commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
399812ede24478019058b0df541ab702113dd2b1
add OrientationOnly ControllerState, update comments
vladkol/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,vladkol/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,vladkol/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,StephenHodgson/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,DDReaper/MixedRealityToolkit-Unity
Assets/MixedRealityToolkit/_Core/Definitions/Devices/ControllerState.cs
Assets/MixedRealityToolkit/_Core/Definitions/Devices/ControllerState.cs
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. namespace Microsoft.MixedReality.Toolkit.Internal.Definitions.Devices { /// <summary> /// The Controller State defines how a controller or headset is currently being tracked. /// This enables developers to be able to handle non-tracked situations and react accordingly /// </summary> public enum ControllerState { /// <summary> /// No controller state provided by the SDK. /// </summary> None = 0, /// <summary> /// The controller is currently fully tracked and has accurate positioning. /// </summary> Tracked, /// <summary> /// The controller is currently not tracked. /// </summary> NotTracked, /// <summary> /// The controller is currently only returning orientation data. /// </summary> OrientationOnly, /// <summary> /// Reserved, for systems that provide alternate tracking. /// </summary> Other } }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. namespace Microsoft.MixedReality.Toolkit.Internal.Definitions.Devices { /// <summary> /// The Controller State defines whether a controller or headset is currently being tracker or not. /// This enables developers to be able to handle non-tracked situations and react accordingly /// </summary> public enum ControllerState { /// <summary> /// No controller state provided by the SDK. /// </summary> None = 0, /// <summary> /// The controller is currently fully tracked and has accurate positioning. /// </summary> Tracked, /// <summary> /// The controller is currently not visually tracked and has relative positioning. /// </summary> NotTracked, /// <summary> /// Reserved, for systems that provide alternate tracking. /// </summary> Other } }
mit
C#
6c723d3788fe0420e6a09607031068928c96de91
Test launching 10 listeners in CI
InEngine-NET/InEngine.NET,InEngine-NET/InEngine.NET,InEngine-NET/InEngine.NET
IntegrationEngine.Tests/JobProcessor/MessageQueueListenerManagerTest.cs
IntegrationEngine.Tests/JobProcessor/MessageQueueListenerManagerTest.cs
using BeekmanLabs.UnitTesting; using IntegrationEngine.JobProcessor; using NUnit.Framework; using Moq; using System; using System.Threading; namespace IntegrationEngine.Tests.JobProcessor { public class MessageQueueListenerManagerTest : TestBase<MessageQueueListenerManager> { public Mock<MessageQueueListenerFactory> MockMessageQueueListenerFactory { get; set; } [SetUp] public void Setup() { MockMessageQueueListenerFactory = new Mock<MessageQueueListenerFactory>(); MockMessageQueueListenerFactory.Setup(x => x.CreateRabbitMQListener()) .Returns<IMessageQueueListener>(null); Subject.MessageQueueListenerFactory = MockMessageQueueListenerFactory.Object; } [Test] public void ShouldStartListener() { Subject.ListenerTaskCount = 1; Subject.StartListener(); MockMessageQueueListenerFactory.Verify(x => x.CreateRabbitMQListener(), Times.Once); } [Test] public void ShouldStartMultipleListeners() { var listenerTaskCount = 10; Subject.ListenerTaskCount = listenerTaskCount; Subject.StartListener(); MockMessageQueueListenerFactory.Verify(x => x.CreateRabbitMQListener(), Times.Exactly(listenerTaskCount)); } [Test] public void ShouldSetCancellationTokenOnDispose() { Subject.CancellationTokenSource = new CancellationTokenSource(); Subject.Dispose(); Assert.That(Subject.CancellationTokenSource.IsCancellationRequested, Is.True); } } }
using BeekmanLabs.UnitTesting; using IntegrationEngine.JobProcessor; using NUnit.Framework; using Moq; using System; using System.Threading; namespace IntegrationEngine.Tests.JobProcessor { public class MessageQueueListenerManagerTest : TestBase<MessageQueueListenerManager> { public Mock<MessageQueueListenerFactory> MockMessageQueueListenerFactory { get; set; } [SetUp] public void Setup() { MockMessageQueueListenerFactory = new Mock<MessageQueueListenerFactory>(); MockMessageQueueListenerFactory.Setup(x => x.CreateRabbitMQListener()) .Returns<IMessageQueueListener>(null); Subject.MessageQueueListenerFactory = MockMessageQueueListenerFactory.Object; } [Test] public void ShouldStartListener() { Subject.ListenerTaskCount = 1; Subject.StartListener(); MockMessageQueueListenerFactory.Verify(x => x.CreateRabbitMQListener(), Times.Once); } [Test] public void ShouldStartMultipleListeners() { var listenerTaskCount = 3; Subject.ListenerTaskCount = listenerTaskCount; Subject.StartListener(); MockMessageQueueListenerFactory.Verify(x => x.CreateRabbitMQListener(), Times.Exactly(listenerTaskCount)); } [Test] public void ShouldSetCancellationTokenOnDispose() { Subject.CancellationTokenSource = new CancellationTokenSource(); Subject.Dispose(); Assert.That(Subject.CancellationTokenSource.IsCancellationRequested, Is.True); } } }
mit
C#
fdf7189ab90abd138a1b2e629a0f807f60fc0ca2
Add get best id method for season images.
henrikfroehling/TraktApiSharp
Source/Lib/TraktApiSharp/Objects/Get/Shows/Seasons/TraktSeasonImages.cs
Source/Lib/TraktApiSharp/Objects/Get/Shows/Seasons/TraktSeasonImages.cs
namespace TraktApiSharp.Objects.Get.Shows.Seasons { using Basic; using Newtonsoft.Json; /// <summary>A collection of images and image sets for a Trakt season.</summary> public class TraktSeasonImages { /// <summary>Gets or sets the screenshot image set.</summary> [JsonProperty(PropertyName = "poster")] public TraktImageSet Poster { get; set; } /// <summary>Gets or sets the thumb image.</summary> [JsonProperty(PropertyName = "thumb")] public TraktImage Thumb { get; set; } } }
namespace TraktApiSharp.Objects.Get.Shows.Seasons { using Basic; using Newtonsoft.Json; /// <summary> /// A collection of images for a Trakt season. /// </summary> public class TraktSeasonImages { /// <summary> /// A poster image set for various sizes. /// </summary> [JsonProperty(PropertyName = "poster")] public TraktImageSet Poster { get; set; } /// <summary> /// A thumbnail image. /// </summary> [JsonProperty(PropertyName = "thumb")] public TraktImage Thumb { get; set; } } }
mit
C#
3da0e277eccc7ea96069962a60ef39f4ccaa0fa0
Update ExchangeRateRepository.cs
tiksn/TIKSN-Framework
TIKSN.Core/Finance/ForeignExchange/Data/Mongo/ExchangeRateRepository.cs
TIKSN.Core/Finance/ForeignExchange/Data/Mongo/ExchangeRateRepository.cs
using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using MongoDB.Driver; using TIKSN.Data.Mongo; namespace TIKSN.Finance.ForeignExchange.Data.Mongo { public class ExchangeRateRepository : MongoRepository<ExchangeRateEntity, Guid>, IExchangeRateRepository { public ExchangeRateRepository( IMongoClientSessionProvider mongoClientSessionProvider, IMongoDatabaseProvider mongoDatabaseProvider) : base( mongoClientSessionProvider, mongoDatabaseProvider, "ExchangeRates") { } public Task<IReadOnlyCollection<ExchangeRateEntity>> SearchAsync( Guid foreignExchangeID, string baseCurrencyCode, string counterCurrencyCode, DateTimeOffset dateFrom, DateTimeOffset dateTo, CancellationToken cancellationToken) { var filter = Builders<ExchangeRateEntity>.Filter.And( Builders<ExchangeRateEntity>.Filter.Eq(item => item.ForeignExchangeID, foreignExchangeID), Builders<ExchangeRateEntity>.Filter.Eq(item => item.BaseCurrencyCode, baseCurrencyCode), Builders<ExchangeRateEntity>.Filter.Eq(item => item.CounterCurrencyCode, counterCurrencyCode), Builders<ExchangeRateEntity>.Filter.Gte(item => item.AsOn, dateFrom), Builders<ExchangeRateEntity>.Filter.Lte(item => item.AsOn, dateTo)); return base.SearchAsync(filter, cancellationToken); } } }
using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using MongoDB.Driver; using TIKSN.Data.Mongo; namespace TIKSN.Finance.ForeignExchange.Data.Mongo { public class ExchangeRateRepository : MongoRepository<ExchangeRateEntity, Guid>, IExchangeRateRepository { public ExchangeRateRepository( IMongoClientSessionProvider mongoClientSessionProvider, IMongoDatabaseProvider mongoDatabaseProvider) : base( mongoClientSessionProvider, mongoDatabaseProvider, "ExchangeRates") { } public Task<ExchangeRateEntity> GetOrDefaultAsync( Guid foreignExchangeID, string baseCurrencyCode, string counterCurrencyCode, DateTimeOffset asOn, CancellationToken cancellationToken) { var filter = Builders<ExchangeRateEntity>.Filter.And( Builders<ExchangeRateEntity>.Filter.Eq(item => item.ForeignExchangeID, foreignExchangeID), Builders<ExchangeRateEntity>.Filter.Eq(item => item.BaseCurrencyCode, baseCurrencyCode), Builders<ExchangeRateEntity>.Filter.Eq(item => item.CounterCurrencyCode, counterCurrencyCode), Builders<ExchangeRateEntity>.Filter.Eq(item => item.AsOn, asOn)); return base.SingleOrDefaultAsync(filter, cancellationToken); } public Task<IReadOnlyCollection<ExchangeRateEntity>> SearchAsync( Guid foreignExchangeID, string baseCurrencyCode, string counterCurrencyCode, DateTimeOffset dateFrom, DateTimeOffset dateTo, CancellationToken cancellationToken) { var filter = Builders<ExchangeRateEntity>.Filter.And( Builders<ExchangeRateEntity>.Filter.Eq(item => item.ForeignExchangeID, foreignExchangeID), Builders<ExchangeRateEntity>.Filter.Eq(item => item.BaseCurrencyCode, baseCurrencyCode), Builders<ExchangeRateEntity>.Filter.Eq(item => item.CounterCurrencyCode, counterCurrencyCode), Builders<ExchangeRateEntity>.Filter.Gte(item => item.AsOn, dateFrom), Builders<ExchangeRateEntity>.Filter.Lte(item => item.AsOn, dateTo)); return base.SearchAsync(filter, cancellationToken); } } }
mit
C#
b8e354eac15733598353242318ec15328421fcb4
fix the logic of application stopping
thinking-home/system,thinking-home/system,thinking-home/system
ThinkingHome.Console/Program.cs
ThinkingHome.Console/Program.cs
using System; using System.Linq; using System.Reflection; using System.Runtime.Loader; using System.Threading; using ThinkingHome.Core.Infrastructure; namespace ThinkingHome.Console { internal class Program { public static void Main(string[] args) { // init and start var config = new HomeConfiguration(); var app = new HomeApplication(); app.StartServices(config); // finalize void Shutdown() { System.Console.WriteLine("\nApplication is shutting down..."); app.StopServices(); System.Console.WriteLine("Done"); } AssemblyLoadContext.Default.Unloading += context => { Shutdown(); }; System.Console.CancelKeyPress += (sender, eventArgs) => { Shutdown(); }; // wait System.Console.WriteLine("Service is available. Press Ctrl+C to exit."); var done = new AutoResetEvent(false); done.WaitOne(); } } }
using System; using System.Linq; using System.Reflection; using System.Runtime.Loader; using System.Threading; using ThinkingHome.Core.Infrastructure; namespace ThinkingHome.Console { internal class Program { public static void Main(string[] args) { // init and start var config = new HomeConfiguration(); var app = new HomeApplication(); app.StartServices(config); // finalize Action shutdown = () => { System.Console.WriteLine("Application is shutting down..."); app.StopServices(); System.Console.WriteLine("Done"); }; AssemblyLoadContext.Default.Unloading += context => { shutdown(); }; System.Console.CancelKeyPress += (sender, eventArgs) => { shutdown(); }; // wait if (args.Any(value => value == "-enter")) { System.Console.WriteLine("Service is available. Press ENTER to exit."); System.Console.ReadLine(); } else { System.Console.WriteLine("Service is available. Press Ctrl+C to exit."); var done = new AutoResetEvent(false); done.WaitOne(); } } } }
mit
C#
27ba2197843de4e6dc5b55ccd3f6d45f5ecdff99
reorder modal
geffzhang/Opserver,VictoriaD/Opserver,rducom/Opserver,GABeech/Opserver,jeddytier4/Opserver,manesiotise/Opserver,rducom/Opserver,opserver/Opserver,VictoriaD/Opserver,geffzhang/Opserver,opserver/Opserver,manesiotise/Opserver,opserver/Opserver,mqbk/Opserver,mqbk/Opserver,GABeech/Opserver,jeddytier4/Opserver,manesiotise/Opserver
Opserver/Views/SQL/Databases.Modal.cshtml
Opserver/Views/SQL/Databases.Modal.cshtml
@using StackExchange.Opserver.Data.SQL @using StackExchange.Opserver.Views.SQL @model DatabasesModel @{ var db = Model.Database; } <h4 class="modal-title"> Database details for @db </h4> @helper RenderLink(DatabasesModel.Views view, string text, bool disabled = false) { if (disabled) { <a href="javascript:void(0)" class="text-muted disabled">@text</a> } else { <a href="#/db/@Model.Database/@view.ToString().ToLower()" class="@(view == Model.View ? "active" : "")">@text</a> } } <div class="row"> <div class="navbar-left col-md-2"> @RenderLink(DatabasesModel.Views.Tables, "Tables") @RenderLink(DatabasesModel.Views.Views, "Views") @RenderLink(DatabasesModel.Views.StoredProcedures, "Stored Procs") @RenderLink(DatabasesModel.Views.Backups, "Backups") @RenderLink(DatabasesModel.Views.Restores, "Restores") @RenderLink(DatabasesModel.Views.Storage, "Storage") @RenderLink(DatabasesModel.Views.MissingIndexes, "Missing Indexes", Model.Instance.Version < Singleton<SQLInstance.MissingIndex>.Instance.MinVersion) @RenderLink(DatabasesModel.Views.UnusedIndexes, "Unused Indexes", true) @RenderLink(DatabasesModel.Views.BlitzIndex, "Blitz Index", true) </div> <div class="col-md-10 js-database-modal-right"> @RenderBody() </div> </div>
@using StackExchange.Opserver.Data.SQL @using StackExchange.Opserver.Views.SQL @model DatabasesModel @{ var db = Model.Database; } <h4 class="modal-title"> Database details for @db </h4> @helper RenderLink(DatabasesModel.Views view, string text, bool disabled = false) { if (disabled) { <a href="javascript:void(0)" class="text-muted disabled">@text</a> } else { <a href="#/db/@Model.Database/@view.ToString().ToLower()" class="@(view == Model.View ? "active" : "")">@text</a> } } <div class="row"> <div class="navbar-left col-md-2"> @RenderLink(DatabasesModel.Views.Tables, "Tables") @RenderLink(DatabasesModel.Views.Backups, "Backups") @RenderLink(DatabasesModel.Views.Restores, "Restores") @RenderLink(DatabasesModel.Views.Views, "Views") @RenderLink(DatabasesModel.Views.StoredProcedures, "Stored Procedures") @RenderLink(DatabasesModel.Views.Storage, "Storage") @RenderLink(DatabasesModel.Views.MissingIndexes, "Missing Indexes", Model.Instance.Version < Singleton<SQLInstance.MissingIndex>.Instance.MinVersion) @RenderLink(DatabasesModel.Views.UnusedIndexes, "Unused Indexes", true) @RenderLink(DatabasesModel.Views.BlitzIndex, "Blitz Index", true) </div> <div class="col-md-10 js-database-modal-right"> @RenderBody() </div> </div>
mit
C#
ebb84ce0ca1e4d43c9891339988e9e6a13d47975
Remove Hakyll reference.
ForNeVeR/fornever.me,ForNeVeR/fornever.me,ForNeVeR/fornever.me
ForneverMind/views/_Layout.cshtml
ForneverMind/views/_Layout.cshtml
@using RazorEngine.Templating @inherits TemplateBase <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>F. von Never — @ViewBag.Title</title> <base href="@System.Configuration.ConfigurationManager.AppSettings["BaseUrl"]"/> <link rel="alternate" type="application/rss+xml" href="./rss.xml" title="RSS Feed"/> <link rel="stylesheet" type="text/css" href="./css/main.css"/> </head> <body> <div id="header"> <div id="logo"> <a href="./">Инженер, программист, джентльмен</a> </div> <div id="navigation"> <a href="./archive.html">Посты</a> <a href="./contact.html">Контакты</a> <a href="./plans/index.html">Планы</a> </div> </div> <div id="content"> <h1>@ViewBag.Title</h1> @RenderBody() </div> <footer> <div> <a class="tag" href="./rss.xml">RSS</a> <a class="tag" href="https://github.com/ForNeVeR/fornever.me">GitHub</a> </div> <div> Сайт использует библиотеку <a href="http://docs.freya.io/en/latest/">Freya</a> </div> </footer> @RenderSection("scripts", false) </body> </html>
@using RazorEngine.Templating @inherits TemplateBase <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>F. von Never — @ViewBag.Title</title> <base href="@System.Configuration.ConfigurationManager.AppSettings["BaseUrl"]"/> <link rel="alternate" type="application/rss+xml" href="./rss.xml" title="RSS Feed"/> <link rel="stylesheet" type="text/css" href="./css/main.css"/> </head> <body> <div id="header"> <div id="logo"> <a href="./">Инженер, программист, джентльмен</a> </div> <div id="navigation"> <a href="./archive.html">Посты</a> <a href="./contact.html">Контакты</a> <a href="./plans/index.html">Планы</a> </div> </div> <div id="content"> <h1>@ViewBag.Title</h1> @RenderBody() </div> <footer> <div> <a class="tag" href="./rss.xml">RSS</a> <a class="tag" href="https://github.com/ForNeVeR/fornever.me">GitHub</a> </div> <div> Сайт сгенерирован при помощи <a href="http://jaspervdj.be/hakyll">Hakyll</a> </div> </footer> @RenderSection("scripts", false) </body> </html>
mit
C#
c3c881149049c58982e282269ecd6cbcc0314b33
Fix test data path when building in Unity plugin
JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity
resharper/resharper-yaml/test/src/TestEnvironment.cs
resharper/resharper-yaml/test/src/TestEnvironment.cs
using JetBrains.Application.BuildScript.Application.Zones; using JetBrains.ReSharper.TestFramework; using JetBrains.TestFramework; using JetBrains.TestFramework.Application.Zones; using NUnit.Framework; [assembly: RequiresSTA] // This attribute is marked obsolete but is still supported. Use is discouraged in preference to convention, but the // convention doesn't work for us. That convention is to walk up the tree from the executing assembly and look for a // relative path called "test/data". This doesn't work because our common "build" folder is one level above our // "test/data" folder, so it doesn't get found. We want to keep the common "build" folder, but allow multiple "modules" // with separate "test/data" folders. E.g. "resharper-unity" and "resharper-yaml" // TODO: This makes things work when building as part of the Unity project, but breaks standalone // Maybe it should be using product/subplatform markers? #pragma warning disable 618 [assembly: TestDataPathBase("resharper-yaml/test/data")] #pragma warning restore 618 namespace JetBrains.ReSharper.Plugins.Yaml.Tests { [ZoneDefinition] public interface IYamlTestZone : ITestsEnvZone, IRequire<PsiFeatureTestZone> { } [SetUpFixture] public class TestEnvironment : ExtensionTestEnvironmentAssembly<IYamlTestZone> { } }
using JetBrains.Application.BuildScript.Application.Zones; using JetBrains.ReSharper.TestFramework; using JetBrains.TestFramework; using JetBrains.TestFramework.Application.Zones; using NUnit.Framework; [assembly: RequiresSTA] namespace JetBrains.ReSharper.Plugins.Yaml.Tests { [ZoneDefinition] public interface IYamlTestZone : ITestsEnvZone, IRequire<PsiFeatureTestZone> { } [SetUpFixture] public class TestEnvironment : ExtensionTestEnvironmentAssembly<IYamlTestZone> { } }
apache-2.0
C#
3e93dd543d0ce3827ac9bf069824bee617cfb464
Test construction is internal.
fixie/fixie
src/Fixie/Test.cs
src/Fixie/Test.cs
namespace Fixie { using System.Reflection; public class Test { public string Class { get; } public string Method { get; } public string Name { get; } internal Test(MethodInfo method) { Class = method.ReflectedType!.FullName!; Method = method.Name; Name = Class + "." + Method; } internal Test(string @class, string method) { Class = @class; Method = method; Name = Class + "." + Method; } internal Test(string name) { var indexOfMemberSeparator = name.LastIndexOf("."); var className = name.Substring(0, indexOfMemberSeparator); var methodName = name.Substring(indexOfMemberSeparator + 1); Class = className; Method = methodName; Name = name; } } }
namespace Fixie { using System.Reflection; public class Test { public string Class { get; } public string Method { get; } public string Name { get; } public Test(MethodInfo method) { Class = method.ReflectedType!.FullName!; Method = method.Name; Name = Class + "." + Method; } public Test(string @class, string method) { Class = @class; Method = method; Name = Class + "." + Method; } public Test(string name) { var indexOfMemberSeparator = name.LastIndexOf("."); var className = name.Substring(0, indexOfMemberSeparator); var methodName = name.Substring(indexOfMemberSeparator + 1); Class = className; Method = methodName; Name = name; } } }
mit
C#
583a86ec3ebe014033bc2f5f2dac073d4e5b8d5f
Fix typo.
urasandesu/Enkidu
Urasandesu.Enkidu/Resources.cs
Urasandesu.Enkidu/Resources.cs
/* * File: Resources.cs * * Author: Akira Sugiura ([email protected]) * * * Copyright (c) 2017 Akira Sugiura * * This software is MIT License. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ using System.Globalization; using System.Resources; namespace Urasandesu.Enkidu { class Resources { static ResourceManager ms_resourceManager; public Resources() { } public static ResourceManager ResourceManager { get { if (ReferenceEquals(ms_resourceManager, null)) ms_resourceManager = new ResourceManager("Urasandesu.Enkidu.Resources", typeof(Resources).Assembly); return ms_resourceManager; } } public static CultureInfo Culture { get; set; } public static string GetString(string name) { return ResourceManager.GetString(name, Culture); } } }
/* * File: Synchronizable.cs * * Author: Akira Sugiura ([email protected]) * * * Copyright (c) 2017 Akira Sugiura * * This software is MIT License. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ using System.Globalization; using System.Resources; namespace Urasandesu.Enkidu { class Resources { static ResourceManager m_resourceManager; public Resources() { } public static ResourceManager ResourceManager { get { if (ReferenceEquals(m_resourceManager, null)) m_resourceManager = new ResourceManager("Urasandesu.Enkidu.Resources", typeof(Resources).Assembly); return m_resourceManager; } } public static CultureInfo Culture { get; set; } public static string GetString(string name) { return ResourceManager.GetString(name, Culture); } } }
mit
C#
b6ca01b1a3c11b759ac3dff739baf720682984c4
Fix resolver URI
ajlopez/Aktores
Samples/WebCrawler/WebCrawler/Resolver.cs
Samples/WebCrawler/WebCrawler/Resolver.cs
namespace WebCrawler { using System; using System.Collections.Generic; using System.Globalization; using Aktores.Core; public class Resolver : Actor { private List<Uri> downloadedAddresses; private string host; public Resolver() { this.downloadedAddresses = new List<Uri>(); } public ActorRef Downloader { get; set; } public void Process(string url) { Console.WriteLine("[Resolver] processing " + url); Uri target; try { target = new Uri(url); } catch (Exception ex) { Console.WriteLine( string.Format(CultureInfo.InvariantCulture, "URL rejected {0}: not an URI", url)); return; } if ((target.Scheme != Uri.UriSchemeHttp) && (target.Scheme != Uri.UriSchemeHttps)) { Console.WriteLine( string.Format(CultureInfo.InvariantCulture, "URL rejected {0}: unsupported protocol", url)); return; } if (this.host == null) this.host = target.Host; else if (this.host != target.Host) { Console.WriteLine( string.Format(CultureInfo.InvariantCulture, "URL rejected {0}: external host", url)); return; } if (this.downloadedAddresses.Contains(target)) return; this.downloadedAddresses.Add(target); this.Downloader.Tell(url); } public override void Receive(object message) { this.Process((string)message); } } }
namespace WebCrawler { using System; using System.Collections.Generic; using System.Globalization; using Aktores.Core; public class Resolver : Actor { private List<Uri> downloadedAddresses; public Resolver() { this.downloadedAddresses = new List<Uri>(); } public ActorRef Downloader { get; set; } public void Process(string url) { Console.WriteLine("[Resolver] processing " + url); Uri target = new Uri(url); if ((target.Scheme != Uri.UriSchemeHttp) && (target.Scheme != Uri.UriSchemeHttps)) { Console.WriteLine( string.Format(CultureInfo.InvariantCulture, "URL rejected {0}: unsupported protocol", url)); return; } if (this.downloadedAddresses.Contains(target)) return; this.downloadedAddresses.Add(target); this.Downloader.Tell(url); } public override void Receive(object message) { this.Process((string)message); } } }
mit
C#
20301be25ca45cc67496715ef1dd0d6423e1323a
Fix ListView item styling on Android
warappa/XamlCSS
XamlCSS.XamarinForms/VisualTreeCell.cs
XamlCSS.XamarinForms/VisualTreeCell.cs
using System; using Xamarin.Forms; using XamlCSS.Windows.Media; namespace XamlCSS.XamarinForms { public static class VisualTreeCell { public static readonly BindableProperty IncludeProperty = BindableProperty.CreateAttached( "Include", typeof(bool), typeof(VisualTreeCell), false, propertyChanged: OnIncludeChanged); public static bool GetInclude(BindableObject view) { return (bool)view.GetValue(IncludeProperty); } public static void SetInclude(BindableObject view, bool value) { view.SetValue(IncludeProperty, value); } static void OnIncludeChanged(BindableObject view, object oldValue, object newValue) { var entry = view as Cell; if (entry == null) { return; } bool register = (bool)newValue; if (register) { entry.Appearing += Entry_Appearing; entry.Disappearing += Entry_Disappearing; entry.PropertyChanged += Entry_PropertyChanged; } else { entry.Appearing -= Entry_Appearing; entry.Disappearing -= Entry_Disappearing; entry.PropertyChanged -= Entry_PropertyChanged; } } private static void Entry_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "Parent") { var s = sender as Element; if (s.Parent != null) VisualTreeHelper.Include(sender as Element); else VisualTreeHelper.Exclude(sender as Element); } } private static void Entry_Disappearing(object sender, EventArgs e) { //Debug.WriteLine("Entry_Disappearing"); VisualTreeHelper.Exclude(sender as Element); } private static void Entry_Appearing(object sender, EventArgs e) { VisualTreeHelper.Include(sender as Element); } } }
using System; using Xamarin.Forms; using XamlCSS.Windows.Media; namespace XamlCSS.XamarinForms { public static class VisualTreeCell { public static readonly BindableProperty IncludeProperty = BindableProperty.CreateAttached( "Include", typeof(bool), typeof(VisualTreeCell), false, propertyChanged: OnIncludeChanged); public static bool GetInclude(BindableObject view) { return (bool)view.GetValue(IncludeProperty); } public static void SetInclude(BindableObject view, bool value) { view.SetValue(IncludeProperty, value); } static void OnIncludeChanged(BindableObject view, object oldValue, object newValue) { var entry = view as Cell; if (entry == null) { return; } bool register = (bool)newValue; if (register) { entry.Appearing += Entry_Appearing; entry.Disappearing += Entry_Disappearing; } else { entry.Appearing -= Entry_Appearing; entry.Disappearing -= Entry_Disappearing; } } private static void Entry_Disappearing(object sender, EventArgs e) { VisualTreeHelper.Exclude(sender as Element); } private static void Entry_Appearing(object sender, EventArgs e) { VisualTreeHelper.Include(sender as Element); } } }
mit
C#
bf6a1af030ace41d55967c3005b3fa524d6352ec
remove iOS specific top padding since we're using a nav bar
IrvingtonProgramming/InteractApp,IrvingtonProgramming/InteractApp,IrvingtonProgramming/InteractApp
InteractApp/EventListPage.xaml.cs
InteractApp/EventListPage.xaml.cs
using System; using System.Collections.Generic; using System.Diagnostics; using Xamarin.Forms; namespace InteractApp { public partial class EventListPage : ContentPage { private static readonly string EventDesc = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; public List<Event> SampleList = new List<Event> () { Event.newEvent(0, "http://www.grey-hare.co.uk/wp-content/uploads/2012/09/Event-management.png", "Event0", DateTime.Now, "Fremont, CA", EventDesc, new List<String> (){ "service" }), new Event() }; public EventListPage () { InitializeComponent (); this.Title = "Events"; ToolbarItems.Add(new ToolbarItem { Text = "My Info", Order = ToolbarItemOrder.Primary, }); ToolbarItems.Add(new ToolbarItem { Text = "My Events", Order = ToolbarItemOrder.Primary, }); EventList.ItemsSource = SampleList; EventList.ItemTapped += async (sender, e) => { await DisplayAlert("Tapped", ((Event) e.Item).Name + " row was tapped", "OK"); Debug.WriteLine("Tapped: " + ((Event) e.Item).Name); ((ListView)sender).SelectedItem = null; // de-select the row }; Padding = new Thickness (0,0,0,0); } } }
using System; using System.Collections.Generic; using System.Diagnostics; using Xamarin.Forms; namespace InteractApp { public partial class EventListPage : ContentPage { private static readonly string EventDesc = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; public List<Event> SampleList = new List<Event> () { Event.newEvent(0, "http://www.grey-hare.co.uk/wp-content/uploads/2012/09/Event-management.png", "Event0", DateTime.Now, "Fremont, CA", EventDesc, new List<String> (){ "service" }), new Event() }; public EventListPage () { InitializeComponent (); this.Title = "Events"; ToolbarItems.Add(new ToolbarItem { Text = "My Info", Order = ToolbarItemOrder.Primary, }); ToolbarItems.Add(new ToolbarItem { Text = "My Events", Order = ToolbarItemOrder.Primary, }); EventList.ItemsSource = SampleList; EventList.ItemTapped += async (sender, e) => { await DisplayAlert("Tapped", ((Event) e.Item).Name + " row was tapped", "OK"); Debug.WriteLine("Tapped: " + ((Event) e.Item).Name); ((ListView)sender).SelectedItem = null; // de-select the row }; Padding = new Thickness (0,Device.OnPlatform(20, 0, 0),0,0); } } }
mit
C#
7ec68beaa4825a2a9bcb88c8902d8a46bcba7065
Add download_url and content_type for file upload questions
bcemmett/SurveyMonkeyApi-v3
SurveyMonkey/Containers/ResponseAnswer.cs
SurveyMonkey/Containers/ResponseAnswer.cs
using Newtonsoft.Json; namespace SurveyMonkey.Containers { [JsonConverter(typeof(TolerantJsonConverter))] public class ResponseAnswer { public long? ChoiceId { get; set; } public long? RowId { get; set; } public long? ColId { get; set; } public long? OtherId { get; set; } public string Text { get; set; } public bool? IsCorrect { get; set; } public int? Score { get; set; } public string DownloadUrl { get; set; } public string ContentType { get; set; } public string SimpleText { get; set; } [JsonIgnore] internal object TagData { get; set; } public ChoiceMetadata ChoiceMetadata { get; set; } } }
using Newtonsoft.Json; namespace SurveyMonkey.Containers { [JsonConverter(typeof(TolerantJsonConverter))] public class ResponseAnswer { public long? ChoiceId { get; set; } public long? RowId { get; set; } public long? ColId { get; set; } public long? OtherId { get; set; } public string Text { get; set; } public bool? IsCorrect { get; set; } public int? Score { get; set; } public string SimpleText { get; set; } [JsonIgnore] internal object TagData { get; set; } public ChoiceMetadata ChoiceMetadata { get; set; } } }
mit
C#
1e16776254400ce5c6db206fbfc8777c22642cbc
Use with params from APL
lstefano71/Nowin,lstefano71/Nowin,lstefano71/Nowin
ZipFS/Helpers/Helpers.cs
ZipFS/Helpers/Helpers.cs
using System; using Owin; using Microsoft.Owin; using System.Threading.Tasks; using WildHeart.Owin.Middleware; using Microsoft.Owin.StaticFiles; using System.Collections.Generic; namespace WildHeart.Owin { public static class APLHelper { public static void AddMimeTypes(FileServerOptions opts, string def) { AddMimeTypes(opts, new string[] { def }); } public static void AddMimeTypes(FileServerOptions opts, string[] tdefs) { AddMimeTypes(opts, tdefs as IList<string>); } public static void AddMimeTypes(FileServerOptions opts,IList<string> tdefs) { var ctp = new Microsoft.Owin.StaticFiles.ContentTypes.FileExtensionContentTypeProvider(); foreach (var def in tdefs) { var d = def.Split(';'); ctp.Mappings["." + d[0]] = d[1]; } opts.StaticFileOptions.ContentTypeProvider = ctp; } public static IAppBuilder UseCompression(IAppBuilder app) { app.UseSendFileFallback(); return app.UseStaticCompression(); } public static IAppBuilder UseErrorPage(IAppBuilder app) { return app.UseErrorPage(new Microsoft.Owin.Diagnostics.ErrorPageOptions { SourceCodeLineCount = 20, ShowExceptionDetails = true, ShowCookies = true, ShowEnvironment = true, ShowHeaders = true, ShowQuery = true, ShowSourceCode = true }); } public static IAppBuilder Use(IAppBuilder app, Func<IOwinContext,object[], bool> callback,params object[] args) { return app.Use((ctx, next) => { bool res = callback(ctx,args); if (!res) return next(); return Task.Delay(0); }); } public static IAppBuilder UseFromPool(IAppBuilder app, string pool, string fnname, Func<string, string, IOwinContext, bool> callback) { return app.Use((ctx, next) => { bool res = callback(pool, fnname, ctx); if (!res) return next(); return Task.Delay(0); }); } } }
using System; using Owin; using Microsoft.Owin; using System.Threading.Tasks; using WildHeart.Owin.Middleware; using Microsoft.Owin.StaticFiles; using System.Collections.Generic; namespace WildHeart.Owin { public static class APLHelper { public static void AddMimeTypes(FileServerOptions opts, string def) { AddMimeTypes(opts, new string[] { def }); } public static void AddMimeTypes(FileServerOptions opts, string[] tdefs) { AddMimeTypes(opts, tdefs as IList<string>); } public static void AddMimeTypes(FileServerOptions opts,IList<string> tdefs) { var ctp = new Microsoft.Owin.StaticFiles.ContentTypes.FileExtensionContentTypeProvider(); foreach (var def in tdefs) { var d = def.Split(';'); ctp.Mappings["." + d[0]] = d[1]; } opts.StaticFileOptions.ContentTypeProvider = ctp; } public static IAppBuilder UseCompression(IAppBuilder app) { app.UseSendFileFallback(); return app.UseStaticCompression(); } public static IAppBuilder UseErrorPage(IAppBuilder app) { return app.UseErrorPage(new Microsoft.Owin.Diagnostics.ErrorPageOptions { SourceCodeLineCount = 20, ShowExceptionDetails = true, ShowCookies = true, ShowEnvironment = true, ShowHeaders = true, ShowQuery = true, ShowSourceCode = true }); } public static IAppBuilder Use(IAppBuilder app, Func<IOwinContext,bool> callback) { //app.Use<HeaderMiddleware>("X-UA-Compatible", "IE=Edge"); return app.Use((ctx, next) => { bool res = callback(ctx); if (!res) return next(); return Task.Delay(0); }); } } }
mit
C#
a9714d97260ba306e7821a9bcbcc66df1436b80c
Fix code formatting in ToxVersion.
uruk/SharpTox,Impyy/SharpTox
SharpTox/Core/ToxVersion.cs
SharpTox/Core/ToxVersion.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SharpTox.Core { public class ToxVersion { public int Major { get; private set; } public int Minor { get; private set; } public int Patch { get; private set; } public static ToxVersion Current { get { return new ToxVersion( (int)ToxFunctions.VersionMajor(), (int)ToxFunctions.VersionMinor(), (int)ToxFunctions.VersionPatch()); } } public bool IsCompatible() { return ToxFunctions.VersionIsCompatible((uint)Major, (uint)Minor, (uint)Patch); } public ToxVersion(int major, int minor, int patch) { Major = major; Minor = minor; Patch = patch; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SharpTox.Core { public class ToxVersion { public int Major { get; private set; } public int Minor { get; private set; } public int Patch { get; private set; } public static ToxVersion Current { get { return new ToxVersion( (int)ToxFunctions.VersionMajor(), (int)ToxFunctions.VersionMinor(), (int)ToxFunctions.VersionPatch()); } } public bool IsCompatible() { return ToxFunctions.VersionIsCompatible((uint)Major, (uint)Minor, (uint)Patch); } public ToxVersion(int major, int minor, int patch) { Major = major; Minor = minor; Patch = patch; } } }
mit
C#
fc81e477a3bf7daf7e9f158812e6b7e5e5c70055
increase version
jittuu/RGeoIP
RGeoIP/Properties/AssemblyInfo.cs
RGeoIP/Properties/AssemblyInfo.cs
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("RGeoIP")] [assembly: AssemblyDescription("Store IP Ranges in Redis as sorted sets for fast lookup")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("RGeoIP")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("2361907f-2215-4f65-a7ac-28191ed1ca5f")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")]
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("RGeoIP")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("RGeoIP")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("2361907f-2215-4f65-a7ac-28191ed1ca5f")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
e7f95a214acdb74713c687125e587947113ab2c8
Remove obsolete message from private function
ivandrofly/octokit.net,M-Zuber/octokit.net,TattsGroup/octokit.net,shana/octokit.net,thedillonb/octokit.net,ivandrofly/octokit.net,editor-tools/octokit.net,octokit/octokit.net,khellang/octokit.net,shiftkey/octokit.net,eriawan/octokit.net,TattsGroup/octokit.net,adamralph/octokit.net,SmithAndr/octokit.net,thedillonb/octokit.net,gdziadkiewicz/octokit.net,dampir/octokit.net,SamTheDev/octokit.net,shiftkey/octokit.net,devkhan/octokit.net,editor-tools/octokit.net,alfhenrik/octokit.net,eriawan/octokit.net,shiftkey-tester/octokit.net,chunkychode/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,chunkychode/octokit.net,shiftkey-tester/octokit.net,shana/octokit.net,khellang/octokit.net,dampir/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,M-Zuber/octokit.net,alfhenrik/octokit.net,Sarmad93/octokit.net,Sarmad93/octokit.net,devkhan/octokit.net,gdziadkiewicz/octokit.net,rlugojr/octokit.net,rlugojr/octokit.net,octokit/octokit.net,SmithAndr/octokit.net,SamTheDev/octokit.net
Octokit/Helpers/ModelExtensions.cs
Octokit/Helpers/ModelExtensions.cs
using System; using System.Text.RegularExpressions; namespace Octokit { // TODO: this is only related to SSH keys, we should rename this /// <summary> /// Extensions for working with SSH keys /// </summary> public static class ModelExtensions { #if NETFX_CORE static readonly Regex sshKeyRegex = new Regex(@"ssh-[rd]s[as] (?<data>\S+) ?(?<name>.*)$"); #else static readonly Regex sshKeyRegex = new Regex(@"ssh-[rd]s[as] (?<data>\S+) ?(?<name>.*)$", RegexOptions.Compiled); #endif /// <summary> /// Extract SSH key information from the API response /// </summary> /// <param name="sshKey">Key details received from API</param> [Obsolete("This method will be removed in a future release.")] public static SshKeyInfo GetKeyDataAndName(this SshKey sshKey) { Ensure.ArgumentNotNull(sshKey, "sshKey"); var key = sshKey.Key; if (key == null) return null; var match = sshKeyRegex.Match(key); return (match.Success ? new SshKeyInfo(match.Groups["data"].Value, match.Groups["name"].Value) : null); } /// <summary> /// Compare two SSH keys to see if they are equal /// </summary> /// <param name="key">Reference SSH key</param> /// <param name="otherKey">Key to compare</param> [Obsolete("This method will be removed in a future release.")] public static bool HasSameDataAs(this SshKey key, SshKey otherKey) { Ensure.ArgumentNotNull(key, "key"); if (otherKey == null) return false; var keyData = key.GetKeyData(); return keyData != null && keyData == otherKey.GetKeyData(); } static string GetKeyData(this SshKey key) { var keyInfo = key.GetKeyDataAndName(); return keyInfo == null ? null : keyInfo.Data; } } }
using System; using System.Text.RegularExpressions; namespace Octokit { // TODO: this is only related to SSH keys, we should rename this /// <summary> /// Extensions for working with SSH keys /// </summary> public static class ModelExtensions { #if NETFX_CORE static readonly Regex sshKeyRegex = new Regex(@"ssh-[rd]s[as] (?<data>\S+) ?(?<name>.*)$"); #else static readonly Regex sshKeyRegex = new Regex(@"ssh-[rd]s[as] (?<data>\S+) ?(?<name>.*)$", RegexOptions.Compiled); #endif /// <summary> /// Extract SSH key information from the API response /// </summary> /// <param name="sshKey">Key details received from API</param> [Obsolete("This method will be removed in a future release.")] public static SshKeyInfo GetKeyDataAndName(this SshKey sshKey) { Ensure.ArgumentNotNull(sshKey, "sshKey"); var key = sshKey.Key; if (key == null) return null; var match = sshKeyRegex.Match(key); return (match.Success ? new SshKeyInfo(match.Groups["data"].Value, match.Groups["name"].Value) : null); } /// <summary> /// Compare two SSH keys to see if they are equal /// </summary> /// <param name="key">Reference SSH key</param> /// <param name="otherKey">Key to compare</param> [Obsolete("This method will be removed in a future release.")] public static bool HasSameDataAs(this SshKey key, SshKey otherKey) { Ensure.ArgumentNotNull(key, "key"); if (otherKey == null) return false; var keyData = key.GetKeyData(); return keyData != null && keyData == otherKey.GetKeyData(); } [Obsolete("This method will be removed in a future release.")] static string GetKeyData(this SshKey key) { var keyInfo = key.GetKeyDataAndName(); return keyInfo == null ? null : keyInfo.Data; } } }
mit
C#
633be5ee0b2368ef9ab46be999721d850e1172c2
Add HTTP codes to error responses
bwatts/Totem,bwatts/Totem
Source/Totem.Web/WebApiRequest.cs
Source/Totem.Web/WebApiRequest.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using Nancy; using Totem.IO; using Totem.Runtime.Timeline; namespace Totem.Web { /// <summary> /// An process observing and publishing to the timeline in order to make a web request /// </summary> public abstract class WebApiRequest : Runtime.Timeline.Request { private Response _response; public Response ToResponse() { Expect(_response).IsNotNull("Web API flow has not responded"); return _response; } protected void Respond(Response response) { Expect(_response).IsNull("Web API flow has already responded"); _response = response; ThenDone(); } protected void RespondOK(string reason) { Respond(new Response { StatusCode = HttpStatusCode.OK, ReasonPhrase = reason }); } protected void RespondCreated(string reason) { Respond(new Response { StatusCode = HttpStatusCode.Created, ReasonPhrase = reason }); } protected void RespondError(string reason) { Respond(new Response { StatusCode = HttpStatusCode.InternalServerError, ReasonPhrase = reason }); } protected void RespondError(string reason, string error) { Log.Error("[web] 500 Internal server error: {Reason:l} {Error}", reason, error); Respond(new Response { StatusCode = HttpStatusCode.InternalServerError, ReasonPhrase = reason, ContentType = MediaType.Plain.ToTextUtf8(), Contents = body => { using(var writer = new StreamWriter(body)) { writer.Write(error); } } }); } protected void RespondUnprocessableEntity(string reasonPhrase) { Log.Error("[web] 422 Unprocessable entity: {Reason:l}", reasonPhrase); Respond(new Response { StatusCode = HttpStatusCode.UnprocessableEntity, ReasonPhrase = reasonPhrase }); } void When(FlowStopped e) { RespondError("[web] Flow stopped: " + Text.Of(e.Type), e.Error); } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using Nancy; using Totem.IO; using Totem.Runtime.Timeline; namespace Totem.Web { /// <summary> /// An process observing and publishing to the timeline in order to make a web request /// </summary> public abstract class WebApiRequest : Runtime.Timeline.Request { private Response _response; public Response ToResponse() { Expect(_response).IsNotNull("Web API flow has not responded"); return _response; } protected void Respond(Response response) { Expect(_response).IsNull("Web API flow has already responded"); _response = response; ThenDone(); } protected void RespondOK(string reason) { Respond(new Response { StatusCode = HttpStatusCode.OK, ReasonPhrase = reason }); } protected void RespondCreated(string reason) { Respond(new Response { StatusCode = HttpStatusCode.Created, ReasonPhrase = reason }); } protected void RespondError(string reason) { Respond(new Response { StatusCode = HttpStatusCode.InternalServerError, ReasonPhrase = reason }); } protected void RespondError(string reason, string error) { Log.Error("[web] Internal server error: {Reason:l} {Error}", reason, error); Respond(new Response { StatusCode = HttpStatusCode.InternalServerError, ReasonPhrase = reason, ContentType = MediaType.Plain.ToTextUtf8(), Contents = body => { using(var writer = new StreamWriter(body)) { writer.Write(error); } } }); } protected void RespondUnprocessableEntity(string reasonPhrase) { Log.Error("[web] Unprocessable entity: {Reason:l}", reasonPhrase); Respond(new Response { StatusCode = HttpStatusCode.UnprocessableEntity, ReasonPhrase = reasonPhrase }); } void When(FlowStopped e) { RespondError("[web] Flow stopped: " + Text.Of(e.Type), e.Error); } } }
mit
C#
d05a136b937fd3874c3148d9eaa48667571a8c73
fix $flatten behavior
Soluto/tweek,Soluto/tweek,Soluto/tweek,Soluto/tweek,Soluto/tweek,Soluto/tweek
Tweek.ApiService/ServingModule.cs
Tweek.ApiService/ServingModule.cs
using System; using System.Collections.Generic; using System.Linq; using Engine; using Engine.Core.Context; using Engine.DataTypes; using LanguageExt; using Nancy; using Newtonsoft.Json; namespace Tweek.ApiService { public class ServingModule : NancyModule { public static Tuple<IReadOnlyDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>> PartitionByKey<TKey, TValue>(IDictionary<TKey,TValue> source, Predicate<TKey> predicate) { IReadOnlyDictionary<bool, IReadOnlyDictionary<TKey,TValue>> dict = source.GroupBy(x => predicate(x.Key)) .ToDictionary(p => p.Key, p => (IReadOnlyDictionary<TKey,TValue>)p.ToDictionary(x=>x.Key, x=>x.Value)); return Tuple.Create(dict.TryGetValue(true).IfNone(new Dictionary<TKey, TValue>()), dict.TryGetValue(false).IfNone(new Dictionary<TKey, TValue>())); } private static readonly string PREFIX = "/configurations"; public ServingModule(ITweek tweek) : base(PREFIX) { Get["{query*}", runAsync:true] = async (@params, ct) => { var allParams = PartitionByKey(((DynamicDictionary) Request.Query).ToDictionary(), x => x.StartsWith("$")); var modifiers = allParams.Item1; var isFlatten = modifiers.TryGetValue("$flatten").Select(x=>bool.Parse(x.ToString())).IfNone(false); IReadOnlyDictionary<string, string> contextParams = allParams.Item2.ToDictionary(x=>x.Key, x=>x.Value.ToString()); var identities = new HashSet<Identity>(contextParams.Where(x => !x.Key.Contains(".")).Select(x=>new Identity(x.Key, x.Value))); GetLoadedContextByIdentityType contextProps = identityType => key => contextParams.TryGetValue($"{identityType}.{key}"); var query = ConfigurationPath.New(((string) @params.query)); var data = await tweek.Calculate(query, identities, contextProps); return JsonConvert.SerializeObject(!isFlatten ? TreeResult.From(data) : data.ToDictionary(x => x.Key.ToString(), x => x.Value.ToString())); }; } } }
using System.Collections.Generic; using System.Linq; using Engine; using Engine.Core.Context; using Engine.DataTypes; using LanguageExt; using Nancy; using Newtonsoft.Json; namespace Tweek.ApiService { public class ServingModule : NancyModule { private static readonly string PREFIX = "/configurations"; public ServingModule(ITweek tweek) : base(PREFIX) { Get["{query*}", runAsync:true] = async (@params, ct) => { var isFlatten = @params["$flatten"] == true; IReadOnlyDictionary<string,string> requestParams = ((DynamicDictionary) Request.Query).ToDictionary() .ToDictionary(x => x.Key, x => x.Value.ToString()); var identities = new HashSet<Identity>(requestParams.Where(x => !x.Key.Contains(".")).Select(x=>new Identity(x.Key, x.Value))); GetLoadedContextByIdentityType contextProps = identityType => key => requestParams.TryGetValue($"{identityType}.{key}"); var query = ConfigurationPath.New(((string) @params.query)); var data = await tweek.Calculate(query, identities, contextProps); return JsonConvert.SerializeObject(!isFlatten ? TreeResult.From(data) : data.ToDictionary(x => x.Key.ToString(), x => x.Value.ToString())); }; } } }
mit
C#
6d28a5ea0efd604eba3d3bb5ddf7ce6148f419a1
fix typos (#166)
skbkontur/NuGetGallery,KuduApps/NugetGallery16Fx45-DeleteMe,KuduApps/NuGetGallery,KuduApps/NuGetGallery,KuduApps/NugetGallery21Fx45-DeleteMe,KuduApps/NuGetGallery,mtian/SiteExtensionGallery,kudustress/NuGetGallery2,grenade/NuGetGallery_download-count-patch,mtian/SiteExtensionGallery,kudustress/NuGetGalleryOptmized,grenade/NuGetGallery_download-count-patch,KuduApps/NuGetGallery,projectkudu/SiteExtensionGallery,projectkudu/SiteExtensionGallery,JetBrains/ReSharperGallery,projectkudu/SiteExtensionGallery,kudustress/NuGetGallery2,ScottShingler/NuGetGallery,KuduApps/NuGetGallery,JetBrains/ReSharperGallery,ScottShingler/NuGetGallery,kudustress/NuGetGallery,ScottShingler/NuGetGallery,skbkontur/NuGetGallery,grenade/NuGetGallery_download-count-patch,JetBrains/ReSharperGallery,KuduApps/NugetGallery21Fx45-DeleteMe,KuduApps/NugetGallery16Fx45-DeleteMe,kudustress/NuGetGallery,kudustress/NuGetGalleryOptmized,skbkontur/NuGetGallery,mtian/SiteExtensionGallery
Website/Views/Pages/Home.cshtml
Website/Views/Pages/Home.cshtml
@{ ViewBag.Tab = "Home"; } <section class="featured"> <div> <h1>Jump Start Your Projects with NuGet</h1> <p >NuGet is a Visual Studio extension that makes it easy to install and update open source libraries and tools in Visual Studio.</p> <p class="sub"><em>So <a href="http://visualstudiogallery.msdn.microsoft.com/en-us/27077b70-9dad-4c64-adcf-c7cf6bc9970c/file/37502/5/NuGet.Tools.signed.vsix">install NuGet</a> and get a jump on your next project!</em></p> <a class="install" href="http://visualstudiogallery.msdn.microsoft.com/en-us/27077b70-9dad-4c64-adcf-c7cf6bc9970c/fil/37502/5/NuGet.Tools.signed.vsix">Install NuGet</a> </div> <img src="@Url.Content("~/content/images/hero.png")" alt="NuGet GUI Window" /> </section> <section class="release"> <h2>NuGet 1.5 Released</h2> <p>Take 5 minutes and UPGRADE NOW using the Visual Studio Extension Manager. Why? Because there's a pile of new features and it will make your life easier! All these details and <a href="http://docs.nuget.org/docs/release-notes/nuget-1.4">more here...</a></p> </section> <section class="info"> <h3>About</h3> <p>When you use NuGet to install a package, it copies the library files to your solution and automatically updates your project (add references, change config files, etc). If you remove a package, NuGet reverses whatever changes it made so that no clutter is left.</p> <h3>Important Notice</h3> <p>You can develop your own package and share it via the NuGet Gallery. Read the documentation for more details on <a title="Creating and submitting a package" href="http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package">how to create and publish a package</a>. If you don&rsquo;t plan on submitting a package, there&rsquo;s no need to register.</p> </section>
@{ ViewBag.Tab = "Home"; } <section class="featured"> <div> <h1>Jump Start Your Projects with NuGet</h1> <p >NuGet is a Visual Studio extension that makes it easy to install and update open source libraries and tools in Visual Studio.</p> <p class="sub"><em>So <a href="http://visualstudiogallery.msdn.microsoft.com/en-us/27077b70-9dad-4c64-adcf-c7cf6bc9970c/file/37502/5/NuGet.Tools.signed.vsix">install NuGet</a> and get a jump on your next project!</em></p> <a class="install" href="http://visualstudiogallery.msdn.microsoft.com/en-us/27077b70-9dad-4c64-adcf-c7cf6bc9970c/fil/37502/5/NuGet.Tools.signed.vsix">Install NuGet</a> </div> <img src="@Url.Content("~/content/images/hero.png")" alt="NuGet GUI Window" /> </section> <section class="release"> <h2>NuGet 1.5 Released</h2> <p>Take 5 minutes and UPGRADE NOW using the Visual Studio Extension Manager. Why? Because there's a pile of new features and it will make your life easier! All these details and <a href="http://docs.nuget.org/docs/release-notes/nuget-1.4">more here...</a></p> </section> <section class="info"> <h3>About</h3> <p>When you use NuGet to install a package, it copies the library files to your solution and automatically updates your project (add references, change config files, etc). If you remove a package, NuGet reverses whatever changes it made so that no clutter is left.</p> <h3>Important Notice</h3> <p>ou can develop your own package and share it via the NuGet Gallery. Read the documentation for more details on <a title="Creating and submitting a package" href="http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package">how to create and publish a package</a>. If you don&rsquo;t plan on submitting a package, there&rsquo;s no need to register.</p> </section>
apache-2.0
C#
798d21cf3e3c1820d9f5a28da7363a2951d38ad3
update ConversionMethods
bryan2894-playgrnd/SimpleWeather-Xamarin,bryan2894-playgrnd/SimpleWeather-Xamarin
SimpleWeather/ConversionMethods.cs
SimpleWeather/ConversionMethods.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SimpleWeather { public static class ConversionMethods { private const double KM_TO_MI = 0.621371192; private const double MI_TO_KM = 1.609344; public static string mbToInHg(String input) { double result = 29.92 * double.Parse(input) / 1013.25; return Math.Round(result, 2).ToString(); } public static string kmToMi(String input) { double result = KM_TO_MI * double.Parse(input); return Math.Round(result).ToString(); } public static string miToKm(String input) { double result = MI_TO_KM * double.Parse(input); return Math.Round(result).ToString(); } public static string mphTokph(String input) { double result = MI_TO_KM * double.Parse(input); return Math.Round(result).ToString(); } public static string kphTomph(String input) { double result = KM_TO_MI * double.Parse(input); return Math.Round(result).ToString(); } public static string FtoC(String input) { double result = (double.Parse(input) - 32) * ((double)5 / 9); return Math.Round(result).ToString(); } public static string CtoF(string input) { double result = (double.Parse(input) * ((double)9 /5)) + 32; return Math.Round(result).ToString(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SimpleWeather { public static class ConversionMethods { public const double KM_TO_MI = 0.621371192; public const double MI_TO_KM = 1.609344; public static string mbToInHg(String input) { double result = 29.92 * double.Parse(input) / 1013.25; return result.ToString("0.00"); } public static string mbToInHg(double input) { double result = 29.92 * input / 1013.25; return result.ToString("0.00"); } public static string kmToMi(String input) { double result = KM_TO_MI * double.Parse(input); return Math.Round(result, 2).ToString(); } public static string kmToMi(double input) { double result = KM_TO_MI * input; return Math.Round(result, 2).ToString(); } public static string miToKm(String input) { double result = MI_TO_KM * double.Parse(input); return Math.Round(result, 2).ToString(); } public static string miToKm(double input) { double result = MI_TO_KM * input; return Math.Round(result, 2).ToString(); } public static string mphTokph(String input) { double result = MI_TO_KM * double.Parse(input); return Math.Round(result).ToString(); } public static string mphTokph(double input) { double result = MI_TO_KM * input; return Math.Round(result).ToString(); } public static string kphTomph(String input) { double result = KM_TO_MI * double.Parse(input); return Math.Round(result).ToString(); } public static string kphTomph(double input) { double result = KM_TO_MI * input; return Math.Round(result).ToString(); } } }
apache-2.0
C#
3003e86882707638c203140a2edc246d96bd586f
Add company name to assembly.
GetTabster/Tabster
Tabster/Properties/AssemblyInfo.cs
Tabster/Properties/AssemblyInfo.cs
#region using System.Reflection; using System.Runtime.InteropServices; #endregion // 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("Tabster")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Nate Shoffner")] [assembly: AssemblyProduct("Tabster")] [assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("05e93702-6d2b-4e7e-888a-cf5d891f9fb8")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.5.2.0")] [assembly: AssemblyFileVersion("1.5.2.0")]
#region using System.Reflection; using System.Runtime.InteropServices; #endregion // 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("Tabster")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Tabster")] [assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("05e93702-6d2b-4e7e-888a-cf5d891f9fb8")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.5.2.0")] [assembly: AssemblyFileVersion("1.5.2.0")]
apache-2.0
C#
7f8a1a7863c7ae5722637b397fae86e169f7aaa8
Revert "And we have the medium line working!"
pcamp123/GadgtSpot-Windows-Phone-Application
WP8App/Services/WordWrapService.cs
WP8App/Services/WordWrapService.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using WPAppStudio.Services.Interfaces; namespace WPAppStudio.Services { public class WordWrapService { private readonly ITextMeasurementService _tms; public WordWrapService(ITextMeasurementService textMeasurementService) { _tms = textMeasurementService; } public string GetWords(string text, int wordCount) { StringBuilder result = new StringBuilder(); for (int word = 0; word < wordCount; word++) { int space = text.IndexOf(' ', 1); //return text.Substring(0, space); if (space == -1) { result.Append(text); return result.ToString(); } result.Append(text.Substring(0, space)); text = text.Substring(space); } return result.ToString(); } public string GetLine(string text, int lineLength) { string line = GetWords(text, 3); int width = _tms.GetTextWidth(line); if (width <= lineLength) { return line; } return GetWords(text, 1); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using WPAppStudio.Services.Interfaces; namespace WPAppStudio.Services { public class WordWrapService { private readonly ITextMeasurementService _tms; public WordWrapService(ITextMeasurementService textMeasurementService) { _tms = textMeasurementService; } public string GetWords(string text, int wordCount) { StringBuilder result = new StringBuilder(); for (int word = 0; word < wordCount; word++) { int space = text.IndexOf(' ', 1); //return text.Substring(0, space); if (space == -1) { result.Append(text); return result.ToString(); } result.Append(text.Substring(0, space)); text = text.Substring(space); } return result.ToString(); } public string GetLine(string text, int lineLength) { for (int wordCount = 10; wordCount > 0; wordCount--) { string line = GetWords(text, wordCount); int width = _tms.GetTextWidth(line); if (width <= lineLength) { return line; } } return GetWords(text, 1); } } }
mit
C#
0fe4265e26d6b4eba23378be5b4f899d0e89edc1
implement Classifier.Clustering(Raw.RawBlock)
myxini/block-program
block-program/Detection/Classifier.cs
block-program/Detection/Classifier.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Myxini.Recognition { class Classifier : IClassifier { private class Pattern { private Image.IImage pattern; public IBlock Block { get; private set; } public Pattern(Image.IImage pattern, IBlock block) { this.pattern = pattern; Block = block; } public double Match(Image.IImage image) { // ここでパターンマッチング // 仮に値を返す return (new Random()).NextDouble() * 2 - 1; } } private IList<Pattern> patterns = new List<Pattern> { //LED new Pattern( /* なにかパターンの画像 */null, new Block(Command.LED, /* なにかパラメータ */new BlockParameter(), false) ), //Move //Rotate //MicroSwitch //PSD //Start //End }; public IBlock clustering(Raw.IRawBlock raw_block) { // ここでパターンマッチングして最もマッチする Pattern pattern_max_matching = patterns .OrderByDescending(pattern => Math.Abs(pattern.Match(raw_block.BoundingImage))) .First(); return pattern_max_matching.Block; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Myxini.Recognition { class Classifier : IClassifier { private class Pattern { private Image.IImage pattern; IBlock Block { get; private set; } Pattern(Image.IImage pattern, IBlock block) { this.pattern = pattern; Block = block; } double Match(Image.IImage image) { // ここでパターンマッチング // 仮に値を返す return (new Random()).NextDouble() * 2 - 1; } } private IList<Pattern> patterns = new List<Pattern> { //LED //Move //Rotate //MicroSwitch //PSD //Start //End }; public IBlock clustering(Raw.IRawBlock raw_block) { // ここでパターンマッチング throw new NotImplementedException(); } } }
mit
C#
f117ec80c640d9f9ca3abf6685aa24553b3dfe2b
Throw InvalidOperationException when ActiveCharacterRenderer is null in MainCharacterEntityRenderer
ethanmoffat/EndlessClient
EndlessClient/Rendering/MapEntityRenderers/MainCharacterEntityRenderer.cs
EndlessClient/Rendering/MapEntityRenderers/MainCharacterEntityRenderer.cs
// 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 System; using EndlessClient.Rendering.Character; using EndlessClient.Rendering.Map; using EOLib.Domain.Character; using Microsoft.Xna.Framework.Graphics; namespace EndlessClient.Rendering.MapEntityRenderers { public class MainCharacterEntityRenderer : BaseMapEntityRenderer { private readonly ICharacterRendererProvider _characterRendererProvider; public MainCharacterEntityRenderer(ICharacterProvider characterProvider, ICharacterRendererProvider characterRendererProvider, ICharacterRenderOffsetCalculator characterRenderOffsetCalculator) : base(characterProvider, characterRenderOffsetCalculator) { _characterRendererProvider = characterRendererProvider; } public override MapRenderLayer RenderLayer { get { return MapRenderLayer.MainCharacter; } } protected override int RenderDistance { get { return 1; } } protected override bool ElementExistsAt(int row, int col) { return row == _characterProvider.ActiveCharacter.RenderProperties.MapY && col == _characterProvider.ActiveCharacter.RenderProperties.MapX; } public override void RenderElementAt(SpriteBatch spriteBatch, int row, int col, int alpha) { if(_characterRendererProvider.ActiveCharacterRenderer == null) throw new InvalidOperationException("Active character renderer is null! Did you call MapRenderer.Update() before calling MapRenderer.Draw()?"); spriteBatch.End(); //todo: use different blend state if character is hidden spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); _characterRendererProvider.ActiveCharacterRenderer.DrawToSpriteBatch(spriteBatch); spriteBatch.End(); spriteBatch.Begin(); } } }
// 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 EndlessClient.Rendering.Character; using EndlessClient.Rendering.Map; using EOLib.Domain.Character; using Microsoft.Xna.Framework.Graphics; namespace EndlessClient.Rendering.MapEntityRenderers { public class MainCharacterEntityRenderer : BaseMapEntityRenderer { private readonly ICharacterRendererProvider _characterRendererProvider; public MainCharacterEntityRenderer(ICharacterProvider characterProvider, ICharacterRendererProvider characterRendererProvider, ICharacterRenderOffsetCalculator characterRenderOffsetCalculator) : base(characterProvider, characterRenderOffsetCalculator) { _characterRendererProvider = characterRendererProvider; } public override MapRenderLayer RenderLayer { get { return MapRenderLayer.MainCharacter; } } protected override int RenderDistance { get { return 1; } } protected override bool ElementExistsAt(int row, int col) { return row == _characterProvider.ActiveCharacter.RenderProperties.MapY && col == _characterProvider.ActiveCharacter.RenderProperties.MapX; } public override void RenderElementAt(SpriteBatch spriteBatch, int row, int col, int alpha) { spriteBatch.End(); //todo: use different blend state if character is hidden spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); _characterRendererProvider.ActiveCharacterRenderer.DrawToSpriteBatch(spriteBatch); spriteBatch.End(); spriteBatch.Begin(); } } }
mit
C#
54deea464cb66d774d203c434796f452d8428c61
Fix method reference in XML comment
artem-aliev/tinkerpop,apache/incubator-tinkerpop,pluradj/incubator-tinkerpop,apache/tinkerpop,krlohnes/tinkerpop,artem-aliev/tinkerpop,apache/tinkerpop,robertdale/tinkerpop,robertdale/tinkerpop,apache/incubator-tinkerpop,apache/tinkerpop,robertdale/tinkerpop,krlohnes/tinkerpop,artem-aliev/tinkerpop,apache/tinkerpop,apache/incubator-tinkerpop,krlohnes/tinkerpop,jorgebay/tinkerpop,krlohnes/tinkerpop,apache/tinkerpop,robertdale/tinkerpop,pluradj/incubator-tinkerpop,apache/tinkerpop,jorgebay/tinkerpop,artem-aliev/tinkerpop,robertdale/tinkerpop,jorgebay/tinkerpop,artem-aliev/tinkerpop,krlohnes/tinkerpop,pluradj/incubator-tinkerpop,apache/tinkerpop,jorgebay/tinkerpop
gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ITraversalSideEffects.cs
gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ITraversalSideEffects.cs
#region License /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #endregion using System; using System.Collections.Generic; namespace Gremlin.Net.Process.Traversal { /// <summary> /// A <see cref="ITraversal" /> can maintain global sideEffects. /// </summary> public interface ITraversalSideEffects : IDisposable { /// <summary> /// Retrieves the keys of the side-effect that can be supplied to <see cref="Get" />. /// </summary> /// <returns>The keys of the side-effect.</returns> IReadOnlyCollection<string> Keys(); /// <summary> /// Gets the side-effect associated with the provided key. /// </summary> /// <param name="key">The key to get the value for.</param> /// <returns>The value associated with key.</returns> object Get(string key); /// <summary> /// Invalidates the side effect cache for traversal. /// </summary> void Close(); } }
#region License /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #endregion using System; using System.Collections.Generic; namespace Gremlin.Net.Process.Traversal { /// <summary> /// A <see cref="ITraversal" /> can maintain global sideEffects. /// </summary> public interface ITraversalSideEffects : IDisposable { /// <summary> /// Retrieves the keys of the side-effect that can be supplied to <see cref="Get(string)" />. /// </summary> /// <returns>The keys of the side-effect.</returns> IReadOnlyCollection<string> Keys(); /// <summary> /// Gets the side-effect associated with the provided key. /// </summary> /// <param name="key">The key to get the value for.</param> /// <returns>The value associated with key.</returns> object Get(string key); /// <summary> /// Invalidates the side effect cache for traversal. /// </summary> void Close(); } }
apache-2.0
C#
6b613e84a588496099e77581a6bd39d59165f985
Add new file userAuth.cpl/Droid/MainActivity.cs
ArcanaMagus/userAuth.cpl,ArcanaMagus/userAuth.cpl,ArcanaMagus/userAuth.cpl,ArcanaMagus/userAuth.cpl
userAuth.cpl/Droid/MainActivity.cs
userAuth.cpl/Droid/MainActivity.cs
� using System; using System.Collections.Generic; using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; namespace userAuth.cpl.Droid { [Activity (Label = "userAuth.cpl.Droid", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = Android.Content.PM.ConfigChanges.Density | Android.Content.PM.ConfigChanges.Touchscreen)] public class MainActivity : global::Xamarin.Forms.Platform.Android.ActivityIndicatorRenderer { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); global::Xamarin.Forms.Forms.Init (this, bundle); LoadApplication (new App ()); // Create your apponlication here } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; namespace userAuth.cpl.Droid { [Activity (Label = "userAuth.cpl.Droid", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = Android.Content.PM.ConfigChanges.Density | Android.Content.PM.ConfigChanges.Touchscreen)] public class MainActivity : global::Xamarin.Forms.Platform.Android.ActivityIndicatorRenderer { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); global::Xamarin.Forms.Forms.Init (this, bundle); LoadApplication (new App ()); // Create your apponlication here } } }
mit
C#
dc8df9c62f429dcdd714de7ae9807d2cff15732b
Enable PreLoadImages
qianlifeng/Wox,Wox-launcher/Wox,lances101/Wox,qianlifeng/Wox,qianlifeng/Wox,Wox-launcher/Wox,lances101/Wox
Wox/App.xaml.cs
Wox/App.xaml.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Windows; using Wox.CommandArgs; using Wox.Core.Plugin; using Wox.Helper; using Wox.Infrastructure; namespace Wox { public partial class App : Application, ISingleInstanceApp { private const string Unique = "Wox_Unique_Application_Mutex"; public static MainWindow Window { get; private set; } [STAThread] public static void Main() { if (SingleInstance<App>.InitializeAsFirstInstance(Unique)) { var application = new App(); application.InitializeComponent(); application.Run(); SingleInstance<App>.Cleanup(); } } protected override void OnStartup(StartupEventArgs e) { using (new Timeit("Startup Time")) { base.OnStartup(e); DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException; AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle; ThreadPool.QueueUserWorkItem(o => { ImageLoader.ImageLoader.PreloadImages(); }); Window = new MainWindow(); PluginManager.Init(Window); CommandArgsFactory.Execute(e.Args.ToList()); } } public bool OnActivate(IList<string> args) { CommandArgsFactory.Execute(args); return true; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Windows; using Wox.CommandArgs; using Wox.Core.Plugin; using Wox.Helper; using Wox.Infrastructure; namespace Wox { public partial class App : Application, ISingleInstanceApp { private const string Unique = "Wox_Unique_Application_Mutex"; public static MainWindow Window { get; private set; } [STAThread] public static void Main() { if (SingleInstance<App>.InitializeAsFirstInstance(Unique)) { var application = new App(); application.InitializeComponent(); application.Run(); SingleInstance<App>.Cleanup(); } } protected override void OnStartup(StartupEventArgs e) { using (new Timeit("Startup Time")) { base.OnStartup(e); DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException; AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle; //ThreadPool.QueueUserWorkItem(o => { ImageLoader.ImageLoader.PreloadImages(); }); Window = new MainWindow(); PluginManager.Init(Window); CommandArgsFactory.Execute(e.Args.ToList()); } } public bool OnActivate(IList<string> args) { CommandArgsFactory.Execute(args); return true; } } }
mit
C#
b9e338e4c98025cfe39e0021edea8d42da33c123
add "set" to DbSet and Context prop
Borayvor/ASP.NET-MVC-CourseProject,Borayvor/ASP.NET-MVC-CourseProject,Borayvor/ASP.NET-MVC-CourseProject
EntertainmentSystem/Data/EntertainmentSystem.Data.Common/Repositories/DbRepository{T}.cs
EntertainmentSystem/Data/EntertainmentSystem.Data.Common/Repositories/DbRepository{T}.cs
namespace EntertainmentSystem.Data.Common { using System; using System.Data.Entity; using System.Linq; using Models; using Repositories; public class DbRepository<T> : IDbRepository<T> where T : class, IAuditInfo, IDeletableEntity { public DbRepository(DbContext context) { if (context == null) { throw new ArgumentException("An instance of DbContext is required to use this repository.", nameof(context)); } this.Context = context; this.DbSet = this.Context.Set<T>(); } private IDbSet<T> DbSet { get; set; } private DbContext Context { get; set; } public IQueryable<T> All() { return this.DbSet.Where(x => !x.IsDeleted); } public IQueryable<T> AllWithDeleted() { return this.DbSet; } public T GetById(object id) { return this.DbSet.Find(id); } public void Create(T entity) { this.DbSet.Add(entity); } public virtual void Update(T entity) { var entry = this.Context.Entry(entity); if (entry.State == EntityState.Detached) { this.DbSet.Attach(entity); } entry.State = EntityState.Modified; } public void Delete(T entity) { entity.IsDeleted = true; entity.DeletedOn = DateTime.Now; } public void DeletePermanent(T entity) { this.DbSet.Remove(entity); } public void Save() { this.Context.SaveChanges(); } } }
namespace EntertainmentSystem.Data.Common { using System; using System.Data.Entity; using System.Linq; using Models; using Repositories; public class DbRepository<T> : IDbRepository<T> where T : class, IAuditInfo, IDeletableEntity { public DbRepository(DbContext context) { if (context == null) { throw new ArgumentException("An instance of DbContext is required to use this repository.", nameof(context)); } this.Context = context; this.DbSet = this.Context.Set<T>(); } private IDbSet<T> DbSet { get; } private DbContext Context { get; } public IQueryable<T> All() { return this.DbSet.Where(x => !x.IsDeleted); } public IQueryable<T> AllWithDeleted() { return this.DbSet; } public T GetById(object id) { return this.DbSet.Find(id); } public void Create(T entity) { this.DbSet.Add(entity); } public virtual void Update(T entity) { var entry = this.Context.Entry(entity); if (entry.State == EntityState.Detached) { this.DbSet.Attach(entity); } entry.State = EntityState.Modified; } public void Delete(T entity) { entity.IsDeleted = true; entity.DeletedOn = DateTime.Now; } public void DeletePermanent(T entity) { this.DbSet.Remove(entity); } public void Save() { this.Context.SaveChanges(); } } }
mit
C#
9a90ebaffe41df590ca3fac9e0b5acdea35c5175
Revert "Removing 'zzz' from method name"
Smartrak/Smartrak.Library
Collections/Paging/PagingHelpers.cs
Collections/Paging/PagingHelpers.cs
using System; using System.Linq; namespace Smartrak.Collections.Paging { public static class PagingHelpers { /// <summary> /// Gets a paged list of entities with the total appended to each row in the resultset. This is a faster way of doing things than using 2 seperate queries /// </summary> /// <typeparam name="T">The type of the entity, can be inferred by the type of queryable you pass</typeparam> /// <param name="entities">A queryable of entities</param> /// <param name="page">the 1 indexed page number you are interested in, cannot be zero or negative</param> /// <param name="pageSize">the size of the page you want, cannot be zero or negative</param> /// <returns>A queryable of the page of entities with counts appended.</returns> public static IQueryable<EntityWithCount<T>> GetPageWithTotalzzz<T>(this IQueryable<T> entities, int page, int pageSize) where T : class { if (entities == null) { throw new ArgumentNullException("entities"); } if (page < 1) { throw new ArgumentException("Must be positive", "page"); } if (pageSize < 1) { throw new ArgumentException("Must be positive", "pageSize"); } return entities .Select(e => new EntityWithCount<T> { Entity = e, Count = entities.Count() }) .Skip(page - 1 * pageSize) .Take(pageSize); } } }
using System; using System.Linq; namespace Smartrak.Collections.Paging { public static class PagingHelpers { /// <summary> /// Gets a paged list of entities with the total appended to each row in the resultset. This is a faster way of doing things than using 2 seperate queries /// </summary> /// <typeparam name="T">The type of the entity, can be inferred by the type of queryable you pass</typeparam> /// <param name="entities">A queryable of entities</param> /// <param name="page">the 1 indexed page number you are interested in, cannot be zero or negative</param> /// <param name="pageSize">the size of the page you want, cannot be zero or negative</param> /// <returns>A queryable of the page of entities with counts appended.</returns> public static IQueryable<EntityWithCount<T>> GetPageWithTotal<T>(this IQueryable<T> entities, int page, int pageSize) where T : class { if (entities == null) { throw new ArgumentNullException("entities"); } if (page < 1) { throw new ArgumentException("Must be positive", "page"); } if (pageSize < 1) { throw new ArgumentException("Must be positive", "pageSize"); } return entities .Select(e => new EntityWithCount<T> { Entity = e, Count = entities.Count() }) .Skip(page - 1 * pageSize) .Take(pageSize); } } }
mit
C#
a347546128d1b5cec7f1c396a15c3715f8421ddb
Add Commodity Type to Security Types Fix Issue #8 Thanks dsheph
qusma/ib-csharp,krs43/ib-csharp,sebfia/ib-csharp
Krs.Ats.IBNet/Enums/SecurityType.cs
Krs.Ats.IBNet/Enums/SecurityType.cs
using System; using System.ComponentModel; namespace Krs.Ats.IBNet { /// <summary> /// Contract Security Types /// </summary> [Serializable()] public enum SecurityType { /// <summary> /// Stock /// </summary> [Description("STK")] Stock, /// <summary> /// Option /// </summary> [Description("OPT")] Option, /// <summary> /// Future /// </summary> [Description("FUT")] Future, /// <summary> /// Indice /// </summary> [Description("IND")] Index, /// <summary> /// FOP = options on futures /// </summary> [Description("FOP")] FutureOption, /// <summary> /// Cash /// </summary> [Description("CASH")] Cash, /// <summary> /// For Combination Orders - must use combo leg details /// </summary> [Description("BAG")] Bag, /// <summary> /// Bond /// </summary> [Description("BOND")] Bond, /// <summary> /// Warrant /// </summary> [Description("WAR")] Warrant, /// <summary> /// Commodity /// </summary> [Description("CMDTY")] Commodity, /// <summary> /// Undefined Security Type /// </summary> [Description("")] Undefined } }
using System; using System.ComponentModel; namespace Krs.Ats.IBNet { /// <summary> /// Contract Security Types /// </summary> [Serializable()] public enum SecurityType { /// <summary> /// Stock /// </summary> [Description("STK")] Stock, /// <summary> /// Option /// </summary> [Description("OPT")] Option, /// <summary> /// Future /// </summary> [Description("FUT")] Future, /// <summary> /// Indice /// </summary> [Description("IND")] Index, /// <summary> /// FOP = options on futures /// </summary> [Description("FOP")] FutureOption, /// <summary> /// Cash /// </summary> [Description("CASH")] Cash, /// <summary> /// For Combination Orders - must use combo leg details /// </summary> [Description("BAG")] Bag, /// <summary> /// Bond /// </summary> [Description("BOND")] Bond, /// <summary> /// Warrant /// </summary> [Description("WAR")] Warrant, /// <summary> /// Undefined Security Type /// </summary> [Description("")] Undefined } }
mit
C#
e5eea503dbdfebee5f2911354ded244885a5f5d1
Remove finalizer logic from `ResourcesSkin`
NeoAdonis/osu,smoogipoo/osu,peppy/osu,smoogipooo/osu,NeoAdonis/osu,UselessToucan/osu,peppy/osu,smoogipoo/osu,smoogipoo/osu,ppy/osu,UselessToucan/osu,UselessToucan/osu,ppy/osu,peppy/osu,NeoAdonis/osu,peppy/osu-new,ppy/osu
osu.Game/Skinning/ResourcesSkin.cs
osu.Game/Skinning/ResourcesSkin.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable enable using System; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.OpenGL.Textures; using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; using osu.Framework.Platform; using osu.Game.Audio; namespace osu.Game.Skinning { /// <summary> /// An <see cref="ISkin"/> that uses an underlying <see cref="IResourceStore{T}"/> with namespaces for resources retrieval. /// </summary> public class ResourcesSkin : ISkin, IDisposable { private readonly TextureStore textures; private readonly ISampleStore samples; public ResourcesSkin(IResourceStore<byte[]> resources, GameHost host, AudioManager audio) { textures = new TextureStore(host.CreateTextureLoaderStore(new NamespacedResourceStore<byte[]>(resources, @"Textures"))); samples = audio.GetSampleStore(new NamespacedResourceStore<byte[]>(resources, @"Samples")); } public Drawable? GetDrawableComponent(ISkinComponent component) => null; public Texture? GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) => textures.Get(componentName, wrapModeS, wrapModeT); public ISample? GetSample(ISampleInfo sampleInfo) { foreach (var lookup in sampleInfo.LookupNames) { ISample? sample = samples.Get(lookup); if (sample != null) return sample; } return null; } public IBindable<TValue>? GetConfig<TLookup, TValue>(TLookup lookup) => null; public void Dispose() { textures.Dispose(); samples.Dispose(); } } }
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable enable using System; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.OpenGL.Textures; using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; using osu.Framework.Platform; using osu.Game.Audio; namespace osu.Game.Skinning { /// <summary> /// An <see cref="ISkin"/> that uses an underlying <see cref="IResourceStore{T}"/> with namespaces for resources retrieval. /// </summary> public class ResourcesSkin : ISkin { private readonly TextureStore textures; private readonly ISampleStore samples; public ResourcesSkin(IResourceStore<byte[]> resources, GameHost host, AudioManager audio) { textures = new TextureStore(host.CreateTextureLoaderStore(new NamespacedResourceStore<byte[]>(resources, @"Textures"))); samples = audio.GetSampleStore(new NamespacedResourceStore<byte[]>(resources, @"Samples")); } public Drawable? GetDrawableComponent(ISkinComponent component) => null; public Texture? GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) => textures.Get(componentName, wrapModeS, wrapModeT); public ISample? GetSample(ISampleInfo sampleInfo) { foreach (var lookup in sampleInfo.LookupNames) { ISample? sample = samples.Get(lookup); if (sample != null) return sample; } return null; } public IBindable<TValue>? GetConfig<TLookup, TValue>(TLookup lookup) => null; #region Disposal ~ResourcesSkin() { // required to potentially clean up sample store from audio hierarchy. Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } private bool isDisposed; protected virtual void Dispose(bool isDisposing) { if (isDisposed) return; isDisposed = true; textures.Dispose(); samples.Dispose(); } #endregion } }
mit
C#
9aa6391309e2d3757f9da51a85b3db00de1ae351
Bump to version 2.5.0.0
bobus15/proshine,Silv3rPRO/proshine
PROShine/Properties/AssemblyInfo.cs
PROShine/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("PROShine")] [assembly: AssemblyDescription("A free, open-source and advanced bot for Pokemon Revolution Online.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Silv3r")] [assembly: AssemblyProduct("PROShine")] [assembly: AssemblyCopyright("Copyright © Silv3r, 2016-2032")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.5.0.0")] [assembly: AssemblyFileVersion("2.5.0.0")] [assembly: NeutralResourcesLanguage("en")]
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("PROShine")] [assembly: AssemblyDescription("A free, open-source and advanced bot for Pokemon Revolution Online.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Silv3r")] [assembly: AssemblyProduct("PROShine")] [assembly: AssemblyCopyright("Copyright © Silv3r, 2016-2032")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.4.0.0")] [assembly: AssemblyFileVersion("2.4.0.0")] [assembly: NeutralResourcesLanguage("en")]
mit
C#
cc92d3d6a91dfd5acbdd681b57737df083f6f12b
Enable the GC to clean up the process list immediately. Fixed potential null reference when disposing before starting.
frederik256/ProcessRelauncher
ProcessRelauncher/ProcessMonitor.cs
ProcessRelauncher/ProcessMonitor.cs
using System; using System.Diagnostics; using System.Threading; namespace ProcessRelauncher { public class ProcessMonitor : IDisposable { private Timer _timer; private readonly int _monitoringPollingIntervalMs; private readonly ProcessStartInfo _processStartInfo; private readonly string _processName; public ProcessMonitor(string processName, ProcessStartInfo launcher, int monitoringPollingIntervalMs) { _processStartInfo = launcher; _processName = processName.ToLower(); _monitoringPollingIntervalMs = monitoringPollingIntervalMs; } public void Monitor(object o) { Process[] processlist = Process.GetProcesses(); foreach (var p in processlist) { if (p.ProcessName.ToLower().Equals(_processName)) return; } Process.Start(_processStartInfo); processlist = null; GC.Collect(); } public void Start() { if (_timer != null) return; _timer = new Timer(this.Monitor, null, 0, _monitoringPollingIntervalMs); } public void Dispose() { if (_timer == null) return; _timer.Dispose(); } } }
using System; using System.Diagnostics; using System.Threading; namespace ProcessRelauncher { public class ProcessMonitor : IDisposable { private Timer _timer; private readonly int _monitoringPollingIntervalMs; private readonly ProcessStartInfo _processStartInfo; private readonly string _processName; public ProcessMonitor(string processName, ProcessStartInfo launcher, int monitoringPollingIntervalMs) { _processStartInfo = launcher; _processName = processName.ToLower(); _monitoringPollingIntervalMs = monitoringPollingIntervalMs; } public void Monitor(object o) { Process[] processlist = Process.GetProcesses(); foreach(var p in processlist) { if (p.ProcessName.ToLower().Equals(_processName)) return; } Process.Start(_processStartInfo); GC.Collect(); } public void Start() { if (_timer != null) return; _timer = new Timer(this.Monitor, null, 0, _monitoringPollingIntervalMs); } public void Dispose() { _timer.Dispose(); } } }
bsd-3-clause
C#
9414540854ff1a4f911d706446c0c7192adebc88
Update XML comment document.
jyuch/ReflectionToStringBuilder
src/ReflectionToStringBuilder/ToStringPropertyMap.cs
src/ReflectionToStringBuilder/ToStringPropertyMap.cs
// Copyright (c) 2015 jyuch // Released under the MIT license // https://github.com/jyuch/ReflectionToStringBuilder/blob/master/LICENSE using System; using System.Reflection; namespace Jyuch.ReflectionToStringBuilder { /// <summary> /// Mapping info for a member to string-format. /// </summary> public sealed class ToStringPropertyMap { private readonly Func<object, object> _accessor; private string _name; private bool _isIgnore; internal bool IsIgnore { get { return _isIgnore; } } internal ToStringPropertyMap(Type objectType, MemberInfo member) { _accessor = ReflectionHelper.GetMemberAccessor(objectType, member); _name = member.Name; _isIgnore = false; } /// <summary> /// Set name to member. /// </summary> /// <param name="name"></param> /// <returns>The reference mapping for the member.</returns> public ToStringPropertyMap Name(string name) { _name = name; return this; } /// <summary> /// Ignore the member when generate string-format. /// </summary> /// <returns>The reference mapping for the member.</returns> public ToStringPropertyMap Ignore() { _isIgnore = true; return this; } /// <summary> /// Ignore the member when generate string-format. /// </summary> /// <param name="ignore">True to ignore, otherwise false.</param> /// <returns>The reference mapping for the member.</returns> public ToStringPropertyMap Ignore(bool ignore) { _isIgnore = ignore; return this; } internal string ToStringMember(object obj) { return $"{_name}={_accessor(obj)?.ToString() ?? string.Empty}"; } } }
// Copyright (c) 2015 jyuch // Released under the MIT license // https://github.com/jyuch/ReflectionToStringBuilder/blob/master/LICENSE using System; using System.Reflection; namespace Jyuch.ReflectionToStringBuilder { public sealed class ToStringPropertyMap { private readonly Func<object, object> _accessor; private string _name; private bool _isIgnore; internal bool IsIgnore { get { return _isIgnore; } } internal ToStringPropertyMap(Type objectType, MemberInfo member) { _accessor = ReflectionHelper.GetMemberAccessor(objectType, member); _name = member.Name; _isIgnore = false; } /// <summary> /// Set name to member. /// </summary> /// <param name="name"></param> /// <returns>The reference mapping for the member.</returns> public ToStringPropertyMap Name(string name) { _name = name; return this; } /// <summary> /// Ignore the member when generate string-format. /// </summary> /// <returns>The reference mapping for the member.</returns> public ToStringPropertyMap Ignore() { _isIgnore = true; return this; } /// <summary> /// Ignore the member when generate string-format. /// </summary> /// <param name="ignore">True to ignore, otherwise false.</param> /// <returns>The reference mapping for the member.</returns> public ToStringPropertyMap Ignore(bool ignore) { _isIgnore = ignore; return this; } internal string ToStringMember(object obj) { return $"{_name}={_accessor(obj)?.ToString() ?? string.Empty}"; } } }
mit
C#
807f0c5ce53fc5b0d7e4749b6cd513b04faef93c
Comment out the code in Hangman that uses Table
12joan/hangman
hangman.cs
hangman.cs
using System; namespace Hangman { public class Hangman { public static void Main(string[] args) { // Table table = new Table(2, 3); // string output = table.Draw(); // Console.WriteLine(output); } } }
using System; namespace Hangman { public class Hangman { public static void Main(string[] args) { Table table = new Table(2, 3); string output = table.Draw(); Console.WriteLine(output); } } }
unlicense
C#
0d0336cc9c3a04d7e23af38698b215a2955e965f
Update dependencies from dotnet/corefx (dotnet/coreclr#27431)
ericstj/corefx,ericstj/corefx,ericstj/corefx,shimingsg/corefx,shimingsg/corefx,shimingsg/corefx,shimingsg/corefx,ericstj/corefx,shimingsg/corefx,shimingsg/corefx,ericstj/corefx,ericstj/corefx,shimingsg/corefx,ericstj/corefx
src/Common/src/CoreLib/Interop/Unix/System.Native/Interop.GetTimestamp.cs
src/Common/src/CoreLib/Interop/Unix/System.Native/Interop.GetTimestamp.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Runtime.InteropServices; internal static partial class Interop { internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestampResolution", ExactSpelling = true)] internal static extern ulong GetTimestampResolution(); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp", ExactSpelling = true)] // [SuppressGCTransition] // https://github.com/dotnet/coreclr/issues/27465 internal static extern ulong GetTimestamp(); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Runtime.InteropServices; internal static partial class Interop { internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestampResolution", ExactSpelling = true)] internal static extern ulong GetTimestampResolution(); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp", ExactSpelling = true)] [SuppressGCTransition] internal static extern ulong GetTimestamp(); } }
mit
C#
4efdd5f378329929c57b8b646c0147f1c68788dd
Use pkcs11-mock for testing
Pkcs11Interop/pkcs11-logger,Pkcs11Interop/pkcs11-logger,Pkcs11Interop/pkcs11-logger
test/Pkcs11LoggerTests/Settings.cs
test/Pkcs11LoggerTests/Settings.cs
/* * PKCS11-LOGGER - PKCS#11 logging proxy module * Copyright (c) 2011-2015 JWC s.r.o. <http://www.jwc.sk> * Author: Jaroslav Imrich <[email protected]> * * Licensing for open source projects: * PKCS11-LOGGER is available under the terms of the GNU Affero General * Public License version 3 as published by the Free Software Foundation. * Please see <http://www.gnu.org/licenses/agpl-3.0.html> for more details. * * Licensing for other types of projects: * PKCS11-LOGGER is available under the terms of flexible commercial license. * Please contact JWC s.r.o. at <[email protected]> for more details. */ namespace Pkcs11Logger.Tests { /// <summary> /// Test settings /// </summary> public static class Settings { /// <summary> /// The PKCS#11 unmanaged library path /// </summary> public static string Pkcs11LibraryPath = @"c:\test\pkcs11-mock-x86.dll"; /// <summary> /// The normal user pin /// </summary> public static string NormalUserPin = @"11111111"; /// <summary> /// The PKCS11-LOGGER unmanaged library path /// </summary> public static string Pkcs11LoggerLibraryPath = @"c:\test\pkcs11-logger-x86.dll"; /// <summary> /// Primary log file path /// </summary> public static string Pkcs11LoggerLogPath1 = @"c:\test\pkcs11-logger-x86-1.txt"; /// <summary> /// Alternative log file path /// </summary> public static string Pkcs11LoggerLogPath2 = @"c:\test\pkcs11-logger-x86-2.txt"; } }
/* * PKCS11-LOGGER - PKCS#11 logging proxy module * Copyright (c) 2011-2015 JWC s.r.o. <http://www.jwc.sk> * Author: Jaroslav Imrich <[email protected]> * * Licensing for open source projects: * PKCS11-LOGGER is available under the terms of the GNU Affero General * Public License version 3 as published by the Free Software Foundation. * Please see <http://www.gnu.org/licenses/agpl-3.0.html> for more details. * * Licensing for other types of projects: * PKCS11-LOGGER is available under the terms of flexible commercial license. * Please contact JWC s.r.o. at <[email protected]> for more details. */ namespace Pkcs11Logger.Tests { /// <summary> /// Test settings /// </summary> public static class Settings { /// <summary> /// The PKCS#11 unmanaged library path /// </summary> public static string Pkcs11LibraryPath = @"siecap11.dll"; /// <summary> /// The normal user pin /// </summary> public static string NormalUserPin = @"11111111"; /// <summary> /// The PKCS11-LOGGER unmanaged library path /// </summary> public static string Pkcs11LoggerLibraryPath = @"c:\pkcs11-logger-x86.dll"; /// <summary> /// Primary log file path /// </summary> public static string Pkcs11LoggerLogPath1 = @"c:\pkcs11-logger-x86-1.txt"; /// <summary> /// Alternative log file path /// </summary> public static string Pkcs11LoggerLogPath2 = @"c:\pkcs11-logger-x86-2.txt"; } }
apache-2.0
C#
976c435749838971252d53ad550ff07587a6b7b8
Set LogLevel in master branch to Warning
sqybi/baidu-hi-crawler
BaiduHiCrawler/BaiduHiCrawler/Constants.cs
BaiduHiCrawler/BaiduHiCrawler/Constants.cs
namespace BaiduHiCrawler { using System; static class Constants { public const string CommentRetrivalUrlPattern = "http://hi.baidu.com/qcmt/data/cmtlist?qing_request_source=new_request&thread_id_enc={0}&start={1}&count={2}&orderby_type=0&favor=2&type=smblog"; public const string LocalArchiveFolder = @".\Archive\"; public const string LogsFolder = @".\Logs\"; public static readonly Uri LoginUri = new Uri("http://hi.baidu.com/go/login"); public static readonly Uri HomeUri = new Uri("http://hi.baidu.com/home"); public static readonly DateTime CommentBaseDateTime = new DateTime(1970, 1, 1, 0, 0, 0); public static readonly LogLevel LogLevel = LogLevel.Warning; } }
namespace BaiduHiCrawler { using System; static class Constants { public const string CommentRetrivalUrlPattern = "http://hi.baidu.com/qcmt/data/cmtlist?qing_request_source=new_request&thread_id_enc={0}&start={1}&count={2}&orderby_type=0&favor=2&type=smblog"; public const string LocalArchiveFolder = @".\Archive\"; public const string LogsFolder = @".\Logs\"; public static readonly Uri LoginUri = new Uri("http://hi.baidu.com/go/login"); public static readonly Uri HomeUri = new Uri("http://hi.baidu.com/home"); public static readonly DateTime CommentBaseDateTime = new DateTime(1970, 1, 1, 0, 0, 0); public static readonly LogLevel LogLevel = LogLevel.Verbose; } }
mit
C#
a02d1e87a78febcc370269d580e37b1989a331b0
Revert "Revert "Fixed server not being listed on master server""
Facepunch/Facepunch.Steamworks,Facepunch/Facepunch.Steamworks,Facepunch/Facepunch.Steamworks
Facepunch.Steamworks/Structs/ServerInit.cs
Facepunch.Steamworks/Structs/ServerInit.cs
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Runtime.InteropServices; using System.Text; namespace Steamworks { /// <summary> /// Used to set up the server. /// The variables in here are all required to be set, and can't be changed once the server is created. /// </summary> public struct SteamServerInit { public IPAddress IpAddress; public ushort SteamPort; public ushort GamePort; public ushort QueryPort; public bool Secure; /// <summary> /// The version string is usually in the form x.x.x.x, and is used by the master server to detect when the server is out of date. /// If you go into the dedicated server tab on steamworks you'll be able to server the latest version. If this version number is /// less than that latest version then your server won't show. /// </summary> public string VersionString; /// <summary> /// This should be the same directory game where gets installed into. Just the folder name, not the whole path. I.e. "Rust", "Garrysmod". /// </summary> public string ModDir; /// <summary> /// The game description. Setting this to the full name of your game is recommended. /// </summary> public string GameDescription; /// <summary> /// Is a dedicated server /// </summary> public bool DedicatedServer; public SteamServerInit( string modDir, string gameDesc ) { DedicatedServer = true; ModDir = modDir; GameDescription = gameDesc; GamePort = 27015; QueryPort = 27016; Secure = true; VersionString = "1.0.0.0"; IpAddress = null; SteamPort = 0; } /// <summary> /// Set the Steam quert port /// </summary> public SteamServerInit WithRandomSteamPort() { SteamPort = (ushort)new Random().Next( 10000, 60000 ); return this; } /// <summary> /// If you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE into usQueryPort, then it causes the game server API to use /// "GameSocketShare" mode, which means that the game is responsible for sending and receiving UDP packets for the master /// server updater. /// /// More info about this here: https://partner.steamgames.com/doc/api/ISteamGameServer#HandleIncomingPacket /// </summary> public SteamServerInit WithQueryShareGamePort() { QueryPort = 0xFFFF; return this; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Runtime.InteropServices; using System.Text; namespace Steamworks { /// <summary> /// Used to set up the server. /// The variables in here are all required to be set, and can't be changed once the server is created. /// </summary> public struct SteamServerInit { public IPAddress IpAddress; public ushort SteamPort; public ushort GamePort; public ushort QueryPort; public bool Secure; /// <summary> /// The version string is usually in the form x.x.x.x, and is used by the master server to detect when the server is out of date. /// If you go into the dedicated server tab on steamworks you'll be able to server the latest version. If this version number is /// less than that latest version then your server won't show. /// </summary> public string VersionString; /// <summary> /// This should be the same directory game where gets installed into. Just the folder name, not the whole path. I.e. "Rust", "Garrysmod". /// </summary> public string ModDir; /// <summary> /// The game description. Setting this to the full name of your game is recommended. /// </summary> public string GameDescription; public SteamServerInit( string modDir, string gameDesc ) { ModDir = modDir; GameDescription = gameDesc; GamePort = 27015; QueryPort = 27016; Secure = true; VersionString = "1.0.0.0"; ModDir = "unset"; GameDescription = "unset"; IpAddress = null; SteamPort = 0; } /// <summary> /// Set the Steam quert port /// </summary> public SteamServerInit WithRandomSteamPort() { SteamPort = (ushort)new Random().Next( 10000, 60000 ); return this; } /// <summary> /// If you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE into usQueryPort, then it causes the game server API to use /// "GameSocketShare" mode, which means that the game is responsible for sending and receiving UDP packets for the master /// server updater. /// /// More info about this here: https://partner.steamgames.com/doc/api/ISteamGameServer#HandleIncomingPacket /// </summary> public SteamServerInit WithQueryShareGamePort() { QueryPort = 0xFFFF; return this; } } }
mit
C#
e6935c872d102d1c9e0bd6956ae9e5be236d6bb9
Change AssemblyInfo
laulaua3/MapperExpression,laulaua3/MapperExpression,laulaua3/MapperExpression
CS/MapperCore/Properties/AssemblyInfo.cs
CS/MapperCore/Properties/AssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Les informations générales relatives à un assembly dépendent de // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations // associées à un assembly. [assembly: AssemblyTitle("MapperExpression")] [assembly: AssemblyDescription("Mapper simple like AutoMapper based on the lambda expressions")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Laurent Boulet")] [assembly: AssemblyProduct("MapperExpression")] [assembly: AssemblyCopyright("Copyright © Microsoft 2016")] [assembly: AssemblyTrademark("MapperExpression")] [assembly: AssemblyCulture("")] // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de // COM, affectez la valeur true à l'attribut ComVisible sur ce type. [assembly: ComVisible(false)] // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM [assembly: Guid("a339b173-2ba4-44df-8654-4b0e6d6b9cd0")] // Les informations de version pour un assembly se composent des quatre valeurs suivantes : // // Version principale // Version secondaire // Numéro de build // Révision // // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut // en utilisant '*', comme indiqué ci-dessous : // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.*")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: InternalsVisibleTo("MapperExpression.Tests.Units")] [assembly: InternalsVisibleTo("MapperExpression.Fakes")] [assembly: CLSCompliant(true)]
using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Les informations générales relatives à un assembly dépendent de // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations // associées à un assembly. [assembly: AssemblyTitle("MapperExpression")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("LB")] [assembly: AssemblyProduct("MapperExpression")] [assembly: AssemblyCopyright("Copyright © Microsoft 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de // COM, affectez la valeur true à l'attribut ComVisible sur ce type. [assembly: ComVisible(false)] // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM [assembly: Guid("a339b173-2ba4-44df-8654-4b0e6d6b9cd0")] // Les informations de version pour un assembly se composent des quatre valeurs suivantes : // // Version principale // Version secondaire // Numéro de build // Révision // // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut // en utilisant '*', comme indiqué ci-dessous : // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.*")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: InternalsVisibleTo("MapperExpression.Tests.Units")] [assembly: InternalsVisibleTo("MapperExpression.Fakes")] [assembly: CLSCompliant(true)]
apache-2.0
C#
87893c35a92be42929ea6e5355156ee2231988ca
Update AssemblyInfo
JohanLarsson/Gu.Localization
Gu.Localization/Properties/AssemblyInfo.cs
Gu.Localization/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; 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("Gu.Localization")] [assembly: AssemblyDescription("For localization using ResourceManager.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Johan Larsson")] [assembly: AssemblyProduct("Gu.Localization")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("0686a7de-9e74-44f6-bfaa-342c73cea820")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.1.0.0")] [assembly: AssemblyFileVersion("2.1.0.0")] [assembly: InternalsVisibleTo("Gu.Wpf.Localization", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("Gu.Localization.Tests", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("Gu.Localization.Benchmarks", AllInternalsVisible = true)] [assembly: NeutralResourcesLanguage("en")]
using System.Reflection; using System.Resources; 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("Gu.Localization")] [assembly: AssemblyDescription("For localization of WPF applications.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Johan Larsson")] [assembly: AssemblyProduct("Gu.Localization")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("0686a7de-9e74-44f6-bfaa-342c73cea820")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.1.0.0")] [assembly: AssemblyFileVersion("2.1.0.0")] [assembly: InternalsVisibleTo("Gu.Wpf.Localization", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("Gu.Localization.Tests", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("Gu.Localization.Benchmarks", AllInternalsVisible = true)] [assembly: NeutralResourcesLanguage("en")]
mit
C#
ed06ea691e6ff7fd36ecd02f9bf04c29fdb36524
simplify expression for AssemblyLoadContext
momcms/MoM,momcms/MoM
MoM.Web/Loaders/DirectoryAssemblyLoader.cs
MoM.Web/Loaders/DirectoryAssemblyLoader.cs
using Microsoft.Extensions.PlatformAbstractions; using System; using System.IO; using System.Reflection; namespace MoM.Web.Loaders { public class DirectoryAssemblyLoader : IAssemblyLoader { private readonly string DirectoryPath; private readonly IAssemblyLoadContext AssemblyLoadContext; public DirectoryAssemblyLoader(string path, IAssemblyLoadContext assemblyLoadContext) { DirectoryPath = path; AssemblyLoadContext = assemblyLoadContext; } public Assembly Load(AssemblyName assemblyName) { return AssemblyLoadContext.LoadFile(Path.Combine(DirectoryPath, assemblyName + ".dll")); } public IntPtr LoadUnmanagedLibrary(string name) { throw new NotImplementedException(); } } }
using Microsoft.Extensions.PlatformAbstractions; using System; using System.IO; using System.Reflection; namespace MoM.Web.Loaders { public class DirectoryAssemblyLoader : IAssemblyLoader { private readonly string DirectoryPath; private readonly IAssemblyLoadContext AssemblyLoadContext; public DirectoryAssemblyLoader(string path, IAssemblyLoadContext assemblyLoadContext) { DirectoryPath = path; AssemblyLoadContext = assemblyLoadContext; } public Assembly Load(AssemblyName assemblyName) { return this.AssemblyLoadContext.LoadFile(Path.Combine(DirectoryPath, assemblyName + ".dll")); } public IntPtr LoadUnmanagedLibrary(string name) { throw new NotImplementedException(); } } }
mit
C#
36e0036a9baa56a9645a87d28eee8db19be636b4
REMOVE unnecessary debug message
JohannesDeml/adaptingGravityUnity3D
Assets/Player/PlayerController.cs
Assets/Player/PlayerController.cs
using UnityEngine; using System.Collections; using Deml.Physics.Gravity; [System.Flags] public enum PlayerState { Initialized = 1 << 0, Movable = 1 << 1, Turnable = 1 << 2 } [RequireComponent(typeof(AdaptingGravity))] [RequireComponent(typeof(Rigidbody))] public class PlayerController : MonoBehaviour { [SerializeField] private float mouseSensitivity = 0.5f; [SerializeField] private float movementSpeed = 5f; public PlayerState State { get; private set; } private AdaptingGravity gravityController; private new Rigidbody rigidbody; // Use this for initialization void Awake () { gravityController = GetComponent<AdaptingGravity>(); rigidbody = GetComponent<Rigidbody>(); State = PlayerState.Initialized; EnableState(PlayerState.Movable); EnableState(PlayerState.Turnable); } public void Move(Vector3 movementInput, float rotationInput, bool jumpingInput) { if (!HasState(PlayerState.Initialized)) { return; } if (HasState(PlayerState.Turnable)) { UpdateRotation(rotationInput); } if (HasState(PlayerState.Movable)) { UpdateMovement(movementInput, jumpingInput); } } private void UpdateMovement(Vector3 movementInput, bool jumping) { Vector3 mappedMovement = movementInput.x * transform.right + movementInput.z * transform.forward; float groundModifier = (gravityController.OnGround) ? 1.0f : 0.2f; mappedMovement = Vector3.ProjectOnPlane(mappedMovement, gravityController.GroundNormal); Debug.DrawLine(transform.position, transform.position + 3f * mappedMovement, Color.red); mappedMovement *= groundModifier*movementSpeed*Time.fixedDeltaTime; MoveRelative(mappedMovement); } private void MoveRelative(Vector3 relativeChange) { rigidbody.MovePosition(transform.position + relativeChange); } private void UpdateRotation(float angle) { Quaternion rotation = Quaternion.AngleAxis(angle*1000f*mouseSensitivity*Time.fixedDeltaTime, gravityController.GroundNormal); transform.rotation = rotation*transform.rotation; } public void DisableState(PlayerState stateToDisable) { State &= ~stateToDisable; } public void EnableState(PlayerState stateToEnable) { State |= stateToEnable; } public bool HasState(PlayerState stateToCheck) { return ((State & stateToCheck) == stateToCheck); } }
using UnityEngine; using System.Collections; using Deml.Physics.Gravity; [System.Flags] public enum PlayerState { Initialized = 1 << 0, Movable = 1 << 1, Turnable = 1 << 2 } [RequireComponent(typeof(AdaptingGravity))] [RequireComponent(typeof(Rigidbody))] public class PlayerController : MonoBehaviour { [SerializeField] private float mouseSensitivity = 0.5f; [SerializeField] private float movementSpeed = 5f; public PlayerState State { get; private set; } private AdaptingGravity gravityController; private new Rigidbody rigidbody; // Use this for initialization void Awake () { gravityController = GetComponent<AdaptingGravity>(); rigidbody = GetComponent<Rigidbody>(); State = PlayerState.Initialized; EnableState(PlayerState.Movable); EnableState(PlayerState.Turnable); } public void Move(Vector3 movementInput, float rotationInput, bool jumpingInput) { if (!HasState(PlayerState.Initialized)) { return; } if (HasState(PlayerState.Turnable)) { UpdateRotation(rotationInput); } if (HasState(PlayerState.Movable)) { UpdateMovement(movementInput, jumpingInput); } } private void UpdateMovement(Vector3 movementInput, bool jumping) { Vector3 mappedMovement = movementInput.x * transform.right + movementInput.z * transform.forward; float groundModifier = (gravityController.OnGround) ? 1.0f : 0.2f; mappedMovement = Vector3.ProjectOnPlane(mappedMovement, gravityController.GroundNormal); Debug.DrawLine(transform.position, transform.position + 3f * mappedMovement, Color.red); mappedMovement *= groundModifier*movementSpeed*Time.fixedDeltaTime; MoveRelative(mappedMovement); } private void MoveRelative(Vector3 relativeChange) { rigidbody.MovePosition(transform.position + relativeChange); } private void UpdateRotation(float angle) { Debug.Log("Jup"); Quaternion rotation = Quaternion.AngleAxis(angle*1000f*mouseSensitivity*Time.fixedDeltaTime, gravityController.GroundNormal); transform.rotation = rotation*transform.rotation; } public void DisableState(PlayerState stateToDisable) { State &= ~stateToDisable; } public void EnableState(PlayerState stateToEnable) { State |= stateToEnable; } public bool HasState(PlayerState stateToCheck) { return ((State & stateToCheck) == stateToCheck); } }
mit
C#
ca98325c82e2288a9215932c46c1fcb61ad35ca8
Set default <UpdateFrameCount> to 10
Trojaner25/Rocket-Safezone,Trojaner25/Rocket-Regions
RegionsConfiguration.cs
RegionsConfiguration.cs
using System.Collections.Generic; using Rocket.API; using RocketRegions.Model; namespace RocketRegions { public class RegionsConfiguration : IRocketPluginConfiguration { public int UpdateFrameCount; public List<Region> Regions; public string UrlOpenMessage; public void LoadDefaults() { Regions = new List<Region>(); UpdateFrameCount = 10; UrlOpenMessage = "Visit webpage"; } } }
using System.Collections.Generic; using Rocket.API; using RocketRegions.Model; namespace RocketRegions { public class RegionsConfiguration : IRocketPluginConfiguration { public int UpdateFrameCount; public List<Region> Regions; public string UrlOpenMessage; public void LoadDefaults() { Regions = new List<Region>(); UpdateFrameCount = 1; UrlOpenMessage = "Visit webpage"; } } }
agpl-3.0
C#
4744ecc11c934bb407c3416f8721ad31a5a27fb2
Add copyright assembly info
iridinite/shiftdrive
Client/Properties/AssemblyInfo.cs
Client/Properties/AssemblyInfo.cs
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("ShiftDrive")] [assembly: AssemblyProduct("Project ShiftDrive")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("Project ShiftDrive Client")] [assembly: AssemblyCompany("Mika Molenkamp")] [assembly: AssemblyCopyright("Copyright (C) Mika Molenkamp, 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("76532173-3cf3-4519-966a-8d3dbc0267f6")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.0.0")] [assembly: AssemblyFileVersion("0.1.0.0")]
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("ShiftDrive")] [assembly: AssemblyProduct("Project ShiftDrive")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("Project ShiftDrive Client")] [assembly: AssemblyCompany("Mika Molenkamp")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("76532173-3cf3-4519-966a-8d3dbc0267f6")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.0.0")] [assembly: AssemblyFileVersion("0.1.0.0")]
bsd-3-clause
C#
579bdb0ee5287f404ab12a1035f2a47cb73d3ee0
Add "Input Mode", "File" options to "Popup" action
danielchalmers/DesktopWidgets
DesktopWidgets/Actions/PopupAction.cs
DesktopWidgets/Actions/PopupAction.cs
using System.ComponentModel; using System.IO; using System.Windows; using DesktopWidgets.Classes; namespace DesktopWidgets.Actions { internal class PopupAction : ActionBase { public FilePath FilePath { get; set; } = new FilePath(); [DisplayName("Text")] public string Text { get; set; } = ""; [DisplayName("Input Mode")] public InputMode InputMode { get; set; } = InputMode.Text; [DisplayName("Title")] public string Title { get; set; } = ""; [DisplayName("Image")] public MessageBoxImage Image { get; set; } protected override void ExecuteAction() { base.ExecuteAction(); var input = string.Empty; switch (InputMode) { case InputMode.Clipboard: input = Clipboard.GetText(); break; case InputMode.File: input = File.ReadAllText(FilePath.Path); break; case InputMode.Text: input = Text; break; } MessageBox.Show(input, Title, MessageBoxButton.OK, Image); } } }
using System.ComponentModel; using System.Windows; namespace DesktopWidgets.Actions { internal class PopupAction : ActionBase { [DisplayName("Text")] public string Text { get; set; } = ""; [DisplayName("Title")] public string Title { get; set; } = ""; [DisplayName("Image")] public MessageBoxImage Image { get; set; } protected override void ExecuteAction() { base.ExecuteAction(); MessageBox.Show(Text, Title, MessageBoxButton.OK, Image); } } }
apache-2.0
C#
c695d41c47c8baa48db1a590fe7378641a9e0ab9
Use lowercase name for package folders (#2162)
bingbing8/PowerShell,jsoref/PowerShell,KarolKaczmarek/PowerShell,KarolKaczmarek/PowerShell,bingbing8/PowerShell,daxian-dbw/PowerShell,JamesWTruher/PowerShell-1,jsoref/PowerShell,bmanikm/PowerShell,PaulHigin/PowerShell,KarolKaczmarek/PowerShell,TravisEz13/PowerShell,JamesWTruher/PowerShell-1,bingbing8/PowerShell,jsoref/PowerShell,daxian-dbw/PowerShell,TravisEz13/PowerShell,PaulHigin/PowerShell,TravisEz13/PowerShell,daxian-dbw/PowerShell,bmanikm/PowerShell,JamesWTruher/PowerShell-1,KarolKaczmarek/PowerShell,bmanikm/PowerShell,KarolKaczmarek/PowerShell,PaulHigin/PowerShell,TravisEz13/PowerShell,bmanikm/PowerShell,bingbing8/PowerShell,bmanikm/PowerShell,jsoref/PowerShell,JamesWTruher/PowerShell-1,PaulHigin/PowerShell,jsoref/PowerShell,daxian-dbw/PowerShell,bingbing8/PowerShell
src/TypeCatalogParser/Main.cs
src/TypeCatalogParser/Main.cs
using System; using System.IO; using System.Linq; using NuGet.Frameworks; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.ProjectModel; using Microsoft.DotNet.ProjectModel.Graph; using Microsoft.Extensions.DependencyModel.Resolution; namespace TypeCatalogParser { public class Program { public static void Main(string[] args) { // These are packages that are not part of .NET Core and must be excluded string[] excludedPackages = { "Microsoft.Management.Infrastructure", "Microsoft.Management.Infrastructure.Native", "Microsoft.mshtml" }; // The TypeCatalogGen project takes this as input var outputPath = "../TypeCatalogGen/powershell.inc"; // Get a context for our top level project var context = ProjectContext.Create("../Microsoft.PowerShell.SDK", NuGetFramework.Parse("netstandard1.6")); System.IO.File.WriteAllLines(outputPath, // Get the target for the current runtime from t in context.LockFile.Targets where t.RuntimeIdentifier == context.RuntimeIdentifier // Get the packages (not projects) from x in t.Libraries where (x.Type == "package" && !excludedPackages.Contains(x.Name)) // Get the real reference assemblies from y in x.CompileTimeAssemblies where y.Path.EndsWith(".dll") // Construct the path to the assemblies select $"{context.PackagesDirectory}/{x.Name.ToLower()}/{x.Version}/{y.Path};"); Console.WriteLine($"List of reference assemblies written to {outputPath}"); } } }
using System; using System.IO; using System.Linq; using NuGet.Frameworks; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.ProjectModel; using Microsoft.DotNet.ProjectModel.Graph; using Microsoft.Extensions.DependencyModel.Resolution; namespace TypeCatalogParser { public class Program { public static void Main(string[] args) { // These are packages that are not part of .NET Core and must be excluded string[] excludedPackages = { "Microsoft.Management.Infrastructure", "Microsoft.Management.Infrastructure.Native", "Microsoft.mshtml" }; // The TypeCatalogGen project takes this as input var outputPath = "../TypeCatalogGen/powershell.inc"; // Get a context for our top level project var context = ProjectContext.Create("../Microsoft.PowerShell.SDK", NuGetFramework.Parse("netstandard1.6")); System.IO.File.WriteAllLines(outputPath, // Get the target for the current runtime from t in context.LockFile.Targets where t.RuntimeIdentifier == context.RuntimeIdentifier // Get the packages (not projects) from x in t.Libraries where (x.Type == "package" && !excludedPackages.Contains(x.Name)) // Get the real reference assemblies from y in x.CompileTimeAssemblies where y.Path.EndsWith(".dll") // Construct the path to the assemblies select $"{context.PackagesDirectory}/{x.Name}/{x.Version}/{y.Path};"); Console.WriteLine($"List of reference assemblies written to {outputPath}"); } } }
mit
C#
2d92a99e35e0a6fd783b220181a0c104c7416184
Add version field and make CheckForErrors less accessible from outside.
icedream/gmadsharp
src/addoncreator/AddonJson.cs
src/addoncreator/AddonJson.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using Newtonsoft.Json; namespace GarrysMod.AddonCreator { public class AddonJson { [JsonProperty("title")] public string Title { get; set; } [JsonProperty("description")] public string Description { get; set; } [JsonProperty("type")] public string Type { get; set; } [JsonProperty("tags")] public List<string> Tags { get; set; } [JsonProperty("ignore")] public List<string> Ignores { get; set; } [JsonProperty("version")] public int Version { get; set; } internal void CheckForErrors() { if (string.IsNullOrEmpty(Title)) { throw new MissingFieldException("Title is empty or not specified."); } if (!string.IsNullOrEmpty(Description) && Description.Contains('\0')) { throw new InvalidDataException("Description contains NULL character."); } if (string.IsNullOrEmpty(Type)) { throw new MissingFieldException("Type is empty or not specified."); } } public void RemoveIgnoredFiles(ref Dictionary<string, AddonFileInfo> files) { foreach (var key in files.Keys.ToArray()) // ToArray makes a shadow copy of Keys to avoid "mid-loop-removal" conflicts { if (Ignores.Any(w => w.WildcardRegex().IsMatch(key))) files.Remove(key); } } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using Newtonsoft.Json; namespace GarrysMod.AddonCreator { public class AddonJson { [JsonProperty("title")] public string Title { get; set; } [JsonProperty("description")] public string Description { get; set; } [JsonProperty("type")] public string Type { get; set; } [JsonProperty("tags")] public List<string> Tags { get; set; } [JsonProperty("ignore")] public List<string> Ignores { get; set; } public void CheckForErrors() { if (string.IsNullOrEmpty(Title)) { throw new MissingFieldException("Title is empty or not specified."); } if (!string.IsNullOrEmpty(Description) && Description.Contains('\0')) { throw new InvalidDataException("Description contains NULL character."); } if (string.IsNullOrEmpty(Type)) { throw new MissingFieldException("Type is empty or not specified."); } } public void RemoveIgnoredFiles(ref Dictionary<string, AddonFileInfo> files) { foreach (var key in files.Keys.ToArray()) // ToArray makes a shadow copy of Keys to avoid "mid-loop-removal" conflicts { if (Ignores.Any(w => w.WildcardRegex().IsMatch(key))) files.Remove(key); } } } }
mit
C#
16676b018c40ded091519f8b2a6c6d43f6504db6
Increase version to 1.1.3
bungeemonkee/Transformerizer
Transformerizer/Properties/AssemblyInfo.cs
Transformerizer/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; // 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("Transformerizer")] [assembly: AssemblyDescription("Transformerizer: Parallel transform library for .NET")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif [assembly: AssemblyCompany("David Love")] [assembly: AssemblyProduct("Transformerizer")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // Version information for an assembly consists of the following four values. // We will increase these values in the following way: // Major Version : Increased when there is a release that breaks a public api // Minor Version : Increased for each non-api-breaking release // Build Number : 0 for alpha versions, 1 for beta versions, 2 for release candidates, 3 for releases // Revision : Always 0 for release versions, always 1+ for alpha, beta, rc versions to indicate the alpha/beta/rc number [assembly: AssemblyVersion("1.1.3.0")] [assembly: AssemblyFileVersion("1.1.3.0")] // This version number will roughly follow semantic versioning : http://semver.org // The first three numbers will always match the first the numbers of the version above. [assembly: AssemblyInformationalVersion("1.1.3")]
using System.Reflection; using System.Resources; // 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("Transformerizer")] [assembly: AssemblyDescription("Transformerizer: Parallel transform library for .NET")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif [assembly: AssemblyCompany("David Love")] [assembly: AssemblyProduct("Transformerizer")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // Version information for an assembly consists of the following four values. // We will increase these values in the following way: // Major Version : Increased when there is a release that breaks a public api // Minor Version : Increased for each non-api-breaking release // Build Number : 0 for alpha versions, 1 for beta versions, 2 for release candidates, 3 for releases // Revision : Always 0 for release versions, always 1+ for alpha, beta, rc versions to indicate the alpha/beta/rc number [assembly: AssemblyVersion("1.1.1.3")] [assembly: AssemblyFileVersion("1.1.1.3")] // This version number will roughly follow semantic versioning : http://semver.org // The first three numbers will always match the first the numbers of the version above. [assembly: AssemblyInformationalVersion("1.1.1-beta3")]
mit
C#
7a9ed78527d1f9c02d7e3509011cc6be5a8ec60b
Remove missed leftover usages
smoogipoo/osu,peppy/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,ppy/osu,ppy/osu,UselessToucan/osu,smoogipooo/osu,UselessToucan/osu,ppy/osu,peppy/osu,peppy/osu,smoogipoo/osu,peppy/osu-new,NeoAdonis/osu,UselessToucan/osu
osu.Game.Tests/Resources/TestResources.cs
osu.Game.Tests/Resources/TestResources.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.IO; using NUnit.Framework; using osu.Framework; using osu.Framework.IO.Stores; namespace osu.Game.Tests.Resources { public static class TestResources { public static DllResourceStore GetStore() => new DllResourceStore(typeof(TestResources).Assembly); public static Stream OpenResource(string name) => GetStore().GetStream($"Resources/{name}"); public static Stream GetTestBeatmapStream(bool virtualTrack = false) => OpenResource($"Archives/241526 Soleily - Renatus{(virtualTrack ? "_virtual" : "")}.osz"); public static string GetTestBeatmapForImport(bool virtualTrack = false) { var tempPath = Path.Combine(RuntimeInfo.StartupDirectory, Path.GetTempFileName() + ".osz"); using (var stream = GetTestBeatmapStream(virtualTrack)) using (var newFile = File.Create(tempPath)) stream.CopyTo(newFile); Assert.IsTrue(File.Exists(tempPath)); return tempPath; } } }
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.IO; using NUnit.Framework; using osu.Framework; using osu.Framework.IO.Stores; namespace osu.Game.Tests.Resources { public static class TestResources { public static DllResourceStore GetStore() => new DllResourceStore(typeof(TestResources).Assembly); public static Stream OpenResource(string name) => GetStore().GetStream($"Resources/{name}"); public static Stream GetTestBeatmapStream(bool virtualTrack = false) => OpenResource($"Archives/241526 Soleily - Renatus{(virtualTrack ? "_virtual" : "")}.osz"); public static string GetTestBeatmapForImport(bool virtualTrack = false) { var temp = Path.GetTempFileName() + ".osz"; using (var stream = GetTestBeatmapStream(virtualTrack)) using (var newFile = RuntimeInfo.StartupStorage.GetStream(temp, FileAccess.Write)) stream.CopyTo(newFile); Assert.IsTrue(RuntimeInfo.StartupStorage.Exists(temp)); return temp; } } }
mit
C#
f5df6f05a2aa19f5285110d8fdaad696282ac395
test fix
janmarek/Felbook,janmarek/Felbook
Felbook.Tests/Fakes/MockStatusService.cs
Felbook.Tests/Fakes/MockStatusService.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Felbook.Models; namespace Felbook.Tests.Fakes { class MockStatusService : AbstractMockService, IStatusService { public MockStatusService(MockModel model) : base(model) { } #region Interface methods public Status FindStatusById(int id) { throw new NotImplementedException(); } public void AddCommentToStatus(User author, Status commentedStatus, string text) { throw new NotImplementedException(); } public void AddStatus(User user, Group group, Event ev, StatusFormModel formModel) { throw new NotImplementedException(); } public void AddStatus(User user, Event ev, StatusFormModel formModel) { throw new NotImplementedException(); } public void AddStatus(User user, Group group, StatusFormModel formModel) { throw new NotImplementedException(); } public void AddStatus(User user, StatusFormModel formModel) { throw new NotImplementedException(); } #endregion } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Felbook.Models; namespace Felbook.Tests.Fakes { class MockStatusService : AbstractMockService, IStatusService { public MockStatusService(MockModel model) : base(model) { } #region Interface methods public Status FindStatusById(int id) { throw new NotImplementedException(); } public void AddCommentToStatus(User author, Status commentedStatus, string text) { throw new NotImplementedException(); } public void AddStatus(User user, Group group, StatusFormModel formModel) { throw new NotImplementedException(); } public void AddStatus(User user, StatusFormModel formModel) { throw new NotImplementedException(); } #endregion } }
mit
C#
96b0897872f48994ed92bb70e7cd8c41b2fa65d7
bump version
Fody/Janitor
CommonAssemblyInfo.cs
CommonAssemblyInfo.cs
using System.Reflection; [assembly: AssemblyVersion("1.1.6")] [assembly: AssemblyFileVersion("1.1.6")]
using System.Reflection; [assembly: AssemblyVersion("1.1.5")] [assembly: AssemblyFileVersion("1.1.5")]
mit
C#
6f7a7b9c18f11ef9a7013133b897bbeac44920cd
Remove unused Toolbar options until we actually make use of them
IrvingtonProgramming/InteractApp,IrvingtonProgramming/InteractApp,IrvingtonProgramming/InteractApp
InteractApp/EventListPage.xaml.cs
InteractApp/EventListPage.xaml.cs
using System; using System.Diagnostics; using Xamarin.Forms; using InteractApp; namespace InteractApp { public class EventListPageBase : ViewPage<EventListPageViewModel> { } public partial class EventListPage : EventListPageBase { public EventListPage () { InitializeComponent (); this.Title = "Events"; Padding = new Thickness (0, 0, 0, 0); // ToolbarItems.Add (new ToolbarItem { // Text = "My Info", // Order = ToolbarItemOrder.Primary, // Command = new Command (this.ShowMyInfoPage), // }); // ToolbarItems.Add (new ToolbarItem { // Text = "My Events", // Order = ToolbarItemOrder.Primary, // }); //To hide iOS list seperator EventList.SeparatorVisibility = SeparatorVisibility.None; ViewModel.LoadEventsCommand.Execute (null); EventList.ItemTapped += async (sender, e) => { Event evt = (Event)e.Item; Debug.WriteLine ("Tapped: " + (evt.Name)); var page = new EventInfoPage (evt); ((ListView)sender).SelectedItem = null; await Navigation.PushAsync (page); }; } private void ShowMyInfoPage () { Navigation.PushAsync (new MyInfoPage ()); } } }
using System; using System.Diagnostics; using Xamarin.Forms; using InteractApp; namespace InteractApp { public class EventListPageBase : ViewPage<EventListPageViewModel> { } public partial class EventListPage : EventListPageBase { public EventListPage () { InitializeComponent (); this.Title = "Events"; Padding = new Thickness (0, 0, 0, 0); ToolbarItems.Add (new ToolbarItem { Text = "My Info", Order = ToolbarItemOrder.Primary, Command = new Command (this.ShowMyInfoPage), }); ToolbarItems.Add (new ToolbarItem { Text = "My Events", Order = ToolbarItemOrder.Primary, }); //To hide iOS list seperator EventList.SeparatorVisibility = SeparatorVisibility.None; ViewModel.LoadEventsCommand.Execute (null); EventList.ItemTapped += async (sender, e) => { Event evt = (Event)e.Item; Debug.WriteLine ("Tapped: " + (evt.Name)); var page = new EventInfoPage (evt); ((ListView)sender).SelectedItem = null; await Navigation.PushAsync (page); }; } private void ShowMyInfoPage () { Navigation.PushAsync (new MyInfoPage ()); } } }
mit
C#
d704507823b5c4a107fcab0fff70a1db28fbca41
Write Position using the Position Writer Function
Dreadlow/PolarisServer,MrSwiss/PolarisServer,PolarisTeam/PolarisServer,cyberkitsune/PolarisServer,lockzag/PolarisServer
PolarisServer/Models/PSOObject.cs
PolarisServer/Models/PSOObject.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using PolarisServer.Packets; namespace PolarisServer.Models { public class PSOObject { public struct PSOObjectThing { public UInt32 data; } public EntityHeader Header { get; set; } public MysteryPositions Position { get; set; } public string Name { get; set; } public UInt32 ThingFlag { get; set; } public PSOObjectThing[] things { get; set; } public byte[] GenerateSpawnBlob() { PacketWriter writer = new PacketWriter(); writer.WriteStruct(Header); writer.Write(Position); writer.Seek(2, SeekOrigin.Current); // Padding I guess... writer.WriteFixedLengthASCII(Name, 0x34); writer.Write(ThingFlag); writer.Write(things.Length); foreach (PSOObjectThing thing in things) { writer.WriteStruct(thing); } return writer.ToArray(); } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using PolarisServer.Packets; namespace PolarisServer.Models { public class PSOObject { public struct PSOObjectThing { public UInt32 data; } public EntityHeader Header { get; set; } public MysteryPositions Position { get; set; } public string Name { get; set; } public UInt32 ThingFlag { get; set; } public PSOObjectThing[] things { get; set; } public byte[] GenerateSpawnBlob() { PacketWriter writer = new PacketWriter(); writer.WriteStruct(Header); writer.WriteStruct(Position); writer.Seek(2, SeekOrigin.Current); // Padding I guess... writer.WriteFixedLengthASCII(Name, 0x34); writer.Write(ThingFlag); writer.Write(things.Length); foreach (PSOObjectThing thing in things) { writer.WriteStruct(thing); } return writer.ToArray(); } } }
agpl-3.0
C#
fd1cbf8ead236986f4065217bc678241eb2ae754
Update FadeParticlesNearPoint.cs
grreuze/Utils
Scripts/FadeParticlesNearPoint.cs
Scripts/FadeParticlesNearPoint.cs
using UnityEngine; [ExecuteInEditMode] [RequireComponent(typeof(ParticleSystem))] public class FadeParticlesNearPoint : MonoBehaviour { ParticleSystem ps; [Header("Use \"Infinity\" to ignore an axis")] [SerializeField] Vector3 point; [SerializeField] float radius; [SerializeField] float startFadeDistance = 3; [SerializeField] bool killParticleWhenFaded; bool isLocal; bool ignoreX, ignoreY, ignoreZ; Color startColor; void Start() { ps = GetComponent<ParticleSystem>(); isLocal = ps.main.simulationSpace == ParticleSystemSimulationSpace.Local; } void OnValidate() { ignoreX = point.x == Mathf.Infinity; ignoreY = point.y == Mathf.Infinity; ignoreZ = point.z == Mathf.Infinity; } void LateUpdate() { ParticleSystem.Particle[] particles = new ParticleSystem.Particle[ps.main.maxParticles]; startColor = ps.main.startColor.color; int count = ps.GetParticles(particles); for (int i = 0; i < count; i++) { ParticleSystem.Particle p = particles[i]; Vector3 pos = isLocal ? transform.TransformPoint(p.position) : p.position; float distance = 0; if (!ignoreX) distance += (pos.x - point.x) * (pos.x - point.x); if (!ignoreY) distance += (pos.y - point.y) * (pos.y - point.y); if (!ignoreZ) distance += (pos.z - point.z) * (pos.z - point.z); distance = Mathf.Sqrt(distance); if (distance < startFadeDistance + radius) { Color color = p.startColor; color.a = startColor.a * Mathf.InverseLerp(radius, startFadeDistance + radius, distance); p.startColor = color; if (killParticleWhenFaded && distance < radius) p.remainingLifetime = 0; particles[i] = p; } else { p.startColor = startColor; particles[i] = p; } } ps.SetParticles(particles, count); } }
using UnityEngine; [ExecuteInEditMode] [RequireComponent(typeof(ParticleSystem))] public class FadeParticlesNearPoint : MonoBehaviour { ParticleSystem ps; [Header("Use \"Infinity\" to ignore an axis")] [SerializeField] Vector3 point; [SerializeField] float radius; [SerializeField] float startFadeDistance = 3; [SerializeField] bool killParticleWhenFaded; bool isLocal; bool ignoreX, ignoreY, ignoreZ; Color startColor; void Start() { ps = GetComponent<ParticleSystem>(); isLocal = ps.main.simulationSpace == ParticleSystemSimulationSpace.Local; ignoreX = point.x == Mathf.Infinity; ignoreY = point.y == Mathf.Infinity; ignoreZ = point.z == Mathf.Infinity; } void LateUpdate() { ParticleSystem.Particle[] particles = new ParticleSystem.Particle[ps.main.maxParticles]; startColor = ps.main.startColor.color; int count = ps.GetParticles(particles); for (int i = 0; i < count; i++) { ParticleSystem.Particle p = particles[i]; Vector3 pos = isLocal ? transform.TransformPoint(p.position) : p.position; if (ignoreX) point.x = pos.x; if (ignoreY) point.y = pos.y; if (ignoreZ) point.z = pos.z; float distance = Vector3.Distance(pos, point); if (distance < startFadeDistance + radius) { Color color = p.startColor; color.a = startColor.a * Mathf.InverseLerp(radius, startFadeDistance + radius, distance); p.startColor = color; if (killParticleWhenFaded && distance < radius) p.remainingLifetime = 0; particles[i] = p; } else { p.startColor = startColor; particles[i] = p; } } ps.SetParticles(particles, count); } }
mit
C#
87379543670b053975b6132e1e98284c11792cbd
Use Only Razor VE
ASP-MVC/OMX-System,ASP-MVC/OMX-System,ASP-MVC/OMX-System
Source/OMX/OMX.Web/Global.asax.cs
Source/OMX/OMX.Web/Global.asax.cs
namespace OMX.Web { using System.Collections.Generic; using System.Data.Entity; using System.Reflection; using System.Web; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; using OMX.Data; using OMX.Data.Migrations; using OMX.Infrastructure.Mappings; public class MvcApplication : HttpApplication { protected void Application_Start() { this.UseOnlyRazorViewEngine(); this.LoadAutoMapper(); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); } private void UseOnlyRazorViewEngine() { ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new RazorViewEngine()); } private void LoadAutoMapper() { var autoMapperConfig = new AutoMapperConfig(new List<Assembly>() { Assembly.GetExecutingAssembly() }); autoMapperConfig.Execute(); } } }
namespace OMX.Web { using System.Collections.Generic; using System.Data.Entity; using System.Reflection; using System.Web; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; using OMX.Data; using OMX.Data.Migrations; using OMX.Infrastructure.Mappings; public class MvcApplication : HttpApplication { protected void Application_Start() { this.LoadAutoMapper(); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); } private void LoadAutoMapper() { var autoMapperConfig = new AutoMapperConfig(new List<Assembly>() { Assembly.GetExecutingAssembly() }); autoMapperConfig.Execute(); } } }
mit
C#
0c7ab5397a9d1fe73d70004b64c953a32320f04f
Simplify test
kei10in/KipSharp
KipTest/PrintSchemaCapabilitiesTests.cs
KipTest/PrintSchemaCapabilitiesTests.cs
using Kip; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xunit; using psk = Kip.PrintSchemaKeywords; namespace KipTest { public class PrintSchemaCapabilitiesTests { [Fact] public void FindPropertyByNameTest() { var pc = new PrintSchemaCapabilities(); pc.Add(new PrintSchemaProperty(psk.DisplayName, "value")); var p = pc.Property(psk.DisplayName); Assert.Equal("value", p.Value); } } }
using Kip; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xunit; using psk = Kip.PrintSchemaKeywords; namespace KipTest { public class PrintSchemaCapabilitiesTests { [Fact] public void FindPropertyByNameTest() { var pc = new PrintSchemaCapabilities(); pc.Add(new PrintSchemaProperty(psk.DisplayName, "value")); var p = pc.Property(psk.DisplayName); var s = p.Value.AsString(); Assert.Equal("value", s); } } }
mit
C#
4e58247b0580a07ce337821dbbba4920e84273d8
Add RedirectUrl for purchase redirection
ParcelForMe/p4m-demo-shop,ParcelForMe/p4m-demo-shop,ParcelForMe/p4m-demo-shop,ParcelForMe/p4m-demo-shop
OpenOrderFramework/Models/P4MMessages.cs
OpenOrderFramework/Models/P4MMessages.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OpenOrderFramework.Models { public class P4MBaseMessage { public bool Success { get { return string.IsNullOrWhiteSpace(Error); } } public string Error { get; set; } } public class LoginMessage : P4MBaseMessage { public string RedirectUrl { get; set; } } public class ConsumerMessage : P4MBaseMessage { public Consumer Consumer { get; set; } public bool HasOpenCart { get; set; } } public class CartMessage : P4MBaseMessage { public P4MCart Cart { get; set; } public P4MAddress BillTo { get; set; } public P4MAddress DeliverTo { get; set; } } public class DiscountMessage : P4MBaseMessage { public string Code { get; set; } public decimal Tax { get; set; } public string Description { get; set; } public decimal Amount { get; set; } } public class CartUpdateMessage : P4MBaseMessage { public decimal Tax { get; set; } public decimal Shipping { get; set; } public decimal Discount { get; set; } } public class PurchaseMessage : P4MBaseMessage { public string Id { get; set; } public string TransactionTypeCode { get; set; } public string AuthCode { get; set; } public P4MCart Cart { get; set; } public P4MAddress DeliverTo { get; set; } public P4MAddress BillTo { get; set; } public string RedirectUrl { get; set; } // 3D Secure fields public string ACSUrl { get; set; } public string PaReq { get; set; } public string ACSResponseUrl { get; set; } public string P4MData { get; set; } } public class PostCartMessage : P4MBaseMessage { public string SessionId { get; set; } public bool ClearItems { get; set; } public P4MCart Cart { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OpenOrderFramework.Models { public class P4MBaseMessage { public bool Success { get { return string.IsNullOrWhiteSpace(Error); } } public string Error { get; set; } } public class LoginMessage : P4MBaseMessage { public string RedirectUrl { get; set; } } public class ConsumerMessage : P4MBaseMessage { public Consumer Consumer { get; set; } public bool HasOpenCart { get; set; } } public class CartMessage : P4MBaseMessage { public P4MCart Cart { get; set; } public P4MAddress BillTo { get; set; } public P4MAddress DeliverTo { get; set; } } public class DiscountMessage : P4MBaseMessage { public string Code { get; set; } public decimal Tax { get; set; } public string Description { get; set; } public decimal Amount { get; set; } } public class CartUpdateMessage : P4MBaseMessage { public decimal Tax { get; set; } public decimal Shipping { get; set; } public decimal Discount { get; set; } } public class PurchaseMessage : P4MBaseMessage { public string Id { get; set; } public string TransactionTypeCode { get; set; } public string AuthCode { get; set; } public P4MCart Cart { get; set; } public P4MAddress DeliverTo { get; set; } public P4MAddress BillTo { get; set; } // 3D Secure fields public string ACSUrl { get; set; } public string PaReq { get; set; } public string ACSResponseUrl { get; set; } public string P4MData { get; set; } } public class PostCartMessage : P4MBaseMessage { public string SessionId { get; set; } public bool ClearItems { get; set; } public P4MCart Cart { get; set; } } }
mit
C#
b3072cf343e15ec58a70295cc66996a44e30ff1d
Mark ScriptException as [Serializable] for when it has to cross AppDomains
ft-/opensim-optimizations-wip,ft-/arribasim-dev-extras,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,ft-/arribasim-dev-tests,bravelittlescientist/opensim-performance,QuillLittlefeather/opensim-1,QuillLittlefeather/opensim-1,ft-/arribasim-dev-tests,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,rryk/omp-server,RavenB/opensim,ft-/opensim-optimizations-wip-tests,Michelle-Argus/ArribasimExtract,TomDataworks/opensim,OpenSimian/opensimulator,QuillLittlefeather/opensim-1,justinccdev/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,BogusCurry/arribasim-dev,RavenB/opensim,ft-/opensim-optimizations-wip,Michelle-Argus/ArribasimExtract,TomDataworks/opensim,ft-/arribasim-dev-extras,rryk/omp-server,TomDataworks/opensim,OpenSimian/opensimulator,ft-/opensim-optimizations-wip-tests,Michelle-Argus/ArribasimExtract,QuillLittlefeather/opensim-1,OpenSimian/opensimulator,ft-/opensim-optimizations-wip-extras,ft-/arribasim-dev-tests,ft-/opensim-optimizations-wip-extras,ft-/opensim-optimizations-wip-tests,bravelittlescientist/opensim-performance,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,ft-/opensim-optimizations-wip-tests,ft-/arribasim-dev-tests,TomDataworks/opensim,BogusCurry/arribasim-dev,QuillLittlefeather/opensim-1,ft-/arribasim-dev-extras,Michelle-Argus/ArribasimExtract,BogusCurry/arribasim-dev,justinccdev/opensim,M-O-S-E-S/opensim,ft-/opensim-optimizations-wip-extras,ft-/opensim-optimizations-wip-tests,M-O-S-E-S/opensim,M-O-S-E-S/opensim,OpenSimian/opensimulator,BogusCurry/arribasim-dev,bravelittlescientist/opensim-performance,rryk/omp-server,ft-/opensim-optimizations-wip,RavenB/opensim,rryk/omp-server,justinccdev/opensim,QuillLittlefeather/opensim-1,bravelittlescientist/opensim-performance,ft-/arribasim-dev-extras,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,rryk/omp-server,BogusCurry/arribasim-dev,TomDataworks/opensim,ft-/opensim-optimizations-wip,ft-/arribasim-dev-tests,M-O-S-E-S/opensim,ft-/arribasim-dev-extras,rryk/omp-server,bravelittlescientist/opensim-performance,Michelle-Argus/ArribasimExtract,justinccdev/opensim,QuillLittlefeather/opensim-1,ft-/opensim-optimizations-wip-extras,RavenB/opensim,ft-/arribasim-dev-extras,TomDataworks/opensim,OpenSimian/opensimulator,M-O-S-E-S/opensim,TomDataworks/opensim,ft-/arribasim-dev-tests,M-O-S-E-S/opensim,OpenSimian/opensimulator,justinccdev/opensim,BogusCurry/arribasim-dev,OpenSimian/opensimulator,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,ft-/opensim-optimizations-wip-extras,RavenB/opensim,justinccdev/opensim,RavenB/opensim,RavenB/opensim,Michelle-Argus/ArribasimExtract,M-O-S-E-S/opensim,bravelittlescientist/opensim-performance
OpenSim/Region/ScriptEngine/Shared/ScriptException.cs
OpenSim/Region/ScriptEngine/Shared/ScriptException.cs
/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the OpenSimulator Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; namespace OpenSim.Region.ScriptEngine.Shared { [Serializable] public class ScriptException : Exception { public ScriptException() : base() {} public ScriptException(string message) : base(message) {} public ScriptException(string message, Exception innerException) : base(message, innerException) {} } }
/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the OpenSimulator Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; namespace OpenSim.Region.ScriptEngine.Shared { public class ScriptException : Exception { public ScriptException() : base() {} public ScriptException(string message) : base(message) {} public ScriptException(string message, Exception innerException) : base(message, innerException) {} } }
bsd-3-clause
C#
2c3505c684043e65e5a1eafb85184aebb007e0a1
Modify AssemblyInfo.cs
Banane9/XmlRpc
XmlRpc/Properties/AssemblyInfo.cs
XmlRpc/Properties/AssemblyInfo.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die mit einer Assembly verknüpft sind. [assembly: AssemblyTitle("XmlRpc")] [assembly: AssemblyDescription("Implementation of the Xml-Rpc Spec.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("XmlRpc")] [assembly: AssemblyCopyright("Copyright © Banane9 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von // COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. [assembly: ComVisible(false)] // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird [assembly: Guid("5e546fe3-3da8-4fa2-b018-60071bfdcbc6")] // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: // // Hauptversion // Nebenversion // Buildnummer // Revision // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.0.*")] [assembly: AssemblyFileVersion("2.0.*")]
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die mit einer Assembly verknüpft sind. [assembly: AssemblyTitle("XmlRpc")] [assembly: AssemblyDescription("Implementation of the Xml-Rpc Spec.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("XmlRpc")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von // COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. [assembly: ComVisible(false)] // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird [assembly: Guid("5e546fe3-3da8-4fa2-b018-60071bfdcbc6")] // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: // // Hauptversion // Nebenversion // Buildnummer // Revision // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
lgpl-2.1
C#
ac6625f7b04fcf0ee4682cb2d7225ac571fa62dd
update ProtocolVersions
TomDataworks/opensim,TomDataworks/opensim,RavenB/opensim,TomDataworks/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,RavenB/opensim,RavenB/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,TomDataworks/opensim,TomDataworks/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,TomDataworks/opensim,RavenB/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,TomDataworks/opensim,RavenB/opensim,RavenB/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,RavenB/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC
OpenSim/Server/Base/ProtocolVersions.cs
OpenSim/Server/Base/ProtocolVersions.cs
/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the OpenSimulator Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ namespace OpenSim.Server.Base { public class ProtocolVersions { /// <value> /// This is the external protocol versions. It is separate from the OpenSimulator project version. /// /// These version numbers should be increased by 1 every time a code /// change in the Service.Connectors and Server.Handlers, espectively, /// makes the previous OpenSimulator revision incompatible /// with the new revision. /// /// Changes which are compatible with an older revision (e.g. older revisions experience degraded functionality /// but not outright failure) do not need a version number increment. /// /// Having this version number allows the grid service to reject connections from regions running a version /// of the code that is too old. /// /// </value> // The range of acceptable servers for client-side connectors public readonly static int ClientProtocolVersionMin = 1; public readonly static int ClientProtocolVersionMax = 1; // The range of acceptable clients in server-side handlers public readonly static int ServerProtocolVersionMin = 1; public readonly static int ServerProtocolVersionMax = 1; } }
/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the OpenSimulator Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ namespace OpenSim.Server.Base { public class ProtocolVersions { /// <value> /// This is the external protocol versions. It is separate from the OpenSimulator project version. /// /// These version numbers should be increased by 1 every time a code /// change in the Service.Connectors and Server.Handlers, espectively, /// makes the previous OpenSimulator revision incompatible /// with the new revision. /// /// Changes which are compatible with an older revision (e.g. older revisions experience degraded functionality /// but not outright failure) do not need a version number increment. /// /// Having this version number allows the grid service to reject connections from regions running a version /// of the code that is too old. /// /// </value> // The range of acceptable servers for client-side connectors public readonly static int ClientProtocolVersionMin = 0; public readonly static int ClientProtocolVersionMax = 0; // The range of acceptable clients in server-side handlers public readonly static int ServerProtocolVersionMin = 0; public readonly static int ServerProtocolVersionMax = 0; } }
bsd-3-clause
C#
34dc61040278b937d8c6805dc94168ec49199ebb
Change comment test to reflect changed samples
villermen/runescape-cache-tools,villermen/runescape-cache-tools
RuneScapeCacheToolsTests/VorbisTests.cs
RuneScapeCacheToolsTests/VorbisTests.cs
using System; using System.IO; using System.Linq; using Villermen.RuneScapeCacheTools.Audio.Vorbis; using Xunit; using Xunit.Abstractions; namespace RuneScapeCacheToolsTests { public class VorbisTests : IDisposable { private ITestOutputHelper Output { get; } private VorbisReader Reader1 { get; } private VorbisReader Reader2 { get; } private VorbisWriter Writer { get; } public VorbisTests(ITestOutputHelper output) { Output = output; Reader1 = new VorbisReader(File.OpenRead("testdata/sample1.ogg")); Reader2 = new VorbisReader(File.OpenRead("testdata/sample2.ogg")); Writer = new VorbisWriter(File.OpenWrite("out.ogg")); } [Fact] public void TestReadComments() { Reader1.ReadPacket(); var commentPacket = Reader1.ReadPacket(); Output.WriteLine($"Type of packet: {commentPacket.GetType().FullName}"); Assert.IsType<VorbisCommentHeader>(commentPacket); var commentHeader = (VorbisCommentHeader)commentPacket; Output.WriteLine("Comments in header:"); foreach (var userComment in commentHeader.UserComments) { Output.WriteLine($" - {userComment.Item1}: {userComment.Item2}"); } Assert.True(commentHeader.UserComments.Contains(new Tuple<string, string>("DATE", "2012"))); } public void Dispose() { Reader1?.Dispose(); Reader2?.Dispose(); Writer?.Dispose(); } } }
using System; using System.IO; using System.Linq; using Villermen.RuneScapeCacheTools.Audio.Vorbis; using Xunit; using Xunit.Abstractions; namespace RuneScapeCacheToolsTests { public class VorbisTests : IDisposable { private ITestOutputHelper Output { get; } private VorbisReader Reader1 { get; } private VorbisReader Reader2 { get; } private VorbisWriter Writer { get; } public VorbisTests(ITestOutputHelper output) { Output = output; Reader1 = new VorbisReader(File.OpenRead("testdata/sample1.ogg")); Reader2 = new VorbisReader(File.OpenRead("testdata/sample2.ogg")); Writer = new VorbisWriter(File.OpenWrite("out.ogg")); } [Fact] public void TestReadComments() { Reader1.ReadPacket(); var commentPacket = Reader1.ReadPacket(); Output.WriteLine($"Type of packet: {commentPacket.GetType().FullName}"); Assert.IsType<VorbisCommentHeader>(commentPacket); var commentHeader = (VorbisCommentHeader)commentPacket; Output.WriteLine("Comments in header:"); foreach (var userComment in commentHeader.UserComments) { Output.WriteLine($" - {userComment.Item1}: {userComment.Item2}"); } Assert.True(commentHeader.UserComments.Contains(new Tuple<string, string>("genre", "Soundtrack"))); } public void Dispose() { Reader1?.Dispose(); Reader2?.Dispose(); Writer?.Dispose(); } } }
mit
C#
fca6ac5e48a9e85d69f64c87c4b673e2b67c29b3
Fix a little bug with the new counter. The rf frequency measurement is now tested and works.
jstammers/EDMSuite,jstammers/EDMSuite,Stok/EDMSuite,ColdMatter/EDMSuite,Stok/EDMSuite,ColdMatter/EDMSuite,jstammers/EDMSuite,jstammers/EDMSuite,ColdMatter/EDMSuite,jstammers/EDMSuite,ColdMatter/EDMSuite
DAQ/Agilent53131A.cs
DAQ/Agilent53131A.cs
using System; using System.Collections.Generic; using System.Text; using DAQ.Environment; namespace DAQ.HAL { public class Agilent53131A : FrequencyCounter { public Agilent53131A(String visaAddress) : base(visaAddress) {} public override double Frequency { get { if (!Environs.Debug) { Connect(); Write(":FUNC 'FREQ 1'"); Write(":FREQ:ARM:STAR:SOUR IMM"); Write(":FREQ:ARM:STOP:SOUR TIM"); Write(":FREQ:ARM:STOP:TIM 1.0"); Write("READ:FREQ?"); string fr = Read(); Disconnect(); return Double.Parse(fr); } else { return 170.730 + (new Random()).NextDouble(); } } } public override double Amplitude { get { throw new Exception("The method or operation is not implemented."); } } } }
using System; using System.Collections.Generic; using System.Text; using DAQ.Environment; namespace DAQ.HAL { public class Agilent53131A : FrequencyCounter { public Agilent53131A(String visaAddress) : base(visaAddress) {} public override double Frequency { get { if (!Environs.Debug) { Write(":FUNC 'FREQ 1'"); Write(":FREQ:ARM:STAR:SOUR IMM"); Write(":FREQ:ARM:STOP:SOUR TIM"); Write(":FREQ:ARM:STOP:TIM 1.0"); Write("READ:FREQ?"); string fr = Read(); return Double.Parse(fr); } else { return 170.730 + (new Random()).NextDouble(); } } } public override double Amplitude { get { throw new Exception("The method or operation is not implemented."); } } } }
mit
C#
a7de476c42f1d45d90d0faa2f2c6589bcfb504dd
add refusal field
Appleseed/base,Appleseed/base
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { class SolrResponseItem { public string id { get; set; } public string item_type { get; set; } public string address_1 { get; set; } public string city { get; set; } public string state { get; set; } public string classification { get; set; } public string country { get; set; } public string postal_code { get; set; } public string product_description { get; set; } public string product_quantity { get; set; } public string product_type { get; set; } public string code_info { get; set; } public string reason_for_recall { get; set; } public DateTime recall_initiation_date { get; set; } public string recall_number { get; set; } public string recalling_firm { get; set; } public string voluntary_mandated { get; set; } public DateTime report_date { get; set; } public string status { get; set; } public DateTime date_last_indexed { get; set; } //ICitations public string act_cfr { get; set; } public string program_area { get; set; } public string description_short { get; set; } public string description_long { get; set; } public DateTime end_date { get; set; } //IClassification public string district_decision { get; set; } public string district { get; set; } public DateTime inspection_end_date { get; set; } public string center { get; set; } public string project_area { get; set; } public string legal_name { get; set; } //IRefusal public string fei_number { get; set; } public string product_code { get; set; } public string product_code_description { get; set; } public DateTime refusal_date { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { class SolrResponseItem { public string id { get; set; } public string item_type { get; set; } public string address_1 { get; set; } public string city { get; set; } public string state { get; set; } public string classification { get; set; } public string country { get; set; } public string postal_code { get; set; } public string product_description { get; set; } public string product_quantity { get; set; } public string product_type { get; set; } public string code_info { get; set; } public string reason_for_recall { get; set; } public DateTime recall_initiation_date { get; set; } public string recall_number { get; set; } public string recalling_firm { get; set; } public string voluntary_mandated { get; set; } public DateTime report_date { get; set; } public string status { get; set; } public DateTime date_last_indexed { get; set; } //ICitations public string act_cfr { get; set; } public string program_area { get; set; } public string description_short { get; set; } public string description_long { get; set; } public DateTime end_date { get; set; } //IClassification public string district_decision { get; set; } public string district { get; set; } public DateTime inspection_end_date { get; set; } public string center { get; set; } public string project_area { get; set; } public string legal_name { get; set; } //IRefusal public string fei_number { get; set; } public string product_code { get; set; } public string product_code_description { get; set; } } }
apache-2.0
C#
c0367553dafda7b0217c9aa7775458bcbc1097e5
Add type conversion test
jxhv/spGet,jxhv/spGet
ASP.NET-MVC/Views/Home/Index.cshtml
ASP.NET-MVC/Views/Home/Index.cshtml
@{ Layout = null; } <!DOCTYPE html> <html> <head> <title>SpGet - StordProcedure to Script Framework</title> <style> * { font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } ul { margin:0; padding:0; } li { display:inline-block; width:120px; border-bottom:1px solid #808080; padding:7px; } #types td, #types th { border:1px solid #c0c0c0; } </style> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.0.min.js"></script> <script src="~/Scripts/spGet/spGet.js"></script> <script src="~/Scripts/demo.js"></script> <script> // names of stored procedures // if you want to hide stored procedure names... var sp_mem_add = "@Html.Raw(SpGet.Security.Encrypt("mem_add"))"; var sp_mem_del = "@Html.Raw(SpGet.Security.Encrypt("mem_del"))"; var sp_mem_set = "@Html.Raw(SpGet.Security.Encrypt("mem_set"))"; var sp_mem_get_tbl = "@Html.Raw(SpGet.Security.Encrypt("mem_get_tbl"))"; var sp_mem_get_phone = "@Html.Raw(SpGet.Security.Encrypt("mem_get_phone"))"; var spGet = new SpGet(); var demo = new Demo(); $(function () { demo.init(); }); </script> </head> <body> <form id="__ajaxAntiForgeryForm" action="#" method="post">@Html.AntiForgeryToken()</form> <h1>spGet ASP.NET MVC Example</h1> <h1>Member List</h1> <div id="board"></div> <h2>Edit Data</h2> <p>Gianna's new phone number: <input id="edPhone" type="text" /></p> <h2>Updated Data</h2> <p>Gianna's phone number: <span id="phone"></span></p> <h2>Type Conversion Test</h2> <table id="types"></table> </body> </html>
@{ Layout = null; } <!DOCTYPE html> <html> <head> <title>SpGet - StordProcedure to Script Framework</title> <style> * { font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } ul { margin:0; padding:0; } li { display:inline-block; width:120px; border-bottom:1px solid #808080; padding:7px; } </style> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.0.min.js"></script> <script src="~/Scripts/spGet/spGet.js"></script> <script src="~/Scripts/demo.js"></script> <script> // names of stored procedures // if you want to hide stored procedure names... var sp_mem_add = "@Html.Raw(SpGet.Security.Encrypt("mem_add"))"; var sp_mem_del = "@Html.Raw(SpGet.Security.Encrypt("mem_del"))"; var sp_mem_set = "@Html.Raw(SpGet.Security.Encrypt("mem_set"))"; var sp_mem_get_tbl = "@Html.Raw(SpGet.Security.Encrypt("mem_get_tbl"))"; var sp_mem_get_phone = "@Html.Raw(SpGet.Security.Encrypt("mem_get_phone"))"; var spGet = new SpGet(); var demo = new Demo(); $(function () { demo.init(); }); </script> </head> <body> <form id="__ajaxAntiForgeryForm" action="#" method="post">@Html.AntiForgeryToken()</form> <h1>spGet ASP.NET MVC Example</h1> <h1>Member List</h1> <div id="board"></div> <h2>Edit Data</h2> <p>Gianna's new phone number: <input id="edPhone" type="text" /></p> <h2>Updated Data</h2> <p>Gianna's phone number: <span id="phone"></span></p> </body> </html>
mit
C#
ccd53c581b8ac855e589752dccc9829e5b6ef54b
Bump to version 2.6.2.0 (slightly late)
Silv3rPRO/proshine
PROShine/Properties/AssemblyInfo.cs
PROShine/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("PROShine")] [assembly: AssemblyDescription("A free, open-source and advanced bot for Pokemon Revolution Online.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Silv3r")] [assembly: AssemblyProduct("PROShine")] [assembly: AssemblyCopyright("Copyright © Silv3r, 2016-2032")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.6.2.0")] [assembly: AssemblyFileVersion("2.6.2.0")] [assembly: NeutralResourcesLanguage("en")]
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("PROShine")] [assembly: AssemblyDescription("A free, open-source and advanced bot for Pokemon Revolution Online.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Silv3r")] [assembly: AssemblyProduct("PROShine")] [assembly: AssemblyCopyright("Copyright © Silv3r, 2016-2032")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.6.1.0")] [assembly: AssemblyFileVersion("2.6.1.0")] [assembly: NeutralResourcesLanguage("en")]
mit
C#
c0bb3183a4e374a62cecac520558d121915b6e39
Revert "added prop commit3"
ravi-msi/practicegit,ravi-msi/practicegit,ravi-msi/practicegit
PracticeGit/PracticeGit/AddNewFile.cs
PracticeGit/PracticeGit/AddNewFile.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PracticeGit { class AddNewFile { public int MyProperty { get; set; } public string Commit1 { get; set; } public string Commit2 { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PracticeGit { class AddNewFile { public int MyProperty { get; set; } public string Commit1 { get; set; } public string Commit2 { get; set; } public string Commit3 { get; set; } } }
mit
C#
9bfd6986b57cab02c5b3feeac8f1050d837a20e4
Decrease bootstrap column sizes to improve mobile experience
johanhelsing/vaskelista,johanhelsing/vaskelista
Vaskelista/Views/Household/Create.cshtml
Vaskelista/Views/Household/Create.cshtml
@model Vaskelista.Models.Household @{ ViewBag.Title = "Create"; } <h2>Velkommen til vaskelista</h2> <p>Her kan du velge hva vaskelisten din skal hete:</p> <div class="form-horizontal"> <div class="form-group"> <div class="col-md-2"><label>@Request.Url.ToString()</label></div> <div class="col-md-4"> <ul class="form-option-list"> @foreach (string randomUrl in ViewBag.RandomUrls) { <li> @using (Html.BeginForm("Create", "Household", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.HiddenFor(model => model.Token, new { Value = randomUrl }) <input type="submit" value="@randomUrl" class="btn btn-default" /> } </li> } </ul> </div> </div> </div> @section Scripts { @Scripts.Render("~/bundles/jqueryval") }
@model Vaskelista.Models.Household @{ ViewBag.Title = "Create"; } <h2>Velkommen til vaskelista</h2> <p>Her kan du velge hva vaskelisten din skal hete:</p> <div class="form-horizontal"> <div class="form-group"> <div class="col-md-12"><label>@Request.Url.ToString()</label></div> <div class="col-md-12"> <ul class="form-option-list"> @foreach (string randomUrl in ViewBag.RandomUrls) { <li> @using (Html.BeginForm("Create", "Household", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.HiddenFor(model => model.Token, new { Value = randomUrl }) <input type="submit" value="@randomUrl" class="btn btn-default" /> } </li> } </ul> </div> </div> </div> @section Scripts { @Scripts.Render("~/bundles/jqueryval") }
mit
C#
3b43536d76f8f0f14c20ff09a0c8e7c56a252c0a
更新.net 4.5项目的版本号
JeffreySu/WxOpen,JeffreySu/WxOpen
src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Properties/AssemblyInfo.cs
src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Senparc.Weixin.WxOpen")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Senparc.Weixin.WxOpen")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] //将 ComVisible 设置为 false 将使此程序集中的类型 //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, //请将此类型的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("379d8c97-4f96-45af-9f91-6bd160514495")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.4.2.*")] //[assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Senparc.Weixin.WxOpen")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Senparc.Weixin.WxOpen")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] //将 ComVisible 设置为 false 将使此程序集中的类型 //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, //请将此类型的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("379d8c97-4f96-45af-9f91-6bd160514495")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.4.0.*")] //[assembly: AssemblyFileVersion("1.0.0.0")]
apache-2.0
C#
02eaf9b3684a3877164c8be6a946bcbde81e9ed8
add generic type to skill view model
mzrimsek/resume-site-api
Web/Models/SkillModels/SkillViewModel.cs
Web/Models/SkillModels/SkillViewModel.cs
using Core.Interfaces; namespace Web.Models.SkillModels { public class SkillViewModel : IHasId { public int Id { get; set; } public int LanguageId { get; set; } public string Name { get; set; } public int Rating { get; set; } public string RatingName { get; set; } } }
namespace Web.Models.SkillModels { public class SkillViewModel { public int Id { get; set; } public int LanguageId { get; set; } public string Name { get; set; } public int Rating { get; set; } public string RatingName { get; set; } } }
mit
C#
21ae7d00277e32481db1fa94cdf99562770112ef
Fix performance of QuaternionExtensions.FromRotationVector
virtuallynaked/virtually-naked,virtuallynaked/virtually-naked
Viewer/src/math/QuaternionExtensions.cs
Viewer/src/math/QuaternionExtensions.cs
using SharpDX; using System; using static SharpDX.Vector3; using static MathExtensions; using static System.Math; public static class QuaternionExtensions { public static Quaternion RotateBetween(Vector3 v1, Vector3 v2) { Vector3 xyz = Vector3.Cross(v1, v2); float w = (float) Math.Sqrt(v1.LengthSquared() * v2.LengthSquared()) + Vector3.Dot(v1, v2); Quaternion q = new Quaternion(xyz, w); q.Normalize(); return q; } public static void DecomposeIntoTwistThenSwing(this Quaternion q, Vector3 axis, out Quaternion twist, out Quaternion swing) { //Note: I'm unsure if this works with anything except unit vectors as the axis twist = new Quaternion(axis.X * q.X, axis.Y * q.Y, axis.Z * q.Z, q.W); twist.Normalize(); swing = q * Quaternion.Invert(twist); } public static Quaternion SwingBetween(Vector3 a, Vector3 b, Vector3 n) { //Assumes a, b, and n are unit vectors Vector3 axis = Normalize(Cross(n, a-b)); Vector3 rejectionA = a - axis * Dot(a, axis); Vector3 rejectionB = b - axis * Dot(b, axis); float cosAngle = Dot(Normalize(rejectionA), Normalize(rejectionB)); float angle = (float) Math.Acos(cosAngle); Vector3 crossRejection = Cross(rejectionA, rejectionB); if (Dot(axis, crossRejection) < 0) { angle = -angle; } return Quaternion.RotationAxis(axis, angle); } //In general, gives the same result as Quaternion.Angle, but is more numerically accurate for angles close to 0 public static float AccurateAngle(this Quaternion q) { double lengthSquared = Sqr((double) q.X) + Sqr((double) q.Y) + Sqr((double) q.Z); double angle = 2 * Math.Asin(Sqrt(lengthSquared)); return (float) angle; } public static Quaternion FromRotationVector(Vector3 v) { Quaternion logQ = new Quaternion(v / 2, 0); return Quaternion.Exponential(logQ); } }
using SharpDX; using System; using static SharpDX.Vector3; using static MathExtensions; using static System.Math; public static class QuaternionExtensions { public static Quaternion RotateBetween(Vector3 v1, Vector3 v2) { Vector3 xyz = Vector3.Cross(v1, v2); float w = (float) Math.Sqrt(v1.LengthSquared() * v2.LengthSquared()) + Vector3.Dot(v1, v2); Quaternion q = new Quaternion(xyz, w); q.Normalize(); return q; } public static void DecomposeIntoTwistThenSwing(this Quaternion q, Vector3 axis, out Quaternion twist, out Quaternion swing) { //Note: I'm unsure if this works with anything except unit vectors as the axis twist = new Quaternion(axis.X * q.X, axis.Y * q.Y, axis.Z * q.Z, q.W); twist.Normalize(); swing = q * Quaternion.Invert(twist); } public static Quaternion SwingBetween(Vector3 a, Vector3 b, Vector3 n) { //Assumes a, b, and n are unit vectors Vector3 axis = Normalize(Cross(n, a-b)); Vector3 rejectionA = a - axis * Dot(a, axis); Vector3 rejectionB = b - axis * Dot(b, axis); float cosAngle = Dot(Normalize(rejectionA), Normalize(rejectionB)); float angle = (float) Math.Acos(cosAngle); Vector3 crossRejection = Cross(rejectionA, rejectionB); if (Dot(axis, crossRejection) < 0) { angle = -angle; } return Quaternion.RotationAxis(axis, angle); } //In general, gives the same result as Quaternion.Angle, but is more numerically accurate for angles close to 0 public static float AccurateAngle(this Quaternion q) { double lengthSquared = Sqr((double) q.X) + Sqr((double) q.Y) + Sqr((double) q.Z); double angle = 2 * Math.Asin(Sqrt(lengthSquared)); return (float) angle; } public static Quaternion FromRotationVector(Vector3 v) { Quaternion.RotationAxis(v, 1); Quaternion logQ = new Quaternion(v / 2, 0); return Quaternion.Exponential(logQ); } }
mit
C#
b1a94d0d8047f46d2130fe7632b9b88abbea209b
Fix setting FileDialog.FileName
PowerOfCode/Eto,bbqchickenrobot/Eto-1,l8s/Eto,bbqchickenrobot/Eto-1,bbqchickenrobot/Eto-1,l8s/Eto,PowerOfCode/Eto,PowerOfCode/Eto,l8s/Eto
Source/Eto.Gtk/Forms/GtkFileDialog.cs
Source/Eto.Gtk/Forms/GtkFileDialog.cs
using System; using System.IO; using Eto.Forms; using System.Collections.Generic; using System.Linq; namespace Eto.GtkSharp.Forms { public abstract class GtkFileDialog<TControl, TWidget> : WidgetHandler<TControl, TWidget>, FileDialog.IHandler where TControl: Gtk.FileChooserDialog where TWidget: FileDialog { IFileDialogFilter[] filters; public string FileName { get { return Control.Filename; } set { Control.SetCurrentFolder(Path.GetDirectoryName(value)); Control.SetFilename(value); Control.CurrentName = Path.GetFileName(value); } } public Uri Directory { get { return new Uri(Control.CurrentFolderUri); } set { Control.SetCurrentFolderUri(value.AbsoluteUri); } } public IEnumerable<IFileDialogFilter> Filters { get { return filters; } set { var list = Control.Filters.ToArray (); foreach (Gtk.FileFilter filter in list) { Control.RemoveFilter(filter); } filters = value.ToArray (); foreach (var val in filters) { var filter = new Gtk.FileFilter(); filter.Name = val.Name; foreach (string pattern in val.Extensions) filter.AddPattern("*" + pattern); Control.AddFilter(filter); } } } public IFileDialogFilter CurrentFilter { get { if (CurrentFilterIndex == -1 || filters == null) return null; return filters[CurrentFilterIndex]; } set { CurrentFilterIndex = Array.IndexOf (filters, value); } } public int CurrentFilterIndex { get { Gtk.FileFilter[] filters = Control.Filters; for (int i=0; i<filters.Length; i++) { if (filters[i] == Control.Filter) return i; } return -1; } set { Gtk.FileFilter[] filters = Control.Filters; Control.Filter = filters[value]; } } public bool CheckFileExists { get { return false; } set { } } public string Title { get { return Control.Title; } set { Control.Title = value; } } public DialogResult ShowDialog(Window parent) { if (parent != null) Control.TransientFor = (Gtk.Window)parent.ControlObject; int result = Control.Run(); Control.Hide (); DialogResult response = ((Gtk.ResponseType)result).ToEto (); if (response == DialogResult.Ok && !string.IsNullOrEmpty(Control.CurrentFolder)) System.IO.Directory.SetCurrentDirectory(Control.CurrentFolder); return response; } } }
using System; using System.IO; using Eto.Forms; using System.Collections.Generic; using System.Linq; namespace Eto.GtkSharp.Forms { public abstract class GtkFileDialog<TControl, TWidget> : WidgetHandler<TControl, TWidget>, FileDialog.IHandler where TControl: Gtk.FileChooserDialog where TWidget: FileDialog { IFileDialogFilter[] filters; public string FileName { get { return Control.Filename; } set { Control.SetCurrentFolder(Path.GetDirectoryName(value)); Control.SetFilename(value); } } public Uri Directory { get { return new Uri(Control.CurrentFolderUri); } set { Control.SetCurrentFolderUri(value.AbsoluteUri); } } public IEnumerable<IFileDialogFilter> Filters { get { return filters; } set { var list = Control.Filters.ToArray (); foreach (Gtk.FileFilter filter in list) { Control.RemoveFilter(filter); } filters = value.ToArray (); foreach (var val in filters) { var filter = new Gtk.FileFilter(); filter.Name = val.Name; foreach (string pattern in val.Extensions) filter.AddPattern("*" + pattern); Control.AddFilter(filter); } } } public IFileDialogFilter CurrentFilter { get { if (CurrentFilterIndex == -1 || filters == null) return null; return filters[CurrentFilterIndex]; } set { CurrentFilterIndex = Array.IndexOf (filters, value); } } public int CurrentFilterIndex { get { Gtk.FileFilter[] filters = Control.Filters; for (int i=0; i<filters.Length; i++) { if (filters[i] == Control.Filter) return i; } return -1; } set { Gtk.FileFilter[] filters = Control.Filters; Control.Filter = filters[value]; } } public bool CheckFileExists { get { return false; } set { } } public string Title { get { return Control.Title; } set { Control.Title = value; } } public DialogResult ShowDialog(Window parent) { if (parent != null) Control.TransientFor = (Gtk.Window)parent.ControlObject; int result = Control.Run(); Control.Hide (); DialogResult response = ((Gtk.ResponseType)result).ToEto (); if (response == DialogResult.Ok && !string.IsNullOrEmpty(Control.CurrentFolder)) System.IO.Directory.SetCurrentDirectory(Control.CurrentFolder); return response; } } }
bsd-3-clause
C#
2808182c0b917218e68132dd0b72da6ee031d372
Rename previously unknown GAF field
MHeasell/TAUtil,MHeasell/TAUtil
TAUtil/Gaf/Structures/GafFrameData.cs
TAUtil/Gaf/Structures/GafFrameData.cs
namespace TAUtil.Gaf.Structures { using System.IO; public struct GafFrameData { public ushort Width; public ushort Height; public ushort XPos; public ushort YPos; public byte TransparencyIndex; public bool Compressed; public ushort FramePointers; public uint Unknown2; public uint PtrFrameData; public uint Unknown3; public static void Read(BinaryReader b, ref GafFrameData e) { e.Width = b.ReadUInt16(); e.Height = b.ReadUInt16(); e.XPos = b.ReadUInt16(); e.YPos = b.ReadUInt16(); e.TransparencyIndex = b.ReadByte(); e.Compressed = b.ReadBoolean(); e.FramePointers = b.ReadUInt16(); e.Unknown2 = b.ReadUInt32(); e.PtrFrameData = b.ReadUInt32(); e.Unknown3 = b.ReadUInt32(); } } }
namespace TAUtil.Gaf.Structures { using System.IO; public struct GafFrameData { public ushort Width; public ushort Height; public ushort XPos; public ushort YPos; public byte Unknown1; public bool Compressed; public ushort FramePointers; public uint Unknown2; public uint PtrFrameData; public uint Unknown3; public static void Read(BinaryReader b, ref GafFrameData e) { e.Width = b.ReadUInt16(); e.Height = b.ReadUInt16(); e.XPos = b.ReadUInt16(); e.YPos = b.ReadUInt16(); e.Unknown1 = b.ReadByte(); e.Compressed = b.ReadBoolean(); e.FramePointers = b.ReadUInt16(); e.Unknown2 = b.ReadUInt32(); e.PtrFrameData = b.ReadUInt32(); e.Unknown3 = b.ReadUInt32(); } } }
mit
C#
38996054879a0869a97fab15a069ab34bd058d9e
add warnings
Hochfrequenz/EDILibrary
EDILibrary/StringSplitEnhacement.cs
EDILibrary/StringSplitEnhacement.cs
// Copyright (c) 2017 Hochfrequenz Unternehmensberatung GmbH using System.Collections.Generic; namespace EDILibrary { public static class StringExtensions { // the string.Split() method from .NET tend to run out of memory on 80 Mb strings. // this has been reported several places online. // This version is fast and memory efficient and return no empty lines. public static List<string> LowMemSplit(this string s, string seperator) { List<string> list = new List<string>(); int lastPos = 0; int pos = s.IndexOf(seperator); // warn: string.IndexOf(string) is culture-specific while (pos > -1) { while (pos == lastPos) { lastPos += seperator.Length; pos = s.IndexOf(seperator, lastPos); // warn: string.IndexOf(string) is culture-specific if (pos == -1) return list; } string tmp = s.Substring(lastPos, pos - lastPos); if (tmp.Trim().Length > 0) list.Add(tmp); lastPos = pos + seperator.Length; pos = s.IndexOf(seperator, lastPos); // warn: string.IndexOf(string) is culture-specific } if (lastPos < s.Length) { string tmp = s.Substring(lastPos, s.Length - lastPos); if (tmp.Trim().Length > 0) list.Add(tmp); } return list; } } }
// Copyright (c) 2017 Hochfrequenz Unternehmensberatung GmbH using System.Collections.Generic; namespace EDILibrary { public static class StringExtensions { // the string.Split() method from .NET tend to run out of memory on 80 Mb strings. // this has been reported several places online. // This version is fast and memory efficient and return no empty lines. public static List<string> LowMemSplit(this string s, string seperator) { List<string> list = new List<string>(); int lastPos = 0; int pos = s.IndexOf(seperator); while (pos > -1) { while (pos == lastPos) { lastPos += seperator.Length; pos = s.IndexOf(seperator, lastPos); if (pos == -1) return list; } string tmp = s.Substring(lastPos, pos - lastPos); if (tmp.Trim().Length > 0) list.Add(tmp); lastPos = pos + seperator.Length; pos = s.IndexOf(seperator, lastPos); } if (lastPos < s.Length) { string tmp = s.Substring(lastPos, s.Length - lastPos); if (tmp.Trim().Length > 0) list.Add(tmp); } return list; } } }
mit
C#
94d51fce0173f3208d52468bb22dc64d270fa57e
fix cit's incorrect usage of Environment.Newline
chimpinano/WebApi,congysu/WebApi,lungisam/WebApi,scz2011/WebApi,lungisam/WebApi,yonglehou/WebApi,abkmr/WebApi,chimpinano/WebApi,LianwMS/WebApi,lewischeng-ms/WebApi,lewischeng-ms/WebApi,congysu/WebApi,abkmr/WebApi,yonglehou/WebApi,scz2011/WebApi,LianwMS/WebApi
test/Common/Routing/SubRouteCollectionTest.cs
test/Common/Routing/SubRouteCollectionTest.cs
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. #if !ASPNETWEBAPI using System.Web.Routing; #endif using Microsoft.TestCommon; using Moq; #if ASPNETWEBAPI namespace System.Web.Http.Routing #else namespace System.Web.Mvc.Routing #endif { public class SubRouteCollectionTest { #if ASPNETWEBAPI [Fact] public void SubRouteCollection_Throws_OnDuplicateNamedRoute_WebAPI() { // Arrange var collection = new SubRouteCollection(); var route1 = new HttpRoute("api/Person"); var route2 = new HttpRoute("api/Car"); collection.Add(new RouteEntry("route", route1)); var expectedError = "A route named 'route' is already in the route collection. Route names must be unique.\r\n\r\n" + "Duplicates:\r\n" + "api/Car\r\n" + "api/Person"; // Act & Assert Assert.Throws<InvalidOperationException>(() => collection.Add(new RouteEntry("route", route2)), expectedError); } #else [Fact] public void SubRouteCollection_Throws_OnDuplicateNamedRoute_MVC() { // Arrange var collection = new SubRouteCollection(); var route1 = new Route("Home/Index", new Mock<IRouteHandler>().Object); var route2 = new Route("Person/Index", new Mock<IRouteHandler>().Object); collection.Add(new RouteEntry("route", route1)); var expectedError = "A route named 'route' is already in the route collection. Route names must be unique.\r\n\r\n" + "Duplicates:\r\n" + "Person/Index\r\n" + "Home/Index"; // Act & Assert Assert.Throws<InvalidOperationException>(() => collection.Add(new RouteEntry("route", route2)), expectedError); } #endif } }
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. #if !ASPNETWEBAPI using System.Web.Routing; #endif using Microsoft.TestCommon; using Moq; #if ASPNETWEBAPI namespace System.Web.Http.Routing #else namespace System.Web.Mvc.Routing #endif { public class SubRouteCollectionTest { #if ASPNETWEBAPI [Fact] public void SubRouteCollection_Throws_OnDuplicateNamedRoute_WebAPI() { // Arrange var collection = new SubRouteCollection(); var route1 = new HttpRoute("api/Person"); var route2 = new HttpRoute("api/Car"); collection.Add(new RouteEntry("route", route1)); var expectedError = "A route named 'route' is already in the route collection. Route names must be unique." + Environment.NewLine + Environment.NewLine + "Duplicates:" + Environment.NewLine + "api/Car" + Environment.NewLine + "api/Person"; // Act & Assert Assert.Throws<InvalidOperationException>(() => collection.Add(new RouteEntry("route", route2)), expectedError); } #else [Fact] public void SubRouteCollection_Throws_OnDuplicateNamedRoute_MVC() { // Arrange var collection = new SubRouteCollection(); var route1 = new Route("Home/Index", new Mock<IRouteHandler>().Object); var route2 = new Route("Person/Index", new Mock<IRouteHandler>().Object); collection.Add(new RouteEntry("route", route1)); var expectedError = "A route named 'route' is already in the route collection. Route names must be unique." + Environment.NewLine + Environment.NewLine + "Duplicates:" + Environment.NewLine + "Person/Index" + Environment.NewLine + "Home/Index"; // Act & Assert Assert.Throws<InvalidOperationException>(() => collection.Add(new RouteEntry("route", route2)), expectedError); } #endif } }
mit
C#
242e38615f50d2ba1e554acd17dc4274ae46bc58
Correct intermediate tests
codingseb/TranslateMe
TranslateMe.Tests/TranslateMeTests.cs
TranslateMe.Tests/TranslateMeTests.cs
using Should; using NUnit.Framework; namespace TranslateMe.Tests { [TestFixture] public class TranslateMeTests { TMLanguagesLoader loader; [OneTimeSetUp] public void LoadTranslations() { loader = new TMLanguagesLoader(TM.Instance); loader.AddTranslation("SayHello", "en", "Hello"); loader.AddTranslation("SayHello", "fr", "Bonjour"); } [Test()] public void StaticBasicTranslations() { TM.Tr("TestNoTextId", "Test").ShouldEqual("Test"); TM.Tr("SayHello", "SH").ShouldEqual("Hello"); TM.Instance.CurrentLanguage = "fr"; TM.Tr("SayHello", "SH").ShouldEqual("Bonjour"); TM.Tr("SayHello", "SH", "en").ShouldEqual("Hello"); TM.Tr("SayHello", "SH", "es").ShouldEqual("SH"); } [OneTimeTearDown] public void ClearDicts() { loader.ClearAllTranslations(); } } }
using Should; using NUnit.Framework; namespace TranslateMe.Tests { [TestFixture] public class TranslateMeTests { TMLanguagesLoader loader; [OneTimeSetUp] public void LoadTranslations() { loader = new TMLanguagesLoader(TM.Instance); loader.AddTranslation("SayHello", "en", "Hello"); loader.AddTranslation("SayHello", "fr", "Bonjour"); } [TestCase()] public string StaticBasicTranslations(string textId, string defaultText) { TM.Tr("TestNoTextId", "Test").ShouldEqual("Test"); TM.Tr("SayHello", "SH").ShouldEqual("Hello"); TM.Instance.CurrentLanguage = "fr"; TM.Tr("SayHello", "SH").ShouldEqual("Bonjour"); TM.Tr("SayHello", "SH", "en").ShouldEqual("Hello"); TM.Tr("SayHello", "SH", "es").ShouldEqual("SH"); } [OneTimeTearDown] public void ClearDicts() { loader.ClearAllTranslations(); } } }
mit
C#
62b27e5efc9e3a2c314735c506c5936415d9933f
Fix silly infinite loop bug
SceneGate/Yarhl
GameFolderFactory.cs
GameFolderFactory.cs
// // GameFolderFactory.cs // // Author: // Benito Palacios Sánchez <[email protected]> // // Copyright (c) 2014 Benito Palacios Sánchez // // 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 later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. using System; using System.IO; using Libgame; using Libgame.IO; namespace Libgame { public static class GameFolderFactory { public static GameFolder FromPath(string dir) { return FromPath(dir, Path.GetDirectoryName(dir)); } public static GameFolder FromPath(string dir, string dirName) { GameFolder folder = new GameFolder(dirName); foreach (string filePath in Directory.GetFiles(dir)) { string filename = Path.GetFileName(filePath); DataStream stream = new DataStream(filePath, FileMode.Open, FileAccess.ReadWrite); folder.AddFile(new GameFile(filename, stream)); } return folder; } } }
// // GameFolderFactory.cs // // Author: // Benito Palacios Sánchez <[email protected]> // // Copyright (c) 2014 Benito Palacios Sánchez // // 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 later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. using System; using System.IO; using Libgame; using Libgame.IO; namespace Libgame { public static class GameFolderFactory { public static GameFolder FromPath(string dir) { return FromPath(Path.GetDirectoryName(dir)); } public static GameFolder FromPath(string dir, string dirName) { GameFolder folder = new GameFolder(dirName); foreach (string filePath in Directory.GetFiles(dir)) { string filename = Path.GetFileName(filePath); DataStream stream = new DataStream(filePath, FileMode.Open, FileAccess.ReadWrite); folder.AddFile(new GameFile(filename, stream)); } return folder; } } }
mit
C#
206e77f28fba08d58d13193f8dc1eaeb05cc24a5
fix bug
feedhenry-templates/blank-xamarin,feedhenry-templates/blank-xamarin
blank-xamarin-ios/ViewController.cs
blank-xamarin-ios/ViewController.cs
using System; using UIKit; using FHSDK; namespace blank_xamarin_ios { public partial class ViewController : UIViewController { public ViewController (IntPtr handle) : base (handle) { } public async override void ViewDidLoad () { base.ViewDidLoad (); try { var initTask = await FHClient.Init(); if (initTask) { StatusLabel.Text = "FH init successful"; } } catch(Exception e) { StatusLabel.Text = "FH init in error"; Console.WriteLine("Error {0}", e); } } } }
using System; using UIKit; using FHSDK; namespace blank_xamarin_ios { public partial class ViewController : UIViewController { public ViewController (IntPtr handle) : base (handle) { } public async override void ViewDidLoad () { base.ViewDidLoad (); try { var initTask = await FHClient.Init(); if (!initTask) { StatusLabel.Text = "FH init successful"; } } catch(Exception e) { StatusLabel.Text = "FH init in error"; Console.WriteLine("Error {0}", e); } } } }
apache-2.0
C#
d0cc5d6a3eec70b658321b235b06ba543e2fa30b
order rooms by name
flagbug/UnofficialGitterApp
Gitter/ViewModels/RoomsViewModel.cs
Gitter/ViewModels/RoomsViewModel.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; using ReactiveUI; using Splat; namespace Gitter.ViewModels { public class RoomsViewModel : ReactiveObject, IRoutableViewModel { private RoomViewModel selectedRoom; public RoomsViewModel(IGitterApi api = null, IScreen hostScreen = null) { this.HostScreen = hostScreen ?? Locator.Current.GetService<IScreen>(); this.Rooms = new ReactiveList<RoomViewModel>(); this.LoadRooms = ReactiveCommand.CreateAsyncObservable(_ => LoadRoomsImpl(api ?? GitterApi.UserInitiated)); this.LoadRooms.Subscribe(x => { using (this.Rooms.SuppressChangeNotifications()) { this.Rooms.Clear(); this.Rooms.AddRange(x); } }); this.WhenAnyValue(x => x.SelectedRoom) .Where(x => x != null) .Subscribe(x => { this.SelectedRoom = null; this.HostScreen.Router.Navigate.Execute(new MessagesViewModel(x.Room)); }); } public IScreen HostScreen { get; private set; } public ReactiveCommand<IEnumerable<RoomViewModel>> LoadRooms { get; private set; } public IReactiveList<RoomViewModel> Rooms { get; private set; } public RoomViewModel SelectedRoom { get { return this.selectedRoom; } set { this.RaiseAndSetIfChanged(ref this.selectedRoom, value); } } public string UrlPathSegment { get { return "Rooms"; } } private static IObservable<IEnumerable<RoomViewModel>> LoadRoomsImpl(IGitterApi api) { return GitterApi.GetAccessToken() .SelectMany(api.GetRooms) .Select(rooms => rooms.OrderBy(room => room.name, StringComparer.CurrentCulture).Select(room => new RoomViewModel(room))); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; using ReactiveUI; using Splat; namespace Gitter.ViewModels { public class RoomsViewModel : ReactiveObject, IRoutableViewModel { private RoomViewModel selectedRoom; public RoomsViewModel(IGitterApi api = null, IScreen hostScreen = null) { this.HostScreen = hostScreen ?? Locator.Current.GetService<IScreen>(); this.Rooms = new ReactiveList<RoomViewModel>(); this.LoadRooms = ReactiveCommand.CreateAsyncObservable(_ => LoadRoomsImpl(api ?? GitterApi.UserInitiated)); this.LoadRooms.Subscribe(x => { using (this.Rooms.SuppressChangeNotifications()) { this.Rooms.Clear(); this.Rooms.AddRange(x); } }); this.WhenAnyValue(x => x.SelectedRoom) .Where(x => x != null) .Subscribe(x => { this.SelectedRoom = null; this.HostScreen.Router.Navigate.Execute(new MessagesViewModel(x.Room)); }); } public IScreen HostScreen { get; private set; } public ReactiveCommand<IEnumerable<RoomViewModel>> LoadRooms { get; private set; } public IReactiveList<RoomViewModel> Rooms { get; private set; } public RoomViewModel SelectedRoom { get { return this.selectedRoom; } set { this.RaiseAndSetIfChanged(ref this.selectedRoom, value); } } public string UrlPathSegment { get { return "Rooms"; } } private static IObservable<IEnumerable<RoomViewModel>> LoadRoomsImpl(IGitterApi api) { return GitterApi.GetAccessToken() .SelectMany(api.GetRooms) .Select(rooms => rooms.Select(room => new RoomViewModel(room))); } } }
mit
C#
45f833ceea17628cc54856bb9aa58916e0dc6589
Add invocation null checks for safety
NeoAdonis/osu,ZLima12/osu,smoogipoo/osu,EVAST9919/osu,peppy/osu-new,ZLima12/osu,peppy/osu,UselessToucan/osu,smoogipooo/osu,EVAST9919/osu,smoogipoo/osu,ppy/osu,2yangk23/osu,peppy/osu,ppy/osu,smoogipoo/osu,peppy/osu,johnneijzen/osu,UselessToucan/osu,ppy/osu,UselessToucan/osu,2yangk23/osu,NeoAdonis/osu,johnneijzen/osu,NeoAdonis/osu
osu.Game/Graphics/UserInterface/BackButton.cs
osu.Game/Graphics/UserInterface/BackButton.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Bindings; using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface { public class BackButton : VisibilityContainer { public Action Action; private readonly TwoLayerButton button; public BackButton(Receptor receptor) { receptor.OnBackPressed = () => Action?.Invoke(); Size = TwoLayerButton.SIZE_EXTENDED; Child = button = new TwoLayerButton { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, Text = @"back", Icon = OsuIcon.LeftCircle, Action = () => Action?.Invoke() }; } [BackgroundDependencyLoader] private void load(OsuColour colours) { button.BackgroundColour = colours.Pink; button.HoverColour = colours.PinkDark; } protected override void PopIn() { button.MoveToX(0, 400, Easing.OutQuint); button.FadeIn(150, Easing.OutQuint); } protected override void PopOut() { button.MoveToX(-TwoLayerButton.SIZE_EXTENDED.X / 2, 400, Easing.OutQuint); button.FadeOut(400, Easing.OutQuint); } public class Receptor : Drawable, IKeyBindingHandler<GlobalAction> { public Action OnBackPressed; public bool OnPressed(GlobalAction action) { switch (action) { case GlobalAction.Back: OnBackPressed?.Invoke(); return true; } return false; } public bool OnReleased(GlobalAction action) => action == GlobalAction.Back; } } }
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Bindings; using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface { public class BackButton : VisibilityContainer { public Action Action; private readonly TwoLayerButton button; public BackButton(Receptor receptor) { receptor.OnBackPressed = () => Action.Invoke(); Size = TwoLayerButton.SIZE_EXTENDED; Child = button = new TwoLayerButton { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, Text = @"back", Icon = OsuIcon.LeftCircle, Action = () => Action?.Invoke() }; } [BackgroundDependencyLoader] private void load(OsuColour colours) { button.BackgroundColour = colours.Pink; button.HoverColour = colours.PinkDark; } protected override void PopIn() { button.MoveToX(0, 400, Easing.OutQuint); button.FadeIn(150, Easing.OutQuint); } protected override void PopOut() { button.MoveToX(-TwoLayerButton.SIZE_EXTENDED.X / 2, 400, Easing.OutQuint); button.FadeOut(400, Easing.OutQuint); } public class Receptor : Drawable, IKeyBindingHandler<GlobalAction> { public Action OnBackPressed; public bool OnPressed(GlobalAction action) { switch (action) { case GlobalAction.Back: OnBackPressed.Invoke(); return true; } return false; } public bool OnReleased(GlobalAction action) => action == GlobalAction.Back; } } }
mit
C#
9fc9009dbe1a6bba52686e41413aae20c4804652
Add change handling for sample section
UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,smoogipooo/osu,peppy/osu,smoogipoo/osu,ppy/osu,ppy/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,peppy/osu-new,NeoAdonis/osu,peppy/osu,UselessToucan/osu,peppy/osu
osu.Game/Screens/Edit/Timing/SampleSection.cs
osu.Game/Screens/Edit/Timing/SampleSection.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. 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.Game.Beatmaps.ControlPoints; using osu.Game.Graphics.UserInterfaceV2; namespace osu.Game.Screens.Edit.Timing { internal class SampleSection : Section<SampleControlPoint> { private LabelledTextBox bank; private SliderWithTextBoxInput<int> volume; [BackgroundDependencyLoader] private void load() { Flow.AddRange(new Drawable[] { bank = new LabelledTextBox { Label = "Bank Name", }, volume = new SliderWithTextBoxInput<int>("Volume") { Current = new SampleControlPoint().SampleVolumeBindable, } }); } protected override void OnControlPointChanged(ValueChangedEvent<SampleControlPoint> point) { if (point.NewValue != null) { bank.Current = point.NewValue.SampleBankBindable; bank.Current.BindValueChanged(_ => ChangeHandler?.SaveState()); volume.Current = point.NewValue.SampleVolumeBindable; volume.Current.BindValueChanged(_ => ChangeHandler?.SaveState()); } } protected override SampleControlPoint CreatePoint() { var reference = Beatmap.Value.Beatmap.ControlPointInfo.SamplePointAt(SelectedGroup.Value.Time); return new SampleControlPoint { SampleBank = reference.SampleBank, SampleVolume = reference.SampleVolume, }; } } }
// Copyright (c) ppy Pty Ltd <[email protected]>. 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.Game.Beatmaps.ControlPoints; using osu.Game.Graphics.UserInterfaceV2; namespace osu.Game.Screens.Edit.Timing { internal class SampleSection : Section<SampleControlPoint> { private LabelledTextBox bank; private SliderWithTextBoxInput<int> volume; [BackgroundDependencyLoader] private void load() { Flow.AddRange(new Drawable[] { bank = new LabelledTextBox { Label = "Bank Name", }, volume = new SliderWithTextBoxInput<int>("Volume") { Current = new SampleControlPoint().SampleVolumeBindable, } }); } protected override void OnControlPointChanged(ValueChangedEvent<SampleControlPoint> point) { if (point.NewValue != null) { bank.Current = point.NewValue.SampleBankBindable; volume.Current = point.NewValue.SampleVolumeBindable; } } protected override SampleControlPoint CreatePoint() { var reference = Beatmap.Value.Beatmap.ControlPointInfo.SamplePointAt(SelectedGroup.Value.Time); return new SampleControlPoint { SampleBank = reference.SampleBank, SampleVolume = reference.SampleVolume, }; } } }
mit
C#
3585e2900ed8a488d6bb6fb69fddfd6305c37e32
Replace unnecessary empty skin implementation with null
smoogipoo/osu,peppy/osu,NeoAdonis/osu,peppy/osu,smoogipooo/osu,peppy/osu,ppy/osu,peppy/osu-new,UselessToucan/osu,smoogipoo/osu,ppy/osu,smoogipoo/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,UselessToucan/osu,UselessToucan/osu
osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs
osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.IO; using osu.Framework.Audio; using osu.Framework.Audio.Track; using osu.Framework.Graphics.Textures; using osu.Game.Beatmaps; using osu.Game.Skinning; using osu.Game.Storyboards; namespace osu.Game.Tests.Beatmaps { public class TestWorkingBeatmap : WorkingBeatmap { private readonly IBeatmap beatmap; private readonly Storyboard storyboard; /// <summary> /// Create an instance which provides the <see cref="IBeatmap"/> when requested. /// </summary> /// <param name="beatmap">The beatmap.</param> /// <param name="storyboard">An optional storyboard.</param> /// <param name="audioManager">The <see cref="AudioManager"/>.</param> public TestWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null, AudioManager audioManager = null) : base(beatmap.BeatmapInfo, audioManager) { this.beatmap = beatmap; this.storyboard = storyboard; } public override bool TrackLoaded => true; public override bool BeatmapLoaded => true; protected override IBeatmap GetBeatmap() => beatmap; protected override Storyboard GetStoryboard() => storyboard ?? base.GetStoryboard(); protected override ISkin GetSkin() => null; public override Stream GetStream(string storagePath) => null; protected override Texture GetBackground() => null; protected override Track GetBeatmapTrack() => null; } }
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.IO; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Audio.Track; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.OpenGL.Textures; using osu.Framework.Graphics.Textures; using osu.Game.Audio; using osu.Game.Beatmaps; using osu.Game.Skinning; using osu.Game.Storyboards; namespace osu.Game.Tests.Beatmaps { public class TestWorkingBeatmap : WorkingBeatmap { private readonly IBeatmap beatmap; private readonly Storyboard storyboard; /// <summary> /// Create an instance which provides the <see cref="IBeatmap"/> when requested. /// </summary> /// <param name="beatmap">The beatmap.</param> /// <param name="storyboard">An optional storyboard.</param> /// <param name="audioManager">The <see cref="AudioManager"/>.</param> public TestWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null, AudioManager audioManager = null) : base(beatmap.BeatmapInfo, audioManager) { this.beatmap = beatmap; this.storyboard = storyboard; } public override bool TrackLoaded => true; public override bool BeatmapLoaded => true; protected override IBeatmap GetBeatmap() => beatmap; protected override Storyboard GetStoryboard() => storyboard ?? base.GetStoryboard(); protected override ISkin GetSkin() => new EmptySkin(); public override Stream GetStream(string storagePath) => null; protected override Texture GetBackground() => null; protected override Track GetBeatmapTrack() => null; private class EmptySkin : ISkin { public Drawable GetDrawableComponent(ISkinComponent component) => null; public Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) => null; public ISample GetSample(ISampleInfo sampleInfo) => null; public IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup) => null; } } }
mit
C#
cd92eb85a9ce6c2604daa42a8ae9d8e48e65b0cc
Add Character.IsMoving, add get and set to Character.CurrentSpeed
manio143/ShadowsOfShadows
src/Entities/Character.cs
src/Entities/Character.cs
using System; using Microsoft.Xna.Framework; using System.Collections.Generic; using ShadowsOfShadows.Items; using ShadowsOfShadows.Helpers; using ShadowsOfShadows.Physics; namespace ShadowsOfShadows.Entities { public abstract class Character : Entity, IInteractable, IUpdateable { public string Name { get; } public bool IsMoving { get; set; } private int Speed; public int CurrentSpeed { get; set; } public int Velocity { get; set; } public List<Item> Equipment { get; } public Character(string name, char renderChar, int speed, int velocity) : base(new Renderables.ConsoleRenderable(renderChar)) { this.Name = name; this.Speed = speed; this.CurrentSpeed = speed; this.Velocity = velocity; this.Equipment = new List<Item>(); } public Character(string name, char renderChar, int speed, int velocity, List<Item> equipment) : this(name, renderChar, speed, velocity) { this.Equipment = equipment; } public void Interact() { } private void Move() { if (IsMoving == false) return; switch (Transform.Direction) { case Direction.Right: Transform.Position = new Point(Transform.Position.X + Velocity, Transform.Position.Y); break; case Direction.Left: Transform.Position = new Point(Transform.Position.X - Velocity, Transform.Position.Y); break; case Direction.Up: Transform.Position = new Point(Transform.Position.X, Transform.Position.Y - Velocity); break; case Direction.Down: Transform.Position = new Point(Transform.Position.X, Transform.Position.Y + Velocity); break; } } public void Update(TimeSpan deltaTime) { CurrentSpeed--; if (CurrentSpeed == 0) { CurrentSpeed = Speed; Move(); } } public abstract void Shoot<T>(Direction direction) where T : Projectile; public double Health { get; set; } public double AttackPower { get; set; } public double DefencePower { get; set; } public double Mana { get; set; } public bool Immortal { get; set; } public double MagicPower { get; set; } public void Attack(Character character) { this.Health -= character.DefencePower; character.Health -= this.AttackPower; } } }
using System; using Microsoft.Xna.Framework; using System.Collections.Generic; using ShadowsOfShadows.Items; using ShadowsOfShadows.Helpers; using ShadowsOfShadows.Physics; namespace ShadowsOfShadows.Entities { public abstract class Character : Entity, IInteractable, IUpdateable { public string Name { get; } private int Speed; private int CurrentSpeed; public int Velocity { get; set; } public List<Item> Equipment { get; } public Character(string name, char renderChar, int speed, int velocity) : base(new Renderables.ConsoleRenderable(renderChar)) { this.Name = name; this.Speed = speed; this.CurrentSpeed = speed; this.Velocity = velocity; this.Equipment = new List<Item>(); } public Character(string name, char renderChar, int speed, int velocity, List<Item> equipment) : this(name, renderChar, speed, velocity) { this.Equipment = equipment; } public void Interact() { } private void Move() { switch (Transform.Direction) { case Direction.Right: Transform.Position = new Point(Transform.Position.X + Velocity, Transform.Position.Y); break; case Direction.Left: Transform.Position = new Point(Transform.Position.X - Velocity, Transform.Position.Y); break; case Direction.Up: Transform.Position = new Point(Transform.Position.X, Transform.Position.Y - Velocity); break; case Direction.Down: Transform.Position = new Point(Transform.Position.X, Transform.Position.Y + Velocity); break; } } public void Update(TimeSpan deltaTime) { CurrentSpeed--; if (CurrentSpeed == 0) { CurrentSpeed = Speed; Move(); } } public abstract void Shoot<T>(Direction direction) where T : Projectile; public double Health { get; set; } public double AttackPower { get; set; } public double DefencePower { get; set; } public double Mana { get; set; } public bool Immortal { get; set; } public double MagicPower { get; set; } public void Attack(Character character) { this.Health -= character.DefencePower; character.Health -= this.AttackPower; } } }
mit
C#
3a0afa9968a907538171ccffb859c71eec30618a
update Company
StockSharp/StockSharp
Localization/ProjectDescriptions.cs
Localization/ProjectDescriptions.cs
#region S# License /****************************************************************************************** NOTICE!!! This program and source code is owned and licensed by StockSharp, LLC, www.stocksharp.com Viewing or use of this code requires your acceptance of the license agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE Removal of this comment is a violation of the license agreement. Project: StockSharp.Localization.Localization File: ProjectDescriptions.cs Created: 2015, 11, 11, 2:32 PM Copyright 2010 by StockSharp, LLC *******************************************************************************************/ #endregion S# License namespace StockSharp.Localization { /// <summary> /// Information for an assembly manifest. /// </summary> public class ProjectDescriptions { /// <summary> /// Gets company information. /// </summary> public const string Company = "StockSharp Platfrom LLC"; /// <summary> /// Gets product information. /// </summary> public const string Product = "StockSharp"; /// <summary> /// Gets copyright information. /// </summary> public const string Copyright = "Copyright @ StockSharp 2021"; /// <summary> /// Gets trademark information. /// </summary> public const string Trademark = "StockSharp"; /// <summary> /// Gets version information. /// </summary> public const string Version = "5.0.0"; } }
#region S# License /****************************************************************************************** NOTICE!!! This program and source code is owned and licensed by StockSharp, LLC, www.stocksharp.com Viewing or use of this code requires your acceptance of the license agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE Removal of this comment is a violation of the license agreement. Project: StockSharp.Localization.Localization File: ProjectDescriptions.cs Created: 2015, 11, 11, 2:32 PM Copyright 2010 by StockSharp, LLC *******************************************************************************************/ #endregion S# License namespace StockSharp.Localization { /// <summary> /// Information for an assembly manifest. /// </summary> public class ProjectDescriptions { /// <summary> /// Gets company information. /// </summary> public const string Company = "StockSharp LP"; /// <summary> /// Gets product information. /// </summary> public const string Product = "StockSharp"; /// <summary> /// Gets copyright information. /// </summary> public const string Copyright = "Copyright @ StockSharp 2021"; /// <summary> /// Gets trademark information. /// </summary> public const string Trademark = "StockSharp"; /// <summary> /// Gets version information. /// </summary> public const string Version = "5.0.0"; } }
apache-2.0
C#
2c13d19e610cac2fad9f632e60f849144eaf040d
Fix ProjectN build breaks (dotnet/corert#7115)
ptoonen/corefx,wtgodbe/corefx,ericstj/corefx,shimingsg/corefx,wtgodbe/corefx,ViktorHofer/corefx,ptoonen/corefx,ptoonen/corefx,shimingsg/corefx,BrennanConroy/corefx,ptoonen/corefx,ericstj/corefx,ericstj/corefx,wtgodbe/corefx,shimingsg/corefx,ericstj/corefx,ptoonen/corefx,shimingsg/corefx,shimingsg/corefx,wtgodbe/corefx,BrennanConroy/corefx,ericstj/corefx,ericstj/corefx,ViktorHofer/corefx,ptoonen/corefx,ViktorHofer/corefx,ViktorHofer/corefx,ptoonen/corefx,shimingsg/corefx,shimingsg/corefx,BrennanConroy/corefx,wtgodbe/corefx,ViktorHofer/corefx,ViktorHofer/corefx,wtgodbe/corefx,wtgodbe/corefx,ViktorHofer/corefx,ericstj/corefx
src/Common/src/CoreLib/System/Environment.WinRT.cs
src/Common/src/CoreLib/System/Environment.WinRT.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.IO; using Internal.Runtime.Augments; namespace System { public static partial class Environment { public static string UserName => "Windows User"; public static string UserDomainName => "Windows Domain"; private static string GetFolderPathCore(SpecialFolder folder, SpecialFolderOption option) { WinRTInteropCallbacks callbacks = WinRTInterop.UnsafeCallbacks; return callbacks != null && callbacks.IsAppxModel() ? callbacks.GetFolderPath(folder, option) : null; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.IO; namespace System { public static partial class Environment { public static string UserName => "Windows User"; public static string UserDomainName => "Windows Domain"; private static string GetFolderPathCore(SpecialFolder folder, SpecialFolderOption option) { WinRTInteropCallbacks callbacks = WinRTInterop.UnsafeCallbacks; return callbacks != null && callbacks.IsAppxModel() ? callbacks.GetFolderPath(folder, option) : null; } } }
mit
C#
a3ad0eee83dff26bb843b927f054381c7553af1f
Remove unused StorageEngine base class
markmeeus/MarcelloDB
MarcelloDB/Storage/StorageEngine.cs
MarcelloDB/Storage/StorageEngine.cs
using System; using MarcelloDB; using MarcelloDB.Storage.StreamActors; using MarcelloDB.Transactions.__; namespace MarcelloDB.Storage { internal class StorageEngine<T> { internal Marcello Session { get; set; } public StorageEngine(Marcello session) { Session = session; } internal byte[] Read(long address, int length) { return Reader().Read(address, length); } internal void Write(long address, byte[] bytes) { Writer().Write(address, bytes); } #region reader/writer factories Writer Writer() { return new JournalledWriter(this.Session, typeof(T).Name); } Reader Reader() { return new JournalledReader(this.Session, typeof(T).Name); } #endregion } }
using System; using MarcelloDB; using MarcelloDB.Storage.StreamActors; using MarcelloDB.Transactions.__; namespace MarcelloDB.Storage { public abstract class StorageEngine { internal abstract byte[] Read (long address, int length); internal abstract void Write (long address, byte[] bytes); protected bool JournalEnabled { get; set; } internal void DisableJournal() { JournalEnabled = false; } } public class StorageEngine<T> : StorageEngine { internal Marcello Session { get; set; } public StorageEngine(Marcello session) { Session = session; JournalEnabled = typeof(T) != typeof(TransactionJournal); } internal override byte[] Read(long address, int length) { return Reader().Read(address, length); } internal override void Write(long address, byte[] bytes) { Writer().Write(address, bytes); } #region reader/writer factories Writer Writer() { if (JournalEnabled) { return new JournalledWriter(this.Session, typeof(T).Name); } else { return new Writer(this.Session, typeof(T).Name); } } Reader Reader() { if (JournalEnabled) { return new JournalledReader(this.Session, typeof(T).Name); } else { return new Reader(this.Session, typeof(T).Name); } } #endregion } }
mit
C#
044d88afae2c5448e5fdc3893c4a9c285c4eec0e
Fix Health
LLucile/Institfighter
Assets/Scripts/GameUI.cs
Assets/Scripts/GameUI.cs
using UnityEngine; using System.Collections; using UnityEngine.UI; public class GameUI : MonoBehaviour { public GameObject[] PlayerUI; public Image[] playersHealth; public Text[] playersScore; public UICard[] templates; public RectTransform[] p1cards; public RectTransform[] p2cards; public CameraShake cameraShake; public Renderer chalkBoard; public static GameUI Instance = null; void Awake() { if (GameUI.Instance == null){ Instance = this; } else if (Instance != this){ Destroy (gameObject); } DontDestroyOnLoad(GameUI.Instance); } // Use this for initialization void Start () { } // Update is called once per frame void Update () { } public void SetHealth(int player, float amount){ playersScore[player].text = amount+""; playersHealth[player].fillAmount = Mathf.Abs(Mathf.Min(amount, GameManager.Instance.maxScore)/GameManager.Instance.maxScore); } public void CreateCard(int player, int number, Card card){ RectTransform parent; if (player == 1) { parent = p2cards [number]; } else { parent = p1cards [number]; } UICard instance = Instantiate (templates [player]).GetComponent<UICard>(); instance.transform.SetParent (parent, false); instance.Setup (card); } public void RemoveCard (int player, int number){ UICard card = GetCard (player, number); if (card != null) Destroy (card.gameObject); } public void SelectCard(int player, int number, bool selected){ UICard card = GetCard (player, number); if (selected) { card.Select(); } else { card.Unselect(); } } public void Shake(float intensity){ cameraShake.ShakeCamera(intensity, 4f, new Vector3()); } public void SetChalk(int value){ chalkBoard.material.SetInt("FuncA", value); } UICard GetCard(int player, int number){ RectTransform parent; if (player == 1) { parent = p2cards [number]; } else { parent = p1cards [number]; } return parent.GetComponentInChildren<UICard> (); } }
using UnityEngine; using System.Collections; using UnityEngine.UI; public class GameUI : MonoBehaviour { public GameObject[] PlayerUI; public Image[] playersHealth; public Text[] playersScore; public UICard[] templates; public RectTransform[] p1cards; public RectTransform[] p2cards; public CameraShake cameraShake; public Renderer shalkBoard; public static GameUI Instance = null; void Awake() { if (GameUI.Instance == null){ Instance = this; } else if (Instance != this){ Destroy (gameObject); } DontDestroyOnLoad(GameUI.Instance); } // Use this for initialization void Start () { } // Update is called once per frame void Update () { } public void SetHealth(int player, float amount){ playersScore[player].text = amount+""; playersHealth[player].fillAmount = Mathf.Abs(Mathf.Max(amount, GameManager.Instance.maxScore)/GameManager.Instance.maxScore); } public void CreateCard(int player, int number, Card card){ RectTransform parent; if (player == 1) { parent = p2cards [number]; } else { parent = p1cards [number]; } UICard instance = Instantiate (templates [player]).GetComponent<UICard>(); instance.transform.SetParent (parent, false); instance.Setup (card); } public void RemoveCard (int player, int number){ UICard card = GetCard (player, number); if (card != null) Destroy (card.gameObject); } public void SelectCard(int player, int number, bool selected){ UICard card = GetCard (player, number); if (selected) { card.Select(); } else { card.Unselect(); } } public void Shake(float intensity){ cameraShake.ShakeCamera(intensity, 4f, new Vector3()); } public void SetChalk(){ } UICard GetCard(int player, int number){ RectTransform parent; if (player == 1) { parent = p2cards [number]; } else { parent = p1cards [number]; } return parent.GetComponentInChildren<UICard> (); } }
mit
C#
27fbd8af25a1972b49ab45c77f227deadb809fe3
ADD I CANT MOVE FUNCTION!!!!
edwardinubuntu/Roguelike2D
Assets/Scripts/Player.cs
Assets/Scripts/Player.cs
using UnityEngine; using System.Collections; public class Player : MovingObject { public int wallDamage = 1; public int pointsPerFood = 10; public int pointsPerSoda = 20; public float restartLevelDelay = 1f; private Animator animator; private int food; // Use this for initialization protected override void Start () { animator = GetComponent<Animator> (); food = GameManager.instance.playerFoodPoints; base.Start (); } private void OnDisable () { GameManager.instance.playerFoodPoints = food; } // Update is called once per frame void Update () { if (!GameManager.instance.playersTurn) return; int horizontal = 0; int vertical = 0; horizontal = (int)Input.GetAxisRaw ("Horizontal"); vertical = (int)Input.GetAxisRaw ("Vertical"); if (horizontal != 0) vertical = 0; if (horizontal != 0 || vertical != 0) AttemptMove<Wall> (horizontal, vertical); } protected abstract void OnCantMove <T> (T component) { Wall hitWall = component as Wall; hitWall.DamageWall (wallDamage); animator.SetTrigger ("playerChop"); } private void OnTriggerEnter2D (Collider2D other) { if (other.tag == "Exit") { Invoke ("Restart", restartLevelDelay); enabled = false; } else if (other.tag == "Food") { food += pointsPerFood; other.gameObject.SetActive (false); } else if (other.tag == "Soda") { food+= pointsPerSoda; other.gameObject.SetActive(false); } } private void Restart () { Application.LoadLevel (Application.loadedLevel); } protected override void AttemptMove <T> (int xDir, int yDir) { food--; base.AttemptMove <T> (xDir, yDir); RaycastHit2D hit; CheckIfGameOver (); GameManager.instance.playersTurn = false; } private void LoseFood (int loss) { animator.SetTrigger ("playerHit"); food -= loss; CheckIfGameOver (); } private void CheckIfGameOver () { if (food <= 0) GameManager.instance.GameOver (); } }
using UnityEngine; using System.Collections; public class Player : MovingObject { public int wallDamage = 1; public int pointsPerFood = 10; public int pointsPerSoda = 20; public float restartLevelDelay = 1f; private Animator animator; private int food; // Use this for initialization protected override void Start () { animator = GetComponent<Animator> (); food = GameManager.instance.playerFoodPoints; base.Start (); } private void OnDisable () { GameManager.instance.playerFoodPoints = food; } // Update is called once per frame void Update () { if (!GameManager.instance.playersTurn) return; int horizontal = 0; int vertical = 0; horizontal = (int)Input.GetAxisRaw ("Horizontal"); vertical = (int)Input.GetAxisRaw ("Vertical"); if (horizontal != 0) vertical = 0; if (horizontal != 0 || vertical != 0) AttemptMove<Wall> (horizontal, vertical); } protected override void AttemptMove <T> (int xDir, int yDir) { food--; base.AttemptMove <T> (xDir, yDir); RaycastHit2D hit; CheckIfGameOver (); GameManager.instance.playersTurn = false; } private void CheckIfGameOver () { if (food <= 0) GameManager.instance.GameOver (); } }
mit
C#
4320f7f06746411a392a1ef429980012d165d12f
Stop backing field names being used instead of the public property names on JSON response and comments
jpsingleton/Huxley,Newsworthy/Huxley,mjanthony/Huxley,mjanthony/Huxley,Newsworthy/Huxley,jpsingleton/Huxley
src/Huxley/Global.asax.cs
src/Huxley/Global.asax.cs
/* Huxley - a JSON proxy for the UK National Rail Live Departure Board SOAP API Copyright (C) 2015 James Singleton * http://huxley.unop.uk * https://github.com/jpsingleton/Huxley This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ using System; using System.Web; using System.Web.Http; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; namespace Huxley { public class WebApiApplication : HttpApplication { protected void Application_Start() { // Makes the JSON easier to read in a browser without installing an extension like JSONview GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.Formatting = Formatting.Indented; // Stops the backing field names being used instead of the public property names (*Field & PropertyChanged etc.) GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); // Returns JSON to the browser without needing to add application/json to the accept request header - remove to use XML (becomes the default) GlobalConfiguration.Configuration.Formatters.Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter); // Pass Register into Configure to support attribute routing in the future GlobalConfiguration.Configure(WebApiConfig.Register); } protected void Application_BeginRequest(object sender, EventArgs e) { var application = sender as HttpApplication; if (application != null && application.Context != null) { application.Context.Response.Headers.Remove("Server"); } } } }
/* Huxley - a JSON proxy for the UK National Rail Live Departure Board SOAP API Copyright (C) 2015 James Singleton * http://huxley.unop.uk * https://github.com/jpsingleton/Huxley This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ using System; using System.Web; using System.Web.Http; using Newtonsoft.Json; namespace Huxley { public class WebApiApplication : HttpApplication { protected void Application_Start() { GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.Formatting = Formatting.Indented; GlobalConfiguration.Configuration.Formatters.Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter); GlobalConfiguration.Configure(WebApiConfig.Register); } protected void Application_BeginRequest(object sender, EventArgs e) { var application = sender as HttpApplication; if (application != null && application.Context != null) { application.Context.Response.Headers.Remove("Server"); } } } }
agpl-3.0
C#
d67de06f5611b93e22142ce5437ea09416f76cd3
Increase version to 2.2.0
Azure/amqpnetlite
src/Properties/Version.cs
src/Properties/Version.cs
// ------------------------------------------------------------------------------------ // Copyright (c) Microsoft 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. You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, // EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR // CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR // NON-INFRINGEMENT. // // See the Apache Version 2.0 License for specific language governing permissions and // limitations under the License. // ------------------------------------------------------------------------------------ using System.Reflection; // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("2.1.0")] [assembly: AssemblyFileVersion("2.2.0")] [assembly: AssemblyInformationalVersion("2.2.0")]
// ------------------------------------------------------------------------------------ // Copyright (c) Microsoft 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. You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, // EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR // CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR // NON-INFRINGEMENT. // // See the Apache Version 2.0 License for specific language governing permissions and // limitations under the License. // ------------------------------------------------------------------------------------ using System.Reflection; // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("2.1.0")] [assembly: AssemblyFileVersion("2.1.8")] [assembly: AssemblyInformationalVersion("2.1.8")]
apache-2.0
C#
d7a91f4939dd5c1045dd4af95c7738058ad7c405
Replace Click() to JavaScriptClick()
ObjectivityLtd/Test.Automation,ObjectivityBSS/Test.Automation
Objectivity.Test.Automation.Tests.Angular/PageObjects/ProtractorHomePage.cs
Objectivity.Test.Automation.Tests.Angular/PageObjects/ProtractorHomePage.cs
using Objectivity.Test.Automation.Common.Types; namespace Objectivity.Test.Automation.Tests.Angular.PageObjects { using System.Globalization; using NLog; using Objectivity.Test.Automation.Common; using Objectivity.Test.Automation.Common.Extensions; using Objectivity.Test.Automation.Tests.PageObjects; using System; public class ProtractorHomePage : ProjectPageBase { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); /// <summary> /// Locators for elements /// </summary> private readonly ElementLocator QuickStart = new ElementLocator(Locator.Id, "drop1"), Tutorial = new ElementLocator(Locator.CssSelector, "li[class*='open']>ul>li>a[href*='tutorial']"); public ProtractorHomePage OpenProtractorHomePage() { var url = BaseConfiguration.GetUrlValue; this.Driver.SynchronizeWithAngular(true); this.Driver.NavigateTo(new Uri(url)); Logger.Info(CultureInfo.CurrentCulture, "Opening page {0}", url); return this; } public ProtractorHomePage(DriverContext driverContext) : base(driverContext) { } public ProtractorHomePage ClickQuickStart() { this.Driver.GetElement(this.QuickStart).JavaScriptClick(); return this; } public TutorialPage ClickTutorial() { this.Driver.GetElement(this.Tutorial).Click(); return new TutorialPage(this.DriverContext); } } }
using Objectivity.Test.Automation.Common.Types; namespace Objectivity.Test.Automation.Tests.Angular.PageObjects { using System.Globalization; using NLog; using Objectivity.Test.Automation.Common; using Objectivity.Test.Automation.Common.Extensions; using Objectivity.Test.Automation.Tests.PageObjects; using System; public class ProtractorHomePage : ProjectPageBase { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); /// <summary> /// Locators for elements /// </summary> private readonly ElementLocator QuickStart = new ElementLocator(Locator.Id, "drop1"), Tutorial = new ElementLocator(Locator.CssSelector, "li[class*='open']>ul>li>a[href*='tutorial']"); public ProtractorHomePage OpenProtractorHomePage() { var url = BaseConfiguration.GetUrlValue; this.Driver.SynchronizeWithAngular(true); this.Driver.NavigateTo(new Uri(url)); Logger.Info(CultureInfo.CurrentCulture, "Opening page {0}", url); return this; } public ProtractorHomePage(DriverContext driverContext) : base(driverContext) { } public ProtractorHomePage ClickQuickStart() { this.Driver.GetElement(this.QuickStart).Click(); return this; } public TutorialPage ClickTutorial() { this.Driver.GetElement(this.Tutorial).Click(); return new TutorialPage(this.DriverContext); } } }
mit
C#
552b735a42cbec65c9dd6f25cb2e48ac7868e8b5
Refactor constructor generation in BaseClassStep
eatdrinksleepcode/casper,eatdrinksleepcode/casper
Console/BaseClassStep.cs
Console/BaseClassStep.cs
using System.Linq; using Boo.Lang.Compiler.Ast; using Boo.Lang.Compiler.Steps; using Casper.IO; namespace Casper { public class BaseClassStep : AbstractTransformerCompilerStep { private readonly IDirectory location; public BaseClassStep(IDirectory location) { this.location = location; } public override void Run() { base.Visit(CompileUnit); } public override void OnModule(Module node) { if(node.Namespace == null) { var baseClass = new ClassDefinition(node.LexicalInfo); baseClass.Name = node.Name + "Project"; baseClass.BaseTypes.Add(TypeReference.Lift(typeof(ProjectBase))); var configureMethod = new Method(node.LexicalInfo) { Name = "Configure", Modifiers = TypeMemberModifiers.Override | TypeMemberModifiers.Protected, Body = node.Globals, }; baseClass.Members.Add(configureMethod); baseClass.Members.Add(CreateConstructor(node, ConstructorParameterForRootProject(node))); baseClass.Members.Add(CreateConstructor(node, ConstructorParameterForSubProject(node))); baseClass.Members.Add(CreateConstructor(node, ConstructorParameterForSubProject(node), ConstructorParameterForName(node))); node.Globals = null; node.Members.Add(baseClass); } } private Constructor CreateConstructor(Module node, params ParameterDeclaration[] constructorParameters) { var constructor = new Constructor(node.LexicalInfo); foreach(var c in constructorParameters) { constructor.Parameters.Add(c); } var args = constructorParameters.Select(p => new ReferenceExpression(node.LexicalInfo, p.Name)).Cast<Expression>().ToList(); args.Insert(1, Expression.Lift(this.location.FullPath)); constructor.Body.Add(new MethodInvocationExpression( node.LexicalInfo, new SuperLiteralExpression(node.LexicalInfo), args.ToArray() )); return constructor; } private static ParameterDeclaration ConstructorParameterForRootProject(Module node) { return new ParameterDeclaration(node.LexicalInfo) { Name = "fileSystem", Type = TypeReference.Lift(typeof(IFileSystem)) }; } private static ParameterDeclaration ConstructorParameterForSubProject(Module node) { return new ParameterDeclaration(node.LexicalInfo) { Name = "parent", Type = TypeReference.Lift(typeof(ProjectBase)) }; } private static ParameterDeclaration ConstructorParameterForName(Module node) { return new ParameterDeclaration(node.LexicalInfo) { Name = "name", Type = TypeReference.Lift(typeof(string)) }; } } }
using System.Linq; using Boo.Lang.Compiler.Ast; using Boo.Lang.Compiler.Steps; using Casper.IO; namespace Casper { public class BaseClassStep : AbstractTransformerCompilerStep { private readonly IDirectory location; public BaseClassStep(IDirectory location) { this.location = location; } public override void Run() { base.Visit(CompileUnit); } public override void OnModule(Module node) { if(node.Namespace == null) { var baseClass = new ClassDefinition(node.LexicalInfo); baseClass.Name = node.Name + "Project"; baseClass.BaseTypes.Add(TypeReference.Lift(typeof(ProjectBase))); var configureMethod = new Method(node.LexicalInfo) { Name = "Configure", Modifiers = TypeMemberModifiers.Override | TypeMemberModifiers.Protected, Body = node.Globals, }; baseClass.Members.Add(configureMethod); baseClass.Members.Add(CreateConstructor(node, ConstructorParameterForRootProject(node))); baseClass.Members.Add(CreateConstructor(node, ConstructorParameterForSubProject(node))); baseClass.Members.Add(CreateConstructor(node, ConstructorParameterForSubProject(node), ConstructorParameterForName(node))); node.Globals = null; node.Members.Add(baseClass); } } private Constructor CreateConstructor(Module node, params ParameterDeclaration[] constructorParameters) { var constructor = new Constructor(node.LexicalInfo); foreach(var c in constructorParameters) { constructor.Parameters.Add(c); } var args = constructorParameters.Take(1).Select(p => new ReferenceExpression(node.LexicalInfo, p.Name)) .Concat(Enumerable.Repeat(Expression.Lift(this.location.FullPath), 1)) .Concat(constructorParameters.Skip(1).Select(p => new ReferenceExpression(node.LexicalInfo, p.Name))); constructor.Body.Add(new MethodInvocationExpression( node.LexicalInfo, new SuperLiteralExpression(node.LexicalInfo), args.ToArray() )); return constructor; } private static ParameterDeclaration ConstructorParameterForRootProject(Module node) { return new ParameterDeclaration(node.LexicalInfo) { Name = "fileSystem", Type = TypeReference.Lift(typeof(IFileSystem)) }; } private static ParameterDeclaration ConstructorParameterForSubProject(Module node) { return new ParameterDeclaration(node.LexicalInfo) { Name = "parent", Type = TypeReference.Lift(typeof(ProjectBase)) }; } private static ParameterDeclaration ConstructorParameterForName(Module node) { return new ParameterDeclaration(node.LexicalInfo) { Name = "name", Type = TypeReference.Lift(typeof(string)) }; } } }
mit
C#
b27fc1aaf9ff98a83d5140c6b5d56836dcd88d59
Update includeList in teachers.
denismaster/DiplomContentSystem,denismaster/DiplomContentSystem,denismaster/DiplomContentSystem,denismaster/DiplomContentSystem
src/DiplomContentSystem.Services/Teachers/TeacherService.cs
src/DiplomContentSystem.Services/Teachers/TeacherService.cs
using System; using System.Collections.Generic; using DiplomContentSystem.Core; using DiplomContentSystem.Dto; using AutoMapper; namespace DiplomContentSystem.Services.Teachers { public class TeacherService { private readonly IRepository<Teacher> _repository; private readonly IMapper _mapper; public TeacherService(IRepository<Teacher> repository, IMapper mapper) { if (repository == null) throw new ArgumentNullException(nameof(repository)); if (mapper == null) throw new ArgumentNullException(nameof(mapper)); _repository = repository; _mapper = mapper; } public Dto.ListResponse<TeacherListItem> GetTeachers(TeacherRequest request) { var queryBuilder = new TeachersQueryBuilder(); var response = new ListResponse<TeacherListItem>(); string[] includes = {"Position","Department"}; var query = queryBuilder.UseDto(request) .UsePaging() .UseFilters() .UseSortings(defaultSorting:"id") .Build(); response.TotalCount = _repository.Count(query.FilterExpression); response.Items = _mapper.Map<IEnumerable<TeacherListItem>>(_repository.Get(query, includes)); return response; } public Teacher Get(int id) { string[] includes = {"Position","Department"}; return _repository.Get(id,includes); } public bool AddTeacher(TeacherEditItem teacherDto) { var dbTeacher = _mapper.Map<Teacher>(teacherDto); _repository.Add(dbTeacher); _repository.SaveChanges(); return true; } public bool UpdateTeacher(TeacherEditItem teacherDto) { var dbTeacher = _mapper.Map<Teacher>(teacherDto); _repository.Update(dbTeacher); _repository.SaveChanges(); return true; } } }
using System; using System.Collections.Generic; using DiplomContentSystem.Core; using DiplomContentSystem.Dto; using AutoMapper; namespace DiplomContentSystem.Services.Teachers { public class TeacherService { private readonly IRepository<Teacher> _repository; private readonly IMapper _mapper; public TeacherService(IRepository<Teacher> repository, IMapper mapper) { if (repository == null) throw new ArgumentNullException(nameof(repository)); if (mapper == null) throw new ArgumentNullException(nameof(mapper)); _repository = repository; _mapper = mapper; } public Dto.ListResponse<TeacherListItem> GetTeachers(TeacherRequest request) { var queryBuilder = new TeachersQueryBuilder(); var response = new ListResponse<TeacherListItem>(); string[] includes = {"Position","Speciality"}; var query = queryBuilder.UseDto(request) .UsePaging() .UseFilters() .UseSortings(defaultSorting:"id") .Build(); response.TotalCount = _repository.Count(query.FilterExpression); response.Items = _mapper.Map<IEnumerable<TeacherListItem>>(_repository.Get(query, includes)); return response; } public Teacher Get(int id) { string[] includes = {"Position","Speciality"}; return _repository.Get(id,includes); } public bool AddTeacher(TeacherEditItem teacherDto) { var dbTeacher = _mapper.Map<Teacher>(teacherDto); _repository.Add(dbTeacher); _repository.SaveChanges(); return true; } public bool UpdateTeacher(TeacherEditItem teacherDto) { var dbTeacher = _mapper.Map<Teacher>(teacherDto); _repository.Update(dbTeacher); _repository.SaveChanges(); return true; } } }
apache-2.0
C#
a66550fa2371ad8fd45153ef6d380ffa4b84d9a4
Fix list-commands sorting via Linq. Fixes #16
nvisionative/Dnn.Platform,dnnsoftware/Dnn.Platform,bdukes/Dnn.Platform,EPTamminga/Dnn.Platform,dnnsoftware/Dnn.AdminExperience.Extensions,dnnsoftware/Dnn.AdminExperience.Extensions,valadas/Dnn.Platform,mitchelsellers/Dnn.Platform,mitchelsellers/Dnn.Platform,bdukes/Dnn.Platform,RichardHowells/Dnn.Platform,EPTamminga/Dnn.Platform,dnnsoftware/Dnn.Platform,RichardHowells/Dnn.Platform,mitchelsellers/Dnn.Platform,robsiera/Dnn.Platform,RichardHowells/Dnn.Platform,bdukes/Dnn.Platform,robsiera/Dnn.Platform,valadas/Dnn.Platform,dnnsoftware/Dnn.Platform,bdukes/Dnn.Platform,nvisionative/Dnn.Platform,valadas/Dnn.Platform,valadas/Dnn.Platform,dnnsoftware/Dnn.Platform,EPTamminga/Dnn.Platform,mitchelsellers/Dnn.Platform,nvisionative/Dnn.Platform,valadas/Dnn.Platform,dnnsoftware/Dnn.AdminExperience.Extensions,dnnsoftware/Dnn.Platform,robsiera/Dnn.Platform,RichardHowells/Dnn.Platform,mitchelsellers/Dnn.Platform
src/Modules/Prompt/Dnn.PersonaBar.Prompt/Commands/Commands/ListCommands.cs
src/Modules/Prompt/Dnn.PersonaBar.Prompt/Commands/Commands/ListCommands.cs
using Dnn.PersonaBar.Prompt.Attributes; using Dnn.PersonaBar.Prompt.Common; using Dnn.PersonaBar.Prompt.Interfaces; using Dnn.PersonaBar.Prompt.Models; using Dnn.PersonaBar.Prompt.Repositories; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; using System; using System.Linq; namespace Dnn.PersonaBar.Prompt.Commands.Commands { [ConsoleCommand("list-commands", "Lists all available commands", new string[] { })] public class ListCommands : ConsoleCommandBase, IConsoleCommand { public string ValidationMessage { get; private set; } public void Init(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId) { Initialize(args, portalSettings, userInfo, activeTabId); } public bool IsValid() { return true; } public ConsoleResultModel Run() { try { var lstOut = CommandRepository.Instance.GetCommands().Values.OrderBy(c => c.Name + '.' + c.Name); return new ConsoleResultModel(string.Format("Found {0} commands", lstOut.Count())) { data = lstOut, fieldOrder = new string[] { "Name", "Description", "Version", "NameSpace" } }; } catch (Exception ex) { DotNetNuke.Services.Exceptions.Exceptions.LogException(ex); return new ConsoleErrorResultModel("An error occurred while attempting to restart the application."); } } } }
using Dnn.PersonaBar.Prompt.Attributes; using Dnn.PersonaBar.Prompt.Common; using Dnn.PersonaBar.Prompt.Interfaces; using Dnn.PersonaBar.Prompt.Models; using Dnn.PersonaBar.Prompt.Repositories; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; using System; using System.Linq; namespace Dnn.PersonaBar.Prompt.Commands.Commands { [ConsoleCommand("list-commands", "Lists all available commands", new string[] { })] public class ListCommands : ConsoleCommandBase, IConsoleCommand { public string ValidationMessage { get; private set; } public void Init(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId) { Initialize(args, portalSettings, userInfo, activeTabId); } public bool IsValid() { return true; } public ConsoleResultModel Run() { try { var lstOut = CommandRepository.Instance.GetCommands().Values; return new ConsoleResultModel(string.Format("Found {0} commands", lstOut.Count())) { data = lstOut, fieldOrder = new string[] { "Name", "Description", "Version", "NameSpace" } }; } catch (Exception ex) { DotNetNuke.Services.Exceptions.Exceptions.LogException(ex); return new ConsoleErrorResultModel("An error occurred while attempting to restart the application."); } } } }
mit
C#
53a491eff93565a852f0d4b4d6c636d19eceb890
Tweak conventions for nservicebus messages to work in unobtrusive and normal mode
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
src/SFA.DAS.EmployerAccounts/Extensions/EndpointConfigurationExtensions.cs
src/SFA.DAS.EmployerAccounts/Extensions/EndpointConfigurationExtensions.cs
using System; using NServiceBus; using SFA.DAS.AutoConfiguration; using SFA.DAS.EmployerFinance.Messages.Commands; using SFA.DAS.Notifications.Messages.Commands; using SFA.DAS.NServiceBus.Configuration.AzureServiceBus; using StructureMap; namespace SFA.DAS.EmployerAccounts.Extensions { public static class EndpointConfigurationExtensions { public static EndpointConfiguration UseAzureServiceBusTransport(this EndpointConfiguration config, Func<string> connectionStringBuilder, IContainer container) { var isDevelopment = container.GetInstance<IEnvironmentService>().IsCurrent(DasEnv.LOCAL); if (isDevelopment) { var transport = config.UseTransport<LearningTransport>(); transport.Transactions(TransportTransactionMode.ReceiveOnly); ConfigureRouting(transport.Routing()); } else { config.UseAzureServiceBusTransport(connectionStringBuilder(), ConfigureRouting); var conventions = config.Conventions(); conventions.DefiningCommandsAs(type => { return type.Namespace == typeof(SendEmailCommand).Namespace || type.Namespace == typeof(ImportLevyDeclarationsCommand).Namespace; }); } return config; } private static void ConfigureRouting(RoutingSettings routing) { routing.RouteToEndpoint( typeof(ImportLevyDeclarationsCommand).Assembly, typeof(ImportLevyDeclarationsCommand).Namespace, "SFA.DAS.EmployerFinance.MessageHandlers" ); routing.RouteToEndpoint( typeof(SendEmailCommand).Assembly, typeof(SendEmailCommand).Namespace, "SFA.DAS.Notifications.MessageHandlers" ); } } }
using System; using NServiceBus; using SFA.DAS.AutoConfiguration; using SFA.DAS.EmployerFinance.Messages.Commands; using SFA.DAS.Notifications.Messages.Commands; using SFA.DAS.NServiceBus.Configuration.AzureServiceBus; using StructureMap; namespace SFA.DAS.EmployerAccounts.Extensions { public static class EndpointConfigurationExtensions { public static EndpointConfiguration UseAzureServiceBusTransport(this EndpointConfiguration config, Func<string> connectionStringBuilder, IContainer container) { var isDevelopment = container.GetInstance<IEnvironmentService>().IsCurrent(DasEnv.LOCAL); if (isDevelopment) { var transport = config.UseTransport<LearningTransport>(); transport.Transactions(TransportTransactionMode.ReceiveOnly); ConfigureRouting(transport.Routing()); } else { config.UseAzureServiceBusTransport(connectionStringBuilder(), ConfigureRouting); } return config; } private static void ConfigureRouting(RoutingSettings routing) { routing.RouteToEndpoint( typeof(ImportLevyDeclarationsCommand).Assembly, typeof(ImportLevyDeclarationsCommand).Namespace, "SFA.DAS.EmployerFinance.MessageHandlers" ); routing.RouteToEndpoint( typeof(SendEmailCommand).Assembly, typeof(SendEmailCommand).Namespace, "SFA.DAS.Notifications.MessageHandlers" ); } } }
mit
C#
718c9859a097cf7c1f264e3f67a7cd425c9c59c8
Revert "View インスタンスが何度も作られないよう修正"
veigr/LevelChartPlugin
LvChartPlugin/LvChart.cs
LvChartPlugin/LvChart.cs
using System.ComponentModel.Composition; using Grabacr07.KanColleViewer.Composition; using LvChartPlugin.ViewModels; namespace LvChartPlugin { [Export(typeof(IPlugin))] [Export(typeof(ITool))] [ExportMetadata("Guid", "626E91CE-A031-4FB6-8E02-E52906A665BA")] [ExportMetadata("Title", "LvChart")] [ExportMetadata("Description", "Level チャート を表示します。")] [ExportMetadata("Version", "1.3.0")] [ExportMetadata("Author", "@veigr")] public class LvChart : IPlugin, ITool { private readonly ToolViewModel vm = new ToolViewModel(); public void Initialize() {} public string Name => "LvChart"; public object View => new Views.ToolView {DataContext = this.vm}; } }
using System.ComponentModel.Composition; using Grabacr07.KanColleViewer.Composition; using LvChartPlugin.ViewModels; using LvChartPlugin.Views; namespace LvChartPlugin { [Export(typeof(IPlugin))] [Export(typeof(ITool))] [ExportMetadata("Guid", "626E91CE-A031-4FB6-8E02-E52906A665BA")] [ExportMetadata("Title", "LvChart")] [ExportMetadata("Description", "Level チャート を表示します。")] [ExportMetadata("Version", "1.3.0")] [ExportMetadata("Author", "@veigr")] public class LvChart : IPlugin, ITool { private readonly ToolView v = new ToolView { DataContext = new ToolViewModel() }; public void Initialize() {} public string Name => "LvChart"; public object View => this.v; } }
mit
C#
04a633a8c647f05635affbaa0ebd9b5b1b448a74
make bearer optional
oelite/RESTme
OElite.Restme/IRestme.cs
OElite.Restme/IRestme.cs
using System; using System.Net.Http; using System.Threading.Tasks; namespace OElite { public interface IRestme { Uri BaseUri { get; set; } string RequestUrlPath { get; set; } void Add(string key, string value); void Add(string key, object value); void Add(object value); void AddHeader(string header, string value, bool allowMultipleValues = false); void AddBearerToken(string token, bool addBearerPrefix = true); T Request<T>(HttpMethod method, string keyOrRelativePath = null); Task<T> RequestAsync<T>(HttpMethod method, string keyOrRelativePath = null); T Get<T>(string keyOrRelativePath = null); Task<T> GetAsync<T>(string keyOrRelativePath = null); string Get(string keyOrRelativePath = null); Task<string> GetAsync(string keyOrRelativePath = null); T Post<T>(string keyOrRelativePath = null, object dataObject = null); Task<T> PostAsync<T>(string keyOrRelativePath = null, object dataObject = null); string Post(string keyOrRelativePath = null, string dataValue = null); Task<string> PostAsync(string keyOrRelativePath = null, string dataValue = null); T Delete<T>(string keyOrRelativePath = null); Task<T> DeleteAsync<T>(string keyOrRelativePath = null); bool Delete(string keyOrRelativePath = null); Task<bool> DeleteAsync(string keyOrRelativePAth = null); } }
using System; using System.Net.Http; using System.Threading.Tasks; namespace OElite { public interface IRestme { Uri BaseUri { get; set; } string RequestUrlPath { get; set; } void Add(string key, string value); void Add(string key, object value); void Add(object value); void AddHeader(string header, string value, bool allowMultipleValues = false); void AddBearerToken(string token); T Request<T>(HttpMethod method, string keyOrRelativePath = null); Task<T> RequestAsync<T>(HttpMethod method, string keyOrRelativePath = null); T Get<T>(string keyOrRelativePath = null); Task<T> GetAsync<T>(string keyOrRelativePath = null); string Get(string keyOrRelativePath = null); Task<string> GetAsync(string keyOrRelativePath = null); T Post<T>(string keyOrRelativePath = null, object dataObject = null); Task<T> PostAsync<T>(string keyOrRelativePath = null, object dataObject = null); string Post(string keyOrRelativePath = null, string dataValue = null); Task<string> PostAsync(string keyOrRelativePath = null, string dataValue = null); T Delete<T>(string keyOrRelativePath = null); Task<T> DeleteAsync<T>(string keyOrRelativePath = null); bool Delete(string keyOrRelativePath = null); Task<bool> DeleteAsync(string keyOrRelativePAth = null); } }
mit
C#
5b7fac19c1226a0417a0b78cba69af0144deb4e0
Add documentation
sguertl/Flying_Pi,sguertl/Flying_Pi,sguertl/Flying_Pi,sguertl/Flying_Pi
Dronection/Android/WiFi/WiFiDronection/WiFiDronection/ControllerSettings.cs
Dronection/Android/WiFi/WiFiDronection/WiFiDronection/ControllerSettings.cs
namespace WiFiDronection { public class ControllerSettings { // Constants public static readonly bool ACTIVE = true; public static readonly bool INACTIVE = false; /// <summary> /// Flying mode /// </summary> public bool Inverted { get; set; } /// <summary> /// Trim of yaw parameter [-30;30] /// </summary> public int TrimYaw { get; set; } /// <summary> /// Trim of pitch parameter [-30;30] /// </summary> public int TrimPitch { get; set; } /// <summary> /// Trim of roll paramter [-30;30] /// </summary> public int TrimRoll { get; set; } /// <summary> /// Altitude control /// </summary> public bool AltitudeControlActivated { get; set; } /// <summary> /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:WiFiDronection.ControllerSettings"/>. /// </summary> /// <returns>A <see cref="T:System.String"/> that represents the current <see cref="T:WiFiDronection.ControllerSettings"/>.</returns> public override string ToString() { return TrimYaw + ";" + TrimPitch + ";" + TrimRoll; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; namespace WiFiDronection { public class ControllerSettings { // Constants public static readonly bool ACTIVE = true; public static readonly bool INACTIVE = false; /// <summary> /// Are the joysticks inverted /// </summary> public bool Inverted { get; set; } /// <summary> /// Trim of yaw parameter [-30;30] /// </summary> public int TrimYaw { get; set; } /// <summary> /// Trim of pitch parameter [-30;30] /// </summary> public int TrimPitch { get; set; } /// <summary> /// Trim of roll paramter [-30;30] /// </summary> public int TrimRoll { get; set; } /// <summary> /// Is Height control of the copter active /// </summary> public bool AltitudeControlActivated { get; set; } public ControllerSettings() { } public override string ToString() { return TrimYaw + ";" + TrimPitch + ";" + TrimRoll; } } }
apache-2.0
C#