commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13 values | lang stringclasses 23 values |
|---|---|---|---|---|---|---|---|---|
dcca1cc78075cd7822cf3de553aae3a58df3ece0 | Fix unit test | SamDel/ChromeCast-Desktop-Audio-Streamer | Source/ChromeCast.Desktop.AudioStreamer.Test/Application/ConfigurationTest.cs | Source/ChromeCast.Desktop.AudioStreamer.Test/Application/ConfigurationTest.cs | using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ChromeCast.Desktop.AudioStreamer.Application;
namespace ChromeCast.Desktop.AudioStreamer.Test.Application
{
[TestClass]
public class ConfigurationTest
{
AutoResetEvent asyncEvent;
bool useShortCuts;
bool boolShowLog;
bool showLag;
int lagValue;
bool autoStart;
string ipAddressesDevices;
bool autoRestart;
[TestMethod]
public void TestMethod1()
{
asyncEvent = new AutoResetEvent(false);
var configuration = new Configuration();
configuration.Load(ConfigurationCallback);
asyncEvent.WaitOne(100);
Assert.IsFalse(useShortCuts);
Assert.IsFalse(boolShowLog);
Assert.IsFalse(showLag);
Assert.AreEqual(1000, lagValue);
Assert.AreEqual(string.Empty, ipAddressesDevices);
Assert.AreEqual(false, autoRestart);
}
private void ConfigurationCallback(bool useShortCutsIn, bool boolShowLogIn, bool showLagIn, int lagValueIn, bool autoStartIn, string ipAddressesDevicesIn, bool showWindow, bool autoRestartIn)
{
useShortCuts = useShortCutsIn;
boolShowLog = boolShowLogIn;
showLag = showLagIn;
lagValue = lagValueIn;
autoStart = autoStartIn;
ipAddressesDevices = ipAddressesDevicesIn;
autoRestart = autoRestartIn;
asyncEvent.Set();
}
}
}
| using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ChromeCast.Desktop.AudioStreamer.Application;
namespace ChromeCast.Desktop.AudioStreamer.Test.Application
{
[TestClass]
public class ConfigurationTest
{
AutoResetEvent asyncEvent;
bool useShortCuts;
bool boolShowLog;
bool showLag;
int lagValue;
bool autoStart;
string ipAddressesDevices;
[TestMethod]
public void TestMethod1()
{
asyncEvent = new AutoResetEvent(false);
var configuration = new Configuration();
configuration.Load(ConfigurationCallback);
asyncEvent.WaitOne(100);
Assert.IsFalse(useShortCuts);
Assert.IsFalse(boolShowLog);
Assert.IsFalse(showLag);
Assert.AreEqual(1000, lagValue);
Assert.AreEqual(string.Empty, ipAddressesDevices);
}
private void ConfigurationCallback(bool useShortCutsIn, bool boolShowLogIn, bool showLagIn, int lagValueIn, bool autoStartIn, string ipAddressesDevicesIn, bool showWindow)
{
useShortCuts = useShortCutsIn;
boolShowLog = boolShowLogIn;
showLag = showLagIn;
lagValue = lagValueIn;
autoStart = autoStartIn;
ipAddressesDevices = ipAddressesDevicesIn;
asyncEvent.Set();
}
}
}
| mit | C# |
25ac45a9aa7f008772a5583aee2bc7fa3a81c522 | Increase version number | luckyrat/domain-public-suffix | domain-public-suffix/Properties/AssemblyInfo.cs | domain-public-suffix/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DomainPublicSuffix")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DomainPublicSuffix")]
[assembly: AssemblyCopyright("Copyright (c) Chris Tomlinson 2018 (some parts (c) Dan Esparza used under MIT license)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("da7e04fa-424b-4484-ac15-869d7e91d55d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
| using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DomainPublicSuffix")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DomainPublicSuffix")]
[assembly: AssemblyCopyright("Copyright (c) Chris Tomlinson 2015 (some parts (c) Dan Esparza used under MIT license)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("da7e04fa-424b-4484-ac15-869d7e91d55d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
| mit | C# |
0f93481ca8e072fa8a33b48a90737933012884b2 | Update PaymentOrderChangedEvent.cs | SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments | src/CommitmentsV2/SFA.DAS.CommitmentsV2.Messages/Events/PaymentOrderChangedEvent.cs | src/CommitmentsV2/SFA.DAS.CommitmentsV2.Messages/Events/PaymentOrderChangedEvent.cs | using SFA.DAS.CommitmentsV2.Types;
namespace SFA.DAS.CommitmentsV2.Messages.Events
{
public class PaymentOrderChangedEvent
{
public long AccountId { get; set; }
public int[] PaymentOrder { get; set; }
}
}
| using SFA.DAS.CommitmentsV2.Types;
namespace SFA.DAS.CommitmentsV2.Messages.Events
{
public class PaymentOrderChangedEvent
{
public long AccountId { get; set; }
public int[] PaymentOrder { get; set; }
}
}
| mit | C# |
65c42f5c7b1fe508ba82fd714605771f57da4438 | Revert "Removed Tab" | PixelManiacs/DonUniverso,PixelManiacs/DonUniverso | beansjam_unity/Assets/_Game/Scripts/Oneliners.cs | beansjam_unity/Assets/_Game/Scripts/Oneliners.cs | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Oneliners : MonoBehaviour
{
public AudioSource audioSource;
public List<AudioClip> allClips = new List<AudioClip>();
private int previousClipNumber = 99;
/// <summary>
/// Plays a random audio clip
/// </summary>
public void PlayRandomClip()
{
int randomClipNumber;
// if the audio source is not playing
if (!audioSource.isPlaying)
{
// avoid playing the same clip two times in a row
do
{
// pick a random audio clip
randomClipNumber = Random.Range(0, allClips.Count);
} while (randomClipNumber == previousClipNumber);
previousClipNumber = randomClipNumber;
// assign the clip to the audio source
audioSource.clip = allClips[randomClipNumber];
// play the audio source
audioSource.Play();
}
}
}
| using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Oneliners : MonoBehaviour
{
public AudioSource audioSource;
public List<AudioClip> allClips = new List<AudioClip>();
private int previousClipNumber = 99;
/// <summary>
/// Plays a random audio clip
/// </summary>
public void PlayRandomClip()
{
int randomClipNumber;
// if the audio source is not playing
if (!audioSource.isPlaying)
{
// avoid playing the same clip two times in a row
do
{
// pick a random audio clip
randomClipNumber = Random.Range(0, allClips.Count);
} while (randomClipNumber == previousClipNumber);
previousClipNumber = randomClipNumber;
// assign the clip to the audio source
audioSource.clip = allClips[randomClipNumber];
// play the audio source
audioSource.Play();
}
}
}
| mit | C# |
0d3b1aa71b734359fd11d13a29b4b45d7826e863 | increment version for nuget | richorama/AzureStorageExtensions | AzureJsonStore/Properties/AssemblyInfo.cs | AzureJsonStore/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AzureJsonStore")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Two10Degrees")]
[assembly: AssemblyProduct("AzureJsonStore")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("83b1a659-240f-45ec-9414-9db492a7fe8d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.4.0")]
[assembly: AssemblyFileVersion("1.0.4.0")]
| using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AzureJsonStore")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Two10Degrees")]
[assembly: AssemblyProduct("AzureJsonStore")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("83b1a659-240f-45ec-9414-9db492a7fe8d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]
| mit | C# |
0bdccfae46e415efc8ecde01e74db503bd52188d | make repository enumerable to get all records | eriklieben/ErikLieben.Data | ErikLieben.Data/Repository/IRepository.cs | ErikLieben.Data/Repository/IRepository.cs | namespace ErikLieben.Data.Repository
{
using System.Collections.Generic;
public interface IRepository<T> : IEnumerable<T>
where T : class
{
/// <summary>
/// Adds the specified item.
/// </summary>
/// <param name="item">The item to add.</param>
void Add(T item);
/// <summary>
/// Deletes the specified item.
/// </summary>
/// <param name="item">The item to delete.</param>
void Delete(T item);
/// <summary>
/// Updates the specified item.
/// </summary>
/// <param name="item">The item to update.</param>
void Update(T item);
IEnumerable<T> Find(ISpecification<T> specification, IFetchingStrategy<T> fetchingStrategy);
}
}
| namespace ErikLieben.Data.Repository
{
using System.Collections.Generic;
public interface IRepository<T>
where T : class
{
/// <summary>
/// Adds the specified item.
/// </summary>
/// <param name="item">The item to add.</param>
void Add(T item);
/// <summary>
/// Deletes the specified item.
/// </summary>
/// <param name="item">The item to delete.</param>
void Delete(T item);
/// <summary>
/// Updates the specified item.
/// </summary>
/// <param name="item">The item to update.</param>
void Update(T item);
IEnumerable<T> Find(ISpecification<T> specification, IFetchingStrategy<T> fetchingStrategy);
}
}
| mit | C# |
c08f5d3be26f3893e3871bfc8d04ab103dd91d61 | Update UsingSparklines.cs | asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET | Examples/CSharp/Charts/UsingSparklines.cs | Examples/CSharp/Charts/UsingSparklines.cs | using System.IO;
using Aspose.Cells;
using Aspose.Cells.Charts;
using System;
using System.Drawing;
namespace Aspose.Cells.Examples.Charts
{
public class UsingSparklines
{
public static void Main(string[] args)
{
//ExStart:1
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//Instantiate a Workbook
//Open a template file
Workbook book = new Workbook(dataDir + "Book1.xlsx");
//Get the first worksheet
Worksheet sheet = book.Worksheets[0];
//Use the following lines if you need to read the Sparklines
//Read the Sparklines from the template file (if it has)
foreach (SparklineGroup g in sheet.SparklineGroupCollection)
{
//Display the Sparklines group information e.g type, number of sparklines items
Console.WriteLine("sparkline group: type:" + g.Type + ", sparkline items count:" + g.SparklineCollection.Count);
foreach (Sparkline s in g.SparklineCollection)
{
//Display the individual Sparkines and the data ranges
Console.WriteLine("sparkline: row:" + s.Row + ", col:" + s.Column + ", dataRange:" + s.DataRange);
}
}
//Add Sparklines
//Define the CellArea D2:D10
CellArea ca = new CellArea();
ca.StartColumn = 4;
ca.EndColumn = 4;
ca.StartRow = 1;
ca.EndRow = 7;
//Add new Sparklines for a data range to a cell area
int idx = sheet.SparklineGroupCollection.Add(SparklineType.Column, "Sheet1!B2:D8", false, ca);
SparklineGroup group = sheet.SparklineGroupCollection[idx];
//Create CellsColor
CellsColor clr = book.CreateCellsColor();
clr.Color = Color.Orange;
group.SeriesColor = clr;
//Save the excel file
book.Save(dataDir + "Book1.out.xlsx");
//ExEnd:1
}
}
}
| using System.IO;
using Aspose.Cells;
using Aspose.Cells.Charts;
using System;
using System.Drawing;
namespace Aspose.Cells.Examples.Charts
{
public class UsingSparklines
{
public static void Main(string[] args)
{
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//Instantiate a Workbook
//Open a template file
Workbook book = new Workbook(dataDir + "Book1.xlsx");
//Get the first worksheet
Worksheet sheet = book.Worksheets[0];
//Use the following lines if you need to read the Sparklines
//Read the Sparklines from the template file (if it has)
foreach (SparklineGroup g in sheet.SparklineGroupCollection)
{
//Display the Sparklines group information e.g type, number of sparklines items
Console.WriteLine("sparkline group: type:" + g.Type + ", sparkline items count:" + g.SparklineCollection.Count);
foreach (Sparkline s in g.SparklineCollection)
{
//Display the individual Sparkines and the data ranges
Console.WriteLine("sparkline: row:" + s.Row + ", col:" + s.Column + ", dataRange:" + s.DataRange);
}
}
//Add Sparklines
//Define the CellArea D2:D10
CellArea ca = new CellArea();
ca.StartColumn = 4;
ca.EndColumn = 4;
ca.StartRow = 1;
ca.EndRow = 7;
//Add new Sparklines for a data range to a cell area
int idx = sheet.SparklineGroupCollection.Add(SparklineType.Column, "Sheet1!B2:D8", false, ca);
SparklineGroup group = sheet.SparklineGroupCollection[idx];
//Create CellsColor
CellsColor clr = book.CreateCellsColor();
clr.Color = Color.Orange;
group.SeriesColor = clr;
//Save the excel file
book.Save(dataDir + "Book1.out.xlsx");
}
}
} | mit | C# |
9a8d96cb0985b5ac2805bb109083ecef40440116 | Update Switch.cs | williambl/Haunt | Haunt/Assets/Scripts/Enviroment/Switch.cs | Haunt/Assets/Scripts/Enviroment/Switch.cs | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Switch : MonoBehaviour {
GameManager manager;
void Start ()
{
if(manager == null)
manager = GameObject.Find ("Manager").GetComponent<GameManager> ();
}
void OnTriggerStay (Collider other)
{
if (other.GetComponent<ItemComponent> () != null) {
if (other.GetComponent<ItemComponent> ().item.id == "objective" && other.GetComponent<ItemComponent> ().isHeld == false) {
manager.won = true;
}
}
}
}
| using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Switch : MonoBehaviour {
GameManager manager;
void Start ()
{
manager = GameObject.Find ("Manager").GetComponent<GameManager> ();
}
void OnTriggerStay (Collider other)
{
if (other.GetComponent<ItemComponent> () != null) {
if (other.GetComponent<ItemComponent> ().item.id == "objective" && other.GetComponent<ItemComponent> ().isHeld == false) {
manager.won = true;
}
}
}
}
| mit | C# |
81ff0d01497baaa57ecea5f0ea05a68fec465b65 | Fix typo | Azure-Samples/active-directory-dotnet-webapp-roleclaims,AzureADSamples/WebApp-RoleClaims-DotNet,AzureADSamples/WebApp-RoleClaims-DotNet,AzureADSamples/WebApp-RoleClaims-DotNet,Azure-Samples/active-directory-dotnet-webapp-roleclaims,peterlil/active-directory-dotnet-webapp-roleclaims,Azure-Samples/active-directory-dotnet-webapp-roleclaims,peterlil/active-directory-dotnet-webapp-roleclaims,peterlil/active-directory-dotnet-webapp-roleclaims | WebApp-RoleClaims-DotNet/AuthorizeAttribute.cs | WebApp-RoleClaims-DotNet/AuthorizeAttribute.cs | using System;
using System.Web.Mvc;
using System.Web.Routing;
namespace WebApp_RoleClaims_DotNet
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)]
public class AuthorizeAttribute : System.Web.Mvc.AuthorizeAttribute
{
/// <summary>
/// By Default, MVC returns a 401 Unauthorized when a user's roles do not meet the AuthorizeAttribute requirements.
/// This initializes a reauthentication request to our identity provider. Since the user is already logged in,
/// AAD returns to the same page, which then issues another 401, creating a redirect loop.
/// Here, we override the AuthorizeAttribute's HandleUnauthorizedRequest method to show something that makes
/// sense in the context of our application.
/// </summary>
protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
{
if (filterContext.HttpContext.Request.IsAuthenticated)
{
//One Strategy:
//filterContext.Result = new System.Web.Mvc.HttpStatusCodeResult((int)System.Net.HttpStatusCode.Forbidden);
//Another Strategy:
filterContext.Result = new RedirectToRouteResult(
new RouteValueDictionary(
new
{
controller = "Error",
action = "ShowError",
errorMessage = "You do not have sufficient privileges to view this page."
})
);
}
else
{
base.HandleUnauthorizedRequest(filterContext);
}
}
}
} | using System;
using System.Web.Mvc;
using System.Web.Routing;
namespace WebApp_RoleClaims_DotNet
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)]
public class AuthorizeAttribute : System.Web.Mvc.AuthorizeAttribute
{
/// <summary>
/// By Default, MVC returns a 401 Unauthorized when a user's roles do not meet the AuthorizeAttribute requirements.
/// This initializes a reauthentication request to our identity provider. Since the user is already logged in,
/// AAD returns to the same page, which then issues another 401, creating a redirect loop.
/// Here, we override the AuthorizeAttribute's HandleUnauthorizedRequest method to show something that makes
/// sense in the context of our application.
/// </summary>
protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
{
if (filterContext.HttpContext.Request.IsAuthenticated)
{
//One Strategy:
//filterContext.Result = new System.Web.Mvc.HttpStatusCodeResult((int)System.Net.HttpStatusCode.Forbidden);
//Another Strategy:
filterContext.Result = new RedirectToRouteResult(
new RouteValueDictionary(
new
{
controller = "Error",
action = "ShowError",
errorMessage = "You do not have sufficient priviliges to view this page."
})
);
}
else
{
base.HandleUnauthorizedRequest(filterContext);
}
}
}
} | mit | C# |
bab16971ae3fe0d117154ab2697b25b5b2056657 | Add comment for claims transform | aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore | src/Microsoft.AspNetCore.Authentication.Abstractions/IClaimsTransformation.cs | src/Microsoft.AspNetCore.Authentication.Abstractions/IClaimsTransformation.cs | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Security.Claims;
using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Authentication
{
/// <summary>
/// Used by the <see cref="IAuthenticationService"/> for claims transformation.
/// </summary>
public interface IClaimsTransformation
{
/// <summary>
/// Provides a central transformation point to change the specified principal.
/// Note: this will be run on each AuthenticateAsync call, so its safer to
/// return a new ClaimsPrincipal if your transformation is not idempotent.
/// </summary>
/// <param name="principal">The <see cref="ClaimsPrincipal"/> to transform.</param>
/// <returns>The transformed principal.</returns>
Task<ClaimsPrincipal> TransformAsync(ClaimsPrincipal principal);
}
} | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Security.Claims;
using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Authentication
{
/// <summary>
/// Used by the <see cref="IAuthenticationService"/> for claims transformation.
/// </summary>
public interface IClaimsTransformation
{
/// <summary>
/// Provides a central transformation point to change the specified principal.
/// </summary>
/// <param name="principal">The <see cref="ClaimsPrincipal"/> to transform.</param>
/// <returns>The transformed principal.</returns>
Task<ClaimsPrincipal> TransformAsync(ClaimsPrincipal principal);
}
} | apache-2.0 | C# |
e7ce6a307e1bdc36b1aff0f72e556e6d369c5cd0 | Handle Invalid format for Upgrade check | madsoulswe/Umbraco-CMS,bjarnef/Umbraco-CMS,umbraco/Umbraco-CMS,abryukhov/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,abjerner/Umbraco-CMS,mattbrailsford/Umbraco-CMS,bjarnef/Umbraco-CMS,abryukhov/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abryukhov/Umbraco-CMS,robertjf/Umbraco-CMS,dawoe/Umbraco-CMS,umbraco/Umbraco-CMS,madsoulswe/Umbraco-CMS,robertjf/Umbraco-CMS,arknu/Umbraco-CMS,marcemarc/Umbraco-CMS,madsoulswe/Umbraco-CMS,leekelleher/Umbraco-CMS,leekelleher/Umbraco-CMS,arknu/Umbraco-CMS,dawoe/Umbraco-CMS,dawoe/Umbraco-CMS,umbraco/Umbraco-CMS,bjarnef/Umbraco-CMS,bjarnef/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,KevinJump/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,arknu/Umbraco-CMS,abjerner/Umbraco-CMS,marcemarc/Umbraco-CMS,marcemarc/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,marcemarc/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,umbraco/Umbraco-CMS,mattbrailsford/Umbraco-CMS,robertjf/Umbraco-CMS,leekelleher/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,leekelleher/Umbraco-CMS,KevinJump/Umbraco-CMS,leekelleher/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abryukhov/Umbraco-CMS | src/Umbraco.Core/Persistence/Repositories/Implement/UpgradeCheckRepository.cs | src/Umbraco.Core/Persistence/Repositories/Implement/UpgradeCheckRepository.cs | using System.Net.Http;
using System.Net.Http.Formatting;
using System.Threading.Tasks;
using Semver;
using Umbraco.Core.Models;
namespace Umbraco.Core.Persistence.Repositories.Implement
{
internal class UpgradeCheckRepository : IUpgradeCheckRepository
{
private static HttpClient _httpClient;
private const string RestApiUpgradeChecklUrl = "https://our.umbraco.com/umbraco/api/UpgradeCheck/CheckUpgrade";
public async Task<UpgradeResult> CheckUpgradeAsync(SemVersion version)
{
try
{
if (_httpClient == null)
_httpClient = new HttpClient();
var task = await _httpClient.PostAsync(RestApiUpgradeChecklUrl, new CheckUpgradeDto(version), new JsonMediaTypeFormatter());
var result = await task.Content.ReadAsAsync<UpgradeResult>();
return result ?? new UpgradeResult("None", "", "");
}
catch (UnsupportedMediaTypeException)
{
// this occurs if the server for Our is up but doesn't return a valid result (ex. content type)
return new UpgradeResult("None", "", "");
}
catch (HttpRequestException)
{
// this occurs if the server for Our is down or cannot be reached
return new UpgradeResult("None", "", "");
}
}
private class CheckUpgradeDto
{
public CheckUpgradeDto(SemVersion version)
{
VersionMajor = version.Major;
VersionMinor = version.Minor;
VersionPatch = version.Patch;
VersionComment = version.Prerelease;
}
public int VersionMajor { get; }
public int VersionMinor { get; }
public int VersionPatch { get; }
public string VersionComment { get; }
}
}
}
| using System.Net.Http;
using System.Net.Http.Formatting;
using System.Threading.Tasks;
using Semver;
using Umbraco.Core.Models;
namespace Umbraco.Core.Persistence.Repositories.Implement
{
internal class UpgradeCheckRepository : IUpgradeCheckRepository
{
private static HttpClient _httpClient;
private const string RestApiUpgradeChecklUrl = "https://our.umbraco.com/umbraco/api/UpgradeCheck/CheckUpgrade";
public async Task<UpgradeResult> CheckUpgradeAsync(SemVersion version)
{
try
{
if (_httpClient == null)
_httpClient = new HttpClient();
var task = await _httpClient.PostAsync(RestApiUpgradeChecklUrl, new CheckUpgradeDto(version), new JsonMediaTypeFormatter());
var result = await task.Content.ReadAsAsync<UpgradeResult>();
return result ?? new UpgradeResult("None", "", "");
}
catch (HttpRequestException)
{
// this occurs if the server for Our is down or cannot be reached
return new UpgradeResult("None", "", "");
}
}
private class CheckUpgradeDto
{
public CheckUpgradeDto(SemVersion version)
{
VersionMajor = version.Major;
VersionMinor = version.Minor;
VersionPatch = version.Patch;
VersionComment = version.Prerelease;
}
public int VersionMajor { get; }
public int VersionMinor { get; }
public int VersionPatch { get; }
public string VersionComment { get; }
}
}
}
| mit | C# |
c626b1afd859fe2e0b6dc33174cf6f20d7679f80 | Use newer binary from upstream | xamarin/XamarinComponents,xamarin/XamarinComponents,xamarin/XamarinComponents,xamarin/XamarinComponents,xamarin/XamarinComponents,xamarin/XamarinComponents | Android/ExposureNotification/build.cake | Android/ExposureNotification/build.cake | var TARGET = Argument ("t", Argument ("target", "ci"));
var NUGET_VERSION = "18.0.2-eap.3";
var AAR_URL = "https://github.com/google/exposure-notifications-android/raw/fbba9296bda9ae3b2c02d2bfd7590c742963875e/app/libs/play-services-nearby-18.0.2-eap.aar";
Task ("externals")
.Does (() =>
{
EnsureDirectoryExists ("./externals");
DownloadFile(AAR_URL, "./externals/play-services-nearby-18.0.2-eap.aar");
// Update .csproj nuget versions
XmlPoke("./source/PlayServicesNearby/PlayServicesNearby.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION);
});
Task("libs")
.IsDependentOn("externals")
.Does(() =>
{
MSBuild("./PlayServicesNearby.sln", c => {
c.Configuration = "Release";
c.Restore = true;
c.MaxCpuCount = 0;
c.Properties.Add("DesignTimeBuild", new [] { "false" });
});
});
Task("nuget")
.IsDependentOn("libs")
.Does(() =>
{
MSBuild ("./PlayServicesNearby.sln", c => {
c.Configuration = "Release";
c.MaxCpuCount = 0;
c.Targets.Clear();
c.Targets.Add("Pack");
c.Properties.Add("PackageOutputPath", new [] { MakeAbsolute(new FilePath("./output")).FullPath });
c.Properties.Add("PackageRequireLicenseAcceptance", new [] { "true" });
c.Properties.Add("DesignTimeBuild", new [] { "false" });
});
});
Task("samples")
.IsDependentOn("nuget");
Task("ci")
.IsDependentOn("samples");
Task ("clean")
.Does (() =>
{
if (DirectoryExists ("./externals/"))
DeleteDirectory ("./externals", new DeleteDirectorySettings {
Recursive = true,
Force = true
});
});
RunTarget (TARGET);
| var TARGET = Argument ("t", Argument ("target", "ci"));
var NUGET_VERSION = "18.0.2-eap.2";
var AAR_URL = "https://github.com/google/exposure-notifications-android/raw/1e4c8e322f4189a609623540f665e05ee1eeccb7/app/libs/play-services-nearby-18.0.2-eap.aar";
Task ("externals")
.Does (() =>
{
EnsureDirectoryExists ("./externals");
DownloadFile(AAR_URL, "./externals/play-services-nearby-18.0.2-eap.aar");
// Update .csproj nuget versions
XmlPoke("./source/PlayServicesNearby/PlayServicesNearby.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION);
});
Task("libs")
.IsDependentOn("externals")
.Does(() =>
{
MSBuild("./PlayServicesNearby.sln", c => {
c.Configuration = "Release";
c.Restore = true;
c.MaxCpuCount = 0;
c.Properties.Add("DesignTimeBuild", new [] { "false" });
});
});
Task("nuget")
.IsDependentOn("libs")
.Does(() =>
{
MSBuild ("./PlayServicesNearby.sln", c => {
c.Configuration = "Release";
c.MaxCpuCount = 0;
c.Targets.Clear();
c.Targets.Add("Pack");
c.Properties.Add("PackageOutputPath", new [] { MakeAbsolute(new FilePath("./output")).FullPath });
c.Properties.Add("PackageRequireLicenseAcceptance", new [] { "true" });
c.Properties.Add("DesignTimeBuild", new [] { "false" });
});
});
Task("samples")
.IsDependentOn("nuget");
Task("ci")
.IsDependentOn("samples");
Task ("clean")
.Does (() =>
{
if (DirectoryExists ("./externals/"))
DeleteDirectory ("./externals", new DeleteDirectorySettings {
Recursive = true,
Force = true
});
});
RunTarget (TARGET);
| mit | C# |
15fe4ae7a8e81d66a6e48531338b0a578a1d9ea8 | Set toolbar popup initial state | DMagic1/KSP_Contract_Window | Source/ContractsWindow.Unity/Unity/CW_Toolbar.cs | Source/ContractsWindow.Unity/Unity/CW_Toolbar.cs | #region license
/*The MIT License (MIT)
CW_Toolbar - Controls the toolbar options popup
Copyright (c) 2016 DMagic
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#endregion
using System;
using System.Collections.Generic;
using ContractsWindow.Unity.Interfaces;
using UnityEngine;
using UnityEngine.UI;
namespace ContractsWindow.Unity.Unity
{
[RequireComponent(typeof(CanvasGroup), typeof(RectTransform))]
public class CW_Toolbar : CW_Popup
{
[SerializeField]
private Toggle StockToggle = null;
[SerializeField]
private Toggle StockReplace = null;
private bool loaded;
public void setToolbar()
{
if (CW_Window.Window == null)
return;
if (CW_Window.Window.Interface == null)
return;
if (StockToggle != null)
{
StockToggle.isOn = CW_Window.Window.Interface.StockToolbar;
if (!CW_Window.Window.Interface.BlizzyAvailable)
StockToggle.gameObject.SetActive(false);
}
if (StockReplace != null)
{
StockReplace.isOn = CW_Window.Window.Interface.ReplaceToolbar;
if (!CW_Window.Window.Interface.StockToolbar)
StockReplace.gameObject.SetActive(false);
}
loaded = true;
FadeIn();
}
public void UseStockToolbar(bool isOn)
{
if (!loaded)
return;
if (CW_Window.Window == null)
return;
if (CW_Window.Window.Interface == null)
return;
if (!CW_Window.Window.Interface.BlizzyAvailable)
{
CW_Window.Window.Interface.StockToolbar = true;
return;
}
CW_Window.Window.Interface.StockToolbar = isOn;
if (StockReplace != null)
StockReplace.gameObject.SetActive(isOn);
}
public void ReplaceStockToolbar(bool isOn)
{
if (!loaded)
return;
if (CW_Window.Window == null)
return;
if (CW_Window.Window.Interface == null)
return;
CW_Window.Window.Interface.ReplaceToolbar = isOn;
}
public void Close()
{
if (CW_Window.Window == null)
return;
CW_Window.Window.FadePopup(this);
}
public override void ClosePopup()
{
gameObject.SetActive(false);
Destroy(gameObject);
}
}
}
| #region license
/*The MIT License (MIT)
CW_Toolbar - Controls the toolbar options popup
Copyright (c) 2016 DMagic
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#endregion
using System;
using System.Collections.Generic;
using ContractsWindow.Unity.Interfaces;
using UnityEngine;
using UnityEngine.UI;
namespace ContractsWindow.Unity.Unity
{
[RequireComponent(typeof(CanvasGroup), typeof(RectTransform))]
public class CW_Toolbar : CW_Popup
{
[SerializeField]
private Toggle StockToggle = null;
[SerializeField]
private Toggle StockReplace = null;
public void setToolbar()
{
if (CW_Window.Window == null)
return;
if (CW_Window.Window.Interface == null)
return;
if (StockToggle == null && !CW_Window.Window.Interface.BlizzyAvailable)
StockToggle.gameObject.SetActive(false);
if (StockReplace == null && !CW_Window.Window.Interface.StockToolbar)
StockReplace.gameObject.SetActive(false);
FadeIn();
}
public void UseStockToolbar(bool isOn)
{
if (CW_Window.Window == null)
return;
if (CW_Window.Window.Interface == null)
return;
if (!CW_Window.Window.Interface.BlizzyAvailable)
{
CW_Window.Window.Interface.StockToolbar = true;
return;
}
CW_Window.Window.Interface.StockToolbar = isOn;
if (StockReplace != null)
StockReplace.gameObject.SetActive(isOn);
}
public void ReplaceStockToolbar(bool isOn)
{
if (CW_Window.Window == null)
return;
if (CW_Window.Window.Interface == null)
return;
CW_Window.Window.Interface.ReplaceToolbar = isOn;
}
public void Close()
{
if (CW_Window.Window == null)
return;
CW_Window.Window.FadePopup(this);
}
public override void ClosePopup()
{
gameObject.SetActive(false);
Destroy(gameObject);
}
}
}
| mit | C# |
1a761239cbf4f52666327e5b2ce7e62a4cc0f43d | Remove class variable declaration for UINavigationController | iFreedive/monotouch-samples,iFreedive/monotouch-samples,robinlaide/monotouch-samples,W3SS/monotouch-samples,labdogg1003/monotouch-samples,haithemaraissia/monotouch-samples,W3SS/monotouch-samples,peteryule/monotouch-samples,peteryule/monotouch-samples,davidrynn/monotouch-samples,nelzomal/monotouch-samples,kingyond/monotouch-samples,markradacz/monotouch-samples,W3SS/monotouch-samples,andypaul/monotouch-samples,xamarin/monotouch-samples,nelzomal/monotouch-samples,hongnguyenpro/monotouch-samples,robinlaide/monotouch-samples,a9upam/monotouch-samples,nelzomal/monotouch-samples,a9upam/monotouch-samples,peteryule/monotouch-samples,andypaul/monotouch-samples,hongnguyenpro/monotouch-samples,hongnguyenpro/monotouch-samples,nervevau2/monotouch-samples,sakthivelnagarajan/monotouch-samples,haithemaraissia/monotouch-samples,haithemaraissia/monotouch-samples,YOTOV-LIMITED/monotouch-samples,davidrynn/monotouch-samples,a9upam/monotouch-samples,haithemaraissia/monotouch-samples,kingyond/monotouch-samples,a9upam/monotouch-samples,davidrynn/monotouch-samples,markradacz/monotouch-samples,YOTOV-LIMITED/monotouch-samples,nervevau2/monotouch-samples,sakthivelnagarajan/monotouch-samples,nervevau2/monotouch-samples,hongnguyenpro/monotouch-samples,sakthivelnagarajan/monotouch-samples,robinlaide/monotouch-samples,iFreedive/monotouch-samples,nervevau2/monotouch-samples,albertoms/monotouch-samples,markradacz/monotouch-samples,andypaul/monotouch-samples,peteryule/monotouch-samples,labdogg1003/monotouch-samples,andypaul/monotouch-samples,labdogg1003/monotouch-samples,nelzomal/monotouch-samples,YOTOV-LIMITED/monotouch-samples,davidrynn/monotouch-samples,albertoms/monotouch-samples,albertoms/monotouch-samples,kingyond/monotouch-samples,robinlaide/monotouch-samples,sakthivelnagarajan/monotouch-samples,xamarin/monotouch-samples,labdogg1003/monotouch-samples,YOTOV-LIMITED/monotouch-samples,xamarin/monotouch-samples | Hello_MultiScreen_iPhone/AppDelegate.cs | Hello_MultiScreen_iPhone/AppDelegate.cs | using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Hello_MultiScreen_iPhone
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
//---- declarations
UIWindow window;
// This method is invoked when the application has loaded its UI and it is ready to run
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
this.window = new UIWindow (UIScreen.MainScreen.Bounds);
//---- instantiate a new navigation controller
var rootNavigationController = new UINavigationController();
//---- instantiate a new home screen
HomeScreen homeScreen = new HomeScreen();
//---- add the home screen to the navigation controller (it'll be the top most screen)
rootNavigationController.PushViewController(homeScreen, false);
//---- set the root view controller on the window. the nav controller will handle the rest
this.window.RootViewController = rootNavigationController;
this.window.MakeKeyAndVisible ();
return true;
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Hello_MultiScreen_iPhone
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
//---- declarations
UIWindow window;
UINavigationController rootNavigationController;
// This method is invoked when the application has loaded its UI and it is ready to run
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
this.window = new UIWindow (UIScreen.MainScreen.Bounds);
//---- instantiate a new navigation controller
this.rootNavigationController = new UINavigationController();
//---- instantiate a new home screen
HomeScreen homeScreen = new HomeScreen();
//---- add the home screen to the navigation controller (it'll be the top most screen)
this.rootNavigationController.PushViewController(homeScreen, false);
//---- set the root view controller on the window. the nav controller will handle the rest
this.window.RootViewController = this.rootNavigationController;
this.window.MakeKeyAndVisible ();
return true;
}
}
}
| mit | C# |
2fa4d68097f09463abcf94bb894daf1a23e987c5 | Replace estimatefee with estimatesmartfee | nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet | HiddenWallet.ChaumianTumbler/Program.cs | HiddenWallet.ChaumianTumbler/Program.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;
using System.Threading;
using NBitcoin;
using HiddenWallet.ChaumianTumbler.Configuration;
using NBitcoin.RPC;
using System.Net;
namespace HiddenWallet.ChaumianTumbler
{
public class Program
{
#pragma warning disable IDE1006 // Naming Styles
public static async Task Main(string[] args)
#pragma warning restore IDE1006 // Naming Styles
{
try
{
var configFilePath = Path.Combine(Global.DataDir, "Config.json");
Global.Config = new Config();
await Global.Config.LoadOrCreateDefaultFileAsync(configFilePath, CancellationToken.None);
Global.RpcClient = new RPCClient(
credentials: new RPCCredentialString
{
UserPassword = new NetworkCredential(Global.Config.BitcoinRpcUser, Global.Config.BitcoinRpcPassword)
},
network: Global.Config.Network);
await AssertRpcNodeFullyInitializedAsync();
Global.StateMachine = new TumblerStateMachine();
Global.StateMachineJobCancel = new CancellationTokenSource();
Global.StateMachineJob = Global.StateMachine.StartAsync(Global.StateMachineJobCancel.Token);
using (var host = WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build())
{
await host.RunAsync();
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
Console.WriteLine("Press a key to exit...");
Console.ReadKey();
}
}
private static async Task AssertRpcNodeFullyInitializedAsync()
{
RPCResponse blockchainInfo = await Global.RpcClient.SendCommandAsync(RPCOperations.getblockchaininfo);
try
{
if (blockchainInfo.Error != null)
{
throw new NotSupportedException("blockchainInfo.Error != null");
}
if (blockchainInfo.Result == null)
{
throw new NotSupportedException("blockchainInfo.Result == null");
}
int blocks = blockchainInfo.Result.Value<int>("blocks");
if (blocks == 0)
{
throw new NotSupportedException("blocks == 0");
}
int headers = blockchainInfo.Result.Value<int>("headers");
if (headers == 0)
{
throw new NotSupportedException("headers == 0");
}
if (blocks != headers)
{
throw new NotSupportedException("blocks != headers");
}
if (await Global.RpcClient.SendCommandAsync("estimatesmartfee", 1, "ECONOMICAL") == null)
{
throw new NotSupportedException("estimatesmartfee 1 ECONOMICAL == null");
}
}
catch
{
Console.WriteLine("Bitcoin Core is not yet fully initialized.");
throw;
}
}
}
}
| using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System.Threading;
using NBitcoin;
using HiddenWallet.ChaumianTumbler.Configuration;
using NBitcoin.RPC;
using System.Net;
namespace HiddenWallet.ChaumianTumbler
{
public class Program
{
#pragma warning disable IDE1006 // Naming Styles
public static async Task Main(string[] args)
#pragma warning restore IDE1006 // Naming Styles
{
try
{
var configFilePath = Path.Combine(Global.DataDir, "Config.json");
Global.Config = new Config();
await Global.Config.LoadOrCreateDefaultFileAsync(configFilePath, CancellationToken.None);
Global.RpcClient = new RPCClient(
credentials: new RPCCredentialString
{
UserPassword = new NetworkCredential(Global.Config.BitcoinRpcUser, Global.Config.BitcoinRpcPassword)
},
network: Global.Config.Network);
await AssertRpcNodeFullyInitializedAsync();
Global.StateMachine = new TumblerStateMachine();
Global.StateMachineJobCancel = new CancellationTokenSource();
Global.StateMachineJob = Global.StateMachine.StartAsync(Global.StateMachineJobCancel.Token);
using (var host = WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build())
{
await host.RunAsync();
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
Console.WriteLine("Press a key to exit...");
Console.ReadKey();
}
}
private static async Task AssertRpcNodeFullyInitializedAsync()
{
RPCResponse blockchainInfo = await Global.RpcClient.SendCommandAsync(RPCOperations.getblockchaininfo);
try
{
if (blockchainInfo.Error != null)
{
throw new NotSupportedException("blockchainInfo.Error != null");
}
if (blockchainInfo.Result == null)
{
throw new NotSupportedException("blockchainInfo.Result == null");
}
int blocks = blockchainInfo.Result.Value<int>("blocks");
if (blocks == 0)
{
throw new NotSupportedException("blocks == 0");
}
int headers = blockchainInfo.Result.Value<int>("headers");
if (headers == 0)
{
throw new NotSupportedException("headers == 0");
}
if (blocks != headers)
{
throw new NotSupportedException("blocks != headers");
}
if (await Global.RpcClient.EstimateFeeRateAsync(1) == null)
{
throw new NotSupportedException("estimatefee 1 == null");
}
}
catch
{
Console.WriteLine("Bitcoin Core is not yet fully initialized.");
throw;
}
}
}
}
| mit | C# |
528e3288d9c6a2683bf82eaf70ac454e61ff343c | update desc | bitzhuwei/CSharpGL,bitzhuwei/CSharpGL,bitzhuwei/CSharpGL | CSharpGL/Properties/AssemblyInfo.cs | CSharpGL/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("CSharpGL")]
[assembly: AssemblyDescription(
@"CSharpGL allows you to use OpenGL functions in the Object-Oriented way.
For more information please check (http://bitzhuwei.github.io/CSharpGL/)")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("bitzhuwei")]
[assembly: AssemblyProduct("CSharpGL")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("bbae5fc4-9f20-4b2d-b59c-95639c58d089")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.4.1")]
[assembly: AssemblyFileVersion("1.0.4.1")]
| using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("CSharpGL")]
[assembly: AssemblyDescription(
@"CSharpGL allows you to use OpenGL functions in the Object-Oriented way.
It wraps OpenGL’s functions and use enum type as parameters instead of ‘uint’for some functions.
It abstracts objects inside OpenGL and describes them as classes.
It provides maths class for matrix and vectors.
It provide useful utilities.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("bitzhuwei")]
[assembly: AssemblyProduct("CSharpGL")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("bbae5fc4-9f20-4b2d-b59c-95639c58d089")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.4.1")]
[assembly: AssemblyFileVersion("1.0.4.1")]
| mit | C# |
ea477a218df2197938d5f4bbe78d43279317c983 | Update Variables.cs | amay077/Xamarin.Forms.GoogleMaps | XFGoogleMapSample/XFGoogleMapSample/Variables.cs | XFGoogleMapSample/XFGoogleMapSample/Variables.cs | /// PLEASE RENAME THIS FILE TO Variables.cs
using System;
namespace XFGoogleMapSample
{
public static class Variables
{
// https://developers.google.com/maps/documentation/android-api/signup
public const string GOOGLE_MAPS_ANDROID_API_KEY = "your_android_maps_apikey";
// https://developers.google.com/maps/documentation/ios-sdk/start#step_4_get_an_api_key
public const string GOOGLE_MAPS_IOS_API_KEY = "your_ios_maps_apikey";
}
}
| /// PLEASE RENAME THIS FILE TO Variables.cs
using System;
namespace XFGoogleMapSample
{
public static class Variables
{
// https://developers.google.com/maps/documentation/android-api/signup
public const string GOOGLE_MAPS_ANDROID_API_KEY = "AIzaSyDJEUQvRgCbnqob11uGvy-DuX37hvCYFXc";
// https://developers.google.com/maps/documentation/ios-sdk/start#step_4_get_an_api_key
public const string GOOGLE_MAPS_IOS_API_KEY = "AIzaSyDy-l6HDdq6nucnWc7R7pyUhLPvyORt5Rc";
}
}
| mit | C# |
03f61e240cd512d69f9248dcb9c475c62430ff48 | Remove tracing from the unifier | Logicalshift/Reason | LogicalShift.Reason/BasicUnification.cs | LogicalShift.Reason/BasicUnification.cs | using LogicalShift.Reason.Api;
using LogicalShift.Reason.Unification;
using System;
using System.Collections.Generic;
namespace LogicalShift.Reason
{
/// <summary>
/// Helper methods for performing unification
/// </summary>
public static class BasicUnification
{
/// <summary>
/// Returns the possible ways that a query term can unify with a program term
/// </summary>
public static IEnumerable<ILiteral> Unify(this ILiteral query, ILiteral program)
{
var simpleUnifier = new SimpleUnifier();
// Run the unifier
try
{
simpleUnifier.QueryUnifier.Compile(query);
simpleUnifier.PrepareToRunProgram();
simpleUnifier.ProgramUnifier.Compile(program);
}
catch (InvalidOperationException)
{
// No results
// TODO: really should report failure in a better way
yield break;
}
// Retrieve the unified value for the program
var result = simpleUnifier.UnifiedValue(query.UnificationKey ?? query);
// If the result was valid, return as the one value from this function
if (result != null)
{
yield return result;
}
}
}
}
| using LogicalShift.Reason.Api;
using LogicalShift.Reason.Unification;
using System;
using System.Collections.Generic;
namespace LogicalShift.Reason
{
/// <summary>
/// Helper methods for performing unification
/// </summary>
public static class BasicUnification
{
/// <summary>
/// Returns the possible ways that a query term can unify with a program term
/// </summary>
public static IEnumerable<ILiteral> Unify(this ILiteral query, ILiteral program)
{
var simpleUnifier = new SimpleUnifier();
var traceUnifier = new TraceUnifier(simpleUnifier);
// Run the unifier
try
{
Console.WriteLine(query);
traceUnifier.QueryUnifier.Compile(query);
simpleUnifier.PrepareToRunProgram();
Console.WriteLine(program);
traceUnifier.ProgramUnifier.Compile(program);
}
catch (InvalidOperationException)
{
// No results
// TODO: really should report failure in a better way
yield break;
}
// Retrieve the unified value for the program
// TODO: eventually we'll need to use a unification key
var result = simpleUnifier.UnifiedValue(program.UnificationKey ?? program);
// If the result was valid, return as the one value from this function
if (result != null)
{
yield return result;
}
}
}
}
| apache-2.0 | C# |
580bdd8c86dca4a91057319b4e50947acd95d4c4 | Update HomeController description | uheerme/core,uheerme/core,uheerme/core | Samesound/Controllers/HomeController.cs | Samesound/Controllers/HomeController.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Samesound.Controllers
{
/// <summary>
/// The web application's controller.
/// </summary>
public class HomeController : Controller
{
/// <summary>
/// The method that returns the Home view, which contains the angular.js application.
/// </summary>
/// <returns>The Home view.</returns>
public ActionResult Index()
{
return View();
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Samesound.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
}
}
| mit | C# |
d20a79c3f992261665b41203207621be9aee9100 | Update bridge to use new interface | Cyberboss/tgstation-server,tgstation/tgstation-server-tools,tgstation/tgstation-server,tgstation/tgstation-server,Cyberboss/tgstation-server | TGS.Interface.Bridge/DreamDaemonBridge.cs | TGS.Interface.Bridge/DreamDaemonBridge.cs | using RGiesecke.DllExport;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace TGS.Interface.Bridge
{
/// <summary>
/// Holds the proc that DD calls to access <see cref="ITGInterop"/>
/// </summary>
public static class DreamDaemonBridge
{
/// <summary>
/// The proc that DD calls to access <see cref="ITGInterop"/>
/// </summary>
/// <param name="argc">The number of arguments passed</param>
/// <param name="args">The arguments passed</param>
/// <returns>0</returns>
[DllExport("DDEntryPoint", CallingConvention = CallingConvention.Cdecl)]
public static int DDEntryPoint(int argc, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 0)]string[] args)
{
try
{
var parsedArgs = new List<string>();
parsedArgs.AddRange(args);
var instance = parsedArgs[0];
parsedArgs.RemoveAt(0);
using (var I = new ServerInterface())
I.Server.GetInstance(instance).Interop.InteropMessage(String.Join(" ", parsedArgs));
}
catch { }
return 0;
}
}
}
| using RGiesecke.DllExport;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using TGS.Interface;
using TGS.Interface.Components;
namespace TGS.Interface.Bridge
{
/// <summary>
/// Holds the proc that DD calls to access <see cref="ITGInterop"/>
/// </summary>
public static class DreamDaemonBridge
{
/// <summary>
/// The proc that DD calls to access <see cref="ITGInterop"/>
/// </summary>
/// <param name="argc">The number of arguments passed</param>
/// <param name="args">The arguments passed</param>
/// <returns>0</returns>
[DllExport("DDEntryPoint", CallingConvention = CallingConvention.Cdecl)]
public static int DDEntryPoint(int argc, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 0)]string[] args)
{
try
{
var parsedArgs = new List<string>();
parsedArgs.AddRange(args);
var instance = parsedArgs[0];
parsedArgs.RemoveAt(0);
using (var I = new ServerInterface())
if(I.ConnectToInstance(instance, true).HasFlag(ConnectivityLevel.Connected))
I.GetComponent<ITGInterop>().InteropMessage(String.Join(" ", parsedArgs));
}
catch { }
return 0;
}
}
}
| agpl-3.0 | C# |
3cc16e8a108f0e5b15d4d2fcb03da153313e2e9f | add RegexHelper | jwldnr/VisualLinter | VisualLinter/Helpers/EnvironmentHelper.cs | VisualLinter/Helpers/EnvironmentHelper.cs | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace jwldnr.VisualLinter.Helpers
{
internal static class EnvironmentHelper
{
internal static string GetVariable(string name)
{
return GetVariableInfo("PATH", EnvironmentVariableTarget.User)
.Select(value => new { value, files = GetFiles(value) })
.Where(info => null != info.files)
.Where(info => info.files.Any(file => file.IndexOf(name, StringComparison.OrdinalIgnoreCase) != -1))
.Select(info => GetExecutable(Path.Combine(Environment.ExpandEnvironmentVariables(info.value), name)))
.FirstOrDefault();
}
private static string GetExecutable(string name)
{
return GetVariableInfo("PATHEXT", EnvironmentVariableTarget.Machine)
.Where(value => null != value)
.Select(value => new { value, file = name + value })
.Where(info => File.Exists(info.file))
.Select(info => info.file)
.FirstOrDefault();
}
private static string[] GetFiles(string value)
{
try
{
return Directory.GetFiles(value);
}
catch (Exception)
{
return null;
}
}
private static IEnumerable<string> GetVariableInfo(string variable, EnvironmentVariableTarget target)
{
try
{
return Environment.GetEnvironmentVariable(variable, target)?
.Split(Path.PathSeparator);
}
catch (Exception)
{
return null;
}
}
}
} | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace jwldnr.VisualLinter.Helpers
{
internal static class EnvironmentHelper
{
internal static string GetVariable(string name) => GetVariableInfo("PATH", EnvironmentVariableTarget.User)
.Select(value => new { value, files = GetFiles(value) })
.Where(info => null != info.files)
.Where(info => info.files.Any(file => file.IndexOf(name, StringComparison.OrdinalIgnoreCase) != -1))
.Select(info => GetExecutable(Path.Combine(Environment.ExpandEnvironmentVariables(info.value), name)))
.FirstOrDefault();
private static string GetExecutable(string name) => GetVariableInfo("PATHEXT", EnvironmentVariableTarget.Machine)
.Where(value => null != value)
.Select(value => new { value, file = name + value })
.Where(info => File.Exists(info.file))
.Select(info => info.file)
.FirstOrDefault();
private static string[] GetFiles(string value)
{
try
{
return Directory.GetFiles(value);
}
catch (Exception)
{
return null;
}
}
private static IEnumerable<string> GetVariableInfo(string variable, EnvironmentVariableTarget target)
{
try
{
return Environment.GetEnvironmentVariable(variable, target)?
.Split(Path.PathSeparator);
}
catch (Exception)
{
return null;
}
}
}
} | mit | C# |
e32f4fcf4508f7a94bad4d492b0693f45502077d | バージョンを1.0.3へ。NuGetパッケージと合わせる。 | ume05rw/Xb.Core,ume05rw/Xb.Core | Xb.Core.PCL4.5/Properties/AssemblyInfo.cs | Xb.Core.PCL4.5/Properties/AssemblyInfo.cs | using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("Xb.Core")]
[assembly: AssemblyDescription("Ready to Xamarin, Simple Library(PCL) for .Net")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Do-Be's")]
[assembly: AssemblyProduct("Xb.Core")]
[assembly: AssemblyCopyright("Copyright Do-Be's© 2016")]
[assembly: AssemblyTrademark("Do-Be's")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
[assembly: Guid("39818505-693c-4c7f-883d-77b63e68e618")]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]
[assembly: NeutralResourcesLanguage("ja")]
| using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("Xb.Core")]
[assembly: AssemblyDescription("Ready to Xamarin, Simple Library(PCL) for .Net")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Do-Be's")]
[assembly: AssemblyProduct("Xb.Core")]
[assembly: AssemblyCopyright("Copyright Do-Be's© 2016")]
[assembly: AssemblyTrademark("Do-Be's")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
[assembly: Guid("39818505-693c-4c7f-883d-77b63e68e618")]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: NeutralResourcesLanguage("ja")]
| mit | C# |
9be6421d21041aa64bee9e111459d45b43741717 | Update range documentation. | henrikfroehling/TraktApiSharp | Source/Lib/TraktApiSharp/Utils/Range.cs | Source/Lib/TraktApiSharp/Utils/Range.cs | namespace TraktApiSharp.Utils
{
/// <summary>
/// Represents a range between two values.
/// </summary>
/// <typeparam name="T">The actual underlying data type.</typeparam>
public struct Range<T>
{
/// <summary>Initializes a new instance of the <see cref="Range{T}" /> struct.</summary>
/// <param name="begin">The range's begin value.</param>
/// <param name="end">The range's end value.</param>
public Range(T begin, T end)
{
Begin = begin;
End = end;
}
public T Begin { get; }
public T End { get; }
}
}
| namespace TraktApiSharp.Utils
{
/// <summary>
/// Represents a range between two values.
/// </summary>
/// <typeparam name="T">The actual underlying data type.</typeparam>
public struct Range<T>
{
/// <summary>Initializes a new instance of the <see cref="Range" /> struct.</summary>
/// <param name="begin">The range's begin value.</param>
/// <param name="end">The range's end value.</param>
public Range(T begin, T end)
{
Begin = begin;
End = end;
}
public T Begin { get; }
public T End { get; }
}
}
| mit | C# |
64b2173fd2e6ec2a693090188ca37b4d5e520d7f | Fix possible `Element does not support ... control pattern interface.` | 2gis/Winium.StoreApps,2gis/Winium.StoreApps | Winium/Winium.StoreApps.InnerServer/Commands/Helpers/FrameworkElementExtensions.cs | Winium/Winium.StoreApps.InnerServer/Commands/Helpers/FrameworkElementExtensions.cs | namespace Winium.StoreApps.InnerServer.Commands.Helpers
{
#region
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Winium.Mobile.Common.Exceptions;
#endregion
internal static class FrameworkElementExtensions
{
#region Constants
private const string HelpNotSupportInterfaceMsg = "Element does not support {0} control pattern interface.";
#endregion
#region Methods
internal static string AutomationId(this FrameworkElement element)
{
return element == null ? null : element.GetValue(AutomationProperties.AutomationIdProperty) as string;
}
internal static string AutomationName(this FrameworkElement element)
{
return element == null ? null : element.GetValue(AutomationProperties.NameProperty) as string;
}
internal static string ClassName(this FrameworkElement element)
{
return element == null ? null : element.GetType().ToString();
}
internal static AutomationPeer GetAutomationPeer(this FrameworkElement element)
{
var peer = FrameworkElementAutomationPeer.CreatePeerForElement(element);
if (peer == null)
{
throw new AutomationException("Element does not support AutomationPeer.");
}
return peer;
}
internal static T GetProviderOrDefault<T>(this FrameworkElement element, PatternInterface patternInterface)
where T : class
{
var peer = GetAutomationPeer(element);
return peer == null ? null : peer.GetPattern(patternInterface) as T;
}
internal static T GetProvider<T>(this FrameworkElement element, PatternInterface patternInterface)
where T : class
{
var provider = element.GetProviderOrDefault<T>(patternInterface);
if (provider != null)
{
return provider;
}
throw new AutomationException(string.Format(HelpNotSupportInterfaceMsg, typeof(T).Name));
}
#endregion
}
}
| namespace Winium.StoreApps.InnerServer.Commands.Helpers
{
#region
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Winium.Mobile.Common.Exceptions;
#endregion
internal static class FrameworkElementExtensions
{
#region Constants
private const string HelpNotSupportInterfaceMsg = "Element does not support {0} control pattern interface.";
#endregion
#region Methods
internal static string AutomationId(this FrameworkElement element)
{
return element == null ? null : element.GetValue(AutomationProperties.AutomationIdProperty) as string;
}
internal static string AutomationName(this FrameworkElement element)
{
return element == null ? null : element.GetValue(AutomationProperties.NameProperty) as string;
}
internal static string ClassName(this FrameworkElement element)
{
return element == null ? null : element.GetType().ToString();
}
internal static AutomationPeer GetAutomationPeer(this FrameworkElement element)
{
var peer = FrameworkElementAutomationPeer.FromElement(element);
if (peer == null)
{
throw new AutomationException("Element does not support AutomationPeer.");
}
return peer;
}
internal static T GetProviderOrDefault<T>(this FrameworkElement element, PatternInterface patternInterface)
where T : class
{
var peer = FrameworkElementAutomationPeer.FromElement(element);
return peer == null ? null : peer.GetPattern(patternInterface) as T;
}
internal static T GetProvider<T>(this FrameworkElement element, PatternInterface patternInterface)
where T : class
{
var provider = element.GetProviderOrDefault<T>(patternInterface);
if (provider != null)
{
return provider;
}
throw new AutomationException(string.Format(HelpNotSupportInterfaceMsg, typeof(T).Name));
}
#endregion
}
}
| mpl-2.0 | C# |
fdfd82aec42256ca1f44ab3b576c5c410640316d | Add elastic scale on appear | smoogipoo/osu,peppy/osu,peppy/osu,ppy/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu,peppy/osu-new,smoogipooo/osu,UselessToucan/osu,UselessToucan/osu,smoogipoo/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu | osu.Game/Graphics/UserInterfaceV2/OsuPopover.cs | osu.Game/Graphics/UserInterfaceV2/OsuPopover.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 JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Overlays;
using osuTK;
namespace osu.Game.Graphics.UserInterfaceV2
{
public class OsuPopover : Popover
{
private const float fade_duration = 250;
private const double scale_duration = 500;
public OsuPopover(bool withPadding = true)
{
Content.Padding = withPadding ? new MarginPadding(20) : new MarginPadding();
Body.Masking = true;
Body.CornerRadius = 10;
Body.Margin = new MarginPadding(10);
Body.EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Offset = new Vector2(0, 2),
Radius = 5,
Colour = Colour4.Black.Opacity(0.3f)
};
}
[BackgroundDependencyLoader(true)]
private void load([CanBeNull] OverlayColourProvider colourProvider, OsuColour osuColour)
{
Background.Colour = Arrow.Colour = colourProvider?.Background4 ?? osuColour.GreySeafoamDarker;
}
protected override Drawable CreateArrow() => Empty();
protected override void PopIn()
{
this.ScaleTo(1, scale_duration, Easing.OutElasticHalf);
this.FadeIn(fade_duration, Easing.OutQuint);
}
protected override void PopOut()
{
this.ScaleTo(0.7f, scale_duration, Easing.OutQuint);
this.FadeOut(fade_duration, Easing.OutQuint);
}
}
}
| // 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 JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Overlays;
using osuTK;
namespace osu.Game.Graphics.UserInterfaceV2
{
public class OsuPopover : Popover
{
private const float fade_duration = 250;
public OsuPopover(bool withPadding = true)
{
Content.Padding = withPadding ? new MarginPadding(20) : new MarginPadding();
Body.Masking = true;
Body.CornerRadius = 10;
Body.Margin = new MarginPadding(10);
Body.EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Offset = new Vector2(0, 2),
Radius = 5,
Colour = Colour4.Black.Opacity(0.3f)
};
}
[BackgroundDependencyLoader(true)]
private void load([CanBeNull] OverlayColourProvider colourProvider, OsuColour osuColour)
{
Background.Colour = Arrow.Colour = colourProvider?.Background4 ?? osuColour.GreySeafoamDarker;
}
protected override Drawable CreateArrow() => Empty();
protected override void PopIn() => this.FadeIn(fade_duration, Easing.OutQuint);
protected override void PopOut() => this.FadeOut(fade_duration, Easing.OutQuint);
}
}
| mit | C# |
bb1a72cb6feb961fb10e4104942a40c83c3975d3 | Fix tests being order-dependent | ppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework | osu.Framework.Tests/Localisation/ThreadCultureTest.cs | osu.Framework.Tests/Localisation/ThreadCultureTest.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.Collections.Generic;
using System.Globalization;
using System.Threading;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Platform;
using osu.Framework.Testing;
using osu.Framework.Tests.Visual;
namespace osu.Framework.Tests.Localisation
{
[HeadlessTest]
public class ThreadCultureTest : FrameworkTestScene
{
[Resolved]
private GameHost host { get; set; }
[Resolved]
private FrameworkConfigManager config { get; set; }
[Test]
public void TestDefaultCultureIsInvariant()
{
setCulture("");
assertCulture("");
}
[Test]
public void TestValidCultureIsSelected()
{
setCulture("ko-KR");
assertCulture("ko-KR");
}
[Test]
public void TestInvalidCultureFallsBackToInvariant()
{
setCulture("ko_KR");
assertCulture("");
}
private void setCulture(string name) => AddStep($"set culture = {name}", () => config.Set(FrameworkSetting.Locale, name));
private void assertCulture(string name)
{
var cultures = new List<CultureInfo>();
AddStep("query cultures", () =>
{
host.DrawThread.Scheduler.Add(() => cultures.Add(Thread.CurrentThread.CurrentCulture));
host.UpdateThread.Scheduler.Add(() => cultures.Add(Thread.CurrentThread.CurrentCulture));
host.AudioThread.Scheduler.Add(() => cultures.Add(Thread.CurrentThread.CurrentCulture));
});
AddUntilStep("wait for query", () => cultures.Count == 3);
AddAssert($"culture is {name}", () => cultures.TrueForAll(c => c.Name == name));
}
}
}
| // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Platform;
using osu.Framework.Testing;
using osu.Framework.Tests.Visual;
namespace osu.Framework.Tests.Localisation
{
[HeadlessTest]
public class ThreadCultureTest : FrameworkTestScene
{
[Resolved]
private GameHost host { get; set; }
[Resolved]
private FrameworkConfigManager config { get; set; }
[Test]
public void TestDefaultCultureIsInvariant()
{
assertCulture("");
}
[Test]
public void TestValidCultureIsSelected()
{
setCulture("ko-KR");
assertCulture("ko-KR");
}
[Test]
public void TestInvalidCultureFallsBackToInvariant()
{
setCulture("ko_KR");
assertCulture("");
}
private void setCulture(string name) => AddStep($"set culture = {name}", () => config.Set(FrameworkSetting.Locale, name));
private void assertCulture(string name)
{
var cultures = new List<CultureInfo>();
AddStep("query cultures", () =>
{
host.DrawThread.Scheduler.Add(() => cultures.Add(Thread.CurrentThread.CurrentCulture));
host.UpdateThread.Scheduler.Add(() => cultures.Add(Thread.CurrentThread.CurrentCulture));
host.AudioThread.Scheduler.Add(() => cultures.Add(Thread.CurrentThread.CurrentCulture));
});
AddUntilStep("wait for query", () => cultures.Count == 3);
AddAssert($"culture is {name}", () => cultures.TrueForAll(c => c.Name == name));
}
}
}
| mit | C# |
061d9f8d1b4e41a488145165c3e3f392a408eb42 | Make DimmedLoadingLayer block input when active (#6956) | peppy/osu-new,johnneijzen/osu,EVAST9919/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,NeoAdonis/osu,ppy/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu,smoogipooo/osu,johnneijzen/osu,2yangk23/osu,smoogipoo/osu,2yangk23/osu,ppy/osu,EVAST9919/osu,UselessToucan/osu | osu.Game/Graphics/UserInterface/DimmedLoadingLayer.cs | osu.Game/Graphics/UserInterface/DimmedLoadingLayer.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 osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Extensions.Color4Extensions;
using osuTK;
namespace osu.Game.Graphics.UserInterface
{
public class DimmedLoadingLayer : OverlayContainer
{
private const float transition_duration = 250;
private readonly LoadingAnimation loading;
public DimmedLoadingLayer(float dimAmount = 0.5f, float iconScale = 1f)
{
RelativeSizeAxes = Axes.Both;
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black.Opacity(dimAmount),
},
loading = new LoadingAnimation { Scale = new Vector2(iconScale) },
};
}
protected override void PopIn()
{
this.FadeIn(transition_duration, Easing.OutQuint);
loading.Show();
}
protected override void PopOut()
{
this.FadeOut(transition_duration, Easing.OutQuint);
loading.Hide();
}
}
}
| // 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 osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Extensions.Color4Extensions;
using osuTK;
namespace osu.Game.Graphics.UserInterface
{
public class DimmedLoadingLayer : VisibilityContainer
{
private const float transition_duration = 250;
private readonly LoadingAnimation loading;
public DimmedLoadingLayer(float dimAmount = 0.5f, float iconScale = 1f)
{
RelativeSizeAxes = Axes.Both;
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black.Opacity(dimAmount),
},
loading = new LoadingAnimation { Scale = new Vector2(iconScale) },
};
}
protected override void PopIn()
{
this.FadeIn(transition_duration, Easing.OutQuint);
loading.Show();
}
protected override void PopOut()
{
this.FadeOut(transition_duration, Easing.OutQuint);
loading.Hide();
}
}
}
| mit | C# |
b9202420b6f85e336764e2d7e2467f8ca091ebc4 | Format unknown OID. | googleprojectzero/sandbox-attacksurface-analysis-tools | NtApiDotNet/Utilities/ASN1/OIDValues.cs | NtApiDotNet/Utilities/ASN1/OIDValues.cs | // Copyright 2020 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless 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.
namespace NtApiDotNet.Utilities.ASN1
{
/// <summary>
/// Class containing known OID values.
/// </summary>
internal static class OIDValues
{
internal const string KERBEROS_NAME = "1.2.840.113554.1.2.2.1";
internal const string KERBEROS_PRINCIPAL = "1.2.840.113554.1.2.2.2";
internal const string KERBEROS_USER_TO_USER = "1.2.840.113554.1.2.2.3";
internal const string KERBEROS = "1.2.840.113554.1.2.2";
internal const string MS_KERBEROS = "1.2.840.48018.1.2.2";
internal const string NTLM_SSP = "1.3.6.1.4.1.311.2.2.10";
internal const string MS_NEGOX = "1.3.6.1.4.1.311.2.2.30";
internal const string SPNEGO = "1.3.6.1.5.5.2";
public static string ToString(string oid)
{
switch (oid)
{
case KERBEROS:
case KERBEROS_NAME:
return "Kerberos";
case KERBEROS_USER_TO_USER:
return "Kerberos User to User";
case MS_KERBEROS:
return "Microsoft Kerberos";
case NTLM_SSP:
return "NTLM";
case MS_NEGOX:
return "Microsoft Negotiate Extended";
case SPNEGO:
return "SPNEGO";
default:
return $"UNKNOWN OID {oid}";
}
}
}
}
| // Copyright 2020 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless 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.
namespace NtApiDotNet.Utilities.ASN1
{
/// <summary>
/// Class containing known OID values.
/// </summary>
internal static class OIDValues
{
internal const string KERBEROS_NAME = "1.2.840.113554.1.2.2.1";
internal const string KERBEROS_PRINCIPAL = "1.2.840.113554.1.2.2.2";
internal const string KERBEROS_USER_TO_USER = "1.2.840.113554.1.2.2.3";
internal const string KERBEROS = "1.2.840.113554.1.2.2";
internal const string MS_KERBEROS = "1.2.840.48018.1.2.2";
internal const string NTLM_SSP = "1.3.6.1.4.1.311.2.2.10";
internal const string MS_NEGOX = "1.3.6.1.4.1.311.2.2.30";
internal const string SPNEGO = "1.3.6.1.5.5.2";
public static string ToString(string oid)
{
switch (oid)
{
case KERBEROS:
case KERBEROS_NAME:
return "Kerberos";
case KERBEROS_USER_TO_USER:
return "Kerberos User to User";
case MS_KERBEROS:
return "Microsoft Kerberos";
case NTLM_SSP:
return "NTLM";
case MS_NEGOX:
return "Microsoft Negotiate Extended";
case SPNEGO:
return "SPNEGO";
default:
return "UNKNOWN OID";
}
}
}
}
| apache-2.0 | C# |
6493a4c7d1438c2c2decbd002bc0d28c73db9a86 | Add POST REDIRECT GET Pattern to controller | IliaAnastassov/OdeToFood,IliaAnastassov/OdeToFood | OdeToFood/Controllers/HomeController.cs | OdeToFood/Controllers/HomeController.cs | using Microsoft.AspNetCore.Mvc;
using OdeToFood.Entities;
using OdeToFood.Services;
using OdeToFood.ViewModels;
namespace OdeToFood.Controllers
{
public class HomeController : Controller
{
private IRestaurantData _restaurantData;
private IGreeter _greeter;
public HomeController(IRestaurantData restaurantData, IGreeter greeter)
{
_restaurantData = restaurantData;
_greeter = greeter;
}
public IActionResult Index()
{
var model = new HomePageViewModel()
{
Message = _greeter.GetGreeting(),
Restaurants = _restaurantData.GetAll()
};
return View(model);
}
public IActionResult Details(int id)
{
var model = _restaurantData.Get(id);
if (model == null)
{
return RedirectToAction(nameof(Index));
}
return View(model);
}
[HttpGet]
public IActionResult Create()
{
return View();
}
[HttpPost]
public IActionResult Create(RestaurantEditViewModel model)
{
var restaurant = new Restaurant()
{
Name = model.Name,
Cuisine = model.Cuisine
};
restaurant = _restaurantData.Add(restaurant);
return RedirectToAction(nameof(Details), new { Id = restaurant.Id });
}
}
}
| using System.Linq;
using Microsoft.AspNetCore.Mvc;
using OdeToFood.Entities;
using OdeToFood.Services;
using OdeToFood.ViewModels;
namespace OdeToFood.Controllers
{
public class HomeController : Controller
{
private IRestaurantData _restaurantData;
private IGreeter _greeter;
public HomeController(IRestaurantData restaurantData, IGreeter greeter)
{
_restaurantData = restaurantData;
_greeter = greeter;
}
public IActionResult Index()
{
var model = new HomePageViewModel()
{
Message = _greeter.GetGreeting(),
Restaurants = _restaurantData.GetAll()
};
return View(model);
}
public IActionResult Details(int id)
{
var model = _restaurantData.Get(id);
if (model == null)
{
return RedirectToAction(nameof(Index));
}
return View(model);
}
[HttpGet]
public IActionResult Create()
{
return View();
}
[HttpPost]
public IActionResult Create(RestaurantEditViewModel model)
{
var restaurant = new Restaurant()
{
Name = model.Name,
Cuisine = model.Cuisine
};
restaurant = _restaurantData.Add(restaurant);
return View(nameof(Details), restaurant);
}
}
}
| mit | C# |
4c6330bb21fa0eb6c9ff69de3ccf617f9911cf72 | bump version to 1.5.8 | martin2250/OpenCNCPilot | OpenCNCPilot/Properties/AssemblyInfo.cs | OpenCNCPilot/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenCNCPilot")]
[assembly: AssemblyDescription("GCode Sender and AutoLeveller")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("martin2250")]
[assembly: AssemblyProduct("OpenCNCPilot")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5.8.0")]
[assembly: AssemblyFileVersion("1.5.8.0")]
| using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenCNCPilot")]
[assembly: AssemblyDescription("GCode Sender and AutoLeveller")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("martin2250")]
[assembly: AssemblyProduct("OpenCNCPilot")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5.7.0")]
[assembly: AssemblyFileVersion("1.5.7.0")]
| mit | C# |
516492c5449d529cb2a065229c854f0156a57ef4 | bump to version 1.3.6 | Terradue/DotNetTep,Terradue/DotNetTep | Terradue.Tep/Properties/AssemblyInfo.cs | Terradue.Tep/Properties/AssemblyInfo.cs | /*!
\namespace Terradue.Tep
@{
Terradue.Tep Software Package provides with all the functionalities specific to the TEP.
\xrefitem sw_version "Versions" "Software Package Version" 1.3.6
\xrefitem sw_link "Links" "Software Package List" [Terradue.Tep](https://git.terradue.com/sugar/Terradue.Tep)
\xrefitem sw_license "License" "Software License" [AGPL](https://git.terradue.com/sugar/Terradue.Tep/LICENSE)
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch
\xrefitem sw_req "Require" "Software Dependencies" \ref ServiceStack
\xrefitem sw_req "Require" "Software Dependencies" \ref log4net
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Portal
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Authentication.Umsso
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Cloud
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Github
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Metadata.EarthObservation
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.News
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenNebula
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.GeoJson
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.RdfEO
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Tumblr
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Twitter
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Ogc.OwsContext
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Syndication
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.WebService.Model
\ingroup Tep
@}
*/
/*!
\defgroup Tep Tep Modules
@{
This is a super component that encloses all Thematic Exploitation Platform related functional components.
Their main functionnalities are targeted to enhance the basic \ref Core functionalities for the thematic usage of the plaform.
@}
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using NuGet4Mono.Extensions;
[assembly: AssemblyTitle("Terradue.Tep")]
[assembly: AssemblyDescription("Terradue Tep .Net library")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Terradue")]
[assembly: AssemblyProduct("Terradue.Tep")]
[assembly: AssemblyCopyright("Terradue")]
[assembly: AssemblyAuthors("Enguerran Boissier")]
[assembly: AssemblyProjectUrl("https://git.terradue.com/sugar/Terradue.Tep")]
[assembly: AssemblyLicenseUrl("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.3.6")]
[assembly: AssemblyInformationalVersion("1.3.6")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)] | /*!
\namespace Terradue.Tep
@{
Terradue.Tep Software Package provides with all the functionalities specific to the TEP.
\xrefitem sw_version "Versions" "Software Package Version" 1.3.5
\xrefitem sw_link "Links" "Software Package List" [Terradue.Tep](https://git.terradue.com/sugar/Terradue.Tep)
\xrefitem sw_license "License" "Software License" [AGPL](https://git.terradue.com/sugar/Terradue.Tep/LICENSE)
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch
\xrefitem sw_req "Require" "Software Dependencies" \ref ServiceStack
\xrefitem sw_req "Require" "Software Dependencies" \ref log4net
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Portal
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Authentication.Umsso
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Cloud
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Github
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Metadata.EarthObservation
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.News
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenNebula
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.GeoJson
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.RdfEO
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Tumblr
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Twitter
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Ogc.OwsContext
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Syndication
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.WebService.Model
\ingroup Tep
@}
*/
/*!
\defgroup Tep Tep Modules
@{
This is a super component that encloses all Thematic Exploitation Platform related functional components.
Their main functionnalities are targeted to enhance the basic \ref Core functionalities for the thematic usage of the plaform.
@}
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using NuGet4Mono.Extensions;
[assembly: AssemblyTitle("Terradue.Tep")]
[assembly: AssemblyDescription("Terradue Tep .Net library")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Terradue")]
[assembly: AssemblyProduct("Terradue.Tep")]
[assembly: AssemblyCopyright("Terradue")]
[assembly: AssemblyAuthors("Enguerran Boissier")]
[assembly: AssemblyProjectUrl("https://git.terradue.com/sugar/Terradue.Tep")]
[assembly: AssemblyLicenseUrl("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.3.5")]
[assembly: AssemblyInformationalVersion("1.3.5")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)] | agpl-3.0 | C# |
03917d92e7b344ab154a757610ea85daab8b4b3d | Revise TakeAReasonableFee for good. | nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet | WalletWasabi/Helpers/NBitcoinHelpers.cs | WalletWasabi/Helpers/NBitcoinHelpers.cs | using NBitcoin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WalletWasabi.Helpers
{
public static class NBitcoinHelpers
{
public static string HashOutpoints(IEnumerable<OutPoint> outPoints)
{
var sb = new StringBuilder();
foreach (OutPoint input in outPoints.OrderBy(x => x.Hash.ToString()).ThenBy(x => x.N))
{
sb.Append(ByteHelpers.ToHex(input.ToBytes()));
}
return HashHelpers.GenerateSha256Hash(sb.ToString());
}
public static BitcoinAddress ParseBitcoinAddress(string address)
{
try
{
return BitcoinAddress.Create(address, Network.RegTest);
}
catch (FormatException)
{
try
{
return BitcoinAddress.Create(address, Network.TestNet);
}
catch (FormatException)
{
return BitcoinAddress.Create(address, Network.Main);
}
}
}
private static readonly Money[] ReasonableFees = new[] {
Money.Coins(0.002m),
Money.Coins(0.001m),
Money.Coins(0.0005m),
Money.Coins(0.0002m),
Money.Coins(0.0001m),
Money.Coins(0.00005m),
Money.Coins(0.00002m),
Money.Coins(0.00001m)
};
public static Money TakeAReasonableFee(Money inputValue)
{
Money half = inputValue / 2;
foreach (Money fee in ReasonableFees)
{
Money diff = inputValue - fee;
if (diff > half)
{
return diff;
}
}
return half;
}
public static int CalculateVsizeAssumeSegwit(int inNum, int outNum)
{
var origTxSize = inNum * Constants.P2pkhInputSizeInBytes + outNum * Constants.OutputSizeInBytes + 10;
var newTxSize = inNum * Constants.P2wpkhInputSizeInBytes + outNum * Constants.OutputSizeInBytes + 10; // BEWARE: This assumes segwit only inputs!
var vSize = (int)Math.Ceiling(((3 * newTxSize) + origTxSize) / 4m);
return vSize;
}
}
}
| using NBitcoin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WalletWasabi.Helpers
{
public static class NBitcoinHelpers
{
public static string HashOutpoints(IEnumerable<OutPoint> outPoints)
{
var sb = new StringBuilder();
foreach (OutPoint input in outPoints.OrderBy(x => x.Hash.ToString()).ThenBy(x => x.N))
{
sb.Append(ByteHelpers.ToHex(input.ToBytes()));
}
return HashHelpers.GenerateSha256Hash(sb.ToString());
}
public static BitcoinAddress ParseBitcoinAddress(string address)
{
try
{
return BitcoinAddress.Create(address, Network.RegTest);
}
catch (FormatException)
{
try
{
return BitcoinAddress.Create(address, Network.TestNet);
}
catch (FormatException)
{
return BitcoinAddress.Create(address, Network.Main);
}
}
}
//public static Money TakeAReasonableFee(Money outputValue)
//{
// Money fee1 = Money.Coins(0.002m);
// Money ret = outputValue - fee;
// var half = outputValue / 2;
// if (ret <= half)
// {
// return half;
// }
// return ret;
//}
public static Money TakeAReasonableFee(Money outputValue)
{
// sanity check
var sanity = Money.Coins(0.00001m);
if (outputValue <= sanity)
{
return outputValue;
}
Money fee = Money.Coins(0.002m);
var remaining = Money.Zero;
for (int i = 0; i < 100; i++)
{
remaining = outputValue - fee;
if (remaining >= sanity)
{
break;
}
fee = fee.Percentange(50);
}
return remaining <= 0 ? outputValue : remaining;
}
//public static Money TakeAReasonableFee(Money outputValue)
//{
// // sanity check
// var sanity = Money.Coins(0.00001m);
// if (outputValue <= sanity)
// {
// return outputValue;
// }
// Money fee = Money.Coins(0.002m);
// var remaining = Money.Zero;
// while (true)
// {
// remaining = outputValue - fee;
// if (remaining > sanity)
// {
// break;
// }
// fee = fee.Percentange(50);
// }
// return remaining <= 0 ? outputValue : remaining;
//}
public static int CalculateVsizeAssumeSegwit(int inNum, int outNum)
{
var origTxSize = inNum * Constants.P2pkhInputSizeInBytes + outNum * Constants.OutputSizeInBytes + 10;
var newTxSize = inNum * Constants.P2wpkhInputSizeInBytes + outNum * Constants.OutputSizeInBytes + 10; // BEWARE: This assumes segwit only inputs!
var vSize = (int)Math.Ceiling(((3 * newTxSize) + origTxSize) / 4m);
return vSize;
}
}
}
| mit | C# |
900f72ef11e506caad3a558d0702ac335dbab6d7 | Remove all awaits in the MessageBusConnection | exceptionless/Exceptionless,exceptionless/Exceptionless,exceptionless/Exceptionless,adamzolotarev/Exceptionless,exceptionless/Exceptionless,adamzolotarev/Exceptionless,adamzolotarev/Exceptionless | Source/Api/Hubs/MessageBusConnection.cs | Source/Api/Hubs/MessageBusConnection.cs | using System;
using System.Threading.Tasks;
using Exceptionless.Core.Component;
using Exceptionless.Core.Extensions;
using Microsoft.AspNet.SignalR;
namespace Exceptionless.Api.Hubs {
public class MessageBusConnection : PersistentConnection {
private readonly ConnectionMapping _userIdConnections;
public MessageBusConnection(ConnectionMapping userIdConnections) {
_userIdConnections = userIdConnections;
}
protected override Task OnConnected(IRequest request, string connectionId) {
foreach (string organizationId in request.User.GetOrganizationIds())
Groups.Add(connectionId, organizationId);
_userIdConnections.Add(request.User.GetUserId(), connectionId);
return TaskHelper.Completed();
}
protected override Task OnDisconnected(IRequest request, string connectionId, bool stopCalled) {
_userIdConnections.Remove(request.User.GetUserId(), connectionId);
return TaskHelper.Completed();
}
protected override Task OnReconnected(IRequest request, string connectionId) {
foreach (string organizationId in request.User.GetOrganizationIds())
Groups.Add(connectionId, organizationId);
if (!_userIdConnections.GetConnections(request.User.GetUserId()).Contains(connectionId))
_userIdConnections.Add(request.User.GetUserId(), connectionId);
return TaskHelper.Completed();
}
protected override bool AuthorizeRequest(IRequest request) {
return request.User.Identity.IsAuthenticated;
}
}
} | using System;
using System.Linq;
using System.Threading.Tasks;
using Exceptionless.Core.Component;
using Exceptionless.Core.Extensions;
using Foundatio.Logging;
using Microsoft.AspNet.SignalR;
namespace Exceptionless.Api.Hubs {
public class MessageBusConnection : PersistentConnection {
private readonly ConnectionMapping _userIdConnections;
public MessageBusConnection(ConnectionMapping userIdConnections) {
_userIdConnections = userIdConnections;
}
protected override async Task OnConnected(IRequest request, string connectionId) {
try {
await Task.WhenAll(request.User.GetOrganizationIds().Select(id => Groups.Add(connectionId, id))).AnyContext();
_userIdConnections.Add(request.User.GetUserId(), connectionId);
} catch (Exception ex) {
Logger.Error().Exception(ex).Message($"OnConnected Error: {ex.Message}").Tag("SignalR").Write();
throw;
}
}
protected override Task OnDisconnected(IRequest request, string connectionId, bool stopCalled) {
try {
_userIdConnections.Remove(request.User.GetUserId(), connectionId);
} catch (Exception ex) {
Logger.Error().Exception(ex).Message($"OnDisconnected Error: {ex.Message}").Tag("SignalR").Write();
throw;
}
return TaskHelper.Completed();
}
protected override async Task OnReconnected(IRequest request, string connectionId) {
try {
await Task.WhenAll(request.User.GetOrganizationIds().Select(id => Groups.Add(connectionId, id))).AnyContext();
if (!_userIdConnections.GetConnections(request.User.GetUserId()).Contains(connectionId))
_userIdConnections.Add(request.User.GetUserId(), connectionId);
} catch (Exception ex) {
Logger.Error().Exception(ex).Message($"OnReconnected Error: {ex.Message}").Tag("SignalR").Write();
throw;
}
}
protected override bool AuthorizeRequest(IRequest request) {
return request.User.Identity.IsAuthenticated;
}
}
} | apache-2.0 | C# |
a7178da708d79f44acc204bccde773e6600d55b6 | Handle leading and trailing whitespace for comments. (#664) | tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools | tools/check-enforcer/Azure.Sdk.Tools.CheckEnforcer/Handlers/IssueCommentHandler.cs | tools/check-enforcer/Azure.Sdk.Tools.CheckEnforcer/Handlers/IssueCommentHandler.cs | using Azure.Sdk.Tools.CheckEnforcer.Configuration;
using Azure.Sdk.Tools.CheckEnforcer.Integrations.GitHub;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Primitives;
using Microsoft.Identity.Client;
using Octokit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Azure.Sdk.Tools.CheckEnforcer.Handlers
{
public class IssueCommentHandler : Handler<IssueCommentPayload>
{
public IssueCommentHandler(IGlobalConfigurationProvider globalConfigurationProvider, IGitHubClientProvider gitHubClientProvider, IRepositoryConfigurationProvider repositoryConfigurationProvider, ILogger logger) : base(globalConfigurationProvider, gitHubClientProvider, repositoryConfigurationProvider, logger)
{
}
protected override async Task HandleCoreAsync(HandlerContext<IssueCommentPayload> context, CancellationToken cancellationToken)
{
var payload = context.Payload;
var installationId = payload.Installation.Id;
var repositoryId = payload.Repository.Id;
var comment = payload.Comment.Body.ToLower().Trim();
var issueId = payload.Issue.Number;
// Bail early if we aren't even a check enforcer comment. Reduces exception noise.
if (!comment.StartsWith("/check-enforcer")) return;
var pullRequest = await context.Client.PullRequest.Get(repositoryId, issueId);
var sha = pullRequest.Head.Sha;
switch (comment)
{
case "/check-enforcer override":
await SetSuccessAsync(context.Client, repositoryId, sha, cancellationToken);
break;
case "/check-enforcer reset":
await CreateCheckAsync(context.Client, installationId, repositoryId, sha, true, cancellationToken);
break;
case "/check-enforcer evaluate":
await EvaluatePullRequestAsync(context.Client, installationId, repositoryId, sha, cancellationToken);
break;
default:
this.Logger.LogInformation("Unrecognized command: {comment}", comment);
break;
}
}
}
}
| using Azure.Sdk.Tools.CheckEnforcer.Configuration;
using Azure.Sdk.Tools.CheckEnforcer.Integrations.GitHub;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Primitives;
using Microsoft.Identity.Client;
using Octokit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Azure.Sdk.Tools.CheckEnforcer.Handlers
{
public class IssueCommentHandler : Handler<IssueCommentPayload>
{
public IssueCommentHandler(IGlobalConfigurationProvider globalConfigurationProvider, IGitHubClientProvider gitHubClientProvider, IRepositoryConfigurationProvider repositoryConfigurationProvider, ILogger logger) : base(globalConfigurationProvider, gitHubClientProvider, repositoryConfigurationProvider, logger)
{
}
protected override async Task HandleCoreAsync(HandlerContext<IssueCommentPayload> context, CancellationToken cancellationToken)
{
var payload = context.Payload;
var installationId = payload.Installation.Id;
var repositoryId = payload.Repository.Id;
var comment = payload.Comment.Body.ToLower();
var issueId = payload.Issue.Number;
// Bail early if we aren't even a check enforcer comment. Reduces exception noise.
if (!comment.StartsWith("/check-enforcer")) return;
var pullRequest = await context.Client.PullRequest.Get(repositoryId, issueId);
var sha = pullRequest.Head.Sha;
switch (comment)
{
case "/check-enforcer override":
await SetSuccessAsync(context.Client, repositoryId, sha, cancellationToken);
break;
case "/check-enforcer reset":
await CreateCheckAsync(context.Client, installationId, repositoryId, sha, true, cancellationToken);
break;
case "/check-enforcer evaluate":
await EvaluatePullRequestAsync(context.Client, installationId, repositoryId, sha, cancellationToken);
break;
default:
this.Logger.LogInformation("Unrecognized command: {comment}", comment);
break;
}
}
}
}
| mit | C# |
5ec8e14e205f00517dca9351992e6ded255edae9 | Comment out route to raw file | Zyrio/ictus,Zyrio/ictus | src/Ictus/Controllers/HomeController.cs | src/Ictus/Controllers/HomeController.cs | using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace Yio.Controllers
{
public class HomeController : Controller
{
public HomeController()
{
}
[Route("/")]
[Route("/{repository}")]
[Route("/{repository}/{fileId}")]
public IActionResult Index(string repository, string fileId)
{
ViewBag.SiteName = Yio.Data.Constants.AppSettingsConstant.SiteName;
ViewBag.IsYiffco = true;
if(ViewBag.SiteName != "Yiff.co") {
ViewBag.IsYiffco = false;
}
if(Yio.Data.Constants.VersionConstant.Patch == 0) {
ViewBag.Version = Yio.Data.Constants.VersionConstant.Release.ToString();
} else {
ViewBag.Version = Yio.Data.Constants.VersionConstant.Release.ToString() + "." +
Yio.Data.Constants.VersionConstant.Patch.ToString();
}
return View("Index");
}
//[Route("/{repository}/{fileId}.{extension}")]
//public async Task<IActionResult> Raw(string repository, string fileId, string extension)
//{
// var file = System.IO.File.OpenRead("/home/ducky/Pictures/607.jpg");
// string type = "application/octet-stream";
//
// if(extension == "jpg" || extension == "jpeg")
// {
// type = "image/jpeg";
// } else if(extension == "png")
// {
// type = "image/jpeg";
// } else if(extension == "gif")
// {
// type = "image/gif";
// }
//
// return File(file, type);
//}
[Route("/frame/comment/{repository}/{fileId}")]
public IActionResult Comment(string repository, string fileId)
{
return View("Comment");
}
public string Error()
{
return "If you can see this message, something has gone terribly wrong.";
}
}
}
| using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace Yio.Controllers
{
public class HomeController : Controller
{
public HomeController()
{
}
[Route("/")]
[Route("/{repository}")]
[Route("/{repository}/{fileId}")]
public IActionResult Index(string repository, string fileId)
{
ViewBag.SiteName = Yio.Data.Constants.AppSettingsConstant.SiteName;
ViewBag.IsYiffco = true;
if(ViewBag.SiteName != "Yiff.co") {
ViewBag.IsYiffco = false;
}
if(Yio.Data.Constants.VersionConstant.Patch == 0) {
ViewBag.Version = Yio.Data.Constants.VersionConstant.Release.ToString();
} else {
ViewBag.Version = Yio.Data.Constants.VersionConstant.Release.ToString() + "." +
Yio.Data.Constants.VersionConstant.Patch.ToString();
}
return View("Index");
}
[Route("/{repository}/{fileId}.{extension}")]
public async Task<IActionResult> Raw(string repository, string fileId, string extension)
{
var file = System.IO.File.OpenRead("/home/ducky/Pictures/607.jpg");
string type = "application/octet-stream";
if(extension == "jpg" || extension == "jpeg")
{
type = "image/jpeg";
} else if(extension == "png")
{
type = "image/jpeg";
} else if(extension == "gif")
{
type = "image/gif";
}
return File(file, type);
}
[Route("/frame/comment/{repository}/{fileId}")]
public IActionResult Comment(string repository, string fileId)
{
return View("Comment");
}
public string Error()
{
return "If you can see this message, something has gone terribly wrong.";
}
}
}
| mit | C# |
69f549a2ba99b35dc30916b2cc73d3fa3d4cd136 | allow registration of new mediator; default to old mediator | turner-industries/Turner.Infrastructure.Mediator | Turner.Infrastructure.Mediator/Configuration/SimpleInjectorMediatorConfiguration.cs | Turner.Infrastructure.Mediator/Configuration/SimpleInjectorMediatorConfiguration.cs | using SimpleInjector;
using System.Reflection;
using Turner.Infrastructure.Mediator.Decorators;
using Turner.Infrastructure.Mediator.Mediators;
namespace Turner.Infrastructure.Mediator.Configuration
{
public static class SimpleInjectorMediatorConfiguration
{
public static void ConfigureMediator(this Container container, Assembly[] assemblies)
{
ConfigureDynamicMediator(container, assemblies);
}
public static void ConfigureDynamicMediator(this Container container, Assembly[] assemblies)
{
container.Register<IMediator>(() => new DynamicDispatchMediator(container.GetInstance));
RegisterHandlers(container, assemblies);
}
public static void ConfigureStaticMediator(this Container container, Assembly[] assemblies)
{
container.RegisterSingleton<IStaticDispatcher>(
() => new StaticDispatcher(container.GetInstance, assemblies));
container.Register<IMediator>(
() => new StaticDispatchMediator(container.GetInstance<IStaticDispatcher>()));
RegisterHandlers(container, assemblies);
}
private static void RegisterHandlers(Container container, Assembly[] assemblies)
{
bool ShouldValidate(DecoratorPredicateContext context) =>
!context.ImplementationType.RequestHasAttribute(typeof(DoNotValidateAttribute));
container.Register(typeof(IRequestHandler<>), assemblies);
container.Register(typeof(IRequestHandler<,>), assemblies);
container.RegisterDecorator(typeof(IRequestHandler<>), typeof(ValidationHandler<>), ShouldValidate);
container.RegisterDecorator(typeof(IRequestHandler<,>), typeof(ValidationHandler<,>), ShouldValidate);
container.RegisterDecorator(typeof(IRequestHandler<>), typeof(TransactionHandler<>));
container.RegisterDecorator(typeof(IRequestHandler<,>), typeof(TransactionHandler<,>));
}
}
}
| using SimpleInjector;
using System.Reflection;
using Turner.Infrastructure.Mediator.Decorators;
namespace Turner.Infrastructure.Mediator.Configuration
{
public static class SimpleInjectorMediatorConfiguration
{
public static void ConfigureMediator(this Container container, Assembly[] assemblies)
{
RegisterMediator(container, assemblies);
}
private static void RegisterMediator(Container container, Assembly[] assemblies)
{
bool ShouldValidate(DecoratorPredicateContext context) =>
!context.ImplementationType.RequestHasAttribute(typeof(DoNotValidateAttribute));
container.Register<IMediator>(() => new Mediator(container.GetInstance));
container.Register(typeof(IRequestHandler<>), assemblies);
container.Register(typeof(IRequestHandler<,>), assemblies);
container.RegisterDecorator(typeof(IRequestHandler<>), typeof(ValidationHandler<>), ShouldValidate);
container.RegisterDecorator(typeof(IRequestHandler<,>), typeof(ValidationHandler<,>), ShouldValidate);
container.RegisterDecorator(typeof(IRequestHandler<>), typeof(TransactionHandler<>));
container.RegisterDecorator(typeof(IRequestHandler<,>), typeof(TransactionHandler<,>));
}
}
}
| mit | C# |
c136f7541bde862b3276faf03b62cfbbfab125ea | fix code in code block rule. | LordZoltan/docfx,DuncanmaMSFT/docfx,928PJY/docfx,superyyrrzz/docfx,hellosnow/docfx,dotnet/docfx,pascalberger/docfx,hellosnow/docfx,928PJY/docfx,DuncanmaMSFT/docfx,dotnet/docfx,LordZoltan/docfx,dotnet/docfx,928PJY/docfx,pascalberger/docfx,superyyrrzz/docfx,superyyrrzz/docfx,pascalberger/docfx,hellosnow/docfx,LordZoltan/docfx,LordZoltan/docfx | src/Microsoft.DocAsCode.MarkdownLite/Basic/BlockRules/MarkdownCodeBlockRule.cs | src/Microsoft.DocAsCode.MarkdownLite/Basic/BlockRules/MarkdownCodeBlockRule.cs | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.DocAsCode.MarkdownLite
{
using System.Text.RegularExpressions;
public class MarkdownCodeBlockRule : IMarkdownRule
{
public virtual string Name => "Code";
public virtual Regex Code => Regexes.Block.Code;
public virtual IMarkdownToken TryMatch(IMarkdownParser parser, IMarkdownParsingContext context)
{
var match = Code.Match(context.CurrentMarkdown);
if (match.Length == 0)
{
return null;
}
var sourceInfo = context.Consume(match.Length);
var capStr = Regexes.Lexers.LeadingWhiteSpaces.Replace(match.Value, string.Empty);
if (parser.Options.Pedantic)
{
return new MarkdownCodeBlockToken(this, parser.Context, capStr, null, sourceInfo);
}
else
{
return new MarkdownCodeBlockToken(this, parser.Context, Regexes.Lexers.TailingEmptyLines.Replace(capStr, string.Empty), null, sourceInfo);
}
}
}
}
| // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.DocAsCode.MarkdownLite
{
using System.Text.RegularExpressions;
public class MarkdownCodeBlockRule : IMarkdownRule
{
public virtual string Name => "Code";
public virtual Regex Code => Regexes.Block.Code;
public virtual IMarkdownToken TryMatch(IMarkdownParser parser, IMarkdownParsingContext context)
{
var match = Regexes.Block.Code.Match(context.CurrentMarkdown);
if (match.Length == 0)
{
return null;
}
var sourceInfo = context.Consume(match.Length);
var capStr = Regexes.Lexers.LeadingWhiteSpaces.Replace(match.Value, string.Empty);
if (parser.Options.Pedantic)
{
return new MarkdownCodeBlockToken(this, parser.Context, capStr, null, sourceInfo);
}
else
{
return new MarkdownCodeBlockToken(this, parser.Context, Regexes.Lexers.TailingEmptyLines.Replace(capStr, string.Empty), null, sourceInfo);
}
}
}
}
| mit | C# |
bddece4faa1f751d090b75022cb3d66c90af678c | return raw message in wechat verification | supertigerzou/TigerStudio,supertigerzou/TigerStudio | src/TigerStudio.API/Modules/TigerStudio.Wechat/Controllers/WechatController.cs | src/TigerStudio.API/Modules/TigerStudio.Wechat/Controllers/WechatController.cs | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Security;
namespace TigerStudio.Wechat.Controllers
{
[RoutePrefix("api/wechat")]
public class WechatController : ApiController
{
private const string Token = "alibaba";
// sample: api/wechat?signature=af30f7826dd7c71e23291dcb9ab94be53b7b87dd×tamp=1425805977&nonce=739636270&echostr=hello
[Route("")]
public HttpResponseMessage Get(string signature, string timestamp, string nonce, string echostr)
{
var stringToReturn = string.Empty;
Trace.TraceInformation(string.Format("Signature: {0}, Timestamp: {1}, Nonce: {2}, Echostr: {3}", signature, timestamp, nonce, echostr));
if (CheckSignature(signature, timestamp, nonce)) stringToReturn = echostr;
return new HttpResponseMessage()
{ Content = new StringContent(stringToReturn, Encoding.UTF8, "text/html") };
}
private bool CheckSignature(string signature, string timestamp, string nonce)
{
string[] arrTmp = { Token, timestamp, nonce };
Array.Sort(arrTmp);
var tmpStr = string.Join("", arrTmp);
tmpStr = FormsAuthentication.HashPasswordForStoringInConfigFile(tmpStr, "SHA1");
return tmpStr != null && tmpStr.ToLower() == signature;
}
}
}
| using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Security;
namespace TigerStudio.Wechat.Controllers
{
[RoutePrefix("api/wechat")]
public class WechatController : ApiController
{
private const string Token = "alibaba";
[Route("")]
public IHttpActionResult Get(string signature, string timestamp, string nonce, string echostr)
{
Trace.TraceInformation(string.Format("Signature: {0}, Timestamp: {1}, Nonce: {2}, Echostr: {3}", signature, timestamp, nonce, echostr));
if (CheckSignature(signature, timestamp, nonce))
return Ok(echostr);
return BadRequest();
}
private bool CheckSignature(string signature, string timestamp, string nonce)
{
string[] arrTmp = { Token, timestamp, nonce };
Array.Sort(arrTmp);
var tmpStr = string.Join("", arrTmp);
tmpStr = FormsAuthentication.HashPasswordForStoringInConfigFile(tmpStr, "SHA1");
return tmpStr != null && tmpStr.ToLower() == signature;
}
}
}
| mit | C# |
a6384eb03bb449fb86e1b10b0b4186806ec92075 | Fix StackTraceLog. | nessos/Eff | src/Eff.Tests/Utils.cs | src/Eff.Tests/Utils.cs | using Eff.Core;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Eff.Tests
{
static class Utils
{
public static string StackTraceLog(this Exception ex)
{
if (ex.Data["StackTraceLog"] is Queue<ExceptionLog> queue)
{
var builder = new StringBuilder();
foreach (var item in queue)
{
builder.AppendLine($"at {item.CallerMemberName} in {Path.GetFileName(item.CallerFilePath)}: line {item.CallerLineNumber}");
builder.Append("paremeters:");
foreach (var (name, value) in item.Parameters)
{
builder.Append($" ({name}, {value}) ");
}
builder.AppendLine();
builder.Append("locals:");
foreach (var (name, value) in item.LocalVariables)
{
builder.Append($" ({name}, {value}) ");
}
builder.AppendLine();
}
return builder.ToString();
}
else return string.Empty;
}
}
}
| using Eff.Core;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Eff.Tests
{
static class Utils
{
public static string StackTraceLog(this Exception ex)
{
var builder = new StringBuilder();
foreach (var item in (Queue<ExceptionLog>)ex.Data["StackTraceLog"])
{
builder.AppendLine($"at {item.CallerMemberName} in {Path.GetFileName(item.CallerFilePath)}: line {item.CallerLineNumber}");
builder.Append("paremeters:");
foreach (var (name, value) in item.Parameters)
{
builder.Append($" ({name}, {value}) ");
}
builder.AppendLine();
builder.Append("locals:");
foreach (var (name, value) in item.LocalVariables)
{
builder.Append($" ({name}, {value}) ");
}
builder.AppendLine();
}
return builder.ToString();
}
}
}
| mit | C# |
9047b56ed1086318bbd7034b01216fb5c79ad233 | Make Asset non abstract | brickpile/brickpile,brickpile/brickpile,brickpile/brickpile | BrickPile.Domain/Models/Asset.cs | BrickPile.Domain/Models/Asset.cs | using System;
using System.ComponentModel.DataAnnotations;
namespace BrickPile.Domain.Models {
public class Asset {
/// <summary>
/// Gets or sets the id.
/// </summary>
/// <value>
/// The id.
/// </value>
[ScaffoldColumn(false)]
public string Id { get; set; }
/// <summary>
/// Gets or sets the type of the content.
/// </summary>
/// <value>
/// The type of the content.
/// </value>
public string ContentType { get; set; }
/// <summary>
/// Gets or sets the length of the content.
/// </summary>
/// <value>
/// The length of the content.
/// </value>
public long? ContentLength { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the uploaded.
/// </summary>
/// <value>
/// The uploaded.
/// </value>
public DateTime? DateUploaded { get; set; }
/// <summary>
/// Gets or sets the link.
/// </summary>
/// <value>
/// The link.
/// </value>
public string VirtualPath { get; set; }
/// <summary>
/// Gets or sets the URL.
/// </summary>
/// <value>
/// The URL.
/// </value>
public string Url { get; set; }
/// <summary>
/// Gets or sets the thumbnail.
/// </summary>
/// <value>
/// The thumbnail.
/// </value>
public byte[] Thumbnail { get; set; }
}
}
| using System;
using System.ComponentModel.DataAnnotations;
namespace BrickPile.Domain.Models {
public abstract class Asset {
/// <summary>
/// Gets or sets the id.
/// </summary>
/// <value>
/// The id.
/// </value>
[ScaffoldColumn(false)]
public string Id { get; set; }
/// <summary>
/// Gets or sets the type of the content.
/// </summary>
/// <value>
/// The type of the content.
/// </value>
public string ContentType { get; set; }
/// <summary>
/// Gets or sets the length of the content.
/// </summary>
/// <value>
/// The length of the content.
/// </value>
public long? ContentLength { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the uploaded.
/// </summary>
/// <value>
/// The uploaded.
/// </value>
public DateTime? DateUploaded { get; set; }
/// <summary>
/// Gets or sets the link.
/// </summary>
/// <value>
/// The link.
/// </value>
public string VirtualPath { get; set; }
/// <summary>
/// Gets or sets the URL.
/// </summary>
/// <value>
/// The URL.
/// </value>
public string Url { get; set; }
/// <summary>
/// Gets or sets the thumbnail.
/// </summary>
/// <value>
/// The thumbnail.
/// </value>
public byte[] Thumbnail { get; set; }
}
}
| mit | C# |
2485173b9d4437ea0a4793789a86a753019e7341 | Fix inconsistent ordering | jskeet/DemoCode,jskeet/DemoCode,jskeet/DemoCode,jskeet/DemoCode | CSharp8/Nullability/BasicDemo.cs | CSharp8/Nullability/BasicDemo.cs | #nullable disable
// All code is available at:
// https://github.com/jskeet/DemoCode
using System;
namespace Nullability
{
class Person
{
public string FirstName { get; }
public string LastName { get; }
public string MiddleName { get; }
public Person(string firstName, string lastName, string middleName)
{
// TODO: Validate arguments
FirstName = firstName;
LastName = lastName;
MiddleName = middleName;
}
}
class BasicDemo
{
static void Main()
{
var jon = new Person("Jon", "Skeet", "Leslie");
var miguel = new Person("Miguel", "de Icaza", null);
PrintNameLengths(jon);
PrintNameLengths(miguel);
}
static void PrintNameLengths(Person person)
{
string first = person.FirstName;
string last = person.LastName;
string middle = person.MiddleName;
Console.WriteLine("First={0}; Last={1}; Middle={2}",
first.Length,
last.Length,
middle.Length);
}
}
}
| #nullable disable
// All code is available at:
// https://github.com/jskeet/DemoCode
using System;
namespace Nullability
{
class Person
{
public string FirstName { get; }
public string LastName { get; }
public string MiddleName { get; }
public Person(string firstName, string lastName, string middleName)
{
// TODO: Validate arguments
FirstName = firstName;
LastName = lastName;
MiddleName = middleName;
}
}
class BasicDemo
{
static void Main()
{
var jon = new Person("Jon", "Skeet", "Leslie");
var miguel = new Person("Miguel", "de Icaza", null);
PrintNameLengths(jon);
PrintNameLengths(miguel);
}
static void PrintNameLengths(Person person)
{
string first = person.FirstName;
string middle = person.MiddleName;
string last = person.LastName;
Console.WriteLine("First={0}; Last={1}; Middle={2}",
first.Length,
last.Length,
middle.Length);
}
}
}
| apache-2.0 | C# |
5503aa7b4a60e5d144af2cdb1eebaa409413a257 | Remove comment | aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore | samples/MvcSample/FiltersController.cs | samples/MvcSample/FiltersController.cs | using Microsoft.AspNet.Mvc;
using MvcSample.Filters;
using MvcSample.Models;
namespace MvcSample
{
[ServiceFilter(typeof(PassThroughAttribute), Order = 1)]
[ServiceFilter(typeof(PassThroughAttribute))]
[PassThrough(Order = 0)]
[PassThrough(Order = 2)]
public class FiltersController : Controller
{
private readonly User _user = new User() { Name = "User Name", Address = "Home Address" };
// TODO: Add a real filter here
[ServiceFilter(typeof(PassThroughAttribute))]
[AgeEnhancer]
[InspectResultPage]
public IActionResult Index(int age)
{
_user.Age = age;
return View("MyView", _user);
}
}
} | using Microsoft.AspNet.Mvc;
using MvcSample.Filters;
using MvcSample.Models;
namespace MvcSample
{
// Expected order in descriptor - object -> int -> string
// TODO: Add a real filter here
[ServiceFilter(typeof(PassThroughAttribute), Order = 1)]
[ServiceFilter(typeof(PassThroughAttribute))]
[PassThrough(Order = 0)]
[PassThrough(Order = 2)]
public class FiltersController : Controller
{
private readonly User _user = new User() { Name = "User Name", Address = "Home Address" };
// TODO: Add a real filter here
[ServiceFilter(typeof(PassThroughAttribute))]
[AgeEnhancer]
[InspectResultPage]
public IActionResult Index(int age)
{
_user.Age = age;
return View("MyView", _user);
}
}
} | apache-2.0 | C# |
b6268e36505ece94d2ba5f8b4d2842ce59dedaae | Bump version to 8.17.0-rc2 | bjarnef/Umbraco-CMS,abryukhov/Umbraco-CMS,dawoe/Umbraco-CMS,bjarnef/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,arknu/Umbraco-CMS,abjerner/Umbraco-CMS,robertjf/Umbraco-CMS,abjerner/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,umbraco/Umbraco-CMS,mattbrailsford/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abjerner/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,umbraco/Umbraco-CMS,umbraco/Umbraco-CMS,KevinJump/Umbraco-CMS,dawoe/Umbraco-CMS,dawoe/Umbraco-CMS,KevinJump/Umbraco-CMS,mattbrailsford/Umbraco-CMS,mattbrailsford/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,umbraco/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,bjarnef/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,bjarnef/Umbraco-CMS,marcemarc/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,arknu/Umbraco-CMS,mattbrailsford/Umbraco-CMS,arknu/Umbraco-CMS,robertjf/Umbraco-CMS,robertjf/Umbraco-CMS,arknu/Umbraco-CMS,KevinJump/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,dawoe/Umbraco-CMS | src/SolutionInfo.cs | src/SolutionInfo.cs | using System.Reflection;
using System.Resources;
[assembly: AssemblyCompany("Umbraco")]
[assembly: AssemblyCopyright("Copyright © Umbraco 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
// versions
// read https://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin
// note: do NOT change anything here manually, use the build scripts
// this is the ONLY ONE the CLR cares about for compatibility
// should change ONLY when "hard" breaking compatibility (manual change)
[assembly: AssemblyVersion("8.0.0")]
// these are FYI and changed automatically
[assembly: AssemblyFileVersion("8.17.0")]
[assembly: AssemblyInformationalVersion("8.17.0-rc2")]
| using System.Reflection;
using System.Resources;
[assembly: AssemblyCompany("Umbraco")]
[assembly: AssemblyCopyright("Copyright © Umbraco 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
// versions
// read https://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin
// note: do NOT change anything here manually, use the build scripts
// this is the ONLY ONE the CLR cares about for compatibility
// should change ONLY when "hard" breaking compatibility (manual change)
[assembly: AssemblyVersion("8.0.0")]
// these are FYI and changed automatically
[assembly: AssemblyFileVersion("8.17.0")]
[assembly: AssemblyInformationalVersion("8.17.0-rc")]
| mit | C# |
169d324bc0d610e4937d3709899a29428a5dd242 | Make the Monaco editor Fields support preview (#10777) | stevetayloruk/Orchard2,stevetayloruk/Orchard2,stevetayloruk/Orchard2,stevetayloruk/Orchard2,stevetayloruk/Orchard2 | src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Monaco.Edit.cshtml | src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Monaco.Edit.cshtml | @model OrchardCore.ContentFields.ViewModels.EditTextFieldViewModel
@{
var settings = Model.PartFieldDefinition.GetSettings<TextFieldSettings>();
var monacoSettings = Model.PartFieldDefinition.GetSettings<TextFieldMonacoEditorSettings>();
var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem);
}
<div class="form-group">
<label asp-for="Text">@Model.PartFieldDefinition.DisplayName()</label>
<div id="@Html.IdFor(x => x.Text)_editor" asp-for="Text" style="min-height: 400px;" class="form-control" dir="@culture.GetLanguageDirection()"></div>
<textarea asp-for="Text" hidden>@Html.Raw(Model.Text)</textarea>
@if (!String.IsNullOrEmpty(settings.Hint))
{
<span class="hint">@settings.Hint</span>
}
</div>
<script asp-name="monaco" depends-on="admin" at="Foot"></script>
<script at="Foot" depends-on="monaco">
$(document).ready(function () {
require(['vs/editor/editor.main'], function () {
var settings = @Html.Raw(monacoSettings.Options);
if (settings.automaticLayout == undefined) {
settings.automaticLayout = true;
}
var html = document.getElementsByTagName("html")[0];
const mutationObserver = new MutationObserver(setTheme);
mutationObserver.observe(html, { attributes: true });
function setTheme() {
var theme = html.dataset.theme;
if (theme === "darkmode") {
monaco.editor.setTheme('vs-dark')
} else {
monaco.editor.setTheme('vs')
}
}
setTheme();
var editor = monaco.editor.create(document.getElementById('@Html.IdFor(x => x.Text)_editor'), settings);
var textArea = document.getElementById('@Html.IdFor(x => x.Text)');
editor.getModel().setValue(textArea.value);
window.addEventListener("submit", function () {
textArea.value = editor.getValue();
});
editor.getModel().onDidChangeContent((event) => {
textArea.value = editor.getValue();
$(document).trigger('contentpreview:render');
});
});
});
</script>
| @model OrchardCore.ContentFields.ViewModels.EditTextFieldViewModel
@{
var settings = Model.PartFieldDefinition.GetSettings<TextFieldSettings>();
var monacoSettings = Model.PartFieldDefinition.GetSettings<TextFieldMonacoEditorSettings>();
var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem);
}
<div class="form-group">
<label asp-for="Text">@Model.PartFieldDefinition.DisplayName()</label>
<div id="@Html.IdFor(x => x.Text)_editor" asp-for="Text" style="min-height: 400px;" class="form-control" dir="@culture.GetLanguageDirection()"></div>
<textarea asp-for="Text" hidden>@Html.Raw(Model.Text)</textarea>
@if (!String.IsNullOrEmpty(settings.Hint))
{
<span class="hint">@settings.Hint</span>
}
</div>
<script asp-name="monaco" depends-on="admin" at="Foot"></script>
<script at="Foot" depends-on="monaco">
$(document).ready(function () {
require(['vs/editor/editor.main'], function () {
var settings = @Html.Raw(monacoSettings.Options);
if (settings.automaticLayout == undefined) {
settings.automaticLayout = true;
}
var html = document.getElementsByTagName("html")[0];
const mutationObserver = new MutationObserver(setTheme);
mutationObserver.observe(html, { attributes: true });
function setTheme() {
var theme = html.dataset.theme;
if (theme === "darkmode") {
monaco.editor.setTheme('vs-dark')
} else {
monaco.editor.setTheme('vs')
}
}
setTheme();
var editor = monaco.editor.create(document.getElementById('@Html.IdFor(x => x.Text)_editor'), settings);
var textArea = document.getElementById('@Html.IdFor(x => x.Text)');
editor.getModel().setValue(textArea.value);
window.addEventListener("submit", function () {
textArea.value = editor.getValue();
});
});
});
</script>
| bsd-3-clause | C# |
acfd4352b5d9a3611666f2f9768526156e27103b | Fix a typo in the NodaTime.Calendars namespace summary. | zaccharles/nodatime,BenJenkinson/nodatime,zaccharles/nodatime,malcolmr/nodatime,zaccharles/nodatime,zaccharles/nodatime,nodatime/nodatime,malcolmr/nodatime,nodatime/nodatime,zaccharles/nodatime,jskeet/nodatime,BenJenkinson/nodatime,malcolmr/nodatime,zaccharles/nodatime,malcolmr/nodatime,jskeet/nodatime | src/NodaTime/Calendars/NamespaceDoc.cs | src/NodaTime/Calendars/NamespaceDoc.cs | #region Copyright and license information
// Copyright 2001-2009 Stephen Colebourne
// Copyright 2009-2011 Jon Skeet
//
// 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.
#endregion
using System.Runtime.CompilerServices;
namespace NodaTime.Calendars
{
/// <summary>
/// <para>
/// The NodaTime.Calendars namespace contains types related to calendars beyond the
/// <see cref="CalendarSystem"/> type in the core NodaTime namespace.
/// </para>
/// </summary>
[CompilerGenerated]
internal class NamespaceDoc
{
// No actual code here - it's just for the sake of documenting the namespace.
}
}
| #region Copyright and license information
// Copyright 2001-2009 Stephen Colebourne
// Copyright 2009-2011 Jon Skeet
//
// 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.
#endregion
using System.Runtime.CompilerServices;
namespace NodaTime.Calendars
{
/// <summary>
/// <para>
/// The NodaTime.Calendar namespace contains types related to calendars beyond the
/// <see cref="CalendarSystem"/> type in the core NodaTime namespace.
/// </para>
/// </summary>
[CompilerGenerated]
internal class NamespaceDoc
{
// No actual code here - it's just for the sake of documenting the namespace.
}
}
| apache-2.0 | C# |
c1d0a2dd351c6ee9cd088461dbc6c6bcb8a0dc09 | Fix build script | lockoncode/LockOnCode.VirtualMachine,lockoncode/LockOnCode.VirtualMachine | build.cake | build.cake | #addin "Cake.Incubator"
#tool "xunit.runner.console"
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var binDir = ""; // Destination Binary File Directory name i.e. bin
var projJson = ""; // Path to the project.json
var projDir = ""; // Project Directory
var solutionFile = "LockOnCode.VirtualMachine.sln"; // Solution file if needed
var outputDir = Directory("Build") + Directory(configuration); // The output directory the build artifacts saved too
var buildSettings = new DotNetCoreBuildSettings
{
Framework = "netcoreapp1.1",
Configuration = "Release",
OutputDirectory = outputDir
};
Task("Clean")
.Does(() =>
{
if (DirectoryExists(outputDir))
{
DeleteDirectory(outputDir, recursive:true);
}
});
Task("Restore")
.Does(() => {
DotNetCoreRestore(solutionFile);
});
Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.Does(() => {
DotNetCoreBuild(solutionFile, buildSettings);
});
Task("UnitTest")
.IsDependentOn("Build")
.Does(() => {
Information("Start Running Tests");
var testSettings = new DotNetCoreTestSettings
{
NoBuild = true,
DiagnosticOutput = true
};
var testProjects = GetFiles("./**/*Tests.csproj");
foreach(var testProject in testProjects)
{
Information("Found Test Project: " + testProject);
DotNetCoreTest(testProject.ToString(), testSettings);
}
//XUnit2(testAssemblies);*/
//DotNetCoreTest(testProject);
});
Task("Package")
.IsDependentOn("Build")
.Does(() => {
var packSettings = new DotNetCorePackSettings
{
OutputDirectory = outputDir,
NoBuild = true
};
DotNetCorePack(projJson, packSettings);
});
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("Build");
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target); | #addin "Cake.Incubator"
#tool "xunit.runner.console"
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var binDir = ""; // Destination Binary File Directory name i.e. bin
var projJson = ""; // Path to the project.json
var projDir = ""; // Project Directory
var solutionFile = "LockOnCode.VirtualMachine.sln"; // Solution file if needed
var outputDir = Directory("Build") + Directory(configuration); // The output directory the build artifacts saved too
var testProject = "./LockOnCode.VirtualMachine.Devices.Tests/LockOnCode.VirtualMachine.Devices.Tests.csproj";
var buildSettings = new DotNetCoreBuildSettings
{
Framework = "netcoreapp1.1",
Configuration = "Release",
OutputDirectory = outputDir
};
Task("Clean")
.Does(() =>
{
if (DirectoryExists(outputDir))
{
DeleteDirectory(outputDir, recursive:true);
}
});
Task("Restore")
.Does(() => {
DotNetCoreRestore(solutionFile);
});
Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.Does(() => {
DotNetCoreBuild(solutionFile, buildSettings);
});
Task("UnitTest")
.IsDependentOn("Build")
.Does(() => {
Information("Start Running Tests");
var testSettings = new DotNetCoreTestSettings
{
NoBuild = true,
DiagnosticOutput = true
};
var testProjects = GetFiles("./**/*Tests.csproj");
foreach(var testProject in testProjects)
{
Information("Found Test Project: " + testProject);
DotNetCoreTest(testProject.ToString(), testSettings);
}
//XUnit2(testAssemblies);*/
//DotNetCoreTest(testProject);
});
Task("Package")
.IsDependentOn("Build")
.Does(() => {
var packSettings = new DotNetCorePackSettings
{
OutputDirectory = outputDir,
NoBuild = true
};
DotNetCorePack(projJson, packSettings);
});
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("Build");
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target); | mit | C# |
f5acf48de30f7f66150e5df2a27acfdfadde9969 | Raise build verbosity to debug appveyor. | jzeferino/jzeferino.XSAddin,jzeferino/jzeferino.XSAddin | build.cake | build.cake | #addin "Cake.Xamarin&version=1.3.0.14"
var target = Argument("target", "Default");
var configuration = "Release";
// Define directories.
var solutionFile = GetFiles("./*.sln").First();
// Addin project.
var binaryPath = File("./src/jzeferino.XSAddin/bin/" + configuration + "jzeferino.XSAddin.dll");
// Output folder.
var artifactsDir = Directory("./artifacts");
// Build configuration
var isLocalBuild = BuildSystem.IsLocalBuild;
Task("Clean-Solution")
.IsDependentOn("Clean-Folders")
.Does(() =>
{
DotNetBuild(solutionFile, settings => settings
.SetConfiguration(configuration)
.WithTarget("Clean")
.SetVerbosity(Verbosity.Verbose));
});
Task("Clean-Folders")
.Does(() =>
{
CleanDirectory(artifactsDir);
CleanDirectories ("./**/bin");
CleanDirectories ("./**/obj");
});
Task("Restore-Packages")
.Does(() =>
{
NuGetRestore(solutionFile);
});
Task("Build")
.IsDependentOn("Clean-Solution")
.IsDependentOn("Restore-Packages")
.Does(() =>
{
DotNetBuild(solutionFile, settings =>
settings.SetConfiguration(configuration)
.WithProperty("TreatWarningsAsErrors", "false")
.SetVerbosity(Verbosity.Quiet));
});
Task("Pack")
.IsDependentOn("Build")
.WithCriteria(() => isLocalBuild)
.Does(() =>
{
MDToolSetup.Pack(binaryPath, artifactsDir);
});
Task("Default")
.IsDependentOn("Pack");
RunTarget(target);
| #addin "Cake.Xamarin&version=1.3.0.14"
var target = Argument("target", "Default");
var configuration = "Release";
// Define directories.
var solutionFile = GetFiles("./*.sln").First();
// Addin project.
var binaryPath = File("./src/jzeferino.XSAddin/bin/" + configuration + "jzeferino.XSAddin.dll");
// Output folder.
var artifactsDir = Directory("./artifacts");
// Build configuration
var isLocalBuild = BuildSystem.IsLocalBuild;
Task("Clean-Solution")
.IsDependentOn("Clean-Folders")
.Does(() =>
{
DotNetBuild(solutionFile, settings => settings
.SetConfiguration(configuration)
.WithTarget("Clean")
.SetVerbosity(Verbosity.Minimal));
});
Task("Clean-Folders")
.Does(() =>
{
CleanDirectory(artifactsDir);
CleanDirectories ("./**/bin");
CleanDirectories ("./**/obj");
});
Task("Restore-Packages")
.Does(() =>
{
NuGetRestore(solutionFile);
});
Task("Build")
.IsDependentOn("Clean-Solution")
.IsDependentOn("Restore-Packages")
.Does(() =>
{
DotNetBuild(solutionFile, settings =>
settings.SetConfiguration(configuration)
.WithProperty("TreatWarningsAsErrors", "false")
.SetVerbosity(Verbosity.Quiet));
});
Task("Pack")
.IsDependentOn("Build")
.WithCriteria(() => isLocalBuild)
.Does(() =>
{
MDToolSetup.Pack(binaryPath, artifactsDir);
});
Task("Default")
.IsDependentOn("Pack");
RunTarget(target);
| mit | C# |
b38275ba23b6fe9b0bf4602255ce325c9c2bcc13 | Fix cake not finding MSBuild with custom VS installation directory | Zutatensuppe/DiabloInterface,Zutatensuppe/DiabloInterface | build.cake | build.cake | #tool nuget:?package=vswhere
#addin nuget:?package=Cake.Compression&version=0.1.1
#addin nuget:?package=SharpZipLib&version=0.86.0
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var buildNumber = Argument("buildNumber", "0");
var buildDir = Directory("./artifacts");
var binDir = buildDir + Directory("bin");
var solution = "./src/DiabloInterface.sln";
Task("Clean")
.Does(() =>
{
CleanDirectory(binDir);
});
Task("RestorePackages")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore(solution);
});
Task("Build")
.IsDependentOn("RestorePackages")
.Does(() =>
{
var modernMSBuildPath = VSWhereLatest() + File(@"\MSBuild\15.0\Bin\MSBuild.exe");
MSBuild(solution, settings =>
{
if (FileExists(modernMSBuildPath))
{
settings.ToolPath = modernMSBuildPath;
}
settings.SetConfiguration(configuration);
settings.SetVerbosity(Verbosity.Minimal);
});
});
Task("Package")
.IsDependentOn("Build")
.Does(() =>
{
var path = "./src/DiabloInterface/bin/" + configuration + "/";
var allFiles =
GetFiles(path + "*.dll") +
GetFiles(path + "*.exe") +
GetFiles(path + "*.config");
var files = allFiles.Where(x => !x.GetFilename().ToString().Contains(".vshost.exe"));
Information("Copying from {0}", path);
CopyFiles(files, binDir);
var assemblyInfo = ParseAssemblyInfo("./src/DiabloInterface/Properties/AssemblyInfo.cs");
var fileName = string.Format("DiabloInterface-v{0}.zip", assemblyInfo.AssemblyInformationalVersion);
ZipCompress(binDir, buildDir + File(fileName));
});
Task("Default")
.IsDependentOn("Package");
RunTarget(target);
| #addin nuget:?package=Cake.Compression&version=0.1.1
#addin nuget:?package=SharpZipLib&version=0.86.0
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var buildNumber = Argument("buildNumber", "0");
var buildDir = Directory("./artifacts");
var binDir = buildDir + Directory("bin");
var solution = "./src/DiabloInterface.sln";
Task("Clean")
.Does(() =>
{
CleanDirectory(binDir);
});
Task("RestorePackages")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore(solution);
});
Task("Build")
.IsDependentOn("RestorePackages")
.Does(() =>
{
MSBuild(solution, settings => settings
.SetConfiguration(configuration)
.SetVerbosity(Verbosity.Minimal)
);
});
Task("Package")
.IsDependentOn("Build")
.Does(() =>
{
var path = "./src/DiabloInterface/bin/" + configuration + "/";
var allFiles =
GetFiles(path + "*.dll") +
GetFiles(path + "*.exe") +
GetFiles(path + "*.config");
var files = allFiles.Where(x => !x.GetFilename().ToString().Contains(".vshost.exe"));
Information("Copying from {0}", path);
CopyFiles(files, binDir);
var assemblyInfo = ParseAssemblyInfo("./src/DiabloInterface/Properties/AssemblyInfo.cs");
var fileName = string.Format("DiabloInterface-v{0}.zip", assemblyInfo.AssemblyInformationalVersion);
ZipCompress(binDir, buildDir + File(fileName));
});
Task("Default")
.IsDependentOn("Package");
RunTarget(target);
| mit | C# |
d7f287195e2d9902e5037ad42e6166e54ce54575 | Add a check for when the MyGet Eto source already exists (#8) | Marc3842h/Titan,Marc3842h/Titan,Marc3842h/Titan | build.cake | build.cake | #tool "nuget:?package=xunit.runner.console"
var config = Argument("configuration", "Release");
var buildDir = Directory("./Titan/bin/") + Directory(config);
Task("Clean")
.Does(() =>
{
CleanDirectory(buildDir);
});
Task("Restore-NuGet-Packages")
.IsDependentOn("Clean")
.Does(() =>
{
if(!NuGetHasSource("https://www.myget.org/F/eto/api/v3/index.json")) {
// First add MyGet Eto source
NuGetAddSource(
name: "MyGet.org Eto",
source: "https://www.myget.org/F/eto/api/v3/index.json"
);
}
NuGetRestore("./Titan.sln");
});
Task("Build")
.IsDependentOn("Restore-NuGet-Packages")
.Does(() =>
{
if(IsRunningOnWindows())
{
// Use MSBuild
MSBuild("./Titan.sln", settings => settings.SetConfiguration(config));
}
else
{
// Use XBuild
XBuild("./Titan.sln", settings => settings.SetConfiguration(config));
}
});
Task("Run-Unit-Tests")
.IsDependentOn("Build")
.Does(() =>
{
XUnit2(GetFiles("./TitanTest/bin/" + config + "/Titan*.dll"), new XUnit2Settings()
{
Parallelism = ParallelismOption.All,
OutputDirectory = "./TitanTest/bin/" + config + "/results"
});
});
Task("Default").IsDependentOn("Run-Unit-Tests");
RunTarget("Default");
| #tool "nuget:?package=xunit.runner.console"
var config = Argument("configuration", "Release");
var buildDir = Directory("./Titan/bin/") + Directory(config);
Task("Clean")
.Does(() =>
{
CleanDirectory(buildDir);
});
Task("Restore-NuGet-Packages")
.IsDependentOn("Clean")
.Does(() =>
{
// First add MyGet Eto source
NuGetAddSource(
name: "MyGet.org Eto",
source: "https://www.myget.org/F/eto/api/v3/index.json"
);
NuGetRestore("./Titan.sln");
});
Task("Build")
.IsDependentOn("Restore-NuGet-Packages")
.Does(() =>
{
if(IsRunningOnWindows())
{
// Use MSBuild
MSBuild("./Titan.sln", settings => settings.SetConfiguration(config));
}
else
{
// Use XBuild
XBuild("./Titan.sln", settings => settings.SetConfiguration(config));
}
});
Task("Run-Unit-Tests")
.IsDependentOn("Build")
.Does(() =>
{
XUnit2(GetFiles("./TitanTest/bin/" + config + "/Titan*.dll"), new XUnit2Settings()
{
Parallelism = ParallelismOption.All,
OutputDirectory = "./TitanTest/bin/" + config + "/results"
});
});
Task("Default").IsDependentOn("Run-Unit-Tests");
RunTarget("Default");
| mit | C# |
f0d4ab9aa7d46671064a3a833f3bd5d3883d992a | Revert "ignore opencover sample project" | mgj/fetcher,mgj/fetcher | build.cake | build.cake | #tool "nuget:?package=GitVersion.CommandLine"
#tool "nuget:?package=gitlink"
var sln = new FilePath("Fetcher.sln");
var binDir = new DirectoryPath("bin");
var outputDir = new DirectoryPath("artifacts");
var target = Argument("target", "Default");
var isRunningOnAppVeyor = AppVeyor.IsRunningOnAppVeyor;
var isPullRequest = AppVeyor.Environment.PullRequest.IsPullRequest;
Task("Clean").Does(() =>
{
CleanDirectories("./**/bin");
CleanDirectories("./**/obj");
CleanDirectories(binDir.FullPath);
CleanDirectories(outputDir.FullPath);
});
GitVersion versionInfo = null;
Task("Version").Does(() => {
GitVersion(new GitVersionSettings {
UpdateAssemblyInfo = true,
OutputType = GitVersionOutput.BuildServer
});
versionInfo = GitVersion(new GitVersionSettings{ OutputType = GitVersionOutput.Json });
Information("VI:\t{0}", versionInfo.FullSemVer);
});
Task("Restore").Does(() => {
NuGetRestore(sln);
});
Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Version")
.IsDependentOn("Restore")
.Does(() => {
DotNetBuild(sln,
settings => settings.SetConfiguration("Release")
);
});
Task("GitLink")
.WithCriteria(() => IsRunningOnWindows())
.IsDependentOn("Build")
.Does(() => {
GitLink(sln.GetDirectory(), new GitLinkSettings {
RepositoryUrl = "https://github.com/mgj/fetcher",
ArgumentCustomization = args => args.Append(
"-ignore fetcher.core.tests,fetcher.playground.core,fetcher.playground.droid,fetcher.playground.touch")
});
});
Task("PackageAll")
.IsDependentOn("GitLink")
.Does(() => {
EnsureDirectoryExists(outputDir);
var nugetSettings = new NuGetPackSettings {
Authors = new [] { "Mikkel Jensen" },
Owners = new [] { "Mikkel Jensen" },
IconUrl = new Uri("https://artm.dk/images/android-logo.png"),
ProjectUrl = new Uri("https://github.com/mgj/fetcher"),
LicenseUrl = new Uri("https://github.com/mgj/fetcher/blob/master/LICENSE"),
Copyright = "Copyright (c) Mikkel Jensen",
RequireLicenseAcceptance = false,
Version = versionInfo.NuGetVersion,
Symbols = false,
NoPackageAnalysis = true,
OutputDirectory = outputDir,
Verbosity = NuGetVerbosity.Detailed,
BasePath = "./nuspec"
};
nugetSettings.ReleaseNotes = ParseReleaseNotes("./releasenotes/fetcher.md").Notes.ToArray();
NuGetPack("./nuspec/artm.fetcher.nuspec", nugetSettings);
});
Task("UploadAppVeyorArtifact")
.IsDependentOn("PackageAll")
.WithCriteria(() => !isPullRequest)
.WithCriteria(() => isRunningOnAppVeyor)
.Does(() => {
Information("Artifacts Dir: {0}", outputDir.FullPath);
foreach(var file in GetFiles(outputDir.FullPath + "/*")) {
Information("Uploading {0}", file.FullPath);
AppVeyor.UploadArtifact(file.FullPath);
}
});
Task("Default").IsDependentOn("UploadAppVeyorArtifact").Does(() => {});
RunTarget(target); | #tool "nuget:?package=GitVersion.CommandLine"
#tool "nuget:?package=gitlink"
var sln = new FilePath("Fetcher.sln");
var binDir = new DirectoryPath("bin");
var outputDir = new DirectoryPath("artifacts");
var target = Argument("target", "Default");
var isRunningOnAppVeyor = AppVeyor.IsRunningOnAppVeyor;
var isPullRequest = AppVeyor.Environment.PullRequest.IsPullRequest;
Task("Clean").Does(() =>
{
CleanDirectories("./**/bin");
CleanDirectories("./**/obj");
CleanDirectories(binDir.FullPath);
CleanDirectories(outputDir.FullPath);
});
GitVersion versionInfo = null;
Task("Version").Does(() => {
GitVersion(new GitVersionSettings {
UpdateAssemblyInfo = true,
OutputType = GitVersionOutput.BuildServer
});
versionInfo = GitVersion(new GitVersionSettings{ OutputType = GitVersionOutput.Json });
Information("VI:\t{0}", versionInfo.FullSemVer);
});
Task("Restore").Does(() => {
NuGetRestore(sln);
});
Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Version")
.IsDependentOn("Restore")
.Does(() => {
DotNetBuild(sln,
settings => settings.SetConfiguration("Release")
);
});
Task("GitLink")
.WithCriteria(() => IsRunningOnWindows())
.IsDependentOn("Build")
.Does(() => {
GitLink(sln.GetDirectory(), new GitLinkSettings {
RepositoryUrl = "https://github.com/mgj/fetcher",
ArgumentCustomization = args => args.Append(
"-ignore bom,bomtest,fetcher.core.tests,fetcher.playground.core,fetcher.playground.droid,fetcher.playground.touch")
});
});
Task("PackageAll")
.IsDependentOn("GitLink")
.Does(() => {
EnsureDirectoryExists(outputDir);
var nugetSettings = new NuGetPackSettings {
Authors = new [] { "Mikkel Jensen" },
Owners = new [] { "Mikkel Jensen" },
IconUrl = new Uri("https://artm.dk/images/android-logo.png"),
ProjectUrl = new Uri("https://github.com/mgj/fetcher"),
LicenseUrl = new Uri("https://github.com/mgj/fetcher/blob/master/LICENSE"),
Copyright = "Copyright (c) Mikkel Jensen",
RequireLicenseAcceptance = false,
Version = versionInfo.NuGetVersion,
Symbols = false,
NoPackageAnalysis = true,
OutputDirectory = outputDir,
Verbosity = NuGetVerbosity.Detailed,
BasePath = "./nuspec"
};
nugetSettings.ReleaseNotes = ParseReleaseNotes("./releasenotes/fetcher.md").Notes.ToArray();
NuGetPack("./nuspec/artm.fetcher.nuspec", nugetSettings);
});
Task("UploadAppVeyorArtifact")
.IsDependentOn("PackageAll")
.WithCriteria(() => !isPullRequest)
.WithCriteria(() => isRunningOnAppVeyor)
.Does(() => {
Information("Artifacts Dir: {0}", outputDir.FullPath);
foreach(var file in GetFiles(outputDir.FullPath + "/*")) {
Information("Uploading {0}", file.FullPath);
AppVeyor.UploadArtifact(file.FullPath);
}
});
Task("Default").IsDependentOn("UploadAppVeyorArtifact").Does(() => {});
RunTarget(target); | apache-2.0 | C# |
a282071afe4838917c51a4de93e7e3f9e4bc4d6e | fix project.json location for dotnetrestore | frozenskys/appy-christmas,frozenskys/appy-christmas | build.cake | build.cake | ///////////////////////////////////////////////////////////////////////////////
// Tools and Addins
///////////////////////////////////////////////////////////////////////////////
#addin nuget:?package=Cake.Figlet
///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Debug");
///////////////////////////////////////////////////////////////////////////////
// SETUP / TEARDOWN
///////////////////////////////////////////////////////////////////////////////
Setup(ctx =>
{
// Executed BEFORE the first task.
Information(Figlet("Appy Christmas"));
});
Teardown(ctx =>
{
// Executed AFTER the last task.
Information("Finished running tasks.");
});
///////////////////////////////////////////////////////////////////////////////
// USER TASKS
///////////////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(ctx => {
CleanDirectories("./src/**/bin/" + configuration);
CleanDirectories("./src/**/obj/" + configuration);
});
Task("Restore")
.IsDependentOn("Clean")
.Does(ctx => {
DotNetCoreRestore("./src/ProductApi/project.json", new DotNetCoreRestoreSettings {
Sources = new [] { "https://api.nuget.org/v3/index.json" }
});
});
Task("Build")
.IsDependentOn("Restore")
.Does(ctx => {
var projects = GetFiles("./**/project.json");
foreach(var project in projects)
{
DotNetCoreBuild(project.GetDirectory().FullPath, new DotNetCoreBuildSettings {
Configuration = configuration
});
}
});
Task("Publish")
.IsDependentOn("Build")
.Does(ctx => {
var settings = new DotNetCorePublishSettings
{
Framework = "netcoreapp1.1",
Configuration = "Release",
OutputDirectory = "./artifacts/"
};
DotNetCorePublish("./src/ProductApi/project.json", settings);
});
Task("Run")
.IsDependentOn("Build")
.Does(() => {
DotNetCoreRun("./src/ProductApi");
});
Task("AppVeyor")
.IsDependentOn("Publish");
Task("Default")
.IsDependentOn("Run");
RunTarget(target); | ///////////////////////////////////////////////////////////////////////////////
// Tools and Addins
///////////////////////////////////////////////////////////////////////////////
#addin nuget:?package=Cake.Figlet
///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Debug");
///////////////////////////////////////////////////////////////////////////////
// SETUP / TEARDOWN
///////////////////////////////////////////////////////////////////////////////
Setup(ctx =>
{
// Executed BEFORE the first task.
Information(Figlet("Appy Christmas"));
});
Teardown(ctx =>
{
// Executed AFTER the last task.
Information("Finished running tasks.");
});
///////////////////////////////////////////////////////////////////////////////
// USER TASKS
///////////////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(ctx => {
CleanDirectories("./src/**/bin/" + configuration);
CleanDirectories("./src/**/obj/" + configuration);
});
Task("Restore")
.IsDependentOn("Clean")
.Does(ctx => {
DotNetCoreRestore("./", new DotNetCoreRestoreSettings {
Sources = new [] { "https://api.nuget.org/v3/index.json" },
Verbosity = DotNetCoreRestoreVerbosity.Warning
});
});
Task("Build")
.IsDependentOn("Restore")
.Does(ctx => {
var projects = GetFiles("./**/project.json");
foreach(var project in projects)
{
DotNetCoreBuild(project.GetDirectory().FullPath, new DotNetCoreBuildSettings {
Configuration = configuration
});
}
});
Task("Publish")
.IsDependentOn("Build")
.Does(ctx => {
var settings = new DotNetCorePublishSettings
{
Framework = "netcoreapp1.0",
Configuration = "Release",
OutputDirectory = "./artifacts/"
};
DotNetCorePublish("./src/ProductApi/project.json", settings);
});
Task("Run")
.IsDependentOn("Build")
.Does(() => {
DotNetCoreRun("./src/ProductApi");
});
Task("AppVeyor")
.IsDependentOn("Publish");
Task("Default")
.IsDependentOn("Run");
RunTarget(target); | mit | C# |
91ca245c584921864a44f15b9c8934147c53d469 | Allow testing | EVAST9919/osu,naoey/osu,smoogipoo/osu,johnneijzen/osu,UselessToucan/osu,DrabWeb/osu,smoogipoo/osu,2yangk23/osu,peppy/osu,peppy/osu-new,smoogipooo/osu,DrabWeb/osu,ppy/osu,ppy/osu,smoogipoo/osu,2yangk23/osu,naoey/osu,DrabWeb/osu,NeoAdonis/osu,NeoAdonis/osu,EVAST9919/osu,UselessToucan/osu,johnneijzen/osu,NeoAdonis/osu,peppy/osu,ZLima12/osu,UselessToucan/osu,naoey/osu,peppy/osu,ppy/osu,ZLima12/osu | build.cake | build.cake | ///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////
var target = Argument("target", "Build");
var framework = Argument("framework", "net471");
var configuration = Argument("configuration", "Release");
var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj");
var testProjects = GetFiles("**/*.Tests.csproj");
///////////////////////////////////////////////////////////////////////////////
// TASKS
///////////////////////////////////////////////////////////////////////////////
Task("Compile")
.Does(() => {
DotNetCoreBuild(osuDesktop.FullPath, new DotNetCoreBuildSettings {
Framework = framework,
Configuration = configuration
});
});
Task("Test")
.ContinueOnError()
.DoesForEach(testProjects, testProject => {
DotNetCoreTest(testProject.FullPath, new DotNetCoreTestSettings {3
Framework = framework,
Configuration = configuration,
Logger = $"trx;LogFileName={testProject.GetFilename()}.trx",
ResultsDirectory = "./TestResults/"
});
});
Task("Build")
.IsDependentOn("Compile")
.IsDependentOn("Test");
RunTarget(target); | #tool Microsoft.TestPlatform.Portable
///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////
var target = Argument("target", "Test");
var framework = Argument("framework", "net471");
var configuration = Argument("configuration", "Debug");
var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj");
var testProjects = new [] {
new FilePath("./osu.Game.Tests/osu.Game.Tests.csproj"),
new FilePath("./osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj"),
new FilePath("./osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj"),
new FilePath("./osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj"),
new FilePath("./osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj"),
};
///////////////////////////////////////////////////////////////////////////////
// TASKS
///////////////////////////////////////////////////////////////////////////////
Task("Compile")
.Does(() => {
DotNetCoreBuild(osuDesktop.FullPath, new DotNetCoreBuildSettings {
Framework = framework,
Configuration = "Debug"
});
});
Task("CompileTests")
.DoesForEach(testProjects, testProject => {
DotNetCoreBuild(testProject.FullPath, new DotNetCoreBuildSettings {
Framework = framework
});
});
Task("Test")
.IsDependentOn("CompileTests")
.Does(() => {
VSTest($"./*.Tests/bin/{configuration}/{framework}/**/*Tests.exe");
});
RunTarget(target); | mit | C# |
625e205ed26468ca0db9e6a7214ba2494afb4178 | Clean up build script | robertcoltheart/Inject,robertcoltheart/Inject | build.cake | build.cake | #tool "nuget:?package=GitVersion.CommandLine&version=3.6.1"
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.4.1"
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var nugetApiKey = Argument("nugetapikey", EnvironmentVariable("NUGET_API_KEY"));
//////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
//////////////////////////////////////////////////////////////////////
var version = "1.0.0";
var artifacts = Directory("./artifacts");
var solution = File("./src/Inject.sln");
//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
CleanDirectories("./src/**/bin");
CleanDirectories("./src/**/obj");
if (DirectoryExists(artifacts))
DeleteDirectory(artifacts, true);
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore(solution);
});
Task("Versioning")
.IsDependentOn("Clean")
.WithCriteria(() => !BuildSystem.IsLocalBuild)
.Does(() =>
{
GitVersion(new GitVersionSettings
{
OutputType = GitVersionOutput.BuildServer
});
var result = GitVersion(new GitVersionSettings
{
UpdateAssemblyInfo = true
});
version = result.NuGetVersion;
});
Task("Build")
.IsDependentOn("Versioning")
.IsDependentOn("Restore")
.Does(() =>
{
CreateDirectory(artifacts);
DotNetBuild(solution, x =>
{
x.SetConfiguration("Release");
x.WithProperty("GenerateDocumentation", "true");
});
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
var testResults = artifacts + File("TestResults.xml");
NUnit3("./src/**/bin/**/Release/*.Tests.dll", new NUnit3Settings
{
Results = testResults
});
if (BuildSystem.IsRunningOnAppVeyor)
AppVeyor.UploadTestResults(testResults, AppVeyorTestResultsType.NUnit3);
});
Task("Package")
.IsDependentOn("Build")
.IsDependentOn("Test")
.Does(() =>
{
NuGetPack("./build/Inject.nuspec", new NuGetPackSettings
{
Version = version,
BasePath = "./src",
OutputDirectory = artifacts
});
});
Task("Publish")
.IsDependentOn("Package")
.Does(() =>
{
var package = "./artifacts/Inject." + version + ".nupkg";
NuGetPush(package, new NuGetPushSettings
{
ApiKey = nugetApiKey
});
});
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("Package");
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);
| #addin "nuget:?package=Cake.DocFx&version=0.1.6"
#addin "nuget:?package=Cake.ReSharperReports&version=0.3.1"
#tool "nuget:?package=GitVersion.CommandLine&version=3.6.1"
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.4.1"
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var nugetApiKey = Argument("nugetapikey", EnvironmentVariable("NUGET_API_KEY"));
//////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
//////////////////////////////////////////////////////////////////////
var version = "1.0.0";
var artifacts = Directory("./artifacts");
var solution = File("./src/Inject.sln");
//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
CleanDirectories("./src/**/bin");
CleanDirectories("./src/**/obj");
if (DirectoryExists(artifacts))
DeleteDirectory(artifacts, true);
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore(solution);
});
Task("Versioning")
.IsDependentOn("Clean")
.WithCriteria(() => !BuildSystem.IsLocalBuild)
.Does(() =>
{
GitVersion(new GitVersionSettings
{
OutputType = GitVersionOutput.BuildServer
});
var result = GitVersion(new GitVersionSettings
{
UpdateAssemblyInfo = true
});
version = result.NuGetVersion;
});
Task("Build")
.IsDependentOn("Versioning")
.IsDependentOn("Restore")
.Does(() =>
{
CreateDirectory(artifacts);
DotNetBuild(solution, x =>
{
x.SetConfiguration("Release");
x.WithProperty("GenerateDocumentation", "true");
});
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
var testResults = artifacts + File("TestResults.xml");
NUnit3("./src/**/bin/**/Release/*.Tests.dll", new NUnit3Settings
{
Results = testResults
});
if (BuildSystem.IsRunningOnAppVeyor)
AppVeyor.UploadTestResults(testResults, AppVeyorTestResultsType.NUnit3);
});
Task("Package")
.IsDependentOn("Build")
.IsDependentOn("Test")
.Does(() =>
{
NuGetPack("./build/Inject.nuspec", new NuGetPackSettings
{
Version = version,
BasePath = "./src",
OutputDirectory = artifacts
});
});
Task("Publish")
.IsDependentOn("Package")
.Does(() =>
{
var package = "./artifacts/Inject." + version + ".nupkg";
NuGetPush(package, new NuGetPushSettings
{
ApiKey = nugetApiKey
});
});
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("Package");
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);
| mit | C# |
ce603fc99ec9c2b9cc5d233f14878d61930634d0 | Update cake script to csproj | stormpath/stormpath-dotnet-owin-middleware | build.cake | build.cake | var configuration = Argument("configuration", "Debug");
Task("Clean")
.Does(() =>
{
CleanDirectory("./artifacts/");
});
Task("Restore")
.Does(() =>
{
DotNetCoreRestore();
});
Task("Build")
.Does(() =>
{
DotNetCoreBuild("./src/**/*.csproj", new DotNetCoreBuildSettings
{
Configuration = configuration
});
});
Task("Pack")
.Does(() =>
{
new List<string>
{
"Stormpath.Owin.Abstractions",
"Stormpath.Owin.Middleware",
"Stormpath.Owin.Views.Precompiled"
}.ForEach(name =>
{
DotNetCorePack("./src/" + name + ".csproj", new DotNetCorePackSettings
{
Configuration = configuration,
OutputDirectory = "./artifacts/"
});
});
});
Task("Test")
.IsDependentOn("Restore")
.IsDependentOn("Build")
.Does(() =>
{
new List<string>
{
"Stormpath.Owin.UnitTest"
}.ForEach(name =>
{
DotNetCoreTest("./test/" + name + ".csproj");
});
});
Task("Default")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.IsDependentOn("Build")
.IsDependentOn("Pack");
var target = Argument("target", "Default");
RunTarget(target); | var configuration = Argument("configuration", "Debug");
Task("Clean")
.Does(() =>
{
CleanDirectory("./artifacts/");
});
Task("Restore")
.Does(() =>
{
DotNetCoreRestore();
});
Task("Build")
.Does(() =>
{
DotNetCoreBuild("./src/**/project.json", new DotNetCoreBuildSettings
{
Configuration = configuration
});
});
Task("Pack")
.Does(() =>
{
new List<string>
{
"Stormpath.Owin.Abstractions",
"Stormpath.Owin.Middleware",
"Stormpath.Owin.Views.Precompiled"
}.ForEach(name =>
{
DotNetCorePack("./src/" + name + "/project.json", new DotNetCorePackSettings
{
Configuration = configuration,
OutputDirectory = "./artifacts/"
});
});
});
Task("Test")
.IsDependentOn("Restore")
.IsDependentOn("Build")
.Does(() =>
{
new List<string>
{
"Stormpath.Owin.UnitTest"
}.ForEach(name =>
{
DotNetCoreTest("./test/" + name + "/project.json");
});
});
Task("Default")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.IsDependentOn("Build")
.IsDependentOn("Pack");
var target = Argument("target", "Default");
RunTarget(target); | apache-2.0 | C# |
09a3a3b3a46792edb66ddd39119d990f76a89975 | fix build script | Sphiecoh/MusicStore,Sphiecoh/MusicStore | build.cake | build.cake | var target = Argument("target", "Default");
var configuration = Argument<string>("configuration", "Release");
///////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
///////////////////////////////////////////////////////////////////////////////
var isLocalBuild = !AppVeyor.IsRunningOnAppVeyor;
var sourcePath = Directory("./src/NancyMusicStore");
var testsPath = Directory("test");
var buildArtifacts = Directory("./artifacts/packages");
Task("Publish")
.IsDependentOn("RunTests")
.Does(() =>
{
var settings = new DotNetCorePublishSettings
{
// Framework = "netcoreapp1.0",
Configuration = "Release",
OutputDirectory = buildArtifacts
};
var projects = GetFiles("./**/*.csproj");
foreach(var project in projects)
{
DotNetCorePublish(project.GetDirectory().FullPath, settings);
}
});
Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.Does(() =>
{
var projects = GetFiles("./**/*.csproj");
foreach(var project in projects)
{
var settings = new DotNetCoreBuildSettings
{
Configuration = configuration
// Runtime = IsRunningOnWindows() ? null : "unix-x64"
};
DotNetCoreBuild(project.GetDirectory().FullPath, settings);
}
});
Task("RunTests")
.IsDependentOn("Build")
.Does(() =>
{
var projects = GetFiles("./test/**/*.csproj");
foreach(var project in projects)
{
var settings = new DotNetCoreTestSettings
{
Configuration = configuration
};
DotNetCoreTest(project.GetDirectory().FullPath, settings);
}
});
Task("Clean")
.Does(() =>
{
CleanDirectories(new DirectoryPath[] { buildArtifacts });
});
Task("Restore")
.Does(() =>
{
var settings = new DotNetCoreRestoreSettings
{
Sources = new [] { "https://api.nuget.org/v3/index.json" }
};
DotNetCoreRestore("./NancyMusicStore.sln", settings);
//DotNetCoreRestore(testsPath, settings);
});
Task("Default")
.IsDependentOn("Build");
RunTarget(target); | var target = Argument("target", "Default");
var configuration = Argument<string>("configuration", "Release");
///////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
///////////////////////////////////////////////////////////////////////////////
var isLocalBuild = !AppVeyor.IsRunningOnAppVeyor;
var sourcePath = Directory("./src/NancyMusicStore");
var testsPath = Directory("test");
var buildArtifacts = Directory("./artifacts/packages");
Task("Publish")
.IsDependentOn("RunTests")
.Does(() =>
{
var settings = new DotNetCorePublishSettings
{
// Framework = "netcoreapp1.0",
Configuration = "Release",
OutputDirectory = buildArtifacts
};
var projects = GetFiles("./**/project.json");
foreach(var project in projects)
{
DotNetCorePublish(project.GetDirectory().FullPath, settings);
}
});
Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.Does(() =>
{
var projects = GetFiles("./**/project.json");
foreach(var project in projects)
{
var settings = new DotNetCoreBuildSettings
{
Configuration = configuration
// Runtime = IsRunningOnWindows() ? null : "unix-x64"
};
DotNetCoreBuild(project.GetDirectory().FullPath, settings);
}
});
Task("RunTests")
.IsDependentOn("Build")
.Does(() =>
{
var projects = GetFiles("./test/**/project.json");
foreach(var project in projects)
{
var settings = new DotNetCoreTestSettings
{
Configuration = configuration
};
DotNetCoreTest(project.GetDirectory().FullPath, settings);
}
});
Task("Clean")
.Does(() =>
{
CleanDirectories(new DirectoryPath[] { buildArtifacts });
});
Task("Restore")
.Does(() =>
{
var settings = new DotNetCoreRestoreSettings
{
Sources = new [] { "https://api.nuget.org/v3/index.json" }
};
DotNetCoreRestore("./src", settings);
//DotNetCoreRestore(testsPath, settings);
});
Task("Default")
.IsDependentOn("Build");
RunTarget(target); | mit | C# |
2fafc74c74e838cfd1df833fb4ee9e7d1274f299 | Add copyright header. | ft-/opensim-optimizations-wip,AlexRa/opensim-mods-Alex,ft-/arribasim-dev-extras,bravelittlescientist/opensim-performance,bravelittlescientist/opensim-performance,bravelittlescientist/opensim-performance,N3X15/VoxelSim,intari/OpenSimMirror,RavenB/opensim,allquixotic/opensim-autobackup,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,QuillLittlefeather/opensim-1,zekizeki/agentservice,justinccdev/opensim,BogusCurry/arribasim-dev,justinccdev/opensim,AlphaStaxLLC/taiga,justinccdev/opensim,N3X15/VoxelSim,RavenB/opensim,ft-/arribasim-dev-extras,ft-/opensim-optimizations-wip-extras,M-O-S-E-S/opensim,BogusCurry/arribasim-dev,ft-/arribasim-dev-tests,N3X15/VoxelSim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,bravelittlescientist/opensim-performance,AlexRa/opensim-mods-Alex,AlexRa/opensim-mods-Alex,ft-/arribasim-dev-tests,QuillLittlefeather/opensim-1,N3X15/VoxelSim,AlphaStaxLLC/taiga,justinccdev/opensim,AlphaStaxLLC/taiga,ft-/opensim-optimizations-wip-extras,Michelle-Argus/ArribasimExtract,TomDataworks/opensim,TechplexEngineer/Aurora-Sim,cdbean/CySim,ft-/opensim-optimizations-wip-tests,ft-/opensim-optimizations-wip-tests,allquixotic/opensim-autobackup,Michelle-Argus/ArribasimExtract,TechplexEngineer/Aurora-Sim,rryk/omp-server,ft-/arribasim-dev-tests,TomDataworks/opensim,intari/OpenSimMirror,ft-/opensim-optimizations-wip,zekizeki/agentservice,OpenSimian/opensimulator,intari/OpenSimMirror,RavenB/opensim,OpenSimian/opensimulator,M-O-S-E-S/opensim,N3X15/VoxelSim,intari/OpenSimMirror,bravelittlescientist/opensim-performance,intari/OpenSimMirror,M-O-S-E-S/opensim,bravelittlescientist/opensim-performance,RavenB/opensim,BogusCurry/arribasim-dev,BogusCurry/arribasim-dev,zekizeki/agentservice,OpenSimian/opensimulator,ft-/opensim-optimizations-wip-tests,AlexRa/opensim-mods-Alex,allquixotic/opensim-autobackup,rryk/omp-server,Michelle-Argus/ArribasimExtract,AlphaStaxLLC/taiga,QuillLittlefeather/opensim-1,OpenSimian/opensimulator,justinccdev/opensim,allquixotic/opensim-autobackup,allquixotic/opensim-autobackup,TomDataworks/opensim,ft-/opensim-optimizations-wip-extras,TechplexEngineer/Aurora-Sim,ft-/arribasim-dev-extras,AlphaStaxLLC/taiga,ft-/arribasim-dev-extras,M-O-S-E-S/opensim,ft-/opensim-optimizations-wip,OpenSimian/opensimulator,ft-/arribasim-dev-tests,cdbean/CySim,AlexRa/opensim-mods-Alex,cdbean/CySim,zekizeki/agentservice,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,ft-/opensim-optimizations-wip,QuillLittlefeather/opensim-1,ft-/arribasim-dev-tests,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,ft-/opensim-optimizations-wip-extras,intari/OpenSimMirror,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,ft-/arribasim-dev-extras,QuillLittlefeather/opensim-1,zekizeki/agentservice,rryk/omp-server,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,AlphaStaxLLC/taiga,BogusCurry/arribasim-dev,AlexRa/opensim-mods-Alex,N3X15/VoxelSim,RavenB/opensim,BogusCurry/arribasim-dev,ft-/opensim-optimizations-wip-extras,TomDataworks/opensim,ft-/opensim-optimizations-wip-tests,M-O-S-E-S/opensim,RavenB/opensim,cdbean/CySim,Michelle-Argus/ArribasimExtract,OpenSimian/opensimulator,TechplexEngineer/Aurora-Sim,N3X15/VoxelSim,TomDataworks/opensim,AlphaStaxLLC/taiga,cdbean/CySim,Michelle-Argus/ArribasimExtract,ft-/opensim-optimizations-wip-tests,zekizeki/agentservice,rryk/omp-server,allquixotic/opensim-autobackup,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,cdbean/CySim,rryk/omp-server,AlphaStaxLLC/taiga,QuillLittlefeather/opensim-1,N3X15/VoxelSim,M-O-S-E-S/opensim,RavenB/opensim,TomDataworks/opensim,ft-/arribasim-dev-tests,ft-/arribasim-dev-extras,Michelle-Argus/ArribasimExtract,justinccdev/opensim,OpenSimian/opensimulator,QuillLittlefeather/opensim-1,M-O-S-E-S/opensim,TomDataworks/opensim,rryk/omp-server | OpenSim/Framework/ConfigBase.cs | OpenSim/Framework/ConfigBase.cs | /*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework
{
public abstract class ConfigBase
{
protected ConfigurationMember m_configMember;
}
}
| using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework
{
public abstract class ConfigBase
{
protected ConfigurationMember m_configMember;
}
}
| bsd-3-clause | C# |
557a33c254af5c05fcb1c7c3c9a87cb948431df2 | Update Version.cs | plivo/plivo-dotnet,plivo/plivo-dotnet | src/Plivo/Version.cs | src/Plivo/Version.cs | using System;
namespace Plivo
{
/// <summary>
/// Version.
/// </summary>
public class Version
{
/// <summary>
/// DotNet SDK version
/// </summary>
public const string SdkVersion = "4.4.10";
/// <summary>
/// Plivo API version
/// </summary>
public const string ApiVersion = "v1";
}
}
| using System;
namespace Plivo
{
/// <summary>
/// Version.
/// </summary>
public class Version
{
/// <summary>
/// DotNet SDK version
/// </summary>
public const string SdkVersion = "4.4.9";
/// <summary>
/// Plivo API version
/// </summary>
public const string ApiVersion = "v1";
}
}
| mit | C# |
e51049544d4020bef380c47c17cdd21ed1fa58f2 | Update types of IDirectedEdge | DasAllFolks/SharpGraphs | Graph/IDirectedEdge.cs | Graph/IDirectedEdge.cs | using System;
namespace Graph
{
/// <summary>
/// Represents a directed edge (arrow) in a labeled <see cref="Graph"/>.
/// </summary>
/// <typeparam name="V">
/// The type used to create vertex (node) labels.
/// </typeparam>
public interface IDirectedEdge<V, W> : IEdge<V, W>, IEquatable<IDirectedEdge<V, W>>
where V : struct, IEquatable<V>
where W : struct, IComparable<W>, IEquatable<W>
{
/// <summary>
/// Returns the head (vertex) of the <see cref="IDirectedEdge{V}"/>.
/// </summary>
V Head { get; }
/// <summary>
/// Returns the tail (vertex) of the <see cref="IDirectedEdge{V}"/>.
/// </summary>
V Tail { get; }
}
}
| using System;
namespace Graph
{
/// <summary>
/// Represents a directed edge (arrow) in a labeled <see cref="Graph"/>.
/// </summary>
/// <typeparam name="V">
/// The type used to create vertex (node) labels.
/// </typeparam>
public interface IDirectedEdge<V> : IEdge<V>, IEquatable<IDirectedEdge<V>>
where V : struct, IEquatable<V>
{
/// <summary>
/// Returns the head (vertex) of the <see cref="IDirectedEdge{V}"/>.
/// </summary>
V Head { get; }
/// <summary>
/// Returns the tail (vertex) of the <see cref="IDirectedEdge{V}"/>.
/// </summary>
V Tail { get; }
}
}
| apache-2.0 | C# |
f5b77a1a91c41c1992ea3b45ddb2905ba988eebd | Change Pcsc<T> to Pcsc<TIPcscProvider> | Archie-Yang/PcscDotNet | src/PcscDotNet/Pcsc_1.cs | src/PcscDotNet/Pcsc_1.cs | using System;
namespace PcscDotNet
{
public static class Pcsc<TIPcscProvider> where TIPcscProvider : class, IPcscProvider, new()
{
private static readonly Pcsc _instance = new Pcsc(new TIPcscProvider());
public static Pcsc Instance => _instance;
public static PcscContext CreateContext()
{
return new PcscContext(_instance);
}
public static PcscContext EstablishContext(SCardScope scope)
{
return new PcscContext(_instance, scope);
}
}
} | using System;
namespace PcscDotNet
{
public static class Pcsc<T> where T : class, IPcscProvider, new()
{
private static readonly Pcsc _instance = new Pcsc(new T());
public static Pcsc Instance => _instance;
public static PcscContext CreateContext()
{
return new PcscContext(_instance);
}
public static PcscContext EstablishContext(SCardScope scope)
{
return new PcscContext(_instance, scope);
}
}
} | mit | C# |
d3270e9ecb2d74945725c2d536921a6c20c60541 | Bump version to 0.24 | github-for-unity/Unity,github-for-unity/Unity,github-for-unity/Unity | common/SolutionInfo.cs | common/SolutionInfo.cs | #pragma warning disable 436
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub for Unity")]
[assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("TestUtils", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("TaskSystemIntegrationTests", AllInternalsVisible = true)]
//Required for NSubstitute
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)]
//Required for Unity compilation
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)]
namespace System
{
internal static class AssemblyVersionInformation {
internal const string Version = "0.24.0";
}
}
| #pragma warning disable 436
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub for Unity")]
[assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("TestUtils", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("TaskSystemIntegrationTests", AllInternalsVisible = true)]
//Required for NSubstitute
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)]
//Required for Unity compilation
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)]
namespace System
{
internal static class AssemblyVersionInformation {
internal const string Version = "0.23.0";
}
}
| mit | C# |
9ece63a9253370889189ba3cc7a444eea60b3c41 | Bump version | github-for-unity/Unity,github-for-unity/Unity,mpOzelot/Unity,mpOzelot/Unity,github-for-unity/Unity | common/SolutionInfo.cs | common/SolutionInfo.cs | using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub for Unity")]
[assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)]
//Required for NSubstitute
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)]
//Required for Unity compilation
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)]
namespace System
{
internal static class AssemblyVersionInformation {
internal const string Version = "0.3.0.0";
}
}
| using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub for Unity")]
[assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)]
//Required for NSubstitute
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)]
//Required for Unity compilation
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)]
namespace System
{
internal static class AssemblyVersionInformation {
internal const string Version = "0.2.0.0";
}
}
| mit | C# |
5f36eeffe88821f066f54082965adb956958ab8b | Add an assertion for BoundExpression.Display with a null Type. | swaroop-sridhar/roslyn,ErikSchierboom/roslyn,KevinRansom/roslyn,reaction1989/roslyn,weltkante/roslyn,VSadov/roslyn,dpoeschl/roslyn,mmitche/roslyn,abock/roslyn,physhi/roslyn,MattWindsor91/roslyn,wvdd007/roslyn,jkotas/roslyn,KevinH-MS/roslyn,mattscheffer/roslyn,nguerrera/roslyn,nguerrera/roslyn,srivatsn/roslyn,VSadov/roslyn,bkoelman/roslyn,xoofx/roslyn,Hosch250/roslyn,vslsnap/roslyn,cston/roslyn,AmadeusW/roslyn,brettfo/roslyn,abock/roslyn,michalhosala/roslyn,stephentoub/roslyn,KirillOsenkov/roslyn,eriawan/roslyn,mattwar/roslyn,tannergooding/roslyn,Hosch250/roslyn,amcasey/roslyn,mattwar/roslyn,balajikris/roslyn,orthoxerox/roslyn,kelltrick/roslyn,jaredpar/roslyn,mattscheffer/roslyn,mgoertz-msft/roslyn,zooba/roslyn,vslsnap/roslyn,jeffanders/roslyn,OmarTawfik/roslyn,mavasani/roslyn,stephentoub/roslyn,bbarry/roslyn,AmadeusW/roslyn,jeffanders/roslyn,leppie/roslyn,AnthonyDGreen/roslyn,paulvanbrenk/roslyn,natidea/roslyn,paulvanbrenk/roslyn,heejaechang/roslyn,MatthieuMEZIL/roslyn,lorcanmooney/roslyn,Giftednewt/roslyn,AArnott/roslyn,budcribar/roslyn,KevinRansom/roslyn,jhendrixMSFT/roslyn,eriawan/roslyn,dpoeschl/roslyn,xasx/roslyn,vslsnap/roslyn,MattWindsor91/roslyn,wvdd007/roslyn,diryboy/roslyn,MichalStrehovsky/roslyn,dotnet/roslyn,AArnott/roslyn,mavasani/roslyn,Pvlerick/roslyn,zooba/roslyn,TyOverby/roslyn,mmitche/roslyn,tmat/roslyn,jmarolf/roslyn,aelij/roslyn,dotnet/roslyn,leppie/roslyn,aelij/roslyn,reaction1989/roslyn,KevinRansom/roslyn,a-ctor/roslyn,tmeschter/roslyn,OmarTawfik/roslyn,kelltrick/roslyn,agocke/roslyn,cston/roslyn,michalhosala/roslyn,bbarry/roslyn,lorcanmooney/roslyn,jamesqo/roslyn,Shiney/roslyn,srivatsn/roslyn,ljw1004/roslyn,MichalStrehovsky/roslyn,heejaechang/roslyn,bbarry/roslyn,a-ctor/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,shyamnamboodiripad/roslyn,jmarolf/roslyn,tmat/roslyn,mattwar/roslyn,jamesqo/roslyn,bartdesmet/roslyn,drognanar/roslyn,Hosch250/roslyn,jcouv/roslyn,ericfe-ms/roslyn,stephentoub/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,brettfo/roslyn,balajikris/roslyn,DustinCampbell/roslyn,abock/roslyn,dotnet/roslyn,jcouv/roslyn,gafter/roslyn,srivatsn/roslyn,AmadeusW/roslyn,jasonmalinowski/roslyn,diryboy/roslyn,drognanar/roslyn,xasx/roslyn,genlu/roslyn,budcribar/roslyn,sharwell/roslyn,KirillOsenkov/roslyn,bartdesmet/roslyn,swaroop-sridhar/roslyn,mgoertz-msft/roslyn,Giftednewt/roslyn,yeaicc/roslyn,physhi/roslyn,panopticoncentral/roslyn,weltkante/roslyn,diryboy/roslyn,khyperia/roslyn,MichalStrehovsky/roslyn,akrisiun/roslyn,kelltrick/roslyn,gafter/roslyn,tvand7093/roslyn,cston/roslyn,pdelvo/roslyn,pdelvo/roslyn,ErikSchierboom/roslyn,genlu/roslyn,OmarTawfik/roslyn,mattscheffer/roslyn,AnthonyDGreen/roslyn,jhendrixMSFT/roslyn,yeaicc/roslyn,leppie/roslyn,jcouv/roslyn,shyamnamboodiripad/roslyn,drognanar/roslyn,reaction1989/roslyn,jhendrixMSFT/roslyn,CaptainHayashi/roslyn,AlekseyTs/roslyn,gafter/roslyn,amcasey/roslyn,lorcanmooney/roslyn,Shiney/roslyn,tvand7093/roslyn,DustinCampbell/roslyn,ericfe-ms/roslyn,VSadov/roslyn,MatthieuMEZIL/roslyn,KevinH-MS/roslyn,akrisiun/roslyn,AnthonyDGreen/roslyn,robinsedlaczek/roslyn,jeffanders/roslyn,eriawan/roslyn,wvdd007/roslyn,jmarolf/roslyn,zooba/roslyn,swaroop-sridhar/roslyn,panopticoncentral/roslyn,CaptainHayashi/roslyn,shyamnamboodiripad/roslyn,robinsedlaczek/roslyn,jasonmalinowski/roslyn,KiloBravoLima/roslyn,heejaechang/roslyn,tannergooding/roslyn,tvand7093/roslyn,balajikris/roslyn,TyOverby/roslyn,MattWindsor91/roslyn,paulvanbrenk/roslyn,xoofx/roslyn,bkoelman/roslyn,jkotas/roslyn,physhi/roslyn,agocke/roslyn,AlekseyTs/roslyn,amcasey/roslyn,bkoelman/roslyn,sharwell/roslyn,KiloBravoLima/roslyn,jamesqo/roslyn,DustinCampbell/roslyn,tmeschter/roslyn,xoofx/roslyn,ErikSchierboom/roslyn,orthoxerox/roslyn,pdelvo/roslyn,CaptainHayashi/roslyn,panopticoncentral/roslyn,ljw1004/roslyn,khyperia/roslyn,robinsedlaczek/roslyn,budcribar/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,xasx/roslyn,ericfe-ms/roslyn,jasonmalinowski/roslyn,davkean/roslyn,Pvlerick/roslyn,mgoertz-msft/roslyn,natidea/roslyn,khyperia/roslyn,jkotas/roslyn,mmitche/roslyn,MattWindsor91/roslyn,CyrusNajmabadi/roslyn,Giftednewt/roslyn,AlekseyTs/roslyn,TyOverby/roslyn,weltkante/roslyn,tmeschter/roslyn,nguerrera/roslyn,bartdesmet/roslyn,sharwell/roslyn,tmat/roslyn,a-ctor/roslyn,natidea/roslyn,CyrusNajmabadi/roslyn,tannergooding/roslyn,MatthieuMEZIL/roslyn,davkean/roslyn,KirillOsenkov/roslyn,michalhosala/roslyn,Shiney/roslyn,brettfo/roslyn,KevinH-MS/roslyn,ljw1004/roslyn,davkean/roslyn,jaredpar/roslyn,dpoeschl/roslyn,akrisiun/roslyn,genlu/roslyn,KiloBravoLima/roslyn,AArnott/roslyn,jaredpar/roslyn,orthoxerox/roslyn,agocke/roslyn,yeaicc/roslyn,mavasani/roslyn,aelij/roslyn,Pvlerick/roslyn,CyrusNajmabadi/roslyn | src/Compilers/CSharp/Portable/BoundTree/Formatting.cs | src/Compilers/CSharp/Portable/BoundTree/Formatting.cs | // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
using System.Diagnostics;
namespace Microsoft.CodeAnalysis.CSharp
{
internal abstract partial class BoundExpression
{
/// <summary>
/// Returns a serializable object that is used for displaying this expression in a diagnostic message.
/// </summary>
public virtual object Display
{
get
{
Debug.Assert((object)this.Type != null, $"Unexpected null type in {this.GetType().Name}");
return this.Type;
}
}
}
internal sealed partial class BoundArgListOperator
{
public override object Display
{
get { return "__arglist"; }
}
}
internal sealed partial class BoundLiteral
{
public override object Display
{
get { return ConstantValue.IsNull ? MessageID.IDS_NULL.Localize() : base.Display; }
}
}
internal sealed partial class BoundLambda
{
public override object Display
{
get { return this.MessageID.Localize(); }
}
}
internal sealed partial class UnboundLambda
{
public override object Display
{
get { return this.MessageID.Localize(); }
}
}
internal sealed partial class BoundMethodGroup
{
public override object Display
{
get { return MessageID.IDS_MethodGroup.Localize(); }
}
}
internal sealed partial class BoundPropertyGroup
{
public override object Display
{
get { throw ExceptionUtilities.Unreachable; }
}
}
internal sealed partial class BoundThrowExpression
{
public override object Display
{
get { return MessageID.IDS_ThrowExpression.Localize(); }
}
}
}
| // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp
{
internal abstract partial class BoundExpression
{
/// <summary>
/// Returns a serializable object that is used for displaying this expression in a diagnostic message.
/// </summary>
public virtual object Display
{
get { return this.Type; }
}
}
internal sealed partial class BoundArgListOperator
{
public override object Display
{
get { return "__arglist"; }
}
}
internal sealed partial class BoundLiteral
{
public override object Display
{
get { return ConstantValue.IsNull ? MessageID.IDS_NULL.Localize() : base.Display; }
}
}
internal sealed partial class BoundLambda
{
public override object Display
{
get { return this.MessageID.Localize(); }
}
}
internal sealed partial class UnboundLambda
{
public override object Display
{
get { return this.MessageID.Localize(); }
}
}
internal sealed partial class BoundMethodGroup
{
public override object Display
{
get { return MessageID.IDS_MethodGroup.Localize(); }
}
}
internal sealed partial class BoundPropertyGroup
{
public override object Display
{
get { throw ExceptionUtilities.Unreachable; }
}
}
internal sealed partial class BoundThrowExpression
{
public override object Display
{
get { return MessageID.IDS_ThrowExpression.Localize(); }
}
}
}
| mit | C# |
07424f598fa181ba269793bbc08f4da96ccc21bc | Fix test | stripe/stripe-dotnet | src/StripeTests/Infrastructure/StripeExceptionTest.cs | src/StripeTests/Infrastructure/StripeExceptionTest.cs | namespace StripeTests
{
using System.Threading.Tasks;
using Stripe;
using Xunit;
public class StripeExceptionTest : BaseStripeTest
{
public StripeExceptionTest(StripeMockFixture stripeMockFixture)
: base(stripeMockFixture)
{
}
[Fact]
public async Task SetsStripeResponse()
{
// This test assumes that `POST /v1/payment_intents` has at least one required param,
// and so will throw an exception if we provide zero params.
var exception = await Assert.ThrowsAsync<StripeException>(async () =>
{
await new PaymentIntentService(this.StripeClient)
.CreateAsync(new PaymentIntentCreateOptions());
});
Assert.NotNull(exception);
Assert.NotNull(exception.StripeError);
Assert.NotNull(exception.StripeError.StripeResponse);
}
}
}
| namespace StripeTests
{
using System.Threading.Tasks;
using Stripe;
using Xunit;
public class StripeExceptionTest : BaseStripeTest
{
public StripeExceptionTest(StripeMockFixture stripeMockFixture)
: base(stripeMockFixture)
{
}
[Fact]
public async Task SetsStripeResponse()
{
var exception = await Assert.ThrowsAsync<StripeException>(async () =>
{
await new CouponService(this.StripeClient)
.CreateAsync(new CouponCreateOptions());
});
Assert.NotNull(exception);
Assert.NotNull(exception.StripeError);
Assert.NotNull(exception.StripeError.StripeResponse);
}
}
}
| apache-2.0 | C# |
786020dfbdf01ab6930a2fee8a766b53b3ddcbb2 | Make collections in TestGroup observable | lpatalas/ExpressRunner | MiniRunner/TestGroup.cs | MiniRunner/TestGroup.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Caliburn.Micro;
using MiniRunner.Api;
namespace MiniRunner
{
public class TestGroup
{
private readonly string name;
private readonly BindableCollection<TestGroup> subGroups;
private readonly BindableCollection<Test> tests;
public string Name
{
get { return name; }
}
public IList<TestGroup> SubGroups
{
get { return subGroups; }
}
public IList<Test> Tests
{
get { return tests; }
}
public TestGroup(string name)
: this(name, Enumerable.Empty<TestGroup>(), Enumerable.Empty<Test>())
{
}
public TestGroup(string name, IEnumerable<TestGroup> subGroups, IEnumerable<Test> tests)
{
this.name = name;
this.subGroups = new BindableCollection<TestGroup>(subGroups);
this.tests = new BindableCollection<Test>(tests);
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MiniRunner.Api;
namespace MiniRunner
{
public class TestGroup
{
private readonly string name;
private readonly IList<TestGroup> subGroups;
private readonly IList<Test> tests;
public string Name
{
get { return name; }
}
public IList<TestGroup> SubGroups
{
get { return subGroups; }
}
public IList<Test> Tests
{
get { return tests; }
}
public TestGroup(string name)
{
this.name = name;
this.subGroups = new List<TestGroup>();
this.tests = new List<Test>();
}
public TestGroup(string name, IEnumerable<TestGroup> subGroups, IEnumerable<Test> tests)
{
this.name = name;
this.subGroups = subGroups.ToList();
this.tests = tests.ToList();
}
}
}
| mit | C# |
6ec03f4a96ab2396b48a819ac6091ffb4cb5121c | fix the randomScale | enormand/cyber-space-shooter | Assets/Scripts/Objects/DebrisController.cs | Assets/Scripts/Objects/DebrisController.cs | using UnityEngine;
using System.Collections;
public class DebrisController : SpaceObject {
public float minRandomScale;
public float maxRandomScale;
public float scaleAxisVariability;
public float speedVariablity;
public float maxRandomTumble;
public int scoreValue = 1;
private Vector3 speedForce;
public Vector3 SpeedForce {
get { return speedForce; }
set { speedForce = value; }
}
public void ConfigurateDebris () {
Rigidbody rigidbody = GetComponent<Rigidbody> ();
// Random scale
Transform parent = transform.parent;
transform.parent = null;
Vector3 randomScale = Vector3.one * Random.value * (maxRandomScale - minRandomScale) + Vector3.one * minRandomScale // Random axis-uniform scale
+ (Random.insideUnitSphere * scaleAxisVariability);
transform.localScale = randomScale;
transform.parent = parent;
// Random life points
life.LifePoints *= Mathf.Max(Mathf.RoundToInt(randomScale.magnitude), life.LifePoints);
// Random mass
rigidbody.mass *= randomScale.magnitude;
// Random velocity
rigidbody.AddForce (speedForce + Random.insideUnitSphere * speedVariablity, ForceMode.VelocityChange);
rigidbody.AddTorque (Random.insideUnitSphere * maxRandomTumble * rigidbody.mass, ForceMode.Impulse);
}
/*
* Manage the notifications of the LifeController.
*/
protected override void LifeObserver () {
if (life.LifePoints == LifeShieldManager.MIN_LIFE_POINTS) {
scoreManager.Score += scoreValue;
Destroy (gameObject);
}
}
}
| using UnityEngine;
using System.Collections;
public class DebrisController : SpaceObject {
public float minRandomScale;
public float maxRandomScale;
public float scaleAxisVariability;
public float speedVariablity;
public float maxRandomTumble;
public int scoreValue = 1;
private Vector3 speedForce;
public Vector3 SpeedForce {
get { return speedForce; }
set { speedForce = value; }
}
public void ConfigurateDebris () {
Rigidbody rigidbody = GetComponent<Rigidbody> ();
// Random scale
Transform parent = transform.parent;
transform.parent = null;
Vector3 randomScale = Vector3.one * Random.value * (maxRandomScale - minRandomScale) + Vector3.one * minRandomScale // Random axis-uniform scale
+ (Random.insideUnitSphere * 2 * scaleAxisVariability - Vector3.one); // Random vector3 between (-1,-1,-1) to (1,1,1)
transform.localScale = randomScale;
transform.parent = parent;
// Random life points
life.LifePoints *= Mathf.Max(Mathf.RoundToInt(randomScale.magnitude), life.LifePoints);
// Random mass
rigidbody.mass *= randomScale.magnitude;
// Random velocity
rigidbody.AddForce (speedForce + Random.insideUnitSphere * speedVariablity, ForceMode.VelocityChange);
rigidbody.AddTorque (Random.insideUnitSphere * maxRandomTumble * rigidbody.mass, ForceMode.Impulse);
}
/*
* Manage the notifications of the LifeController.
*/
protected override void LifeObserver () {
if (life.LifePoints == LifeShieldManager.MIN_LIFE_POINTS) {
scoreManager.Score += scoreValue;
Destroy (gameObject);
}
}
}
| mit | C# |
015f71f35881e721b3d0f6964926fafccd65ea4d | Update assembly version of Types.dll to 3.7 | NuGetPackageExplorer/NuGetPackageExplorer,BreeeZe/NuGetPackageExplorer,NuGetPackageExplorer/NuGetPackageExplorer,campersau/NuGetPackageExplorer,dsplaisted/NuGetPackageExplorer | Types/Properties/AssemblyInfo.cs | Types/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Outercurve Foundation")]
[assembly: AssemblyProduct("NuGet Package Explorer")]
[assembly: AssemblyCopyright("\x00a9 Outercurve Foundation. All rights reserved.")]
[assembly: AssemblyTitle("NuGetPackageExplorer.Types")]
[assembly: AssemblyDescription("Contains types to enable the plugin architecture in NuGet Package Explorer.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("3.7.0.0")]
[assembly: AssemblyFileVersion("3.7.0.0")]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8bdc7953-73c3-47d6-b0c5-41fda3d55e42")] | using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Outercurve Foundation")]
[assembly: AssemblyProduct("NuGet Package Explorer")]
[assembly: AssemblyCopyright("\x00a9 Outercurve Foundation. All rights reserved.")]
[assembly: AssemblyTitle("NuGetPackageExplorer.Types")]
[assembly: AssemblyDescription("Contains types to enable the plugin architecture in NuGet Package Explorer.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8bdc7953-73c3-47d6-b0c5-41fda3d55e42")] | mit | C# |
c0803ee8f0df48412564af36d5c7d56702b3bf19 | Change test back to using a string builder | csf-dev/CSF.Screenplay,csf-dev/CSF.Screenplay,csf-dev/CSF.Screenplay | Tests/CSF.Screenplay.Reporting.Tests/JsonReportRendererTests.cs | Tests/CSF.Screenplay.Reporting.Tests/JsonReportRendererTests.cs | using System.IO;
using System.Text;
using CSF.Screenplay.Reporting.Tests;
using CSF.Screenplay.Reporting.Tests.Autofixture;
using CSF.Screenplay.ReportModel;
using NUnit.Framework;
namespace CSF.Screenplay.Reporting.Tests
{
[TestFixture]
public class JsonReportRendererTests
{
[Test,AutoMoqData]
public void Write_can_create_a_document_without_crashing([RandomReport] Report report)
{
// Arrange
using(var writer = GetReportOutput())
{
var sut = new JsonReportRenderer(writer);
// Act & assert
Assert.DoesNotThrow(() => sut.Render(report));
}
}
TextWriter GetReportOutput()
{
// Uncomment this line to write the report to a file instead of a throwaway string
//return new StreamWriter("JsonReportRendererTests.json");
var sb = new StringBuilder();
return new StringWriter(sb);
}
}
}
| using System.IO;
using System.Text;
using CSF.Screenplay.Reporting.Tests;
using CSF.Screenplay.Reporting.Tests.Autofixture;
using CSF.Screenplay.ReportModel;
using NUnit.Framework;
namespace CSF.Screenplay.Reporting.Tests
{
[TestFixture]
public class JsonReportRendererTests
{
[Test,AutoMoqData]
public void Write_can_create_a_document_without_crashing([RandomReport] Report report)
{
// Arrange
using(var writer = GetReportOutput())
{
var sut = new JsonReportRenderer(writer);
// Act & assert
Assert.DoesNotThrow(() => sut.Render(report));
}
}
TextWriter GetReportOutput()
{
// Uncomment this line to write the report to a file instead of a throwaway string
return new StreamWriter("JsonReportRendererTests.json");
//var sb = new StringBuilder();
//return new StringWriter(sb);
}
}
}
| mit | C# |
c97d02321110071c2b1ff47e6c8b7a42c5be330d | remove body parameters | j2ghz/IntranetGJAK,j2ghz/IntranetGJAK | IntranetGJAK/Controllers/FileController.cs | IntranetGJAK/Controllers/FileController.cs | using IntranetGJAK.Models;
using Microsoft.AspNet.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
namespace IntranetGJAK.Controllers
{
[Route("api/[controller]")]
public class FileController : Controller
{
[FromServices]
public IFileRepository Files { get; set; }
// GET: api/values
[HttpGet]
public IEnumerable<File> Get()
{
return Files.GetAll();
}
// GET api/values/5
[HttpGet("{id}", Name = "GetTodo")]
public IActionResult GetById(string id)
{
var item = Files.Find(id);
if (item == null)
{
return HttpNotFound();
}
return new ObjectResult(item);
}
// POST api/values
[HttpPost]
public void Post()
{
}
// PUT api/values/5
[HttpPut("{id}")]
public void Put(int id)
{
}
// DELETE api/values/5
[HttpDelete("{id}")]
public void Delete(int id)
{
}
}
} | using IntranetGJAK.Models;
using Microsoft.AspNet.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
namespace IntranetGJAK.Controllers
{
[Route("api/[controller]")]
public class FileController : Controller
{
[FromServices]
public IFileRepository Files { get; set; }
// GET: api/values
[HttpGet]
public IEnumerable<File> Get()
{
return Files.GetAll();
}
// GET api/values/5
[HttpGet("{id}", Name = "GetTodo")]
public IActionResult GetById(string id)
{
var item = Files.Find(id);
if (item == null)
{
return HttpNotFound();
}
return new ObjectResult(item);
}
// POST api/values
[HttpPost]
public void Post([FromBody]string value)
{
}
// PUT api/values/5
[HttpPut("{id}")]
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/values/5
[HttpDelete("{id}")]
public void Delete(int id)
{
}
}
} | agpl-3.0 | C# |
a7d2a915165485a4b528ac16ddf53b2c6360676d | Remove test code | mattherman/MbDotNet,SuperDrew/MbDotNet,mattherman/MbDotNet | MbDotNet/Exceptions/MountebankException.cs | MbDotNet/Exceptions/MountebankException.cs | using System;
namespace MbDotNet.Exceptions
{
[Serializable]
public class MountebankException : Exception
{
public MountebankException(string message) : base(message) { }
}
}
| using System;
namespace MbDotNet.Exceptions
{
[Serializable]
public class MountebankException : Exception
{
public MountebankException(string message) : base(message) { }
public void Test()
{
var obj = new { Key = "x", Value = "y" };
}
}
}
| mit | C# |
15dd132c92e13ee2fb41f723a270d65a441d8d89 | Use SetUpSteps attribute | ZLima12/osu,2yangk23/osu,ppy/osu,DrabWeb/osu,smoogipoo/osu,2yangk23/osu,johnneijzen/osu,smoogipooo/osu,peppy/osu-new,smoogipoo/osu,smoogipoo/osu,UselessToucan/osu,EVAST9919/osu,johnneijzen/osu,NeoAdonis/osu,ZLima12/osu,peppy/osu,DrabWeb/osu,UselessToucan/osu,NeoAdonis/osu,UselessToucan/osu,EVAST9919/osu,ppy/osu,DrabWeb/osu,NeoAdonis/osu,peppy/osu,ppy/osu,peppy/osu | osu.Game/Tests/Visual/PlayerTestCase.cs | osu.Game/Tests/Visual/PlayerTestCase.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.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Play;
using osu.Game.Tests.Beatmaps;
using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
public abstract class PlayerTestCase : RateAdjustedBeatmapTestCase
{
private readonly Ruleset ruleset;
protected Player Player;
protected PlayerTestCase(Ruleset ruleset)
{
this.ruleset = ruleset;
Add(new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Depth = int.MaxValue
});
}
[SetUpSteps]
public void SetUpSteps()
{
AddStep(ruleset.RulesetInfo.Name, loadPlayer);
AddUntilStep(() => Player.IsLoaded, "player loaded");
}
protected virtual IBeatmap CreateBeatmap(Ruleset ruleset) => new TestBeatmap(ruleset.RulesetInfo);
protected virtual bool AllowFail => false;
private void loadPlayer()
{
var beatmap = CreateBeatmap(ruleset);
Beatmap.Value = new TestWorkingBeatmap(beatmap, Clock);
if (!AllowFail)
Beatmap.Value.Mods.Value = new[] { ruleset.GetAllMods().First(m => m is ModNoFail) };
LoadComponentAsync(Player = CreatePlayer(ruleset), p =>
{
Player = p;
LoadScreen(p);
});
}
protected virtual Player CreatePlayer(Ruleset ruleset) => new Player
{
AllowPause = false,
AllowLeadIn = false,
AllowResults = false,
};
}
}
| // 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.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Play;
using osu.Game.Tests.Beatmaps;
using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
public abstract class PlayerTestCase : RateAdjustedBeatmapTestCase
{
private readonly Ruleset ruleset;
protected Player Player;
protected PlayerTestCase(Ruleset ruleset)
{
this.ruleset = ruleset;
Add(new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Depth = int.MaxValue
});
AddStep(ruleset.RulesetInfo.Name, loadPlayer);
AddUntilStep(() => Player.IsLoaded, "player loaded");
}
protected virtual IBeatmap CreateBeatmap(Ruleset ruleset) => new TestBeatmap(ruleset.RulesetInfo);
protected virtual bool AllowFail => false;
private void loadPlayer()
{
var beatmap = CreateBeatmap(ruleset);
Beatmap.Value = new TestWorkingBeatmap(beatmap, Clock);
if (!AllowFail)
Beatmap.Value.Mods.Value = new[] { ruleset.GetAllMods().First(m => m is ModNoFail) };
LoadComponentAsync(Player = CreatePlayer(ruleset), p =>
{
Player = p;
LoadScreen(p);
});
}
protected virtual Player CreatePlayer(Ruleset ruleset) => new Player
{
AllowPause = false,
AllowLeadIn = false,
AllowResults = false,
};
}
}
| mit | C# |
5495a0a70fd1c2320c801a0e9ba6c72e6f64f7a0 | Add content to ScreenTestCase as protection against overwriting | NeoAdonis/osu,smoogipoo/osu,smoogipoo/osu,smoogipooo/osu,UselessToucan/osu,peppy/osu,NeoAdonis/osu,DrabWeb/osu,ZLima12/osu,peppy/osu,EVAST9919/osu,peppy/osu-new,ppy/osu,johnneijzen/osu,smoogipoo/osu,NeoAdonis/osu,2yangk23/osu,johnneijzen/osu,DrabWeb/osu,UselessToucan/osu,EVAST9919/osu,ZLima12/osu,DrabWeb/osu,2yangk23/osu,UselessToucan/osu,ppy/osu,peppy/osu,ppy/osu | osu.Game/Tests/Visual/ScreenTestCase.cs | osu.Game/Tests/Visual/ScreenTestCase.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.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Screens;
namespace osu.Game.Tests.Visual
{
/// <summary>
/// A test case which can be used to test a screen (that relies on OnEntering being called to execute startup instructions).
/// </summary>
public abstract class ScreenTestCase : ManualInputManagerTestCase
{
private readonly OsuScreenStack stack;
private readonly Container content;
protected override Container<Drawable> Content => content;
protected ScreenTestCase()
{
base.Content.AddRange(new Drawable[]
{
stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both },
content = new Container { RelativeSizeAxes = Axes.Both }
});
}
protected void LoadScreen(OsuScreen screen)
{
if (stack.CurrentScreen != null)
stack.Exit();
stack.Push(screen);
}
}
}
| // 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;
using osu.Game.Screens;
namespace osu.Game.Tests.Visual
{
/// <summary>
/// A test case which can be used to test a screen (that relies on OnEntering being called to execute startup instructions).
/// </summary>
public abstract class ScreenTestCase : ManualInputManagerTestCase
{
private OsuScreenStack stack;
[BackgroundDependencyLoader]
private void load()
{
Add(stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both });
}
protected void LoadScreen(OsuScreen screen)
{
if (stack.CurrentScreen != null)
stack.Exit();
stack.Push(screen);
}
}
}
| mit | C# |
d3381f38bb4004ca1df6bde031fb23d0d25fcc08 | Clarify test case to ensure | operator works like I think it does | mattgwagner/CertiPay.Payroll.Common | CertiPay.Payroll.Common.Tests/SpecialTaxStatusTests.cs | CertiPay.Payroll.Common.Tests/SpecialTaxStatusTests.cs | using NUnit.Framework;
namespace CertiPay.Payroll.Common.Tests
{
public class SpecialTaxStatusTests
{
[Test]
[TestCase(SpecialTaxStatus.ExemptFromLocalTax | SpecialTaxStatus.ExemptFromFederalTax, SpecialTaxStatus.ExemptFromLocalTax)]
[TestCase(SpecialTaxStatus.None, SpecialTaxStatus.None)]
[TestCase(SpecialTaxStatus.ExemptFromMedicare | SpecialTaxStatus.ExemptFromSocialSecurity, SpecialTaxStatus.ExemptFromSocialSecurity)]
[TestCase(SpecialTaxStatus.ExemptFromLocalTax | SpecialTaxStatus.ExemptFromStateTax, SpecialTaxStatus.ExemptFromStateTax)]
[TestCase(SpecialTaxStatus.ExemptFromFICA, SpecialTaxStatus.ExemptFromMedicare)]
[TestCase(SpecialTaxStatus.ExemptFromFICA, SpecialTaxStatus.ExemptFromSocialSecurity)]
[TestCase(SpecialTaxStatus.ExemptFromFICA, SpecialTaxStatus.ExemptFromMedicare & SpecialTaxStatus.ExemptFromSocialSecurity)]
[TestCase(SpecialTaxStatus.ExemptFromFICA, SpecialTaxStatus.ExemptFromMedicare | SpecialTaxStatus.ExemptFromSocialSecurity)]
[TestCase(SpecialTaxStatus.ExemptFromFICA | SpecialTaxStatus.ExemptFromMedicare, SpecialTaxStatus.ExemptFromSocialSecurity)]
[TestCase(SpecialTaxStatus.ExemptFromSocialSecurity | SpecialTaxStatus.ExemptFromMedicare | SpecialTaxStatus.ExemptFromFederalTax | SpecialTaxStatus.ExemptFromStateTax, SpecialTaxStatus.ExemptFromFICA)]
public void Should_Have_Flags(SpecialTaxStatus flags, SpecialTaxStatus should_have)
{
Assert.IsTrue(flags.HasFlag(should_have));
}
[Test]
[TestCase(SpecialTaxStatus.ExemptFromSocialSecurity | SpecialTaxStatus.ExemptFromFederalTax, SpecialTaxStatus.ExemptFromStateTax)]
[TestCase(SpecialTaxStatus.ExemptFromFederalTax, SpecialTaxStatus.ExemptFromStateTax)]
[TestCase(SpecialTaxStatus.ExemptFromSocialSecurity, SpecialTaxStatus.ExemptFromStateTax)]
[TestCase(SpecialTaxStatus.None, SpecialTaxStatus.ExemptFromStateTax)]
[TestCase(SpecialTaxStatus.ExemptFromMedicare, SpecialTaxStatus.ExemptFromFICA)]
[TestCase(SpecialTaxStatus.ExemptFromSocialSecurity, SpecialTaxStatus.ExemptFromFICA)]
public void Should_Not_Have_Flags(SpecialTaxStatus flags, SpecialTaxStatus should_not_have)
{
Assert.IsFalse(flags.HasFlag(should_not_have));
}
}
} | using NUnit.Framework;
namespace CertiPay.Payroll.Common.Tests
{
public class SpecialTaxStatusTests
{
[Test]
[TestCase(SpecialTaxStatus.ExemptFromLocalTax | SpecialTaxStatus.ExemptFromFederalTax, SpecialTaxStatus.ExemptFromLocalTax)]
[TestCase(SpecialTaxStatus.None, SpecialTaxStatus.None)]
[TestCase(SpecialTaxStatus.ExemptFromMedicare | SpecialTaxStatus.ExemptFromSocialSecurity, SpecialTaxStatus.ExemptFromSocialSecurity)]
[TestCase(SpecialTaxStatus.ExemptFromLocalTax | SpecialTaxStatus.ExemptFromStateTax, SpecialTaxStatus.ExemptFromStateTax)]
[TestCase(SpecialTaxStatus.ExemptFromFICA, SpecialTaxStatus.ExemptFromMedicare)]
[TestCase(SpecialTaxStatus.ExemptFromFICA, SpecialTaxStatus.ExemptFromSocialSecurity)]
[TestCase(SpecialTaxStatus.ExemptFromFICA, SpecialTaxStatus.ExemptFromMedicare & SpecialTaxStatus.ExemptFromSocialSecurity)]
[TestCase(SpecialTaxStatus.ExemptFromFICA, SpecialTaxStatus.ExemptFromMedicare | SpecialTaxStatus.ExemptFromSocialSecurity)]
[TestCase(SpecialTaxStatus.ExemptFromFICA | SpecialTaxStatus.ExemptFromMedicare, SpecialTaxStatus.ExemptFromSocialSecurity)]
public void Should_Have_Flags(SpecialTaxStatus flags, SpecialTaxStatus should_have)
{
Assert.IsTrue(flags.HasFlag(should_have));
}
[Test]
[TestCase(SpecialTaxStatus.ExemptFromSocialSecurity | SpecialTaxStatus.ExemptFromFederalTax, SpecialTaxStatus.ExemptFromStateTax)]
[TestCase(SpecialTaxStatus.ExemptFromFederalTax, SpecialTaxStatus.ExemptFromStateTax)]
[TestCase(SpecialTaxStatus.ExemptFromSocialSecurity, SpecialTaxStatus.ExemptFromStateTax)]
[TestCase(SpecialTaxStatus.None, SpecialTaxStatus.ExemptFromStateTax)]
[TestCase(SpecialTaxStatus.ExemptFromMedicare, SpecialTaxStatus.ExemptFromFICA)]
[TestCase(SpecialTaxStatus.ExemptFromSocialSecurity, SpecialTaxStatus.ExemptFromFICA)]
public void Should_Not_Have_Flags(SpecialTaxStatus flags, SpecialTaxStatus should_not_have)
{
Assert.IsFalse(flags.HasFlag(should_not_have));
}
}
} | mit | C# |
b6d25ed5d740381f4fc2870d13eabcd12096c7fe | Fix number of messages retrieved. Used to be n-1 | chinaboard/EasyNetQ,Ascendon/EasyNetQ,fpommerening/EasyNetQ,lukasz-lysik/EasyNetQ,ar7z1/EasyNetQ,sanjaysingh/EasyNetQ,nicklv/EasyNetQ,EasyNetQ/EasyNetQ,mleenhardt/EasyNetQ,scratch-net/EasyNetQ,zidad/EasyNetQ,Ascendon/EasyNetQ,fpommerening/EasyNetQ,Pliner/EasyNetQ,EIrwin/EasyNetQ,micdenny/EasyNetQ,tkirill/EasyNetQ,reisenberger/EasyNetQ,scratch-net/EasyNetQ,reisenberger/EasyNetQ,maverix/EasyNetQ,ar7z1/EasyNetQ,alexwiese/EasyNetQ,alexwiese/EasyNetQ,lukasz-lysik/EasyNetQ,chinaboard/EasyNetQ,danbarua/EasyNetQ,EIrwin/EasyNetQ,sanjaysingh/EasyNetQ,maverix/EasyNetQ,blackcow02/EasyNetQ,Pliner/EasyNetQ,alexwiese/EasyNetQ,mleenhardt/EasyNetQ,danbarua/EasyNetQ,GeckoInformasjonssystemerAS/EasyNetQ,nicklv/EasyNetQ,zidad/EasyNetQ,blackcow02/EasyNetQ,tkirill/EasyNetQ,GeckoInformasjonssystemerAS/EasyNetQ | Source/EasyNetQ.Hosepipe/QueueRetrieval.cs | Source/EasyNetQ.Hosepipe/QueueRetrieval.cs | using System;
using System.Collections.Generic;
using System.Text;
using RabbitMQ.Client.Exceptions;
namespace EasyNetQ.Hosepipe
{
public interface IQueueRetreival {
IEnumerable<HosepipeMessage> GetMessagesFromQueue(QueueParameters parameters);
}
public class QueueRetreival : IQueueRetreival
{
public IEnumerable<HosepipeMessage> GetMessagesFromQueue(QueueParameters parameters)
{
using (var connection = HosepipeConnection.FromParamters(parameters))
using (var channel = connection.CreateModel())
{
try
{
channel.QueueDeclarePassive(parameters.QueueName);
}
catch (OperationInterruptedException exception)
{
Console.WriteLine(exception.Message);
yield break;
}
var count = 0;
while (count++ < parameters.NumberOfMessagesToRetrieve)
{
var basicGetResult = channel.BasicGet(parameters.QueueName, noAck: parameters.Purge);
if (basicGetResult == null) break; // no more messages on the queue
var properties = new MessageProperties(basicGetResult.BasicProperties);
var info = new MessageReceivedInfo(
"hosepipe",
basicGetResult.DeliveryTag,
basicGetResult.Redelivered,
basicGetResult.Exchange,
basicGetResult.RoutingKey,
parameters.QueueName);
yield return new HosepipeMessage(Encoding.UTF8.GetString(basicGetResult.Body), properties, info);
}
}
}
}
} | using System;
using System.Collections.Generic;
using System.Text;
using RabbitMQ.Client.Exceptions;
namespace EasyNetQ.Hosepipe
{
public interface IQueueRetreival {
IEnumerable<HosepipeMessage> GetMessagesFromQueue(QueueParameters parameters);
}
public class QueueRetreival : IQueueRetreival
{
public IEnumerable<HosepipeMessage> GetMessagesFromQueue(QueueParameters parameters)
{
using (var connection = HosepipeConnection.FromParamters(parameters))
using (var channel = connection.CreateModel())
{
try
{
channel.QueueDeclarePassive(parameters.QueueName);
}
catch (OperationInterruptedException exception)
{
Console.WriteLine(exception.Message);
yield break;
}
var count = 0;
while (++count < parameters.NumberOfMessagesToRetrieve)
{
var basicGetResult = channel.BasicGet(parameters.QueueName, noAck: parameters.Purge);
if (basicGetResult == null) break; // no more messages on the queue
var properties = new MessageProperties(basicGetResult.BasicProperties);
var info = new MessageReceivedInfo(
"hosepipe",
basicGetResult.DeliveryTag,
basicGetResult.Redelivered,
basicGetResult.Exchange,
basicGetResult.RoutingKey,
parameters.QueueName);
yield return new HosepipeMessage(Encoding.UTF8.GetString(basicGetResult.Body), properties, info);
}
}
}
}
} | mit | C# |
26c89bd3bcef26edda2677f790680736ded7a694 | Fix flag msg | DaggerES/LunaMultiPlayer,gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer | Common/Message/Data/Flag/FlagListResponseMsgData.cs | Common/Message/Data/Flag/FlagListResponseMsgData.cs | using Lidgren.Network;
using LunaCommon.Message.Types;
namespace LunaCommon.Message.Data.Flag
{
public class FlagListResponseMsgData : FlagBaseMsgData
{
/// <inheritdoc />
internal FlagListResponseMsgData() { }
public override FlagMessageType FlagMessageType => FlagMessageType.ListResponse;
public int FlagCount;
public FlagInfo[] FlagFiles = new FlagInfo[0];
public override string ClassName { get; } = nameof(FlagListResponseMsgData);
internal override void InternalSerialize(NetOutgoingMessage lidgrenMsg)
{
base.InternalSerialize(lidgrenMsg);
lidgrenMsg.Write(FlagCount);
for (var i = 0; i < FlagCount; i++)
{
FlagFiles[i].Serialize(lidgrenMsg);
}
}
internal override void InternalDeserialize(NetIncomingMessage lidgrenMsg)
{
base.InternalDeserialize(lidgrenMsg);
FlagCount = lidgrenMsg.ReadInt32();
if (FlagFiles.Length < FlagCount)
FlagFiles = new FlagInfo[FlagCount];
for (var i = 0; i < FlagCount; i++)
{
if(FlagFiles[i] == null)
FlagFiles[i] = new FlagInfo();
FlagFiles[i].Deserialize(lidgrenMsg);
}
}
internal override int InternalGetMessageSize()
{
var arraySize = 0;
for (var i = 0; i < FlagCount; i++)
{
arraySize += FlagFiles[i].GetByteCount();
}
return base.InternalGetMessageSize() + sizeof(int) + arraySize;
}
}
} | using Lidgren.Network;
using LunaCommon.Message.Types;
namespace LunaCommon.Message.Data.Flag
{
public class FlagListResponseMsgData : FlagBaseMsgData
{
/// <inheritdoc />
internal FlagListResponseMsgData() { }
public override FlagMessageType FlagMessageType => FlagMessageType.ListResponse;
public int FlagCount;
public FlagInfo[] FlagFiles = new FlagInfo[0];
public override string ClassName { get; } = nameof(FlagListResponseMsgData);
internal override void InternalSerialize(NetOutgoingMessage lidgrenMsg)
{
base.InternalSerialize(lidgrenMsg);
lidgrenMsg.Write(FlagCount);
for (var i = 0; i < FlagCount; i++)
{
FlagFiles[i].Serialize(lidgrenMsg);
}
}
internal override void InternalDeserialize(NetIncomingMessage lidgrenMsg)
{
base.InternalDeserialize(lidgrenMsg);
FlagCount = lidgrenMsg.ReadInt32();
for (var i = 0; i < FlagCount; i++)
{
if(FlagFiles[i] == null)
FlagFiles[i] = new FlagInfo();
FlagFiles[i].Deserialize(lidgrenMsg);
}
}
internal override int InternalGetMessageSize()
{
var arraySize = 0;
for (var i = 0; i < FlagCount; i++)
{
arraySize += FlagFiles[i].GetByteCount();
}
return base.InternalGetMessageSize() + sizeof(int) + arraySize;
}
}
} | mit | C# |
a94a86178bcbbde7a7b1a96cf871be29c3e96b40 | Align osu!catch playfield with stable 1:1 | UselessToucan/osu,UselessToucan/osu,smoogipoo/osu,smoogipoo/osu,peppy/osu-new,peppy/osu,NeoAdonis/osu,NeoAdonis/osu,ppy/osu,ppy/osu,peppy/osu,ppy/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu,NeoAdonis/osu,smoogipooo/osu | osu.Game.Rulesets.Catch/UI/CatchPlayfieldAdjustmentContainer.cs | osu.Game.Rulesets.Catch/UI/CatchPlayfieldAdjustmentContainer.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.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.UI;
using osuTK;
namespace osu.Game.Rulesets.Catch.UI
{
public class CatchPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
{
private const float playfield_size_adjust = 0.8f;
protected override Container<Drawable> Content => content;
private readonly Container content;
public CatchPlayfieldAdjustmentContainer()
{
// because we are using centre anchor/origin, we will need to limit visibility in the future
// to ensure tall windows do not get a readability advantage.
// it may be possible to bake the catch-specific offsets (-100..340 mentioned below) into new values
// which are compatible with TopCentre alignment.
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Size = new Vector2(playfield_size_adjust);
InternalChild = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit,
FillAspectRatio = 4f / 3,
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both, }
};
}
/// <summary>
/// A <see cref="Container"/> which scales its content relative to a target width.
/// </summary>
private class ScalingContainer : Container
{
protected override void Update()
{
base.Update();
// in stable, fruit fall vertically from -100 to 340.
// to emulate this, we want to make our playfield 440 gameplay pixels high.
// we then offset it -100 vertically in the position set below.
const float stable_v_offset_ratio = 440 / 384f;
Scale = new Vector2(Parent.ChildSize.X / CatchPlayfield.WIDTH);
Position = new Vector2(0, -100 * stable_v_offset_ratio + Scale.X);
Size = Vector2.Divide(new Vector2(1, stable_v_offset_ratio), Scale);
}
}
}
}
| // 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;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.UI;
using osuTK;
namespace osu.Game.Rulesets.Catch.UI
{
public class CatchPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
{
private const float playfield_size_adjust = 0.8f;
protected override Container<Drawable> Content => content;
private readonly Container content;
public CatchPlayfieldAdjustmentContainer()
{
Anchor = Anchor.TopCentre;
Origin = Anchor.TopCentre;
Size = new Vector2(playfield_size_adjust);
InternalChild = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit,
FillAspectRatio = 4f / 3,
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both }
};
}
/// <summary>
/// A <see cref="Container"/> which scales its content relative to a target width.
/// </summary>
private class ScalingContainer : Container
{
protected override void Update()
{
base.Update();
Scale = new Vector2(Parent.ChildSize.X / CatchPlayfield.WIDTH);
Size = Vector2.Divide(Vector2.One, Scale);
}
}
}
}
| mit | C# |
b37ec3b67d0810e0c1658357d007891e7545abaa | Remove #ifdefs for now | ZLima12/osu-framework,ppy/osu-framework,ZLima12/osu-framework,DrabWeb/osu-framework,peppy/osu-framework,peppy/osu-framework,DrabWeb/osu-framework,smoogipooo/osu-framework,DrabWeb/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework | osu.Framework/Platform/Linux/Sdl/SdlClipboard.cs | osu.Framework/Platform/Linux/Sdl/SdlClipboard.cs | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System.Runtime.InteropServices;
namespace osu.Framework.Platform.Linux.Sdl
{
public class SdlClipboard : Clipboard
{
private const string lib = "libSDL2-2.0.so.0";
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipboardText", ExactSpelling = true)]
internal static extern string SDL_GetClipboardText();
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetClipboardText", ExactSpelling = true)]
internal static extern int SDL_SetClipboardText(string text);
public override string GetText()
{
return SDL_GetClipboardText();
}
public override void SetText(string selectedText)
{
SDL_SetClipboardText(selectedText);
}
}
}
| // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System.Runtime.InteropServices;
namespace osu.Framework.Platform.Linux.Sdl
{
public class SdlClipboard : Clipboard
{
#if ANDROID
const string lib = "libSDL2.so";
#elif IPHONE
const string lib = "__Internal";
#else
private const string lib = "libSDL2-2.0.so.0";
#endif
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipboardText", ExactSpelling = true)]
internal static extern string SDL_GetClipboardText();
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetClipboardText", ExactSpelling = true)]
internal static extern int SDL_SetClipboardText(string text);
public override string GetText()
{
return SDL_GetClipboardText();
}
public override void SetText(string selectedText)
{
SDL_SetClipboardText(selectedText);
}
}
}
| mit | C# |
aeab2be5d1968c7a1a6a712afc2897033891bb6e | Add xmldoc to SeasonalBackgroundMode | UselessToucan/osu,peppy/osu,UselessToucan/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu,peppy/osu,smoogipoo/osu,peppy/osu-new,NeoAdonis/osu,smoogipooo/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,ppy/osu | osu.Game/Configuration/SeasonalBackgroundMode.cs | osu.Game/Configuration/SeasonalBackgroundMode.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.Configuration
{
public enum SeasonalBackgroundMode
{
/// <summary>
/// Seasonal backgrounds are shown regardless of season, if at all available.
/// </summary>
Always,
/// <summary>
/// Seasonal backgrounds are shown only during their corresponding season.
/// </summary>
Sometimes,
/// <summary>
/// Seasonal backgrounds are never shown.
/// </summary>
Never
}
}
| // 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.Configuration
{
public enum SeasonalBackgroundMode
{
Always,
Sometimes,
Never
}
}
| mit | C# |
69f2f171d8afa8f49663ad55e3081645bb2aab1f | Fix for UTC to local time and vice versa conversions fo FieldValueDateTime | llortkisoftware/FogBugzVS,llortkisoftware/FogBugzVS | FogBugzAPI/Model/Cases/Fields/FieldValueDateTime.cs | FogBugzAPI/Model/Cases/Fields/FieldValueDateTime.cs | using System;
namespace FogBugzAPI.Model.Cases.Fields
{
public class FieldValueDateTime : FieldValue
{
//FORMAT: 2007-05-06T22:47:59Z
public FieldValueDateTime()
{
Value = DateTime.Now;
}
public override void FromString(string value)
{
if (string.IsNullOrEmpty(value))
{
Value = DateTime.MinValue;
return;
}
Value = Convert.ToDateTime(value).ToLocalTime();
}
public override string ToStringValue()
{
DateTime dtValue = (DateTime)Value;
return dtValue.ToUniversalTime().ToString("o");
}
}
} | using System;
namespace FogBugzAPI.Model.Cases.Fields
{
public class FieldValueDateTime : FieldValue
{
//FORMAT: 2007-05-06T22:47:59Z
public FieldValueDateTime()
{
Value = DateTime.Now;
}
public override void FromString(string value)
{
if (string.IsNullOrEmpty(value))
{
Value = DateTime.MinValue;
return;
}
Value = Convert.ToDateTime(value);
}
public override string ToStringValue()
{
DateTime dtValue = (DateTime)Value;
return dtValue.ToUniversalTime().ToLongDateString() + dtValue.ToUniversalTime().ToLongTimeString();
}
}
} | apache-2.0 | C# |
348cf1d3192926f32aecb8567e1e390bb36d28d8 | Add test for shooting into space (#5) | ForNeVeR/TankDriver | TankDriver.Tests/Logic/BulletSpaceTests.cs | TankDriver.Tests/Logic/BulletSpaceTests.cs | using TankDriver.Logic;
using Microsoft.Xna.Framework;
using Xunit;
namespace TankDriver.Tests.Logic
{
public class BulletSpaceTests
{
private readonly Rectangle BulletSpaceBounds = new Rectangle(0, 0, 100, 100);
[Fact]
public void BulletOutOfBound()
{
BulletSpace bulletSpace = new BulletSpace(BulletSpaceBounds);
bulletSpace.AddBullet(50.0, 50.0, 0.0);
bulletSpace.AddBullet(200.0, 200.0, 0.0);
Assert.Equal(2, bulletSpace.Bullets.Count);
bulletSpace.Update(System.TimeSpan.FromMilliseconds(10.0));
Assert.Equal(1, bulletSpace.Bullets.Count);
}
[Fact]
public void ShootBulletIntoSpace()
{
BulletSpace bulletSpace = new BulletSpace(BulletSpaceBounds);
Tank tank = new Tank(20.0, 20.0, 0.0);
tank.ShootInto(bulletSpace);
Assert.Equal(1, bulletSpace.Bullets.Count);
Assert.Equal(tank.TurretHeading, bulletSpace.Bullets[0].Heading, Configuration.GeometryPrecision);
}
}
}
| using TankDriver.Logic;
using Microsoft.Xna.Framework;
using Xunit;
namespace TankDriver.Tests.Logic
{
public class BulletSpaceTests
{
[Fact]
public void BulletOutOfBound()
{
BulletSpace bulletSpace = new BulletSpace(new Rectangle(0, 0, 100, 100));
bulletSpace.AddBullet(50.0, 50.0, 0.0);
bulletSpace.AddBullet(200.0, 200.0, 0.0);
Assert.Equal(2, bulletSpace.Bullets.Count);
bulletSpace.Update(System.TimeSpan.FromMilliseconds(10.0));
Assert.Equal(1, bulletSpace.Bullets.Count);
}
}
}
| mit | C# |
182cf2f51700643d9d9e7547d3bd079b7b5b6eb5 | Change the default value of the parameter initialization method. | luchaoshuai/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,carldai0106/aspnetboilerplate,verdentk/aspnetboilerplate,ryancyq/aspnetboilerplate,ryancyq/aspnetboilerplate,ryancyq/aspnetboilerplate,ilyhacker/aspnetboilerplate,carldai0106/aspnetboilerplate,verdentk/aspnetboilerplate,ilyhacker/aspnetboilerplate,carldai0106/aspnetboilerplate,carldai0106/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,ilyhacker/aspnetboilerplate,ryancyq/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,luchaoshuai/aspnetboilerplate,verdentk/aspnetboilerplate | src/Abp.EntityFrameworkCore/EntityFrameworkCore/ValueConverters/AbpDateTimeValueConverter.cs | src/Abp.EntityFrameworkCore/EntityFrameworkCore/ValueConverters/AbpDateTimeValueConverter.cs | using System;
using System.Linq.Expressions;
using Abp.Timing;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Abp.EntityFrameworkCore.ValueConverters
{
public class AbpDateTimeValueConverter : ValueConverter<DateTime?, DateTime?>
{
public AbpDateTimeValueConverter([CanBeNull] ConverterMappingHints mappingHints = null)
: base(Normalize, Normalize, mappingHints)
{
}
private static readonly Expression<Func<DateTime?, DateTime?>> Normalize = x =>
x.HasValue ? Clock.Normalize(x.Value) : x;
}
} | using System;
using System.Linq.Expressions;
using Abp.Timing;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Abp.EntityFrameworkCore.ValueConverters
{
public class AbpDateTimeValueConverter : ValueConverter<DateTime?, DateTime?>
{
public AbpDateTimeValueConverter([CanBeNull] ConverterMappingHints mappingHints = default)
: base(Normalize, Normalize, mappingHints)
{
}
private static readonly Expression<Func<DateTime?, DateTime?>> Normalize = x =>
x.HasValue ? Clock.Normalize(x.Value) : x;
}
} | mit | C# |
2a05c4cf911df47fa7242fcaba587ee64dc969f8 | Change table name for Items. | wangjun/windows-app,wangjun/windows-app | wallabag/wallabag.Shared/Models/Item.cs | wallabag/wallabag.Shared/Models/Item.cs | using System;
using SQLite;
namespace wallabag.Models
{
[Table("Items")]
public class Item
{
public string Title { get; set; }
public string Content { get; set; }
public Uri Url { get; set; }
public bool IsRead { get; set; }
public bool IsFavourite { get; set; }
}
}
| using System;
namespace wallabag.Models
{
public class Item
{
public string Title { get; set; }
public string Content { get; set; }
public Uri Url { get; set; }
public bool IsRead { get; set; }
public bool IsFavourite { get; set; }
}
}
| mit | C# |
f72a968ae1808814f49cb3a9cf2c6426be7e7848 | Change the assembly version to "base" | joelverhagen/StandardSerializer | Knapcode.StandardSerializer/Properties/AssemblyInfo.cs | Knapcode.StandardSerializer/Properties/AssemblyInfo.cs | //------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: System.Reflection.AssemblyTitle("Knapcode.StandardSerializer")]
[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: System.CLSCompliant(true)]
[assembly: System.Runtime.InteropServices.Guid("963e0295-1d98-4f44-aadc-8cb4ba91c613")]
[assembly: System.Reflection.AssemblyInformationalVersion("1.0.0.0-base")]
[assembly: System.Reflection.AssemblyVersion("1.0.0.0")]
[assembly: System.Reflection.AssemblyFileVersion("1.0.0.0")]
| //------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: System.Reflection.AssemblyTitle("Knapcode.StandardSerializer")]
[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: System.CLSCompliant(true)]
[assembly: System.Runtime.InteropServices.Guid("963e0295-1d98-4f44-aadc-8cb4ba91c613")]
[assembly: System.Reflection.AssemblyInformationalVersion("1.0.0.0-9c82a0d-dirty")]
[assembly: System.Reflection.AssemblyVersion("1.0.0.0")]
[assembly: System.Reflection.AssemblyFileVersion("1.0.0.0")]
| unlicense | C# |
ee3d56beaa1ca7f8db909f274ceb750dc3f9ea25 | Update AuthorizationAutoConfigBehavior - Remove reference to Services.Moderation | mariocatch/MODiX,mariocatch/MODiX,mariocatch/MODiX,mariocatch/MODiX | Modix.Services/Core/AuthorizationAutoConfigBehavior.cs | Modix.Services/Core/AuthorizationAutoConfigBehavior.cs | using System;
using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
namespace Modix.Services.Core
{
/// <summary>
/// Implements a behavior that automatically performs configuration necessary for an <see cref="IAuthorizationService"/> to work.
/// </summary>
public class AuthorizationAutoConfigBehavior : BehaviorBase
{
// TODO: Abstract DiscordSocketClient to IDiscordSocketClient, or something, to make this testable
/// <summary>
/// Constructs a new <see cref="AuthorizationAutoConfigBehavior"/> object, with the given injected dependencies.
/// See <see cref="BehaviorBase"/> for more details.
/// </summary>
/// <param name="discordClient">The value to use for <see cref="DiscordClient"/>.</param>
/// <param name="serviceProvider">See <see cref="BehaviorBase"/>.</param>
public AuthorizationAutoConfigBehavior(DiscordSocketClient discordClient, IServiceProvider serviceProvider)
: base(serviceProvider)
{
DiscordClient = discordClient;
}
/// <inheritdoc />
internal protected override Task OnStartingAsync()
{
DiscordClient.GuildAvailable += OnGuildAvailable;
DiscordClient.LeftGuild += OnLeftGuild;
return Task.CompletedTask;
}
/// <inheritdoc />
internal protected override Task OnStoppedAsync()
{
DiscordClient.GuildAvailable -= OnGuildAvailable;
DiscordClient.LeftGuild -= OnLeftGuild;
return Task.CompletedTask;
}
/// <inheritdoc />
internal protected override void Dispose(bool disposeManaged)
{
if (disposeManaged && IsRunning)
OnStoppedAsync();
base.Dispose(disposeManaged);
}
// TODO: Abstract DiscordSocketClient to IDiscordSocketClient, or something, to make this testable
/// <summary>
/// A <see cref="DiscordSocketClient"/> for interacting with, and receiving events from, the Discord API.
/// </summary>
internal protected DiscordSocketClient DiscordClient { get; }
private Task OnGuildAvailable(IGuild guild)
=> SelfExecuteRequest<IAuthorizationService>(x => x.AutoConfigureGuildAsync(guild));
private Task OnLeftGuild(IGuild guild)
=> SelfExecuteRequest<IAuthorizationService>(x => x.UnConfigureGuildAsync(guild));
}
}
| using System;
using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
using Modix.Services.Moderation;
namespace Modix.Services.Core
{
/// <summary>
/// Implements a behavior that automatically performs configuration necessary for an <see cref="IAuthorizationService"/> to work.
/// </summary>
public class AuthorizationAutoConfigBehavior : BehaviorBase
{
// TODO: Abstract DiscordSocketClient to IDiscordSocketClient, or something, to make this testable
/// <summary>
/// Constructs a new <see cref="ModerationAutoConfigBehavior"/> object, with the given injected dependencies.
/// See <see cref="BehaviorBase"/> for more details.
/// </summary>
/// <param name="discordClient">The value to use for <see cref="DiscordClient"/>.</param>
/// <param name="serviceProvider">See <see cref="BehaviorBase"/>.</param>
public AuthorizationAutoConfigBehavior(DiscordSocketClient discordClient, IServiceProvider serviceProvider)
: base(serviceProvider)
{
DiscordClient = discordClient;
}
/// <inheritdoc />
internal protected override Task OnStartingAsync()
{
DiscordClient.GuildAvailable += OnGuildAvailable;
DiscordClient.LeftGuild += OnLeftGuild;
return Task.CompletedTask;
}
/// <inheritdoc />
internal protected override Task OnStoppedAsync()
{
DiscordClient.GuildAvailable -= OnGuildAvailable;
DiscordClient.LeftGuild -= OnLeftGuild;
return Task.CompletedTask;
}
/// <inheritdoc />
internal protected override void Dispose(bool disposeManaged)
{
if (disposeManaged && IsRunning)
OnStoppedAsync();
base.Dispose(disposeManaged);
}
// TODO: Abstract DiscordSocketClient to IDiscordSocketClient, or something, to make this testable
/// <summary>
/// A <see cref="DiscordSocketClient"/> for interacting with, and receiving events from, the Discord API.
/// </summary>
internal protected DiscordSocketClient DiscordClient { get; }
private Task OnGuildAvailable(IGuild guild)
=> SelfExecuteRequest<IAuthorizationService>(x => x.AutoConfigureGuildAsync(guild));
private Task OnLeftGuild(IGuild guild)
=> SelfExecuteRequest<IAuthorizationService>(x => x.UnConfigureGuildAsync(guild));
}
}
| mit | C# |
0d6890243fc7b6308ffdd87e7f87c1551d4ae2fd | Fix typo in xmldoc | smoogipoo/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,ppy/osu,smoogipooo/osu,peppy/osu,ppy/osu,UselessToucan/osu,smoogipoo/osu,UselessToucan/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu,peppy/osu-new | osu.Game/Rulesets/Edit/BeatmapVerifier.cs | osu.Game/Rulesets/Edit/BeatmapVerifier.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.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Edit.Checks;
using osu.Game.Rulesets.Edit.Checks.Components;
namespace osu.Game.Rulesets.Edit
{
/// <summary>
/// A ruleset-agnostic beatmap verifier that identifies issues in common metadata or mapping standards.
/// </summary>
public class BeatmapVerifier : IBeatmapVerifier
{
private readonly List<ICheck> checks = new List<ICheck>
{
new CheckBackground(),
};
public IEnumerable<Issue> Run(IBeatmap beatmap) => checks.SelectMany(check => check.Run(beatmap));
}
}
| // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Edit.Checks;
using osu.Game.Rulesets.Edit.Checks.Components;
namespace osu.Game.Rulesets.Edit
{
/// <summary>
/// A ruleset-agnostic beatmap converter that identifies issues in common metadata or mapping standards.
/// </summary>
public class BeatmapVerifier : IBeatmapVerifier
{
private readonly List<ICheck> checks = new List<ICheck>
{
new CheckBackground(),
};
public IEnumerable<Issue> Run(IBeatmap beatmap) => checks.SelectMany(check => check.Run(beatmap));
}
}
| mit | C# |
7cdc56a78ee8aded1a47432888071c5663a62a1b | Fix LogTime for CloseGroupViewModel. | ZooPin/CK-Glouton,ZooPin/CK-Glouton,ZooPin/CK-Glouton,ZooPin/CK-Glouton | src/CK.Glouton.Model/Logs/CloseGroupViewModel.cs | src/CK.Glouton.Model/Logs/CloseGroupViewModel.cs | using CK.Glouton.Model.Lucene;
using Lucene.Net.Documents;
namespace CK.Glouton.Model.Logs
{
public class CloseGroupViewModel : ILogViewModel
{
public string LogLevel { get; set; }
public string Conclusion { get; set; }
public ELogType LogType => ELogType.CloseGroup;
public IExceptionViewModel Exception { get; set; }
public string LogTime { get; set; }
public static CloseGroupViewModel Get( ILuceneSearcher searcher, Document document )
{
CloseGroupViewModel obj = new CloseGroupViewModel
{
LogLevel = document.Get( LogField.LOG_LEVEL ),
LogTime = DateTools.StringToDate( document.Get( LogField.LOG_TIME ) ).ToString( "dd/MM/yyyy HH:mm:ss.fff" ),
Conclusion = document.Get( LogField.CONCLUSION ),
Exception = ExceptionViewModel.Get( searcher, document )
};
return obj;
}
}
}
| using CK.Glouton.Model.Lucene;
using Lucene.Net.Documents;
namespace CK.Glouton.Model.Logs
{
public class CloseGroupViewModel : ILogViewModel
{
public string LogLevel { get; set; }
public string Conclusion { get; set; }
public ELogType LogType => ELogType.CloseGroup;
public IExceptionViewModel Exception { get; set; }
public string LogTime { get; set; }
public static CloseGroupViewModel Get( ILuceneSearcher searcher, Document doc )
{
CloseGroupViewModel obj = new CloseGroupViewModel
{
LogLevel = doc.Get( LogField.LOG_LEVEL ),
LogTime = doc.Get( LogField.LOG_TIME ),
Conclusion = doc.Get( LogField.CONCLUSION ),
Exception = ExceptionViewModel.Get( searcher, doc )
};
return obj;
}
}
}
| mit | C# |
caa07dbfbe99dda0e801702dd909adebf98fa59d | Define standard layout | 12joan/hangman | hangman.cs | hangman.cs | using System;
using System.IO;
namespace Hangman {
public class Hangman {
public static void Main(string[] args) {
// char key = Console.ReadKey(true).KeyChar;
// var game = new Game("HANG THE MAN");
// bool wasCorrect = game.GuessLetter(key);
// Console.WriteLine(wasCorrect.ToString());
// var output = game.ShownWord();
// Console.WriteLine(output);
string titleText = File.ReadAllText("title.txt");
Cell[] title = {
new Cell(titleText, Cell.CentreAlign)
};
Cell[] word = {
new Cell("_E__O _O___", Cell.CentreAlign)
};
Cell[] stats = {
new Cell("Incorrect letters:\n A B I U"),
new Cell("Lives remaining:\n 11/15", Cell.RightAlign)
};
Cell[] status = {
new Cell("Press any letter to guess!", Cell.CentreAlign)
};
Row[] rows = {
new Row(title),
new Row(word),
new Row(stats),
new Row(status)
};
var table = new Table(
Math.Min(81, Console.WindowWidth),
2,
rows
);
var output = table.Draw();
Console.WriteLine(output);
}
}
}
| using System;
namespace Hangman {
public class Hangman {
public static void Main(string[] args) {
// char key = Console.ReadKey(true).KeyChar;
// var game = new Game("HANG THE MAN");
// bool wasCorrect = game.GuessLetter(key);
// Console.WriteLine(wasCorrect.ToString());
// var output = game.ShownWord();
// Console.WriteLine(output);
Cell[] cells = {
new Cell("This\nis\na"),
new Cell("Row", Cell.RightAlign)
};
Row[] rows = {
new Row(cells),
new Row(cells)
};
var table = new Table(
Math.Min(80, Console.WindowWidth),
2,
rows
);
var output = table.Draw();
Console.WriteLine(output);
}
}
}
| unlicense | C# |
61b80ea7af294c0da7ff16d1d3020c5cd6321378 | add TeamCity server url to logging | stormleoxia/teamcity-nuget-support,stormleoxia/teamcity-nuget-support,JetBrains/teamcity-nuget-support,JetBrains/teamcity-nuget-support,JetBrains/teamcity-nuget-support,stormleoxia/teamcity-nuget-support,JetBrains/teamcity-nuget-support | nuget-extensions/nuget-feed/Repo/RemoteRepo.cs | nuget-extensions/nuget-feed/Repo/RemoteRepo.cs | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Cache;
using System.Text;
using JetBrains.TeamCity.ServiceMessages.Read;
using log4net;
namespace JetBrains.TeamCity.NuGet.Feed.Repo
{
public class RemoteRepo : ITeamCityPackagesRepo
{
private static readonly ILog LOG = LogManagerHelper.GetCurrentClassLogger();
private readonly string myRemoteUrl;
private readonly IServiceMessageParser myParser;
private readonly PackageLoader myLoader;
public RemoteRepo(string remoteUrl, IServiceMessageParser parser, PackageLoader loader)
{
myRemoteUrl = remoteUrl;
myParser = parser;
myLoader = loader;
}
public IEnumerable<TeamCityPackage> GetAllPackages()
{
try
{
var wr = (HttpWebRequest) WebRequest.Create(myRemoteUrl);
wr.CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
using (var webResponse = (HttpWebResponse) wr.GetResponse())
{
var stream = webResponse.GetResponseStream();
if (stream == null)
throw new Exception(string.Format("Failed to read packages from stream. Status code: {0}",
webResponse.StatusCode));
var streamReader = new StreamReader(stream, Encoding.UTF8);
return myParser.ParseServiceMessages(streamReader).Select(myLoader.Load).ToArray();
}
} catch(Exception e)
{
LOG.Warn(string.Format("Failed to fetch all packages from: {0}. {1}", myRemoteUrl, e.Message), e);
return new TeamCityPackage[0];
}
}
public IEnumerable<TeamCityPackage> FilterById(IEnumerable<string> ids)
{
var set = new HashSet<string>(ids);
if (set.Count == 0) return new TeamCityPackage[0];
return GetAllPackages().Where(x=>set.Contains(x.Id));
}
public IEnumerable<TeamCityPackage> FiltetByIdLatest(IEnumerable<string> ids)
{
var set = new HashSet<string>(ids);
if (set.Count == 0) return new TeamCityPackage[0];
return GetAllPackages().Where(x=>x.IsLatestVersion).Where(x => set.Contains(x.Id));
}
}
} | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Cache;
using System.Text;
using JetBrains.TeamCity.ServiceMessages.Read;
using log4net;
namespace JetBrains.TeamCity.NuGet.Feed.Repo
{
public class RemoteRepo : ITeamCityPackagesRepo
{
private static readonly ILog LOG = LogManagerHelper.GetCurrentClassLogger();
private readonly string myRemoteUrl;
private readonly IServiceMessageParser myParser;
private readonly PackageLoader myLoader;
public RemoteRepo(string remoteUrl, IServiceMessageParser parser, PackageLoader loader)
{
myRemoteUrl = remoteUrl;
myParser = parser;
myLoader = loader;
}
public IEnumerable<TeamCityPackage> GetAllPackages()
{
try
{
var wr = (HttpWebRequest) WebRequest.Create(myRemoteUrl);
wr.CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
using (var webResponse = (HttpWebResponse) wr.GetResponse())
{
var stream = webResponse.GetResponseStream();
if (stream == null)
throw new Exception(string.Format("Failed to read packages from stream. Status code: {0}",
webResponse.StatusCode));
var streamReader = new StreamReader(stream, Encoding.UTF8);
return myParser.ParseServiceMessages(streamReader).Select(myLoader.Load).ToArray();
}
} catch(Exception e)
{
LOG.Warn("Failed to fetch all packages: " + e.Message, e);
return new TeamCityPackage[0];
}
}
public IEnumerable<TeamCityPackage> FilterById(IEnumerable<string> ids)
{
var set = new HashSet<string>(ids);
if (set.Count == 0) return new TeamCityPackage[0];
return GetAllPackages().Where(x=>set.Contains(x.Id));
}
public IEnumerable<TeamCityPackage> FiltetByIdLatest(IEnumerable<string> ids)
{
var set = new HashSet<string>(ids);
if (set.Count == 0) return new TeamCityPackage[0];
return GetAllPackages().Where(x=>x.IsLatestVersion).Where(x => set.Contains(x.Id));
}
}
} | apache-2.0 | C# |
354e57418a5cd18e173384eece261b71e8c20b95 | Fix sorting and searching on table | ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab | Anlab.Mvc/Views/Admin/ListClients.cshtml | Anlab.Mvc/Views/Admin/ListClients.cshtml | @model IList<User>
@{
ViewData["Title"] = "List Non Admin Users";
}
<div class="col">
<table id="table">
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Email</th>
<th>Client Id</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
@foreach (var user in Model)
{
<tr>
<td>
<a class="btn btn-default" asp-action="EditUser" asp-route-Id="@user.Id" >Edit</a>
</td>
<td>@user.Name</td>
<td>@user.Email</td>
<td>@user.ClientId</td>
<td>@user.Phone</td>
</tr>
}
</tbody>
</table>
</div>
@section AdditionalStyles
{
@{ await Html.RenderPartialAsync("_DataTableStylePartial"); }
}
@section Scripts
{
@{ await Html.RenderPartialAsync("_DataTableScriptsPartial"); }
<script type="text/javascript">
$(function () {
$("#table").dataTable({
"sorting": [[2, "desc"]],
"pageLength": 100,
"columnDefs": [
{ "orderable": false, "targets": [0] },
{ "searchable":false, "targets": 0 }
]
});
});
</script>
}
| @model IList<User>
@{
ViewData["Title"] = "List Non Admin Users";
}
<div class="col">
<table id="table">
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Email</th>
<th>Client Id</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
@foreach (var user in Model)
{
<tr>
<td>
<a class="btn btn-default" asp-action="EditUser" asp-route-Id="@user.Id" >Edit</a>
</td>
<td>@user.Name</td>
<td>@user.Email</td>
<td>@user.ClientId</td>
<td>@user.Phone</td>
</tr>
}
</tbody>
</table>
</div>
@section AdditionalStyles
{
@{ await Html.RenderPartialAsync("_DataTableStylePartial"); }
}
@section Scripts
{
@{ await Html.RenderPartialAsync("_DataTableScriptsPartial"); }
<script type="text/javascript">
$(function () {
$("#table").dataTable({
"sorting": [[2, "desc"]],
"pageLength": 100,
});
});
</script>
}
| mit | C# |
000a6c6f41d82b4c24688c998dd18cfe77e4dbe2 | Build and publish XSerializer release candidate package | RockFramework/Rock.Encryption | Rock.Encryption.XSerializer/Properties/AssemblyInfo.cs | Rock.Encryption.XSerializer/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Rock.Encryption.XSerializer")]
[assembly: AssemblyDescription("Extension to Rock.Encryption - allows properties marked with the [Encrypt] attribute to be encrypted during an XSerializer serialization operation.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Quicken Loans")]
[assembly: AssemblyProduct("Rock.Encryption.XSerializer")]
[assembly: AssemblyCopyright("Copyright © Quicken Loans 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9e66b304-79a0-4eed-a5f3-adaf0e27844b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.0")]
[assembly: AssemblyInformationalVersion("0.9.0-rc1")]
| using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Rock.Encryption.XSerializer")]
[assembly: AssemblyDescription("Extension to Rock.Encryption - allows properties marked with the [Encrypt] attribute to be encrypted during an XSerializer serialization operation.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Quicken Loans")]
[assembly: AssemblyProduct("Rock.Encryption.XSerializer")]
[assembly: AssemblyCopyright("Copyright © Quicken Loans 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9e66b304-79a0-4eed-a5f3-adaf0e27844b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.0")]
[assembly: AssemblyInformationalVersion("0.9.0-alpha01")]
| mit | C# |
7e826ebd9b914fb8b46bec946c127db4e9b2768f | Set the document language to English | alastairs/cgowebsite,alastairs/cgowebsite | src/CGO.Web/Views/Shared/_Layout.cshtml | src/CGO.Web/Views/Shared/_Layout.cshtml | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/themes/base/css", "~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@RenderSection("scripts", required: false)
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/themes/base/css", "~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@RenderSection("scripts", required: false)
</body>
</html>
| mit | C# |
3e5970a555321433f00808c2a074287ce10f33f8 | Fix the name. | MasterDevs/Clippy | Clippy/Clippy/Properties/AssemblyInfo.cs | Clippy/Clippy/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MasterDevs.Clippy")]
[assembly: AssemblyDescription("Treat the clipboard like a Stream")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("MasterDevs")]
[assembly: AssemblyProduct("MasterDevs.Clippy")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a3e914ee-6255-4b13-87ff-c17f2600d9af")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Clippy")]
[assembly: AssemblyDescription("Treat the clipboard like a Stream")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("MasterDevs")]
[assembly: AssemblyProduct("Clippy")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a3e914ee-6255-4b13-87ff-c17f2600d9af")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| mit | C# |
0266f4d068457f82233084e483881c86ce180cff | Clean up | Weingartner/Migrations.Json.Net | Weingartner.Json.Migration.Common/VersionMemberName.cs | Weingartner.Json.Migration.Common/VersionMemberName.cs | using System;
namespace Weingartner.Json.Migration.Common
{
public interface IVersionMemberName
{
string VersionPropertyName { get; }
string VersionBackingFieldName { get; }
}
public static class VersionMemberName
{
private static IVersionMemberName _instance;
public static IVersionMemberName Instance
{
get { return _instance ?? (_instance = new InvalidCsVersionMemberName()); }
}
public static bool TrySetInstance(IVersionMemberName instance)
{
if (instance == null)
{
throw new ArgumentNullException("instance");
}
if (_instance != null) return false;
_instance = instance;
return true;
}
}
public class InvalidCsVersionMemberName : IVersionMemberName
{
public string VersionPropertyName { get { return "<>Version"; } }
public string VersionBackingFieldName { get { return "<>_version"; } }
}
public class ValidCsVersionMemberName : IVersionMemberName
{
public string VersionPropertyName { get { return "Version"; } }
public string VersionBackingFieldName { get { return "_version"; } }
}
}
| using System;
namespace Weingartner.Json.Migration.Common
{
public interface IVersionMemberName
{
string VersionPropertyName { get; }
string VersionBackingFieldName { get; }
}
public static class VersionMemberName
{
private static IVersionMemberName _instance;
public static IVersionMemberName Instance
{
get { return _instance ?? (_instance = new InvalidCsVersionMemberName()); }
}
public static bool TrySetInstance(IVersionMemberName instance)
{
if (instance == null)
{
throw new ArgumentNullException("instance");
}
if (_instance != null) return false;
_instance = instance;
return true;
}
public static bool IsInstanceCreated
{
get { return _instance != null; }
}
}
public class InvalidCsVersionMemberName : IVersionMemberName
{
public string VersionPropertyName { get { return "<>Version"; } }
public string VersionBackingFieldName { get { return "<>_version"; } }
}
public class ValidCsVersionMemberName : IVersionMemberName
{
public string VersionPropertyName { get { return "Version"; } }
public string VersionBackingFieldName { get { return "_version"; } }
}
}
| mit | C# |
54a94be88179245675cdfa5c16379a38c3715893 | update IsGhost to Destroy not DestoryImmediate. | drawcode/game-lib-engine | Engine/Extensions/TransformExtensions.cs | Engine/Extensions/TransformExtensions.cs | using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class TransformExtensions {
public static bool IsPrefabGhost(this Transform inst) {
var tmp = new GameObject();
try {
tmp.transform.parent = inst.parent;
var index = inst.GetSiblingIndex();
inst.SetSiblingIndex(int.MaxValue);
if (inst.GetSiblingIndex() == 0)
return true;
inst.SetSiblingIndex(index);
return false;
}
finally {
//UnityEngine.Object.DestroyImmediate(tmp);
UnityEngine.Object.Destroy(tmp);
}
}
} | using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class TransformExtensions {
public static bool IsPrefabGhost(this Transform inst) {
var tmp = new GameObject();
try {
tmp.transform.parent = inst.parent;
var index = inst.GetSiblingIndex();
inst.SetSiblingIndex(int.MaxValue);
if (inst.GetSiblingIndex() == 0)
return true;
inst.SetSiblingIndex(index);
return false;
}
finally {
UnityEngine.Object.DestroyImmediate(tmp);
}
}
} | mit | C# |
e2e212cdb27fb9256e076918aa926ff1ece4ba58 | Remove AssemblFileVersion and use AssemblyVersion only | oliverzick/ImmutableUndoRedo | src/ImmutableUndoRedo/Properties/AssemblyInfo.cs | src/ImmutableUndoRedo/Properties/AssemblyInfo.cs | #region Copyright and license
// <copyright file="AssemblyInfo.cs" company="Oliver Zick">
// Copyright (c) 2015 Oliver Zick. All rights reserved.
// </copyright>
// <author>Oliver Zick</author>
// <license>
// 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.
// </license>
#endregion
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ImmutableUndoRedo")]
[assembly: AssemblyDescription("A lightweight, flexible and easy to use do/undo/redo implementation based on immutable objects for .NET.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ImmutableUndoRedo")]
[assembly: AssemblyCopyright("Copyright © 2015 Oliver Zick. All rights reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
[assembly: Guid("ef605850-4540-4e3a-9e71-cc10385d94c7")]
[assembly: AssemblyVersion("1.1.1.0")]
| #region Copyright and license
// <copyright file="AssemblyInfo.cs" company="Oliver Zick">
// Copyright (c) 2015 Oliver Zick. All rights reserved.
// </copyright>
// <author>Oliver Zick</author>
// <license>
// 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.
// </license>
#endregion
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ImmutableUndoRedo")]
[assembly: AssemblyDescription("A lightweight, flexible and easy to use do/undo/redo implementation based on immutable objects for .NET.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ImmutableUndoRedo")]
[assembly: AssemblyCopyright("Copyright © 2015 Oliver Zick. All rights reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
[assembly: Guid("ef605850-4540-4e3a-9e71-cc10385d94c7")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.1.1.0")] | apache-2.0 | C# |
244f0b83c5f54a3deb53257236411b2280f7ea09 | Clear live tile on launch if theres no music playing. | Amrykid/Neptunium | src/Neptunium/Core/UI/NepAppUILiveTileHandler.cs | src/Neptunium/Core/UI/NepAppUILiveTileHandler.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Neptunium.Core.Media.Metadata;
using Neptunium.Media.Songs;
using Windows.UI.Core;
using Windows.UI.Notifications;
namespace Neptunium.Core.UI
{
public class NepAppUILiveTileHandler
{
internal NepAppUILiveTileHandler()
{
NepApp.SongManager.PreSongChanged += SongManager_PreSongChanged;
NepApp.SongManager.SongChanged += SongManager_SongChanged;
NepApp.SongManager.StationRadioProgramStarted += SongManager_StationRadioProgramStarted;
if (!NepApp.MediaPlayer.IsPlaying) ClearLiveTileAndMediaNotifcation();
}
internal void ClearLiveTileAndMediaNotifcation()
{
if (!NepApp.IsServerMode)
{
if (App.GetDevicePlatform() == Crystal3.Core.Platform.Desktop || App.GetDevicePlatform() == Crystal3.Core.Platform.Mobile)
{
//clears the tile if we're suspending.
TileUpdateManager.CreateTileUpdaterForApplication().Clear();
}
if (!NepApp.MediaPlayer.IsPlaying)
{
//removes the now playing notification from the action center.
ToastNotificationManager.History.Remove(NepAppUIManagerNotifier.SongNotificationTag);
}
}
}
private void SongManager_StationRadioProgramStarted(object sender, NepAppStationProgramStartedEventArgs e)
{
if (e.Metadata != null)
NepApp.UI.Notifier.UpdateLiveTile(new ExtendedSongMetadata(e.Metadata));
}
private void SongManager_SongChanged(object sender, NepAppSongChangedEventArgs e)
{
NepApp.UI.Notifier.UpdateLiveTile((ExtendedSongMetadata)e.Metadata);
}
private void SongManager_PreSongChanged(object sender, NepAppSongChangedEventArgs e)
{
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Neptunium.Core.Media.Metadata;
using Neptunium.Media.Songs;
using Windows.UI.Core;
using Windows.UI.Notifications;
namespace Neptunium.Core.UI
{
public class NepAppUILiveTileHandler
{
internal NepAppUILiveTileHandler()
{
NepApp.SongManager.PreSongChanged += SongManager_PreSongChanged;
NepApp.SongManager.SongChanged += SongManager_SongChanged;
NepApp.SongManager.StationRadioProgramStarted += SongManager_StationRadioProgramStarted;
}
internal void ClearLiveTileAndMediaNotifcation()
{
if (!NepApp.IsServerMode)
{
if (App.GetDevicePlatform() == Crystal3.Core.Platform.Desktop || App.GetDevicePlatform() == Crystal3.Core.Platform.Mobile)
{
//clears the tile if we're suspending.
TileUpdateManager.CreateTileUpdaterForApplication().Clear();
}
if (!NepApp.MediaPlayer.IsPlaying)
{
//removes the now playing notification from the action center.
ToastNotificationManager.History.Remove(NepAppUIManagerNotifier.SongNotificationTag);
}
}
}
private void SongManager_StationRadioProgramStarted(object sender, NepAppStationProgramStartedEventArgs e)
{
if (e.Metadata != null)
NepApp.UI.Notifier.UpdateLiveTile(new ExtendedSongMetadata(e.Metadata));
}
private void SongManager_SongChanged(object sender, NepAppSongChangedEventArgs e)
{
NepApp.UI.Notifier.UpdateLiveTile((ExtendedSongMetadata)e.Metadata);
}
private void SongManager_PreSongChanged(object sender, NepAppSongChangedEventArgs e)
{
}
}
}
| mit | C# |
27e2bbc71a9e97e538c0d6018ea81a08bd24105e | Implement SpriteCircular using CornerRadius. | Tom94/osu-framework,RedNesto/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,peppy/osu-framework,DrabWeb/osu-framework,DrabWeb/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,default0/osu-framework,ZLima12/osu-framework,RedNesto/osu-framework,NeoAdonis/osu-framework,paparony03/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,DrabWeb/osu-framework,peppy/osu-framework,default0/osu-framework,Nabile-Rahmani/osu-framework,NeoAdonis/osu-framework,Nabile-Rahmani/osu-framework,smoogipooo/osu-framework,naoey/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,paparony03/osu-framework,naoey/osu-framework,ppy/osu-framework,Tom94/osu-framework | osu.Framework/Graphics/Sprites/SpriteCircular.cs | osu.Framework/Graphics/Sprites/SpriteCircular.cs | // Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using OpenTK;
using System.Diagnostics;
namespace osu.Framework.Graphics.Sprites
{
public class SpriteCircular : Sprite
{
public override float CornerRadius
{
get { return Texture.DisplayWidth / 2f; }
set { Debug.Assert(false, "Cannot set CornerRadius of SpriteCircular."); }
}
}
}
| // Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using OpenTK;
namespace osu.Framework.Graphics.Sprites
{
public class SpriteCircular : Sprite
{
public float HoverRadius;
public override bool Contains(Vector2 screenSpacePos)
{
float hoverRadius = HoverRadius > 0 ? HoverRadius : Texture.DisplayWidth / 2f;
Vector2 localSpacePos = screenSpacePos * DrawInfo.MatrixInverse;
return Vector2.DistanceSquared(localSpacePos, DrawQuad.Centre) < hoverRadius * hoverRadius;
}
}
}
| mit | C# |
d6a5743d1b04da99e6e2ae62ee6b6cd2c4201405 | Add doc for what happens when getting clipboard text fails (SDL) | peppy/osu-framework,ppy/osu-framework,ppy/osu-framework,Tom94/osu-framework,smoogipooo/osu-framework,DrabWeb/osu-framework,ZLima12/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,DrabWeb/osu-framework | osu.Framework/Platform/Linux/Sdl/SdlClipboard.cs | osu.Framework/Platform/Linux/Sdl/SdlClipboard.cs | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
using System.Runtime.InteropServices;
namespace osu.Framework.Platform.Linux.Sdl
{
public class SdlClipboard : Clipboard
{
private const string lib = "libSDL2-2.0";
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_free", ExactSpelling = true)]
internal static extern void SDL_free(IntPtr ptr);
/// <returns>Returns the clipboard text on success or <see cref="IntPtr.Zero"/> on failure. </returns>
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipboardText", ExactSpelling = true)]
internal static extern IntPtr SDL_GetClipboardText();
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetClipboardText", ExactSpelling = true)]
internal static extern int SDL_SetClipboardText(string text);
public override string GetText()
{
IntPtr ptrToText = SDL_GetClipboardText();
string text = Marshal.PtrToStringAnsi(ptrToText);
SDL_free(ptrToText);
return text;
}
public override void SetText(string selectedText)
{
SDL_SetClipboardText(selectedText);
}
}
}
| // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
using System.Runtime.InteropServices;
namespace osu.Framework.Platform.Linux.Sdl
{
public class SdlClipboard : Clipboard
{
private const string lib = "libSDL2-2.0";
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_free", ExactSpelling = true)]
internal static extern void SDL_free(IntPtr ptr);
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipboardText", ExactSpelling = true)]
internal static extern IntPtr SDL_GetClipboardText();
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetClipboardText", ExactSpelling = true)]
internal static extern int SDL_SetClipboardText(string text);
public override string GetText()
{
IntPtr ptrToText = SDL_GetClipboardText();
string text = Marshal.PtrToStringAnsi(ptrToText);
SDL_free(ptrToText);
return text;
}
public override void SetText(string selectedText)
{
SDL_SetClipboardText(selectedText);
}
}
}
| mit | C# |
fb2c35190b246cdda313d8db1bb8b709257e4029 | Remove redundant qualifier | mmanela/diffplex,mmanela/diffplex,mmanela/diffplex,mmanela/diffplex | DiffPlex/Log.cs | DiffPlex/Log.cs | using System.Diagnostics;
namespace DiffPlex
{
public static class Log
{
[Conditional("LOG")]
public static void WriteLine(string format, params object[] args)
{
Debug.WriteLine(format, args);
}
[Conditional("LOG")]
public static void Write(string format, params object[] args)
{
// not implemented
}
}
} | using System.Diagnostics;
namespace DiffPlex
{
public static class Log
{
[Conditional("LOG")]
public static void WriteLine(string format, params object[] args)
{
System.Diagnostics.Debug.WriteLine(format, args);
}
[Conditional("LOG")]
public static void Write(string format, params object[] args)
{
// not implemented
}
}
} | apache-2.0 | C# |
34e87811520a7829568cf1b9657e5384f6df9b4a | Update ScaleCamera.cs | UnityCommunity/UnityLibrary | Assets/Scripts/2D/Camera/ScaleCamera.cs | Assets/Scripts/2D/Camera/ScaleCamera.cs | // pixel perfect camera helpers, from old unity 2D tutorial videos
// source: https://www.youtube.com/watch?v=rMCLWt1DuqI
using UnityEngine;
namespace UnityLibrary
{
[ExecuteInEditMode]
public class ScaleCamera : MonoBehaviour
{
public int targetWidth = 640;
public float pixelsToUnits = 100;
Camera cam;
void Start()
{
cam = GetComponent<Camera>();
if (cam == null)
{
Debug.LogError("Camera not found..", gameObject);
this.enabled = false;
return;
}
SetScale();
}
// in editor need to update in a loop, in case of game window resizes
#if UNITY_EDITOR
void Update()
{
SetScale();
}
#endif
void SetScale()
{
int height = Mathf.RoundToInt(targetWidth / (float)Screen.width * Screen.height);
cam.orthographicSize = height / pixelsToUnits / 2;
}
}
}
| using UnityEngine;
// pixel perfect camera helpers, from old unity 2D tutorial videos
[ExecuteInEditMode]
public class ScaleCamera : MonoBehaviour
{
public int targetWidth = 640;
public float pixelsToUnits = 100;
void Start()
{
int height = Mathf.RoundToInt(targetWidth / (float)Screen.width * Screen.height);
GetComponent<Camera>().orthographicSize = height / pixelsToUnits / 2;
}
}
| mit | C# |
3d2177f8062c5f86af7cce1f623ef60404c690cb | add Feed Uris and blog url | MabroukENG/planetxamarin,MabroukENG/planetxamarin,MabroukENG/planetxamarin | src/Firehose.Web/Authors/MabroukMahdhi.cs | src/Firehose.Web/Authors/MabroukMahdhi.cs | using Firehose.Web.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Firehose.Web.Authors
{
public class MabroukMahdhi : IAmACommunityMember
{
public string EmailAddress => "mabrouk@mahdhi.com";
public IEnumerable<Uri> FeedUris => new List<Uri>() { new Uri("http://xamabrouk.blogspot.de/rss.xml") };
public string FirstName => "Mabrouk";
public string GitHubHandle => "MabroukENG";
public string GravatarHash => "1f5b179abb9b9f8a34a4a9799e205c96";
public string LastName => "Mahdhi";
public GeoPosition Position => new GeoPosition(49.022821, 12.162714);
public string ShortBioOrTagLine => ", is a .Net & Xamarin apps developer @Gefasoft-Engineering GmbH";
public string StateOrRegion => "Tegernheim, Bayern, Germany";
public string TwitterHandle => "Mabrouk_MAHDHI";
public Uri WebSite => new Uri("http://xamabrouk.blogspot.de/");
}
}
| using Firehose.Web.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Firehose.Web.Authors
{
public class MabroukMahdhi : IAmACommunityMember
{
public string EmailAddress => "mabrouk@mahdhi.com";
public IEnumerable<Uri> FeedUris => new List<Uri>();
public string FirstName => "Mabrouk";
public string GitHubHandle => "MabroukENG";
public string GravatarHash => "";
public string LastName => "Mahdhi";
public GeoPosition Position => new GeoPosition(35.772390, 10.825278);
public string ShortBioOrTagLine => ".Net & Xamarin apps developer";
public string StateOrRegion => "Monastir";
public string TwitterHandle => "Mabrouk_MAHDHI";
public Uri WebSite => new Uri("http://mahdhi.com/");
}
}
| mit | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.