commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
0d0485438cd2544c422b05d7de7cd69acabb9bb1
src/WizardFramework.HTML/HtmlWizardPage{TM}.Designer.cs
src/WizardFramework.HTML/HtmlWizardPage{TM}.Designer.cs
namespace WizardFramework.HTML { partial class HtmlWizardPage<TM> { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.webView = new System.Windows.Forms.WebBrowser(); this.SuspendLayout(); // // webView // this.webView.AllowNavigation = false; this.webView.AllowWebBrowserDrop = false; this.webView.Dock = System.Windows.Forms.DockStyle.Fill; this.webView.IsWebBrowserContextMenuEnabled = true; this.webView.Location = new System.Drawing.Point(0, 0); this.webView.MinimumSize = new System.Drawing.Size(20, 20); this.webView.Name = "webView"; this.webView.Size = new System.Drawing.Size(150, 150); this.webView.TabIndex = 0; this.webView.WebBrowserShortcutsEnabled = true; // // HtmlWizardPage // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.Controls.Add(this.webView); this.Name = "HtmlWizardPage"; this.ResumeLayout(false); } #endregion private System.Windows.Forms.WebBrowser webView; } }
namespace WizardFramework.HTML { partial class HtmlWizardPage<TM> { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.webView = new System.Windows.Forms.WebBrowser(); this.SuspendLayout(); // // webView // this.webView.AllowNavigation = false; this.webView.AllowWebBrowserDrop = false; this.webView.Dock = System.Windows.Forms.DockStyle.Fill; this.webView.IsWebBrowserContextMenuEnabled = false; this.webView.Location = new System.Drawing.Point(0, 0); this.webView.MinimumSize = new System.Drawing.Size(20, 20); this.webView.Name = "webView"; this.webView.Size = new System.Drawing.Size(150, 150); this.webView.TabIndex = 0; this.webView.WebBrowserShortcutsEnabled = false; // // HtmlWizardPage // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.Controls.Add(this.webView); this.Name = "HtmlWizardPage"; this.ResumeLayout(false); } #endregion private System.Windows.Forms.WebBrowser webView; } }
Disable shortcuts and ContextMenu in web browser control.
Disable shortcuts and ContextMenu in web browser control.
C#
mit
Jarrey/wizard-framework,Jarrey/wizard-framework,Jarrey/wizard-framework
e348f8b63acbce16f3234f35c3ab33e4f483638f
Azuria/Community/MessageEnumerable.cs
Azuria/Community/MessageEnumerable.cs
using System.Collections; using System.Collections.Generic; namespace Azuria.Community { /// <summary> /// </summary> public class MessageEnumerable : IEnumerable<Message> { private readonly int _conferenceId; private readonly bool _markAsRead; private readonly Senpai _senpai; internal MessageEnumerable(int conferenceId, Senpai senpai, bool markAsRead = true) { this._conferenceId = conferenceId; this._senpai = senpai; this._markAsRead = markAsRead; } #region Methods /// <summary>Returns an enumerator that iterates through a collection.</summary> /// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns> IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); } /// <summary>Returns an enumerator that iterates through the collection.</summary> /// <returns>An enumerator that can be used to iterate through the collection.</returns> public IEnumerator<Message> GetEnumerator() { return new MessageEnumerator(this._conferenceId, this._markAsRead, this._senpai); } #endregion } }
using System.Collections; using System.Collections.Generic; namespace Azuria.Community { /// <summary> /// </summary> public class MessageEnumerable : IEnumerable<Message> { private readonly int _conferenceId; private readonly Senpai _senpai; internal MessageEnumerable(int conferenceId, Senpai senpai, bool markAsRead = true) { this._conferenceId = conferenceId; this._senpai = senpai; this.MarkAsRead = markAsRead; } #region Properties /// <summary> /// </summary> public bool MarkAsRead { get; set; } #endregion #region Methods /// <summary>Returns an enumerator that iterates through a collection.</summary> /// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns> IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); } /// <summary>Returns an enumerator that iterates through the collection.</summary> /// <returns>An enumerator that can be used to iterate through the collection.</returns> public IEnumerator<Message> GetEnumerator() { return new MessageEnumerator(this._conferenceId, this.MarkAsRead, this._senpai); } #endregion } }
Add property to whether mark new Messages as read or not
Add property to whether mark new Messages as read or not
C#
mit
InfiniteSoul/Azuria
19703360f7286bf8f5faac1cc9be63209c88b5e1
src/Avalonia.Base/Styling/Styler.cs
src/Avalonia.Base/Styling/Styler.cs
using System; namespace Avalonia.Styling { public class Styler : IStyler { public void ApplyStyles(IStyleable target) { _ = target ?? throw new ArgumentNullException(nameof(target)); // If the control has a themed templated parent then first apply the styles from // the templated parent theme. if (target.TemplatedParent is IStyleable styleableParent) styleableParent.GetEffectiveTheme()?.TryAttach(target, styleableParent); // Next apply the control theme. target.GetEffectiveTheme()?.TryAttach(target, target); // Apply styles from the rest of the tree. if (target is IStyleHost styleHost) ApplyStyles(target, styleHost); } private void ApplyStyles(IStyleable target, IStyleHost host) { var parent = host.StylingParent; if (parent != null) ApplyStyles(target, parent); if (host.IsStylesInitialized) host.Styles.TryAttach(target, host); } } }
using System; namespace Avalonia.Styling { public class Styler : IStyler { public void ApplyStyles(IStyleable target) { _ = target ?? throw new ArgumentNullException(nameof(target)); // Apply the control theme. target.GetEffectiveTheme()?.TryAttach(target, target); // If the control has a themed templated parent then apply the styles from the // templated parent theme. if (target.TemplatedParent is IStyleable styleableParent) styleableParent.GetEffectiveTheme()?.TryAttach(target, styleableParent); // Apply styles from the rest of the tree. if (target is IStyleHost styleHost) ApplyStyles(target, styleHost); } private void ApplyStyles(IStyleable target, IStyleHost host) { var parent = host.StylingParent; if (parent != null) ApplyStyles(target, parent); if (host.IsStylesInitialized) host.Styles.TryAttach(target, host); } } }
Apply own control theme before templated parent's.
Apply own control theme before templated parent's.
C#
mit
AvaloniaUI/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia
8af19254bab87df5adcdf6c05f887d8950c43383
src/ZobShop.Models/ProductRating.cs
src/ZobShop.Models/ProductRating.cs
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace ZobShop.Models { public class ProductRating { public ProductRating(int rating, string content, int productId, User author) { this.Rating = rating; this.Content = content; this.ProductId = productId; this.Author = author; } [Key] public int ProductRatingId { get; set; } public int Rating { get; set; } public string Content { get; set; } public int ProductId { get; set; } [ForeignKey("ProductId")] public virtual Product Product { get; set; } [ForeignKey("Author")] public string AuthorId { get; set; } [ForeignKey("Id")] public virtual User Author { get; set; } } }
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace ZobShop.Models { public class ProductRating { public ProductRating() { } public ProductRating(int rating, string content, Product product, User author) { this.Rating = rating; this.Content = content; this.Author = author; this.Product = product; } [Key] public int ProductRatingId { get; set; } public int Rating { get; set; } public string Content { get; set; } public int ProductId { get; set; } [ForeignKey("ProductId")] public virtual Product Product { get; set; } [ForeignKey("Author")] public string AuthorId { get; set; } [ForeignKey("Id")] public virtual User Author { get; set; } } }
Add default constructor for product rating
Add default constructor for product rating
C#
mit
Branimir123/ZobShop,Branimir123/ZobShop,Branimir123/ZobShop
7982f01c45817ff7be9c21da3914bae811fdfe0b
R7.University.EduProgramProfiles/Views/Contingent/_ActualRow.cshtml
R7.University.EduProgramProfiles/Views/Contingent/_ActualRow.cshtml
@inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage<ContingentViewModel> @using DotNetNuke.Web.Mvc.Helpers @using R7.University.EduProgramProfiles.ViewModels <td itemprop="eduCode">@Model.EduProfile.EduProgram.Code</td> <td itemprop="eduName">@Model.EduProfileTitle</td> <td itemprop="eduLevel">@Model.EduProfile.EduLevel.Title</td> <td itemprop="eduForm">@Model.EduFormTitle</td> <td itemprop="numberBFpriem">@Model.ActualFB</td> <td itemprop="numberBRpriem">@Model.ActualRB</td> <td itemprop="numberBMpriem">@Model.ActualMB</td> <td itemprop="numberPpriem">@Model.ActualBC</td> <td>@Model.ActualForeign</td>
@inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage<ContingentViewModel> @using DotNetNuke.Web.Mvc.Helpers @using R7.University.EduProgramProfiles.ViewModels <td itemprop="eduCode">@Model.EduProfile.EduProgram.Code</td> <td itemprop="eduName">@Model.EduProfileTitle</td> <td itemprop="eduLevel">@Model.EduProfile.EduLevel.Title</td> <td itemprop="eduForm">@Model.EduFormTitle</td> <td itemprop="numberBF">@Model.ActualFB</td> <td itemprop="numberBR">@Model.ActualRB</td> <td itemprop="numberBM">@Model.ActualMB</td> <td itemprop="numberP">@Model.ActualBC</td> <td itemprop="numberF">@Model.ActualForeign</td>
Update microdata for actual number of students table
Update microdata for actual number of students table
C#
agpl-3.0
roman-yagodin/R7.University,roman-yagodin/R7.University,roman-yagodin/R7.University
fafb91a62c60750f42983d57cbf2fb7cc99e42fc
AIWolfLib/ShuffleExtensions.cs
AIWolfLib/ShuffleExtensions.cs
// // ShuffleExtensions.cs // // Copyright (c) 2017 Takashi OTSUKI // // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // using System; using System.Collections.Generic; using System.Linq; namespace AIWolf.Lib { #if JHELP /// <summary> /// IEnumerableインターフェースを実装したクラスに対するShuffle拡張メソッド定義 /// </summary> #else /// <summary> /// Defines extension method to shuffle what implements IEnumerable interface. /// </summary> #endif public static class ShuffleExtensions { #if JHELP /// <summary> /// IEnumerableをシャッフルしたIListを返す /// </summary> /// <typeparam name="T">IEnumerableの要素の型</typeparam> /// <param name="s">TのIEnumerable</param> /// <returns>シャッフルされたTのIList</returns> #else /// <summary> /// Returns shuffled IList of T. /// </summary> /// <typeparam name="T">Type of element of IEnumerable.</typeparam> /// <param name="s">IEnumerable of T.</param> /// <returns>Shuffled IList of T.</returns> #endif public static IList<T> Shuffle<T>(this IEnumerable<T> s) => s.OrderBy(x => Guid.NewGuid()).ToList(); } }
// // ShuffleExtensions.cs // // Copyright (c) 2017 Takashi OTSUKI // // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // using System; using System.Collections.Generic; using System.Linq; namespace AIWolf.Lib { #if JHELP /// <summary> /// IEnumerableインターフェースを実装したクラスに対するShuffle拡張メソッド定義 /// </summary> #else /// <summary> /// Defines extension method to shuffle what implements IEnumerable interface. /// </summary> #endif public static class ShuffleExtensions { #if JHELP /// <summary> /// IEnumerableをシャッフルしたものを返す /// </summary> /// <typeparam name="T">IEnumerableの要素の型</typeparam> /// <param name="s">TのIEnumerable</param> /// <returns>シャッフルされたIEnumerable</returns> #else /// <summary> /// Returns shuffled IEnumerable of T. /// </summary> /// <typeparam name="T">Type of element of IEnumerable.</typeparam> /// <param name="s">IEnumerable of T.</param> /// <returns>Shuffled IEnumerable of T.</returns> #endif public static IOrderedEnumerable<T> Shuffle<T>(this IEnumerable<T> s) => s.OrderBy(x => Guid.NewGuid()); } }
Make Shuffle<T> return IEnumerable<T> instead of IList<T>.
Make Shuffle<T> return IEnumerable<T> instead of IList<T>.
C#
mit
AIWolfSharp/AIWolf_NET
54ed7d5872c3c1d0bda21da7efe06fb4020d653a
Assets/Scripts/UIController.cs
Assets/Scripts/UIController.cs
using UnityEngine; using UnityEngine.UI; using System.Collections; /// <summary> /// UIController holds references to GUI widgets and acts as data receiver for them. /// </summary> public class UIController : MonoBehaviour, IGUIUpdateTarget { public Text SpeedText; public Slider ThrottleSlider; public Slider EngineThrottleSlider; public Text AltitudeText; public void UpdateSpeed(float speed) { SpeedText.text = "IAS: " + (int)(speed * 1.94f) + " kn"; } public void UpdateThrottle(float throttle) { ThrottleSlider.value = throttle; } public void UpdateEngineThrottle(float engineThrottle) { EngineThrottleSlider.value = engineThrottle; } public void UpdateAltitude(float altitude) { AltitudeText.text = "ALT: " + (int)(altitude * 3.28f) + " ft"; } // Use this for initialization void Start () { } // Update is called once per frame void Update () { } }
using UnityEngine; using UnityEngine.UI; using System.Collections; /// <summary> /// UIController holds references to GUI widgets and acts as data receiver for them. /// </summary> public class UIController : MonoBehaviour, IGUIUpdateTarget { [SerializeField] private Text m_SpeedText; [SerializeField] private Text m_AltitudeText; [SerializeField] private Slider m_ThrottleSlider; [SerializeField] private Slider m_EngineThrottleSlider; public void UpdateSpeed(float speed) { m_SpeedText.text = "IAS: " + (int)(speed * 1.94f) + " kn"; } public void UpdateThrottle(float throttle) { m_ThrottleSlider.value = throttle; } public void UpdateEngineThrottle(float engineThrottle) { m_EngineThrottleSlider.value = engineThrottle; } public void UpdateAltitude(float altitude) { m_AltitudeText.text = "ALT: " + (int)(altitude * 3.28f) + " ft"; } // Use this for initialization void Start () { } // Update is called once per frame void Update () { } }
Switch from public properties to serializable private ones
Switch from public properties to serializable private ones
C#
mit
tanuva/planegame
fe0af5f2d5e7db144486e4e7232fdf73103f4a86
Eco/Variables/UserVariables.cs
Eco/Variables/UserVariables.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net; namespace Eco { public class UserVariables : IVariableProvider { static readonly Dictionary<string, Func<string>> _variables = new Dictionary<string, Func<string>>(); public static void Add(string name, string value) => Add(name, () => value); public static void Add(string name, Func<string> valueProvider) { if (name == null) throw new ArgumentNullException(nameof(name)); if (valueProvider == null) throw new ArgumentNullException(nameof(valueProvider)); if (_variables.ContainsKey(name)) throw new ArgumentException($"User variable with the same name already exists: `{name}`"); _variables.Add(name, valueProvider); } public Dictionary<string, Func<string>> GetVariables() => _variables; } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net; namespace Eco { public class UserVariables : IVariableProvider { static readonly Dictionary<string, Func<string>> _variables = new Dictionary<string, Func<string>>(); public static void Add(string name, string value) => Add(name, () => value); public static void Add(string name, Func<string> valueProvider) { if (name == null) throw new ArgumentNullException(nameof(name)); if (valueProvider == null) throw new ArgumentNullException(nameof(valueProvider)); if (_variables.ContainsKey(name)) throw new ArgumentException($"User variable with the same name already exists: `{name}`"); _variables.Add(name, valueProvider); } public static void Clear() => _variables.Clear(); public Dictionary<string, Func<string>> GetVariables() => _variables; } }
Allow to clear user defined vars.
Allow to clear user defined vars.
C#
apache-2.0
lukyad/Eco
b54820dd748300ffb2ba9ad8843d4581ea6c6786
Winium/TestApp.Test/Samples/WpDriver.cs
Winium/TestApp.Test/Samples/WpDriver.cs
namespace Samples { using System; using OpenQA.Selenium; using OpenQA.Selenium.Remote; public class WpDriver : RemoteWebDriver, IHasTouchScreen { public WpDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) : base(commandExecutor, desiredCapabilities) { TouchScreen = new RemoteTouchScreen(this); } public WpDriver(ICapabilities desiredCapabilities) : base(desiredCapabilities) { TouchScreen = new RemoteTouchScreen(this); } public WpDriver(Uri remoteAddress, ICapabilities desiredCapabilities) : base(remoteAddress, desiredCapabilities) { TouchScreen = new RemoteTouchScreen(this); } public WpDriver(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout) : base(remoteAddress, desiredCapabilities, commandTimeout) { TouchScreen = new RemoteTouchScreen(this); } public ITouchScreen TouchScreen { get; private set; } } }
namespace Samples { #region using System; using OpenQA.Selenium; using OpenQA.Selenium.Remote; #endregion public class WpDriver : RemoteWebDriver, IHasTouchScreen { #region Fields private ITouchScreen touchScreen; #endregion #region Constructors and Destructors public WpDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) : base(commandExecutor, desiredCapabilities) { } public WpDriver(ICapabilities desiredCapabilities) : base(desiredCapabilities) { } public WpDriver(Uri remoteAddress, ICapabilities desiredCapabilities) : base(remoteAddress, desiredCapabilities) { } public WpDriver(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout) : base(remoteAddress, desiredCapabilities, commandTimeout) { } #endregion #region Public Properties public ITouchScreen TouchScreen { get { return this.touchScreen ?? (this.touchScreen = new RemoteTouchScreen(this)); } } #endregion } }
Move touch screen initialization to property getter
Move touch screen initialization to property getter Init TouchScreen when needed instead of initing it in each constructor
C#
mpl-2.0
goldbillka/Winium.StoreApps,goldbillka/Winium.StoreApps,krishachetan89/Winium.StoreApps,2gis/Winium.StoreApps,NetlifeBackupSolutions/Winium.StoreApps,NetlifeBackupSolutions/Winium.StoreApps,krishachetan89/Winium.StoreApps,2gis/Winium.StoreApps
422ac74cdf77f363e6f997c87e75f7e2bfc7f323
NVika/BuildServers/AppVeyor.cs
NVika/BuildServers/AppVeyor.cs
using System; using System.ComponentModel.Composition; using System.Net.Http; namespace NVika { internal sealed class AppVeyorBuildServer : IBuildServer { private readonly Logger _logger; public string Name { get { return "AppVeyor"; } } [ImportingConstructor] public AppVeyorBuildServer(Logger logger) { _logger = logger; } public bool CanApplyToCurrentContext() { return !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APPVEYOR")); } public void WriteMessage(string message, string category, string details, string filename, string line, string offset, string projectName) { using (var httpClient = new HttpClient()) { httpClient.BaseAddress = new Uri(Environment.GetEnvironmentVariable("APPVEYOR_API_URL")); _logger.Debug("AppVeyor API url: {0}", httpClient.BaseAddress); var responseTask = httpClient.PostAsJsonAsync("api/build/compilationmessages", new { Message = message, Category = category, Details = details, FileName = filename, Line = line, Column = offset, ProjectName = projectName }); responseTask.Wait(); _logger.Debug("AppVeyor CompilationMessage Response: {0}", responseTask.Result.StatusCode); _logger.Debug(responseTask.Result.Content.ReadAsStringAsync().Result); } } } }
using System; using System.ComponentModel.Composition; using System.Net.Http; namespace NVika { internal sealed class AppVeyorBuildServer : IBuildServer { private readonly Logger _logger; private readonly string _appVeyorAPIUrl; public string Name { get { return "AppVeyor"; } } [ImportingConstructor] public AppVeyorBuildServer(Logger logger) { _logger = logger; _appVeyorAPIUrl = Environment.GetEnvironmentVariable("APPVEYOR_API_URL"); } public bool CanApplyToCurrentContext() { return !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APPVEYOR")); } public async void WriteMessage(string message, string category, string details, string filename, string line, string offset, string projectName) { using (var httpClient = new HttpClient()) { httpClient.BaseAddress = new Uri(_appVeyorAPIUrl); _logger.Debug("Send compilation message to AppVeyor:"); _logger.Debug("Message: {0}", message); _logger.Debug("Category: {0}", category); _logger.Debug("Details: {0}", details); _logger.Debug("FileName: {0}", filename); _logger.Debug("Line: {0}", line); _logger.Debug("Column: {0}", offset); _logger.Debug("ProjectName: {0}", projectName); await httpClient.PostAsJsonAsync("api/build/compilationmessages", new { Message = message, Category = category, Details = details, FileName = filename, Line = line, Column = offset, ProjectName = projectName }); } } } }
Add compilation message debug log
Add compilation message debug log
C#
apache-2.0
laedit/vika
53f85aaf6a4724818bd4dbf18524759930b83c3d
osu.Framework/Graphics/Containers/SnapTargetContainer.cs
osu.Framework/Graphics/Containers/SnapTargetContainer.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics.Primitives; namespace osu.Framework.Graphics.Containers { public class SnapTargetContainer : SnapTargetContainer<Drawable> { } /// <summary> /// A <see cref="Container{T}"/> that acts a target for <see cref="EdgeSnappingContainer{T}"/>s. /// It is automatically cached as <see cref="ISnapTargetContainer"/> so that it may be resolved by any /// child <see cref="EdgeSnappingContainer{T}"/>s. /// </summary> public class SnapTargetContainer<T> : Container<T>, ISnapTargetContainer where T : Drawable { public virtual RectangleF SnapRectangle => DrawRectangle; public Quad SnapRectangleToSpaceOfOtherDrawable(IDrawable other) => ToSpaceOfOtherDrawable(SnapRectangle, other); protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) { var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); dependencies.CacheAs<ISnapTargetContainer>(this); return dependencies; } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics.Primitives; namespace osu.Framework.Graphics.Containers { public class SnapTargetContainer : SnapTargetContainer<Drawable> { } /// <summary> /// A <see cref="Container{T}"/> that acts a target for <see cref="EdgeSnappingContainer{T}"/>s. /// It is automatically cached as <see cref="ISnapTargetContainer"/> so that it may be resolved by any /// child <see cref="EdgeSnappingContainer{T}"/>s. /// </summary> [Cached(typeof(ISnapTargetContainer))] public class SnapTargetContainer<T> : Container<T>, ISnapTargetContainer where T : Drawable { public virtual RectangleF SnapRectangle => DrawRectangle; public Quad SnapRectangleToSpaceOfOtherDrawable(IDrawable other) => ToSpaceOfOtherDrawable(SnapRectangle, other); } }
Use Cached attribute rather than CreateChildDependencies
Use Cached attribute rather than CreateChildDependencies
C#
mit
ppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,EVAST9919/osu-framework
f16a415fe784efc36745e049e28fe51f2794c8f9
src/R/Editor/Application.Test/Validation/ErrorTagTest.cs
src/R/Editor/Application.Test/Validation/ErrorTagTest.cs
using System.Diagnostics.CodeAnalysis; using Microsoft.R.Editor.Application.Test.TestShell; using Microsoft.R.Editor.ContentType; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Microsoft.R.Editor.Application.Test.Validation { [ExcludeFromCodeCoverage] [TestClass] public class ErrorTagTest { [TestMethod] [TestCategory("Interactive")] public void R_ErrorTagsTest01() { using (var script = new TestScript(RContentTypeDefinition.ContentType)) { // Force tagger creation var tagSpans = script.GetErrorTagSpans(); script.Type("x <- {"); script.Delete(); script.DoIdle(500); tagSpans = script.GetErrorTagSpans(); string errorTags = script.WriteErrorTags(tagSpans); Assert.AreEqual("[5 - 6] } expected\r\n", errorTags); } } } }
using System.Diagnostics.CodeAnalysis; using Microsoft.R.Editor.Application.Test.TestShell; using Microsoft.R.Editor.ContentType; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Microsoft.R.Editor.Application.Test.Validation { [ExcludeFromCodeCoverage] [TestClass] public class ErrorTagTest { [TestMethod] [TestCategory("Interactive")] public void R_ErrorTagsTest01() { using (var script = new TestScript(RContentTypeDefinition.ContentType)) { // Force tagger creation var tagSpans = script.GetErrorTagSpans(); script.Type("x <- {"); script.Delete(); script.DoIdle(500); tagSpans = script.GetErrorTagSpans(); string errorTags = script.WriteErrorTags(tagSpans); Assert.AreEqual("[5 - 6] } expected\r\n", errorTags); script.Type("}"); script.DoIdle(500); tagSpans = script.GetErrorTagSpans(); Assert.AreEqual(0, tagSpans.Count); } } } }
Add 'fix squiggly' to the test case
Add 'fix squiggly' to the test case
C#
mit
karthiknadig/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,karthiknadig/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,karthiknadig/RTVS,AlexanderSher/RTVS,AlexanderSher/RTVS,AlexanderSher/RTVS,MikhailArkhipov/RTVS,MikhailArkhipov/RTVS,karthiknadig/RTVS,AlexanderSher/RTVS,AlexanderSher/RTVS,MikhailArkhipov/RTVS,MikhailArkhipov/RTVS,MikhailArkhipov/RTVS
8093645ae7a8be223af4a43cdd21eccf90964ff9
LINQToTTree/LinqToTTreeInterfacesLib/IGeneratedCode.cs
LINQToTTree/LinqToTTreeInterfacesLib/IGeneratedCode.cs
 namespace LinqToTTreeInterfacesLib { /// <summary> /// Interface for implementing an object that will contain a complete single query /// </summary> public interface IGeneratedCode { /// <summary> /// Add a new statement to the current spot where the "writing" currsor is pointed. /// </summary> /// <param name="s"></param> void Add(IStatement s); /// <summary> /// Book a variable at the inner most scope /// </summary> /// <param name="v"></param> void Add(IVariable v); /// <summary> /// This variable's inital value is "complex" and must be transfered over the wire in some way other than staight into the code /// (for example, a ROOT object that needs to be written to a TFile). /// </summary> /// <param name="v"></param> void QueueForTransfer(string key, object value); /// <summary> /// Returns the outter most coding block /// </summary> IBookingStatementBlock CodeBody { get; } /// <summary> /// Adds an include file to be included for this query's C++ file. /// </summary> /// <param name="filename"></param> void AddIncludeFile(string filename); /// <summary> /// Set the result of the current code contex. /// </summary> /// <param name="result"></param> void SetResult(IVariable result); /// <summary> /// Returns the value that is the result of this calculation. /// </summary> IVariable ResultValue { get; } } }
 namespace LinqToTTreeInterfacesLib { /// <summary> /// Interface for implementing an object that will contain a complete single query /// </summary> public interface IGeneratedCode { /// <summary> /// Add a new statement to the current spot where the "writing" currsor is pointed. /// </summary> /// <param name="s"></param> void Add(IStatement s); /// <summary> /// Book a variable at the inner most scope /// </summary> /// <param name="v"></param> void Add(IVariable v); /// <summary> /// This variable's inital value is "complex" and must be transfered over the wire in some way other than staight into the code /// (for example, a ROOT object that needs to be written to a TFile). /// </summary> /// <param name="v"></param> void QueueForTransfer(string key, object value); /// <summary> /// Returns the outter most coding block /// </summary> IBookingStatementBlock CodeBody { get; } /// <summary> /// Adds an include file to be included for this query's C++ file. /// </summary> /// <param name="filename"></param> void AddIncludeFile(string filename); /// <summary> /// Set the result of the current code contex. /// </summary> /// <param name="result"></param> void SetResult(IVariable result); /// <summary> /// Returns the value that is the result of this calculation. /// </summary> IVariable ResultValue { get; } /// <summary> /// Get/Set teh current scope... /// </summary> object CurrentScope { get; set; } } }
Allow the scope popping code to work correctly when all you have is the Interface.
Allow the scope popping code to work correctly when all you have is the Interface.
C#
lgpl-2.1
gordonwatts/LINQtoROOT,gordonwatts/LINQtoROOT,gordonwatts/LINQtoROOT
e321d6c370e794e13316c818cb12f37601e3926b
SIL.Windows.Forms.Tests/Progress/LogBox/LogBoxTests.cs
SIL.Windows.Forms.Tests/Progress/LogBox/LogBoxTests.cs
using System; using NUnit.Framework; namespace SIL.Windows.Forms.Tests.Progress.LogBox { [TestFixture] public class LogBoxTests { private Windows.Forms.Progress.LogBox progress; [Test] public void ShowLogBox() { Console.WriteLine("Showing LogBox"); using (var e = new LogBoxFormForTest()) { progress = e.progress; progress.WriteMessage("LogBox test"); progress.ShowVerbose = true; for (int i = 0; i < 1000; i++) { progress.WriteVerbose("."); } progress.WriteMessage("done"); Console.WriteLine(progress.Text); Console.WriteLine(progress.Rtf); Console.WriteLine("Finished"); } } } }
using System; using NUnit.Framework; namespace SIL.Windows.Forms.Tests.Progress.LogBox { [TestFixture] public class LogBoxTests { private Windows.Forms.Progress.LogBox progress; [Test] [Category("KnownMonoIssue")] // this test hangs on TeamCity for Linux public void ShowLogBox() { Console.WriteLine("Showing LogBox"); using (var e = new LogBoxFormForTest()) { progress = e.progress; progress.WriteMessage("LogBox test"); progress.ShowVerbose = true; for (int i = 0; i < 1000; i++) { progress.WriteVerbose("."); } progress.WriteMessage("done"); Console.WriteLine(progress.Text); Console.WriteLine(progress.Rtf); Console.WriteLine("Finished"); } } } }
Disable a test hanging on TeamCity for Linux
Disable a test hanging on TeamCity for Linux
C#
mit
gmartin7/libpalaso,ermshiperete/libpalaso,gtryus/libpalaso,glasseyes/libpalaso,glasseyes/libpalaso,gmartin7/libpalaso,sillsdev/libpalaso,glasseyes/libpalaso,gtryus/libpalaso,glasseyes/libpalaso,gtryus/libpalaso,sillsdev/libpalaso,sillsdev/libpalaso,gmartin7/libpalaso,ermshiperete/libpalaso,sillsdev/libpalaso,gmartin7/libpalaso,ermshiperete/libpalaso,gtryus/libpalaso,ermshiperete/libpalaso
42b7bfe4e70ed7282881958471201b5f0b2ce2c2
Extensions.cs
Extensions.cs
using System; using System.Reactive.Linq; using System.Threading.Tasks; namespace Stampsy.ImageSource { internal static class Extensions { public static IObservable<T> SurroundWith<T> (this IObservable<T> a, IObservable<T> b) { return b.Concat (a).Concat (b); } public static void RouteExceptions<T> (this Task task, IObserver<T> observer) { task.ContinueWith (t => { observer.OnError (t.Exception.Flatten ()); }, TaskContinuationOptions.OnlyOnFaulted); } public static void RouteExceptions<T> (this Task task, TaskCompletionSource<T> tcs) { task.ContinueWith (t => { tcs.TrySetException (t.Exception.Flatten ()); }, TaskContinuationOptions.OnlyOnFaulted); } } }
using System; using System.Reactive.Linq; using System.Threading.Tasks; namespace Stampsy.ImageSource { public static class Extensions { public static Task<TRequest> Fetch<TRequest> (this IDestination<TRequest> destination, Uri url) where TRequest : Request { return ImageSource.Fetch (url, destination); } internal static IObservable<T> SurroundWith<T> (this IObservable<T> a, IObservable<T> b) { return b.Concat (a).Concat (b); } internal static void RouteExceptions<T> (this Task task, IObserver<T> observer) { task.ContinueWith (t => { observer.OnError (t.Exception.Flatten ()); }, TaskContinuationOptions.OnlyOnFaulted); } internal static void RouteExceptions<T> (this Task task, TaskCompletionSource<T> tcs) { task.ContinueWith (t => { tcs.TrySetException (t.Exception.Flatten ()); }, TaskContinuationOptions.OnlyOnFaulted); } } }
Add extension method to call Fetch on destination instance, e.g. _myFolder.Fetch ('dropbox://myfile.png')
Add extension method to call Fetch on destination instance, e.g. _myFolder.Fetch ('dropbox://myfile.png')
C#
mit
stampsy/Stampsy.ImageSource
8fb1f8f55e5d369e571b4645aa7c7ec6ef38c37b
src/reni2/FeatureTest/Reference/ArrayElementType.cs
src/reni2/FeatureTest/Reference/ArrayElementType.cs
using System; using System.Collections.Generic; using System.Linq; using hw.UnitTest; namespace Reni.FeatureTest.Reference { [TestFixture] [ArrayElementType1] [Target(@" a: 'Text'; t: a type >>; t dump_print ")] [Output("(bit)*8[text_item]")] public sealed class ArrayElementType : CompilerTest {} }
using System; using System.Collections.Generic; using System.Linq; using hw.UnitTest; namespace Reni.FeatureTest.Reference { [TestFixture] [ArrayElementType1] [Target(@" a: 'Text'; t: a type item; t dump_print ")] [Output("(bit)*8[text_item]")] public sealed class ArrayElementType : CompilerTest {} }
Access operator for array is now "item"
Change: Access operator for array is now "item"
C#
mit
hahoyer/reni.cs,hahoyer/reni.cs,hahoyer/reni.cs
6a213c5d39826ff3a83765e59432c6dc14696840
src/Elders.Cronus/Properties/AssemblyInfo.cs
src/Elders.Cronus/Properties/AssemblyInfo.cs
// <auto-generated/> using System.Reflection; [assembly: AssemblyTitleAttribute("Elders.Cronus")] [assembly: AssemblyDescriptionAttribute("Elders.Cronus")] [assembly: AssemblyProductAttribute("Elders.Cronus")] [assembly: AssemblyVersionAttribute("2.0.0")] [assembly: AssemblyInformationalVersionAttribute("2.0.0")] [assembly: AssemblyFileVersionAttribute("2.0.0")] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "2.0.0"; } }
// <auto-generated/> using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitleAttribute("Elders.Cronus")] [assembly: AssemblyDescriptionAttribute("Elders.Cronus")] [assembly: ComVisibleAttribute(false)] [assembly: AssemblyProductAttribute("Elders.Cronus")] [assembly: AssemblyCopyrightAttribute("Copyright © 2015")] [assembly: AssemblyVersionAttribute("2.4.0.0")] [assembly: AssemblyFileVersionAttribute("2.4.0.0")] [assembly: AssemblyInformationalVersionAttribute("2.4.0-beta.1+1.Branch.release/2.4.0.Sha.3e4f8834fa8a63812fbfc3121045ffd5f065c6af")] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "2.4.0.0"; } }
Prepare for new implementation of Aggregate Atomic Action
Prepare for new implementation of Aggregate Atomic Action
C#
apache-2.0
Elders/Cronus,Elders/Cronus
a8756915bb0199fff6d3acc9194215255dd2b31b
BlogTemplate/Services/SlugGenerator.cs
BlogTemplate/Services/SlugGenerator.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using BlogTemplate.Models; namespace BlogTemplate.Services { public class SlugGenerator { private BlogDataStore _dataStore; public SlugGenerator(BlogDataStore dataStore) { _dataStore = dataStore; } public string CreateSlug(string title) { Encoding utf8 = new UTF8Encoding(true); string tempTitle = title; char[] invalidChars = Path.GetInvalidPathChars(); foreach (char c in invalidChars) { string s = c.ToString(); string decodedS = utf8.GetString(c); if (tempTitle.Contains(s)) { int removeIdx = tempTitle.IndexOf(s); tempTitle = tempTitle.Remove(removeIdx); } } string slug = title.Replace(" ", "-"); int count = 0; string tempSlug = slug; while (_dataStore.CheckSlugExists(tempSlug)) { count++; tempSlug = $"{slug}-{count}"; } return tempSlug; } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using BlogTemplate.Models; namespace BlogTemplate.Services { public class SlugGenerator { private BlogDataStore _dataStore; public SlugGenerator(BlogDataStore dataStore) { _dataStore = dataStore; } public string CreateSlug(string title) { string tempTitle = title; char[] invalidChars = Path.GetInvalidFileNameChars(); foreach (char c in invalidChars) { tempTitle = tempTitle.Replace(c.ToString(), ""); } string slug = tempTitle.Replace(" ", "-"); int count = 0; string tempSlug = slug; while (_dataStore.CheckSlugExists(tempSlug)) { count++; tempSlug = $"{slug}-{count}"; } return tempSlug; } } }
Remove invalid characters from slug, but keep in title.
Remove invalid characters from slug, but keep in title.
C#
mit
VenusInterns/BlogTemplate,VenusInterns/BlogTemplate,VenusInterns/BlogTemplate
fbefa0d91e4563adc0533e3089f03049d5d1116e
CactbotOverlay/CactbotOverlayConfig.cs
CactbotOverlay/CactbotOverlayConfig.cs
using RainbowMage.OverlayPlugin; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; namespace Cactbot { public class CactbotOverlayConfig : OverlayConfigBase { public static string CactbotAssemblyUri { get { return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); } } public static string CactbotDllRelativeUserUri { get { return System.IO.Path.Combine(CactbotAssemblyUri, "../cactbot/user/"); } } public CactbotOverlayConfig(string name) : base(name) { // Cactbot only supports visibility toggling with the hotkey. // It assumes all overlays are always locked and either are // clickthru or not on a more permanent basis. GlobalHotkeyType = GlobalHotkeyType.ToggleVisible; } private CactbotOverlayConfig() : base(null) { } public override Type OverlayType { get { return typeof(CactbotOverlay); } } public bool LogUpdatesEnabled = true; public double DpsUpdatesPerSecond = 3; public string OverlayData = null; public string RemoteVersionSeen = "0.0"; public string UserConfigFile = ""; } }
using RainbowMage.OverlayPlugin; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; namespace Cactbot { public class CactbotOverlayConfig : OverlayConfigBase { public static string CactbotAssemblyUri { get { return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); } } public static string CactbotDllRelativeUserUri { get { return System.IO.Path.Combine(CactbotAssemblyUri, "../cactbot/user/"); } } public CactbotOverlayConfig(string name) : base(name) { // Cactbot only supports visibility toggling with the hotkey. // It assumes all overlays are always locked and either are // clickthru or not on a more permanent basis. GlobalHotkeyType = GlobalHotkeyType.ToggleVisible; } private CactbotOverlayConfig() : base(null) { } public override Type OverlayType { get { return typeof(CactbotOverlay); } } public bool LogUpdatesEnabled = true; public double DpsUpdatesPerSecond = 0; public string OverlayData = null; public string RemoteVersionSeen = "0.0"; public string UserConfigFile = ""; } }
Change default dps update rate to 0
plugin: Change default dps update rate to 0 It seems far more likely that somebody is going to mess up leaving this at 3 and dropping log lines than somebody using cactbot for a dps overlay and it not working. By the by, you don't need cactbot for dps overlays, you can just make them normal overlays. Cactbot does auto-end fights during wipes so that you can just set your encounter rate to a billion, but that's about all it does.
C#
apache-2.0
quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot
2491583c2463295c80c0ee06b8e4ad839a47795c
src/Pingu.Tests/ToolHelper.cs
src/Pingu.Tests/ToolHelper.cs
using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; namespace Pingu.Tests { class ToolHelper { public static ProcessResult RunPngCheck(string path) { var asm = typeof(ToolHelper).GetTypeInfo().Assembly; var assemblyDir = Path.GetDirectoryName(asm.Location); var pngcheckPath = Path.Combine( assemblyDir, "..", "..", "..", "..", "..", "tools", "pngcheck.exe"); return Exe(pngcheckPath, "-v", path); } public static ProcessResult Exe(string command, params string[] args) { var startInfo = new ProcessStartInfo { FileName = command, Arguments = string.Join( " ", args.Where(x => !string.IsNullOrWhiteSpace(x)) .Select(x => "\"" + x + "\"") ), CreateNoWindow = true, RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false, }; var proc = Process.Start(startInfo); var @out = proc.StandardOutput.ReadToEnd(); var err = proc.StandardError.ReadToEnd(); proc.WaitForExit(20000); return new ProcessResult { ExitCode = proc.ExitCode, StandardOutput = @out, StandardError = err }; } } }
using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; namespace Pingu.Tests { class ToolHelper { public static ProcessResult RunPngCheck(string path) { var asm = typeof(ToolHelper).GetTypeInfo().Assembly; var assemblyDir = Path.GetDirectoryName(asm.Location); // It'll be on the path on Linux/Mac, we ship it for Windows. var pngcheckPath = Path.DirectorySeparatorChar == '\\' ? Path.Combine( assemblyDir, "..", "..", "..", "..", "..", "tools", "pngcheck.exe") : "pngcheck"; return Exe(pngcheckPath, "-v", path); } public static ProcessResult Exe(string command, params string[] args) { var startInfo = new ProcessStartInfo { FileName = command, Arguments = string.Join( " ", args.Where(x => !string.IsNullOrWhiteSpace(x)) .Select(x => "\"" + x + "\"") ), CreateNoWindow = true, RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false, }; var proc = Process.Start(startInfo); var @out = proc.StandardOutput.ReadToEnd(); var err = proc.StandardError.ReadToEnd(); proc.WaitForExit(20000); return new ProcessResult { ExitCode = proc.ExitCode, StandardOutput = @out, StandardError = err }; } } }
Enable tests running on !Windows too.
Tests: Enable tests running on !Windows too. Relies on pngcheck being in the path, but whatever.
C#
mit
bojanrajkovic/pingu
def2e56d849c821a47bfec9aaa05cd6ea35c8ca3
src/RandomGen/Fluent/IRandom.cs
src/RandomGen/Fluent/IRandom.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace RandomGen.Fluent { public interface IRandom : IFluentInterface { INumbers Numbers { get; } INames Names { get; } ITime Time { get; } IText Text { get; } IInternet Internet { get; } IPhoneNumbers PhoneNumbers { get; } /// <summary> /// Returns a gen that chooses randomly from a list /// </summary> /// <typeparam name="T"></typeparam> /// <param name="items"></param> /// <param name="weights">Optional weights affecting the likelihood of an item being chosen. Same length as items</param> Func<T> Items<T>(IEnumerable<T> items, IEnumerable<double> weights); /// <summary> /// Returns a gen that chooses randomly with equal weight for each item. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="items"></param> Func<T> Items<T>(params T[] items); /// <summary> /// Returns a gen that chooses randomly from an Enum values /// </summary> /// <typeparam name="T"></typeparam> /// <param name="weights">Optional weights affecting the likelihood of a value being chosen. Same length as Enum values</param> Func<T> Enum<T>(IEnumerable<double> weights = null) where T : struct, IConvertible; /// <summary> /// Generates random country names /// Based on System.Globalisation /// </summary> Func<string> Countries(); } }
using System; using System.Collections.Generic; namespace RandomGen.Fluent { public interface IRandom : IFluentInterface { INumbers Numbers { get; } INames Names { get; } ITime Time { get; } IText Text { get; } IInternet Internet { get; } IPhoneNumbers PhoneNumbers { get; } /// <summary> /// Returns a gen that chooses randomly from a list /// </summary> /// <typeparam name="T"></typeparam> /// <param name="items"></param> /// <param name="weights">Optional weights affecting the likelihood of an item being chosen. Same length as items</param> Func<T> Items<T>(IEnumerable<T> items, IEnumerable<double> weights = null); /// <summary> /// Returns a gen that chooses randomly with equal weight for each item. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="items"></param> Func<T> Items<T>(params T[] items); /// <summary> /// Returns a gen that chooses randomly from an Enum values /// </summary> /// <typeparam name="T"></typeparam> /// <param name="weights">Optional weights affecting the likelihood of a value being chosen. Same length as Enum values</param> Func<T> Enum<T>(IEnumerable<double> weights = null) where T : struct, IConvertible; /// <summary> /// Generates random country names /// Based on System.Globalisation /// </summary> Func<string> Countries(); } }
Fix for supporting Items without weights.
Fix for supporting Items without weights.
C#
mit
aliostad/RandomGen,aliostad/RandomGen
61de3c75402f55704c07da9128778f35b374a52f
osu.Game.Rulesets.Osu/Skinning/OsuSkinConfiguration.cs
osu.Game.Rulesets.Osu/Skinning/OsuSkinConfiguration.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. namespace osu.Game.Rulesets.Osu.Skinning { public enum OsuSkinConfiguration { HitCirclePrefix, HitCircleOverlap, SliderBorderSize, SliderPathRadius, AllowSliderBallTint, CursorExpand, CursorRotate, HitCircleOverlayAboveNumber, HitCircleOverlayAboveNumer, // Some old skins will have this typo SpinnerFrequencyModulate } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. namespace osu.Game.Rulesets.Osu.Skinning { public enum OsuSkinConfiguration { HitCirclePrefix, HitCircleOverlap, SliderBorderSize, SliderPathRadius, AllowSliderBallTint, CursorExpand, CursorRotate, HitCircleOverlayAboveNumber, HitCircleOverlayAboveNumer, // Some old skins will have this typo SpinnerFrequencyModulate } }
Replace accidental tab with spaces
Replace accidental tab with spaces
C#
mit
ppy/osu,UselessToucan/osu,peppy/osu,peppy/osu,UselessToucan/osu,NeoAdonis/osu,smoogipoo/osu,smoogipoo/osu,peppy/osu,peppy/osu-new,smoogipooo/osu,NeoAdonis/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu
f06445f0d412ea41d2f1d82b518907289bc1a4ed
Assets/Demo/Scripts/UI/GameScreen.cs
Assets/Demo/Scripts/UI/GameScreen.cs
using UnityEngine; using System.Collections; using UnityEngine.UI; using UnityEngine.SceneManagement; public class GameScreen : MonoBehaviour { bool allowLevelLoad = true; void OnEnable() { allowLevelLoad = true; } public void LoadScene(string sceneName) { if (allowLevelLoad) { allowLevelLoad = false; SceneManager.LoadScene(sceneName); } } // Update is called once per frame void Update () { } }
using UnityEngine; using System.Collections; using UnityEngine.UI; using UnityEngine.SceneManagement; public class GameScreen : MonoBehaviour { bool allowLevelLoad = true; string nextLevel; void OnEnable() { allowLevelLoad = true; } public void LoadScene(string sceneName) { if (allowLevelLoad) { allowLevelLoad = false; nextLevel = sceneName; Invoke("LoadNextLevel", 0.33f); } } private void LoadNextLevel() { SceneManager.LoadScene(nextLevel); } }
Load next level after 0.33 seconds to prvent button from being stuck and animation to finish
Load next level after 0.33 seconds to prvent button from being stuck and animation to finish
C#
mit
antila/castle-game-jam-2016
664c824f8bfa49beb72300ec869a8004d23243c7
src/Markdig/MarkdownParserContext.cs
src/Markdig/MarkdownParserContext.cs
using System.Collections.Generic; namespace Markdig { /// <summary> /// Provides a context that can be used as part of parsing Markdown documents. /// </summary> public sealed class MarkdownParserContext { /// <summary> /// Gets or sets the context property collection. /// </summary> public IDictionary<object, object> Properties { get; set; } /// <summary> /// Initializes a new instance of the <see cref="MarkdownParserContext" /> class. /// </summary> public MarkdownParserContext() { Properties = new Dictionary<object, object>(); } } }
using System.Collections.Generic; namespace Markdig { /// <summary> /// Provides a context that can be used as part of parsing Markdown documents. /// </summary> public sealed class MarkdownParserContext { /// <summary> /// Gets or sets the context property collection. /// </summary> public Dictionary<object, object> Properties { get; } /// <summary> /// Initializes a new instance of the <see cref="MarkdownParserContext" /> class. /// </summary> public MarkdownParserContext() { Properties = new Dictionary<object, object>(); } } }
Use Dictionary and removes setter
Use Dictionary and removes setter
C#
bsd-2-clause
lunet-io/markdig
25be7265f20d4a4651cd607cabe4cd6797c77169
CefSharp.Example/AsyncBoundObject.cs
CefSharp.Example/AsyncBoundObject.cs
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; using System.Threading; namespace CefSharp.Example { public class AsyncBoundObject { public void Error() { throw new Exception("This is an exception coming from C#"); } public int Div(int divident, int divisor) { return divident / divisor; } public string Hello(string name) { return "Hello " + name; } public void DoSomething() { Thread.Sleep(1000); } } }
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; using System.Diagnostics; using System.Threading; namespace CefSharp.Example { public class AsyncBoundObject { //We expect an exception here, so tell VS to ignore [DebuggerHidden] public void Error() { throw new Exception("This is an exception coming from C#"); } //We expect an exception here, so tell VS to ignore [DebuggerHidden] public int Div(int divident, int divisor) { return divident / divisor; } public string Hello(string name) { return "Hello " + name; } public void DoSomething() { Thread.Sleep(1000); } } }
Add DebuggerHidden attribute so VS doesn't break when `Break on User-Unhandled Exceptions` is checked
Add DebuggerHidden attribute so VS doesn't break when `Break on User-Unhandled Exceptions` is checked
C#
bsd-3-clause
illfang/CefSharp,twxstar/CefSharp,windygu/CefSharp,haozhouxu/CefSharp,yoder/CefSharp,wangzheng888520/CefSharp,AJDev77/CefSharp,gregmartinhtc/CefSharp,battewr/CefSharp,rlmcneary2/CefSharp,windygu/CefSharp,wangzheng888520/CefSharp,battewr/CefSharp,jamespearce2006/CefSharp,zhangjingpu/CefSharp,gregmartinhtc/CefSharp,Haraguroicha/CefSharp,NumbersInternational/CefSharp,haozhouxu/CefSharp,NumbersInternational/CefSharp,rlmcneary2/CefSharp,AJDev77/CefSharp,battewr/CefSharp,ITGlobal/CefSharp,rlmcneary2/CefSharp,jamespearce2006/CefSharp,twxstar/CefSharp,ITGlobal/CefSharp,haozhouxu/CefSharp,VioletLife/CefSharp,windygu/CefSharp,VioletLife/CefSharp,dga711/CefSharp,yoder/CefSharp,VioletLife/CefSharp,zhangjingpu/CefSharp,AJDev77/CefSharp,AJDev77/CefSharp,Livit/CefSharp,battewr/CefSharp,dga711/CefSharp,Haraguroicha/CefSharp,zhangjingpu/CefSharp,Haraguroicha/CefSharp,yoder/CefSharp,joshvera/CefSharp,NumbersInternational/CefSharp,dga711/CefSharp,joshvera/CefSharp,twxstar/CefSharp,ITGlobal/CefSharp,jamespearce2006/CefSharp,wangzheng888520/CefSharp,windygu/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,joshvera/CefSharp,zhangjingpu/CefSharp,twxstar/CefSharp,Livit/CefSharp,Haraguroicha/CefSharp,Haraguroicha/CefSharp,illfang/CefSharp,NumbersInternational/CefSharp,illfang/CefSharp,rlmcneary2/CefSharp,gregmartinhtc/CefSharp,joshvera/CefSharp,yoder/CefSharp,dga711/CefSharp,illfang/CefSharp,haozhouxu/CefSharp,jamespearce2006/CefSharp,jamespearce2006/CefSharp,ITGlobal/CefSharp,wangzheng888520/CefSharp,VioletLife/CefSharp,Livit/CefSharp
caba78cb5d0ebd67053537e634d613fae733933c
osu.Game/Screens/Play/SoloPlayer.cs
osu.Game/Screens/Play/SoloPlayer.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Diagnostics; using osu.Game.Online.API; using osu.Game.Online.Rooms; using osu.Game.Online.Solo; using osu.Game.Rulesets; using osu.Game.Scoring; namespace osu.Game.Screens.Play { public class SoloPlayer : SubmittingPlayer { public SoloPlayer() : this(null) { } protected SoloPlayer(PlayerConfiguration configuration = null) : base(configuration) { } protected override APIRequest<APIScoreToken> CreateTokenRequest() { if (!(Beatmap.Value.BeatmapInfo.OnlineBeatmapID is int beatmapId)) return null; if (!(Ruleset.Value.ID is int rulesetId) || Ruleset.Value.ID > ILegacyRuleset.MAX_LEGACY_RULESET_ID) return null; return new CreateSoloScoreRequest(beatmapId, rulesetId, Game.VersionHash); } protected override bool HandleTokenRetrievalFailure(Exception exception) => false; protected override APIRequest<MultiplayerScore> CreateSubmissionRequest(Score score, long token) { var beatmap = score.ScoreInfo.Beatmap; Debug.Assert(beatmap.OnlineBeatmapID != null); int beatmapId = beatmap.OnlineBeatmapID.Value; return new SubmitSoloScoreRequest(beatmapId, token, score.ScoreInfo); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Diagnostics; using osu.Game.Online.API; using osu.Game.Online.Rooms; using osu.Game.Online.Solo; using osu.Game.Rulesets; using osu.Game.Scoring; namespace osu.Game.Screens.Play { public class SoloPlayer : SubmittingPlayer { public SoloPlayer() : this(null) { } protected SoloPlayer(PlayerConfiguration configuration = null) : base(configuration) { } protected override APIRequest<APIScoreToken> CreateTokenRequest() { if (!(Beatmap.Value.BeatmapInfo.OnlineBeatmapID is int beatmapId)) return null; if (!(Ruleset.Value.ID is int rulesetId) || Ruleset.Value.ID > ILegacyRuleset.MAX_LEGACY_RULESET_ID) return null; return new CreateSoloScoreRequest(beatmapId, rulesetId, Game.VersionHash); } protected override bool HandleTokenRetrievalFailure(Exception exception) => false; protected override APIRequest<MultiplayerScore> CreateSubmissionRequest(Score score, long token) { var scoreCopy = score.DeepClone(); var beatmap = scoreCopy.ScoreInfo.Beatmap; Debug.Assert(beatmap.OnlineBeatmapID != null); int beatmapId = beatmap.OnlineBeatmapID.Value; return new SubmitSoloScoreRequest(beatmapId, token, scoreCopy.ScoreInfo); } } }
Copy score during submission process to ensure it isn't modified
Copy score during submission process to ensure it isn't modified
C#
mit
peppy/osu,ppy/osu,smoogipoo/osu,ppy/osu,peppy/osu,ppy/osu,peppy/osu-new,smoogipoo/osu,UselessToucan/osu,UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,UselessToucan/osu,smoogipooo/osu
e6d3f54cf7e992b7320a4e5796d3ee56f31def95
appCS/omniBill/Pages/AboutPage.xaml.cs
appCS/omniBill/Pages/AboutPage.xaml.cs
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using omniBill.InnerComponents.Localization; namespace omniBill.pages { /// <summary> /// Interaction logic for AboutPage.xaml /// </summary> public partial class AboutPage : Page { public AboutPage() { InitializeComponent(); Version v = Assembly.GetEntryAssembly().GetName().Version; lbVersion.Text = String.Format("v{0}.{1}.{2}", v.Major, v.Minor, v.Build); } private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) { Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); e.Handled = true; } } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using omniBill.InnerComponents.Localization; namespace omniBill.pages { /// <summary> /// Interaction logic for AboutPage.xaml /// </summary> public partial class AboutPage : Page { public AboutPage() { InitializeComponent(); Version v = Assembly.GetEntryAssembly().GetName().Version; String patch = (v.Build != 0) ? "." + v.Build.ToString() : String.Empty; lbVersion.Text = String.Format("v{0}.{1}{2}", v.Major, v.Minor, patch); } private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) { Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); e.Handled = true; } } }
Change the way version is displayed
Change the way version is displayed
C#
epl-1.0
omniSpectrum/omniBill
4d30761ce3131eccaab114285018f5ab0cc54a79
osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs
osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mania.Judgements { public class ManiaJudgement : Judgement { protected override int NumericResultFor(HitResult result) { switch (result) { default: return 0; case HitResult.Meh: return 50; case HitResult.Ok: return 100; case HitResult.Good: return 200; case HitResult.Great: case HitResult.Perfect: return 300; } } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mania.Judgements { public class ManiaJudgement : Judgement { protected override int NumericResultFor(HitResult result) { switch (result) { default: return 0; case HitResult.Meh: return 50; case HitResult.Ok: return 100; case HitResult.Good: return 200; case HitResult.Great: return 300; case HitResult.Perfect: return 320; } } } }
Fix 1M score being possible with only GREATs in mania
Fix 1M score being possible with only GREATs in mania
C#
mit
UselessToucan/osu,smoogipoo/osu,smoogipoo/osu,peppy/osu-new,peppy/osu,UselessToucan/osu,peppy/osu,UselessToucan/osu,ppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,smoogipooo/osu,smoogipoo/osu
7ca8911f32b969054867acd0405a7b96f0ce6f2a
VigilantCupcake/SubForms/AboutBox.cs
VigilantCupcake/SubForms/AboutBox.cs
using System; using System.IO; using System.Reflection; using System.Windows.Forms; namespace VigilantCupcake.SubForms { partial class AboutBox : Form { public AboutBox() { InitializeComponent(); this.Text = String.Format("About {0}", AssemblyTitle); this.labelProductName.Text = AssemblyProduct; this.labelVersion.Text = AssemblyVersion; this.lastUpdatedBox.Text = LastUpdatedDate.ToString(); this.linkLabel1.Text = Properties.Settings.Default.WebsiteUrl; } public string LatestVersionText { set { latestBox.Text = value; } } #region Assembly Attribute Accessors public static string AssemblyProduct { get { object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); if (attributes.Length == 0) { return ""; } return ((AssemblyProductAttribute)attributes[0]).Product; } } public static string AssemblyTitle { get { object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); if (attributes.Length > 0) { AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; if (!string.IsNullOrEmpty(titleAttribute.Title)) { return titleAttribute.Title; } } return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); } } public static string AssemblyVersion { get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); } } public static DateTime LastUpdatedDate { get { return new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime; } } #endregion Assembly Attribute Accessors private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.linkLabel1.LinkVisited = true; System.Diagnostics.Process.Start(Properties.Settings.Default.WebsiteUrl); } } }
using System; using System.IO; using System.Reflection; using System.Windows.Forms; namespace VigilantCupcake.SubForms { partial class AboutBox : Form { public AboutBox() { InitializeComponent(); this.Text = String.Format("About {0}", AssemblyTitle); this.labelProductName.Text = AssemblyTitle; this.labelVersion.Text = AssemblyVersion; this.lastUpdatedBox.Text = LastUpdatedDate.ToString(); this.linkLabel1.Text = Properties.Settings.Default.WebsiteUrl; } public string LatestVersionText { set { latestBox.Text = value; } } #region Assembly Attribute Accessors public static string AssemblyTitle { get { return "Vigilant Cupcake"; } } public static string AssemblyVersion { get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); } } public static DateTime LastUpdatedDate { get { return new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime; } } #endregion Assembly Attribute Accessors private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.linkLabel1.LinkVisited = true; System.Diagnostics.Process.Start(Properties.Settings.Default.WebsiteUrl); } } }
Make the about window have a space in the application name
Make the about window have a space in the application name
C#
mit
amweiss/vigilant-cupcake
5c8423bcf79dbf3edde373025039dcf6e853ffe4
SwitchApp/WpfSwitchClient/App.xaml.cs
SwitchApp/WpfSwitchClient/App.xaml.cs
using System; using System.Net.Http; using System.Windows; using SwitchClient.Classic; using SwitchClient.Hyper; namespace WpfSwitchClient { public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { var client = new HttpClient() { BaseAddress = new Uri(String.Format("http://{0}:9090/", Environment.MachineName)) }; //var window = new MainWindow(new SwitchViewModel(new SwitchService(client))); var window = new MainWindow(new SwitchHyperViewModel(client)); window.Show(); } } }
using System; using System.Net.Http; using System.Windows; using SwitchClient.Classic; using SwitchClient.Hyper; namespace WpfSwitchClient { public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { var client = new HttpClient() { BaseAddress = new Uri(String.Format("http://{0}:9090/", Environment.MachineName)) }; var window = new MainWindow(new SwitchViewModel(new SwitchService(client))); //var window = new MainWindow(new SwitchHyperViewModel(client)); window.Show(); } } }
Reset VM to be Service based
Reset VM to be Service based
C#
apache-2.0
darrelmiller/HypermediaClients,darrelmiller/HypermediaClients
155cfd22311b84d526be5791c687b6b425cd04f2
src/SFA.DAS.EAS.Web/Global.asax.cs
src/SFA.DAS.EAS.Web/Global.asax.cs
using System; using System.Security.Claims; using System.Web.Helpers; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; using FluentValidation.Mvc; using Microsoft.ApplicationInsights; using Microsoft.ApplicationInsights.Extensibility; using Microsoft.Azure; using NLog; using NLog.Targets; using SFA.DAS.EAS.Infrastructure.Logging; namespace SFA.DAS.EAS.Web { public class MvcApplication : System.Web.HttpApplication { private readonly Logger _logger = LogManager.GetCurrentClassLogger(); private static RedisTarget _redisTarget; // Required to ensure assembly is copied to output. protected void Application_Start() { LoggingConfig.ConfigureLogging(); TelemetryConfiguration.Active.InstrumentationKey = CloudConfigurationManager.GetSetting("InstrumentationKey"); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier; FluentValidationModelValidatorProvider.Configure(); } protected void Application_Error(object sender, EventArgs e) { var exception = Server.GetLastError(); _logger.Error(exception); var tc = new TelemetryClient(); tc.TrackTrace($"{exception.Message} - {exception.InnerException}"); } } }
using System; using System.Security.Claims; using System.Web; using System.Web.Helpers; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; using FluentValidation.Mvc; using Microsoft.ApplicationInsights; using Microsoft.ApplicationInsights.Extensibility; using Microsoft.Azure; using NLog; using NLog.Targets; using SFA.DAS.EAS.Infrastructure.Logging; namespace SFA.DAS.EAS.Web { public class MvcApplication : System.Web.HttpApplication { private readonly Logger _logger = LogManager.GetCurrentClassLogger(); private static RedisTarget _redisTarget; // Required to ensure assembly is copied to output. protected void Application_Start() { LoggingConfig.ConfigureLogging(); TelemetryConfiguration.Active.InstrumentationKey = CloudConfigurationManager.GetSetting("InstrumentationKey"); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier; FluentValidationModelValidatorProvider.Configure(); } protected void Application_BeginRequest(object sender, EventArgs e) { var application = sender as HttpApplication; application?.Context?.Response.Headers.Remove("Server"); } protected void Application_Error(object sender, EventArgs e) { var exception = Server.GetLastError(); _logger.Error(exception); var tc = new TelemetryClient(); tc.TrackTrace($"{exception.Message} - {exception.InnerException}"); } } }
Remove server header form http responses
Remove server header form http responses
C#
mit
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
86508fb39abd6e3c722d4473d2b3e470c284e3b3
src/Umbraco.Web.UI/Views/Partials/BlockList/Default.cshtml
src/Umbraco.Web.UI/Views/Partials/BlockList/Default.cshtml
@inherits UmbracoViewPage<BlockListModel> @using Umbraco.Core.Models.Blocks @{ if (Model?.Layout == null || !Model.Layout.Any()) { return; } } <div class="umb-block-list"> @foreach (var layout in Model.Layout) { if (layout?.Udi == null) { continue; } var data = layout.Data; @Html.Partial("BlockList/Components/" + data.ContentType.Alias, layout) } </div>
@inherits UmbracoViewPage<BlockListModel> @using Umbraco.Core.Models.Blocks @{ if (!Model.Any()) { return; } } <div class="umb-block-list"> @foreach (var block in Model) { if (block?.ContentUdi == null) { continue; } var data = block.Content; @Html.Partial("BlockList/Components/" + data.ContentType.Alias, block) } </div>
Update to default Razor snippet we use to help with Block List editor
Update to default Razor snippet we use to help with Block List editor
C#
mit
robertjf/Umbraco-CMS,umbraco/Umbraco-CMS,umbraco/Umbraco-CMS,arknu/Umbraco-CMS,arknu/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,umbraco/Umbraco-CMS,bjarnef/Umbraco-CMS,mattbrailsford/Umbraco-CMS,dawoe/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,marcemarc/Umbraco-CMS,abjerner/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,tcmorris/Umbraco-CMS,tcmorris/Umbraco-CMS,umbraco/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,KevinJump/Umbraco-CMS,leekelleher/Umbraco-CMS,hfloyd/Umbraco-CMS,madsoulswe/Umbraco-CMS,dawoe/Umbraco-CMS,abryukhov/Umbraco-CMS,hfloyd/Umbraco-CMS,leekelleher/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,bjarnef/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,tcmorris/Umbraco-CMS,tcmorris/Umbraco-CMS,leekelleher/Umbraco-CMS,hfloyd/Umbraco-CMS,abryukhov/Umbraco-CMS,abjerner/Umbraco-CMS,tcmorris/Umbraco-CMS,marcemarc/Umbraco-CMS,mattbrailsford/Umbraco-CMS,leekelleher/Umbraco-CMS,KevinJump/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,madsoulswe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,arknu/Umbraco-CMS,bjarnef/Umbraco-CMS,hfloyd/Umbraco-CMS,madsoulswe/Umbraco-CMS,bjarnef/Umbraco-CMS,leekelleher/Umbraco-CMS,mattbrailsford/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,robertjf/Umbraco-CMS
5d571a0c7bcfbc4ec022f09b7ae7f885b5e59a0c
src/PcscDotNet/PcscContext.cs
src/PcscDotNet/PcscContext.cs
using System; namespace PcscDotNet { public class PcscContext : IDisposable { private SCardContext _context; private readonly Pcsc _pcsc; private readonly IPcscProvider _provider; public bool IsDisposed { get; private set; } = false; public bool IsEstablished => _context.HasValue; public Pcsc Pcsc => _pcsc; public PcscContext(Pcsc pcsc) { _pcsc = pcsc; _provider = pcsc.Provider; } public PcscContext(Pcsc pcsc, SCardScope scope) : this(pcsc) { Establish(scope); } ~PcscContext() { Dispose(); } public unsafe PcscContext Establish(SCardScope scope) { if (IsDisposed) throw new ObjectDisposedException(nameof(PcscContext), nameof(Establish)); if (IsEstablished) throw new InvalidOperationException("Context has been established."); SCardContext context; _provider.SCardEstablishContext(scope, null, null, &context).ThrowIfNotSuccess(); _context = context; return this; } public PcscContext Release() { if (IsDisposed) throw new ObjectDisposedException(nameof(PcscContext), nameof(Release)); if (IsEstablished) { _provider.SCardReleaseContext(_context).ThrowIfNotSuccess(); _context = SCardContext.Default; } return this; } public void Dispose() { if (IsDisposed) return; Release(); GC.SuppressFinalize(this); IsDisposed = true; } } }
using System; namespace PcscDotNet { public class PcscContext : IDisposable { private SCardContext _handle; private readonly Pcsc _pcsc; private readonly IPcscProvider _provider; public bool IsDisposed { get; private set; } = false; public bool IsEstablished => _handle.HasValue; public Pcsc Pcsc => _pcsc; public PcscContext(Pcsc pcsc) { _pcsc = pcsc; _provider = pcsc.Provider; } public PcscContext(Pcsc pcsc, SCardScope scope) : this(pcsc) { Establish(scope); } ~PcscContext() { Dispose(); } public unsafe PcscContext Establish(SCardScope scope) { if (IsDisposed) throw new ObjectDisposedException(nameof(PcscContext), nameof(Establish)); if (IsEstablished) throw new InvalidOperationException("Context has been established."); SCardContext handle; _provider.SCardEstablishContext(scope, null, null, &handle).ThrowIfNotSuccess(); _handle = handle; return this; } public PcscContext Release() { if (IsDisposed) throw new ObjectDisposedException(nameof(PcscContext), nameof(Release)); if (IsEstablished) { _provider.SCardReleaseContext(_handle).ThrowIfNotSuccess(); _handle = SCardContext.Default; } return this; } public void Dispose() { if (IsDisposed) return; Release(); GC.SuppressFinalize(this); IsDisposed = true; } } }
Change field and variable names from context to handle
Change field and variable names from context to handle
C#
mit
Archie-Yang/PcscDotNet
5c3141d16afd3a4091e42ed4f1906a58d1d6fba4
osu.Game/Screens/OnlinePlay/Components/ReadyButton.cs
osu.Game/Screens/OnlinePlay/Components/ReadyButton.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics.Cursor; using osu.Framework.Localisation; using osu.Game.Graphics.UserInterface; using osu.Game.Online; using osu.Game.Online.Rooms; namespace osu.Game.Screens.OnlinePlay.Components { public abstract class ReadyButton : TriangleButton, IHasTooltip { public new readonly BindableBool Enabled = new BindableBool(); private IBindable<BeatmapAvailability> availability; [BackgroundDependencyLoader] private void load(OnlinePlayBeatmapAvailabilityTracker beatmapTracker) { availability = beatmapTracker.Availability.GetBoundCopy(); availability.BindValueChanged(_ => updateState()); Enabled.BindValueChanged(_ => updateState(), true); } private void updateState() => base.Enabled.Value = availability.Value.State == DownloadState.LocallyAvailable && Enabled.Value; public virtual LocalisableString TooltipText { get { if (Enabled.Value) return string.Empty; return "Beatmap not downloaded"; } } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics.Cursor; using osu.Framework.Localisation; using osu.Game.Graphics.UserInterface; using osu.Game.Online; using osu.Game.Online.Rooms; namespace osu.Game.Screens.OnlinePlay.Components { public abstract class ReadyButton : TriangleButton, IHasTooltip { public new readonly BindableBool Enabled = new BindableBool(); private IBindable<BeatmapAvailability> availability; [BackgroundDependencyLoader] private void load(OnlinePlayBeatmapAvailabilityTracker beatmapTracker) { availability = beatmapTracker.Availability.GetBoundCopy(); availability.BindValueChanged(_ => updateState()); Enabled.BindValueChanged(_ => updateState(), true); } private void updateState() => base.Enabled.Value = availability.Value.State == DownloadState.LocallyAvailable && Enabled.Value; public virtual LocalisableString TooltipText { get { if (Enabled.Value) return string.Empty; if (availability.Value.State != DownloadState.LocallyAvailable) return "Beatmap not downloaded"; return string.Empty; } } } }
Fix ready button tooltip showing when locally available
Fix ready button tooltip showing when locally available
C#
mit
peppy/osu,ppy/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,peppy/osu,smoogipooo/osu,smoogipoo/osu,smoogipoo/osu,ppy/osu
e81967e2d89d398b0813687f68b6fa2ed5d01262
GitFlowVersion/GitDirFinder.cs
GitFlowVersion/GitDirFinder.cs
namespace GitFlowVersion { using System.IO; public class GitDirFinder { public static string TreeWalkForGitDir(string currentDirectory) { while (true) { var gitDir = Path.Combine(currentDirectory, @".git"); if (Directory.Exists(gitDir)) { return gitDir; } var parent = Directory.GetParent(currentDirectory); if (parent == null) { break; } currentDirectory = parent.FullName; } return null; } } }
namespace GitFlowVersion { using System.IO; using LibGit2Sharp; public class GitDirFinder { public static string TreeWalkForGitDir(string currentDirectory) { string gitDir = Repository.Discover(currentDirectory); if (gitDir != null) { return gitDir.TrimEnd(new []{ Path.DirectorySeparatorChar }); } return null; } } }
Make TreeWalkForGitDir() delegate to LibGit2Sharp
Make TreeWalkForGitDir() delegate to LibGit2Sharp Fix #29
C#
mit
Kantis/GitVersion,dpurge/GitVersion,dpurge/GitVersion,TomGillen/GitVersion,ermshiperete/GitVersion,ParticularLabs/GitVersion,Philo/GitVersion,DanielRose/GitVersion,JakeGinnivan/GitVersion,Philo/GitVersion,orjan/GitVersion,GeertvanHorrik/GitVersion,JakeGinnivan/GitVersion,asbjornu/GitVersion,ParticularLabs/GitVersion,FireHost/GitVersion,Kantis/GitVersion,orjan/GitVersion,dpurge/GitVersion,alexhardwicke/GitVersion,dpurge/GitVersion,MarkZuber/GitVersion,gep13/GitVersion,onovotny/GitVersion,DanielRose/GitVersion,Kantis/GitVersion,onovotny/GitVersion,anobleperson/GitVersion,ermshiperete/GitVersion,RaphHaddad/GitVersion,alexhardwicke/GitVersion,distantcam/GitVersion,onovotny/GitVersion,GitTools/GitVersion,GeertvanHorrik/GitVersion,dazinator/GitVersion,dazinator/GitVersion,openkas/GitVersion,openkas/GitVersion,gep13/GitVersion,asbjornu/GitVersion,RaphHaddad/GitVersion,FireHost/GitVersion,anobleperson/GitVersion,ermshiperete/GitVersion,TomGillen/GitVersion,pascalberger/GitVersion,ermshiperete/GitVersion,DanielRose/GitVersion,GitTools/GitVersion,JakeGinnivan/GitVersion,distantcam/GitVersion,pascalberger/GitVersion,anobleperson/GitVersion,JakeGinnivan/GitVersion,pascalberger/GitVersion,MarkZuber/GitVersion
4cb2c4b494ab229fe81c8032ee530ea69bd4abf0
osu.Android/OsuGameActivity.cs
osu.Android/OsuGameActivity.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using Android.App; using Android.Content.PM; using Android.OS; using Android.Views; using osu.Framework.Android; namespace osu.Android { [Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.SensorLandscape, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = true)] public class OsuGameActivity : AndroidGameActivity { protected override Framework.Game CreateGame() => new OsuGameAndroid(); protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Window.AddFlags(WindowManagerFlags.Fullscreen); Window.AddFlags(WindowManagerFlags.KeepScreenOn); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using Android.App; using Android.Content.PM; using Android.OS; using Android.Views; using osu.Framework.Android; namespace osu.Android { [Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.FullSensor, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = true)] public class OsuGameActivity : AndroidGameActivity { protected override Framework.Game CreateGame() => new OsuGameAndroid(); protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Window.AddFlags(WindowManagerFlags.Fullscreen); Window.AddFlags(WindowManagerFlags.KeepScreenOn); } } }
Support both landscape and portrait mode
Support both landscape and portrait mode Co-Authored-By: miterosan <bf6c2acc98e216512706967a340573e61f973c1d@users.noreply.github.com>
C#
mit
ppy/osu,johnneijzen/osu,NeoAdonis/osu,2yangk23/osu,UselessToucan/osu,ppy/osu,EVAST9919/osu,peppy/osu,johnneijzen/osu,UselessToucan/osu,smoogipooo/osu,2yangk23/osu,peppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu-new,UselessToucan/osu,smoogipoo/osu,ZLima12/osu,NeoAdonis/osu,smoogipoo/osu,EVAST9919/osu,peppy/osu,ZLima12/osu,smoogipoo/osu
f92c62877049f68e340627a345fad04f39b4fd29
WootzJs.Mvc/Mvc/Views/Image.cs
WootzJs.Mvc/Mvc/Views/Image.cs
using WootzJs.Mvc.Mvc.Views.Css; using WootzJs.Web; namespace WootzJs.Mvc.Mvc.Views { public class Image : InlineControl { public Image() { } public Image(string source) { Source = source; } public Image(string defaultSource, string highlightedSource) { Source = defaultSource; MouseEntered += () => Source = highlightedSource; MouseExited += () => Source = defaultSource; } public Image(string defaultSource, string highlightedSource, CssColor highlightColor) { Source = defaultSource; MouseEntered += () => { Source = highlightedSource; Style.BackgroundColor = highlightColor; }; MouseExited += () => { Source = defaultSource; Style.BackgroundColor = CssColor.Inherit; }; } public int Width { get { return int.Parse(Node.GetAttribute("width")); } set { Node.SetAttribute("width", value.ToString()); } } public int Height { get { return int.Parse(Node.GetAttribute("height")); } set { Node.SetAttribute("height", value.ToString()); } } public string Source { get { return Node.GetAttribute("src"); } set { Node.SetAttribute("src", value); } } protected override Element CreateNode() { var node = Browser.Document.CreateElement("img"); node.Style.Display = "block"; return node; } } }
using WootzJs.Mvc.Mvc.Views.Css; using WootzJs.Web; namespace WootzJs.Mvc.Mvc.Views { public class Image : InlineControl { public Image() { } public Image(string source, int? width = null, int? height = null) { Source = source; if (width != null) Width = width.Value; if (height != null) Height = height.Value; } public Image(string defaultSource, string highlightedSource) { Source = defaultSource; MouseEntered += () => Source = highlightedSource; MouseExited += () => Source = defaultSource; } public Image(string defaultSource, string highlightedSource, CssColor highlightColor) { Source = defaultSource; MouseEntered += () => { Source = highlightedSource; Style.BackgroundColor = highlightColor; }; MouseExited += () => { Source = defaultSource; Style.BackgroundColor = CssColor.Inherit; }; } public int Width { get { return int.Parse(Node.GetAttribute("width")); } set { Node.SetAttribute("width", value.ToString()); } } public int Height { get { return int.Parse(Node.GetAttribute("height")); } set { Node.SetAttribute("height", value.ToString()); } } public string Source { get { return Node.GetAttribute("src"); } set { Node.SetAttribute("src", value); } } protected override Element CreateNode() { var node = Browser.Document.CreateElement("img"); node.Style.Display = "block"; return node; } } }
Add ability to set width and height when setting the image
Add ability to set width and height when setting the image
C#
mit
kswoll/WootzJs,x335/WootzJs,x335/WootzJs,kswoll/WootzJs,x335/WootzJs,kswoll/WootzJs
5853cb11cc4fda68fb34a30355f8b9469eff9f28
Foundation/Server/Foundation.Api/Middlewares/Signalr/MessagesHub.cs
Foundation/Server/Foundation.Api/Middlewares/Signalr/MessagesHub.cs
using System.Threading.Tasks; using Microsoft.AspNet.SignalR; using Microsoft.Owin; using Foundation.Api.Middlewares.SignalR.Contracts; namespace Foundation.Api.Middlewares.SignalR { public class MessagesHub : Hub { public override async Task OnConnected() { IOwinContext context = new OwinContext(Context.Request.Environment); Core.Contracts.IDependencyResolver dependencyResolver = context.Get<Core.Contracts.IDependencyResolver>("DependencyResolver"); await dependencyResolver.Resolve<IMessagesHubEvents>().OnConnected(this); await base.OnConnected(); } public override async Task OnDisconnected(bool stopCalled) { IOwinContext context = new OwinContext(Context.Request.Environment); Core.Contracts.IDependencyResolver dependencyResolver = context.Get<Core.Contracts.IDependencyResolver>("DependencyResolver"); await dependencyResolver.Resolve<IMessagesHubEvents>().OnDisconnected(this, stopCalled); await base.OnDisconnected(stopCalled); } public override async Task OnReconnected() { IOwinContext context = new OwinContext(Context.Request.Environment); Core.Contracts.IDependencyResolver dependencyResolver = context.Get<Core.Contracts.IDependencyResolver>("DependencyResolver"); await dependencyResolver.Resolve<IMessagesHubEvents>().OnReconnected(this); await base.OnReconnected(); } } }
using System.Threading.Tasks; using Microsoft.AspNet.SignalR; using Microsoft.Owin; using Foundation.Api.Middlewares.SignalR.Contracts; namespace Foundation.Api.Middlewares.SignalR { public class MessagesHub : Hub { public override async Task OnConnected() { try { IOwinContext context = new OwinContext(Context.Request.Environment); Core.Contracts.IDependencyResolver dependencyResolver = context.Get<Core.Contracts.IDependencyResolver>("DependencyResolver"); await dependencyResolver.Resolve<IMessagesHubEvents>().OnConnected(this); } finally { await base.OnConnected(); } } public override async Task OnDisconnected(bool stopCalled) { try { IOwinContext context = new OwinContext(Context.Request.Environment); Core.Contracts.IDependencyResolver dependencyResolver = context.Get<Core.Contracts.IDependencyResolver>("DependencyResolver"); await dependencyResolver.Resolve<IMessagesHubEvents>().OnDisconnected(this, stopCalled); } finally { await base.OnDisconnected(stopCalled); } } public override async Task OnReconnected() { try { IOwinContext context = new OwinContext(Context.Request.Environment); Core.Contracts.IDependencyResolver dependencyResolver = context.Get<Core.Contracts.IDependencyResolver>("DependencyResolver"); await dependencyResolver.Resolve<IMessagesHubEvents>().OnReconnected(this); } finally { await base.OnReconnected(); } } } }
Call signalr hub base method in case of exception in user codes of signalr hub events class
Call signalr hub base method in case of exception in user codes of signalr hub events class
C#
mit
bit-foundation/bit-framework,bit-foundation/bit-framework,bit-foundation/bit-framework,bit-foundation/bit-framework
df6b0a45533d54133055f7997c6157607179c0dc
RebirthTracker/RebirthTracker/Configuration.cs
RebirthTracker/RebirthTracker/Configuration.cs
using System.Runtime.InteropServices; namespace RebirthTracker { /// <summary> /// Class to keep track of OS-specific configuration settings /// </summary> public static class Configuration { /// <summary> /// Get the folder where files should be stored /// </summary> public static string GetDataDir() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { return "..\\..\\..\\..\\..\\"; } return "../../../../../../"; } } }
using System.Runtime.InteropServices; namespace RebirthTracker { /// <summary> /// Class to keep track of OS-specific configuration settings /// </summary> public static class Configuration { /// <summary> /// Get the folder where files should be stored /// </summary> public static string GetDataDir() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { return "..\\..\\..\\..\\..\\"; } return "/var/www/"; } } }
Use absolute path on linux
Use absolute path on linux
C#
mit
Mako88/dxx-tracker
5809732441d75b39f6ca6fc26c10c04e5de501a1
P2E.Services/UserCredentialsService.cs
P2E.Services/UserCredentialsService.cs
using System; using System.Text; using P2E.Interfaces.Services; namespace P2E.Services { public class UserCredentialsService : IUserCredentialsService { // Syncs console output/input between instance so that only one // instance can request user credentials at any time. private static readonly object LockObject = new object(); public string Loginname { get; private set; } public string Password { get; private set; } public void GetUserCredentials() { // Each instance can request credentials only once. if (HasUserCredentials) return; lock (LockObject) { if (HasUserCredentials) return; Console.Out.Write("Username: "); Loginname = Console.ReadLine(); Console.Out.Write("Password: "); Password = GetPassword(); } } public bool HasUserCredentials => Loginname != null && Password != null; private string GetPassword() { var password = new StringBuilder(); ConsoleKeyInfo key; do { key = Console.ReadKey(true); if (key.Key != ConsoleKey.Backspace && key.Key != ConsoleKey.Enter) { password.Append(key.KeyChar); Console.Write("*"); } else { if (key.Key == ConsoleKey.Backspace && password.Length > 0) { password.Remove(password.Length - 1, 1); Console.Write("\b \b"); } } } while (key.Key != ConsoleKey.Enter); Console.WriteLine(); return password.ToString(); } } }
using System; using System.Text; using P2E.Interfaces.Services; namespace P2E.Services { public class UserCredentialsService : IUserCredentialsService { // TODO - revert that stuipd locking idea and introduce a Credentials class instead. // Syncs console output/input between instance so that only one // instance can request user credentials at any time. private static readonly object LockObject = new object(); public string Loginname { get; private set; } public string Password { get; private set; } public void GetUserCredentials() { // Each instance can request credentials only once. if (HasUserCredentials) return; lock (LockObject) { if (HasUserCredentials) return; Console.Out.Write("Username: "); Loginname = Console.ReadLine(); Console.Out.Write("Password: "); Password = GetPassword(); } } public bool HasUserCredentials => Loginname != null && Password != null; private string GetPassword() { var password = new StringBuilder(); ConsoleKeyInfo key; do { key = Console.ReadKey(true); if (key.Key != ConsoleKey.Backspace && key.Key != ConsoleKey.Enter) { password.Append(key.KeyChar); Console.Write("*"); } else { if (key.Key == ConsoleKey.Backspace && password.Length > 0) { password.Remove(password.Length - 1, 1); Console.Write("\b \b"); } } } while (key.Key != ConsoleKey.Enter); Console.WriteLine(); return password.ToString(); } } }
Create a TODO to revert the locking code.
Create a TODO to revert the locking code.
C#
bsd-2-clause
SludgeVohaul/P2EApp
94bd54b18d9b294fac734049f31ab81493993477
source/Nuke.Common/BuildServers/TeamCityOutputSink.cs
source/Nuke.Common/BuildServers/TeamCityOutputSink.cs
// Copyright 2019 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Diagnostics.CodeAnalysis; using System.Linq; using JetBrains.Annotations; using Nuke.Common.OutputSinks; using Nuke.Common.Utilities; namespace Nuke.Common.BuildServers { [UsedImplicitly] [ExcludeFromCodeCoverage] internal class TeamCityOutputSink : AnsiColorOutputSink { private readonly TeamCity _teamCity; public TeamCityOutputSink(TeamCity teamCity) : base(traceCode: "37", informationCode: "36", warningCode: "33", errorCode: "31", successCode: "32") { _teamCity = teamCity; } public override IDisposable WriteBlock(string text) { return DelegateDisposable.CreateBracket( () => _teamCity.OpenBlock(text), () => _teamCity.CloseBlock(text)); } } }
// Copyright 2019 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using JetBrains.Annotations; using Nuke.Common.OutputSinks; using Nuke.Common.Utilities; using Nuke.Common.Utilities.Collections; namespace Nuke.Common.BuildServers { [UsedImplicitly] [ExcludeFromCodeCoverage] internal class TeamCityOutputSink : AnsiColorOutputSink { private readonly TeamCity _teamCity; public TeamCityOutputSink(TeamCity teamCity) : base(traceCode: "37", informationCode: "36", warningCode: "33", errorCode: "31", successCode: "32") { _teamCity = teamCity; } public override IDisposable WriteBlock(string text) { var stopWatch = new Stopwatch(); return DelegateDisposable.CreateBracket( () => { _teamCity.OpenBlock(text); stopWatch.Start(); }, () => { _teamCity.CloseBlock(text); _teamCity.AddStatisticValue( $"NUKE_DURATION_{text.SplitCamelHumpsWithSeparator("_").ToUpper()}", stopWatch.ElapsedMilliseconds.ToString()); stopWatch.Stop(); }); } } }
Add duration as statistical value for blocks in TeamCity
Add duration as statistical value for blocks in TeamCity
C#
mit
nuke-build/nuke,nuke-build/nuke,nuke-build/nuke,nuke-build/nuke
8b42199c5d08321388c49355e43574005598b1d3
ParkenDD/Services/JumpListService.cs
ParkenDD/Services/JumpListService.cs
using System; using System.Collections.Generic; using System.Threading.Tasks; using Windows.UI.StartScreen; using ParkenDD.Api.Models; namespace ParkenDD.Services { public class JumpListService { private readonly ResourceService _resources; private const string ArgumentFormat = "city={0}"; public JumpListService(ResourceService resources) { _resources = resources; } public async void UpdateCityList(IEnumerable<MetaDataCityRow> metaData) { await UpdateCityListAsync(metaData); } public async Task UpdateCityListAsync(IEnumerable<MetaDataCityRow> cities) { if (cities == null) { return; } if (JumpList.IsSupported()) { var jumpList = await JumpList.LoadCurrentAsync(); jumpList.SystemGroupKind = JumpListSystemGroupKind.None; jumpList.Items.Clear(); foreach (var city in cities) { var item = JumpListItem.CreateWithArguments(string.Format(ArgumentFormat, city.Id), city.Name); item.GroupName = _resources.JumpListCitiesHeader; item.Logo = new Uri("ms-appx:///Assets/ParkingIcon.png"); jumpList.Items.Add(item); } await jumpList.SaveAsync(); } } } }
using System; using System.Collections.Generic; using System.Threading.Tasks; using Windows.UI.StartScreen; using ParkenDD.Api.Models; namespace ParkenDD.Services { public class JumpListService { private readonly ResourceService _resources; private const string ArgumentFormat = "city={0}"; public JumpListService(ResourceService resources) { _resources = resources; } public async void UpdateCityList(IEnumerable<MetaDataCityRow> metaData) { await UpdateCityListAsync(metaData); } public async Task UpdateCityListAsync(IEnumerable<MetaDataCityRow> cities) { /* if (cities == null) { return; } if (JumpList.IsSupported()) { var jumpList = await JumpList.LoadCurrentAsync(); jumpList.SystemGroupKind = JumpListSystemGroupKind.None; jumpList.Items.Clear(); foreach (var city in cities) { var item = JumpListItem.CreateWithArguments(string.Format(ArgumentFormat, city.Id), city.Name); item.GroupName = _resources.JumpListCitiesHeader; item.Logo = new Uri("ms-appx:///Assets/ParkingIcon.png"); jumpList.Items.Add(item); } await jumpList.SaveAsync(); } */ } } }
Comment out jump list support again as no SDK is out yet... :(
Comment out jump list support again as no SDK is out yet... :(
C#
mit
sibbl/ParkenDD
3c7d9de2b1eff2296694c60c326cbb6419d9c6e5
Source/Eto.Test/Eto.Test.Mac/Startup.cs
Source/Eto.Test/Eto.Test.Mac/Startup.cs
using System; using System.Drawing; using MonoMac.Foundation; using MonoMac.AppKit; using MonoMac.ObjCRuntime; using Eto.Forms; namespace Eto.Test.Mac { class Startup { static void Main (string [] args) { AddStyles (); var generator = new Eto.Platform.Mac.Generator (); var app = new TestApplication (generator); app.Run (args); } static void AddStyles () { // support full screen mode! Style.Add<Window, NSWindow> ("main", (widget, control) => { //control.CollectionBehavior |= NSWindowCollectionBehavior.FullScreenPrimary; // not in monomac/master yet.. }); Style.Add<Application, NSApplication> ("application", (widget, control) => { if (control.RespondsToSelector (new Selector ("presentationOptions:"))) { control.PresentationOptions |= NSApplicationPresentationOptions.FullScreen; } }); // other styles Style.Add<TreeView, NSScrollView> ("sectionList", (widget, control) => { control.BorderType = NSBorderType.NoBorder; var table = control.DocumentView as NSTableView; table.SelectionHighlightStyle = NSTableViewSelectionHighlightStyle.SourceList; }); } } }
using System; using System.Drawing; using MonoMac.Foundation; using MonoMac.AppKit; using MonoMac.ObjCRuntime; using Eto.Forms; namespace Eto.Test.Mac { class Startup { static void Main (string [] args) { AddStyles (); var generator = new Eto.Platform.Mac.Generator (); var app = new TestApplication (generator); app.Run (args); } static void AddStyles () { // support full screen mode! Style.Add<Window, NSWindow> ("main", (widget, control) => { control.CollectionBehavior |= NSWindowCollectionBehavior.FullScreenPrimary; }); Style.Add<Application, NSApplication> ("application", (widget, control) => { if (control.RespondsToSelector (new Selector ("presentationOptions:"))) { control.PresentationOptions |= NSApplicationPresentationOptions.FullScreen; } }); // other styles Style.Add<TreeView, NSScrollView> ("sectionList", (widget, control) => { control.BorderType = NSBorderType.NoBorder; var table = control.DocumentView as NSTableView; table.SelectionHighlightStyle = NSTableViewSelectionHighlightStyle.SourceList; }); } } }
Support full screen now that core MonoMac supports it
Mac: Support full screen now that core MonoMac supports it
C#
bsd-3-clause
l8s/Eto,PowerOfCode/Eto,bbqchickenrobot/Eto-1,PowerOfCode/Eto,l8s/Eto,l8s/Eto,bbqchickenrobot/Eto-1,PowerOfCode/Eto,bbqchickenrobot/Eto-1
ce4660448e323cf254d5d62acf4e54b34e138d93
DragonContracts/DragonContracts/Base/RavenDbController.cs
DragonContracts/DragonContracts/Base/RavenDbController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using System.Web; using System.Web.Http; using System.Web.Http.Controllers; using DragonContracts.Models; using Raven.Client; using Raven.Client.Document; using Raven.Client.Embedded; using Raven.Database.Server.Responders; namespace DragonContracts.Base { public class RavenDbController : ApiController { public IDocumentStore Store { get { return LazyDocStore.Value; } } private static readonly Lazy<IDocumentStore> LazyDocStore = new Lazy<IDocumentStore>(() => { var docStore = new EmbeddableDocumentStore() { DataDirectory = "App_Data/Raven" }; docStore.Initialize(); return docStore; }); public IAsyncDocumentSession Session { get; set; } public async override Task<HttpResponseMessage> ExecuteAsync( HttpControllerContext controllerContext, CancellationToken cancellationToken) { using (Session = Store.OpenAsyncSession()) { var result = await base.ExecuteAsync(controllerContext, cancellationToken); await Session.SaveChangesAsync(); return result; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using System.Web; using System.Web.Http; using System.Web.Http.Controllers; using DragonContracts.Models; using Raven.Client; using Raven.Client.Document; using Raven.Client.Embedded; using Raven.Database.Config; using Raven.Database.Server.Responders; namespace DragonContracts.Base { public class RavenDbController : ApiController { private const int RavenWebUiPort = 8081; public IDocumentStore Store { get { return LazyDocStore.Value; } } private static readonly Lazy<IDocumentStore> LazyDocStore = new Lazy<IDocumentStore>(() => { var docStore = new EmbeddableDocumentStore() { DataDirectory = "App_Data/Raven", UseEmbeddedHttpServer = true }; docStore.Configuration.Port = RavenWebUiPort; Raven.Database.Server.NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(RavenWebUiPort); docStore.Initialize(); return docStore; }); public IAsyncDocumentSession Session { get; set; } public async override Task<HttpResponseMessage> ExecuteAsync( HttpControllerContext controllerContext, CancellationToken cancellationToken) { using (Session = Store.OpenAsyncSession()) { var result = await base.ExecuteAsync(controllerContext, cancellationToken); await Session.SaveChangesAsync(); return result; } } } }
Enable raven studio for port 8081
Enable raven studio for port 8081
C#
mit
Vavro/DragonContracts,Vavro/DragonContracts
d2471bd67e67504f4b65a4de5fbb223efd9299b5
UnitTests/UnitTest1.cs
UnitTests/UnitTest1.cs
#region Usings using System.Linq; using System.Web.Mvc; using NUnit.Framework; using WebApplication.Controllers; using WebApplication.Models; #endregion namespace UnitTests { [TestFixture] public class UnitTest1 { [Test] public void TestMethod1() { var formCollection = new FormCollection(); formCollection["Name"] = "Habit"; var habitController = new HabitController(); habitController.Create(formCollection); var habit = ApplicationDbContext.Create().Habits.Single(); Assert.AreEqual("Habit", habit.Name); } } }
#region Usings using NUnit.Framework; #endregion namespace UnitTests { [TestFixture] public class UnitTest1 { [Test] public void TestMethod1() { Assert.True(true); } } }
Replace test with test stub
Replace test with test stub
C#
mit
SmartStepGroup/AgileCamp2015_Master,SmartStepGroup/AgileCamp2015_Master,SmartStepGroup/AgileCamp2015_Master
87b322b1e10fea3a023af2ae96c954bcc46b1794
src/VsConsole/Console/PowerConsole/HostInfo.cs
src/VsConsole/Console/PowerConsole/HostInfo.cs
using System; using System.Diagnostics; namespace NuGetConsole.Implementation.PowerConsole { /// <summary> /// Represents a host with extra info. /// </summary> class HostInfo : ObjectWithFactory<PowerConsoleWindow> { Lazy<IHostProvider, IHostMetadata> HostProvider { get; set; } public HostInfo(PowerConsoleWindow factory, Lazy<IHostProvider, IHostMetadata> hostProvider) : base(factory) { UtilityMethods.ThrowIfArgumentNull(hostProvider); this.HostProvider = hostProvider; } /// <summary> /// Get the HostName attribute value of this host. /// </summary> public string HostName { get { return HostProvider.Metadata.HostName; } } IWpfConsole _wpfConsole; /// <summary> /// Get/create the console for this host. If not already created, this /// actually creates the (console, host) pair. /// /// Note: Creating the console is handled by this package and mostly will /// succeed. However, creating the host could be from other packages and /// fail. In that case, this console is already created and can be used /// subsequently in limited ways, such as displaying an error message. /// </summary> public IWpfConsole WpfConsole { get { if (_wpfConsole == null) { _wpfConsole = Factory.WpfConsoleService.CreateConsole( Factory.ServiceProvider, PowerConsoleWindow.ContentType, HostName); _wpfConsole.Host = HostProvider.Value.CreateHost(_wpfConsole, @async: false); } return _wpfConsole; } } } }
using System; using System.Diagnostics; namespace NuGetConsole.Implementation.PowerConsole { /// <summary> /// Represents a host with extra info. /// </summary> class HostInfo : ObjectWithFactory<PowerConsoleWindow> { Lazy<IHostProvider, IHostMetadata> HostProvider { get; set; } public HostInfo(PowerConsoleWindow factory, Lazy<IHostProvider, IHostMetadata> hostProvider) : base(factory) { UtilityMethods.ThrowIfArgumentNull(hostProvider); this.HostProvider = hostProvider; } /// <summary> /// Get the HostName attribute value of this host. /// </summary> public string HostName { get { return HostProvider.Metadata.HostName; } } IWpfConsole _wpfConsole; /// <summary> /// Get/create the console for this host. If not already created, this /// actually creates the (console, host) pair. /// /// Note: Creating the console is handled by this package and mostly will /// succeed. However, creating the host could be from other packages and /// fail. In that case, this console is already created and can be used /// subsequently in limited ways, such as displaying an error message. /// </summary> public IWpfConsole WpfConsole { get { if (_wpfConsole == null) { _wpfConsole = Factory.WpfConsoleService.CreateConsole( Factory.ServiceProvider, PowerConsoleWindow.ContentType, HostName); _wpfConsole.Host = HostProvider.Value.CreateHost(_wpfConsole, @async: true); } return _wpfConsole; } } } }
Revert accidental change of the async flag.
Revert accidental change of the async flag. --HG-- branch : 1.1
C#
apache-2.0
mdavid/nuget,mdavid/nuget
675a405cdbcc7856632b7a72ae91ccd97a6154f2
Editor/Settings/BuildSettings.cs
Editor/Settings/BuildSettings.cs
using UnityEngine; using UnityEditor; namespace UnityBuild { public abstract class BuildSettings { public abstract string binName { get; } public abstract string binPath { get; } public abstract string[] scenesInBuild { get; } public abstract string[] copyToBuild { get; } //// The name of executable file (e.g. mygame.exe, mygame.app) //public const string BIN_NAME = "mygame"; //// The base path where builds are output. //// Path is relative to the Unity project's base folder unless an absolute path is given. //public const string BIN_PATH = "bin"; //// A list of scenes to include in the build. The first listed scene will be loaded first. //public static string[] scenesInBuild = new string[] { // // "Assets/Scenes/scene1.unity", // // "Assets/Scenes/scene2.unity", // // ... //}; //// A list of files/directories to include with the build. //// Paths are relative to Unity project's base folder unless an absolute path is given. //public static string[] copyToBuild = new string[] { // // "DirectoryToInclude/", // // "FileToInclude.txt", // // ... //}; } }
using UnityEngine; using UnityEditor; namespace UnityBuild { public abstract class BuildSettings { public abstract string binName { get; } public abstract string binPath { get; } public abstract string[] scenesInBuild { get; } public abstract string[] copyToBuild { get; } public virtual void PreBuild() { } public virtual void PostBuild() { } } }
Add virtual pre/post build methods.
Add virtual pre/post build methods.
C#
mit
Chaser324/unity-build,thaumazo/unity-build
ea2b79f3c1a74c7809603730c2e21031dae0d67c
LBD2OBJLib/Types/FixedPoint.cs
LBD2OBJLib/Types/FixedPoint.cs
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LBD2OBJLib.Types { class FixedPoint { public int IntegralPart { get; set; } public int DecimalPart { get; set; } public FixedPoint(byte[] data) { if (data.Length != 2) { throw new ArgumentException("data must be 2 bytes", "data"); } byte[] _data = new byte[2]; data.CopyTo(_data, 0); var signMask = (byte)128; var integralMask = (byte)112; var firstPartOfDecimalMask = (byte)15; bool isNegative = (_data[0] & signMask) == 128; int integralPart = (_data[0] & integralMask) * (isNegative ? -1 : 1); int decimalPart = (_data[0] & firstPartOfDecimalMask); decimalPart <<= 8; decimalPart += data[1]; IntegralPart = integralPart; DecimalPart = decimalPart; } public override string ToString() { return IntegralPart + "." + DecimalPart; } } }
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LBD2OBJLib.Types { class FixedPoint { public int IntegralPart { get; set; } public int DecimalPart { get; set; } const byte SIGN_MASK = 128; const byte INTEGRAL_MASK = 112; const byte MANTISSA_MASK = 15; public FixedPoint(byte[] data) { if (data.Length != 2) { throw new ArgumentException("data must be 2 bytes", "data"); } byte[] _data = new byte[2]; data.CopyTo(_data, 0); bool isNegative = (_data[0] & SIGN_MASK) == 128; int integralPart = (_data[0] & INTEGRAL_MASK) * (isNegative ? -1 : 1); int decimalPart = (_data[0] & MANTISSA_MASK); decimalPart <<= 8; decimalPart += data[1]; IntegralPart = integralPart; DecimalPart = decimalPart; } public override string ToString() { return IntegralPart + "." + DecimalPart; } } }
Change mask variables to const values, remove from constructor
Change mask variables to const values, remove from constructor
C#
mit
Figglewatts/LBD2OBJ
fd8319419f4957b6ec4088cfe31bf8515aa5e888
SampleGame.Desktop/Program.cs
SampleGame.Desktop/Program.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Platform; using osu.Framework; namespace SampleGame.Desktop { public static class Program { [STAThread] public static void Main() { using (GameHost host = Host.GetSuitableHost(@"sample-game")) using (Game game = new SampleGameGame()) host.Run(game); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Linq; using osu.Framework; using osu.Framework.Platform; namespace SampleGame.Desktop { public static class Program { [STAThread] public static void Main(string[] args) { bool useSdl = args.Contains(@"--sdl"); using (GameHost host = Host.GetSuitableHost(@"sample-game", useSdl: useSdl)) using (Game game = new SampleGameGame()) host.Run(game); } } }
Add SDL support to SampleGame
Add SDL support to SampleGame
C#
mit
peppy/osu-framework,ZLima12/osu-framework,peppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework
07baeda87898657f050010d112aad60a47b37888
PalasoUIWindowsForms/WritingSystems/WSPropertiesTabControl.cs
PalasoUIWindowsForms/WritingSystems/WSPropertiesTabControl.cs
using System.Windows.Forms; namespace Palaso.UI.WindowsForms.WritingSystems { public partial class WSPropertiesTabControl : UserControl { private WritingSystemSetupModel _model; public WSPropertiesTabControl() { InitializeComponent(); } public void BindToModel(WritingSystemSetupModel model) { _model = model; _identifiersControl.BindToModel(_model); _fontControl.BindToModel(_model); _keyboardControl.BindToModel(_model); _sortControl.BindToModel(_model); _spellingControl.BindToModel(_model); } } }
using System; using System.Windows.Forms; namespace Palaso.UI.WindowsForms.WritingSystems { public partial class WSPropertiesTabControl : UserControl { private WritingSystemSetupModel _model; public WSPropertiesTabControl() { InitializeComponent(); } public void BindToModel(WritingSystemSetupModel model) { if (_model != null) { _model.SelectionChanged -= ModelChanged; _model.CurrentItemUpdated -= ModelChanged; } _model = model; _identifiersControl.BindToModel(_model); _fontControl.BindToModel(_model); _keyboardControl.BindToModel(_model); _sortControl.BindToModel(_model); _spellingControl.BindToModel(_model); if (_model != null) { _model.SelectionChanged+= ModelChanged; _model.CurrentItemUpdated += ModelChanged; } this.Disposed += OnDisposed; } private void ModelChanged(object sender, EventArgs e) { if( !_model.CurrentIsVoice && _tabControl.Controls.Contains(_spellingPage)) { return;// don't mess if we really don't need a change } _tabControl.Controls.Clear(); this._tabControl.Controls.Add(this._identifiersPage); if( !_model.CurrentIsVoice) { this._tabControl.Controls.Add(this._spellingPage); this._tabControl.Controls.Add(this._fontsPage); this._tabControl.Controls.Add(this._keyboardsPage); this._tabControl.Controls.Add(this._sortingPage); } } void OnDisposed(object sender, EventArgs e) { if (_model != null) _model.SelectionChanged -= ModelChanged; } } }
Hide irrelevant tabs when the Writing System is a voice one.
Hide irrelevant tabs when the Writing System is a voice one.
C#
mit
ermshiperete/libpalaso,glasseyes/libpalaso,andrew-polk/libpalaso,ddaspit/libpalaso,JohnThomson/libpalaso,JohnThomson/libpalaso,darcywong00/libpalaso,ermshiperete/libpalaso,andrew-polk/libpalaso,marksvc/libpalaso,mccarthyrb/libpalaso,chrisvire/libpalaso,darcywong00/libpalaso,gtryus/libpalaso,mccarthyrb/libpalaso,glasseyes/libpalaso,gmartin7/libpalaso,gtryus/libpalaso,darcywong00/libpalaso,mccarthyrb/libpalaso,glasseyes/libpalaso,gtryus/libpalaso,ermshiperete/libpalaso,gtryus/libpalaso,chrisvire/libpalaso,andrew-polk/libpalaso,JohnThomson/libpalaso,marksvc/libpalaso,tombogle/libpalaso,tombogle/libpalaso,gmartin7/libpalaso,mccarthyrb/libpalaso,gmartin7/libpalaso,ddaspit/libpalaso,gmartin7/libpalaso,chrisvire/libpalaso,tombogle/libpalaso,sillsdev/libpalaso,chrisvire/libpalaso,sillsdev/libpalaso,JohnThomson/libpalaso,ddaspit/libpalaso,ermshiperete/libpalaso,glasseyes/libpalaso,ddaspit/libpalaso,hatton/libpalaso,tombogle/libpalaso,sillsdev/libpalaso,andrew-polk/libpalaso,sillsdev/libpalaso,hatton/libpalaso,hatton/libpalaso,marksvc/libpalaso,hatton/libpalaso
bc72532c5ec9c747caa42bd236bc8d80a6d6694f
Src/TensorSharp/Operations/MultiplyIntegerIntegerOperation.cs
Src/TensorSharp/Operations/MultiplyIntegerIntegerOperation.cs
namespace TensorSharp.Operations { using System; using System.Collections.Generic; using System.Linq; using System.Text; public class MultiplyIntegerIntegerOperation : IBinaryOperation<int, int, int> { public Tensor<int> Evaluate(Tensor<int> tensor1, Tensor<int> tensor2) { Tensor<int> result = new Tensor<int>(); result.SetValue(tensor1.GetValue() * tensor2.GetValue()); return result; } } }
namespace TensorSharp.Operations { using System; using System.Collections.Generic; using System.Linq; using System.Text; public class MultiplyIntegerIntegerOperation : IBinaryOperation<int, int, int> { public Tensor<int> Evaluate(Tensor<int> tensor1, Tensor<int> tensor2) { int[] values1 = tensor1.GetValues(); int l = values1.Length; int value2 = tensor2.GetValue(); int[] newvalues = new int[l]; for (int k = 0; k < l; k++) newvalues[k] = values1[k] * value2; return tensor1.CloneWithNewValues(newvalues); } } }
Refactor Multiply Integers Operation to use GetValues and CloneWithValues
Refactor Multiply Integers Operation to use GetValues and CloneWithValues
C#
mit
ajlopez/TensorSharp
585cded973c0d4db57a1d0adcecb7f9d694a8fda
SignalR.Tests/ConnectionFacts.cs
SignalR.Tests/ConnectionFacts.cs
using System; using System.Linq; using System.Threading; using Moq; using SignalR.Client.Transports; using SignalR.Hosting.Memory; using Xunit; namespace SignalR.Client.Tests { public class ConnectionFacts { public class Start { [Fact] public void FailsIfProtocolVersionIsNull() { var connection = new Connection("http://test"); var transport = new Mock<IClientTransport>(); transport.Setup(m => m.Negotiate(connection)).Returns(TaskAsyncHelper.FromResult(new NegotiationResponse { ProtocolVersion = null })); var aggEx = Assert.Throws<AggregateException>(() => connection.Start(transport.Object).Wait()); var ex = aggEx.Unwrap(); Assert.IsType(typeof(InvalidOperationException), ex); Assert.Equal("Incompatible protocol version.", ex.Message); } } public class Received { [Fact] public void SendingBigData() { var host = new MemoryHost(); host.MapConnection<SampleConnection>("/echo"); var connection = new Connection("http://foo/echo"); var wh = new ManualResetEventSlim(); var n = 0; var target = 20; connection.Received += data => { n++; if (n == target) { wh.Set(); } }; connection.Start(host).Wait(); var conn = host.ConnectionManager.GetConnection<SampleConnection>(); for (int i = 0; i < target; ++i) { var node = new BigData(); conn.Broadcast(node).Wait(); Thread.Sleep(1000); } Assert.True(wh.Wait(TimeSpan.FromMinutes(1)), "Timed out"); } public class BigData { public string[] Dummy { get { return Enumerable.Range(0, 1000).Select(x => new String('*', 500)).ToArray(); } } } public class SampleConnection : PersistentConnection { } } } }
using System; using System.Linq; using System.Threading; using Moq; using SignalR.Client.Transports; using SignalR.Hosting.Memory; using Xunit; namespace SignalR.Client.Tests { public class ConnectionFacts { public class Start { [Fact] public void FailsIfProtocolVersionIsNull() { var connection = new Connection("http://test"); var transport = new Mock<IClientTransport>(); transport.Setup(m => m.Negotiate(connection)).Returns(TaskAsyncHelper.FromResult(new NegotiationResponse { ProtocolVersion = null })); var aggEx = Assert.Throws<AggregateException>(() => connection.Start(transport.Object).Wait()); var ex = aggEx.Unwrap(); Assert.IsType(typeof(InvalidOperationException), ex); Assert.Equal("Incompatible protocol version.", ex.Message); } } } }
Remove sending big data test.
Remove sending big data test.
C#
mit
shiftkey/SignalR,shiftkey/SignalR
3fa153c94c729bf4a8231f36957658dde0ce7afe
src/Jasper.ConfluentKafka/Internal/KafkaTopicRouter.cs
src/Jasper.ConfluentKafka/Internal/KafkaTopicRouter.cs
using System; using System.Collections.Generic; using Baseline; using Confluent.Kafka; using Jasper.Configuration; using Jasper.Runtime.Routing; namespace Jasper.ConfluentKafka.Internal { public class KafkaTopicRouter : TopicRouter<KafkaSubscriberConfiguration> { //Dictionary<Uri, ProducerConfig> producerConfigs; //public KafkaTopicRouter(Dictionary<Uri, ProducerConfig> producerConfigs) //{ //} public override Uri BuildUriForTopic(string topicName) { var endpoint = new KafkaEndpoint { IsDurable = true, TopicName = topicName }; return endpoint.Uri; } public override KafkaSubscriberConfiguration FindConfigurationForTopic(string topicName, IEndpoints endpoints) { var uri = BuildUriForTopic(topicName); var endpoint = endpoints.As<TransportCollection>().GetOrCreateEndpoint(uri); return new KafkaSubscriberConfiguration((KafkaEndpoint) endpoint); } } }
using System; using Baseline; using Jasper.Configuration; using Jasper.Runtime.Routing; namespace Jasper.ConfluentKafka.Internal { public class KafkaTopicRouter : TopicRouter<KafkaSubscriberConfiguration> { public override Uri BuildUriForTopic(string topicName) { var endpoint = new KafkaEndpoint { IsDurable = true, TopicName = topicName }; return endpoint.Uri; } public override KafkaSubscriberConfiguration FindConfigurationForTopic(string topicName, IEndpoints endpoints) { var uri = BuildUriForTopic(topicName); var endpoint = endpoints.As<TransportCollection>().GetOrCreateEndpoint(uri); return new KafkaSubscriberConfiguration((KafkaEndpoint) endpoint); } } }
Remove commented code and unused usings
Remove commented code and unused usings
C#
mit
JasperFx/jasper,JasperFx/jasper,JasperFx/jasper
433909078e6315aa9328d0313670f7ec694f68ea
src/MiniCover/CommandLine/Options/CoverageLoadedFileOption.cs
src/MiniCover/CommandLine/Options/CoverageLoadedFileOption.cs
using System.IO; using MiniCover.Model; using Newtonsoft.Json; namespace MiniCover.CommandLine.Options { class CoverageLoadedFileOption : CoverageFileOption { public InstrumentationResult Result { get; private set; } protected override FileInfo PrepareValue(string value) { var fileInfo = base.PrepareValue(value); if (!fileInfo.Exists) throw new FileNotFoundException($"Coverage file does not exist '{fileInfo.FullName}'"); var coverageFileString = File.ReadAllText(fileInfo.FullName); Result = JsonConvert.DeserializeObject<InstrumentationResult>(coverageFileString); return fileInfo; } } }
using System.IO; using MiniCover.Exceptions; using MiniCover.Model; using Newtonsoft.Json; namespace MiniCover.CommandLine.Options { class CoverageLoadedFileOption : CoverageFileOption { public InstrumentationResult Result { get; private set; } protected override FileInfo PrepareValue(string value) { var fileInfo = base.PrepareValue(value); if (!fileInfo.Exists) throw new ValidationException($"Coverage file does not exist '{fileInfo.FullName}'"); var coverageFileString = File.ReadAllText(fileInfo.FullName); Result = JsonConvert.DeserializeObject<InstrumentationResult>(coverageFileString); return fileInfo; } } }
Improve error message when coverage is not found
Improve error message when coverage is not found
C#
mit
lucaslorentz/minicover,lucaslorentz/minicover,lucaslorentz/minicover
8baf58aa1eb06d5811dabd33d79efaaee0070272
Assets/PoolVR/Scripts/FollowTarget.cs
Assets/PoolVR/Scripts/FollowTarget.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; using Zenject; public class FollowTarget : MonoBehaviour { [Inject] public ForceSelector ForceSelector { get; set; } public Rigidbody targetRb; public float distanceToReset = 0.1f; public float velocityThresh; public float moveToTargetSpeed; public bool isAtTarget; void Update () { isAtTarget = Vector3.Distance(targetRb.transform.position, transform.position) <= distanceToReset; if (targetRb.velocity.magnitude < velocityThresh && !isAtTarget) { transform.position = Vector3.Lerp(transform.position, targetRb.transform.position, moveToTargetSpeed); } ForceSelector.IsRunning = isAtTarget; } }
using System; using System.Collections; using System.Collections.Generic; using UniRx; using UnityEngine; using Zenject; public class FollowTarget : MonoBehaviour { [Inject] public ForceSelector ForceSelector { get; set; } public Rigidbody targetRb; public float velocityThresh; public float moveToTargetSpeed; public float distanceToResume; public float distanceToReset; private IDisposable sub; void Start() { sub = Observable .IntervalFrame(5) .Select(_ => Vector3.Distance(targetRb.transform.position, transform.position)) .Hysteresis((d, referenceDist) => d - referenceDist, distanceToResume, distanceToReset) .Subscribe(isMoving => { ForceSelector.IsRunning = !isMoving; }); } void OnDestroy() { if (sub != null) { sub.Dispose(); sub = null; } } void Update () { if (targetRb.velocity.magnitude < velocityThresh && !ForceSelector.IsRunning) { transform.position = Vector3.Lerp(transform.position, targetRb.transform.position, moveToTargetSpeed); } } }
Fix force selector reset clipping error.
Fix force selector reset clipping error.
C#
mit
s-soltys/PoolVR
382214e537a5716c3d21896862b8b64e1b81b6b1
examples/Bands.GettingStarted/Program.cs
examples/Bands.GettingStarted/Program.cs
using Bands.Output; using System; namespace Bands.GettingStarted { class Program { static void Main(string[] args) { Console.WriteLine("Getting started with Bands!"); var payload = new CounterPayload(); var innerConsoleBand = new ConsoleWriterBand<CounterPayload>(CallAddTwo); var incrementableBand = new IncrementableBand<CounterPayload>(innerConsoleBand); var outerConsoleBand = new ConsoleWriterBand<CounterPayload>(incrementableBand); outerConsoleBand.Enter(payload); Console.WriteLine("Kinda badass, right?"); Console.Read(); } public static void CallAddTwo(CounterPayload payload) { Console.WriteLine("Calling payload.AddTwo()"); payload.AddTwo(); } } }
using Bands.Output; using System; namespace Bands.GettingStarted { class Program { static void Main(string[] args) { Console.WriteLine("Getting started with Bands!"); var payload = new CounterPayload(); var innerConsoleBand = new ConsoleWriterBand<CounterPayload>(CallAddTwo); var incrementableBand = new IncrementableBand<CounterPayload>(innerConsoleBand); var outerConsoleBand = new ConsoleWriterBand<CounterPayload>(incrementableBand); outerConsoleBand.Enter(payload); Console.WriteLine("Kinda awesome, right?"); Console.Read(); } public static void CallAddTwo(CounterPayload payload) { Console.WriteLine("Calling payload.AddTwo()"); payload.AddTwo(); } } }
Remove profanity - don't want to alienate folk
Remove profanity - don't want to alienate folk
C#
mit
larrynburris/Bands
f6a35c5490f1d35db4a3c22bb60ec188a3f88ac4
TestStack.FluentMVCTesting.Tests/Internal/ExpressionInspectorTests.cs
TestStack.FluentMVCTesting.Tests/Internal/ExpressionInspectorTests.cs
using NUnit.Framework; using System; using System.Linq.Expressions; using TestStack.FluentMVCTesting.Internal; namespace TestStack.FluentMVCTesting.Tests.Internal { [TestFixture] public class ExpressionInspectorShould { [Test] public void Correctly_parse_equality_comparison_with_string_operands() { Expression<Func<string, bool>> func = text => text == "any"; ExpressionInspector sut = new ExpressionInspector(); var actual = sut.Inspect(func); Assert.AreEqual("text => text == \"any\"", actual); } [Test] public void Correctly_parse_equality_comparison_with_int_operands() { Expression<Func<int, bool>> func = number => number == 5; ExpressionInspector sut = new ExpressionInspector(); var actual = sut.Inspect(func); Assert.AreEqual("number => number == 5", actual); } } }
using NUnit.Framework; using System; using System.Linq.Expressions; using TestStack.FluentMVCTesting.Internal; namespace TestStack.FluentMVCTesting.Tests.Internal { [TestFixture] public class ExpressionInspectorShould { [Test] public void Correctly_parse_equality_comparison_with_string_operands() { Expression<Func<string, bool>> func = text => text == "any"; ExpressionInspector sut = new ExpressionInspector(); var actual = sut.Inspect(func); Assert.AreEqual("text => text == \"any\"", actual); } [Test] public void Correctly_parse_equality_comparison_with_int_operands() { Expression<Func<int, bool>> func = number => number == 5; ExpressionInspector sut = new ExpressionInspector(); var actual = sut.Inspect(func); Assert.AreEqual("number => number == 5", actual); } [Test] public void Correctly_parse_inequality_comparison_with_int_operands() { Expression<Func<int, bool>> func = number => number != 5; ExpressionInspector sut = new ExpressionInspector(); var actual = sut.Inspect(func); Assert.AreEqual("number => number != 5", actual); } } }
Support for parsing inequality operator with integral operands.
Support for parsing inequality operator with integral operands.
C#
mit
TestStack/TestStack.FluentMVCTesting
ce5f62aa6c8ee24ac1620d457b9ee7963ff84578
test/indice.Edi.Tests/Models/EdiFact_ORDRSP_Conditions.cs
test/indice.Edi.Tests/Models/EdiFact_ORDRSP_Conditions.cs
using indice.Edi.Serialization; using System; using System.Collections.Generic; namespace indice.Edi.Tests.Models { public class Interchange_ORDRSP { public Message_ORDRSP Message { get; set; } } [EdiMessage] public class Message_ORDRSP { [EdiCondition("Z01", Path = "IMD/1/0")] [EdiCondition("Z10", Path = "IMD/1/0")] public List<IMD> IMD_List { get; set; } [EdiCondition("Z01", "Z10", CheckFor = EdiConditionCheckType.NotEqual, Path = "IMD/1/0")] public IMD IMD_Other { get; set; } /// <summary> /// Item Description /// </summary> [EdiSegment, EdiPath("IMD")] public class IMD { [EdiValue(Path = "IMD/0")] public string FieldA { get; set; } [EdiValue(Path = "IMD/1")] public string FieldB { get; set; } [EdiValue(Path = "IMD/2")] public string FieldC { get; set; } } } }
using indice.Edi.Serialization; using System; using System.Collections.Generic; namespace indice.Edi.Tests.Models { public class Interchange_ORDRSP { public Message_ORDRSP Message { get; set; } } [EdiMessage] public class Message_ORDRSP { [EdiCondition("Z01", "Z10", Path = "IMD/1/0")] public List<IMD> IMD_List { get; set; } [EdiCondition("Z01", "Z10", CheckFor = EdiConditionCheckType.NotEqual, Path = "IMD/1/0")] public IMD IMD_Other { get; set; } /// <summary> /// Item Description /// </summary> [EdiSegment, EdiPath("IMD")] public class IMD { [EdiValue(Path = "IMD/0")] public string FieldA { get; set; } [EdiValue(Path = "IMD/1")] public string FieldB { get; set; } [EdiValue(Path = "IMD/2")] public string FieldC { get; set; } } } }
Fix failing test ORDRSP after change on Condition stacking behavior
Fix failing test ORDRSP after change on Condition stacking behavior
C#
mit
indice-co/EDI.Net
92b13471b506b29341d0aef73c52d635e59a6220
Thinktecture.Relay.OnPremiseConnectorService/Program.cs
Thinktecture.Relay.OnPremiseConnectorService/Program.cs
using System; using System.Diagnostics; using Serilog; using Topshelf; namespace Thinktecture.Relay.OnPremiseConnectorService { internal static class Program { private static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .ReadFrom.AppSettings() .CreateLogger(); try { HostFactory.Run(config => { config.UseSerilog(); config.Service<OnPremisesService>(settings => { settings.ConstructUsing(_ => new OnPremisesService()); settings.WhenStarted(async s => await s.StartAsync().ConfigureAwait(false)); settings.WhenStopped(s => s.Stop()); }); config.RunAsNetworkService(); config.SetDescription("Thinktecture Relay OnPremises Service"); config.SetDisplayName("Thinktecture Relay OnPremises Service"); config.SetServiceName("TTRelayOnPremisesService"); }); } catch (Exception ex) { Log.Logger.Fatal(ex, "Service crashed"); } finally { Log.CloseAndFlush(); } Log.CloseAndFlush(); #if DEBUG if (Debugger.IsAttached) { // ReSharper disable once LocalizableElement Console.WriteLine("\nPress any key to close application window..."); Console.ReadKey(true); } #endif } } }
using System; using System.Diagnostics; using Serilog; using Topshelf; namespace Thinktecture.Relay.OnPremiseConnectorService { internal static class Program { private static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .ReadFrom.AppSettings() .CreateLogger(); try { HostFactory.Run(config => { config.UseSerilog(); config.EnableShutdown(); config.Service<OnPremisesService>(settings => { settings.ConstructUsing(_ => new OnPremisesService()); settings.WhenStarted(async s => await s.StartAsync().ConfigureAwait(false)); settings.WhenStopped(s => s.Stop()); settings.WhenShutdown(s => s.Stop()); }); config.RunAsNetworkService(); config.SetDescription("Thinktecture Relay OnPremises Service"); config.SetDisplayName("Thinktecture Relay OnPremises Service"); config.SetServiceName("TTRelayOnPremisesService"); }); } catch (Exception ex) { Log.Logger.Fatal(ex, "Service crashed"); } finally { Log.CloseAndFlush(); } Log.CloseAndFlush(); #if DEBUG if (Debugger.IsAttached) { // ReSharper disable once LocalizableElement Console.WriteLine("\nPress any key to close application window..."); Console.ReadKey(true); } #endif } } }
Make sure that On-Premise Connector cleans up on Windows shutdown
Make sure that On-Premise Connector cleans up on Windows shutdown
C#
bsd-3-clause
thinktecture/relayserver,jasminsehic/relayserver,jasminsehic/relayserver,jasminsehic/relayserver,thinktecture/relayserver,thinktecture/relayserver
54de1ce949994cad98a77d07cd909f72b213712f
Assets/SuriyunUnityIAP/Scripts/Network/Messages/IAPNetworkMessageId.cs
Assets/SuriyunUnityIAP/Scripts/Network/Messages/IAPNetworkMessageId.cs
namespace Suriyun.UnityIAP { public class IAPNetworkMessageId { public const short ToServerBuyProductMsgId = 3000; public const short ToServerRequestProducts = 3001; public const short ToClientResponseProducts = 3002; } }
using UnityEngine.Networking; namespace Suriyun.UnityIAP { public class IAPNetworkMessageId { // Developer can changes these Ids to avoid hacking while hosting public const short ToServerBuyProductMsgId = MsgType.Highest + 201; public const short ToServerRequestProducts = MsgType.Highest + 202; public const short ToClientResponseProducts = MsgType.Highest + 203; } }
Set message id by official's highest
Set message id by official's highest
C#
mit
insthync/suriyun-unity-iap
24b314b51f9c5c28be61b09fa6f56558c03c8100
osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteMask.cs
osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteMask.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Graphics; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces; using OpenTK.Graphics; namespace osu.Game.Rulesets.Mania.Edit.Layers.Selection.Overlays { public class HoldNoteMask : HitObjectMask { private readonly BodyPiece body; public HoldNoteMask(DrawableHoldNote hold) : base(hold) { Position = hold.Position; var holdObject = hold.HitObject; InternalChildren = new Drawable[] { new NoteMask(hold.Head), new NoteMask(hold.Tail), body = new BodyPiece { AccentColour = Color4.Transparent }, }; holdObject.ColumnChanged += _ => Position = hold.Position; } [BackgroundDependencyLoader] private void load(OsuColour colours) { body.BorderColour = colours.Yellow; } } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Graphics; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces; using OpenTK.Graphics; namespace osu.Game.Rulesets.Mania.Edit.Layers.Selection.Overlays { public class HoldNoteMask : HitObjectMask { private readonly BodyPiece body; public HoldNoteMask(DrawableHoldNote hold) : base(hold) { var holdObject = hold.HitObject; InternalChildren = new Drawable[] { new HoldNoteNoteMask(hold.Head), new HoldNoteNoteMask(hold.Tail), body = new BodyPiece { AccentColour = Color4.Transparent }, }; holdObject.ColumnChanged += _ => Position = hold.Position; } [BackgroundDependencyLoader] private void load(OsuColour colours) { body.BorderColour = colours.Yellow; } protected override void Update() { base.Update(); Size = HitObject.DrawSize; Position = Parent.ToLocalSpace(HitObject.ScreenSpaceDrawQuad.TopLeft); } private class HoldNoteNoteMask : NoteMask { public HoldNoteNoteMask(DrawableNote note) : base(note) { Select(); } protected override void Update() { base.Update(); Position = HitObject.DrawPosition; } } } }
Fix hold note masks not working
Fix hold note masks not working
C#
mit
ZLima12/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu,ppy/osu,johnneijzen/osu,smoogipoo/osu,ppy/osu,EVAST9919/osu,EVAST9919/osu,smoogipoo/osu,DrabWeb/osu,DrabWeb/osu,NeoAdonis/osu,NeoAdonis/osu,ZLima12/osu,naoey/osu,UselessToucan/osu,peppy/osu-new,naoey/osu,naoey/osu,DrabWeb/osu,peppy/osu,ppy/osu,2yangk23/osu,smoogipooo/osu,UselessToucan/osu,2yangk23/osu,johnneijzen/osu
61e9ee28d2264087205303b15de69d0de1068ea9
src/Defs/MainButtonWorkerToggleWorld.cs
src/Defs/MainButtonWorkerToggleWorld.cs
using RimWorld; using Verse; namespace PrepareLanding.Defs { /// <summary> /// This class is called from a definition file when clicking the "World" button on the bottom menu bar while playing /// (see "PrepareLanding/Defs/Misc/MainButtonDefs/MainButtons.xml"). /// </summary> public class MainButtonWorkerToggleWorld : MainButtonWorker_ToggleWorld { public override void Activate() { // default behavior base.Activate(); // do not show the main window if in tutorial mode if (TutorSystem.TutorialMode) { Log.Message( "[PrepareLanding] MainButtonWorkerToggleWorld: Tutorial mode detected: not showing main window."); return; } // show the main window, minimized. PrepareLanding.Instance.MainWindow.Show(true); } } }
using RimWorld; using Verse; namespace PrepareLanding.Defs { /// <summary> /// This class is called from a definition file when clicking the "World" button on the bottom menu bar while playing /// (see "PrepareLanding/Defs/Misc/MainButtonDefs/MainButtons.xml"). /// </summary> public class MainButtonWorkerToggleWorld : MainButtonWorker_ToggleWorld { public override void Activate() { // default behavior (go to the world map) base.Activate(); // do not show the main window if in tutorial mode if (TutorSystem.TutorialMode) { Log.Message( "[PrepareLanding] MainButtonWorkerToggleWorld: Tutorial mode detected: not showing main window."); return; } // don't add a new window if the window is already there; if it's not create a new one. if (PrepareLanding.Instance.MainWindow == null) PrepareLanding.Instance.MainWindow = new MainWindow(PrepareLanding.Instance.GameData); // show the main window, minimized. PrepareLanding.Instance.MainWindow.Show(true); } } }
Fix bug where window instance was null on world map.
Fix bug where window instance was null on world map.
C#
mit
neitsa/PrepareLanding,neitsa/PrepareLanding
9e17eb234223e2b9869b159f675f3466336b54b2
osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs
osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Configuration; namespace osu.Game.Overlays.Settings.Sections.Gameplay { public class GeneralSettings : SettingsSubsection { protected override string Header => "General"; [BackgroundDependencyLoader] private void load(OsuConfigManager config) { Children = new Drawable[] { new SettingsSlider<double> { LabelText = "Background dim", Bindable = config.GetBindable<double>(OsuSetting.DimLevel), KeyboardStep = 0.1f }, new SettingsSlider<double> { LabelText = "Background blur", Bindable = config.GetBindable<double>(OsuSetting.BlurLevel), KeyboardStep = 0.1f }, new SettingsCheckbox { LabelText = "Show score overlay", Bindable = config.GetBindable<bool>(OsuSetting.ShowInterface) }, new SettingsCheckbox { LabelText = "Always show key overlay", Bindable = config.GetBindable<bool>(OsuSetting.KeyOverlay) }, new SettingsCheckbox { LabelText = "Show approach circle on first \"Hidden\" object", Bindable = config.GetBindable<bool>(OsuSetting.IncreaseFirstObjectVisibility) }, }; } } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Configuration; namespace osu.Game.Overlays.Settings.Sections.Gameplay { public class GeneralSettings : SettingsSubsection { protected override string Header => "General"; [BackgroundDependencyLoader] private void load(OsuConfigManager config) { Children = new Drawable[] { new SettingsSlider<double> { LabelText = "Background dim", Bindable = config.GetBindable<double>(OsuSetting.DimLevel), KeyboardStep = 0.1f }, new SettingsSlider<double> { LabelText = "Background blur", Bindable = config.GetBindable<double>(OsuSetting.BlurLevel), KeyboardStep = 0.1f }, new SettingsCheckbox { LabelText = "Show score overlay", Bindable = config.GetBindable<bool>(OsuSetting.ShowInterface) }, new SettingsCheckbox { LabelText = "Always show key overlay", Bindable = config.GetBindable<bool>(OsuSetting.KeyOverlay) }, new SettingsCheckbox { LabelText = "Increase visibility of first object with \"Hidden\" mod", Bindable = config.GetBindable<bool>(OsuSetting.IncreaseFirstObjectVisibility) }, }; } } }
Reword settings text to be ruleset agnostic
Reword settings text to be ruleset agnostic
C#
mit
NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu-new,DrabWeb/osu,UselessToucan/osu,ZLima12/osu,johnneijzen/osu,naoey/osu,2yangk23/osu,ppy/osu,EVAST9919/osu,2yangk23/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu,UselessToucan/osu,naoey/osu,peppy/osu,naoey/osu,smoogipooo/osu,DrabWeb/osu,EVAST9919/osu,peppy/osu,peppy/osu,smoogipoo/osu,johnneijzen/osu,DrabWeb/osu,ZLima12/osu,UselessToucan/osu
cafd8e476324c494d2f257a68e02b250dcb1e6e7
src/Mirage.Urbanization.Simulation/Persistence/PersistedCityStatisticsCollection.cs
src/Mirage.Urbanization.Simulation/Persistence/PersistedCityStatisticsCollection.cs
using System.Collections.Generic; using System.Linq; using Mirage.Urbanization.ZoneStatisticsQuerying; using System.Collections.Immutable; namespace Mirage.Urbanization.Simulation.Persistence { public class PersistedCityStatisticsCollection { private ImmutableQueue<PersistedCityStatisticsWithFinancialData> _persistedCityStatistics = ImmutableQueue<PersistedCityStatisticsWithFinancialData>.Empty; private PersistedCityStatisticsWithFinancialData _mostRecentStatistics; public void Add(PersistedCityStatisticsWithFinancialData statistics) { _persistedCityStatistics = _persistedCityStatistics.Enqueue(statistics); if (_persistedCityStatistics.Count() > 5200) _persistedCityStatistics = _persistedCityStatistics.Dequeue(); _mostRecentStatistics = statistics; } public QueryResult<PersistedCityStatisticsWithFinancialData> GetMostRecentPersistedCityStatistics() { return QueryResult<PersistedCityStatisticsWithFinancialData>.Create(_mostRecentStatistics); } public IEnumerable<PersistedCityStatisticsWithFinancialData> GetAll() { return _persistedCityStatistics; } } }
using System.Collections.Generic; using System.Linq; using Mirage.Urbanization.ZoneStatisticsQuerying; using System.Collections.Immutable; namespace Mirage.Urbanization.Simulation.Persistence { public class PersistedCityStatisticsCollection { private ImmutableQueue<PersistedCityStatisticsWithFinancialData> _persistedCityStatistics = ImmutableQueue<PersistedCityStatisticsWithFinancialData>.Empty; private PersistedCityStatisticsWithFinancialData _mostRecentStatistics; public void Add(PersistedCityStatisticsWithFinancialData statistics) { _persistedCityStatistics = _persistedCityStatistics.Enqueue(statistics); if (_persistedCityStatistics.Count() > 960) _persistedCityStatistics = _persistedCityStatistics.Dequeue(); _mostRecentStatistics = statistics; } public QueryResult<PersistedCityStatisticsWithFinancialData> GetMostRecentPersistedCityStatistics() { return QueryResult<PersistedCityStatisticsWithFinancialData>.Create(_mostRecentStatistics); } public IEnumerable<PersistedCityStatisticsWithFinancialData> GetAll() { return _persistedCityStatistics; } } }
Reduce the amount of persisted city statistics
Reduce the amount of persisted city statistics
C#
mit
Miragecoder/Urbanization,Miragecoder/Urbanization,Miragecoder/Urbanization
3cf162f6f047ef0e8c731d6297a7e3d71f6304f8
src/FlaUI.Core/AutomationElements/PatternElements/ExpandCollapseAutomationElement.cs
src/FlaUI.Core/AutomationElements/PatternElements/ExpandCollapseAutomationElement.cs
using FlaUI.Core.Definitions; using FlaUI.Core.Patterns; namespace FlaUI.Core.AutomationElements.PatternElements { /// <summary> /// An element that supports the <see cref="IExpandCollapsePattern"/>. /// </summary> public class ExpandCollapseAutomationElement : AutomationElement { public ExpandCollapseAutomationElement(FrameworkAutomationElementBase frameworkAutomationElement) : base(frameworkAutomationElement) { } public IExpandCollapsePattern ExpandCollapsePattern => Patterns.ExpandCollapse.Pattern; /// <summary> /// Gets the current expand / collapse state. /// </summary> public ExpandCollapseState ExpandCollapseState => ExpandCollapsePattern.ExpandCollapseState; /// <summary> /// Expands the element. /// </summary> public void Expand() { ExpandCollapsePattern.Expand(); } /// <summary> /// Collapses the element. /// </summary> public void Collapse() { ExpandCollapsePattern.Expand(); } } }
using FlaUI.Core.Definitions; using FlaUI.Core.Patterns; namespace FlaUI.Core.AutomationElements.PatternElements { /// <summary> /// An element that supports the <see cref="IExpandCollapsePattern"/>. /// </summary> public class ExpandCollapseAutomationElement : AutomationElement { public ExpandCollapseAutomationElement(FrameworkAutomationElementBase frameworkAutomationElement) : base(frameworkAutomationElement) { } public IExpandCollapsePattern ExpandCollapsePattern => Patterns.ExpandCollapse.Pattern; /// <summary> /// Gets the current expand / collapse state. /// </summary> public ExpandCollapseState ExpandCollapseState => ExpandCollapsePattern.ExpandCollapseState; /// <summary> /// Expands the element. /// </summary> public void Expand() { ExpandCollapsePattern.Expand(); } /// <summary> /// Collapses the element. /// </summary> public void Collapse() { ExpandCollapsePattern.Collapse(); } } }
Switch Collapse function to correctly call the Collapse function of the expand pattern
Switch Collapse function to correctly call the Collapse function of the expand pattern
C#
mit
Roemer/FlaUI
3ad10ec2cc94751dd323aba665a9f633fc8f685c
src/Core/Services/Crosspost/TelegramCrosspostService.cs
src/Core/Services/Crosspost/TelegramCrosspostService.cs
using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using Core.Logging; using DAL; using Serilog.Events; using Telegram.Bot; namespace Core.Services.Crosspost { public class TelegramCrosspostService : ICrossPostService { private readonly Core.Logging.ILogger _logger; private readonly string _token; private readonly string _name; public TelegramCrosspostService(string token, string name, ILogger logger) { _logger = logger; _token = token; _name = name; } public async Task Send(string message, Uri link, IReadOnlyCollection<string> tags) { var sb = new StringBuilder(); sb.Append(message); sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); sb.Append(link); sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); sb.Append(string.Join(", ", tags)); try { var bot = new TelegramBotClient(_token); await bot.SendTextMessageAsync(_name, sb.ToString()); _logger.Write(LogEventLevel.Information, $"Message was sent to Telegram channel `{_name}`: `{sb}`"); } catch (Exception ex) { _logger.Write(LogEventLevel.Error, $"Error during send message to Telegram: `{sb}`", ex); } } } }
using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using Core.Logging; using DAL; using Serilog.Events; using Telegram.Bot; namespace Core.Services.Crosspost { public class TelegramCrosspostService : ICrossPostService { private readonly Core.Logging.ILogger _logger; private readonly string _token; private readonly string _name; public TelegramCrosspostService(string token, string name, ILogger logger) { _logger = logger; _token = token; _name = name; } public async Task Send(string message, Uri link, IReadOnlyCollection<string> tags) { var sb = new StringBuilder(); sb.Append(message); sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); sb.Append(link); sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); sb.Append(string.Join(" ", tags)); try { var bot = new TelegramBotClient(_token); await bot.SendTextMessageAsync(_name, sb.ToString()); _logger.Write(LogEventLevel.Information, $"Message was sent to Telegram channel `{_name}`: `{sb}`"); } catch (Exception ex) { _logger.Write(LogEventLevel.Error, $"Error during send message to Telegram: `{sb}`", ex); } } } }
Fix tag line for Telegram
Fix tag line for Telegram
C#
mit
dncuug/dot-net.in.ua,dncuug/dot-net.in.ua,dncuug/dot-net.in.ua
c27a0cbb6fdda17cf9c49acc56a724b120fd9528
src/OmniSharp.DotNetTest/Helpers/ProjectPathResolver.cs
src/OmniSharp.DotNetTest/Helpers/ProjectPathResolver.cs
using System.IO; namespace OmniSharp.DotNetTest.Helpers { internal class ProjectPathResolver { public static string GetProjectPathFromFile(string filepath) { // TODO: revisit this logic, too clumsy var projectFolder = Path.GetDirectoryName(filepath); while (!File.Exists(Path.Combine(projectFolder, "project.json"))) { var parent = Path.GetDirectoryName(filepath); if (parent == projectFolder) { break; } else { projectFolder = parent; } } return projectFolder; } } }
using System.IO; namespace OmniSharp.DotNetTest.Helpers { internal class ProjectPathResolver { public static string GetProjectPathFromFile(string filepath) { // TODO: revisit this logic, too clumsy var projectFolder = Path.GetDirectoryName(filepath); while (!File.Exists(Path.Combine(projectFolder, "project.json"))) { var parent = Path.GetDirectoryName(projectFolder); if (parent == projectFolder) { break; } else { projectFolder = parent; } } return projectFolder; } } }
Fix incorrect project path resolver
Fix incorrect project path resolver
C#
mit
DustinCampbell/omnisharp-roslyn,jtbm37/omnisharp-roslyn,DustinCampbell/omnisharp-roslyn,jtbm37/omnisharp-roslyn,OmniSharp/omnisharp-roslyn,nabychan/omnisharp-roslyn,nabychan/omnisharp-roslyn,OmniSharp/omnisharp-roslyn
2b1c5b2c4a11ffbafbf3fb0361647527de2baaac
osu.Game.Tests/Visual/Gameplay/SkinnableHUDComponentTestScene.cs
osu.Game.Tests/Visual/Gameplay/SkinnableHUDComponentTestScene.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using NUnit.Framework; using osu.Framework.Graphics; using osu.Game.Rulesets; using osu.Game.Rulesets.Osu; namespace osu.Game.Tests.Visual.Gameplay { public abstract class SkinnableHUDComponentTestScene : SkinnableTestScene { protected override Ruleset CreateRulesetForSkinProvider() => new OsuRuleset(); [SetUp] public void SetUp() => Schedule(() => { SetContents(skin => { var implementation = skin != null ? CreateLegacyImplementation() : CreateDefaultImplementation(); implementation.Anchor = Anchor.Centre; implementation.Origin = Anchor.Centre; return implementation; }); }); protected abstract Drawable CreateDefaultImplementation(); protected abstract Drawable CreateLegacyImplementation(); } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using NUnit.Framework; using osu.Framework.Graphics; using osu.Game.Rulesets; using osu.Game.Rulesets.Osu; using osu.Game.Skinning; namespace osu.Game.Tests.Visual.Gameplay { public abstract class SkinnableHUDComponentTestScene : SkinnableTestScene { protected override Ruleset CreateRulesetForSkinProvider() => new OsuRuleset(); [SetUp] public void SetUp() => Schedule(() => { SetContents(skin => { var implementation = skin is not TrianglesSkin ? CreateLegacyImplementation() : CreateDefaultImplementation(); implementation.Anchor = Anchor.Centre; implementation.Origin = Anchor.Centre; return implementation; }); }); protected abstract Drawable CreateDefaultImplementation(); protected abstract Drawable CreateLegacyImplementation(); } }
Fix test failure due to triangle skin no longer being null intests
Fix test failure due to triangle skin no longer being null intests
C#
mit
peppy/osu,peppy/osu,ppy/osu,ppy/osu,peppy/osu,ppy/osu
44212f6b534f75cb4ad937dde474652a72454902
src/Umbraco.Web/Models/Mapping/RedirectUrlMapperProfile.cs
src/Umbraco.Web/Models/Mapping/RedirectUrlMapperProfile.cs
using AutoMapper; using Umbraco.Core.Models; using Umbraco.Web.Composing; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Routing; namespace Umbraco.Web.Models.Mapping { internal class RedirectUrlMapperProfile : Profile { public RedirectUrlMapperProfile(IUmbracoContextAccessor umbracoContextAccessor) { CreateMap<IRedirectUrl, ContentRedirectUrl>() .ForMember(x => x.OriginalUrl, expression => expression.MapFrom(item => Current.UmbracoContext.UrlProvider.GetUrlFromRoute(item.ContentId, item.Url, item.Culture))) .ForMember(x => x.DestinationUrl, expression => expression.MapFrom(item => item.ContentId > 0 ? GetUrl(umbracoContextAccessor, item) : "#")) .ForMember(x => x.RedirectId, expression => expression.MapFrom(item => item.Key)); } private static string GetUrl(IUmbracoContextAccessor umbracoContextAccessor, IRedirectUrl item) => umbracoContextAccessor?.UmbracoContext?.UrlProvider?.GetUrl(item.ContentId, item.Culture); } }
using AutoMapper; using Umbraco.Core.Models; using Umbraco.Web.Composing; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Routing; namespace Umbraco.Web.Models.Mapping { internal class RedirectUrlMapperProfile : Profile { public RedirectUrlMapperProfile(IUmbracoContextAccessor umbracoContextAccessor) { CreateMap<IRedirectUrl, ContentRedirectUrl>() .ForMember(x => x.OriginalUrl, expression => expression.MapFrom(item => Current.UmbracoContext.UrlProvider.GetUrlFromRoute(item.ContentId, item.Url, item.Culture))) .ForMember(x => x.DestinationUrl, expression => expression.MapFrom(item => item.ContentId > 0 ? GetUrl(umbracoContextAccessor, item) : "#")) .ForMember(x => x.RedirectId, expression => expression.MapFrom(item => item.Key)); } private static string GetUrl(IUmbracoContextAccessor umbracoContextAccessor, IRedirectUrl item) => umbracoContextAccessor?.UmbracoContext?.UrlProvider?.GetUrl(item.Id, item.Culture); } }
Revert "the wrong id was used for getting the correct destination url."
Revert "the wrong id was used for getting the correct destination url." This reverts commit 5d1fccb2c426349fae9523084949b6af60532581.
C#
mit
tcmorris/Umbraco-CMS,marcemarc/Umbraco-CMS,abjerner/Umbraco-CMS,KevinJump/Umbraco-CMS,hfloyd/Umbraco-CMS,hfloyd/Umbraco-CMS,marcemarc/Umbraco-CMS,abjerner/Umbraco-CMS,KevinJump/Umbraco-CMS,leekelleher/Umbraco-CMS,marcemarc/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,bjarnef/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,leekelleher/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,hfloyd/Umbraco-CMS,bjarnef/Umbraco-CMS,NikRimington/Umbraco-CMS,tcmorris/Umbraco-CMS,dawoe/Umbraco-CMS,bjarnef/Umbraco-CMS,rasmuseeg/Umbraco-CMS,leekelleher/Umbraco-CMS,KevinJump/Umbraco-CMS,tcmorris/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,madsoulswe/Umbraco-CMS,abryukhov/Umbraco-CMS,dawoe/Umbraco-CMS,abryukhov/Umbraco-CMS,leekelleher/Umbraco-CMS,dawoe/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abryukhov/Umbraco-CMS,tcmorris/Umbraco-CMS,madsoulswe/Umbraco-CMS,NikRimington/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,madsoulswe/Umbraco-CMS,arknu/Umbraco-CMS,hfloyd/Umbraco-CMS,mattbrailsford/Umbraco-CMS,hfloyd/Umbraco-CMS,tcmorris/Umbraco-CMS,abjerner/Umbraco-CMS,robertjf/Umbraco-CMS,arknu/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abryukhov/Umbraco-CMS,arknu/Umbraco-CMS,KevinJump/Umbraco-CMS,leekelleher/Umbraco-CMS,rasmuseeg/Umbraco-CMS,bjarnef/Umbraco-CMS,mattbrailsford/Umbraco-CMS,umbraco/Umbraco-CMS,robertjf/Umbraco-CMS,abjerner/Umbraco-CMS,umbraco/Umbraco-CMS,rasmuseeg/Umbraco-CMS,robertjf/Umbraco-CMS,robertjf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,dawoe/Umbraco-CMS,umbraco/Umbraco-CMS,NikRimington/Umbraco-CMS,umbraco/Umbraco-CMS
6fd10d0bf26739a85e9e2d500f2501fff0a4e1eb
CSharpLLVM/Program.cs
CSharpLLVM/Program.cs
using CommandLine; using CSharpLLVM.Compilation; using System.IO; namespace CSharpLLVM { class Program { /// <summary> /// Entrypoint. /// </summary> /// <param name="args">Arguments.</param> static void Main(string[] args) { Options options = new Options(); Parser parser = new Parser(setSettings); if (parser.ParseArguments(args, options)) { string moduleName = Path.GetFileNameWithoutExtension(options.InputFile); Compiler compiler = new Compiler(options); compiler.Compile(moduleName); } } /// <summary> /// Sets the settings. /// </summary> /// <param name="settings">The settings.</param> private static void setSettings(ParserSettings settings) { settings.MutuallyExclusive = true; } } }
using CommandLine; using CSharpLLVM.Compilation; using System; using System.IO; namespace CSharpLLVM { class Program { /// <summary> /// Entrypoint. /// </summary> /// <param name="args">Arguments.</param> static void Main(string[] args) { Options options = new Options(); Parser parser = new Parser(setSettings); if (parser.ParseArguments(args, options)) { string moduleName = Path.GetFileNameWithoutExtension(options.InputFile); Compiler compiler = new Compiler(options); compiler.Compile(moduleName); } else { Console.WriteLine(options.GetUsage()); } } /// <summary> /// Sets the settings. /// </summary> /// <param name="settings">The settings.</param> private static void setSettings(ParserSettings settings) { settings.MutuallyExclusive = true; } } }
Print usage when parsing did not go right.
Print usage when parsing did not go right.
C#
mit
SharpNative/CSharpLLVM,SharpNative/CSharpLLVM
1f0df0080ad69a31d894f738ad60f39e9bd85fca
Snowflake/Ajax/JSResponse.cs
Snowflake/Ajax/JSResponse.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; namespace Snowflake.Ajax { public class JSResponse : IJSResponse { public IJSRequest Request { get; private set; } public dynamic Payload { get; private set; } public bool Success { get; set; } public JSResponse(IJSRequest request, dynamic payload, bool success = true) { this.Request = request; this.Payload = payload; this.Success = success; } public string GetJson() { return JSResponse.ProcessJSONP(this.Payload, this.Success, this.Request); } private static string ProcessJSONP(dynamic output, bool success, IJSRequest request) { if (request.MethodParameters.ContainsKey("jsoncallback")) { return request.MethodParameters["jsoncallback"] + "(" + JsonConvert.SerializeObject(new Dictionary<string, object>(){ {"payload", output}, {"success", success} }) + ");"; } else { return JsonConvert.SerializeObject(new Dictionary<string, object>(){ {"payload", output}, {"success", success} }); } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; namespace Snowflake.Ajax { public class JSResponse : IJSResponse { public IJSRequest Request { get; private set; } public dynamic Payload { get; private set; } public bool Success { get; set; } public JSResponse(IJSRequest request, dynamic payload, bool success = true) { this.Request = request; this.Payload = payload; this.Success = success; } public string GetJson() { return JSResponse.ProcessJSONP(this.Payload, this.Success, this.Request); } private static string ProcessJSONP(dynamic output, bool success, IJSRequest request) { if (request.MethodParameters.ContainsKey("jsoncallback")) { return request.MethodParameters["jsoncallback"] + "(" + JsonConvert.SerializeObject(new Dictionary<string, object>(){ {"request", request}, {"payload", output}, {"success", success}, {"type", "methodresponse"} }) + ");"; } else { return JsonConvert.SerializeObject(new Dictionary<string, object>(){ {"request", request}, {"payload", output}, {"success", success}, {"type", "methodresponse"} }); } } } }
Add request and 'methodresponse' type in JSON body to account for other response types using the WebSocket APIs
JSAPI: Add request and 'methodresponse' type in JSON body to account for other response types using the WebSocket APIs
C#
mpl-2.0
faint32/snowflake-1,SnowflakePowered/snowflake,faint32/snowflake-1,RonnChyran/snowflake,SnowflakePowered/snowflake,RonnChyran/snowflake,SnowflakePowered/snowflake,faint32/snowflake-1,RonnChyran/snowflake
75a80105a1fce0e9c2e72da033dd0abfb93b7368
src/Website/Controllers/HomeController.cs
src/Website/Controllers/HomeController.cs
using System.Web.Mvc; using System.Net; using Newtonsoft.Json; using System.IO; using System.Collections.Generic; using Newtonsoft.Json.Linq; using System.Linq; using System.Web.Caching; using System; namespace Website.Controllers { public class HomeController : Controller { public ActionResult Index() { return View(); } public ActionResult Benefits() { return View(); } public ActionResult Download() { return View(); } public ActionResult Licensing() { return View(); } public ActionResult Support() { return View(); } public ActionResult Contact() { return View(); } public ActionResult Donate() { var contributors = HttpContext.Cache.Get("github.contributors") as IEnumerable<Contributor>; if (contributors == null) { var url = "https://api.github.com/repos/andrewdavey/cassette/contributors"; var client = new WebClient(); var json = client.DownloadString(url); contributors = JsonConvert.DeserializeObject<IEnumerable<Contributor>>(json); HttpContext.Cache.Insert("github.contributors", contributors, null, Cache.NoAbsoluteExpiration, TimeSpan.FromDays(1)); } ViewBag.Contributors = contributors; return View(); } public ActionResult Resources() { return View(); } } public class Contributor { public string avatar_url { get; set; } public string login { get; set; } public string url { get; set; } } }
using System; using System.Collections.Generic; using System.Net; using System.Web.Caching; using System.Web.Mvc; using Newtonsoft.Json; namespace Website.Controllers { public class HomeController : Controller { public ActionResult Index() { return View(); } public ActionResult Benefits() { return View(); } public ActionResult Download() { return View(); } public ActionResult Licensing() { return View(); } public ActionResult Support() { return View(); } public ActionResult Contact() { return View(); } public ActionResult Donate() { var contributors = GetContributors(); ViewBag.Contributors = contributors; return View(); } IEnumerable<Contributor> GetContributors() { const string cacheKey = "github.contributors"; var contributors = HttpContext.Cache.Get(cacheKey) as IEnumerable<Contributor>; if (contributors != null) return contributors; var json = DownoadContributorsJson(); contributors = JsonConvert.DeserializeObject<IEnumerable<Contributor>>(json); HttpContext.Cache.Insert( cacheKey, contributors, null, Cache.NoAbsoluteExpiration, TimeSpan.FromDays(1) ); return contributors; } static string DownoadContributorsJson() { using (var client = new WebClient()) { return client.DownloadString("https://api.github.com/repos/andrewdavey/cassette/contributors"); } } public ActionResult Resources() { return View(); } } public class Contributor { public string avatar_url { get; set; } public string login { get; set; } public string url { get; set; } } }
Tidy up github api calling code
Tidy up github api calling code
C#
mit
andrewdavey/cassette,honestegg/cassette,BluewireTechnologies/cassette,andrewdavey/cassette,honestegg/cassette,BluewireTechnologies/cassette,damiensawyer/cassette,damiensawyer/cassette,andrewdavey/cassette,honestegg/cassette,damiensawyer/cassette
847d08c5bbb958b3df90cd76a3bb927c56c2e35a
SharedAssemblyInfo.cs
SharedAssemblyInfo.cs
using System.Reflection; // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision [assembly: AssemblyVersion("6.1.*")] [assembly: AssemblyFileVersion("6.1.*")]
using System.Reflection; // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision [assembly: AssemblyVersion("6.2.*")] [assembly: AssemblyFileVersion("6.2.*")]
Change version number for breaking change.
Change version number for breaking change.
C#
apache-2.0
digipost/digipost-api-client-dotnet
7d3325b35580c30193f2d1c7c600f267c4320969
src/ResourceManager/Compute/Commands.Compute/Models/AzureDiskEncryptionStatusContext.cs
src/ResourceManager/Compute/Commands.Compute/Models/AzureDiskEncryptionStatusContext.cs
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by 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. // ---------------------------------------------------------------------------------- using Microsoft.Azure.Management.Compute.Models; using Newtonsoft.Json; namespace Microsoft.Azure.Commands.Compute.Models { enum EncryptionStatus { Encrypted, NotEncrypted, NotMounted, EncryptionInProgress, VMRestartPending, Unknown } class AzureDiskEncryptionStatusContext { public EncryptionStatus OsVolumeEncrypted { get; set; } public DiskEncryptionSettings OsVolumeEncryptionSettings { get; set; } public EncryptionStatus DataVolumesEncrypted { get; set; } public string ProgressMessage { get; set; } } }
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by 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. // ---------------------------------------------------------------------------------- using Microsoft.Azure.Management.Compute.Models; using Newtonsoft.Json; namespace Microsoft.Azure.Commands.Compute.Models { enum EncryptionStatus { Encrypted, NotEncrypted, NotMounted, DecryptionInProgress, EncryptionInProgress, VMRestartPending, Unknown } class AzureDiskEncryptionStatusContext { public EncryptionStatus OsVolumeEncrypted { get; set; } public DiskEncryptionSettings OsVolumeEncryptionSettings { get; set; } public EncryptionStatus DataVolumesEncrypted { get; set; } public string ProgressMessage { get; set; } } }
Add DecryptionInProgress for EncryptionStatus enum
Add DecryptionInProgress for EncryptionStatus enum
C#
apache-2.0
jtlibing/azure-powershell,krkhan/azure-powershell,pankajsn/azure-powershell,arcadiahlyy/azure-powershell,AzureRT/azure-powershell,yantang-msft/azure-powershell,hungmai-msft/azure-powershell,nemanja88/azure-powershell,AzureAutomationTeam/azure-powershell,seanbamsft/azure-powershell,AzureAutomationTeam/azure-powershell,devigned/azure-powershell,yoavrubin/azure-powershell,AzureAutomationTeam/azure-powershell,krkhan/azure-powershell,alfantp/azure-powershell,yantang-msft/azure-powershell,ClogenyTechnologies/azure-powershell,hungmai-msft/azure-powershell,yantang-msft/azure-powershell,atpham256/azure-powershell,hungmai-msft/azure-powershell,jtlibing/azure-powershell,zhencui/azure-powershell,atpham256/azure-powershell,devigned/azure-powershell,pankajsn/azure-powershell,pankajsn/azure-powershell,yoavrubin/azure-powershell,nemanja88/azure-powershell,naveedaz/azure-powershell,AzureRT/azure-powershell,AzureAutomationTeam/azure-powershell,naveedaz/azure-powershell,yoavrubin/azure-powershell,jtlibing/azure-powershell,hungmai-msft/azure-powershell,seanbamsft/azure-powershell,AzureRT/azure-powershell,alfantp/azure-powershell,seanbamsft/azure-powershell,ClogenyTechnologies/azure-powershell,naveedaz/azure-powershell,zhencui/azure-powershell,hungmai-msft/azure-powershell,yantang-msft/azure-powershell,jtlibing/azure-powershell,pankajsn/azure-powershell,rohmano/azure-powershell,atpham256/azure-powershell,alfantp/azure-powershell,zhencui/azure-powershell,seanbamsft/azure-powershell,devigned/azure-powershell,devigned/azure-powershell,krkhan/azure-powershell,naveedaz/azure-powershell,krkhan/azure-powershell,arcadiahlyy/azure-powershell,yantang-msft/azure-powershell,seanbamsft/azure-powershell,rohmano/azure-powershell,arcadiahlyy/azure-powershell,yoavrubin/azure-powershell,rohmano/azure-powershell,devigned/azure-powershell,zhencui/azure-powershell,ClogenyTechnologies/azure-powershell,naveedaz/azure-powershell,atpham256/azure-powershell,atpham256/azure-powershell,AzureAutomationTeam/azure-powershell,AzureRT/azure-powershell,zhencui/azure-powershell,krkhan/azure-powershell,alfantp/azure-powershell,nemanja88/azure-powershell,arcadiahlyy/azure-powershell,zhencui/azure-powershell,ClogenyTechnologies/azure-powershell,yoavrubin/azure-powershell,nemanja88/azure-powershell,alfantp/azure-powershell,hungmai-msft/azure-powershell,pankajsn/azure-powershell,rohmano/azure-powershell,jtlibing/azure-powershell,pankajsn/azure-powershell,AzureRT/azure-powershell,atpham256/azure-powershell,AzureRT/azure-powershell,rohmano/azure-powershell,ClogenyTechnologies/azure-powershell,naveedaz/azure-powershell,seanbamsft/azure-powershell,yantang-msft/azure-powershell,nemanja88/azure-powershell,devigned/azure-powershell,AzureAutomationTeam/azure-powershell,rohmano/azure-powershell,krkhan/azure-powershell,arcadiahlyy/azure-powershell
c9be768be36aa319c0f01fc89b9f8d651c50cedd
CkanDotNet.Web/Views/Shared/_Rating.cshtml
CkanDotNet.Web/Views/Shared/_Rating.cshtml
@using CkanDotNet.Api.Model @using CkanDotNet.Web.Models @using CkanDotNet.Web.Models.Helpers @model Package @{ bool editable = Convert.ToBoolean(ViewData["editable"]); string ratingId = GuidHelper.GetUniqueKey(16); } @if (Model.RatingsAverage.HasValue || editable) { <div id="@ratingId" class="rating"> @{ int rating = 0; if (Model.RatingsAverage.HasValue) { rating = (int)Math.Round(Model.RatingsAverage.Value); } } @for (int i = 1; i <= 5; i++) { @Html.RadioButton("newrate", i, rating == i) } </div> <span class="rating-response"></span> } <script language="javascript"> $("#@(ratingId)").stars({ oneVoteOnly: true, @if (!editable) { @:disabled: true, } callback: function(ui, type, value){ var url = "http://@SettingsHelper.GetRepositoryHost()/package/rate/@Model.Name?rating=" + value; $("#@(ratingId)_iframe").get(0).src = url; $(".rating-response").text("Thanks for your rating!"); } }); </script> @if (editable) { <iframe id="@(ratingId)_iframe" width="0" height="0" frameborder="0" src=""></iframe> }
@using CkanDotNet.Api.Model @using CkanDotNet.Web.Models @using CkanDotNet.Web.Models.Helpers @model Package @{ bool editable = Convert.ToBoolean(ViewData["editable"]); string ratingId = GuidHelper.GetUniqueKey(16); } @if (Model.RatingsAverage.HasValue || editable) { <div id="@ratingId" class="rating"> @{ int rating = 0; if (Model.RatingsAverage.HasValue) { rating = (int)Math.Round(Model.RatingsAverage.Value); } } @for (int i = 1; i <= 5; i++) { @Html.RadioButton("newrate", i, rating == i) } </div> <span class="rating-response"></span> } <script language="javascript"> $("#@(ratingId)").stars({ oneVoteOnly: true, @if (!editable) { @:disabled: true, } callback: function(ui, type, value){ var url = "http://@SettingsHelper.GetRepositoryHost()/package/rate/@Model.Name?rating=" + value; $("#@(ratingId)_iframe").get(0).src = url; $(".rating-response").text("Thanks for your rating!"); // Track the rating event in analytics debugger; _gaq.push([ '_trackEvent', 'Package:@Model.Name', 'Rate', value, value]); } }); </script> @if (editable) { <iframe id="@(ratingId)_iframe" width="0" height="0" frameborder="0" src=""></iframe> }
Add analytics event for package rate
Add analytics event for package rate Record and event when a user submits a package rating.
C#
apache-2.0
opencolorado/.NET-Wrapper-for-CKAN-API,opencolorado/.NET-Wrapper-for-CKAN-API,opencolorado/.NET-Wrapper-for-CKAN-API,DenverDev/.NET-Wrapper-for-CKAN-API,DenverDev/.NET-Wrapper-for-CKAN-API
d8a906b448fe9f56163b4a3c4797b5019f3baa2f
EndlessClient/UIControls/StatusBarLabel.cs
EndlessClient/UIControls/StatusBarLabel.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.HUD; using EOLib; using Microsoft.Xna.Framework; using XNAControls; namespace EndlessClient.UIControls { public class StatusBarLabel : XNALabel { private const int STATUS_LABEL_DISPLAY_TIME_MS = 3000; private readonly IStatusLabelTextProvider _statusLabelTextProvider; public StatusBarLabel(IClientWindowSizeProvider clientWindowSizeProvider, IStatusLabelTextProvider statusLabelTextProvider) : base(GetPositionBasedOnWindowSize(clientWindowSizeProvider), Constants.FontSize07) { _statusLabelTextProvider = statusLabelTextProvider; } public override void Update(GameTime gameTime) { if (Text != _statusLabelTextProvider.StatusText) { Text = _statusLabelTextProvider.StatusText; Visible = true; } if ((DateTime.Now - _statusLabelTextProvider.SetTime).TotalMilliseconds > STATUS_LABEL_DISPLAY_TIME_MS) Visible = false; base.Update(gameTime); } private static Rectangle GetPositionBasedOnWindowSize(IClientWindowSizeProvider clientWindowSizeProvider) { return new Rectangle(97, clientWindowSizeProvider.Height - 25, 1, 1); } } }
// 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.HUD; using EOLib; using Microsoft.Xna.Framework; using XNAControls; namespace EndlessClient.UIControls { public class StatusBarLabel : XNALabel { private const int STATUS_LABEL_DISPLAY_TIME_MS = 3000; private readonly IStatusLabelTextProvider _statusLabelTextProvider; private readonly bool _constructed; public StatusBarLabel(IClientWindowSizeProvider clientWindowSizeProvider, IStatusLabelTextProvider statusLabelTextProvider) : base(GetPositionBasedOnWindowSize(clientWindowSizeProvider), Constants.FontSize07) { _statusLabelTextProvider = statusLabelTextProvider; _constructed = true; } public override void Update(GameTime gameTime) { if (!_constructed) return; if (Text != _statusLabelTextProvider.StatusText) { Text = _statusLabelTextProvider.StatusText; Visible = true; } if ((DateTime.Now - _statusLabelTextProvider.SetTime).TotalMilliseconds > STATUS_LABEL_DISPLAY_TIME_MS) Visible = false; base.Update(gameTime); } private static Rectangle GetPositionBasedOnWindowSize(IClientWindowSizeProvider clientWindowSizeProvider) { return new Rectangle(97, clientWindowSizeProvider.Height - 25, 1, 1); } } }
Check if status label is constructed before executing update
Check if status label is constructed before executing update Fixes weird race condition where sometimes Update() will throw a NullReferenceException because the status bar label is still being constructed but has already been added to the game's components.
C#
mit
ethanmoffat/EndlessClient
0034c7a8eef8928961a70c3cf219a99a78167267
WCF/Shared/Implementation/WcfExtensions.cs
WCF/Shared/Implementation/WcfExtensions.cs
using System; using System.ServiceModel.Channels; namespace Microsoft.ApplicationInsights.Wcf.Implementation { internal static class WcfExtensions { public static HttpRequestMessageProperty GetHttpRequestHeaders(this IOperationContext operation) { if ( operation.HasIncomingMessageProperty(HttpRequestMessageProperty.Name) ) { return (HttpRequestMessageProperty)operation.GetIncomingMessageProperty(HttpRequestMessageProperty.Name); } return null; } public static HttpResponseMessageProperty GetHttpResponseHeaders(this IOperationContext operation) { if ( operation.HasOutgoingMessageProperty(HttpResponseMessageProperty.Name) ) { return (HttpResponseMessageProperty)operation.GetOutgoingMessageProperty(HttpResponseMessageProperty.Name); } return null; } } }
using System; using System.ServiceModel.Channels; namespace Microsoft.ApplicationInsights.Wcf.Implementation { internal static class WcfExtensions { public static HttpRequestMessageProperty GetHttpRequestHeaders(this IOperationContext operation) { try { if ( operation.HasIncomingMessageProperty(HttpRequestMessageProperty.Name) ) { return (HttpRequestMessageProperty)operation.GetIncomingMessageProperty(HttpRequestMessageProperty.Name); } } catch ( ObjectDisposedException ) { // WCF message is already disposed, just avoid it } return null; } public static HttpResponseMessageProperty GetHttpResponseHeaders(this IOperationContext operation) { try { if ( operation.HasOutgoingMessageProperty(HttpResponseMessageProperty.Name) ) { return (HttpResponseMessageProperty)operation.GetOutgoingMessageProperty(HttpResponseMessageProperty.Name); } } catch ( ObjectDisposedException ) { // WCF message is already disposed, just avoid it } return null; } } }
Handle ObjectDisposedException just in case we do end up trying to read properties of a closed message
Handle ObjectDisposedException just in case we do end up trying to read properties of a closed message
C#
mit
Microsoft/ApplicationInsights-SDK-Labs
cb1e88d26fab2a7472ac051543540ed801adf299
HashtagBot/Arf.Console/Program.cs
HashtagBot/Arf.Console/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Arf.Services; using Microsoft.ProjectOxford.Vision.Contract; namespace Arf.Console { class Program { public static bool IsProcessing; public static void Main(string[] args) { System.Console.ForegroundColor = ConsoleColor.Yellow; System.Console.WriteLine("Please write image Url or local path"); while (true) { if (IsProcessing) continue; System.Console.ResetColor(); var imgPath = System.Console.ReadLine(); Run(imgPath); System.Console.ForegroundColor = ConsoleColor.DarkGray; System.Console.WriteLine("It takes a few time.Please wait!"); System.Console.ResetColor(); } } public static async void Run(string imgPath) { IsProcessing = true; var isUpload = imgPath != null && !imgPath.StartsWith("http"); var service = new VisionService(); var analysisResult = isUpload ? await service.UploadAndDescripteImage(imgPath) : await service.DescripteUrl(imgPath); System.Console.ForegroundColor = ConsoleColor.DarkGreen; System.Console.WriteLine(string.Join(" ", analysisResult.Description.Tags.Select(s => s = "#" + s))); System.Console.ResetColor(); IsProcessing = false; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Arf.Services; using Microsoft.ProjectOxford.Vision.Contract; namespace Arf.Console { class Program { public static bool IsProcessing; public static void Main(string[] args) { System.Console.ForegroundColor = ConsoleColor.Yellow; System.Console.WriteLine("Please write image Url or local path"); while (true) { if (IsProcessing) continue; System.Console.ResetColor(); var imgPath = System.Console.ReadLine(); Run(imgPath); System.Console.ForegroundColor = ConsoleColor.DarkGray; System.Console.WriteLine("It takes a few time.Please wait!"); System.Console.ResetColor(); } } public static async void Run(string imgPath) { IsProcessing = true; var isUpload = imgPath != null && !imgPath.StartsWith("http"); var service = new VisionService(); var analysisResult = isUpload ? await service.UploadAndDescripteImage(imgPath) : await service.DescripteUrl(imgPath); System.Console.ForegroundColor = ConsoleColor.DarkGreen; System.Console.WriteLine(string.Join(" ", analysisResult.Description.Tags.Select(s => $"#{s}"))); System.Console.ResetColor(); IsProcessing = false; } } }
Test console Run method updated
Test console Run method updated
C#
mit
mecitsem/hashtagbot,mecitsem/hashtagbot,mecitsem/Arf-HashtagBot,mecitsem/hashtagbot,mecitsem/Arf-HashtagBot
f9492a2fe7e398366c0f697e634e01ee95e62141
Server/Log.cs
Server/Log.cs
using System; namespace DarkMultiPlayerServer { public class DarkLog { public static void Debug(string message) { #if DEBUG float currentTime = Server.serverClock.ElapsedMilliseconds / 1000f; Console.WriteLine("[" + currentTime + "] Debug: " + message); #endif } public static void Normal(string message) { float currentTime = Server.serverClock.ElapsedMilliseconds / 1000f; Console.WriteLine("[" + currentTime + "] Normal: " + message); } } }
using System; namespace DarkMultiPlayerServer { public class DarkLog { public static void Debug(string message) { float currentTime = Server.serverClock.ElapsedMilliseconds / 1000f; Console.WriteLine("[" + currentTime + "] Debug: " + message); } public static void Normal(string message) { float currentTime = Server.serverClock.ElapsedMilliseconds / 1000f; Console.WriteLine("[" + currentTime + "] Normal: " + message); } } }
Make debugging output show up on release builds
Make debugging output show up on release builds
C#
mit
godarklight/DarkMultiPlayer,81ninja/DarkMultiPlayer,Dan-Shields/DarkMultiPlayer,rewdmister4/rewd-mod-packs,dsonbill/DarkMultiPlayer,Kerbas-ad-astra/DarkMultiPlayer,Sanmilie/DarkMultiPlayer,RockyTV/DarkMultiPlayer,RockyTV/DarkMultiPlayer,godarklight/DarkMultiPlayer,81ninja/DarkMultiPlayer
843b268c741368779c60ec5f607ca1ffcd4f66e6
CIV/Program.cs
CIV/Program.cs
using static System.Console; using CIV.Ccs; using CIV.Interfaces; namespace CIV { class Program { static void Main(string[] args) { var text = System.IO.File.ReadAllText(args[0]); var processes = CcsFacade.ParseAll(text); var trace = CcsFacade.RandomTrace(processes["Prison"], 450); foreach (var action in trace) { WriteLine(action); } } } }
using static System.Console; using CIV.Ccs; using CIV.Hml; namespace CIV { class Program { static void Main(string[] args) { var text = System.IO.File.ReadAllText(args[0]); var processes = CcsFacade.ParseAll(text); var hmlText = "[[ack]][[ack]][[ack]](<<ack>>tt and [[freeAll]]ff)"; var prova = HmlFacade.ParseAll(hmlText); WriteLine(prova.Check(processes["Prison"])); } } }
Remove RandomTrace stuff from Main
Remove RandomTrace stuff from Main
C#
mit
lou1306/CIV,lou1306/CIV
c9766565616d90b2f4ff5b76a01c06bcae60d877
src/MvcSample/Views/Emails/Example.cshtml
src/MvcSample/Views/Emails/Example.cshtml
To: @Model.To From: example@website.com Reply-To: another@website.com Subject: @Model.Subject @* NOTE: There MUST be a blank like after the headers and before the content. *@ Hello, This email was generated using Postal for asp.net mvc on @Model.Date.ToShortDateString() Message follows: @Model.Message Thanks!
To: @Model.To From: example@website.com Reply-To: another@website.com Subject: @Model.Subject @* NOTE: There MUST be a blank line after the headers and before the content. *@ Hello, This email was generated using Postal for asp.net mvc on @Model.Date.ToShortDateString() Message follows: @Model.Message Thanks!
Fix typo in example comment.
Fix typo in example comment.
C#
mit
andrewdavey/postal,ajbeaven/postal,hermanho/postal,andrewdavey/postal,vip32/postal,Lybecker/postal
9a00c869971474a249be43f71e9976e0de6354ec
src/ProjectEuler/Puzzles/Puzzle010.cs
src/ProjectEuler/Puzzles/Puzzle010.cs
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.ProjectEuler.Puzzles { using System; using System.Linq; /// <summary> /// A class representing the solution to <c>https://projecteuler.net/problem=10</c>. This class cannot be inherited. /// </summary> internal sealed class Puzzle010 : Puzzle { /// <inheritdoc /> public override string Question => "Find the sum of all the primes below the specified value."; /// <inheritdoc /> protected override int MinimumArguments => 1; /// <inheritdoc /> protected override int SolveCore(string[] args) { int max; if (!TryParseInt32(args[0], out max) || max < 2) { Console.Error.WriteLine("The specified number is invalid."); return -1; } Answer = Enumerable.Range(2, max - 2) .Where((p) => Maths.IsPrime(p)) .Select((p) => (long)p) .Sum(); return 0; } } }
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.ProjectEuler.Puzzles { using System; /// <summary> /// A class representing the solution to <c>https://projecteuler.net/problem=10</c>. This class cannot be inherited. /// </summary> internal sealed class Puzzle010 : Puzzle { /// <inheritdoc /> public override string Question => "Find the sum of all the primes below the specified value."; /// <inheritdoc /> protected override int MinimumArguments => 1; /// <inheritdoc /> protected override int SolveCore(string[] args) { int max; if (!TryParseInt32(args[0], out max) || max < 2) { Console.Error.WriteLine("The specified number is invalid."); return -1; } long sum = 0; for (int n = 2; n < max - 2; n++) { if (Maths.IsPrime(n)) { sum += n; } } Answer = sum; return 0; } } }
Refactor puzzle 10 to not use LINQ
Refactor puzzle 10 to not use LINQ
C#
apache-2.0
martincostello/project-euler
ba08ad548b0e8c0d290bd63ff06fbc3df3faf6f7
src/TramlineFive/TramlineFive.Common/Converters/TimingConverter.cs
src/TramlineFive/TramlineFive.Common/Converters/TimingConverter.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Windows.UI.Xaml.Data; namespace TramlineFive.Common.Converters { public class TimingConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { string[] timings = (string[])value; StringBuilder builder = new StringBuilder(); foreach (string singleTiming in timings) { TimeSpan timing; if (TimeSpan.TryParse((string)singleTiming, out timing)) { TimeSpan timeLeft = timing - DateTime.Now.TimeOfDay; builder.AppendFormat("{0} ({1} мин), ", singleTiming, timeLeft.Minutes); } } builder.Remove(builder.Length - 2, 2); return builder.ToString(); } public object ConvertBack(object value, Type targetType, object parameter, string language) { return String.Empty; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Windows.UI.Xaml.Data; namespace TramlineFive.Common.Converters { public class TimingConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { string[] timings = (string[])value; StringBuilder builder = new StringBuilder(); foreach (string singleTiming in timings) { TimeSpan timing; if (TimeSpan.TryParse((string)singleTiming, out timing)) { TimeSpan timeLeft = timing - DateTime.Now.TimeOfDay; builder.AppendFormat("{0} ({1} мин), ", singleTiming, timeLeft.Minutes < 0 ? 0 : timeLeft.Minutes); } } builder.Remove(builder.Length - 2, 2); return builder.ToString(); } public object ConvertBack(object value, Type targetType, object parameter, string language) { return String.Empty; } } }
Fix some arrivals showing negative ETA minutes.
Fix some arrivals showing negative ETA minutes.
C#
apache-2.0
betrakiss/Tramline-5,betrakiss/Tramline-5
1fab7add9386ec31c9c9ef47aaf281deac8c02aa
Metrics.Reporters.GoogleAnalytics/Metrics.Reporters.GoogleAnalytics.Tracker/Model/Metric.cs
Metrics.Reporters.GoogleAnalytics/Metrics.Reporters.GoogleAnalytics.Tracker/Model/Metric.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Metrics.Reporters.GoogleAnalytics.Tracker.Model.MeasurementProtocol; using Metrics.Reporters.GoogleAnalytics.Tracker.Model.MeasurementProtocol.Values; namespace Metrics.Reporters.GoogleAnalytics.Tracker.Model { public abstract class Metric : ICanReportToGoogleAnalytics { public abstract string Name { get; } protected string TrackableName { get { return this.Name.Replace('[', '~').Replace(']', '~'); } } public virtual ParameterTextValue HitType { get { return HitTypeValue.Event; } } public virtual IEnumerable<Parameter> Parameters { get { return new Parameter[] { Parameter.Boolean(ParameterName.HitNonInteractive, ParameterBooleanValue.True), Parameter.Text(ParameterName.EventLabel, new EventLabelValue(this.TrackableName)) }; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Metrics.Reporters.GoogleAnalytics.Tracker.Model.MeasurementProtocol; using Metrics.Reporters.GoogleAnalytics.Tracker.Model.MeasurementProtocol.Values; namespace Metrics.Reporters.GoogleAnalytics.Tracker.Model { public abstract class Metric : ICanReportToGoogleAnalytics { public abstract string Name { get; } public virtual ParameterTextValue HitType { get { return HitTypeValue.Event; } } public virtual IEnumerable<Parameter> Parameters { get { return new Parameter[] { Parameter.Boolean(ParameterName.HitNonInteractive, ParameterBooleanValue.True), Parameter.Text(ParameterName.EventLabel, new EventLabelValue(this.Name)) }; } } } }
Revert "Try fix for tracking metrics with square brackets in name"
Revert "Try fix for tracking metrics with square brackets in name" This reverts commit 9d62eeab95b733795473c1ecee24ce217166726e.
C#
apache-2.0
hinteadan/Metrics.NET.GAReporting
37d4dd9be181d64eef9a1f9157e95f9269e0871c
src/SilentHunter.Controllers.Compiler/DependencyInjection/ControllerConfigurerExtensions.cs
src/SilentHunter.Controllers.Compiler/DependencyInjection/ControllerConfigurerExtensions.cs
using System; using System.Reflection; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using SilentHunter.FileFormats.Dat.Controllers; using SilentHunter.FileFormats.DependencyInjection; namespace SilentHunter.Controllers.Compiler.DependencyInjection { public static class ControllerConfigurerExtensions { public static SilentHunterParsersConfigurer CompileFrom(this ControllerConfigurer controllerConfigurer, string controllerPath, string assemblyName = null, Func<string, bool> ignorePaths = null, params string[] dependencySearchPaths) { AddCSharpCompiler(controllerConfigurer); return controllerConfigurer.FromAssembly(s => { Assembly entryAssembly = Assembly.GetEntryAssembly(); string applicationName = entryAssembly?.GetName().Name ?? "SilentHunter.Controllers"; var assemblyCompiler = new ControllerAssemblyCompiler(s.GetRequiredService<ICSharpCompiler>(), applicationName, controllerPath) { AssemblyName = assemblyName, IgnorePaths = ignorePaths, DependencySearchPaths = dependencySearchPaths }; return new ControllerAssembly(assemblyCompiler.Compile()); }); } private static void AddCSharpCompiler(IServiceCollectionProvider controllerConfigurer) { IServiceCollection services = controllerConfigurer.ServiceCollection; #if NETFRAMEWORK services.TryAddTransient<ICSharpCompiler, CSharpCompiler>(); #else services.TryAddTransient<ICSharpCompiler, RoslynCompiler>(); #endif } } }
using System; using System.Reflection; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using SilentHunter.FileFormats.Dat.Controllers; using SilentHunter.FileFormats.DependencyInjection; namespace SilentHunter.Controllers.Compiler.DependencyInjection { public static class ControllerConfigurerExtensions { public static SilentHunterParsersConfigurer CompileFrom(this ControllerConfigurer controllerConfigurer, string controllerPath, string assemblyName = null, string applicationName = null, Func<string, bool> ignorePaths = null, params string[] dependencySearchPaths) { AddCSharpCompiler(controllerConfigurer); return controllerConfigurer.FromAssembly(s => { Assembly entryAssembly = Assembly.GetEntryAssembly(); string appName = applicationName ?? entryAssembly?.GetName().Name ?? "SilentHunter.Controllers"; var assemblyCompiler = new ControllerAssemblyCompiler(s.GetRequiredService<ICSharpCompiler>(), appName, controllerPath) { AssemblyName = assemblyName, IgnorePaths = ignorePaths, DependencySearchPaths = dependencySearchPaths }; return new ControllerAssembly(assemblyCompiler.Compile()); }); } private static void AddCSharpCompiler(IServiceCollectionProvider controllerConfigurer) { IServiceCollection services = controllerConfigurer.ServiceCollection; #if NETFRAMEWORK services.TryAddTransient<ICSharpCompiler, CSharpCompiler>(); #else services.TryAddTransient<ICSharpCompiler, RoslynCompiler>(); #endif } } }
Add option to set app name
Add option to set app name
C#
apache-2.0
skwasjer/SilentHunter
83d9641b02f60be1b44fb793c76aa241c4dbff3a
LSDStay/PSX.cs
LSDStay/PSX.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Diagnostics; namespace LSDStay { public static class PSX { public static Process FindPSX() { Process psx = Process.GetProcessesByName("psxfin").FirstOrDefault(); return psx; } public static IntPtr OpenPSX(Process psx) { int PID = psx.Id; IntPtr psxHandle = Memory.OpenProcess((uint)Memory.ProcessAccessFlags.All, false, PID); } public static void ClosePSX(IntPtr processHandle) { int result = Memory.CloseHandle(processHandle); if (result == 0) { Console.WriteLine("ERROR: Could not close psx handle"); } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Diagnostics; namespace LSDStay { public static class PSX { public static Process PSXProcess; public static IntPtr PSXHandle; public static bool FindPSX() { PSXProcess = Process.GetProcessesByName("psxfin").FirstOrDefault(); return (PSXProcess != null); } public static bool OpenPSX() { int PID = PSXProcess.Id; PSXHandle = Memory.OpenProcess((uint)Memory.ProcessAccessFlags.All, false, PID); return (PSXHandle != null); } public static void ClosePSX(IntPtr processHandle) { int result = Memory.CloseHandle(processHandle); if (result == 0) { Console.WriteLine("ERROR: Could not close psx handle"); } } public static string Read(IntPtr address, ref byte[] buffer) { int bytesRead = 0; int absoluteAddress = Memory.PSXGameOffset + (int)address; //IntPtr absoluteAddressPtr = new IntPtr(absoluteAddress); Memory.ReadProcessMemory((int)PSXHandle, absoluteAddress, buffer, buffer.Length, ref bytesRead); return "Address " + address.ToString("x2") + " contains " + Memory.FormatToHexString(buffer); } public static string Write(IntPtr address, byte[] data) { int bytesWritten; int absoluteAddress = Memory.PSXGameOffset + (int)address; IntPtr absoluteAddressPtr = new IntPtr(absoluteAddress); Memory.WriteProcessMemory(PSXHandle, absoluteAddressPtr, data, (uint)data.Length, out bytesWritten); return "Address " + address.ToString("x2") + " is now " + Memory.FormatToHexString(data); } } }
Add Read and Write methods
Add Read and Write methods
C#
mit
Figglewatts/LSDStay
fb04f2c639b28080132d15c6d9b841a931dd0fc5
Tests/SizeTest.cs
Tests/SizeTest.cs
using Xunit; namespace VulkanCore.Tests { public class SizeTest { [Fact] public void ImplicitConversions() { const int intVal = 1; const long longVal = 2; Size intSize = intVal; Size longSize = longVal; Assert.Equal(intVal, intSize); Assert.Equal(longVal, longSize); } } }
using Xunit; namespace VulkanCore.Tests { public class SizeTest { [Fact] public void ImplicitConversions() { const int intVal = 1; const long longVal = 2; Size intSize = intVal; Size longSize = longVal; Assert.Equal(intVal, (int)intSize); Assert.Equal(longVal, (long)longSize); } } }
Fix Size test using explicit conversions for assertions
[Tests] Fix Size test using explicit conversions for assertions
C#
mit
discosultan/VulkanCore
9fdfa3c2a451f13ddff65fb4d1de63643a93b08f
NeuralNetwork/NeuralNetwork/Neuron.cs
NeuralNetwork/NeuralNetwork/Neuron.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ArtificialNeuralNetwork { [Serializable] public class Neuron : INeuron { private readonly ISoma _soma; private readonly IAxon _axon; public Neuron(ISoma soma, IAxon axon) { _soma = soma; _axon = axon; } public virtual double CalculateActivationFunction() { return 0.0; } public void Process() { _axon.ProcessSignal(_soma.CalculateSummation()); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ArtificialNeuralNetwork { [Serializable] public class Neuron : INeuron { private readonly ISoma _soma; private readonly IAxon _axon; private Neuron(ISoma soma, IAxon axon) { _soma = soma; _axon = axon; } public static INeuron Create(ISoma soma, IAxon axon) { return new Neuron(soma, axon); } public void Process() { _axon.ProcessSignal(_soma.CalculateSummation()); } } }
Add static factory method for neuron
Add static factory method for neuron
C#
mit
jobeland/NeuralNetwork
7ea77941719a8ffb4bddc9bcb7317210634a3db3
src/Discore/DiscordMessageType.cs
src/Discore/DiscordMessageType.cs
namespace Discore { public enum DiscordMessageType { Default = 0, RecipientAdd = 1, RecipientRemove = 2, Call = 3, ChannelNameChange = 4, ChannelIconChange = 5, ChannelPinnedMessage = 6, GuildMemberJoin = 7 } }
namespace Discore { public enum DiscordMessageType { Default = 0, RecipientAdd = 1, RecipientRemove = 2, Call = 3, ChannelNameChange = 4, ChannelIconChange = 5, ChannelPinnedMessage = 6, GuildMemberJoin = 7, UserPremiumGuildSubscription = 8, UserPremiumGuildSubscriptionTier1 = 9, UserPremiumGuildSubscriptionTier2 = 10, UserPremiumGuildSubscriptionTier3 = 11, ChannelFollowAdd = 12 } }
Add message types for nitro boosting and channel following
Add message types for nitro boosting and channel following #66
C#
mit
BundledSticksInkorperated/Discore
c576e3fc8cfa01832c33f8a65fd81c581720e240
Source/Test/Operations/NewUserDefinedFunctionOperationTestFixture.cs
Source/Test/Operations/NewUserDefinedFunctionOperationTestFixture.cs
using NUnit.Framework; using Rivet.Operations; namespace Rivet.Test.Operations { [TestFixture] public sealed class NewUserDefinedFunctionTestFixture { const string SchemaName = "schemaName"; const string FunctionName = "functionName"; const string Definition = "as definition"; [SetUp] public void SetUp() { } [Test] public void ShouldSetPropertiesForNewStoredProcedure() { var op = new NewUserDefinedFunctionOperation(SchemaName, FunctionName, Definition); Assert.AreEqual(SchemaName, op.SchemaName); Assert.AreEqual(FunctionName, op.Name); Assert.AreEqual(Definition, op.Definition); } [Test] public void ShouldWriteQueryForNewStoredProcedure() { var op = new NewUserDefinedFunctionOperation(SchemaName, FunctionName, Definition); const string expectedQuery = "create function [schemaName].[functionName] as definition"; Assert.AreEqual(expectedQuery, op.ToQuery()); } } }
using NUnit.Framework; using Rivet.Operations; namespace Rivet.Test.Operations { [TestFixture] public sealed class NewUserDefinedFunctionTestFixture { const string SchemaName = "schemaName"; const string FunctionName = "functionName"; const string Definition = "as definition"; [SetUp] public void SetUp() { } [Test] public void ShouldSetPropertiesForNewUserDefinedFunction() { var op = new NewUserDefinedFunctionOperation(SchemaName, FunctionName, Definition); Assert.AreEqual(SchemaName, op.SchemaName); Assert.AreEqual(FunctionName, op.Name); Assert.AreEqual(Definition, op.Definition); } [Test] public void ShouldWriteQueryForNewUserDefinedFunction() { var op = new NewUserDefinedFunctionOperation(SchemaName, FunctionName, Definition); const string expectedQuery = "create function [schemaName].[functionName] as definition"; Assert.AreEqual(expectedQuery, op.ToQuery()); } } }
Rename function name in test fixture
Rename function name in test fixture
C#
apache-2.0
RivetDB/Rivet,RivetDB/Rivet,RivetDB/Rivet
bf0201b079585f4319e3a85e813c9c5cfd34718a
csharp/Hello/HelloServer/Program.cs
csharp/Hello/HelloServer/Program.cs
using System; using System.Threading.Tasks; using Grpc.Core; using Hello; namespace HelloServer { class HelloServerImpl : HelloService.HelloServiceBase { public override Task<HelloResp> SayHello(HelloReq request, ServerCallContext context) { return Task.FromResult(new HelloResp { Result = "Hey " + request.Name }); } public override Task<HelloResp> SayHelloStrict(HelloReq request, ServerCallContext context) { if (request.Name.Length >= 10) { const string msg = "Length of `Name` cannot be more than 10 characters"; throw new RpcException(new Status(StatusCode.InvalidArgument, msg)); } return Task.FromResult(new HelloResp { Result = "Hey " + request.Name }); } } class Program { const int Port = 50051; public static void Main(string[] args) { Server server = new Server { Services = { HelloService.BindService(new HelloServerImpl()) }, Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) } }; server.Start(); Console.WriteLine("Hello server listening on port " + Port); Console.WriteLine("Press any key to stop the server..."); Console.ReadKey(); server.ShutdownAsync().Wait(); } } }
using System; using System.Threading.Tasks; using Grpc.Core; using Hello; namespace HelloServer { class HelloServerImpl : HelloService.HelloServiceBase { public override Task<HelloResp> SayHello(HelloReq request, ServerCallContext context) { return Task.FromResult(new HelloResp { Result = "Hey, " + request.Name + "!"}); } public override Task<HelloResp> SayHelloStrict(HelloReq request, ServerCallContext context) { if (request.Name.Length >= 10) { const string msg = "Length of `Name` cannot be more than 10 characters"; throw new RpcException(new Status(StatusCode.InvalidArgument, msg)); } return Task.FromResult(new HelloResp { Result = "Hey, " + request.Name + "!"}); } } class Program { const int Port = 50051; public static void Main(string[] args) { Server server = new Server { Services = { HelloService.BindService(new HelloServerImpl()) }, Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) } }; server.Start(); Console.WriteLine("Hello server listening on port " + Port); Console.WriteLine("Press any key to stop the server..."); Console.ReadKey(); server.ShutdownAsync().Wait(); } } }
Update server to send proper response
Update server to send proper response
C#
mit
avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors
29f52b3004693266db7f07412f526e3a4c121321
src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails/ChargePaymentMethodDetailsCardThreeDSecure.cs
src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails/ChargePaymentMethodDetailsCardThreeDSecure.cs
namespace Stripe { using Newtonsoft.Json; using Stripe.Infrastructure; public class ChargePaymentMethodDetailsCardThreeDSecure : StripeEntity { } }
namespace Stripe { using Newtonsoft.Json; using Stripe.Infrastructure; public class ChargePaymentMethodDetailsCardThreeDSecure : StripeEntity { [JsonProperty("succeeded")] public bool Succeeded { get; set; } [JsonProperty("version")] public string Version { get; set; } } }
Add basic fields in Charge's PMD 3DS field
Add basic fields in Charge's PMD 3DS field
C#
apache-2.0
richardlawley/stripe.net,stripe/stripe-dotnet
94bacce2f7b418159506cc34675a7ce499f64a25
src/CompetitionPlatform/Data/AzureRepositories/Settings/GeneralSettingsReader.cs
src/CompetitionPlatform/Data/AzureRepositories/Settings/GeneralSettingsReader.cs
using System.Text; using AzureStorage.Blob; using Common; namespace CompetitionPlatform.Data.AzureRepositories.Settings { public static class GeneralSettingsReader { public static T ReadGeneralSettings<T>(string connectionString, string container, string fileName) { var settingsStorage = new AzureBlobStorage(connectionString); var settingsData = settingsStorage.GetAsync(container, fileName).Result.ToBytes(); var str = Encoding.UTF8.GetString(settingsData); return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(str); } } }
using System.Net.Http; using System.Text; using AzureStorage.Blob; using Common; using Newtonsoft.Json; namespace CompetitionPlatform.Data.AzureRepositories.Settings { public static class GeneralSettingsReader { public static T ReadGeneralSettings<T>(string connectionString, string container, string fileName) { var settingsStorage = new AzureBlobStorage(connectionString); var settingsData = settingsStorage.GetAsync(container, fileName).Result.ToBytes(); var str = Encoding.UTF8.GetString(settingsData); return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(str); } public static T ReadGeneralSettingsFromUrl<T>(string settingsUrl) { var httpClient = new HttpClient(); var settingsString = httpClient.GetStringAsync(settingsUrl).Result; var serviceBusSettings = JsonConvert.DeserializeObject<T>(settingsString); return serviceBusSettings; } } }
Add a method to get settings from a url.
Add a method to get settings from a url.
C#
mit
LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform
8e4153fd31a967eef215d49d2f68a98865e79ac2
osu.Framework.Tests/Visual/Platform/TestSceneExecutionModes.cs
osu.Framework.Tests/Visual/Platform/TestSceneExecutionModes.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Configuration; using osu.Framework.Platform; namespace osu.Framework.Tests.Visual.Platform { [Ignore("This test does not cover correct GL context acquire/release when run headless.")] public class TestSceneExecutionModes : FrameworkTestScene { private Bindable<ExecutionMode> executionMode; [BackgroundDependencyLoader] private void load(FrameworkConfigManager configManager) { executionMode = configManager.GetBindable<ExecutionMode>(FrameworkSetting.ExecutionMode); } [Test] public void ToggleModeSmokeTest() { AddRepeatStep("toggle execution mode", () => executionMode.Value = executionMode.Value == ExecutionMode.MultiThreaded ? ExecutionMode.SingleThread : ExecutionMode.MultiThreaded, 2); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Configuration; using osu.Framework.Platform; using osu.Framework.Threading; namespace osu.Framework.Tests.Visual.Platform { [Ignore("This test does not cover correct GL context acquire/release when run headless.")] public class TestSceneExecutionModes : FrameworkTestScene { private Bindable<ExecutionMode> executionMode; [BackgroundDependencyLoader] private void load(FrameworkConfigManager configManager) { executionMode = configManager.GetBindable<ExecutionMode>(FrameworkSetting.ExecutionMode); } [Test] public void ToggleModeSmokeTest() { AddRepeatStep("toggle execution mode", () => executionMode.Value = executionMode.Value == ExecutionMode.MultiThreaded ? ExecutionMode.SingleThread : ExecutionMode.MultiThreaded, 2); } [Test] public void TestRapidSwitching() { ScheduledDelegate switchStep = null; int switchCount = 0; AddStep("install quick switch step", () => { switchStep = Scheduler.AddDelayed(() => { executionMode.Value = executionMode.Value == ExecutionMode.MultiThreaded ? ExecutionMode.SingleThread : ExecutionMode.MultiThreaded; switchCount++; }, 0, true); }); AddUntilStep("switch count sufficiently high", () => switchCount > 1000); AddStep("remove", () => switchStep.Cancel()); } } }
Add test covering horrible fail scenario
Add test covering horrible fail scenario
C#
mit
smoogipooo/osu-framework,ppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework
4158146c719f6ef3d7f58991b284cf599426d8e5
osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs
osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableSpinnerTick : DrawableOsuHitObject { public override bool DisplayResult => false; protected DrawableSpinner DrawableSpinner => (DrawableSpinner)ParentHitObject; public DrawableSpinnerTick() : base(null) { } public DrawableSpinnerTick(SpinnerTick spinnerTick) : base(spinnerTick) { } protected override double MaximumJudgementOffset => DrawableSpinner.HitObject.Duration; /// <summary> /// Apply a judgement result. /// </summary> /// <param name="hit">Whether this tick was reached.</param> internal void TriggerResult(bool hit) => ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult); } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableSpinnerTick : DrawableOsuHitObject { public override bool DisplayResult => false; protected DrawableSpinner DrawableSpinner => (DrawableSpinner)ParentHitObject; public DrawableSpinnerTick() : this(null) { } public DrawableSpinnerTick(SpinnerTick spinnerTick) : base(spinnerTick) { Anchor = Anchor.Centre; Origin = Anchor.Centre; } protected override double MaximumJudgementOffset => DrawableSpinner.HitObject.Duration; /// <summary> /// Apply a judgement result. /// </summary> /// <param name="hit">Whether this tick was reached.</param> internal void TriggerResult(bool hit) => ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult); } }
Fix spinenr tick samples not positioned at centre
Fix spinenr tick samples not positioned at centre Causing samples to be played at left ear rather than centre.
C#
mit
peppy/osu,peppy/osu,ppy/osu,ppy/osu,peppy/osu,ppy/osu
77ec8581a3fff975145fe782bee9e5228bc71359
Blueprints/BlueprintDefinitions/netcore3.1/AspNetCoreWebApp/template/src/BlueprintBaseName.1/LocalEntryPoint.cs
Blueprints/BlueprintDefinitions/netcore3.1/AspNetCoreWebApp/template/src/BlueprintBaseName.1/LocalEntryPoint.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; namespace BlueprintBaseName._1 { public class Program { public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }); } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; namespace BlueprintBaseName._1 { public class Program { public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }); } }
Fix compile error in .NET Core 3.1 version of ASP.NET Core Web App blueprint
Fix compile error in .NET Core 3.1 version of ASP.NET Core Web App blueprint
C#
apache-2.0
thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet
590aef059f4f2860b32e56a6ca6f831e9daec5e9
NBi.genbiL/GenerationState.cs
NBi.genbiL/GenerationState.cs
using System; using System.Collections.Generic; using System.Data; using System.Linq; namespace NBi.GenbiL { class GenerationState { public DataTable TestCases { get; set; } public IEnumerable<string> Variables { get; set; } public string Template { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using NBi.Service; namespace NBi.GenbiL { public class GenerationState { public TestCasesManager TestCases { get; private set; } public TemplateManager Template { get; private set; } public SettingsManager Settings { get; private set; } public TestListManager List { get; private set; } public TestSuiteManager Suite { get; private set; } public GenerationState() { TestCases = new TestCasesManager(); Template = new TemplateManager(); Settings = new SettingsManager(); List = new TestListManager(); Suite = new TestSuiteManager(); } } }
Define a state that is modified by the actions
Define a state that is modified by the actions
C#
apache-2.0
Seddryck/NBi,Seddryck/NBi
84962a22753391b5a23105bbbc1479aae9bdcdcd
osu.Framework/Logging/LoadingComponentsLogger.cs
osu.Framework/Logging/LoadingComponentsLogger.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Linq; using osu.Framework.Development; using osu.Framework.Extensions.TypeExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Lists; namespace osu.Framework.Logging { internal static class LoadingComponentsLogger { private static readonly WeakList<Drawable> loading_components = new WeakList<Drawable>(); public static void Add(Drawable component) { if (!DebugUtils.IsDebugBuild) return; lock (loading_components) loading_components.Add(component); } public static void Remove(Drawable component) { if (!DebugUtils.IsDebugBuild) return; lock (loading_components) loading_components.Remove(component); } public static void LogAndFlush() { if (!DebugUtils.IsDebugBuild) return; lock (loading_components) { Logger.Log($"⏳ Currently loading components ({loading_components.Count()})"); foreach (var c in loading_components) Logger.Log($"- {c.GetType().ReadableName(),-16} LoadState:{c.LoadState,-5} Thread:{c.LoadThread.Name}"); loading_components.Clear(); Logger.Log("🧵 Task schedulers"); Logger.Log(CompositeDrawable.SCHEDULER_STANDARD.GetStatusString()); Logger.Log(CompositeDrawable.SCHEDULER_LONG_LOAD.GetStatusString()); } } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Linq; using osu.Framework.Development; using osu.Framework.Extensions.TypeExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Lists; namespace osu.Framework.Logging { internal static class LoadingComponentsLogger { private static readonly WeakList<Drawable> loading_components = new WeakList<Drawable>(); public static void Add(Drawable component) { if (!DebugUtils.IsDebugBuild) return; lock (loading_components) loading_components.Add(component); } public static void Remove(Drawable component) { if (!DebugUtils.IsDebugBuild) return; lock (loading_components) loading_components.Remove(component); } public static void LogAndFlush() { if (!DebugUtils.IsDebugBuild) return; lock (loading_components) { Logger.Log($"⏳ Currently loading components ({loading_components.Count()})"); foreach (var c in loading_components) { Logger.Log($"- {c.GetType().ReadableName(),-16} LoadState:{c.LoadState,-5} Thread:{c.LoadThread?.Name ?? "none"}"); } loading_components.Clear(); Logger.Log("🧵 Task schedulers"); Logger.Log(CompositeDrawable.SCHEDULER_STANDARD.GetStatusString()); Logger.Log(CompositeDrawable.SCHEDULER_LONG_LOAD.GetStatusString()); } } } }
Fix potentially null reference if drawable was not assigned a `LoadThread` yet
Fix potentially null reference if drawable was not assigned a `LoadThread` yet
C#
mit
smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,peppy/osu-framework,ppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework
5f0069eb837a8300efc0f90c35cf1415a0fe4ade
osu.Game/Screens/Select/MatchSongSelect.cs
osu.Game/Screens/Select/MatchSongSelect.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using osu.Game.Online.Multiplayer; using osu.Game.Screens.Multi; namespace osu.Game.Screens.Select { public class MatchSongSelect : SongSelect, IMultiplayerScreen { public Action<PlaylistItem> Selected; public string ShortTitle => "song selection"; protected override bool OnStart() { var item = new PlaylistItem { Beatmap = Beatmap.Value.BeatmapInfo, Ruleset = Ruleset.Value, }; item.RequiredMods.AddRange(SelectedMods.Value); Selected?.Invoke(item); if (IsCurrentScreen) Exit(); return true; } } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using osu.Game.Online.Multiplayer; using osu.Game.Screens.Multi; namespace osu.Game.Screens.Select { public class MatchSongSelect : SongSelect, IMultiplayerScreen { public Action<PlaylistItem> Selected; public string ShortTitle => "song selection"; protected override bool OnStart() { var item = new PlaylistItem { Beatmap = Beatmap.Value.BeatmapInfo, Ruleset = Ruleset.Value, RulesetID = Ruleset.Value.ID ?? 0 }; item.RequiredMods.AddRange(SelectedMods.Value); Selected?.Invoke(item); if (IsCurrentScreen) Exit(); return true; } } }
Fix incorrect ruleset being sent to API
Fix incorrect ruleset being sent to API
C#
mit
NeoAdonis/osu,smoogipooo/osu,UselessToucan/osu,NeoAdonis/osu,naoey/osu,2yangk23/osu,peppy/osu,smoogipoo/osu,EVAST9919/osu,naoey/osu,ppy/osu,UselessToucan/osu,ppy/osu,peppy/osu,ppy/osu,DrabWeb/osu,smoogipoo/osu,johnneijzen/osu,ZLima12/osu,UselessToucan/osu,peppy/osu-new,EVAST9919/osu,naoey/osu,ZLima12/osu,smoogipoo/osu,DrabWeb/osu,johnneijzen/osu,DrabWeb/osu,2yangk23/osu,NeoAdonis/osu,peppy/osu
d843fece7411e5d43e68cc005ddc1e110843e815
src/Booma.Proxy.Packets.BlockServer/Commands/Command60/Sub60StartNewWarpCommand.cs
src/Booma.Proxy.Packets.BlockServer/Commands/Command60/Sub60StartNewWarpCommand.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using FreecraftCore.Serializer; namespace Booma.Proxy { /// <summary> /// Payload sent when a client is begining a warp to a new area. /// Contains client ID information and information about the warp itself. /// </summary> [WireDataContract] [SubCommand60(SubCommand60OperationCode.GameStartWarpToArea)] public sealed class Sub60StartNewWarpCommand : BaseSubCommand60, IMessageContextIdentifiable { //TODO: Is this client id? [WireMember(1)] public byte Identifier { get; } [WireMember(2)] public byte Unused1 { get; } /// <summary> /// The zone ID that the user is teleporting to. /// </summary> [WireMember(3)] public short ZoneId { get; } //Unused2 was padding, not sent in the payload. public Sub60StartNewWarpCommand() { //Calc static 32bit size CommandSize = 8 / 4; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using FreecraftCore.Serializer; namespace Booma.Proxy { /// <summary> /// Payload sent when a client is begining a warp to a new area. /// Contains client ID information and information about the warp itself. /// </summary> [WireDataContract] [SubCommand60(SubCommand60OperationCode.GameStartWarpToArea)] public sealed class Sub60StartNewWarpCommand : BaseSubCommand60, IMessageContextIdentifiable { //TODO: Is this client id? [WireMember(1)] public byte Identifier { get; } [WireMember(2)] public byte Unused1 { get; } /// <summary> /// The zone ID that the user is teleporting to. /// </summary> [WireMember(3)] public short ZoneId { get; } //TODO: What is this? [WireMember(4)] public short Unused2 { get; } public Sub60StartNewWarpCommand() { //Calc static 32bit size CommandSize = 8 / 4; } } }
Revert "Cleaned up 0x60 0x21 warp packet model"
Revert "Cleaned up 0x60 0x21 warp packet model" This reverts commit d10e1a0bc424923674067ae9080e6954c1de9403.
C#
agpl-3.0
HelloKitty/Booma.Proxy