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
cae2d7597f31a85746fc6a6e58e707b4f7df6e33
Allow custom layout renderers to use stacktrace
luigiberrettini/NLog,hubo0831/NLog,tetrodoxin/NLog,AqlaSolutions/NLog-Unity3D,FeodorFitsner/NLog,ilya-g/NLog,ajayanandgit/NLog,ilya-g/NLog,rajeshgande/NLog,RichiCoder1/NLog,vladikk/NLog,AndreGleichner/NLog,michaeljbaird/NLog,UgurAldanmaz/NLog,thomkinson/NLog,vladikk/NLog,vladikk/NLog,BrutalCode/NLog,rajk987/NLog,MartinTherriault/NLog,bryjamus/NLog,tmusico/NLog,BrandonLegault/NLog,MoaidHathot/NLog,czema/NLog,fringebits/NLog,Niklas-Peter/NLog,mikkelxn/NLog,zbrad/NLog,vbfox/NLog,matteobruni/NLog,breyed/NLog,RRUZ/NLog,vladikk/NLog,tohosnet/NLog,RRUZ/NLog,zbrad/NLog,czema/NLog,ie-zero/NLog,ArsenShnurkov/NLog,babymechanic/NLog,mikkelxn/NLog,snakefoot/NLog,thomkinson/NLog,thomkinson/NLog,ie-zero/NLog,mikkelxn/NLog,sean-gilliam/NLog,michaeljbaird/NLog,bhaeussermann/NLog,FeodorFitsner/NLog,fringebits/NLog,ArsenShnurkov/NLog,rajeshgande/NLog,bjornbouetsmith/NLog,tmusico/NLog,nazim9214/NLog,AndreGleichner/NLog,czema/NLog,mikkelxn/NLog,NLog/NLog,hubo0831/NLog,campbeb/NLog,littlesmilelove/NLog,czema/NLog,RichiCoder1/NLog,fringebits/NLog,kevindaub/NLog,AqlaSolutions/NLog-Unity3D,kevindaub/NLog,matteobruni/NLog,pwelter34/NLog,AqlaSolutions/NLog-Unity3D,fringebits/NLog,bhaeussermann/NLog,BrandonLegault/NLog,BrutalCode/NLog,BrandonLegault/NLog,tohosnet/NLog,MoaidHathot/NLog,littlesmilelove/NLog,pwelter34/NLog,rajk987/NLog,babymechanic/NLog,luigiberrettini/NLog,tetrodoxin/NLog,rajk987/NLog,bryjamus/NLog,UgurAldanmaz/NLog,Niklas-Peter/NLog,vbfox/NLog,thomkinson/NLog,nazim9214/NLog,campbeb/NLog,breyed/NLog,MartinTherriault/NLog,rajk987/NLog,ajayanandgit/NLog,BrandonLegault/NLog,bjornbouetsmith/NLog,304NotModified/NLog,AqlaSolutions/NLog-Unity3D
src/NLog/Internal/IUsesStackTrace.cs
src/NLog/Internal/IUsesStackTrace.cs
// // Copyright (c) 2004-2011 Jaroslaw Kowalski <jaak@jkowalski.net> // // All rights reserved. // // 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 Jaroslaw Kowalski 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF // THE POSSIBILITY OF SUCH DAMAGE. // namespace NLog.Internal { using NLog.Config; /// <summary> /// Allows components to request stack trace information to be provided in the <see cref="LogEventInfo"/>. /// </summary> public interface IUsesStackTrace { /// <summary> /// Gets the level of stack trace information required by the implementing class. /// </summary> StackTraceUsage StackTraceUsage { get; } } }
// // Copyright (c) 2004-2011 Jaroslaw Kowalski <jaak@jkowalski.net> // // All rights reserved. // // 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 Jaroslaw Kowalski 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF // THE POSSIBILITY OF SUCH DAMAGE. // namespace NLog.Internal { using NLog.Config; /// <summary> /// Allows components to request stack trace information to be provided in the <see cref="LogEventInfo"/>. /// </summary> internal interface IUsesStackTrace { /// <summary> /// Gets the level of stack trace information required by the implementing class. /// </summary> StackTraceUsage StackTraceUsage { get; } } }
bsd-3-clause
C#
1a98f2bf71dcbf8d2c8b57980c90604529bdd4ce
Improve ABI to work better on x64 (values seems better off passed by value instead of byval*).
xen2/SharpLang,xen2/SharpLang,xen2/SharpLang,xen2/SharpLang,xen2/SharpLang
src/SharpLang.Compiler/DefaultABI.cs
src/SharpLang.Compiler/DefaultABI.cs
using SharpLLVM; namespace SharpLang.CompilerServices { class DefaultABI : IABI { private readonly ContextRef context; private readonly TargetDataRef targetData; private readonly int intPtrSize; public DefaultABI(ContextRef context, TargetDataRef targetData) { this.context = context; this.targetData = targetData; var intPtrLLVM = LLVM.PointerType(LLVM.Int8TypeInContext(context), 0); intPtrSize = (int)LLVM.ABISizeOfType(targetData, intPtrLLVM); } public ABIParameterInfo GetParameterInfo(Type type) { if (type.StackType == StackValueType.Value) { // Types smaller than register size will be coerced to integer register type var structSize = LLVM.ABISizeOfType(targetData, type.DefaultTypeLLVM); if (structSize <= (ulong)intPtrSize) { return new ABIParameterInfo(ABIParameterInfoKind.Coerced, LLVM.IntTypeInContext(context, (uint)structSize * 8)); } // Otherwise, fallback to passing by pointer + byval (x86) or direct (x64) if (intPtrSize == 8) return new ABIParameterInfo(ABIParameterInfoKind.Direct); return new ABIParameterInfo(ABIParameterInfoKind.Indirect); } // Other types are passed by value (pointers, int32, int64, float, etc...) return new ABIParameterInfo(ABIParameterInfoKind.Direct); } } }
using SharpLLVM; namespace SharpLang.CompilerServices { class DefaultABI : IABI { private readonly ContextRef context; private readonly TargetDataRef targetData; private readonly int intPtrSize; public DefaultABI(ContextRef context, TargetDataRef targetData) { this.context = context; this.targetData = targetData; var intPtrLLVM = LLVM.PointerType(LLVM.Int8TypeInContext(context), 0); intPtrSize = (int)LLVM.ABISizeOfType(targetData, intPtrLLVM); } public ABIParameterInfo GetParameterInfo(Type type) { if (type.StackType == StackValueType.Value) { // Types smaller than register size will be coerced to integer register type var structSize = LLVM.ABISizeOfType(targetData, type.DefaultTypeLLVM); if (structSize <= (ulong)intPtrSize) { return new ABIParameterInfo(ABIParameterInfoKind.Coerced, LLVM.IntTypeInContext(context, (uint)structSize * 8)); } // Otherwise, fallback to passing by pointer + byval return new ABIParameterInfo(ABIParameterInfoKind.Indirect); } // Other types are passed by value return new ABIParameterInfo(ABIParameterInfoKind.Direct); } } }
bsd-2-clause
C#
1dac53bc55fc11e8627da12d5de15a850e08b8b0
Fix inspection error
NServiceBusSqlPersistence/NServiceBus.SqlPersistence
src/SqlPersistence/ScriptLocation.cs
src/SqlPersistence/ScriptLocation.cs
using System; using System.IO; using System.Reflection; using NServiceBus; using NServiceBus.Settings; static class ScriptLocation { public static string FindScriptDirectory(ReadOnlySettings settings) { var currentDirectory = GetCurrentDirectory(settings); return Path.Combine(currentDirectory, "NServiceBus.Persistence.Sql", settings.GetSqlDialect().Name); } static string GetCurrentDirectory(ReadOnlySettings settings) { if (settings.TryGet("SqlPersistence.ScriptDirectory", out string scriptDirectory)) { return scriptDirectory; } var entryAssembly = Assembly.GetEntryAssembly(); if (entryAssembly == null) { return AppDomain.CurrentDomain.BaseDirectory; } var codeBase = entryAssembly.CodeBase; return Directory.GetParent(new Uri(codeBase).LocalPath).FullName; } public static void ValidateScriptExists(string createScript) { if (!File.Exists(createScript)) { throw new Exception($"Expected '{createScript}' to exist. It is possible it was not deployed with the endpoint or NServiceBus.Persistence.Sql.MsBuild nuget was not included in the project."); } } }
using System; using System.IO; using System.Reflection; using NServiceBus; using NServiceBus.Settings; static class ScriptLocation { public static string FindScriptDirectory(ReadOnlySettings settings) { var currentDirectory = GetCurrentDirectory(settings); return Path.Combine(currentDirectory, "NServiceBus.Persistence.Sql", settings.GetSqlDialect().Name); } static string GetCurrentDirectory(ReadOnlySettings settings) { string scriptDirectory; if (settings.TryGet("SqlPersistence.ScriptDirectory", out scriptDirectory)) { return scriptDirectory; } var entryAssembly = Assembly.GetEntryAssembly(); if (entryAssembly == null) { return AppDomain.CurrentDomain.BaseDirectory; } var codeBase = entryAssembly.CodeBase; return Directory.GetParent(new Uri(codeBase).LocalPath).FullName; } public static void ValidateScriptExists(string createScript) { if (!File.Exists(createScript)) { throw new Exception($"Expected '{createScript}' to exist. It is possible it was not deployed with the endpoint or NServiceBus.Persistence.Sql.MsBuild nuget was not included in the project."); } } }
mit
C#
ac3f4cde66933c521c7c02f717a4d8c4322554c8
Add missing Id property on StripeDispute
stripe/stripe-dotnet,richardlawley/stripe.net,Raganhar/stripe.net,duckwaffle/stripe.net,Raganhar/stripe.net,brentdavid2008/stripe.net
src/Stripe/Entities/StripeDispute.cs
src/Stripe/Entities/StripeDispute.cs
using System; using Newtonsoft.Json; using Stripe.Infrastructure; using Newtonsoft.Json.Linq; using System.Collections.Generic; namespace Stripe { public class StripeDispute : StripeObject { [JsonProperty("object")] public string Object { get; set; } [JsonProperty("livemode")] public bool LiveMode { get; set; } [JsonProperty("amount")] public int? Amount { get; set; } #region Expandable Charge public string ChargeId { get; set; } [JsonIgnore] public StripeCharge Charge { get; set; } [JsonProperty("charge")] internal object InternalCharge { set { ExpandableProperty<StripeCharge>.Map(value, s => ChargeId = s, o => Charge = o); } } #endregion [JsonProperty("created")] [JsonConverter(typeof(StripeDateTimeConverter))] public DateTime? Created { get; set; } [JsonProperty("currency")] public string Currency { get; set; } [JsonProperty("reason")] public string Reason { get; set; } [JsonProperty("status")] public string Status { get; set; } [JsonProperty("balance_transactions")] public List<StripeBalanceTransaction> BalanceTransactions { get; set; } // needs evidence object // needs evidence_details [JsonProperty("is_charge_refundable")] public bool IsChargeRefundable { get; set; } [JsonProperty("metadata")] public Dictionary<string, string> Metadata { get; set; } } }
using System; using Newtonsoft.Json; using Stripe.Infrastructure; using Newtonsoft.Json.Linq; using System.Collections.Generic; namespace Stripe { public class StripeDispute { [JsonProperty("object")] public string Object { get; set; } [JsonProperty("livemode")] public bool LiveMode { get; set; } [JsonProperty("amount")] public int? Amount { get; set; } #region Expandable Charge public string ChargeId { get; set; } [JsonIgnore] public StripeCharge Charge { get; set; } [JsonProperty("charge")] internal object InternalCharge { set { ExpandableProperty<StripeCharge>.Map(value, s => ChargeId = s, o => Charge = o); } } #endregion [JsonProperty("created")] [JsonConverter(typeof(StripeDateTimeConverter))] public DateTime? Created { get; set; } [JsonProperty("currency")] public string Currency { get; set; } [JsonProperty("reason")] public string Reason { get; set; } [JsonProperty("status")] public string Status { get; set; } [JsonProperty("balance_transactions")] public List<StripeBalanceTransaction> BalanceTransactions { get; set; } // needs evidence object // needs evidence_details [JsonProperty("is_charge_refundable")] public bool IsChargeRefundable { get; set; } [JsonProperty("metadata")] public Dictionary<string, string> Metadata { get; set; } } }
apache-2.0
C#
7b3b74adbb3aee5fdd1ed9f9484b10f20ec9c6e1
Copy code into PathEventsHandler class
bartlomiejwolk/AnimationPathAnimator
PathEventsHandlerComponent/PathEventsHandler.cs
PathEventsHandlerComponent/PathEventsHandler.cs
using ATP.SimplePathAnimator.PathAnimatorComponent; using ATP.SimplePathAnimator.PathEventsComponent; using UnityEngine; namespace ATP.SimplePathAnimator.PathEventsHandlerComponent { [RequireComponent(typeof(PathAnimator))] public class PathEventsHandler : MonoBehaviour { #region FIELDS [SerializeField] private GUISkin skin; [SerializeField] private PathAnimator pathAnimator; [SerializeField] private PathEventsSettings settings; [SerializeField] private bool advancedSettingsFoldout; #endregion #region PROPERTIES public PathAnimator PathAnimator { get { return pathAnimator; } set { pathAnimator = value; } } public GUISkin Skin { get { return skin; } set { skin = value; } } public PathEventsSettings Settings { get { return settings; } set { settings = value; } } #endregion #region UNITY MESSAGES private void OnDisable() { PathAnimator.NodeReached -= Animator_NodeReached; } private void OnEnable() { if (PathAnimator == null) return; PathAnimator.NodeReached += Animator_NodeReached; } private void Reset() { pathAnimator = GetComponent<PathAnimator>(); settings = Resources.Load<PathEventsSettings>("DefaultPathEventsSettings"); skin = Resources.Load("DefaultPathEventsSkin") as GUISkin; } #endregion #region EVENT HANDLERS private void Animator_NodeReached( object sender, NodeReachedEventArgs arg) { } #endregion #region METHODS public Vector3[] GetNodePositions() { // TODO Move GetGlobalNodePositions() to Animator class. var nodePositions = PathAnimator.PathData.GetGlobalNodePositions(PathAnimator.ThisTransform); return nodePositions; } #endregion } }
using UnityEngine; namespace ATP.SimplePathAnimator.PathEventsHandlerComponent { public class PathEventsHandler : MonoBehaviour { } }
mit
C#
215fee90416c47b76fe8cc5e7f53c0645a4aedfb
Put the null db initializer back in there.
realistschuckle/entity-framework-mapping,realistschuckle/entity-framework-mapping
src/Data/DriversEdContext.cs
src/Data/DriversEdContext.cs
using Data.Mappings; using Domain.Entities; using System.Data.Entity; namespace Data { public class DriversEdContext : DbContext { public DriversEdContext() { Database.SetInitializer<DriversEdContext>(null); } public DbSet<Driver> Drivers { get; set; } public DbSet<Course> Courses { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Configurations.AddFromAssembly(typeof(DriversEdContext).Assembly); } } }
using Data.Mappings; using Domain.Entities; using System.Data.Entity; namespace Data { public class DriversEdContext : DbContext { public DriversEdContext() { // Database.SetInitializer<DriversEdContext>(null); } public DbSet<Driver> Drivers { get; set; } public DbSet<Course> Courses { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Configurations.AddFromAssembly(typeof(DriversEdContext).Assembly); } } }
mit
C#
d9014f5db9f7bd962a310d3c5aa4737b067cec5c
Support multiple optionally element depend to specify a service that must start before this service starts.
oleg-nenashev/winsw,oleg-nenashev/winsw,abbyad/winsw,kohsuke/winsw,abbyad/winsw,brettwooldridge/winsw,winweb/winsw,chenbojian/winsw,adpande/winsw,ganthore/winsw
WmiSchema.cs
WmiSchema.cs
 namespace WMI { public enum ServiceType { KernalDriver = 1, FileSystemDriver = 2, Adapter = 4, RecognizerDriver = 8, OwnProcess = 16, ShareProcess = 32, InteractiveProcess = 256, } public enum ErrorControl { UserNotNotified = 0, UserNotified = 1, SystemRestartedWithLastKnownGoodConfiguration = 2, SystemAttemptsToStartWithAGoodConfiguration = 3 } public enum StartMode { /// <summary> /// Device driver started by the operating system loader. This value is valid only for driver services. /// </summary> Boot, /// <summary> /// Device driver started by the operating system initialization process. This value is valid only for driver services. /// </summary> System, /// <summary> /// Service to be started automatically by the Service Control Manager during system startup. /// </summary> Automatic, /// <summary> /// Service to be started by the Service Control Manager when a process calls the StartService method. /// </summary> Manual, /// <summary> /// Service that can no longer be started. /// </summary> Disabled, } [WmiClassName("Win32_Service")] public interface Win32Services : IWmiCollection { // ReturnValue Create(bool desktopInteract, string displayName, int errorControl, string loadOrderGroup, string loadOrderGroupDependencies, string name, string pathName, string serviceDependencies, string serviceType, string startMode, string startName, string startPassword); void Create(string name, string displayName, string pathName, ServiceType serviceType, ErrorControl errorControl, StartMode startMode, bool desktopInteract, string[] serviceDependencies); Win32Service Select(string name); } public interface Win32Service : IWmiObject { string Description { get; set; } bool Started { get; } void Delete(); void StartService(); void StopService(); } }
 namespace WMI { public enum ServiceType { KernalDriver = 1, FileSystemDriver = 2, Adapter = 4, RecognizerDriver = 8, OwnProcess = 16, ShareProcess = 32, InteractiveProcess = 256, } public enum ErrorControl { UserNotNotified = 0, UserNotified = 1, SystemRestartedWithLastKnownGoodConfiguration = 2, SystemAttemptsToStartWithAGoodConfiguration = 3 } public enum StartMode { /// <summary> /// Device driver started by the operating system loader. This value is valid only for driver services. /// </summary> Boot, /// <summary> /// Device driver started by the operating system initialization process. This value is valid only for driver services. /// </summary> System, /// <summary> /// Service to be started automatically by the Service Control Manager during system startup. /// </summary> Automatic, /// <summary> /// Service to be started by the Service Control Manager when a process calls the StartService method. /// </summary> Manual, /// <summary> /// Service that can no longer be started. /// </summary> Disabled, } [WmiClassName("Win32_Service")] public interface Win32Services : IWmiCollection { // ReturnValue Create(bool desktopInteract, string displayName, int errorControl, string loadOrderGroup, string loadOrderGroupDependencies, string name, string pathName, string serviceDependencies, string serviceType, string startMode, string startName, string startPassword); void Create(string name, string displayName, string pathName, ServiceType serviceType, ErrorControl errorControl, StartMode startMode, bool desktopInteract); Win32Service Select(string name); } public interface Win32Service : IWmiObject { string Description { get; set; } bool Started { get; } void Delete(); void StartService(); void StopService(); } }
mit
C#
932db6813959f4dda869898fa56ac0b2f882198c
remove notimplementedexception
aritchie/bluetoothle,aritchie/bluetoothle
Plugin.BluetoothLE/Server/AbstractAdvertiser.cs
Plugin.BluetoothLE/Server/AbstractAdvertiser.cs
using System; namespace Plugin.BluetoothLE.Server { public abstract class AbstractAdvertiser : IAdvertiser { public bool IsStarted { get; protected set; } public AdvertisementData CurrentAdvertisementData { get; protected set; } public virtual void Start(AdvertisementData adData) { this.CurrentAdvertisementData = adData; } public virtual void Stop() { this.CurrentAdvertisementData = null; this.IsStarted = false; } } }
using System; namespace Plugin.BluetoothLE.Server { public abstract class AbstractAdvertiser : IAdvertiser { public bool IsStarted { get; protected set; } public AdvertisementData CurrentAdvertisementData { get; protected set; } public virtual void Start(AdvertisementData adData) { this.CurrentAdvertisementData = adData; throw new NotImplementedException(); } public virtual void Stop() { this.CurrentAdvertisementData = null; this.IsStarted = false; throw new NotImplementedException(); } } }
mit
C#
beb4127d0d43055765927fd34067320e114523f0
add slot routing explicitly
projectkudu/SimpleWAWS,davidebbo/SimpleWAWS,projectkudu/SimpleWAWS,projectkudu/TryAppService,davidebbo/SimpleWAWS,projectkudu/TryAppService,davidebbo/SimpleWAWS,fashaikh/SimpleWAWS,fashaikh/SimpleWAWS,fashaikh/SimpleWAWS,projectkudu/SimpleWAWS,fashaikh/SimpleWAWS,projectkudu/SimpleWAWS,projectkudu/TryAppService,projectkudu/TryAppService,davidebbo/SimpleWAWS
SimpleWAWS/Authentication/GoogleAuthProvider.cs
SimpleWAWS/Authentication/GoogleAuthProvider.cs
using System; using System.Collections.Generic; using System.Configuration; using System.Globalization; using System.Linq; using System.Net; using System.Text; using System.Web; namespace SimpleWAWS.Authentication { public class GoogleAuthProvider : BaseOpenIdConnectAuthProvider { public override string GetLoginUrl(HttpContextBase context) { var culture = CultureInfo.CurrentCulture.Name.ToLowerInvariant(); var builder = new StringBuilder(); builder.Append("https://accounts.google.com/o/oauth2/auth"); builder.Append("?response_type=id_token"); builder.AppendFormat("&redirect_uri={0}", WebUtility.UrlEncode(string.Format(CultureInfo.InvariantCulture, "https://{0}/Login", context.Request.Headers["HOST"]))); builder.AppendFormat("&client_id={0}", AuthSettings.GoogleAppId); builder.AppendFormat("&scope={0}", "email"); if (context.IsFunctionsPortalRequest()) { var slot = String.Empty; if (context.Request.QueryString["x-ms-routing-name"] != null) slot = $"?x-ms-routing-name={context.Request.QueryString["x-ms-routing-name"]}"; builder.AppendFormat($"{slot}&state={0}", WebUtility.UrlEncode(string.Format(CultureInfo.InvariantCulture, "{0}{1}", context.Request.Headers["Referer"], context.Request.Url.Query) )); } else builder.AppendFormat("&state={0}", WebUtility.UrlEncode(context.IsAjaxRequest()? string.Format(CultureInfo.InvariantCulture, "/{0}{1}", culture, context.Request.Url.Query) : context.Request.Url.PathAndQuery)); return builder.ToString(); } protected override string GetValidAudiance() { return AuthSettings.GoogleAppId; } public override string GetIssuerName(string altSecId) { return "Google"; } } }
using System; using System.Collections.Generic; using System.Configuration; using System.Globalization; using System.Linq; using System.Net; using System.Text; using System.Web; namespace SimpleWAWS.Authentication { public class GoogleAuthProvider : BaseOpenIdConnectAuthProvider { public override string GetLoginUrl(HttpContextBase context) { var culture = CultureInfo.CurrentCulture.Name.ToLowerInvariant(); var builder = new StringBuilder(); builder.Append("https://accounts.google.com/o/oauth2/auth"); builder.Append("?response_type=id_token"); builder.AppendFormat("&redirect_uri={0}", WebUtility.UrlEncode(string.Format(CultureInfo.InvariantCulture, "https://{0}/Login", context.Request.Headers["HOST"]))); builder.AppendFormat("&client_id={0}", AuthSettings.GoogleAppId); builder.AppendFormat("&scope={0}", "email"); if (context.IsFunctionsPortalRequest()) { builder.AppendFormat("&state={0}", WebUtility.UrlEncode(string.Format(CultureInfo.InvariantCulture, "{0}{1}", context.Request.Headers["Referer"], context.Request.Url.Query) )); } else builder.AppendFormat("&state={0}", WebUtility.UrlEncode(context.IsAjaxRequest()? string.Format(CultureInfo.InvariantCulture, "/{0}{1}", culture, context.Request.Url.Query) : context.Request.Url.PathAndQuery)); return builder.ToString(); } protected override string GetValidAudiance() { return AuthSettings.GoogleAppId; } public override string GetIssuerName(string altSecId) { return "Google"; } } }
apache-2.0
C#
5fd6040469d55b81a620bd524dd0d8828da9a5b8
Update IGrid.cs
LANDIS-II-Foundation/Landis-Spatial-Modeling-Library
src/api/IGrid.cs
src/api/IGrid.cs
// Copyright 2004-2006 University of Wisconsin // All rights reserved. // // Contributors: // James Domingo, UW-Madison, Forest Landscape Ecology Lab namespace Landis.SpatialModeling { /// <summary> /// A rectangular grid of cells (elements). /// </summary> public interface IGrid { /// <summary> /// The grid's dimensions (rows and columns). /// </summary> Dimensions Dimensions { get; } //--------------------------------------------------------------------- /// <summary> /// The number of rows in the grid. /// </summary> int Rows { get; } //--------------------------------------------------------------------- /// <summary> /// The number of columns in the grid. /// </summary> int Columns { get; } //--------------------------------------------------------------------- /// <summary> /// The number of cells in the grid. /// </summary> long Count { get; } } }
// Copyright 2004-2006 University of Wisconsin // All rights reserved. // // The copyright holders license this file under the New (3-clause) BSD // License (the "License"). You may not use this file except in // compliance with the License. A copy of the License is available at // // http://www.opensource.org/licenses/BSD-3-Clause // // and is included in the NOTICE.txt file distributed with this work. // // Contributors: // James Domingo, UW-Madison, Forest Landscape Ecology Lab namespace Landis.SpatialModeling { /// <summary> /// A rectangular grid of cells (elements). /// </summary> public interface IGrid { /// <summary> /// The grid's dimensions (rows and columns). /// </summary> Dimensions Dimensions { get; } //--------------------------------------------------------------------- /// <summary> /// The number of rows in the grid. /// </summary> int Rows { get; } //--------------------------------------------------------------------- /// <summary> /// The number of columns in the grid. /// </summary> int Columns { get; } //--------------------------------------------------------------------- /// <summary> /// The number of cells in the grid. /// </summary> long Count { get; } } }
apache-2.0
C#
9bd9fbd397b803ff3dd2bb23c432465b2051e4a5
Fix issue with line endings
rohmano/azure-powershell,devigned/azure-powershell,ClogenyTechnologies/azure-powershell,pankajsn/azure-powershell,devigned/azure-powershell,rohmano/azure-powershell,atpham256/azure-powershell,ClogenyTechnologies/azure-powershell,devigned/azure-powershell,pankajsn/azure-powershell,AzureAutomationTeam/azure-powershell,pankajsn/azure-powershell,atpham256/azure-powershell,pankajsn/azure-powershell,hungmai-msft/azure-powershell,AzureAutomationTeam/azure-powershell,rohmano/azure-powershell,AzureAutomationTeam/azure-powershell,krkhan/azure-powershell,hungmai-msft/azure-powershell,krkhan/azure-powershell,devigned/azure-powershell,naveedaz/azure-powershell,pankajsn/azure-powershell,ClogenyTechnologies/azure-powershell,rohmano/azure-powershell,krkhan/azure-powershell,hungmai-msft/azure-powershell,krkhan/azure-powershell,atpham256/azure-powershell,atpham256/azure-powershell,rohmano/azure-powershell,AzureAutomationTeam/azure-powershell,ClogenyTechnologies/azure-powershell,hungmai-msft/azure-powershell,krkhan/azure-powershell,hungmai-msft/azure-powershell,atpham256/azure-powershell,naveedaz/azure-powershell,atpham256/azure-powershell,naveedaz/azure-powershell,rohmano/azure-powershell,pankajsn/azure-powershell,krkhan/azure-powershell,ClogenyTechnologies/azure-powershell,hungmai-msft/azure-powershell,devigned/azure-powershell,AzureAutomationTeam/azure-powershell,AzureAutomationTeam/azure-powershell,naveedaz/azure-powershell,devigned/azure-powershell,naveedaz/azure-powershell,naveedaz/azure-powershell
src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementApiToProduct.cs
src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementApiToProduct.cs
// // Copyright (c) Microsoft. 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 Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands { using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; using System; using System.Management.Automation; [Cmdlet(VerbsCommon.Add, Constants.ApiManagementApiToProduct)] [OutputType(typeof(bool))] public class AddAzureApiManagementApiToProduct : AzureApiManagementCmdletBase { [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] [ValidateNotNullOrEmpty] public PsApiManagementContext Context { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Identifier of existing Product to add API to. This parameter is required.")] [ValidateNotNullOrEmpty] public String ProductId { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Identifier of existing APIs to be added to the product. This parameter is required.")] [ValidateNotNullOrEmpty] public String ApiId { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] public SwitchParameter PassThru { get; set; } public override void ExecuteApiManagementCmdlet() { Client.ApiAddToProduct(Context, ProductId, ApiId); if (PassThru) { WriteObject(true); } } } }
// // Copyright (c) Microsoft. 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 Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands { using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; using System; using System.Management.Automation; [Cmdlet(VerbsCommon.Add, Constants.ApiManagementApiToProduct)] [OutputType(typeof(bool))] public class AddAzureApiManagementApiToProduct : AzureApiManagementCmdletBase { [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] [ValidateNotNullOrEmpty] public PsApiManagementContext Context { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Identifier of existing Product to add API to. This parameter is required.")] [ValidateNotNullOrEmpty] public String ProductId { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Identifier of existing APIs to be added to the product. This parameter is required.")] [ValidateNotNullOrEmpty] public String ApiId { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] public SwitchParameter PassThru { get; set; } public override void ExecuteApiManagementCmdlet() { Client.ApiAddToProduct(Context, ProductId, ApiId); if (PassThru) { WriteObject(true); } } } }
apache-2.0
C#
3017e6665f2638737730485ddd3977566d70c437
Update SetUpFixture to kill dotnet process on OneTimeTearDown
atata-framework/atata-kendoui,atata-framework/atata-kendoui
src/Atata.KendoUI.Tests/SetUpFixture.cs
src/Atata.KendoUI.Tests/SetUpFixture.cs
using System; using System.Diagnostics; using System.IO; using System.Net; using System.Threading; using NUnit.Framework; namespace Atata.KendoUI.Tests { [SetUpFixture] public class SetUpFixture { private Process coreRunProcess; [OneTimeSetUp] public void GlobalSetUp() { try { PingTestApp(); } catch { RunTestApp(); } } private static WebResponse PingTestApp() => WebRequest.CreateHttp(UITestFixture.BaseUrl).GetResponse(); private void RunTestApp() { coreRunProcess = new Process { StartInfo = new ProcessStartInfo { FileName = "cmd.exe", Arguments = "/c dotnet run", WorkingDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\..\\..\\Atata.KendoUI.TestApp") } }; coreRunProcess.Start(); Thread.Sleep(5000); var testAppWait = new SafeWait<SetUpFixture>(this) { Timeout = TimeSpan.FromSeconds(40), PollingInterval = TimeSpan.FromSeconds(1) }; testAppWait.IgnoreExceptionTypes(typeof(WebException)); testAppWait.Until(x => PingTestApp()); } [OneTimeTearDown] public void GlobalTearDown() { if (coreRunProcess != null) { coreRunProcess.Kill(true); coreRunProcess.Dispose(); } } } }
using System; using System.Diagnostics; using System.IO; using System.Net; using System.Threading; using NUnit.Framework; namespace Atata.KendoUI.Tests { [SetUpFixture] public class SetUpFixture { private Process coreRunProcess; [OneTimeSetUp] public void GlobalSetUp() { try { PingTestApp(); } catch { RunTestApp(); } } private static WebResponse PingTestApp() => WebRequest.CreateHttp(UITestFixture.BaseUrl).GetResponse(); private void RunTestApp() { coreRunProcess = new Process { StartInfo = new ProcessStartInfo { FileName = "cmd.exe", Arguments = "/c dotnet run", WorkingDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\..\\..\\Atata.KendoUI.TestApp") } }; coreRunProcess.Start(); Thread.Sleep(5000); var testAppWait = new SafeWait<SetUpFixture>(this) { Timeout = TimeSpan.FromSeconds(40), PollingInterval = TimeSpan.FromSeconds(1) }; testAppWait.IgnoreExceptionTypes(typeof(WebException)); testAppWait.Until(x => PingTestApp()); } [OneTimeTearDown] public void GlobalTearDown() { coreRunProcess?.CloseMainWindow(); coreRunProcess?.Dispose(); } } }
apache-2.0
C#
ed26de20d22f1a9ded1b1d92574caa53373768d0
Switch the option on push command to be false by default. This makes it cleaner to turn off publishing. "nuget push -co vs. nuget push -pub-"
mdavid/nuget,mdavid/nuget
src/CommandLine/Commands/PushCommand.cs
src/CommandLine/Commands/PushCommand.cs
namespace NuGet.Commands { using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using NuGet.Common; [Export(typeof(ICommand))] [Command(typeof(NuGetResources), "push", "PushCommandDescription", AltName="pu", MinArgs = 2, MaxArgs = 2, UsageDescriptionResourceName = "PushCommandUsageDescription", UsageSummaryResourceName = "PushCommandUsageSummary")] public class PushCommand : Command { private string _apiKey; private string _packagePath; [Option(typeof(NuGetResources), "PushCommandPublishDescription", AltName = "co")] public bool CreateOnly { get; set; } [Option(typeof(NuGetResources), "PushCommandSourceDescription", AltName = "src")] public string Source { get; set; } public PushCommand() { CreateOnly = true; } public override void ExecuteCommand() { //Frist argument should be the package _packagePath = Arguments[0]; //Second argument should be the API Key _apiKey = Arguments[1]; GalleryServer gallery; if (String.IsNullOrEmpty(Source)) { gallery = new GalleryServer(); } else { gallery = new GalleryServer(Source); } ZipPackage pkg = new ZipPackage(_packagePath); Console.WriteLine(NuGetResources.PushCommandCreatingPackage, pkg.Id, pkg.Version); using (Stream pkgStream = pkg.GetStream()) { gallery.CreatePackage(_apiKey, pkgStream); } Console.WriteLine(NuGetResources.PushCommandPackageCreated); if (!CreateOnly) { var cmd = new PublishCommand(); cmd.Console = Console; cmd.Source = Source; cmd.Arguments = new List<string> { pkg.Id, pkg.Version.ToString(), _apiKey }; cmd.Execute(); } } } }
namespace NuGet.Commands { using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using NuGet.Common; [Export(typeof(ICommand))] [Command(typeof(NuGetResources), "push", "PushCommandDescription", AltName="pu", MinArgs = 2, MaxArgs = 2, UsageDescriptionResourceName = "PushCommandUsageDescription", UsageSummaryResourceName = "PushCommandUsageSummary")] public class PushCommand : Command { private string _apiKey; private string _packagePath; [Option(typeof(NuGetResources), "PushCommandPublishDescription", AltName = "pub")] public bool Publish { get; set; } [Option(typeof(NuGetResources), "PushCommandSourceDescription", AltName = "src")] public string Source { get; set; } public PushCommand() { Publish = true; } public override void ExecuteCommand() { //Frist argument should be the package _packagePath = Arguments[0]; //Second argument should be the API Key _apiKey = Arguments[1]; GalleryServer gallery; if (String.IsNullOrEmpty(Source)) { gallery = new GalleryServer(); } else { gallery = new GalleryServer(Source); } ZipPackage pkg = new ZipPackage(_packagePath); Console.WriteLine(NuGetResources.PushCommandCreatingPackage, pkg.Id, pkg.Version); using (Stream pkgStream = pkg.GetStream()) { gallery.CreatePackage(_apiKey, pkgStream); } Console.WriteLine(NuGetResources.PushCommandPackageCreated); if (Publish) { var cmd = new PublishCommand(); cmd.Console = Console; cmd.Source = Source; cmd.Arguments = new List<string> { pkg.Id, pkg.Version.ToString(), _apiKey }; cmd.Execute(); } } } }
apache-2.0
C#
6990d45fdcefde8365b5a47dafae569f176c108c
Write the json output in a user readable way
AlexGhiondea/SmugMug.NET
src/SmugMugMetadataRetriever/Program.cs
src/SmugMugMetadataRetriever/Program.cs
// Copyright (c) Alex Ghiondea. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Newtonsoft.Json; using SmugMug.Shared.Descriptors; using SmugMug.v2.Authentication; using SmugMugShared; using SmugMugShared.Extensions; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; namespace SmugMugMetadataRetriever { class Program { static OAuthToken s_oauthToken; static void Main(string[] args) { s_oauthToken = SmugMug.Shared.SecretsAccess.GetSmugMugSecrets(); Debug.Assert(!s_oauthToken.Equals(OAuthToken.Invalid)); ApiAnalyzer buf = new ApiAnalyzer(s_oauthToken); var list = new Dictionary<string, string>(); list = buf.GetBaseUris(Constants.Addresses.SmugMug, "/api/v2"); for (int i = 0; i < args.Length; i++) { list.Add("arg" + i, args[i]); } Dictionary<string, string> uris = new Dictionary<string, string>(); foreach (var item in list) { uris.Add(item.Key, Constants.Addresses.SmugMug + item.Value + Constants.RequestModifiers); } var types = buf.AnalyzeAPIs(uris, Constants.Addresses.SmugMugApi); var missingTypes = buf.GetMissingTypes(); // make sure that we have all the types? foreach (var item in missingTypes) { if (!types.ContainsKey(item)) { ConsolePrinter.Write(ConsoleColor.Red, "Could not find type {0}", item); } } var jsonSerSettings = new JsonSerializerSettings(); jsonSerSettings.TypeNameHandling = TypeNameHandling.All; jsonSerSettings.Formatting = Formatting.Indented; var jsonSer = Newtonsoft.Json.JsonSerializer.CreateDefault(jsonSerSettings); using (StreamWriter sw = new StreamWriter("data.json")) { jsonSer.Serialize(sw, types); } } } }
// Copyright (c) Alex Ghiondea. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Newtonsoft.Json; using SmugMug.Shared.Descriptors; using SmugMug.v2.Authentication; using SmugMugShared; using SmugMugShared.Extensions; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; namespace SmugMugMetadataRetriever { class Program { static OAuthToken s_oauthToken; static void Main(string[] args) { s_oauthToken = SmugMug.Shared.SecretsAccess.GetSmugMugSecrets(); Debug.Assert(!s_oauthToken.Equals(OAuthToken.Invalid)); ApiAnalyzer buf = new ApiAnalyzer(s_oauthToken); var list = new Dictionary<string, string>(); list = buf.GetBaseUris(Constants.Addresses.SmugMug, "/api/v2"); for (int i = 0; i < args.Length; i++) { list.Add("arg" + i, args[i]); } Dictionary<string, string> uris = new Dictionary<string, string>(); foreach (var item in list) { uris.Add(item.Key, Constants.Addresses.SmugMug + item.Value + Constants.RequestModifiers); } var types = buf.AnalyzeAPIs(uris, Constants.Addresses.SmugMugApi); var missingTypes = buf.GetMissingTypes(); // make sure that we have all the types? foreach (var item in missingTypes) { if (!types.ContainsKey(item)) { ConsolePrinter.Write(ConsoleColor.Red, "Could not find type {0}", item); } } var jsonSerSettings = new JsonSerializerSettings(); jsonSerSettings.TypeNameHandling = TypeNameHandling.All; var jsonSer = Newtonsoft.Json.JsonSerializer.CreateDefault(jsonSerSettings); using (StreamWriter sw = new StreamWriter("data.json")) { jsonSer.Serialize(sw, types); } } } }
mit
C#
41dbce2c070b0f3cf1fea7ac8f9b278161920f6f
Fix buttons
ZLima12/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,Tom94/osu-framework,paparony03/osu-framework,default0/osu-framework,peppy/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,naoey/osu-framework,paparony03/osu-framework,RedNesto/osu-framework,peppy/osu-framework,default0/osu-framework,Nabile-Rahmani/osu-framework,ppy/osu-framework,Tom94/osu-framework,peppy/osu-framework,DrabWeb/osu-framework,ppy/osu-framework,naoey/osu-framework,smoogipooo/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,Nabile-Rahmani/osu-framework,EVAST9919/osu-framework,RedNesto/osu-framework,EVAST9919/osu-framework
osu.Framework/Graphics/UserInterface/Button.cs
osu.Framework/Graphics/UserInterface/Button.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 osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using OpenTK.Graphics; using osu.Framework.Allocation; namespace osu.Framework.Graphics.UserInterface { public class Button : ClickableContainer { public string Text { get { return spriteText?.Text; } set { if (spriteText != null) spriteText.Text = value; } } public new Color4 Colour { get { return box.Colour; } set { box.Colour = value; } } private Box box; private SpriteText spriteText; public Button() { Children = new Drawable[] { box = new Box { RelativeSizeAxes = Axes.Both, }, spriteText = new SpriteText { Origin = Anchor.Centre, Anchor = Anchor.Centre, } }; } protected override bool OnClick(InputState state) { var flash = new Box { RelativeSizeAxes = Axes.Both }; Add(flash); flash.Colour = box.Colour; flash.BlendingMode = BlendingMode.Additive; flash.Alpha = 0.3f; flash.FadeOutFromOne(200); flash.Expire(); return base.OnClick(state); } } }
// 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 osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using OpenTK.Graphics; using osu.Framework.Allocation; namespace osu.Framework.Graphics.UserInterface { public class Button : ClickableContainer { public string Text { get { return spriteText?.Text; } set { if (spriteText != null) spriteText.Text = value; } } public new Color4 Colour { get { return box.Colour; } set { box.Colour = value; } } private Box box; private SpriteText spriteText; [Initializer] private void Load() { Children = new Drawable[] { box = new Box { RelativeSizeAxes = Axes.Both, }, spriteText = new SpriteText { Origin = Anchor.Centre, Anchor = Anchor.Centre, } }; } protected override bool OnClick(InputState state) { var flash = new Box { RelativeSizeAxes = Axes.Both }; Add(flash); flash.Colour = box.Colour; flash.BlendingMode = BlendingMode.Additive; flash.Alpha = 0.3f; flash.FadeOutFromOne(200); flash.Expire(); return base.OnClick(state); } } }
mit
C#
3de728c3d0fecbb3fa3e9b8019941cb51a3d2867
Update assembly details for NuGet
mwilliamson/java-mammoth
dotnet/Mammoth/Properties/AssemblyInfo.cs
dotnet/Mammoth/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("Mammoth")] [assembly: AssemblyDescription("Convert Word documents from docx to simple HTML")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Michael Williamson")] [assembly: AssemblyProduct("Mammoth")] [assembly: AssemblyCopyright("Copyright © Michael Williamson 2015 - 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("0.0.2.0")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("Mammoth")] [assembly: AssemblyDescription("Convert Word documents from docx to simple HTML")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("Copyright © Michael Williamson 2015 - 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("0.0.2.0")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
bsd-2-clause
C#
ee8459faeb66d322159e4f7520750a2e60ec01c9
Set IndexedAttachments to version 2.0.2.0
ravendb/ravendb.contrib
src/Raven.Bundles.Contrib.IndexedAttachments/Properties/AssemblyInfo.cs
src/Raven.Bundles.Contrib.IndexedAttachments/Properties/AssemblyInfo.cs
using System.Reflection; [assembly: AssemblyTitle("Raven.Bundles.Contrib.IndexedAttachments")] [assembly: AssemblyDescription("Plugin for RavenDB that extracts text from attachments so they can be indexed.")] [assembly: AssemblyVersion("2.0.2.0")] [assembly: AssemblyFileVersion("2.0.2.0")]
using System.Reflection; [assembly: AssemblyTitle("Raven.Bundles.Contrib.IndexedAttachments")] [assembly: AssemblyDescription("Plugin for RavenDB that extracts text from attachments so they can be indexed.")] [assembly: AssemblyVersion("2.0.1.0")] [assembly: AssemblyFileVersion("2.0.1.0")]
mit
C#
d9efd8e113552afd2c423c7ef0eccaa2cd7adbc3
Fix doc warnings
canton7/RestEase
src/RestEase/Implementation/RestEaseInterfaceImplementationAttribute.cs
src/RestEase/Implementation/RestEaseInterfaceImplementationAttribute.cs
using System; using System.ComponentModel; namespace RestEase.Implementation { /// <summary> /// Internal type. Do not use. /// </summary> [EditorBrowsable(EditorBrowsableState.Never)] [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class RestEaseInterfaceImplementationAttribute : Attribute { /// <summary> /// Internal type. Do not use. /// </summary> public Type InterfaceType { get; } /// <summary> /// Internal type. Do not use. /// </summary> public Type ImplementationType { get; } /// <summary> /// Internal type. Do not use. /// </summary> public RestEaseInterfaceImplementationAttribute(Type interfaceType, Type implementationType) { this.InterfaceType = interfaceType; this.ImplementationType = implementationType; } } }
using System; using System.Collections.Generic; using System.Text; namespace RestEase.Implementation { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class RestEaseInterfaceImplementationAttribute : Attribute { public Type InterfaceType { get; } public Type ImplementationType { get; } public RestEaseInterfaceImplementationAttribute(Type interfaceType, Type implementationType) { this.InterfaceType = interfaceType; this.ImplementationType = implementationType; } } }
mit
C#
05a225deafaccb80499e947a8d538cde13cd9478
Update Variable.cs
irtezasyed007/CSC523-Game-Project
Algorithms/Variable.cs
Algorithms/Variable.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CSC_523_Game { class Variable { private char var; private bool truthValue; public Variable(char c) { var = c; this.truthValue = true; } public Variable(char c, bool truthValue) { this.var = c; this.truthValue = truthValue; } public void setValue(bool truthValue) { this.truthValue = truthValue; } public bool getTruthValue() { return this.truthValue; } public char getVariable() { return this.var; } public void setAsComplement() { this.truthValue = !this.truthValue; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CSC_523_Game { class Variable { private char var; private bool truthValue; public Variable(char c) { var = c; this.truthValue = true; } public void setValue(bool truthValue) { this.truthValue = truthValue; } public bool getTruthValue() { return this.truthValue; } public char getVariable() { return this.var; } public void setAsComplement() { this.truthValue = !this.truthValue; } } }
mit
C#
e033947fce812513ac22cc43467134273293d117
add Force to ball on start
gin0606/BlockKuzushi
Assets/Scripts/Ball.cs
Assets/Scripts/Ball.cs
using UnityEngine; using System.Collections; public class Ball : MonoBehaviour { // Use this for initialization void Start () { this.rigidbody2D.AddForce(new Vector2(200, 200)); } // Update is called once per frame void Update () { } }
using UnityEngine; using System.Collections; public class Ball : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } }
mit
C#
8a162905b0000a3c449efce3caa2114fc8ecce7b
Update StephenOwen.cs
planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell
src/Firehose.Web/Authors/StephenOwen.cs
src/Firehose.Web/Authors/StephenOwen.cs
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class StephenOwen : IAmAMicrosoftMVP, IFilterMyBlogPosts { public string FirstName => "Stephen"; public string LastName => "Owen"; public string ShortBioOrTagLine => "FoxDeploy.SubjectMatter = writes about PowerShell"; public string StateOrRegion => "Atlanta"; public string EmailAddress => "Stephen@foxdeploy.com"; public string TwitterHandle => "FoxDeploy"; public string GitHubHandle => "1RedOne"; public GeoPosition Position => new GeoPosition(33.862100, -84.687900); public Uri WebSite => new Uri("http://www.FoxDeploy.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://foxdeploy.com/tag/powershell/feed/"); } } public string GravatarHash => "3dd39b0d646f3b959b741eb0196c4c21"; } }
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class StephenOwen : IAmAMicrosoftMVP, IFilterMyBlogPosts { public string FirstName => "Stephen"; public string LastName => "Owen"; public string ShortBioOrTagLine => "FoxDeploy.SubjectMatter = writes about PowerShell"; public string StateOrRegion => "Atlanta"; public string EmailAddress => "Stephen@foxdeploy.com"; public string TwitterHandle => "FoxDeploy"; public string GitHubHandle => "1RedOne"; public Uri WebSite => new Uri("http://www.FoxDeploy.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://foxdeploy.com/tag/powershell/feed/"); } } public string GravatarHash => "3dd39b0d646f3b959b741eb0196c4c21"; } }
mit
C#
af3fc868bdd4c616b4d486a99b9319df0167ebcd
Rename retrys token to retries
Piotrekol/StreamCompanion,Piotrekol/StreamCompanion
plugins/PlaysReplacements/PlaysReplacements.cs
plugins/PlaysReplacements/PlaysReplacements.cs
using StreamCompanionTypes.DataTypes; using StreamCompanionTypes.Enums; using StreamCompanionTypes.Interfaces; using StreamCompanionTypes.Interfaces.Sources; namespace PlaysReplacements { public class PlaysReplacements : IPlugin, ITokensSource { private int Plays, Retries; private Tokens.TokenSetter _tokenSetter; public string Description { get; } = ""; public string Name { get; } = nameof(PlaysReplacements); public string Author { get; } = "Piotrekol"; public string Url { get; } = ""; public string UpdateUrl { get; } = ""; public PlaysReplacements() { _tokenSetter = Tokens.CreateTokenSetter(Name); UpdateTokens(); } public void CreateTokens(MapSearchResult map) { //ignore replays/spect if (map.Action != OsuStatus.Playing) return; switch (map.SearchArgs.EventType) { case OsuEventType.SceneChange: case OsuEventType.MapChange: Plays++; break; case OsuEventType.PlayChange: Retries++; break; } UpdateTokens(); } private void UpdateTokens() { _tokenSetter("plays", Plays); _tokenSetter("retries", Retries); } } }
using StreamCompanionTypes.DataTypes; using StreamCompanionTypes.Enums; using StreamCompanionTypes.Interfaces; using StreamCompanionTypes.Interfaces.Sources; namespace PlaysReplacements { public class PlaysReplacements : IPlugin, ITokensSource { private int Plays, Retrys; private Tokens.TokenSetter _tokenSetter; public string Description { get; } = ""; public string Name { get; } = nameof(PlaysReplacements); public string Author { get; } = "Piotrekol"; public string Url { get; } = ""; public string UpdateUrl { get; } = ""; public PlaysReplacements() { _tokenSetter = Tokens.CreateTokenSetter(Name); UpdateTokens(); } public void CreateTokens(MapSearchResult map) { //ignore replays/spect if (map.Action != OsuStatus.Playing) return; switch (map.SearchArgs.EventType) { case OsuEventType.SceneChange: case OsuEventType.MapChange: Plays++; break; case OsuEventType.PlayChange: Retrys++; break; } UpdateTokens(); } private void UpdateTokens() { _tokenSetter("plays", Plays); _tokenSetter("retrys", Retrys); } } }
mit
C#
9bfaeaf5dec2a0586a2927a3a19494717cee53b3
Update ExchangeRateRepository.cs
tiksn/TIKSN-Framework
TIKSN.Core/Finance/ForeignExchange/Data/LiteDB/ExchangeRateRepository.cs
TIKSN.Core/Finance/ForeignExchange/Data/LiteDB/ExchangeRateRepository.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using LiteDB; using TIKSN.Data.LiteDB; namespace TIKSN.Finance.ForeignExchange.Data.LiteDB { public class ExchangeRateRepository : LiteDbRepository<ExchangeRateEntity, Guid>, IExchangeRateRepository { public ExchangeRateRepository(ILiteDbDatabaseProvider databaseProvider) : base(databaseProvider, "ExchangeRates", x => new BsonValue(x)) { } public Task<IReadOnlyCollection<ExchangeRateEntity>> SearchAsync( Guid foreignExchangeID, string baseCurrencyCode, string counterCurrencyCode, DateTimeOffset dateFrom, DateTimeOffset dateTo, CancellationToken cancellationToken) { var results = this.collection.Find(x => x.ForeignExchangeID == foreignExchangeID && x.BaseCurrencyCode == baseCurrencyCode && x.CounterCurrencyCode == counterCurrencyCode && x.AsOn >= dateFrom && x.AsOn <= dateTo); return Task.FromResult<IReadOnlyCollection<ExchangeRateEntity>>(results.ToArray()); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using LiteDB; using TIKSN.Data.LiteDB; namespace TIKSN.Finance.ForeignExchange.Data.LiteDB { public class ExchangeRateRepository : LiteDbRepository<ExchangeRateEntity, Guid>, IExchangeRateRepository { public ExchangeRateRepository(ILiteDbDatabaseProvider databaseProvider) : base(databaseProvider, "ExchangeRates", x => new BsonValue(x)) { } public Task<ExchangeRateEntity> GetOrDefaultAsync( Guid foreignExchangeID, string baseCurrencyCode, string counterCurrencyCode, DateTimeOffset asOn, CancellationToken cancellationToken) { var result = this.collection.FindOne(x => x.ForeignExchangeID == foreignExchangeID && x.BaseCurrencyCode == baseCurrencyCode && x.CounterCurrencyCode == counterCurrencyCode && x.AsOn == asOn); return Task.FromResult(result); } public Task<IReadOnlyCollection<ExchangeRateEntity>> SearchAsync( Guid foreignExchangeID, string baseCurrencyCode, string counterCurrencyCode, DateTimeOffset dateFrom, DateTimeOffset dateTo, CancellationToken cancellationToken) { var results = this.collection.Find(x => x.ForeignExchangeID == foreignExchangeID && x.BaseCurrencyCode == baseCurrencyCode && x.CounterCurrencyCode == counterCurrencyCode && x.AsOn >= dateFrom && x.AsOn <= dateTo); return Task.FromResult<IReadOnlyCollection<ExchangeRateEntity>>(results.ToArray()); } } }
mit
C#
91740a905780205b039f02b144e5fac89e9153da
Update WindowsRegistryConfigurationSource.cs
tiksn/TIKSN-Framework
TIKSN.Framework.Core/Configuration/WindowsRegistryConfigurationSource.cs
TIKSN.Framework.Core/Configuration/WindowsRegistryConfigurationSource.cs
using Microsoft.Extensions.Configuration; using Microsoft.Win32; namespace TIKSN.Configuration { public class WindowsRegistryConfigurationSource : IConfigurationSource { public RegistryView RegistryView { get; set; } public string RootKey { get; set; } public IConfigurationProvider Build(IConfigurationBuilder builder) => new WindowsRegistryConfigurationProvider(this.RootKey, this.RegistryView); } }
using Microsoft.Extensions.Configuration; using Microsoft.Win32; namespace TIKSN.Configuration { public class WindowsRegistryConfigurationSource : IConfigurationSource { public RegistryView RegistryView { get; set; } public string RootKey { get; set; } public IConfigurationProvider Build(IConfigurationBuilder builder) { return new WindowsRegistryConfigurationProvider(RootKey, RegistryView); } } }
mit
C#
902d478c3602bd0a697f4cc006e1e108e8fe772c
Solve build error
Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
using System.Collections.Generic; using Promact.Trappist.DomainModel.Models.Question; using System.Linq; using Promact.Trappist.DomainModel.DbContext; namespace Promact.Trappist.Repository.Questions { public class QuestionRepository : IQuestionRespository { private readonly TrappistDbContext _dbContext; public QuestionRepository(TrappistDbContext dbContext) { _dbContext = dbContext; } /// <summary> /// Get all questions /// </summary> /// <returns>Question list</returns> public List<SingleMultipleAnswerQuestion> GetAllQuestions() { var question = _dbContext.SingleMultipleAnswerQuestion.ToList(); return question; } /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption[] singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); foreach(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOptionElement in singleMultipleAnswerQuestionOption) { singleMultipleAnswerQuestionOptionElement.SingleMultipleAnswerQuestionID = singleMultipleAnswerQuestion.Id; _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOptionElement); } _dbContext.SaveChanges(); } } }
using System.Collections.Generic; using Promact.Trappist.DomainModel.Models.Question; using System.Linq; using Promact.Trappist.DomainModel.DbContext; namespace Promact.Trappist.Repository.Questions { public class QuestionRepository : IQuestionRespository { private readonly TrappistDbContext _dbContext; public QuestionRepository(TrappistDbContext dbContext) { _dbContext = dbContext; } /// <summary> /// Get all questions /// </summary> /// <returns>Question list</returns> public List<SingleMultipleAnswerQuestion> GetAllQuestions() { var question = _dbContext.SingleMultipleAnswerQuestion.ToList(); return question; } /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption[] singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); foreach(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOptionElement in singleMultipleAnswerQuestionOption) { singleMultipleAnswerQuestionOptionElement.SingleMultipleAnswerQuestionID = singleMultipleAnswerQuestion.Id; _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOptionElement); } _dbContext.SaveChanges(); } /// <summary> /// Add single multiple answer question into SingleMultipleAnswerQuestion model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOption); _dbContext.SaveChanges(); } /// <summary> /// Add single multiple answer question into SingleMultipleAnswerQuestion model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOption); _dbContext.SaveChanges(); } } }
mit
C#
7ac74328443d50efd42f2d8de0542eebeac8e4f0
Make MetadataResult constructor public (#727)
jskeet/google-cloud-dotnet,chrisdunelm/gcloud-dotnet,googleapis/google-cloud-dotnet,benwulfe/google-cloud-dotnet,iantalarico/google-cloud-dotnet,evildour/google-cloud-dotnet,googleapis/google-cloud-dotnet,benwulfe/google-cloud-dotnet,googleapis/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,iantalarico/google-cloud-dotnet,benwulfe/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,jskeet/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/google-cloud-dotnet,iantalarico/google-cloud-dotnet,evildour/google-cloud-dotnet,evildour/google-cloud-dotnet,jskeet/gcloud-dotnet
apis/Google.Cloud.Metadata.V1/Google.Cloud.Metadata.V1/MetadataResult.cs
apis/Google.Cloud.Metadata.V1/Google.Cloud.Metadata.V1/MetadataResult.cs
// Copyright 2016 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 Google.Cloud.Metadata.V1 { /// <summary> /// Contains the result from a get or wait-for-change operation. /// </summary> /// <seealso cref="MetadataClient.GetMetadata"/> /// <seealso cref="MetadataClient.GetMetadataAsync"/> /// <seealso cref="MetadataClient.WaitForChange"/> /// <seealso cref="MetadataClient.WaitForChangeAsync"/> public sealed class MetadataResult { /// <summary> /// Gets the ETag header from the server response. /// </summary> public string ETag { get; } /// <summary> /// Gets the content of the server response. /// </summary> public string Content { get; } /// <summary> /// Construct a result. /// </summary> /// <param name="content">The content of the server response.</param> /// <param name="eTag">The ETag header from the server response.</param> public MetadataResult(string content, string eTag) { Content = content; ETag = eTag; } } }
// Copyright 2016 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 Google.Cloud.Metadata.V1 { /// <summary> /// Contains the result from a get or wait-for-change operation. /// </summary> /// <seealso cref="MetadataClient.GetMetadata"/> /// <seealso cref="MetadataClient.GetMetadataAsync"/> /// <seealso cref="MetadataClient.WaitForChange"/> /// <seealso cref="MetadataClient.WaitForChangeAsync"/> public sealed class MetadataResult { /// <summary> /// Gets the ETag header from the server response. /// </summary> public string ETag { get; } /// <summary> /// Gets the content of the server response. /// </summary> public string Content { get; } internal MetadataResult(string content, string etag) { Content = content; ETag = etag; } } }
apache-2.0
C#
966f1f8be630bb85a4e629f8facf068dd365d35e
fix version num in assemblyinfo.cs
nberardi/SQLitePCL.raw,nberardi/SQLitePCL.raw,fluendo/SQLitePCL.raw,shiftkey/SQLitePCL.raw,fluendo/SQLitePCL.raw,AArnott/SQLitePCL.raw,loqu8/SQLitePCL.raw,PureWeen/SQLitePCL.raw,PureWeen/SQLitePCL.raw,fluendo/SQLitePCL.raw,AArnott/SQLitePCL.raw,shiftkey/SQLitePCL.raw,nberardi/SQLitePCL.raw,PureWeen/SQLitePCL.raw,matrostik/SQLitePCL.raw,AArnott/SQLitePCL.raw,loqu8/SQLitePCL.raw,matrostik/SQLitePCL.raw,couchbasedeps/SQLitePCL.raw,PureWeen/SQLitePCL.raw,loqu8/SQLitePCL.raw,AArnott/SQLitePCL.raw,ericsink/SQLitePCL.raw,nberardi/SQLitePCL.raw,loqu8/SQLitePCL.raw,shiftkey/SQLitePCL.raw,matrostik/SQLitePCL.raw,fluendo/SQLitePCL.raw,matrostik/SQLitePCL.raw,PKRoma/SQLitePCL.raw,shiftkey/SQLitePCL.raw
src/cs/AssemblyInfo.cs
src/cs/AssemblyInfo.cs
using System.Reflection; using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SQLitePCL.raw")] [assembly: AssemblyDescription("A Portable Class Library (PCL) for low-level (raw) access to SQLite")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Zumero, LLC")] [assembly: AssemblyProduct("SQLitePCL.raw")] [assembly: AssemblyCopyright("Copyright 2014 Zumero, LLC.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // 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.2.0.0")] [assembly: AssemblyFileVersion("0.2.0.0")]
using System.Reflection; using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SQLitePCL.raw")] [assembly: AssemblyDescription("A Portable Class Library (PCL) for low-level (raw) access to SQLite")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Zumero, LLC")] [assembly: AssemblyProduct("SQLitePCL.raw")] [assembly: AssemblyCopyright("Copyright 2014 Zumero, LLC.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.0.0")] [assembly: AssemblyFileVersion("0.1.0.0")]
apache-2.0
C#
c09d43cd7ed34e7129ba3dd8b2dbb9832e27a3db
remove unused actions in Values controller
MCeddy/IoT-core
IoT-Core/Controllers/ValuesController.cs
IoT-Core/Controllers/ValuesController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using IoT_Core.Models; namespace IoT_Core.Controllers { [Route("api/[controller]")] public class ValuesController : Controller { private SensorValueContext _dbContext; public ValuesController(SensorValueContext dbContext) { this._dbContext = dbContext; } // GET api/values [HttpGet] public IActionResult Get() { var results = _dbContext.SensorValues .OrderBy(sv => sv.Id) .ToList(); return Ok(results); } // GET api/values/5 [HttpGet("{id}")] public IActionResult Get(int id) { var sensorValues = _dbContext.SensorValues .FirstOrDefault(value => value.Id == id); if (sensorValues == null) { return NotFound(); } return Ok(sensorValues); } // POST api/values [HttpPost] public async Task<IActionResult> Post([FromBody]SensorValues values) { if (!ModelState.IsValid) { return BadRequest(); } _dbContext.SensorValues.Add(values); await _dbContext.SaveChangesAsync(); return CreatedAtAction("Get", values.Id); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using IoT_Core.Models; namespace IoT_Core.Controllers { [Route("api/[controller]")] public class ValuesController : Controller { private SensorValueContext _dbContext; public ValuesController(SensorValueContext dbContext) { this._dbContext = dbContext; } // GET api/values [HttpGet] public IActionResult Get() { var results = _dbContext.SensorValues .OrderBy(sv => sv.Id) .ToList(); return Ok(results); } // GET api/values/5 [HttpGet("{id}")] public IActionResult Get(int id) { var sensorValues = _dbContext.SensorValues .FirstOrDefault(value => value.Id == id); if (sensorValues == null) { return NotFound(); } return Ok(sensorValues); } // POST api/values [HttpPost] public async Task<IActionResult> Post([FromBody]SensorValues values) { if (!ModelState.IsValid) { return BadRequest(); } _dbContext.SensorValues.Add(values); await _dbContext.SaveChangesAsync(); return CreatedAtAction("Get", values.Id); } // PUT api/values/5 [HttpPut("{id}")] public IActionResult Put(int id, [FromBody]string value) { return Forbid(); } // DELETE api/values/5 [HttpDelete("{id}")] public IActionResult Delete(int id) { return Forbid(); } } }
mit
C#
ed06aeb8490a0b09caed7facbfdc3291a6a5293e
Use Fetch instead of Table
jtkech/Orchard,RoyalVeterinaryCollege/Orchard,ehe888/Orchard,phillipsj/Orchard,jtkech/Orchard,planetClaire/Orchard-LETS,dmitry-urenev/extended-orchard-cms-v10.1,emretiryaki/Orchard,sfmskywalker/Orchard,cooclsee/Orchard,omidnasri/Orchard,Praggie/Orchard,phillipsj/Orchard,smartnet-developers/Orchard,RoyalVeterinaryCollege/Orchard,cooclsee/Orchard,hhland/Orchard,Lombiq/Orchard,smartnet-developers/Orchard,grapto/Orchard.CloudBust,Dolphinsimon/Orchard,JRKelso/Orchard,kouweizhong/Orchard,luchaoshuai/Orchard,emretiryaki/Orchard,planetClaire/Orchard-LETS,grapto/Orchard.CloudBust,jimasp/Orchard,SouleDesigns/SouleDesigns.Orchard,abhishekluv/Orchard,LaserSrl/Orchard,IDeliverable/Orchard,OrchardCMS/Orchard,MetSystem/Orchard,Sylapse/Orchard.HttpAuthSample,IDeliverable/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,LaserSrl/Orchard,m2cms/Orchard,Serlead/Orchard,Ermesx/Orchard,brownjordaninternational/OrchardCMS,mgrowan/Orchard,angelapper/Orchard,OrchardCMS/Orchard-Harvest-Website,Dolphinsimon/Orchard,DonnotRain/Orchard,marcoaoteixeira/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,geertdoornbos/Orchard,johnnyqian/Orchard,NIKASoftwareDevs/Orchard,mgrowan/Orchard,omidnasri/Orchard,Dolphinsimon/Orchard,AdvantageCS/Orchard,qt1/Orchard,AndreVolksdorf/Orchard,SeyDutch/Airbrush,hbulzy/Orchard,dcinzona/Orchard-Harvest-Website,SouleDesigns/SouleDesigns.Orchard,Praggie/Orchard,spraiin/Orchard,andyshao/Orchard,sfmskywalker/Orchard,huoxudong125/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,yonglehou/Orchard,angelapper/Orchard,DonnotRain/Orchard,MetSystem/Orchard,mgrowan/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,jchenga/Orchard,tobydodds/folklife,MetSystem/Orchard,sfmskywalker/Orchard,Fogolan/OrchardForWork,infofromca/Orchard,AdvantageCS/Orchard,tobydodds/folklife,dozoft/Orchard,patricmutwiri/Orchard,gcsuk/Orchard,infofromca/Orchard,harmony7/Orchard,Serlead/Orchard,Inner89/Orchard,geertdoornbos/Orchard,jerryshi2007/Orchard,ehe888/Orchard,alejandroaldana/Orchard,kouweizhong/Orchard,AndreVolksdorf/Orchard,SeyDutch/Airbrush,sebastienros/msc,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,jersiovic/Orchard,bigfont/orchard-cms-modules-and-themes,xkproject/Orchard,dburriss/Orchard,Anton-Am/Orchard,harmony7/Orchard,yonglehou/Orchard,armanforghani/Orchard,Lombiq/Orchard,hhland/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,NIKASoftwareDevs/Orchard,DonnotRain/Orchard,abhishekluv/Orchard,patricmutwiri/Orchard,kgacova/Orchard,bedegaming-aleksej/Orchard,huoxudong125/Orchard,kgacova/Orchard,OrchardCMS/Orchard,harmony7/Orchard,Codinlab/Orchard,Sylapse/Orchard.HttpAuthSample,li0803/Orchard,huoxudong125/Orchard,fassetar/Orchard,marcoaoteixeira/Orchard,KeithRaven/Orchard,harmony7/Orchard,mvarblow/Orchard,SouleDesigns/SouleDesigns.Orchard,Codinlab/Orchard,hannan-azam/Orchard,Anton-Am/Orchard,m2cms/Orchard,li0803/Orchard,dcinzona/Orchard,vairam-svs/Orchard,openbizgit/Orchard,omidnasri/Orchard,omidnasri/Orchard,AndreVolksdorf/Orchard,planetClaire/Orchard-LETS,TalaveraTechnologySolutions/Orchard,Lombiq/Orchard,geertdoornbos/Orchard,marcoaoteixeira/Orchard,mvarblow/Orchard,qt1/Orchard,openbizgit/Orchard,arminkarimi/Orchard,openbizgit/Orchard,DonnotRain/Orchard,TaiAivaras/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,oxwanawxo/Orchard,johnnyqian/Orchard,jimasp/Orchard,fassetar/Orchard,jersiovic/Orchard,JRKelso/Orchard,NIKASoftwareDevs/Orchard,MetSystem/Orchard,OrchardCMS/Orchard,fassetar/Orchard,stormleoxia/Orchard,planetClaire/Orchard-LETS,sfmskywalker/Orchard,huoxudong125/Orchard,kouweizhong/Orchard,emretiryaki/Orchard,infofromca/Orchard,johnnyqian/Orchard,hbulzy/Orchard,vairam-svs/Orchard,hhland/Orchard,vairam-svs/Orchard,neTp9c/Orchard,omidnasri/Orchard,OrchardCMS/Orchard-Harvest-Website,Codinlab/Orchard,yonglehou/Orchard,KeithRaven/Orchard,phillipsj/Orchard,grapto/Orchard.CloudBust,johnnyqian/Orchard,TalaveraTechnologySolutions/Orchard,sfmskywalker/Orchard,bigfont/orchard-cms-modules-and-themes,hannan-azam/Orchard,xiaobudian/Orchard,escofieldnaxos/Orchard,SzymonSel/Orchard,hannan-azam/Orchard,fortunearterial/Orchard,IDeliverable/Orchard,andyshao/Orchard,Praggie/Orchard,gcsuk/Orchard,SeyDutch/Airbrush,stormleoxia/Orchard,jagraz/Orchard,openbizgit/Orchard,rtpHarry/Orchard,hannan-azam/Orchard,kouweizhong/Orchard,AndreVolksdorf/Orchard,alejandroaldana/Orchard,m2cms/Orchard,qt1/Orchard,Codinlab/Orchard,sebastienros/msc,xkproject/Orchard,MetSystem/Orchard,abhishekluv/Orchard,yonglehou/Orchard,cooclsee/Orchard,NIKASoftwareDevs/Orchard,jtkech/Orchard,jersiovic/Orchard,KeithRaven/Orchard,neTp9c/Orchard,patricmutwiri/Orchard,spraiin/Orchard,Ermesx/Orchard,oxwanawxo/Orchard,Fogolan/OrchardForWork,aaronamm/Orchard,armanforghani/Orchard,RoyalVeterinaryCollege/Orchard,dozoft/Orchard,TalaveraTechnologySolutions/Orchard,SouleDesigns/SouleDesigns.Orchard,Fogolan/OrchardForWork,rtpHarry/Orchard,Ermesx/Orchard,mvarblow/Orchard,Lombiq/Orchard,OrchardCMS/Orchard,dburriss/Orchard,mgrowan/Orchard,fortunearterial/Orchard,bedegaming-aleksej/Orchard,yonglehou/Orchard,xiaobudian/Orchard,AndreVolksdorf/Orchard,xiaobudian/Orchard,kgacova/Orchard,dcinzona/Orchard-Harvest-Website,gcsuk/Orchard,RoyalVeterinaryCollege/Orchard,Dolphinsimon/Orchard,yersans/Orchard,jchenga/Orchard,yersans/Orchard,Dolphinsimon/Orchard,Serlead/Orchard,kgacova/Orchard,jerryshi2007/Orchard,brownjordaninternational/OrchardCMS,vairam-svs/Orchard,hhland/Orchard,abhishekluv/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,smartnet-developers/Orchard,bedegaming-aleksej/Orchard,luchaoshuai/Orchard,arminkarimi/Orchard,LaserSrl/Orchard,Serlead/Orchard,andyshao/Orchard,Anton-Am/Orchard,Inner89/Orchard,SzymonSel/Orchard,mvarblow/Orchard,jersiovic/Orchard,brownjordaninternational/OrchardCMS,m2cms/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,Lombiq/Orchard,sebastienros/msc,dozoft/Orchard,luchaoshuai/Orchard,JRKelso/Orchard,SzymonSel/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,TalaveraTechnologySolutions/Orchard,SouleDesigns/SouleDesigns.Orchard,hbulzy/Orchard,spraiin/Orchard,stormleoxia/Orchard,Praggie/Orchard,Sylapse/Orchard.HttpAuthSample,escofieldnaxos/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,Praggie/Orchard,li0803/Orchard,spraiin/Orchard,bigfont/orchard-cms-modules-and-themes,bedegaming-aleksej/Orchard,dburriss/Orchard,kgacova/Orchard,omidnasri/Orchard,OrchardCMS/Orchard-Harvest-Website,stormleoxia/Orchard,armanforghani/Orchard,bigfont/orchard-cms-modules-and-themes,jerryshi2007/Orchard,emretiryaki/Orchard,mvarblow/Orchard,dburriss/Orchard,aaronamm/Orchard,JRKelso/Orchard,patricmutwiri/Orchard,AdvantageCS/Orchard,dcinzona/Orchard,fortunearterial/Orchard,dcinzona/Orchard,jerryshi2007/Orchard,planetClaire/Orchard-LETS,JRKelso/Orchard,geertdoornbos/Orchard,smartnet-developers/Orchard,hbulzy/Orchard,fassetar/Orchard,xiaobudian/Orchard,xkproject/Orchard,abhishekluv/Orchard,LaserSrl/Orchard,angelapper/Orchard,Inner89/Orchard,marcoaoteixeira/Orchard,Ermesx/Orchard,omidnasri/Orchard,Inner89/Orchard,enspiral-dev-academy/Orchard,brownjordaninternational/OrchardCMS,yersans/Orchard,neTp9c/Orchard,openbizgit/Orchard,oxwanawxo/Orchard,KeithRaven/Orchard,geertdoornbos/Orchard,enspiral-dev-academy/Orchard,escofieldnaxos/Orchard,TaiAivaras/Orchard,hbulzy/Orchard,cooclsee/Orchard,jimasp/Orchard,smartnet-developers/Orchard,phillipsj/Orchard,aaronamm/Orchard,RoyalVeterinaryCollege/Orchard,escofieldnaxos/Orchard,stormleoxia/Orchard,TaiAivaras/Orchard,jersiovic/Orchard,ehe888/Orchard,TalaveraTechnologySolutions/Orchard,neTp9c/Orchard,SzymonSel/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,armanforghani/Orchard,enspiral-dev-academy/Orchard,sebastienros/msc,tobydodds/folklife,enspiral-dev-academy/Orchard,luchaoshuai/Orchard,dburriss/Orchard,Sylapse/Orchard.HttpAuthSample,arminkarimi/Orchard,SeyDutch/Airbrush,hannan-azam/Orchard,LaserSrl/Orchard,aaronamm/Orchard,mgrowan/Orchard,andyshao/Orchard,ehe888/Orchard,TalaveraTechnologySolutions/Orchard,arminkarimi/Orchard,jerryshi2007/Orchard,grapto/Orchard.CloudBust,luchaoshuai/Orchard,jimasp/Orchard,rtpHarry/Orchard,OrchardCMS/Orchard-Harvest-Website,armanforghani/Orchard,angelapper/Orchard,cooclsee/Orchard,dcinzona/Orchard,omidnasri/Orchard,IDeliverable/Orchard,li0803/Orchard,andyshao/Orchard,infofromca/Orchard,hhland/Orchard,Fogolan/OrchardForWork,DonnotRain/Orchard,oxwanawxo/Orchard,jchenga/Orchard,omidnasri/Orchard,qt1/Orchard,ehe888/Orchard,aaronamm/Orchard,SeyDutch/Airbrush,huoxudong125/Orchard,jtkech/Orchard,xkproject/Orchard,tobydodds/folklife,fortunearterial/Orchard,Serlead/Orchard,jchenga/Orchard,jimasp/Orchard,abhishekluv/Orchard,jagraz/Orchard,kouweizhong/Orchard,jagraz/Orchard,johnnyqian/Orchard,bigfont/orchard-cms-modules-and-themes,alejandroaldana/Orchard,SzymonSel/Orchard,fassetar/Orchard,sfmskywalker/Orchard,AdvantageCS/Orchard,Ermesx/Orchard,spraiin/Orchard,neTp9c/Orchard,arminkarimi/Orchard,brownjordaninternational/OrchardCMS,gcsuk/Orchard,sfmskywalker/Orchard,angelapper/Orchard,Fogolan/OrchardForWork,oxwanawxo/Orchard,sfmskywalker/Orchard,alejandroaldana/Orchard,infofromca/Orchard,yersans/Orchard,dcinzona/Orchard-Harvest-Website,NIKASoftwareDevs/Orchard,TaiAivaras/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,grapto/Orchard.CloudBust,dcinzona/Orchard-Harvest-Website,jtkech/Orchard,fortunearterial/Orchard,dcinzona/Orchard,qt1/Orchard,enspiral-dev-academy/Orchard,jchenga/Orchard,AdvantageCS/Orchard,dozoft/Orchard,IDeliverable/Orchard,tobydodds/folklife,marcoaoteixeira/Orchard,OrchardCMS/Orchard,KeithRaven/Orchard,phillipsj/Orchard,jagraz/Orchard,alejandroaldana/Orchard,patricmutwiri/Orchard,OrchardCMS/Orchard-Harvest-Website,vairam-svs/Orchard,emretiryaki/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,TalaveraTechnologySolutions/Orchard,tobydodds/folklife,OrchardCMS/Orchard-Harvest-Website,dcinzona/Orchard-Harvest-Website,Inner89/Orchard,jagraz/Orchard,sebastienros/msc,TaiAivaras/Orchard,li0803/Orchard,harmony7/Orchard,dcinzona/Orchard-Harvest-Website,bedegaming-aleksej/Orchard,Anton-Am/Orchard,grapto/Orchard.CloudBust,dozoft/Orchard,Codinlab/Orchard,Sylapse/Orchard.HttpAuthSample,m2cms/Orchard,TalaveraTechnologySolutions/Orchard,gcsuk/Orchard,rtpHarry/Orchard,yersans/Orchard,xiaobudian/Orchard,escofieldnaxos/Orchard,Anton-Am/Orchard,xkproject/Orchard,rtpHarry/Orchard
src/Orchard.Web/Modules/Orchard.Indexing/Services/IndexingTaskManager.cs
src/Orchard.Web/Modules/Orchard.Indexing/Services/IndexingTaskManager.cs
using System; using System.Linq; using JetBrains.Annotations; using Orchard.ContentManagement; using Orchard.Data; using Orchard.Indexing.Models; using Orchard.Logging; using Orchard.Tasks.Indexing; using Orchard.Services; namespace Orchard.Indexing.Services { [UsedImplicitly] public class IndexingTaskManager : IIndexingTaskManager { private readonly IRepository<IndexingTaskRecord> _repository; private readonly IClock _clock; public IndexingTaskManager( IContentManager contentManager, IRepository<IndexingTaskRecord> repository, IClock clock) { _clock = clock; _repository = repository; Logger = NullLogger.Instance; } public ILogger Logger { get; set; } private void CreateTask(ContentItem contentItem, int action) { if (contentItem == null) { throw new ArgumentNullException("contentItem"); } if (contentItem.Record == null) { // ignore that case, when Update is called on a content item which has not be "created" yet return; } foreach (var task in _repository.Fetch(task => task.ContentItemRecord == contentItem.Record)) { _repository.Delete(task); } var taskRecord = new IndexingTaskRecord { CreatedUtc = _clock.UtcNow, ContentItemRecord = contentItem.Record, Action = action }; _repository.Create(taskRecord); } public void CreateUpdateIndexTask(ContentItem contentItem) { CreateTask(contentItem, IndexingTaskRecord.Update); Logger.Information("Indexing task created for [{0}:{1}]", contentItem.ContentType, contentItem.Id); } public void CreateDeleteIndexTask(ContentItem contentItem) { CreateTask(contentItem, IndexingTaskRecord.Delete); Logger.Information("Deleting index task created for [{0}:{1}]", contentItem.ContentType, contentItem.Id); } } }
using System; using System.Linq; using JetBrains.Annotations; using Orchard.ContentManagement; using Orchard.Data; using Orchard.Indexing.Models; using Orchard.Logging; using Orchard.Tasks.Indexing; using Orchard.Services; namespace Orchard.Indexing.Services { [UsedImplicitly] public class IndexingTaskManager : IIndexingTaskManager { private readonly IRepository<IndexingTaskRecord> _repository; private readonly IClock _clock; public IndexingTaskManager( IContentManager contentManager, IRepository<IndexingTaskRecord> repository, IClock clock) { _clock = clock; _repository = repository; Logger = NullLogger.Instance; } public ILogger Logger { get; set; } private void CreateTask(ContentItem contentItem, int action) { if (contentItem == null) { throw new ArgumentNullException("contentItem"); } if (contentItem.Record == null) { // ignore that case, when Update is called on a content item which has not be "created" yet return; } foreach (var task in _repository.Table.Where(task => task.ContentItemRecord == contentItem.Record)) { _repository.Delete(task); } var taskRecord = new IndexingTaskRecord { CreatedUtc = _clock.UtcNow, ContentItemRecord = contentItem.Record, Action = action }; _repository.Create(taskRecord); } public void CreateUpdateIndexTask(ContentItem contentItem) { CreateTask(contentItem, IndexingTaskRecord.Update); Logger.Information("Indexing task created for [{0}:{1}]", contentItem.ContentType, contentItem.Id); } public void CreateDeleteIndexTask(ContentItem contentItem) { CreateTask(contentItem, IndexingTaskRecord.Delete); Logger.Information("Deleting index task created for [{0}:{1}]", contentItem.ContentType, contentItem.Id); } } }
bsd-3-clause
C#
4c620c4eeb5dada19f57bc0f92dd65bb250d1b06
Update Program.cs
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
Battery-Commander.Web/Program.cs
Battery-Commander.Web/Program.cs
using Microsoft.AspNetCore.Hosting; using Sentry; using Serilog; using System.IO; namespace BatteryCommander.Web { public class Program { public static void Main(string[] args) { using (SentrySdk.Init("https://78e464f7456f49a98e500e78b0bb4b13@sentry.io/1447369")) { var host = new WebHostBuilder() .UseApplicationInsights() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup<Startup>() .UseSentry() .UseSerilog((h, context) => { context .Enrich.FromLogContext() .WriteTo.Sentry(); }) .Build(); host.Run(); } } } }
using Microsoft.AspNetCore.Hosting; using Sentry; using Serilog; using System.IO; namespace BatteryCommander.Web { public class Program { public static void Main(string[] args) { using (SentrySdk.Init()) { var host = new WebHostBuilder() .UseApplicationInsights() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup<Startup>() .UseSentry() .UseSerilog((h, context) => { context .Enrich.FromLogContext() .WriteTo.Sentry(); }) .Build(); host.Run(); } } } }
mit
C#
1ed0dba16b92f5d45673428ccbc54eda6f99986c
Revert accidental change of the async flag.
oliver-feng/nuget,indsoft/NuGet2,antiufo/NuGet2,jholovacs/NuGet,anurse/NuGet,rikoe/nuget,indsoft/NuGet2,xoofx/NuGet,rikoe/nuget,RichiCoder1/nuget-chocolatey,ctaggart/nuget,mrward/NuGet.V2,zskullz/nuget,akrisiun/NuGet,indsoft/NuGet2,jmezach/NuGet2,alluran/node.net,chester89/nugetApi,chocolatey/nuget-chocolatey,mrward/NuGet.V2,dolkensp/node.net,xoofx/NuGet,dolkensp/node.net,dolkensp/node.net,oliver-feng/nuget,zskullz/nuget,jmezach/NuGet2,jholovacs/NuGet,mono/nuget,oliver-feng/nuget,atheken/nuget,mrward/nuget,jmezach/NuGet2,alluran/node.net,pratikkagda/nuget,jmezach/NuGet2,xoofx/NuGet,ctaggart/nuget,rikoe/nuget,jholovacs/NuGet,jholovacs/NuGet,OneGet/nuget,themotleyfool/NuGet,OneGet/nuget,oliver-feng/nuget,jholovacs/NuGet,mrward/nuget,rikoe/nuget,mrward/NuGet.V2,RichiCoder1/nuget-chocolatey,ctaggart/nuget,RichiCoder1/nuget-chocolatey,OneGet/nuget,antiufo/NuGet2,themotleyfool/NuGet,mrward/NuGet.V2,anurse/NuGet,GearedToWar/NuGet2,GearedToWar/NuGet2,chocolatey/nuget-chocolatey,pratikkagda/nuget,ctaggart/nuget,pratikkagda/nuget,oliver-feng/nuget,zskullz/nuget,dolkensp/node.net,jmezach/NuGet2,mrward/NuGet.V2,antiufo/NuGet2,chocolatey/nuget-chocolatey,mrward/nuget,zskullz/nuget,indsoft/NuGet2,chester89/nugetApi,atheken/nuget,pratikkagda/nuget,xoofx/NuGet,antiufo/NuGet2,indsoft/NuGet2,mono/nuget,mono/nuget,OneGet/nuget,jmezach/NuGet2,akrisiun/NuGet,GearedToWar/NuGet2,chocolatey/nuget-chocolatey,antiufo/NuGet2,GearedToWar/NuGet2,pratikkagda/nuget,mrward/nuget,alluran/node.net,GearedToWar/NuGet2,pratikkagda/nuget,mono/nuget,RichiCoder1/nuget-chocolatey,GearedToWar/NuGet2,themotleyfool/NuGet,antiufo/NuGet2,oliver-feng/nuget,alluran/node.net,kumavis/NuGet,kumavis/NuGet,RichiCoder1/nuget-chocolatey,RichiCoder1/nuget-chocolatey,chocolatey/nuget-chocolatey,xero-github/Nuget,chocolatey/nuget-chocolatey,xoofx/NuGet,xoofx/NuGet,jholovacs/NuGet,indsoft/NuGet2,mrward/nuget,mrward/NuGet.V2,mrward/nuget
src/VsConsole/Console/PowerConsole/HostInfo.cs
src/VsConsole/Console/PowerConsole/HostInfo.cs
using System; using System.Diagnostics; namespace NuGetConsole.Implementation.PowerConsole { /// <summary> /// Represents a host with extra info. /// </summary> class HostInfo : ObjectWithFactory<PowerConsoleWindow> { Lazy<IHostProvider, IHostMetadata> HostProvider { get; set; } public HostInfo(PowerConsoleWindow factory, Lazy<IHostProvider, IHostMetadata> hostProvider) : base(factory) { UtilityMethods.ThrowIfArgumentNull(hostProvider); this.HostProvider = hostProvider; } /// <summary> /// Get the HostName attribute value of this host. /// </summary> public string HostName { get { return HostProvider.Metadata.HostName; } } IWpfConsole _wpfConsole; /// <summary> /// Get/create the console for this host. If not already created, this /// actually creates the (console, host) pair. /// /// Note: Creating the console is handled by this package and mostly will /// succeed. However, creating the host could be from other packages and /// fail. In that case, this console is already created and can be used /// subsequently in limited ways, such as displaying an error message. /// </summary> public IWpfConsole WpfConsole { get { if (_wpfConsole == null) { _wpfConsole = Factory.WpfConsoleService.CreateConsole( Factory.ServiceProvider, PowerConsoleWindow.ContentType, HostName); _wpfConsole.Host = HostProvider.Value.CreateHost(_wpfConsole, @async: true); } return _wpfConsole; } } } }
using System; using System.Diagnostics; namespace NuGetConsole.Implementation.PowerConsole { /// <summary> /// Represents a host with extra info. /// </summary> class HostInfo : ObjectWithFactory<PowerConsoleWindow> { Lazy<IHostProvider, IHostMetadata> HostProvider { get; set; } public HostInfo(PowerConsoleWindow factory, Lazy<IHostProvider, IHostMetadata> hostProvider) : base(factory) { UtilityMethods.ThrowIfArgumentNull(hostProvider); this.HostProvider = hostProvider; } /// <summary> /// Get the HostName attribute value of this host. /// </summary> public string HostName { get { return HostProvider.Metadata.HostName; } } IWpfConsole _wpfConsole; /// <summary> /// Get/create the console for this host. If not already created, this /// actually creates the (console, host) pair. /// /// Note: Creating the console is handled by this package and mostly will /// succeed. However, creating the host could be from other packages and /// fail. In that case, this console is already created and can be used /// subsequently in limited ways, such as displaying an error message. /// </summary> public IWpfConsole WpfConsole { get { if (_wpfConsole == null) { _wpfConsole = Factory.WpfConsoleService.CreateConsole( Factory.ServiceProvider, PowerConsoleWindow.ContentType, HostName); _wpfConsole.Host = HostProvider.Value.CreateHost(_wpfConsole, @async: false); } return _wpfConsole; } } } }
apache-2.0
C#
b1f67c77535c378be7f1db57748fc40bce20b995
Fix for word search exercise (#624)
exercism/xcsharp,ErikSchierboom/xcsharp,ErikSchierboom/xcsharp,robkeim/xcsharp,exercism/xcsharp,robkeim/xcsharp
exercises/word-search/WordSearch.cs
exercises/word-search/WordSearch.cs
using System; using System.Collections.Generic; using System.Linq; public class WordSearch { public WordSearch(string grid) { throw new NotImplementedException("You need to implement this function."); } public Dictionary<string, ((int, int), (int, int))?> Search(string[] wordsToSearchFor) { throw new NotImplementedException("You need to implement this function."); } }
using System; using System.Collections.Generic; using System.Linq; public class WordSearch { public WordSearch(string grid) { throw new NotImplementedException("You need to implement this function."); } public ((int, int), (int, int)) Search(string wordsToSearchFor) { throw new NotImplementedException("You need to implement this function."); } }
mit
C#
b652e213544faead47b89f6c47fdd14b31462200
Add a method
stampsy/sdwebimage-monotouch
ApiDefinition.cs
ApiDefinition.cs
using System; using System.Drawing; using MonoTouch.ObjCRuntime; using MonoTouch.Foundation; using MonoTouch.UIKit; namespace SDWebImage { [BaseType (typeof (UIView))] [Model] interface SDWebImageManagerDelegate { [Export ("webImageManager:didProgressWithPartialImage:forURL:userInfo:")] void DidProgressWithPartialImage (SDWebImageManager imageManager, UIImage image, NSUrl url, NSDictionary info); [Export ("webImageManager:didProgressWithPartialImage:forURL:")] void DidProgressWithPartialImage (SDWebImageManager imageManager, UIImage image, NSUrl url); [Export ("webImageManager:didFinishWithImage:forURL:userInfo:")] void DidFinishWithImage (SDWebImageManager imageManager, UIImage image, NSUrl url, NSDictionary info); [Export ("webImageManager:didFinishWithImage:forURL:")] void DidFinishWithImage (SDWebImageManager imageManager, UIImage image, NSUrl url); [Export ("webImageManager:didFinishWithImage:")] void DidFinishWithImage (SDWebImageManager imageManager, UIImage image); [Export ("webImageManager:didFailWithError:forURL:userInfo:")] void DidFailWithError (SDWebImageManager imageManager, NSError error, NSUrl url, NSDictionary info); [Export ("webImageManager:didFailWithError:forURL:")] void DidFailWithError (SDWebImageManager imageManager, NSError error, NSUrl url); [Export ("webImageManager:didFailWithError:")] void DidFailWithError (SDWebImageManager imageManager, NSError error); } public delegate void SDWebImageSuccessBlock (UIImage image, bool cached); public delegate void SDWebImageFailureBlock (NSError error); [BaseType (typeof (NSObject))] interface SDWebImageManager { [Static, Export ("sharedManager")] SDWebImageManager SharedManager { get; } [Export ("cancelForDelegate:")] void CancelForDelegate (NSObject del); [Bind ("setImageWithURL:")] void SetImage ([Target] UIImageView view, NSUrl url); [Bind ("setImageWithURL:")] void SetImage ([Target] UIButton view, NSUrl url); [Bind ("setBackgroundImageWithURL:")] void SetBackgroundImage ([Target] UIButton view, NSUrl url); [Export ("downloadWithURL:delegate:options:")] void Download (NSUrl url, NSObject del, SDWebImageOptions options); [Export ("downloadWithURL:delegate:options:success:failure:")] void Download (NSUrl url, [NullAllowed]NSObject del, SDWebImageOptions options, SDWebImageSuccessBlock success, SDWebImageFailureBlock failure); } [BaseType (typeof (NSObject))] interface SDImageCache { [Static, Export ("sharedImageCache")] SDImageCache SharedImageCache { get; } [Static, Export ("setMaxCacheAge:")] void SetMaxCacheAge (int age); [Export ("storeImage:forKey:")] void StoreImage (UIImage image, string key); [Export ("imageFromKey:fromDisk:")] UIImage GetImage (string key, bool fromDisk); } }
using System; using System.Drawing; using MonoTouch.ObjCRuntime; using MonoTouch.Foundation; using MonoTouch.UIKit; namespace SDWebImage { [BaseType (typeof (UIView))] [Model] interface SDWebImageManagerDelegate { [Export ("webImageManager:didProgressWithPartialImage:forURL:userInfo:")] void DidProgressWithPartialImage (SDWebImageManager imageManager, UIImage image, NSUrl url, NSDictionary info); [Export ("webImageManager:didProgressWithPartialImage:forURL:")] void DidProgressWithPartialImage (SDWebImageManager imageManager, UIImage image, NSUrl url); [Export ("webImageManager:didFinishWithImage:forURL:userInfo:")] void DidFinishWithImage (SDWebImageManager imageManager, UIImage image, NSUrl url, NSDictionary info); [Export ("webImageManager:didFinishWithImage:forURL:")] void DidFinishWithImage (SDWebImageManager imageManager, UIImage image, NSUrl url); [Export ("webImageManager:didFinishWithImage:")] void DidFinishWithImage (SDWebImageManager imageManager, UIImage image); [Export ("webImageManager:didFailWithError:forURL:userInfo:")] void DidFailWithError (SDWebImageManager imageManager, NSError error, NSUrl url, NSDictionary info); [Export ("webImageManager:didFailWithError:forURL:")] void DidFailWithError (SDWebImageManager imageManager, NSError error, NSUrl url); [Export ("webImageManager:didFailWithError:")] void DidFailWithError (SDWebImageManager imageManager, NSError error); } public delegate void SDWebImageSuccessBlock (UIImage image, bool cached); public delegate void SDWebImageFailureBlock (NSError error); [BaseType (typeof (NSObject))] interface SDWebImageManager { [Static, Export ("sharedManager")] SDWebImageManager SharedManager { get; } [Export ("cancelForDelegate:")] void CancelForDelegate (NSObject del); [Bind ("setImageWithURL:")] void SetImage ([Target] UIImageView view, NSUrl url); [Bind ("setImageWithURL:")] void SetImage ([Target] UIButton view, NSUrl url); [Bind ("setBackgroundImageWithURL:")] void SetBackgroundImage ([Target] UIButton view, NSUrl url); [Export ("downloadWithURL:delegate:options:")] void Download (NSUrl url, NSObject del, SDWebImageOptions options); [Export ("downloadWithURL:delegate:options:success:failure:")] void Download (NSUrl url, [NullAllowed]NSObject del, SDWebImageOptions options, SDWebImageSuccessBlock success, SDWebImageFailureBlock failure); } [BaseType (typeof (NSObject))] interface SDImageCache { [Static, Export ("sharedImageCache")] SDImageCache SharedImageCache { get; } [Static, Export ("setMaxCacheAge:")] void SetMaxCacheAge (int age); [Export ("storeImage:forKey:")] void StoreImage (UIImage image, string key); } }
mit
C#
54612b02ca25b9df540960acfc7db0b5212a12f1
Advance version number scheme to include pressure regulator gadget.
massimo-nocentini/network-reasoner,massimo-nocentini/network-reasoner,massimo-nocentini/network-reasoner
it.unifi.dsi.stlab.networkreasoner.gas.system.terranova/VersioningInfo.cs
it.unifi.dsi.stlab.networkreasoner.gas.system.terranova/VersioningInfo.cs
using System; namespace it.unifi.dsi.stlab.networkreasoner.gas.system.terranova { public class VersioningInfo { /// <summary> /// Gets the version number. /// /// Here are the stack of versions with a brief description: /// /// v1.1.0: introduce pressure regulator gadget for edges. /// /// v1.0.1: enhancement to tackle turbolent behavior due to /// Reynolds number. /// /// v1.0.0: basic version with checker about negative pressures /// associated to nodes with load gadget. /// /// </summary> /// <value>The version number.</value> public String VersionNumber { get { return "v1.1.0"; } } public String EngineIdentifier { get { return "Network Reasoner, stlab.dsi.unifi.it"; } } } }
using System; namespace it.unifi.dsi.stlab.networkreasoner.gas.system.terranova { public class VersioningInfo { public String VersionNumber { get { return "v1.0.1"; } } public String EngineIdentifier { get { return "Network Reasoner, stlab.dsi.unifi.it"; } } } }
mit
C#
76b6316a51b1db69dfe3b413db172a585306278d
Remove unused usings
appharbor/appharbor-cli
src/AppHarbor.Tests/Commands/CreateCommandTest.cs
src/AppHarbor.Tests/Commands/CreateCommandTest.cs
using System.Linq; using AppHarbor.Commands; using Moq; using Ploeh.AutoFixture.Xunit; using Xunit; using Xunit.Extensions; namespace AppHarbor.Tests.Commands { public class CreateCommandTest { [Theory, AutoCommandData] public void ShouldThrowWhenNoArguments(CreateCommand command) { var exception = Assert.Throws<CommandException>(() => command.Execute(new string[0])); Assert.Equal("An application name must be provided to create an application", exception.Message); } [Theory, AutoCommandData] public void ShouldCreateApplicationWithOnlyName([Frozen]Mock<IAppHarborClient> client, CreateCommand command) { var arguments = new string[] { "foo" }; VerifyArguments(client, command, arguments); } [Theory, AutoCommandData] public void ShouldCreateApplicationWithRegion([Frozen]Mock<IAppHarborClient> client, CreateCommand command, string[] arguments) { VerifyArguments(client, command, arguments); } private static void VerifyArguments(Mock<IAppHarborClient> client, CreateCommand command, string[] arguments) { command.Execute(arguments); client.Verify(x => x.CreateApplication(arguments.First(), arguments.Skip(1).FirstOrDefault()), Times.Once()); } } }
using System; using System.Collections.Generic; using System.Linq; using AppHarbor.Commands; using Moq; using Ploeh.AutoFixture; using Ploeh.AutoFixture.Xunit; using Xunit; using Xunit.Extensions; namespace AppHarbor.Tests.Commands { public class CreateCommandTest { [Theory, AutoCommandData] public void ShouldThrowWhenNoArguments(CreateCommand command) { var exception = Assert.Throws<CommandException>(() => command.Execute(new string[0])); Assert.Equal("An application name must be provided to create an application", exception.Message); } [Theory, AutoCommandData] public void ShouldCreateApplicationWithOnlyName([Frozen]Mock<IAppHarborClient> client, CreateCommand command) { var arguments = new string[] { "foo" }; VerifyArguments(client, command, arguments); } [Theory, AutoCommandData] public void ShouldCreateApplicationWithRegion([Frozen]Mock<IAppHarborClient> client, CreateCommand command, string[] arguments) { VerifyArguments(client, command, arguments); } private static void VerifyArguments(Mock<IAppHarborClient> client, CreateCommand command, string[] arguments) { command.Execute(arguments); client.Verify(x => x.CreateApplication(arguments.First(), arguments.Skip(1).FirstOrDefault()), Times.Once()); } } }
mit
C#
a8499bda128e38b609ce7d02b6b135d9bd0ca9a1
move config attribute to assemblyinfos
dkackman/LinqStatistics
src/PackageInfo.cs
src/PackageInfo.cs
// // PackageInfo.cs // AssemblyInfo shared between projects // using System; using System.Resources; using System.Reflection; // 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: AssemblyDescription("Extensions that add simple statistical methods")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LinqStatistics")] [assembly: AssemblyCopyright("Copyright © Don Kackman 2009, 2013, 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.1.0.0")] [assembly: AssemblyFileVersion("2.1.0.0")] [assembly: CLSCompliant(true)]
// // PackageInfo.cs // AssemblyInfo shared between projects // using System; using System.Resources; using System.Reflection; // 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: AssemblyDescription("Extensions that add simple statistical methods")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LinqStatistics")] [assembly: AssemblyCopyright("Copyright © Don Kackman 2009, 2013, 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.1.0.0")] [assembly: AssemblyFileVersion("2.1.0.0")] [assembly: CLSCompliant(true)]
apache-2.0
C#
6d206370da6ee4e7219bf7f400bdccdd38372048
Replace Single with SingleOrDefault for Url Reposiory
jimbeaudoin/dotnet-core-urlshortener,jimbeaudoin/dotnet-core-urlshortener,jimbeaudoin/dotnet-core-urlshortener
src/UrlShortenerApi/Repositories/UrlRepository.cs
src/UrlShortenerApi/Repositories/UrlRepository.cs
using System; using System.Collections.Generic; using System.Linq; using UrlShortenerApi.Data; using UrlShortenerApi.Models; namespace UrlShortenerApi.Repositories { public class UrlRepository : IUrlRepository { ApplicationDbContext _context; public UrlRepository(ApplicationDbContext context) { _context = context; } public void Add(Url item) { item.ShortFormat = UrlShortenerLib.Shortener.GenerateShortFormat(6); item.CreationDate = DateTime.Now; _context.Urls.Add(item); _context.SaveChanges(); } public IEnumerable<Url> GetAll() { return _context.Urls.ToList(); } public Url Find(int id) { return _context.Urls.SingleOrDefault(m => m.ID == id); } public Url Find(string shortFormat) { return _context.Urls.SingleOrDefault(m => m.ShortFormat == shortFormat); } public void Remove(int id) { var student = _context.Urls.Single(m => m.ID == id); if (student != null) { _context.Urls.Remove(student); } } public void Update(Url item) { _context.Update(item); } } }
using System; using System.Collections.Generic; using System.Linq; using UrlShortenerApi.Data; using UrlShortenerApi.Models; namespace UrlShortenerApi.Repositories { public class UrlRepository : IUrlRepository { ApplicationDbContext _context; public UrlRepository(ApplicationDbContext context) { _context = context; } public void Add(Url item) { item.ShortFormat = UrlShortenerLib.Shortener.GenerateShortFormat(6); item.CreationDate = DateTime.Now; _context.Urls.Add(item); _context.SaveChanges(); } public IEnumerable<Url> GetAll() { return _context.Urls.ToList(); } public Url Find(int id) { return _context.Urls.Single(m => m.ID == id); } public Url Find(string shortFormat) { return _context.Urls.Single(m => m.ShortFormat == shortFormat); } public void Remove(int id) { var student = _context.Urls.Single(m => m.ID == id); if (student != null) { _context.Urls.Remove(student); } } public void Update(Url item) { _context.Update(item); } } }
agpl-3.0
C#
839926cd2620cfb49f63b20505a409787cb46ddb
Set MaxBufferSize in Server class to max.
ideaflare/embark,ubrgw/embark
Embark/Server.cs
Embark/Server.cs
using System; using System.ServiceModel.Web; using Embark.Storage; using Embark.DataChannel; using Embark.TextConversion; using System.Linq; namespace Embark { /// <summary> /// Server that shares a local database hosted over WCF HTTP /// </summary> public sealed class Server : IDisposable { /// <summary> /// Host a new network server /// </summary> /// <param name="directory">Path server will save data to /// <para>Example: @"C:\MyTemp\Embark\Server\"</para></param> /// <param name="port">port to use, default set to 8030</param> /// <param name="textConverter">Custom converter between objects and text. /// <para>If parameter is NULL, the textConverter is set to default json converter.</para> /// </param> public Server(string directory, int port = 8030, ITextConverter textConverter = null) { if (textConverter == null) textConverter = new JavascriptSerializerTextConverter(); var store = new DiskDataStore(directory); var textRepository = new LocalRepository(store, textConverter); Uri url = new Uri("http://localhost:" + port + "/embark/"); webHost = new WebServiceHost(textRepository, url); } private WebServiceHost webHost; /// <summary> /// Open the server web host /// </summary> public void Start() { webHost.Opening += ConfigureEnpointBinding; webHost.Open(); } private void ConfigureEnpointBinding(object sender, EventArgs e) { var endpointBinding = (System.ServiceModel.WebHttpBinding) ((WebServiceHost)sender) .Description .Endpoints .Single(endpoint => endpoint.Contract.ContractType == typeof(ITextRepository)) .Binding; endpointBinding.MaxReceivedMessageSize = int.MaxValue; endpointBinding.MaxBufferSize = int.MaxValue; } /// <summary> /// Close the server web host /// </summary> public void Stop() => webHost.Close(); /// <summary> /// Dispose the web host /// </summary> public void Dispose() => ((IDisposable)webHost)?.Dispose(); } }
using System; using System.ServiceModel.Web; using Embark.Storage; using Embark.DataChannel; using Embark.TextConversion; using System.Linq; namespace Embark { /// <summary> /// Server that shares a local database hosted over WCF HTTP /// </summary> public sealed class Server : IDisposable { /// <summary> /// Host a new network server /// </summary> /// <param name="directory">Path server will save data to /// <para>Example: @"C:\MyTemp\Embark\Server\"</para></param> /// <param name="port">port to use, default set to 8030</param> /// <param name="textConverter">Custom converter between objects and text. /// <para>If parameter is NULL, the textConverter is set to default json converter.</para> /// </param> public Server(string directory, int port = 8030, ITextConverter textConverter = null) { if (textConverter == null) textConverter = new JavascriptSerializerTextConverter(); var store = new DiskDataStore(directory); var textRepository = new LocalRepository(store, textConverter); Uri url = new Uri("http://localhost:" + port + "/embark/"); webHost = new WebServiceHost(textRepository, url); } private WebServiceHost webHost; /// <summary> /// Open the server web host /// </summary> public void Start() { webHost.Opening += ConfigureEnpointBinding; webHost.Open(); } private void ConfigureEnpointBinding(object sender, EventArgs e) { var endpointBinding = (System.ServiceModel.WebHttpBinding) ((WebServiceHost)sender) .Description .Endpoints .Single(endpoint => endpoint.Contract.ContractType == typeof(ITextRepository)) .Binding; endpointBinding.MaxReceivedMessageSize = int.MaxValue; } /// <summary> /// Close the server web host /// </summary> public void Stop() => webHost.Close(); /// <summary> /// Dispose the web host /// </summary> public void Dispose() => ((IDisposable)webHost)?.Dispose(); } }
mit
C#
e5e052070689e5da734ebaffcf030a7df216e125
Fix TextAreaPart not using submitted form value (#4218)
OrchardCMS/Brochard,OrchardCMS/Brochard,stevetayloruk/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,petedavis/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,xkproject/Orchard2,petedavis/Orchard2,stevetayloruk/Orchard2,petedavis/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,OrchardCMS/Brochard,xkproject/Orchard2,petedavis/Orchard2
src/OrchardCore.Modules/OrchardCore.Forms/Views/Items/TextAreaPart.cshtml
src/OrchardCore.Modules/OrchardCore.Forms/Views/Items/TextAreaPart.cshtml
@using OrchardCore.Forms.Models @model ShapeViewModel<TextAreaPart> @{ var formElementPart = Model.Value.ContentItem.As<FormElementPart>(); var formInputElementPart = Model.Value.ContentItem.As<FormInputElementPart>(); var elementId = formElementPart.Id; var elementName = formInputElementPart.Name; var id = !string.IsNullOrEmpty(elementId) ? elementId : !string.IsNullOrEmpty(elementName) ? Html.GenerateIdFromName(elementName) : default(string); var fieldValue = ViewData.ModelState.ContainsKey(elementName) ? ViewData.ModelState[elementName].AttemptedValue : Model.Value.DefaultValue?.Trim(); } <textarea id="@id" name="@elementName" class="form-control" placeholder="@Model.Value.Placeholder">@fieldValue</textarea>
@using OrchardCore.Forms.Models @model ShapeViewModel<TextAreaPart> @{ var formElementPart = Model.Value.ContentItem.As<FormElementPart>(); var formInputElementPart = Model.Value.ContentItem.As<FormInputElementPart>(); var elementId = formElementPart.Id; var elementName = formInputElementPart.Name; var id = !string.IsNullOrEmpty(elementId) ? elementId : !string.IsNullOrEmpty(elementName) ? Html.GenerateIdFromName(elementName) : default(string); } <textarea id="@id" name="@elementName" class="form-control" placeholder="@Model.Value.Placeholder">@Model.Value.DefaultValue?.Trim()</textarea>
bsd-3-clause
C#
f3183327bf23d728f60f1d70bf988bc22d76e536
support tls 1.2
DynamoDS/GRegClientNET
src/GregClient/GregClient.cs
src/GregClient/GregClient.cs
using System.Net; using Greg.Requests; using Greg.Responses; using RestSharp; namespace Greg { public class GregClient : IGregClient { private readonly RestClient _client; public string BaseUrl { get { return _client.BaseUrl.ToString(); } } public readonly IAuthProvider _authProvider; public IAuthProvider AuthProvider { get { return _authProvider; } } public GregClient(IAuthProvider provider, string packageManagerUrl) { ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; _authProvider = provider; _client = new RestClient(packageManagerUrl); } private IRestResponse ExecuteInternal(Request m) { var req = new RestRequest(m.Path, m.HttpMethod); m.Build(ref req); if (m.RequiresAuthorization) { AuthProvider.SignRequest(ref req, _client); } return _client.Execute(req); } public Response Execute(Request m) { return new Response(ExecuteInternal(m)); } public ResponseBody ExecuteAndDeserialize(Request m) { return Execute(m).Deserialize(); } /// <summary> /// Execute the request and deserialize the content. /// </summary> /// <typeparam name="T">The Type of content</typeparam> /// <param name="m">The request.</param> /// <returns>A <see cref="ResponseWithContent{T}"/> or null if there was an error /// in executing the message.</returns> public ResponseWithContentBody<T> ExecuteAndDeserializeWithContent<T>(Request m) { var response = this.ExecuteInternal(m); if (response.StatusCode == HttpStatusCode.NotFound) { return null; } return new ResponseWithContent<T>(response).DeserializeWithContent(); } } }
using System.Net; using Greg.Requests; using Greg.Responses; using RestSharp; namespace Greg { public class GregClient : IGregClient { private readonly RestClient _client; public string BaseUrl { get { return _client.BaseUrl.ToString(); } } public readonly IAuthProvider _authProvider; public IAuthProvider AuthProvider { get { return _authProvider; } } public GregClient(IAuthProvider provider, string packageManagerUrl) { _authProvider = provider; _client = new RestClient(packageManagerUrl); } private IRestResponse ExecuteInternal(Request m) { var req = new RestRequest(m.Path, m.HttpMethod); m.Build(ref req); if (m.RequiresAuthorization) { AuthProvider.SignRequest(ref req, _client); } return _client.Execute(req); } public Response Execute(Request m) { return new Response(ExecuteInternal(m)); } public ResponseBody ExecuteAndDeserialize(Request m) { return Execute(m).Deserialize(); } /// <summary> /// Execute the request and deserialize the content. /// </summary> /// <typeparam name="T">The Type of content</typeparam> /// <param name="m">The request.</param> /// <returns>A <see cref="ResponseWithContent{T}"/> or null if there was an error /// in executing the message.</returns> public ResponseWithContentBody<T> ExecuteAndDeserializeWithContent<T>(Request m) { var response = this.ExecuteInternal(m); if (response.StatusCode == HttpStatusCode.NotFound) { return null; } return new ResponseWithContent<T>(response).DeserializeWithContent(); } } }
mit
C#
c3b15e070033ad5be3aa8d201ff3397a75135ae4
Add validation implementation in recommendations module.
henrikfroehling/TraktApiSharp
Source/Lib/TraktApiSharp/Modules/TraktRecommendationsModule.cs
Source/Lib/TraktApiSharp/Modules/TraktRecommendationsModule.cs
namespace TraktApiSharp.Modules { using Objects.Basic; using Objects.Get.Recommendations; using Requests; using Requests.WithOAuth.Recommendations; using System; using System.Threading.Tasks; public class TraktRecommendationsModule : TraktBaseModule { public TraktRecommendationsModule(TraktClient client) : base(client) { } public async Task<TraktListResult<TraktMovieRecommendation>> GetUserMovieRecommendationsAsync(int? limit = null, TraktExtendedOption extended = null) { return await QueryAsync(new TraktUserMovieRecommendationsRequest(Client) { PaginationOptions = new TraktPaginationOptions(null, limit), ExtendedOption = extended != null ? extended : new TraktExtendedOption() }); } public async Task HideMovieRecommendationAsync(string movieId) { Validate(movieId); await QueryAsync(new TraktUserRecommendationHideMovieRequest(Client) { Id = movieId }); } public async Task<TraktListResult<TraktShowRecommendation>> GetUserShowRecommendationsAsync(int? limit = null, TraktExtendedOption extended = null) { return await QueryAsync(new TraktUserShowRecommendationsRequest(Client) { PaginationOptions = new TraktPaginationOptions(null, limit), ExtendedOption = extended != null ? extended : new TraktExtendedOption() }); } public async Task HideShowRecommendationAsync(string showId) { Validate(showId); await QueryAsync(new TraktUserRecommendationHideShowRequest(Client) { Id = showId }); } private void Validate(string id) { if (string.IsNullOrEmpty(id)) throw new ArgumentException("id not valid", "id"); } } }
namespace TraktApiSharp.Modules { using Objects.Basic; using Objects.Get.Recommendations; using Requests; using Requests.WithOAuth.Recommendations; using System.Threading.Tasks; public class TraktRecommendationsModule : TraktBaseModule { public TraktRecommendationsModule(TraktClient client) : base(client) { } public async Task<TraktListResult<TraktMovieRecommendation>> GetUserMovieRecommendationsAsync(int? limit = null, TraktExtendedOption extended = null) { return await QueryAsync(new TraktUserMovieRecommendationsRequest(Client) { PaginationOptions = new TraktPaginationOptions(null, limit), ExtendedOption = extended != null ? extended : new TraktExtendedOption() }); } public async Task HideMovieRecommendationAsync(string movieId) { await QueryAsync(new TraktUserRecommendationHideMovieRequest(Client) { Id = movieId }); } public async Task<TraktListResult<TraktShowRecommendation>> GetUserShowRecommendationsAsync(int? limit = null, TraktExtendedOption extended = null) { return await QueryAsync(new TraktUserShowRecommendationsRequest(Client) { PaginationOptions = new TraktPaginationOptions(null, limit), ExtendedOption = extended != null ? extended : new TraktExtendedOption() }); } public async Task HideShowRecommendationAsync(string showId) { await QueryAsync(new TraktUserRecommendationHideShowRequest(Client) { Id = showId }); } } }
mit
C#
bdd53b39456a2789d64426a34543ba77b92e088d
Read config for setting db url and endpoint
furore-fhir/spark,furore-fhir/spark,furore-fhir/spark
src/Spark.NetCore/Startup.cs
src/Spark.NetCore/Startup.cs
using Hl7.Fhir.Serialization; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Spark.Engine; using Spark.Engine.Extensions; using Spark.Mongo; using System; namespace Spark.NetCore { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { SparkSettings sparkSettings = new SparkSettings(); Configuration.Bind("SparkSettings", sparkSettings); MongoStoreSettings storeSettings = new MongoStoreSettings(); Configuration.Bind("MongStoreSettings", storeSettings); services.AddMongoFhirStore(storeSettings); services.AddFhir(sparkSettings).SetCompatibilityVersion(CompatibilityVersion.Version_2_2); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseFhir(r => r.MapRoute(name: "default", template: "{controller}/{action}/{id?}", defaults: new { controller = "Home", action = "Index" })); } } }
using Hl7.Fhir.Serialization; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Spark.Engine; using Spark.Engine.Extensions; using Spark.Mongo; using System; namespace Spark.NetCore { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMongoFhirStore(new MongoStoreSettings { Url = "mongodb://localhost/spark" }); services.AddFhir(new SparkSettings { Endpoint = new Uri("https://localhost:44305/fhir"), ParserSettings = new ParserSettings { PermissiveParsing = true } }).SetCompatibilityVersion(CompatibilityVersion.Version_2_2); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseFhir(r => r.MapRoute(name: "default", template: "{controller}/{action}/{id?}", defaults: new { controller = "Home", action = "Index" })); } } }
bsd-3-clause
C#
f78d0c3a9b4997636afb1d86582978d347fcb0f2
Rework regex to allow whitespace
agc93/Cake.VisualStudio,agc93/Cake.VisualStudio
src/TaskRunner/TaskParser.cs
src/TaskRunner/TaskParser.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using Cake.VisualStudio.Helpers; namespace Cake.VisualStudio.TaskRunner { class TaskParser { private static string _loadPattern = "#load \""; public static SortedList<string, string> LoadTasks(string configPath) { var list = new SortedList<string, string>(); try { var script = new ScriptContent(configPath); script.Parse(_loadPattern, s => s.Replace("#load", string.Empty).Trim().Trim('"', ';')); var document = script.ToString(); var r = new Regex("Task\\s*\\(\\s*\\\"(.+)\\b\\\"\\s*\\)"); var matches = r.Matches(document); var taskNames = matches.Cast<Match>().Select(m => m.Groups[1].Value); foreach (var name in taskNames) { list.Add(name, $"-Target=\"{name}\""); } } catch (Exception ex) { Logger.Log(ex); } return list; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using Cake.VisualStudio.Helpers; namespace Cake.VisualStudio.TaskRunner { class TaskParser { private static string _loadPattern = "#load \""; public static SortedList<string, string> LoadTasks(string configPath) { var list = new SortedList<string, string>(); try { var script = new ScriptContent(configPath); script.Parse(_loadPattern, s => s.Replace("#load", string.Empty).Trim().Trim('"', ';')); var document = script.ToString(); var r = new Regex("Task\\([\\w\\\"](.+)\\b\\\"*\\)"); var matches = r.Matches(document); var taskNames = matches.Cast<Match>().Select(m => m.Groups[1].Value); foreach (var name in taskNames) { list.Add(name, $"-Target=\"{name}\""); } } catch (Exception ex) { Logger.Log(ex); } return list; } } }
mit
C#
012b48dbe51e972b291f37f88dfe0788cd9adb84
Remove explicit public definition
ppy/osu,peppy/osu,peppy/osu-new,NeoAdonis/osu,smoogipoo/osu,peppy/osu,ppy/osu,peppy/osu,NeoAdonis/osu,smoogipoo/osu,smoogipoo/osu,UselessToucan/osu,ppy/osu,smoogipooo/osu,NeoAdonis/osu,UselessToucan/osu,UselessToucan/osu
osu.Game/Screens/IHandlePresentBeatmap.cs
osu.Game/Screens/IHandlePresentBeatmap.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Beatmaps; using osu.Game.Rulesets; namespace osu.Game.Screens { /// <summary> /// Denotes a screen which can handle beatmap / ruleset selection via local logic. /// This is used in the <see cref="OsuGame.PresentBeatmap"/> flow to handle cases which require custom logic, /// for instance, if a lease is held on the Beatmap. /// </summary> public interface IHandlePresentBeatmap { /// <summary> /// Invoked with a requested beatmap / ruleset for selection. /// </summary> /// <param name="beatmap">The beatmap to be selected.</param> /// <param name="ruleset">The ruleset to be selected.</param> void PresentBeatmap(WorkingBeatmap beatmap, RulesetInfo ruleset); } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Beatmaps; using osu.Game.Rulesets; namespace osu.Game.Screens { /// <summary> /// Denotes a screen which can handle beatmap / ruleset selection via local logic. /// This is used in the <see cref="OsuGame.PresentBeatmap"/> flow to handle cases which require custom logic, /// for instance, if a lease is held on the Beatmap. /// </summary> public interface IHandlePresentBeatmap { /// <summary> /// Invoked with a requested beatmap / ruleset for selection. /// </summary> /// <param name="beatmap">The beatmap to be selected.</param> /// <param name="ruleset">The ruleset to be selected.</param> public void PresentBeatmap(WorkingBeatmap beatmap, RulesetInfo ruleset); } }
mit
C#
df564942af34fa0debc23819fbe4a7ffbe919095
make asset reader error safe
mruhul/workshop-carsales-web-mvc,mruhul/workshop-carsales-web-mvc
Src/Carsales.Web/Infrastructure/AssetMappers/AssetDataReader.cs
Src/Carsales.Web/Infrastructure/AssetMappers/AssetDataReader.cs
using System; using System.Collections.Generic; using System.IO; using Bolt.Logger; using Bolt.Serializer; using Carsales.Web.Infrastructure.Attributes; namespace Carsales.Web.Infrastructure.AssetMappers { public interface IAssetDataReader { IDictionary<string, AssetData> Read(); } [AutoBind] public class AssetDataReader : IAssetDataReader { private readonly ISerializer serializer; private readonly ILogger logger; public AssetDataReader(ISerializer serializer, ILogger logger) { this.serializer = serializer; this.logger = logger; } public IDictionary<string, AssetData> Read() { try { var content = File.ReadAllText($"{AppDomain.CurrentDomain.BaseDirectory}/webpack.assets.json"); return serializer.Deserialize<IDictionary<string, AssetData>>(content); } catch (Exception e) { logger.Error(e, e.Message); } return new Dictionary<string, AssetData>(); } } }
using System; using System.Collections.Generic; using System.IO; using Bolt.Serializer; using Carsales.Web.Infrastructure.Attributes; namespace Carsales.Web.Infrastructure.AssetMappers { public interface IAssetDataReader { IDictionary<string, AssetData> Read(); } [AutoBind] public class AssetDataReader : IAssetDataReader { private readonly ISerializer serializer; public AssetDataReader(ISerializer serializer) { this.serializer = serializer; } public IDictionary<string, AssetData> Read() { var content = File.ReadAllText($"{AppDomain.CurrentDomain.BaseDirectory}/webpack.assets.json"); return serializer.Deserialize<IDictionary<string, AssetData>>(content); } } }
mit
C#
b09442c38fb4789148463308ff76bb1eb29b1ce5
address failed test for assembly refereneces.
jwChung/Experimentalism,jwChung/Experimentalism
test/ExperimentalUnitTest/AssemblyLevelTest.cs
test/ExperimentalUnitTest/AssemblyLevelTest.cs
using System.Linq; using System.Reflection; using Xunit; namespace Jwc.Experimental { public class AssemblyLevelTest { [Fact] public void SutOnlyReferencesSpecifiedAssemblies() { var sut = Assembly.LoadFrom("Jwc.Experimental.dll"); Assert.NotNull(sut); var specifiedAssemblies = new [] { "mscorlib", "xunit", "xunit.extensions" }; var actual = sut.GetReferencedAssemblies().Select(an => an.Name).Distinct().ToArray(); Assert.Equal(specifiedAssemblies.Length, actual.Length); Assert.False(specifiedAssemblies.Except(actual).Any(), "Empty"); } } }
using System.Linq; using System.Reflection; using Xunit; namespace Jwc.Experimental { public class AssemblyLevelTest { [Fact] public void SutOnlyReferencesSpecifiedAssemblies() { var sut = Assembly.LoadFrom("Jwc.Experimental.dll"); Assert.NotNull(sut); var specifiedAssemblies = new [] { "mscorlib", "xunit" }; var actual = sut.GetReferencedAssemblies().Select(an => an.Name).ToArray(); Assert.Equal(specifiedAssemblies.Length, actual.Length); Assert.False(specifiedAssemblies.Except(actual).Any(), "Empty"); } } }
mit
C#
3f6118465ecf7b79ee24cd3a0a830732134efec8
Fix for unit test
cetusfinance/qwack,cetusfinance/qwack,cetusfinance/qwack,cetusfinance/qwack
test/Qwack.Math.Tests/Options/LocalVolFacts.cs
test/Qwack.Math.Tests/Options/LocalVolFacts.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Qwack.Options; using Xunit; using Qwack.Options.VolSurfaces; namespace Qwack.Math.Tests.Options { public class LocalVolFacts { [Fact] public void ConstLV() { var constVol = 0.32; var originDate = new DateTime(2017, 02, 21); var impliedSurface = new ConstantVolSurface(originDate, constVol); var strikes = new double[3][] { new double[] { 1, 2 }, new double[] { 1, 2 }, new double[] { 1, 2 } }; var timesteps = Enumerable.Range(0, 3).Select(x => (double)x / 3.0).ToArray(); Func<double, double> fwdCurve = (t => { return 1.5; }); var localVarianceGrid = impliedSurface.ComputeLocalVarianceOnGrid(strikes, timesteps, fwdCurve); for (var t = 0; t < localVarianceGrid.Length; t++) { var expectedLocalVariance = constVol * constVol; for (var k = 0; k < localVarianceGrid[t].Length; k++) { Assert.Equal(expectedLocalVariance, localVarianceGrid[t][k]); } } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Qwack.Options; using Xunit; using Qwack.Options.VolSurfaces; namespace Qwack.Math.Tests.Options { public class LocalVolFacts { [Fact] public void ConstLV() { var constVol = 0.32; var originDate = new DateTime(2017, 02, 21); var impliedSurface = new ConstantVolSurface(originDate, constVol); var strikes = new double[3][] { new double[] { 1, 2 }, new double[] { 1, 2 }, new double[] { 1, 2 } }; var timesteps = Enumerable.Range(0, 3).Select(x => (double)x / 3.0).ToArray(); Func<double, double> fwdCurve = (t => { return 1.5; }); var localVarianceGrid = impliedSurface.ComputeLocalVarianceOnGrid(strikes, timesteps, fwdCurve); for (var t = 0; t < localVarianceGrid.GetLength(0); t++) { var expectedLocalVariance = constVol * constVol; for (var k = 0; k < localVarianceGrid.GetLength(1); k++) { Assert.Equal(expectedLocalVariance, localVarianceGrid[t][k]); } } } } }
mit
C#
ace7de5d51dae3dba852de2cc46cdeb85d75c707
Rename Url -> QueryString (typo)
Saltarelle/SaltarelleNodeJS
QueryStringModule/QueryString.cs
QueryStringModule/QueryString.cs
using System; using System.Collections; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Text; namespace NodeJS.QueryStringModule { [Imported] [GlobalMethods] [ModuleName("querystring")] public static class QueryString { public static string Stringify(JsDictionary obj) { return null; } public static string Stringify(JsDictionary obj, string sep) { return null; } public static string Stringify(JsDictionary obj, string sep, string eq) { return null; } public static JsDictionary Parse(string str) { return null; } public static JsDictionary Parse(string str, string sep) { return null; } public static JsDictionary Parse(string str, string sep, string eq) { return null; } public static JsDictionary Parse(string str, string sep, string eq, ParseOptions options) { return null; } } }
using System; using System.Collections; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Text; namespace NodeJS.QueryStringModule { [Imported] [GlobalMethods] [ModuleName("querystring")] public static class Url { public static string Stringify(JsDictionary obj) { return null; } public static string Stringify(JsDictionary obj, string sep) { return null; } public static string Stringify(JsDictionary obj, string sep, string eq) { return null; } public static JsDictionary Parse(string str) { return null; } public static JsDictionary Parse(string str, string sep) { return null; } public static JsDictionary Parse(string str, string sep, string eq) { return null; } public static JsDictionary Parse(string str, string sep, string eq, ParseOptions options) { return null; } } }
apache-2.0
C#
9f3b731906573b2b732694428f9119d2f6b7fea4
fix update sdk version number
NIFTYCloud-mbaas/ncmb_unity,NIFTYCloud-mbaas/ncmb_unity,NIFTYCloud-mbaas/ncmb_unity
ncmb_unity/Assets/NCMB/CommonConstant.cs
ncmb_unity/Assets/NCMB/CommonConstant.cs
/******* Copyright 2017 FUJITSU CLOUD TECHNOLOGIES LIMITED 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. **********/ using System.Collections; namespace NCMB.Internal { //通信種別 internal enum ConnectType { //GET通信 GET, //POST通信 POST, //PUT通信 PUT, //DELETE通信 DELETE } /// <summary> /// 定数を定義する共通用のクラスです /// </summary> internal static class CommonConstant { //service public static readonly string DOMAIN = "mb.api.cloud.nifty.com";//ドメイン public static readonly string DOMAIN_URL = "https://mb.api.cloud.nifty.com";//ドメインのURL public static readonly string API_VERSION = "2013-09-01";//APIバージョン public static readonly string SDK_VERSION = "3.1.1"; //SDKバージョン //DEBUG LOG Setting: NCMBDebugにてdefine設定をしてください } }
/******* Copyright 2017 FUJITSU CLOUD TECHNOLOGIES LIMITED 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. **********/ using System.Collections; namespace NCMB.Internal { //通信種別 internal enum ConnectType { //GET通信 GET, //POST通信 POST, //PUT通信 PUT, //DELETE通信 DELETE } /// <summary> /// 定数を定義する共通用のクラスです /// </summary> internal static class CommonConstant { //service public static readonly string DOMAIN = "mb.api.cloud.nifty.com";//ドメイン public static readonly string DOMAIN_URL = "https://mb.api.cloud.nifty.com";//ドメインのURL public static readonly string API_VERSION = "2013-09-01";//APIバージョン public static readonly string SDK_VERSION = "3.1.0"; //SDKバージョン //DEBUG LOG Setting: NCMBDebugにてdefine設定をしてください } }
apache-2.0
C#
6afe46a2ae572c8bd4cb1d555a0f9720ed0b9a15
Ajuste obterDisponiveis
cayodonatti/TopGearApi
TopGearApi.DataAccess/CarroDA.cs
TopGearApi.DataAccess/CarroDA.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TopGearApi.Domain.Models; namespace TopGearApi.DataAccess { public class CarroDA : TopGearDA<Carro> { public static IEnumerable<Carro> GetByItem(int itemId) { using (var context = GetContext()) { return ( from c in context.Set<Carro>() where c.Itens.FirstOrDefault(i => i.Id == itemId) != null select c ) .ToList(); } } public static IEnumerable<Carro> GetByCategoria(int categoriaId) { using (var context = GetContext()) { return ( from c in context.Set<Carro>() where c.CategoriaId == categoriaId select c ) .ToList(); } } public static IEnumerable<Carro> GetDisponiveis(DateTime inicial, DateTime final, int? itemId) { using (var context = GetContext()) { var carros = context.Set<Carro>().ToList(); var carrosDisponiveis = new List<Carro>(); foreach (var c in carros) { var l = LocacaoDA.GetAtivaByCarro(c.Id, inicial, final); if (l == null) carrosDisponiveis.Add(c); } return carrosDisponiveis; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TopGearApi.Domain.Models; namespace TopGearApi.DataAccess { public class CarroDA : TopGearDA<Carro> { public static IEnumerable<Carro> GetByItem(int itemId) { using (var context = GetContext()) { return ( from c in context.Set<Carro>() where c.Itens.FirstOrDefault(i => i.Id == itemId) != null select c ) .ToList(); } } public static IEnumerable<Carro> GetByCategoria(int categoriaId) { using (var context = GetContext()) { return ( from c in context.Set<Carro>() where c.CategoriaId == categoriaId select c ) .ToList(); } } public static IEnumerable<Carro> GetDisponiveis(DateTime inicial, DateTime final, int? itemId) { using (var context = GetContext()) { var carros = context.Set<Carro>().Where(c => true); var carrosDisponiveis = new List<Carro>(); foreach (var c in carros) { var l = LocacaoDA.GetAtivaByCarro(c.Id, inicial, final); if (l == null) carrosDisponiveis.Add(c); } return carrosDisponiveis; } } } }
mit
C#
3f3bfb52c4fb4be98ce3eb6796637d9d58a417e6
Fix typo
martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode
tests/AdventOfCode.Tests/LocalOnlyAttribute.cs
tests/AdventOfCode.Tests/LocalOnlyAttribute.cs
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.AdventOfCode { using System; using Xunit; /// <summary> /// Attribute that is applied to a method to indicate that it is a fact that should /// only be run by the test runner locally and not in the <c>AppVeyor</c> or <c>Travis</c> /// continuous integrations. This class cannot be inherited. /// </summary> [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public sealed class LocalOnlyAttribute : FactAttribute { /// <summary> /// Initializes a new instance of the <see cref="LocalOnlyAttribute"/> class. /// </summary> public LocalOnlyAttribute() { if (string.Equals(Environment.GetEnvironmentVariable("CI"), bool.TrueString, StringComparison.OrdinalIgnoreCase)) { Skip = "Too slow."; } } } }
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.AdventOfCode { using System; using Xunit; /// <summary> /// Attribute that is applied to a method to indicate that it is a fact that should /// only be run by the test runner locally and not in the <c>AppVeyor</c> or <c>Travis</c> //// continuous integrations. This class cannot be inherited. /// </summary> [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public sealed class LocalOnlyAttribute : FactAttribute { /// <summary> /// Initializes a new instance of the <see cref="LocalOnlyAttribute"/> class. /// </summary> public LocalOnlyAttribute() { if (string.Equals(Environment.GetEnvironmentVariable("CI"), bool.TrueString, StringComparison.OrdinalIgnoreCase)) { Skip = "Too slow."; } } } }
apache-2.0
C#
2392ba6f296c7fb8369e7fd7f1cb451043d7b0cc
Fix failing tests
toddams/RazorLight,toddams/RazorLight
tests/RazorLight.Tests/Utils/DirectoryUtils.cs
tests/RazorLight.Tests/Utils/DirectoryUtils.cs
using System.IO; namespace RazorLight.Tests.Utils { public static class DirectoryUtils { public static string RootDirectory { get { var location = typeof(DirectoryUtils).Assembly.Location; if (!File.Exists(location)) throw new FileNotFoundException($"Could not find file location [{location}]"); location = Directory.GetParent(location).FullName; if (!Directory.Exists(location)) throw new DirectoryNotFoundException($"Could not find location [{location}]."); return location; } } } }
using System.IO; namespace RazorLight.Tests.Utils { public static class DirectoryUtils { public static string RootDirectory { get { var location = typeof(DirectoryUtils).Assembly.Location; if (!Directory.Exists(location)) throw new DirectoryNotFoundException($"Could not find location [{location}]."); return Directory.GetParent(location).FullName; } } } }
apache-2.0
C#
275696d68d576a2e8fa32dc33c3a93bb0cbcbb9f
fix slide show
AEdmunds/Vassall-Theme,AEdmunds/Vassall-Theme,AEdmunds/Vassall-Theme,AEdmunds/Vassall-Theme,AEdmunds/Vassall-Theme,AEdmunds/Vassall-Theme
Views/AdditionalResources.cshtml
Views/AdditionalResources.cshtml
@{ /* Links ***************************************************************/ //RegisterLink(new LinkEntry {Type = "image/x-icon", Rel = "shortcut icon", Href = Url.Content(theme.Location + "/" + theme.Path + "/Images/" + "favicon.ico")}); // SetMeta(new MetaEntry { Name = "viewport", Content = "width=device-width, initial-scale=1.0" }); // Needed for Bootstrap responsiveness // SetMeta(httpEquiv: "X-UA-Compatible", content: "IE=edge,chrome=1"); /* Styles ***************************************************************/ <!-- revolution slider plugin : begin --> Style.Include("rs-plugin/css/settings.css"); Style.Include("rs-responsive.css"); <!-- revolution slider plugin : end --> Style.Include("bootstrap.min.css"); Style.Include("custom.css"); Style.Include("styler.css"); Style.Include("isotope.css"); Style.Include("color_scheme.css"); Style.Include("font-awesome.css"); Style.Include("font-awesome-ie7.css"); Style.Include("flexslider.css"); Style.Include("jquery.fancybox.css"); Style.Include("overwrite.css"); /* Scripts ***************************************************************/ // script files Script.Require("jQuery").AtHead(); Script.Include("jquery-ui.min.js"); Script.Include("bootstrap.js"); Script.Include("jquery.flexslider-min.js"); Script.Include("jquery.isotope.js"); Script.Include("jquery.fancybox.pack.js"); Script.Include("rs-plugin/jquery.themepunch.plugins.min.js"); Script.Include("rs-plugin/jquery.themepunch.revolution.min.js"); Script.Include("revolution.custom.js"); Script.Include("custom.js"); Script.Include("access.js"); }
@{ /* Links ***************************************************************/ //RegisterLink(new LinkEntry {Type = "image/x-icon", Rel = "shortcut icon", Href = Url.Content(theme.Location + "/" + theme.Path + "/Images/" + "favicon.ico")}); // SetMeta(new MetaEntry { Name = "viewport", Content = "width=device-width, initial-scale=1.0" }); // Needed for Bootstrap responsiveness // SetMeta(httpEquiv: "X-UA-Compatible", content: "IE=edge,chrome=1"); /* Styles ***************************************************************/ <!-- revolution slider plugin : begin --> Style.Include("rs-plugin/css/settings.css"); Style.Include("rs-responsive.css"); <!-- revolution slider plugin : end --> Style.Include("bootstrap.min.css"); Style.Include("custom.css"); Style.Include("styler.css"); Style.Include("isotope.css"); Style.Include("color_scheme.css"); Style.Include("font-awesome.css"); Style.Include("font-awesome-ie7.css"); Style.Include("flexslider.css"); Style.Include("jquery.fancybox.css"); Style.Include("overwrite.css"); /* Scripts ***************************************************************/ // script files Script.Require("jQuery").AtHead(); Script.Include("jquery-ui.min.js"); Script.Include("bootstrap.js"); Script.Include("jquery.flexslider-min.js"); Script.Include("jquery.isotope.js"); Script.Include("jquery.fancybox.pack.js"); Script.Include("rs-plugin/jquery.themepunch.plugins.min.js"); Script.Include("rs-plugin/jquery.themepunch.revolution.js"); Script.Include("rs-plugin/jquery.themepunch.revolution.min.js"); Script.Include("custom.js"); Script.Include("access.js"); }
bsd-2-clause
C#
9719bde53226f224fe13aa8195fb9a52552c838e
add humanizr to view imports
ojraqueno/vstemplates,ojraqueno/vstemplates,ojraqueno/vstemplates
Core/Core1.Web/Views/_ViewImports.cshtml
Core/Core1.Web/Views/_ViewImports.cshtml
@using Core1.Web @using Core1.Web.Features.Shared @using Core1.Web.Infrastructure @using Core1.Model @using Humanizer @using Microsoft.Extensions.Configuration @* To capture the extension method *@ @inject Microsoft.Extensions.Configuration.IConfiguration Configuration @inject Core1.Web.Infrastructure.IUserContext UserContext @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using Core1.Web @using Core1.Web.Features.Shared @using Core1.Web.Infrastructure @using Core1.Model @using Microsoft.Extensions.Configuration @* To capture the extension method *@ @inject Microsoft.Extensions.Configuration.IConfiguration Configuration @inject Core1.Web.Infrastructure.IUserContext UserContext @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
mit
C#
c725a1e03ab1e48496a8dff24a36c64d6a3f5d5d
Bump version number to 1.2.2.0.
da2x/EdgeDeflector
EdgeDeflector/Properties/AssemblyInfo.cs
EdgeDeflector/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("EdgeDeflector")] [assembly: AssemblyDescription("Open MICROSOFT-EDGE:// links in your default web browser.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("EdgeDeflector")] [assembly: AssemblyCopyright("Copyright © 2021")] [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("64e191bc-e8ce-4190-939e-c77a75aa0e28")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Maintenance Number // Build Number // // 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.2.2.0")] [assembly: AssemblyFileVersion("1.2.2.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("EdgeDeflector")] [assembly: AssemblyDescription("Open MICROSOFT-EDGE:// links in your default web browser.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("EdgeDeflector")] [assembly: AssemblyCopyright("Copyright © 2021")] [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("64e191bc-e8ce-4190-939e-c77a75aa0e28")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Maintenance Number // Build Number // // 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.2.1.0")] [assembly: AssemblyFileVersion("1.2.1.0")]
mit
C#
bbcc7d954e86713345a6ab86c5d458dedbc22f9f
Update app version to 3.1.0
Phrynohyas/eve-o-preview,Phrynohyas/eve-o-preview
Eve-O-Preview/Properties/AssemblyInfo.cs
Eve-O-Preview/Properties/AssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("EVE-O Preview")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("EVE-O Preview")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("04f08f8d-9e98-423b-acdb-4effb31c0d35")] [assembly: AssemblyVersion("3.1.0.0")] [assembly: AssemblyFileVersion("3.1.0.0")] [assembly: CLSCompliant(true)]
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("EVE-O Preview")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("EVE-O Preview")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("04f08f8d-9e98-423b-acdb-4effb31c0d35")] [assembly: AssemblyVersion("3.0.0.1")] [assembly: AssemblyFileVersion("3.0.0.1")] [assembly: CLSCompliant(true)]
mit
C#
8b2e94ebff2416a2b7812990b42b880a2f1f421e
fix semicolon
KuduApps/NuGetGallery,grenade/NuGetGallery_download-count-patch,KuduApps/NuGetGallery,KuduApps/NuGetGallery,JetBrains/ReSharperGallery,skbkontur/NuGetGallery,grenade/NuGetGallery_download-count-patch,projectkudu/SiteExtensionGallery,JetBrains/ReSharperGallery,skbkontur/NuGetGallery,ScottShingler/NuGetGallery,mtian/SiteExtensionGallery,projectkudu/SiteExtensionGallery,JetBrains/ReSharperGallery,grenade/NuGetGallery_download-count-patch,mtian/SiteExtensionGallery,ScottShingler/NuGetGallery,KuduApps/NuGetGallery,skbkontur/NuGetGallery,ScottShingler/NuGetGallery,projectkudu/SiteExtensionGallery,mtian/SiteExtensionGallery,KuduApps/NuGetGallery
Website/Helpers/PackageHelper.cs
Website/Helpers/PackageHelper.cs
 namespace NuGetGallery { public static class PackageHelper { public static string ParseTags(string tags) { if (tags == null) { return null; } return tags.Replace(',', ' ').Replace(';', ' ').Replace('\t', ' ').Replace(" ", " "); } } }
 namespace NuGetGallery { public static class PackageHelper { public static string ParseTags(string tags) { if (tags == null) { return null; } return tags.Replace(',', ' ').Replace(" ", " "); } } }
apache-2.0
C#
c2945828a539ae427466b0785ea815eb76f52cd0
Remove obsolete documented remark on Exception types
QuantConnect/pythonnet,pythonnet/pythonnet,pythonnet/pythonnet,pythonnet/pythonnet,QuantConnect/pythonnet,QuantConnect/pythonnet
src/runtime/Types/ExceptionClassObject.cs
src/runtime/Types/ExceptionClassObject.cs
using System; namespace Python.Runtime; /// <summary> /// Base class for Python types that reflect managed exceptions based on /// System.Exception /// </summary> [Serializable] internal class ExceptionClassObject : ClassObject { internal ExceptionClassObject(Type tp) : base(tp) { } internal static Exception? ToException(BorrowedReference ob) { var co = GetManagedObject(ob) as CLRObject; return co?.inst as Exception; } /// <summary> /// Exception __repr__ implementation /// </summary> public new static NewReference tp_repr(BorrowedReference ob) { Exception? e = ToException(ob); if (e == null) { return Exceptions.RaiseTypeError("invalid object"); } string name = e.GetType().Name; string message; if (e.Message != String.Empty) { message = String.Format("{0}('{1}')", name, e.Message); } else { message = String.Format("{0}()", name); } return Runtime.PyString_FromString(message); } /// <summary> /// Exception __str__ implementation /// </summary> public new static NewReference tp_str(BorrowedReference ob) { Exception? e = ToException(ob); if (e == null) { return Exceptions.RaiseTypeError("invalid object"); } string message = e.ToString(); string fullTypeName = e.GetType().FullName; string prefix = fullTypeName + ": "; if (message.StartsWith(prefix)) { message = message.Substring(prefix.Length); } else if (message.StartsWith(fullTypeName)) { message = message.Substring(fullTypeName.Length); } return Runtime.PyString_FromString(message); } public override bool Init(BorrowedReference obj, BorrowedReference args, BorrowedReference kw) { if (!base.Init(obj, args, kw)) return false; var e = (CLRObject)GetManagedObject(obj)!; return Exceptions.SetArgsAndCause(obj, (Exception)e.inst); } }
using System; namespace Python.Runtime; /// <summary> /// Base class for Python types that reflect managed exceptions based on /// System.Exception /// </summary> /// <remarks> /// The Python wrapper for managed exceptions LIES about its inheritance /// tree. Although the real System.Exception is a subclass of /// System.Object the Python type for System.Exception does NOT claim that /// it subclasses System.Object. Instead TypeManager.CreateType() uses /// Python's exception.Exception class as base class for System.Exception. /// </remarks> [Serializable] internal class ExceptionClassObject : ClassObject { internal ExceptionClassObject(Type tp) : base(tp) { } internal static Exception? ToException(BorrowedReference ob) { var co = GetManagedObject(ob) as CLRObject; return co?.inst as Exception; } /// <summary> /// Exception __repr__ implementation /// </summary> public new static NewReference tp_repr(BorrowedReference ob) { Exception? e = ToException(ob); if (e == null) { return Exceptions.RaiseTypeError("invalid object"); } string name = e.GetType().Name; string message; if (e.Message != String.Empty) { message = String.Format("{0}('{1}')", name, e.Message); } else { message = String.Format("{0}()", name); } return Runtime.PyString_FromString(message); } /// <summary> /// Exception __str__ implementation /// </summary> public new static NewReference tp_str(BorrowedReference ob) { Exception? e = ToException(ob); if (e == null) { return Exceptions.RaiseTypeError("invalid object"); } string message = e.ToString(); string fullTypeName = e.GetType().FullName; string prefix = fullTypeName + ": "; if (message.StartsWith(prefix)) { message = message.Substring(prefix.Length); } else if (message.StartsWith(fullTypeName)) { message = message.Substring(fullTypeName.Length); } return Runtime.PyString_FromString(message); } public override bool Init(BorrowedReference obj, BorrowedReference args, BorrowedReference kw) { if (!base.Init(obj, args, kw)) return false; var e = (CLRObject)GetManagedObject(obj)!; return Exceptions.SetArgsAndCause(obj, (Exception)e.inst); } }
mit
C#
9c78f7019c8622a3fc7a10c3d3dc8dcb5f44a289
Check that source_handlers contains the tag.
sillsdev/gtk-sharp,sillsdev/gtk-sharp,sillsdev/gtk-sharp,sillsdev/gtk-sharp,sillsdev/gtk-sharp
glib/Source.cs
glib/Source.cs
// GLib.Source.cs - Source class implementation // // Author: Duncan Mak <duncan@ximian.com> // // Copyright (c) 2002 Mike Kestner // // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. namespace GLib { using System; using System.Collections; using System.Runtime.InteropServices; public delegate bool GSourceFunc (); // // Base class for IdleProxy and TimeoutProxy // internal class SourceProxy { internal Delegate real_handler; internal Delegate proxy_handler; internal uint ID; internal void Remove () { lock (Source.source_handlers) Source.source_handlers.Remove (ID); real_handler = null; proxy_handler = null; } } public class Source { private Source () {} internal static Hashtable source_handlers = new Hashtable (); [DllImport("libglib-2.0-0.dll", CallingConvention=CallingConvention.Cdecl)] static extern bool g_source_remove (uint tag); public static bool Remove (uint tag) { // g_source_remove always returns true, so we follow that bool ret = true; lock (Source.source_handlers) { if (source_handlers.Contains (tag)) { source_handlers.Remove (tag); ret = g_source_remove (tag); } } return ret; } } }
// GLib.Source.cs - Source class implementation // // Author: Duncan Mak <duncan@ximian.com> // // Copyright (c) 2002 Mike Kestner // // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. namespace GLib { using System; using System.Collections; using System.Runtime.InteropServices; public delegate bool GSourceFunc (); // // Base class for IdleProxy and TimeoutProxy // internal class SourceProxy { internal Delegate real_handler; internal Delegate proxy_handler; internal uint ID; internal void Remove () { lock (Source.source_handlers) Source.source_handlers.Remove (ID); real_handler = null; proxy_handler = null; } } public class Source { private Source () {} internal static Hashtable source_handlers = new Hashtable (); [DllImport("libglib-2.0-0.dll", CallingConvention=CallingConvention.Cdecl)] static extern bool g_source_remove (uint tag); public static bool Remove (uint tag) { // g_source_remove always returns true, so we follow that bool ret = true; lock (Source.source_handlers) { if (source_handlers.Remove (tag)) { ret = g_source_remove (tag); } } return ret; } } }
lgpl-2.1
C#
cf8e2390e416db36734b9732f420da34b2e06d88
rename tests from calculate_<upperBound>_shouldReturn<result> to calculate_shouldReturn<result>WhenPassed<upperBound>
wimplash/LeEulerizer,wimplash/LeEulerizer
LeEulerizer-Library-Test/Problem1Test.cs
LeEulerizer-Library-Test/Problem1Test.cs
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using LeEulerizer_Library; namespace LeEulerizer_Library_Test { [TestClass] public class Problem1Test { [TestMethod] public void Problem1_canBeConstructed() { Assert.IsNotNull(new Problem1()); } [TestMethod] public void calculate_shouldReturnZeroWhenPassedThree() { Assert.AreEqual(0, new Problem1().calculate(3)); } [TestMethod] public void calculate_shouldReturnThreeWhenPassedFour() { Assert.AreEqual(3, new Problem1().calculate(4)); } [TestMethod] public void calculate_shouldReturnEightWhenPassedSix() { Assert.AreEqual(8, new Problem1().calculate(6)); } [TestMethod] public void calculate_shouldReturnTwentyThreeWhenPassedTen() { Assert.AreEqual(23, new Problem1().calculate(10)); } [TestMethod] [ExpectedException(typeof(ArgumentOutOfRangeException))] public void calculate_shouldThrowExceptionWhenPassedZero() { new Problem1().calculate(0); } [TestMethod] [ExpectedException(typeof(ArgumentOutOfRangeException))] public void calculate_shouldThrowExceptionWhenPassedNegativeOne() { new Problem1().calculate(-1); } [TestMethod] [ExpectedException(typeof(ArgumentOutOfRangeException))] public void calculate_shouldThrowExceptionWhenPassedOne() { new Problem1().calculate(1); } } }
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using LeEulerizer_Library; namespace LeEulerizer_Library_Test { [TestClass] public class Problem1Test { [TestMethod] public void Problem1_canBeConstructed() { Assert.IsNotNull(new Problem1()); } [TestMethod] public void calculate_three_shouldReturnZero() { Assert.AreEqual(0, new Problem1().calculate(3)); } [TestMethod] public void calculate_four_shouldReturnThree() { Assert.AreEqual(3, new Problem1().calculate(4)); } [TestMethod] public void calculate_six_shouldReturnEight() { Assert.AreEqual(8, new Problem1().calculate(6)); } [TestMethod] public void calculate_ten_shouldReturnTwentyThree() { Assert.AreEqual(23, new Problem1().calculate(10)); } [TestMethod] [ExpectedException(typeof(ArgumentOutOfRangeException))] public void calculate_shouldThrowExceptionWhenPassedZero() { new Problem1().calculate(0); } [TestMethod] [ExpectedException(typeof(ArgumentOutOfRangeException))] public void calculate_shouldThrowExceptionWhenPassedNegativeOne() { new Problem1().calculate(-1); } [TestMethod] [ExpectedException(typeof(ArgumentOutOfRangeException))] public void calculate_shouldThrowExceptionWhenPassedOne() { new Problem1().calculate(1); } } }
mit
C#
7e14d2b341d936eca06e74e7bf22986d7f6c5cef
Change BoundingBox.GetCornerVertices to CW
pauldendulk/Mapsui,charlenni/Mapsui,tebben/Mapsui,charlenni/Mapsui
Mapsui/Projection/BoundingBoxIterator.cs
Mapsui/Projection/BoundingBoxIterator.cs
using System.Collections.Generic; using Mapsui.Geometries; namespace Mapsui.Projection { public static class BoundingBoxIterator { public static IEnumerable<Point> AllVertices(this BoundingBox boundingBox) { return new[] { boundingBox.Min, boundingBox.Max }; } public static IEnumerable<Point> GetCornerVertices(this BoundingBox boundingBox) { return new[] { boundingBox.BottomLeft, boundingBox.TopLeft, boundingBox.TopRight, boundingBox.BottomRight}; } } }
using System.Collections.Generic; using Mapsui.Geometries; namespace Mapsui.Projection { public static class BoundingBoxIterator { public static IEnumerable<Point> AllVertices(this BoundingBox boundingBox) { return new[] { boundingBox.Min, boundingBox.Max }; } public static IEnumerable<Point> GetCornerVertices(this BoundingBox boundingBox) { return new[] { boundingBox.BottomLeft, boundingBox.BottomRight, boundingBox.TopRight, boundingBox.TopLeft }; } } }
mit
C#
ca722657dd8b4c9d93788a739753cd25ee74bc0a
remove extra whitespace
ddunkin/raygun4net,MindscapeHQ/raygun4net,nelsonsar/raygun4net,nelsonsar/raygun4net,MindscapeHQ/raygun4net,MindscapeHQ/raygun4net,tdiehl/raygun4net,articulate/raygun4net,tdiehl/raygun4net,ddunkin/raygun4net,articulate/raygun4net
Mindscape.Raygun4Net/RaygunHttpModule.cs
Mindscape.Raygun4Net/RaygunHttpModule.cs
using System; using System.Web; namespace Mindscape.Raygun4Net { public class RaygunHttpModule : IHttpModule { public void Init(HttpApplication context) { context.Error += SendError; } public void Dispose() { } private void SendError(object sender, EventArgs e) { var application = (HttpApplication)sender; new RaygunClient().SendInBackground(Unwrap(application.Server.GetLastError())); } private Exception Unwrap(Exception exception) { if (exception is HttpUnhandledException) { return exception.GetBaseException(); } return exception; } } }
using System; using System.Web; namespace Mindscape.Raygun4Net { public class RaygunHttpModule : IHttpModule { public void Init(HttpApplication context) { context.Error += SendError; } public void Dispose() { } private void SendError(object sender, EventArgs e) { var application = (HttpApplication)sender; new RaygunClient().SendInBackground(Unwrap(application.Server.GetLastError())); } private Exception Unwrap(Exception exception) { if (exception is HttpUnhandledException) { return exception.GetBaseException(); } return exception; } } }
mit
C#
4e614c07cf392b27c9dedde69082b007e632d3d9
Revert unintended change
ppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,peppy/osu-framework
osu.Framework.Tests/Audio/SampleBassInitTest.cs
osu.Framework.Tests/Audio/SampleBassInitTest.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 ManagedBass; using NUnit.Framework; using osu.Framework.Audio.Sample; namespace osu.Framework.Tests.Audio { [TestFixture] public class SampleBassInitTest { private TestBassAudioPipeline pipeline; private Sample sample; [SetUp] public void Setup() { pipeline = new TestBassAudioPipeline(false); sample = pipeline.GetSample(); pipeline.Update(); pipeline.Init(); } [TearDown] public void Teardown() { // See AudioThread.FreeDevice(). if (RuntimeInfo.OS != RuntimeInfo.Platform.Linux) Bass.Free(); } [Test] public void TestSampleInitialisesOnUpdateDevice() { if (RuntimeInfo.OS == RuntimeInfo.Platform.Linux) Assert.Ignore("Test may be intermittent on linux (see AudioThread.FreeDevice())."); Assert.That(sample.IsLoaded, Is.False); pipeline.RunOnAudioThread(() => pipeline.SampleStore.UpdateDevice(0)); Assert.That(sample.IsLoaded, Is.True); } } }
// 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 ManagedBass; using NUnit.Framework; using osu.Framework.Audio.Sample; namespace osu.Framework.Tests.Audio { [TestFixture] public class SampleBassInitTest { private TestBassAudioPipeline pipeline; private Sample sample; [SetUp] public void Setup() { pipeline = new TestBassAudioPipeline(false); sample = pipeline.GetSample(); pipeline.Update(); pipeline.Init(); } [TearDown] public void Teardown() { // See AudioThread.FreeDevice(). if (RuntimeInfo.OS != RuntimeInfo.Platform.Linux) Bass.Free(); } [Test] public void TestSampleInitialisesOnUpdateDevice() { // if (RuntimeInfo.OS == RuntimeInfo.Platform.Linux) // Assert.Ignore("Test may be intermittent on linux (see AudioThread.FreeDevice())."); Assert.That(sample.IsLoaded, Is.False); pipeline.RunOnAudioThread(() => pipeline.SampleStore.UpdateDevice(0)); Assert.That(sample.IsLoaded, Is.True); } } }
mit
C#
caf1dfa91592feba421fd2c92a2582b786657a5e
Add implicit operator for `LocalisableFormattable` to `LocalisableString`
ZLima12/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework
osu.Framework/Localisation/LocalisableString.cs
osu.Framework/Localisation/LocalisableString.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; #nullable enable namespace osu.Framework.Localisation { /// <summary> /// A descriptor representing text that can be localised and formatted. /// </summary> public readonly struct LocalisableString : IEquatable<LocalisableString> { /// <summary> /// The underlying data, can be <see cref="string"/>, <see cref="TranslatableString"/>, <see cref="RomanisableString"/>, or <see cref="LocalisableFormattable"/>. /// </summary> internal readonly object? Data; private LocalisableString(object data) => Data = data; // it's somehow common to call default(LocalisableString), and we should return empty string then. public override string ToString() => Data?.ToString() ?? string.Empty; public bool Equals(LocalisableString other) => LocalisableStringEqualityComparer.Default.Equals(this, other); public override bool Equals(object? obj) => obj is LocalisableString other && Equals(other); public override int GetHashCode() => LocalisableStringEqualityComparer.Default.GetHashCode(this); public static implicit operator LocalisableString(string text) => new LocalisableString(text); public static implicit operator LocalisableString(TranslatableString translatable) => new LocalisableString(translatable); public static implicit operator LocalisableString(RomanisableString romanisable) => new LocalisableString(romanisable); public static implicit operator LocalisableString(LocalisableFormattable formattable) => new LocalisableString(formattable); public static bool operator ==(LocalisableString left, LocalisableString right) => left.Equals(right); public static bool operator !=(LocalisableString left, LocalisableString right) => !left.Equals(right); } }
// 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; #nullable enable namespace osu.Framework.Localisation { /// <summary> /// A descriptor representing text that can be localised and formatted. /// </summary> public readonly struct LocalisableString : IEquatable<LocalisableString> { /// <summary> /// The underlying data, can be <see cref="string"/>, <see cref="TranslatableString"/>, or <see cref="RomanisableString"/>. /// </summary> internal readonly object? Data; private LocalisableString(object data) => Data = data; // it's somehow common to call default(LocalisableString), and we should return empty string then. public override string ToString() => Data?.ToString() ?? string.Empty; public bool Equals(LocalisableString other) => LocalisableStringEqualityComparer.Default.Equals(this, other); public override bool Equals(object? obj) => obj is LocalisableString other && Equals(other); public override int GetHashCode() => LocalisableStringEqualityComparer.Default.GetHashCode(this); public static implicit operator LocalisableString(string text) => new LocalisableString(text); public static implicit operator LocalisableString(TranslatableString translatable) => new LocalisableString(translatable); public static implicit operator LocalisableString(RomanisableString romanisable) => new LocalisableString(romanisable); public static bool operator ==(LocalisableString left, LocalisableString right) => left.Equals(right); public static bool operator !=(LocalisableString left, LocalisableString right) => !left.Equals(right); } }
mit
C#
b4b34559792bd157684109c9d0e16d7cb291da2b
Fix link
erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner
Oogstplanner.Web/Views/Crop/Index.cshtml
Oogstplanner.Web/Views/Crop/Index.cshtml
@model IEnumerable<Crop> @{ ViewBag.Title = "Gewassen"; } <div id="top"></div> <div id="yearCalendar"> <h1>Dit zijn de gewassen in onze database:</h1> <table class="table table-striped"> <tr> <th>Naam</th><th>Ras</th><th>Categorie</th><th>Opp. per 1</th> <th>Opp. per zak</th><th>Prijs per zakje</th><th>Zaaimaanden</th><th>Oogstmaanden</th> </tr> <tbody> @foreach (var crop in Model) { <tr> <td>@crop.Name</td><td>@crop.Race</td><td>@crop.Category</td><td>@crop.AreaPerCrop</td> <td>@crop.AreaPerBag</td><td>@crop.PricePerBag</td> <td>@crop.SowingMonths</td><td>@crop.HarvestingMonths</td> </tr> } </tbody> </table> </div> @Html.ActionLink("Naar Zaaien en oogsten", "SowingAndHarvesting", "Home", null, null)
@model IEnumerable<Crop> @{ ViewBag.Title = "Gewassen"; } <div id="top"></div> <div id="yearCalendar"> <h1>Dit zijn de gewassen in onze database:</h1> <table class="table table-striped"> <tr> <th>Naam</th><th>Ras</th><th>Categorie</th><th>Opp. per 1</th> <th>Opp. per zak</th><th>Prijs per zakje</th><th>Zaaimaanden</th><th>Oogstmaanden</th> </tr> <tbody> @foreach (var crop in Model) { <tr> <td>@crop.Name</td><td>@crop.Race</td><td>@crop.Category</td><td>@crop.AreaPerCrop</td> <td>@crop.AreaPerBag</td><td>@crop.PricePerBag</td> <td>@crop.SowingMonths</td><td>@crop.HarvestingMonths</td> </tr> } </tbody> </table> </div> @Html.ActionLink("Terug naar Zaaien en oogsten", "Index", "Home", null, null)
mit
C#
66ee195c7e836373fe45af6da244e2cdb20b5b65
Remove a stale comment
civicsource/webapi-utils,civicsource/http
aspnetcore/GZipResourceFilter.cs
aspnetcore/GZipResourceFilter.cs
using System.IO.Compression; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Primitives; namespace Archon.AspNetCore { /// <summary> /// A filter that decompresses GZip content from HTTP requests specified as <c>Content-Encoding: gzip</c> /// </summary> public class GZipResourceFilter : IAsyncResourceFilter { public async Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next) { if (context.HttpContext.Request.Headers.TryGetValue("Content-Encoding", out StringValues values) && values.Count == 1 && (values[0] == "gzip" || values[0] == "x-gzip")) context.HttpContext.Request.Body = new GZipStream(context.HttpContext.Request.Body, CompressionMode.Decompress, false); await next(); } } }
using System.IO.Compression; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Primitives; namespace Archon.AspNetCore { // TODO: Separate the server and client helpers in this project so that our web clients don't need to import frickin' ASP.NET /// <summary> /// A filter that decompresses GZip content from HTTP requests specified as <c>Content-Encoding: gzip</c> /// </summary> public class GZipResourceFilter : IAsyncResourceFilter { public async Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next) { if (context.HttpContext.Request.Headers.TryGetValue("Content-Encoding", out StringValues values) && values.Count == 1 && (values[0] == "gzip" || values[0] == "x-gzip")) context.HttpContext.Request.Body = new GZipStream(context.HttpContext.Request.Body, CompressionMode.Decompress, false); await next(); } } }
mit
C#
c342f0e0d2bb76a5465b1cd29fc7e16dd4070111
Make campaign name required
badbuay/allReady,JowenMei/allReady,badbuay/allReady,mgmccarthy/allReady,auroraocciduusadmin/allReady,gitChuckD/allReady,forestcheng/allReady,mikesigs/allReady,arst/allReady,binaryjanitor/allReady,dpaquette/allReady,kmlewis/allReady,SteveStrong/allReady,aliiftikhar/allReady,shawnwildermuth/allReady,auroraocciduusadmin/allReady,c0g1t8/allReady,colhountech/allReady,HamidMosalla/allReady,HTBox/allReady,mheggeseth/allReady,chinwobble/allReady,c0g1t8/allReady,MisterJames/allReady,gftrader/allReady,mipre100/allReady,mikesigs/allReady,mgmccarthy/allReady,aliiftikhar/allReady,binaryjanitor/allReady,enderdickerson/allReady,HamidMosalla/allReady,timstarbuck/allReady,arst/allReady,jonhilt/allReady,anobleperson/allReady,shanecharles/allReady,colhountech/allReady,dangle1/allReady,GProulx/allReady,HTBox/allReady,ksk100/allReady,mipre100/allReady,sJhonny-e/allReady,enderdickerson/allReady,JowenMei/allReady,colhountech/allReady,HTBox/allReady,jonatwabash/allReady,dangle1/allReady,mgmccarthy/allReady,kmlewis/allReady,mheggeseth/allReady,mipre100/allReady,c0g1t8/allReady,BillWagner/allReady,mgmccarthy/allReady,mipre100/allReady,JowenMei/allReady,jonatwabash/allReady,jonatwabash/allReady,ksk100/allReady,BillWagner/allReady,VishalMadhvani/allReady,gitChuckD/allReady,shanecharles/allReady,sJhonny-e/allReady,dneelyep/allReady,gitChuckD/allReady,stevejgordon/allReady,arst/allReady,gftrader/allReady,HamidMosalla/allReady,shawnwildermuth/allReady,aliiftikhar/allReady,GProulx/allReady,anobleperson/allReady,gitChuckD/allReady,forestcheng/allReady,djjlewis/allReady,mheggeseth/allReady,BarryBurke/allReady,timstarbuck/allReady,hrboyceiii/allReady,mikesigs/allReady,chinwobble/allReady,forestcheng/allReady,dangle1/allReady,dneelyep/allReady,djjlewis/allReady,c0g1t8/allReady,SteveStrong/allReady,aliiftikhar/allReady,shanecharles/allReady,GProulx/allReady,BarryBurke/allReady,dangle1/allReady,enderdickerson/allReady,ksk100/allReady,bcbeatty/allReady,BillWagner/allReady,binaryjanitor/allReady,pranap/allReady,VishalMadhvani/allReady,mikesigs/allReady,shawnwildermuth/allReady,joelhulen/allReady,arst/allReady,VishalMadhvani/allReady,HamidMosalla/allReady,VishalMadhvani/allReady,BillWagner/allReady,djjlewis/allReady,gftrader/allReady,sJhonny-e/allReady,pranap/allReady,SteveStrong/allReady,hrboyceiii/allReady,badbuay/allReady,gftrader/allReady,pranap/allReady,shawnwildermuth/allReady,dpaquette/allReady,colhountech/allReady,stevejgordon/allReady,SteveStrong/allReady,mheggeseth/allReady,dpaquette/allReady,timstarbuck/allReady,stevejgordon/allReady,MisterJames/allReady,MisterJames/allReady,MisterJames/allReady,jonhilt/allReady,pranap/allReady,forestcheng/allReady,anobleperson/allReady,jonhilt/allReady,chinwobble/allReady,shanecharles/allReady,ksk100/allReady,hrboyceiii/allReady,JowenMei/allReady,dpaquette/allReady,stevejgordon/allReady,bcbeatty/allReady,BarryBurke/allReady,auroraocciduusadmin/allReady,GProulx/allReady,joelhulen/allReady,timstarbuck/allReady,dneelyep/allReady,auroraocciduusadmin/allReady,bcbeatty/allReady,jonhilt/allReady,BarryBurke/allReady,kmlewis/allReady,binaryjanitor/allReady,anobleperson/allReady,joelhulen/allReady,joelhulen/allReady,jonatwabash/allReady,kmlewis/allReady,HTBox/allReady,enderdickerson/allReady,chinwobble/allReady,bcbeatty/allReady
AllReadyApp/Web-App/AllReady/Models/Campaign.cs
AllReadyApp/Web-App/AllReady/Models/Campaign.cs
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace AllReady.Models { public class Campaign { [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } [Required] public string Name { get; set; } public string Description { get; set; } [Display(Name = "Managing Tenant")] public int ManagingTenantId { get; set; } public Tenant ManagingTenant { get; set; } [Display(Name = "Image URL")] public string ImageUrl { get; set; } /// <summary> /// Collection of Tenants that are supporting this campaign /// </summary> public List<CampaignSponsors> ParticipatingTenants { get; set; } /// <summary> /// The date the campaign starts /// </summary> [Display(Name = "Start date")] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:d}")] public DateTime StartDateTimeUtc { get; set; } /// <summary> /// The date the campaign ends /// </summary> [Display(Name = "End date")] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:d}")] public DateTime EndDateTimeUtc { get; set; } public List<Activity> Activities { get; set; } public ApplicationUser Organizer { get; set; } } }
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace AllReady.Models { public class Campaign { [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } public string Name { get; set; } public string Description { get; set; } [Display(Name = "Managing Tenant")] public int ManagingTenantId { get; set; } public Tenant ManagingTenant { get; set; } [Display(Name = "Image URL")] public string ImageUrl { get; set; } /// <summary> /// Collection of Tenants that are supporting this campaign /// </summary> public List<CampaignSponsors> ParticipatingTenants { get; set; } /// <summary> /// The date the campaign starts /// </summary> [Display(Name = "Start date")] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:d}")] public DateTime StartDateTimeUtc { get; set; } /// <summary> /// The date the campaign ends /// </summary> [Display(Name = "End date")] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:d}")] public DateTime EndDateTimeUtc { get; set; } public List<Activity> Activities { get; set; } public ApplicationUser Organizer { get; set; } } }
mit
C#
09fb05071c377f631036117d54c32877535782f2
Remove the validation of NewsLetterSubscriptionDto.
SevenSpikes/api-plugin-for-nopcommerce,SevenSpikes/api-plugin-for-nopcommerce
Nop.Plugin.Api/DTOs/NewsLetterSubscriptions/NewsLetterSubscriptionDto.cs
Nop.Plugin.Api/DTOs/NewsLetterSubscriptions/NewsLetterSubscriptionDto.cs
using System; using FluentValidation.Attributes; using Newtonsoft.Json; using Nop.Plugin.Api.Validators; namespace Nop.Plugin.Api.DTOs.Categories { [JsonObject(Title = "news_letter_subscription")] public class NewsLetterSubscriptionDto { /// <summary> /// Gets or sets the id /// </summary> [JsonProperty("id")] public string Id { get; set; } /// <summary> /// Gets or sets the email /// </summary> [JsonProperty("email")] public string Email { get; set; } /// <summary> /// Gets or sets whether the subscription is active /// </summary> [JsonProperty("active")] public bool Active { get; set; } /// <summary> /// Gets or sets whether the subscription is active /// </summary> [JsonProperty("store_id")] public int StoreId { get; set; } /// <summary> /// Gets or sets created on utc date /// </summary> [JsonProperty("created_on_utc")] public DateTime? CreatedOnUtc { get; set; } } }
using System; using FluentValidation.Attributes; using Newtonsoft.Json; using Nop.Plugin.Api.Validators; namespace Nop.Plugin.Api.DTOs.Categories { [Validator(typeof(CategoryDtoValidator))] [JsonObject(Title = "news_letter_subscription")] public class NewsLetterSubscriptionDto { /// <summary> /// Gets or sets the id /// </summary> [JsonProperty("id")] public string Id { get; set; } /// <summary> /// Gets or sets the email /// </summary> [JsonProperty("email")] public string Email { get; set; } /// <summary> /// Gets or sets whether the subscription is active /// </summary> [JsonProperty("active")] public bool Active { get; set; } /// <summary> /// Gets or sets whether the subscription is active /// </summary> [JsonProperty("store_id")] public int StoreId { get; set; } /// <summary> /// Gets or sets created on utc date /// </summary> [JsonProperty("created_on_utc")] public DateTime? CreatedOnUtc { get; set; } } }
mit
C#
b551a657cfa2bc9d5f02fad1abfd7629c421b735
Update to hello support snippet
awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples
dotnetv3/Support/Actions/HelloSupport.cs
dotnetv3/Support/Actions/HelloSupport.cs
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 namespace SupportActions; // snippet-start:[Support.dotnetv3.HelloSupport] using Amazon.AWSSupport; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; public static class HelloSupport { static async Task Main(string[] args) { // Use the AWS .NET Core Setup package to set up dependency injection for the AWS Support service. // Use your AWS profile name, or leave it blank to use the default profile. // You must have a Business, Enterprise On-Ramp, or Enterprise Support subscription, or an exception will be thrown. using var host = Host.CreateDefaultBuilder(args) .ConfigureServices((_, services) => services.AddAWSService<IAmazonAWSSupport>() ).Build(); // Now the client is available for injection. var supportClient = host.Services.GetRequiredService<IAmazonAWSSupport>(); // We can use await and any of the async methods to get a response. var response = await supportClient.DescribeServicesAsync(); Console.WriteLine($"\tHello AWS Support! There are {response.Services.Count} services available."); } } // snippet-end:[Support.dotnetv3.HelloSupport]
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 using Amazon.AWSSupport; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; namespace SupportActions; /// <summary> /// Hello AWS Support example. /// </summary> public static class HelloSupport { static async Task Main(string[] args) { // snippet-start:[Support.dotnetv3.HelloSupport] // Use the AWS .NET Core Setup package to set up dependency injection for the AWS Support service. // Use your AWS profile name, or leave it blank to use the default profile. // You must have a Business, Enterprise On-Ramp, or Enterprise Support subscription, or an exception will be thrown. using var host = Host.CreateDefaultBuilder(args) .ConfigureServices((_, services) => services.AddAWSService<IAmazonAWSSupport>() ).Build(); // For this example, get the client from the host after setup. var supportClient = host.Services.GetRequiredService<IAmazonAWSSupport>(); var response = await supportClient.DescribeServicesAsync(); Console.WriteLine($"\tHello AWS Support! There are {response.Services.Count} services available."); // snippet-end:[Support.dotnetv3.HelloSupport] } }
apache-2.0
C#
3f52140a43181662cfc62c74d704ad347e9ebc5f
Add constructor on Airport class
StefanTod/SkyHighSim
Airtraffic_Simulator/Airport.cs
Airtraffic_Simulator/Airport.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Drawing; namespace Airtraffic_Simulator { class Airport { private string name; private int capacity; private Point location; private int lanes; public Airport(string name, int cap, Point location, int lanes) { this.name = name; this.capacity = cap; this.location = location; this.lanes = lanes; } public bool AddToQueue(Airplane p) { return true; } public bool RemoveFromQueue(Airplane p) { return true; } public bool AddFlight(Flight f) { return true; } public bool CreateProblem(int id, string type, TimeSpan duration) { return true; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Drawing; namespace Airtraffic_Simulator { class Airport { private string name; private int capacity; private Point location; private int lanes; public bool AddToQueue(Airplane p) { return true; } public bool RemoveFromQueue(Airplane p) { return true; } public bool AddFlight(Flight f) { return true; } public bool CreateProblem(int id, string type, TimeSpan duration) { return true; } } }
mit
C#
95e37d1833c1164bf17167a80771e40ea5ec3dc6
Extend the validation sample
ghuntley/Lager,flagbug/Lager
AndroidTest/SettingsActivity.cs
AndroidTest/SettingsActivity.cs
using Akavache; using Android.App; using Android.OS; using Android.Preferences; using Lager.Android; using System; using System.Linq; namespace AndroidTest { [Activity(Label = "My Activity")] public class SettingsActivity : PreferenceActivity { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); this.AddPreferencesFromResource(Resource.Layout.Settings); BlobCache.ApplicationName = "Settings Test App"; var storage = new TestSettings(); var textPreference = (EditTextPreference)this.FindPreference("pref_text"); textPreference.BindToSetting(storage, x => x.Text, x => x.Text, x => x.ToString()); var boolPreference = (CheckBoxPreference)this.FindPreference("pref_bool"); boolPreference.BindToSetting(storage, x => x.Boolean, x => x.Checked, x => bool.Parse((string)x)); var listPreference = (ListPreference)this.FindPreference("pref_list"); listPreference.SetEntryValues(Enum.GetNames(typeof(ListEnum))); listPreference.BindToSetting(storage, x => x.ListItem, x => x.Value, x => Enum.Parse(typeof(ListEnum), (string)x), x => x.ToString()); var validationPreference = (EditTextPreference)this.FindPreference("pref_validation"); validationPreference.EditText.TextChanged += (sender, args) => { int value = int.Parse(new string(args.Text.ToArray())); if (!IsValid(value)) { validationPreference.EditText.Error = "Value must be between 100 and 200!"; } }; validationPreference.BindToSetting(storage, x => x.Number, x => x.Text, x => int.Parse(x.ToString()), x => x.ToString(), x => IsValid(x)); } private static bool IsValid(int value) { return value > 100 && value < 200; } } }
using Akavache; using Android.App; using Android.OS; using Android.Preferences; using Lager.Android; using System; namespace AndroidTest { [Activity(Label = "My Activity")] public class SettingsActivity : PreferenceActivity { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); this.AddPreferencesFromResource(Resource.Layout.Settings); BlobCache.ApplicationName = "Settings Test App"; var storage = new TestSettings(); var textPreference = (EditTextPreference)this.FindPreference("pref_text"); textPreference.BindToSetting(storage, x => x.Text, x => x.Text, x => x.ToString()); var boolPreference = (CheckBoxPreference)this.FindPreference("pref_bool"); boolPreference.BindToSetting(storage, x => x.Boolean, x => x.Checked, x => bool.Parse((string)x)); var listPreference = (ListPreference)this.FindPreference("pref_list"); listPreference.SetEntryValues(Enum.GetNames(typeof(ListEnum))); listPreference.BindToSetting(storage, x => x.ListItem, x => x.Value, x => Enum.Parse(typeof(ListEnum), (string)x), x => x.ToString()); var validationPreference = (EditTextPreference)this.FindPreference("pref_validation"); validationPreference.BindToSetting(storage, x => x.Number, x => x.Text, x => int.Parse(x.ToString()), x => x.ToString(), x => x < 100 && x > 200); } } }
mit
C#
280d2aa4e4813dc689139d1639ba598d2bb39240
add comments to SetLabelFromBlendmode
momo-the-monster/workshop-trails
Assets/MMM/Trails/Scripts/SetLabelFromBlendmode.cs
Assets/MMM/Trails/Scripts/SetLabelFromBlendmode.cs
using UnityEngine; using System.Collections; using UnityEngine.UI; /* * Listen for MomoMirror.OnSwitched Event * Update Text Component with new Blend Mode */ namespace mmm { [RequireComponent(typeof(Text))] public class SetLabelFromBlendmode : MonoBehaviour { internal Text field; // Add and Remove the Event Listener void OnEnable() { MomoMirror.OnSwitched += OnSwitched; } void OnDisable() { MomoMirror.OnSwitched -= OnSwitched; } // Cache the Text Component void Start() { field = GetComponent<Text>(); } // Set Text on Event Trigger void OnSwitched ( MomoMirror.BlendModes b ) { field.text = "Blend: " + b.ToString(); } } }
using UnityEngine; using System.Collections; using UnityEngine.UI; namespace mmm { [RequireComponent(typeof(Text))] public class SetLabelFromBlendmode : MonoBehaviour { internal Text field; void OnEnable() { MomoMirror.OnSwitched += OnSwitched; } void OnDisable() { MomoMirror.OnSwitched -= OnSwitched; } void Start() { field = GetComponent<Text>(); } void OnSwitched ( MomoMirror.BlendModes b ) { field.text = "Blend: " + b.ToString(); } } }
mit
C#
ee0d4fec0a7a82f62f4f09b5aa38276498f3f637
remove explorer routes
chunye/azure-functions-ux,chunye/azure-functions-ux,agruning/azure-functions-ux,agruning/azure-functions-ux,projectkudu/AzureFunctions,agruning/azure-functions-ux,projectkudu/WebJobsPortal,projectkudu/AzureFunctions,chunye/azure-functions-ux,chunye/azure-functions-ux,agruning/azure-functions-ux,projectkudu/AzureFunctions,agruning/azure-functions-ux,projectkudu/WebJobsPortal,projectkudu/AzureFunctions,projectkudu/WebJobsPortal,projectkudu/WebJobsPortal,chunye/azure-functions-ux
AzureFunctions/App_Start/WebApiConfig.cs
AzureFunctions/App_Start/WebApiConfig.cs
using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Web; using System.Web.Http; using System.Web.Http.Routing; namespace AzureFunctions.App_Start { public class WebApiConfig { public static void Register(HttpConfiguration config) { GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; using System.Web.Http.Routing; namespace AzureFunctions.App_Start { public class WebApiConfig { public static void Register(HttpConfiguration config) { config.Routes.MapHttpRoute("get-operations", "api/operations", new { controller = "Operation", action = "Get" }, new { verb = new HttpMethodConstraint("GET", "HEAD") }); config.Routes.MapHttpRoute("get-providers-for-subscription", "api/operations/providers/{subscriptionId}", new { controller = "Operation", action = "GetProviders" }, new { verb = new HttpMethodConstraint("GET", "HEAD") }); config.Routes.MapHttpRoute("invoke-operation", "api/operations", new { controller = "Operation", action = "Invoke" }, new { verb = new HttpMethodConstraint("POST") }); config.Routes.MapHttpRoute("get-token", "api/token", new { controller = "ARM", action = "GetToken" }, new { verb = new HttpMethodConstraint("GET", "HEAD") }); config.Routes.MapHttpRoute("get-search", "api/search", new { controller = "ARM", action = "Search" }, new { verb = new HttpMethodConstraint("GET", "HEAD") }); config.Routes.MapHttpRoute("get", "api/{*path}", new { controller = "ARM", action = "Get" }, new { verb = new HttpMethodConstraint("GET", "HEAD") }); GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear(); } } }
apache-2.0
C#
a49b4a7a4ae27cf83a05835d8a10a10a01495e7e
Remove IEnumerator/Coroutine code - refer to previous commit to check it out
FancyVase/tiles
Assets/GoogleVR/Scripts/TileScript.cs
Assets/GoogleVR/Scripts/TileScript.cs
using UnityEngine; using System.Collections; public class TileScript : MonoBehaviour { public int col; private bool isOn; public AudioSource sound; private float TimeToFlash; private float TimeSinceStart; private MeshRenderer tile_renderer; // Use this for initialization void Awake () { isOn = false; TimeSinceStart = -col/5f; TimeToFlash = 0f; tile_renderer = GetComponent<MeshRenderer> (); } // Update is called once per frame void Update () { TimeSinceStart = TimeSinceStart + Time.deltaTime; if (TimeSinceStart > TimeToFlash) { TimeSinceStart = -3f; if (isOn) { tile_renderer.material.color = Color.cyan; } else { tile_renderer.material.color = new Color (0.180f, 0.180f, 0.180f); } Invoke ("resetColor", 1 / 5f); } } void resetColor () { if (tile_renderer != null) { if (isOn) { tile_renderer.material.color = Color.white; } else { tile_renderer.material.color = new Color (0.196f, 0.196f, 0.196f); } } } public void onClick() { isOn = !isOn; resetColor (); } }
using UnityEngine; using System.Collections; public class TileScript : MonoBehaviour { public int col; private bool isOn; public AudioSource sound; private float TimeToFlash; private float TimeSinceStart; private MeshRenderer tile_renderer; // Use this for initialization void Awake () { isOn = false; TimeSinceStart = -col/5f; TimeToFlash = 0f; // StartCoroutine (PlayToneLoop ()); tile_renderer = GetComponent<MeshRenderer> (); } // Update is called once per frame void Update () { TimeSinceStart = TimeSinceStart + Time.deltaTime; if (TimeSinceStart > TimeToFlash) { TimeSinceStart = -3f; if (isOn) { tile_renderer.material.color = Color.cyan; } else { tile_renderer.material.color = new Color (0.180f, 0.180f, 0.180f); } Invoke ("resetColor", 1 / 5f); } } void resetColor () { if (tile_renderer != null) { if (isOn) { tile_renderer.material.color = Color.white; } else { tile_renderer.material.color = new Color (0.196f, 0.196f, 0.196f); } } } // IEnumerator PlayToneLoop() { // yield return new WaitForSeconds(col/5f); // while (true) { //// PlaySound (); // if (isOn) { // MeshRenderer my_renderer = GetComponent<MeshRenderer> (); // if (my_renderer != null) { // my_renderer.material.color = Color.cyan; // } // yield return new WaitForSeconds (1 / 5f); // if (my_renderer != null) { // my_renderer.material.color = Color.white; // } // } else { // yield return new WaitForSeconds (1/5f); // } // //// MeshRenderer my_renderer = GetComponent<MeshRenderer>(); //// if (my_renderer != null) { //// my_renderer.material.color = Color.cyan; //// } //// yield return new WaitForSeconds (1/5f); //// if (my_renderer != null) { //// my_renderer.material.color = Color.white; //// } // yield return new WaitForSeconds(3); // } // } // public void playSound(int tone) { // playSound (tone); // } public void onClick() { isOn = !isOn; resetColor (); } }
mit
C#
03134c324b395d045bf54e24f4ead0913d6de950
bump revision
FacturAPI/facturapi-net
facturapi-net/Properties/AssemblyInfo.cs
facturapi-net/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("Facturapi")] [assembly: AssemblyDescription("Crea Facturas Electrónicas válidas en México lo más fácil posible (CFDI)")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Facturapi")] [assembly: AssemblyProduct("Facturapi")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("Facturapi")] [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("a91d3cf3-1051-41f4-833e-c52ee8fbce20")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.1.*")] [assembly: AssemblyFileVersion("0.1.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Facturapi")] [assembly: AssemblyDescription("Crea Facturas Electrónicas válidas en México lo más fácil posible (CFDI)")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Facturapi")] [assembly: AssemblyProduct("Facturapi")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("Facturapi")] [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("a91d3cf3-1051-41f4-833e-c52ee8fbce20")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.0.*")] [assembly: AssemblyFileVersion("0.1.0.0")]
mit
C#
2ab749369a45685366e3b100543a08703b115d05
Validate the paths to watch and the commands to execute. #2
fguchelaar/FileSystemActions
FSWActions.ConsoleApplication/Program.cs
FSWActions.ConsoleApplication/Program.cs
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using FSWActions.Core; using FSWActions.Core.Config; namespace FSWActions.ConsoleApplication { internal class Program { private static void Main(string[] args) { var configuration = WatchersConfiguration.LoadConfigFromPath("watchers.xml"); if (ValidateWatchers(configuration.Watchers)) { StartWatching(configuration.Watchers); } } private static bool ValidateWatchers(Collection<WatcherConfig> watchers) { bool valid = true; foreach (var watcherConfig in watchers) { if (!Directory.Exists(watcherConfig.Path)) { valid = false; Console.WriteLine("Watcher path not found: {0}", watcherConfig.Path); } foreach (var action in watcherConfig.ActionsConfig) { if (!File.Exists(action.Command)) { valid = false; Console.WriteLine("Action command not found: {0}", action.Command); } } } if (!valid) { // Wait for the user to quit the program. Console.WriteLine("\n\nPress any key to continue\n"); Console.ReadKey(true); } return valid; } private static void StartWatching(Collection<WatcherConfig> watchers) { var listOfWatchers = new List<Watcher>(watchers.Count); foreach (var watcherConfig in watchers) { foreach (var action in watcherConfig.ActionsConfig) { Console.WriteLine("{0} [{1}]\t{2}: {3}", watcherConfig.Path, watcherConfig.Filter, action.Event, action.Command); } var watcher = new Watcher(watcherConfig); listOfWatchers.Add(watcher); watcher.StartWatching(); } // Wait for the user to quit the program. Console.WriteLine("\n\nEnter \'q\' to quit\n"); while (Console.Read() != 'q') ; // Stop all watchers, not really necessary though... foreach (var watcher in listOfWatchers) { watcher.StopWatching(); } } } }
using System; using System.Collections.Generic; using FSWActions.Core; using FSWActions.Core.Config; namespace FSWActions.ConsoleApplication { internal class Program { private static void Main(string[] args) { var configuration = WatchersConfiguration.LoadConfigFromPath("watchers.xml"); var watchers = new List<Watcher>(configuration.Watchers.Count); foreach (var watcherConfig in configuration.Watchers) { foreach (var action in watcherConfig.ActionsConfig) { Console.WriteLine("{0} [{1}]\t{2}: {3}", watcherConfig.Path, watcherConfig.Filter, action.Event, action.Command); } var watcher = new Watcher(watcherConfig); watchers.Add(watcher); watcher.StartWatching(); } // Wait for the user to quit the program. Console.WriteLine("\n\nEnter \'q\' to quit\n"); while (Console.Read() != 'q') ; // Stop all watchers, not really necessary though... foreach (var watcher in watchers) { watcher.StopWatching(); } } } }
mit
C#
4c3381085476d703467e72810347e416818bd5e0
Update ScanBarCodePicture.cs
aspose-barcode/Aspose.BarCode-for-.NET,asposebarcode/Aspose_BarCode_NET,aspose-barcode/Aspose.BarCode-for-.NET,asposebarcode/Aspose_BarCode_NET,asposebarcode/Aspose_BarCode_NET,aspose-barcode/Aspose.BarCode-for-.NET
Examples/CSharp/ManageAndOptimizeBarcodeRecognition/ScanBarCodePicture.cs
Examples/CSharp/ManageAndOptimizeBarcodeRecognition/ScanBarCodePicture.cs
using System; using Aspose.BarCode.BarCodeRecognition; /* This project uses Automatic Package Restore feature of NuGet to resolve Aspose.BarCode for .NET API reference when the project is build. Please check https://docs.nuget.org/consume/nuget-faq for more information. If you do not wish to use NuGet, you can manually download Aspose.BarCode for .NET API from http://www.aspose.com/downloads, install it and then add its reference to this project. For any issues, questions or suggestions please feel free to contact us using http://www.aspose.com/community/forums/default.aspx */ namespace Aspose.BarCode.Examples.CSharp.ManageAndOptimizeBarCodeRecognition { class ScanBarCodePicture { public static void Run() { // ExStart:ScanBarCodePicture // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageAndOptimizeBarcodeRecognition(); try { // Read file from directory with DecodeType.EAN13 BarCodeReader reader = new BarCodeReader(dataDir + "Scan.jpg", DecodeType.EAN13); while (reader.Read()) { // Read symbology type and code text Console.WriteLine("Symbology Type: " + reader.GetCodeType()); Console.WriteLine("CodeText: " + reader.GetCodeText()); } reader.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message + "\nThis example will only work if you apply a valid Aspose BarCode License. You can purchase full license or get 30 day temporary license from http://www.aspose.com/purchase/default.aspx."); } // ExEnd:ScanBarCodePicture } } }
using System; using Aspose.BarCode.BarCodeRecognition; /* This project uses Automatic Package Restore feature of NuGet to resolve Aspose.BarCode for .NET API reference when the project is build. Please check https://docs.nuget.org/consume/nuget-faq for more information. If you do not wish to use NuGet, you can manually download Aspose.BarCode for .NET API from http://www.aspose.com/downloads, install it and then add its reference to this project. For any issues, questions or suggestions please feel free to contact us using http://www.aspose.com/community/forums/default.aspx */ namespace Aspose.BarCode.Examples.CSharp.ManageAndOptimizeBarCodeRecognition { class ScanBarCodePicture { public static void Run() { // ExStart:ScanBarCodePicture // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageAndOptimizeBarcodeRecognition(); try { // Read file from directory with DecodeType.EAN13 BarCodeReader reader = new BarCodeReader(dataDir + "Scan.jpg", DecodeType.EAN13); while (reader.Read()) { // Read symbology type and code text Console.WriteLine("Symbology Type: " + reader.GetCodeType()); Console.WriteLine("CodeText: " + reader.GetCodeText()); } reader.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message + "\nThis example will only work if you apply a valid Aspose BarCode License. You can purchase full license or get 30 day temporary license from http://wwww.aspose.com/purchase/default.aspx."); } // ExEnd:ScanBarCodePicture } } }
mit
C#
5969850e06a3f014dc3608bc1383c46a2ceb300b
Reduce "About" text padding
danielchalmers/DesktopWidgets
DesktopWidgets/Helpers/AboutHelper.cs
DesktopWidgets/Helpers/AboutHelper.cs
using System.Text; using DesktopWidgets.Classes; using DesktopWidgets.Properties; namespace DesktopWidgets.Helpers { public static class AboutHelper { public static string AboutText { get { var stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"{AssemblyInfo.Title} ({AssemblyInfo.Version})"); stringBuilder.AppendLine(); stringBuilder.AppendLine($"Project: {Resources.GitHubMainPage}"); stringBuilder.AppendLine($"Changes: {Resources.GitHubCommits}"); stringBuilder.AppendLine($"Issues: {Resources.GitHubIssues}"); stringBuilder.AppendLine(); stringBuilder.AppendLine($"Icon made by {IconCredits}"); stringBuilder.AppendLine(); stringBuilder.Append(AssemblyInfo.Copyright); return stringBuilder.ToString(); } } private static string IconCredits { get; } = "Freepik (http://www.freepik.com) from www.flaticon.com" + " is licensed under CC BY 3.0 (http://creativecommons.org/licenses/by/3.0/)"; } }
using System.Text; using DesktopWidgets.Classes; using DesktopWidgets.Properties; namespace DesktopWidgets.Helpers { public static class AboutHelper { public static string AboutText { get { var stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"{AssemblyInfo.Title} ({AssemblyInfo.Version})"); stringBuilder.AppendLine(); stringBuilder.AppendLine(); stringBuilder.AppendLine($"Project: {Resources.GitHubMainPage}"); stringBuilder.AppendLine($"Changes: {Resources.GitHubCommits}"); stringBuilder.AppendLine($"Issues: {Resources.GitHubIssues}"); stringBuilder.AppendLine(); stringBuilder.AppendLine($"Icon made by {IconCredits}"); stringBuilder.AppendLine(); stringBuilder.AppendLine(); stringBuilder.Append(AssemblyInfo.Copyright); return stringBuilder.ToString(); } } private static string IconCredits { get; } = "Freepik (http://www.freepik.com) from www.flaticon.com" + " is licensed under CC BY 3.0 (http://creativecommons.org/licenses/by/3.0/)"; } }
apache-2.0
C#
39eda5e413b5eb9f913f0829d73a1f841bbb38bf
update ErrorException
messagebird/csharp-rest-api
MessageBird/Exceptions/ErrorException.cs
MessageBird/Exceptions/ErrorException.cs
using System; using System.Collections.Generic; using MessageBird.Objects; using Newtonsoft.Json; namespace MessageBird.Exceptions { public class ErrorException : Exception { private readonly ICollection<Error> errors; // IEnumerable to be immitable. // TODO: should these really be based on the JSON Errors class, and not a resource translation of it? public IEnumerable<Error> Errors { get { return errors; } } public string Reason { get; private set; } public bool HasErrors { get { return (Errors != null) && (errors.Count > 0); } } public bool HasReason { get { return !String.IsNullOrEmpty(Reason); } } public ErrorException(string reason, Exception? innerException = null) : base(reason, innerException) { Reason = reason; } public ErrorException(ICollection<Error> errors, Exception innerException) : base("multiple errors", innerException) { this.errors = errors; } // XXX: Solve explicit use of json deserialation, needs to be more generic! public static ErrorException FromResponse(string response, Exception innerException) { try { var errors = JsonConvert.DeserializeObject<Dictionary<string, List<Error>>>(response); return new ErrorException(errors["errors"], innerException); } catch (JsonSerializationException) { return null; } } } }
using System; using System.Collections.Generic; using MessageBird.Objects; using Newtonsoft.Json; namespace MessageBird.Exceptions { public class ErrorException : Exception { private readonly ICollection<Error> errors; // IEnumerable to be immitable. // TODO: should these really be based on the JSON Errors class, and not a resource translation of it? public IEnumerable<Error> Errors { get { return errors; } } public string Reason { get; private set; } public bool HasErrors { get { return (Errors != null) && (errors.Count > 0); } } public bool HasReason { get { return !String.IsNullOrEmpty(Reason); } } public ErrorException(string reason, Exception innerException = null) : base(reason, innerException) { Reason = reason; } public ErrorException(ICollection<Error> errors, Exception innerException) : base("multiple errors", innerException) { this.errors = errors; } // XXX: Solve explicit use of json deserialation, needs to be more generic! public static ErrorException FromResponse(string response, Exception innerException) { try { var errors = JsonConvert.DeserializeObject<Dictionary<string, List<Error>>>(response); return new ErrorException(errors["errors"], innerException); } catch (JsonSerializationException) { return null; } } } }
isc
C#
c7a978f02f72a24954ee082d7740b2196580f840
Update for Besiege v0.45
spaar/automatron-mod,spaar/automatron-mod
Automatron/Mod.cs
Automatron/Mod.cs
using System; using System.Collections.Generic; using Blocks; using spaar.ModLoader; using spaar.Mods.Automatron.Actions; using TheGuysYouDespise; using UnityEngine; namespace spaar.Mods.Automatron { public class AutomatronMod : BlockMod { public override string Name { get; } = "automatron"; public override string DisplayName { get; } = "Automatron"; public override string Author { get; } = "spaar"; public override Version Version { get; } = new Version(1, 1, 5); public override string VersionExtra { get; } = ""; public override string BesiegeVersion { get; } = "v0.45"; public override bool CanBeUnloaded { get; } = false; public override bool Preload { get; } = false; private Block automatronBlock = new Block() .ID(410) .BlockName("Automatron") .Obj(new List<Obj> { new Obj("Automatron.obj", "Automatron.png", new VisualOffset(new Vector3(0.48f, 0.48f, 0.48f), new Vector3(0.0f, 0.0f, 0.5f), new Vector3(180f, 180f, 0f))) }) .IconOffset(new Icon( new Vector3(1.0f, 1.0f, 1.0f), new Vector3(0.0f, 0f, 0f), new Vector3(360f, 70f, 300f))) .Components(new[] { typeof(AutomatronBlock) }) .Properties(new BlockProperties().SearchKeywords(new[] { "Automatron", "Automation" })) .Mass(1.5f) .ShowCollider(false) .CompoundCollider(new List<ColliderComposite> { ColliderComposite.Box(new Vector3(1.00f, 1.00f, 1.00f), new Vector3(0, 0, 0.5f), new Vector3(0, 0, 0)) }) .IgnoreIntersectionForBase() .NeededResources(new List<NeededResource>()) .AddingPoints(new List<AddingPoint>()); public override void OnLoad() { LoadBlock(automatronBlock); ActionPressKey.StartKeySim(); } public override void OnUnload() { Configuration.Save(); ActionPressKey.StopKeySim(); } } }
using System; using System.Collections.Generic; using Blocks; using spaar.ModLoader; using spaar.Mods.Automatron.Actions; using TheGuysYouDespise; using UnityEngine; namespace spaar.Mods.Automatron { public class AutomatronMod : BlockMod { public override string Name { get; } = "automatron"; public override string DisplayName { get; } = "Automatron"; public override string Author { get; } = "spaar"; public override Version Version { get; } = new Version(1, 1, 4); public override string VersionExtra { get; } = ""; public override string BesiegeVersion { get; } = "v0.35"; public override bool CanBeUnloaded { get; } = false; public override bool Preload { get; } = false; private Block automatronBlock = new Block() .ID(410) .BlockName("Automatron") .Obj(new List<Obj> { new Obj("Automatron.obj", "Automatron.png", new VisualOffset(new Vector3(0.48f, 0.48f, 0.48f), new Vector3(0.0f, 0.0f, 0.5f), new Vector3(180f, 180f, 0f))) }) .IconOffset(new Icon( new Vector3(1.0f, 1.0f, 1.0f), new Vector3(0.0f, 0f, 0f), new Vector3(360f, 70f, 300f))) .Components(new[] { typeof(AutomatronBlock) }) .Properties(new BlockProperties().SearchKeywords(new[] { "Automatron", "Automation" })) .Mass(1.5f) .ShowCollider(false) .CompoundCollider(new List<ColliderComposite> { ColliderComposite.Box(new Vector3(1.00f, 1.00f, 1.00f), new Vector3(0, 0, 0.5f), new Vector3(0, 0, 0)) }) .IgnoreIntersectionForBase() .NeededResources(new List<NeededResource>()) .AddingPoints(new List<AddingPoint>()); public override void OnLoad() { LoadBlock(automatronBlock); ActionPressKey.StartKeySim(); } public override void OnUnload() { Configuration.Save(); ActionPressKey.StopKeySim(); } } }
mit
C#
5a5e212dc73e6981c736652e25d551ceed56e40d
Fix photo change
Barrelrolla/MonsterClicker
MonsterClicker/MonsterClicker/Monster.cs
MonsterClicker/MonsterClicker/Monster.cs
using System; using System.Collections.Generic; namespace MonsterClicker { using Interfaces; using System.Numerics; using System.Windows.Forms; public class Monster : IMonster { private BigInteger health; private static BigInteger startHealth = 10; private BigInteger nextLevelHealth = startHealth; //private List<string> photosPaths; private Random randomGenerator; private int currentNumber = 0; //TODO: exp and money - every next monster must have more money and exp //TODO: exp must be part of health //TODO: make class Boss //TODO: make homework //TODO: Timer public Monster() { this.Health = startHealth; //this.photosPaths = new List<string>(); this.randomGenerator = new System.Random(); } public BigInteger Health { get { return this.health; } set { this.health = value; } } public void TakeDamage(BigInteger damage) { this.Health -= damage; } public void GenerateHealth() { nextLevelHealth += (nextLevelHealth / 10); this.health = nextLevelHealth; } public int GetRandomNumber() { var number = randomGenerator.Next(0, 5); if (number == this.currentNumber) { while (number == this.currentNumber) { number = randomGenerator.Next(0, 5); } } else { this.currentNumber = number; } return number; } } }
using System; using System.Collections.Generic; namespace MonsterClicker { using Interfaces; using System.Numerics; using System.Windows.Forms; public class Monster : IMonster { private BigInteger health; private static BigInteger startHealth = 10; private BigInteger nextLevelHealth = startHealth; //private List<string> photosPaths; private Random randomGenerator; //TODO: exp and money - every next monster must have more money and exp //TODO: exp must be part of health //TODO: make class Boss //TODO: make homework //TODO: Timer public Monster() { this.Health = startHealth; //this.photosPaths = new List<string>(); this.randomGenerator = new System.Random(); } public BigInteger Health { get { return this.health; } set { this.health = value; } } public void TakeDamage(BigInteger damage) { this.Health -= damage; } public void GenerateHealth() { nextLevelHealth += (nextLevelHealth / 10); this.health = nextLevelHealth; } public int GetRandomNumber() { int firstNumber = 0; var number = randomGenerator.Next(0, 5); if (number == firstNumber) { while (number == firstNumber) { number = randomGenerator.Next(0, 5); } } else { firstNumber = number; } return number; } } }
mit
C#
7e6daf5e767c9e04a6def9cd4f9c958b21c69262
fix portable compile
lontivero/NBitcoin,NicolasDorier/NBitcoin,MetacoSA/NBitcoin,MetacoSA/NBitcoin,stratisproject/NStratis,thepunctuatedhorizon/BrickCoinAlpha.0.0.1,bitcoinbrisbane/NBitcoin,HermanSchoenfeld/NBitcoin,dangershony/NStratis
NBitcoin/Crypto/DeterministicECDSA.cs
NBitcoin/Crypto/DeterministicECDSA.cs
using NBitcoin.BouncyCastle.Crypto; using NBitcoin.BouncyCastle.Crypto.Parameters; using NBitcoin.BouncyCastle.Crypto.Signers; using NBitcoin.BouncyCastle.Security; using System.Linq; namespace NBitcoin.Crypto { static class DeterministicDSAExtensions { public static void Update(this IMac hmac, byte[] input) { hmac.BlockUpdate(input, 0, input.Length); } public static byte[] DoFinal(this IMac hmac) { byte[] result = new byte[hmac.GetMacSize()]; hmac.DoFinal(result, 0); return result; } public static void Update(this IDigest digest, byte[] input) { digest.BlockUpdate(input, 0, input.Length); } public static void Update(this IDigest digest, byte[] input, int offset, int length) { digest.BlockUpdate(input, offset, length); } public static byte[] Digest(this IDigest digest) { byte[] result = new byte[digest.GetDigestSize()]; digest.DoFinal(result, 0); return result; } } public class DeterministicECDSA : ECDsaSigner { private byte[] _buffer = new byte[0]; private readonly IDigest _digest; public DeterministicECDSA() : this("SHA-256") { } public DeterministicECDSA(string hashName) : base(new HMacDsaKCalculator(DigestUtilities.GetDigest(hashName))) { _digest = DigestUtilities.GetDigest(hashName); } public void setPrivateKey(ECPrivateKeyParameters ecKey) { base.Init(true, ecKey); } public void update(byte[] buf) { _buffer = _buffer.Concat(buf).ToArray(); } public byte[] sign() { var hash = new byte[_digest.GetDigestSize()]; _digest.BlockUpdate(_buffer, 0, _buffer.Length); _digest.DoFinal(hash, 0); _digest.Reset(); return signHash(hash); } public byte[] signHash(byte[] hash) { return new ECDSASignature(GenerateSignature(hash)).ToDER(); } } }
using NBitcoin.BouncyCastle.Crypto; using NBitcoin.BouncyCastle.Crypto.Parameters; using NBitcoin.BouncyCastle.Crypto.Signers; using NBitcoin.BouncyCastle.Security; using System.Linq; namespace NBitcoin.Crypto { public class DeterministicECDSA : ECDsaSigner { private byte[] _buffer = new byte[0]; private readonly IDigest _digest; public DeterministicECDSA() : this("SHA-256") { } public DeterministicECDSA(string hashName) : base(new HMacDsaKCalculator(DigestUtilities.GetDigest(hashName))) { _digest = DigestUtilities.GetDigest(hashName); } public void setPrivateKey(ECPrivateKeyParameters ecKey) { base.Init(true, ecKey); } public void update(byte[] buf) { _buffer = _buffer.Concat(buf).ToArray(); } public byte[] sign() { var hash = new byte[_digest.GetDigestSize()]; _digest.BlockUpdate(_buffer, 0, _buffer.Length); _digest.DoFinal(hash, 0); _digest.Reset(); return signHash(hash); } public byte[] signHash(byte[] hash) { return new ECDSASignature(GenerateSignature(hash)).ToDER(); } } }
mit
C#
2d489065230bab8802506813ca8c35eb672aeb4a
Use Marshaller methods in Argv for g_malloc and g_free
sillsdev/gtk-sharp,antoniusriha/gtk-sharp,akrisiun/gtk-sharp,orion75/gtk-sharp,Gankov/gtk-sharp,Gankov/gtk-sharp,openmedicus/gtk-sharp,openmedicus/gtk-sharp,antoniusriha/gtk-sharp,sillsdev/gtk-sharp,openmedicus/gtk-sharp,openmedicus/gtk-sharp,orion75/gtk-sharp,antoniusriha/gtk-sharp,sillsdev/gtk-sharp,Gankov/gtk-sharp,akrisiun/gtk-sharp,antoniusriha/gtk-sharp,orion75/gtk-sharp,sillsdev/gtk-sharp,antoniusriha/gtk-sharp,openmedicus/gtk-sharp,Gankov/gtk-sharp,orion75/gtk-sharp,Gankov/gtk-sharp,sillsdev/gtk-sharp,akrisiun/gtk-sharp,akrisiun/gtk-sharp,orion75/gtk-sharp,openmedicus/gtk-sharp,akrisiun/gtk-sharp,Gankov/gtk-sharp,openmedicus/gtk-sharp
glib/Argv.cs
glib/Argv.cs
// GLib.Argv.cs : Argv marshaling class // // Author: Mike Kestner <mkestner@novell.com> // // Copyright (c) 2004 Novell, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. namespace GLib { using System; using System.Runtime.InteropServices; public class Argv { IntPtr[] arg_ptrs; IntPtr handle; bool add_progname = false; ~Argv () { Marshaller.Free (arg_ptrs); Marshaller.Free (handle); } public Argv (string[] args) : this (args, false) {} public Argv (string[] args, bool add_program_name) { add_progname = add_program_name; if (add_progname) { string[] full = new string [args.Length + 1]; full [0] = System.Environment.GetCommandLineArgs ()[0]; args.CopyTo (full, 1); args = full; } arg_ptrs = new IntPtr [args.Length]; for (int i = 0; i < args.Length; i++) arg_ptrs [i] = Marshaller.StringToPtrGStrdup (args[i]); handle = Marshaller.Malloc ((ulong)(IntPtr.Size * args.Length)); for (int i = 0; i < args.Length; i++) Marshal.WriteIntPtr (handle, i * IntPtr.Size, arg_ptrs [i]); } public IntPtr Handle { get { return handle; } } public string[] GetArgs (int argc) { int count = add_progname ? argc - 1 : argc; int idx = add_progname ? 1 : 0; string[] result = new string [count]; for (int i = 0; i < count; i++, idx++) result [i] = Marshaller.Utf8PtrToString (Marshal.ReadIntPtr (handle, idx * IntPtr.Size)); return result; } } }
// GLib.Argv.cs : Argv marshaling class // // Author: Mike Kestner <mkestner@novell.com> // // Copyright (c) 2004 Novell, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. namespace GLib { using System; using System.Runtime.InteropServices; public class Argv { IntPtr[] arg_ptrs; IntPtr handle; bool add_progname = false; [DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)] static extern IntPtr g_malloc(IntPtr size); [DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)] static extern void g_free (IntPtr mem); ~Argv () { foreach (IntPtr arg in arg_ptrs) g_free (arg); g_free (handle); } public Argv (string[] args) : this (args, false) {} public Argv (string[] args, bool add_program_name) { add_progname = add_program_name; if (add_progname) { string[] full = new string [args.Length + 1]; full [0] = System.Environment.GetCommandLineArgs ()[0]; args.CopyTo (full, 1); args = full; } arg_ptrs = new IntPtr [args.Length]; for (int i = 0; i < args.Length; i++) arg_ptrs [i] = Marshaller.StringToPtrGStrdup (args[i]); handle = g_malloc (new IntPtr (IntPtr.Size * args.Length)); for (int i = 0; i < args.Length; i++) Marshal.WriteIntPtr (handle, i * IntPtr.Size, arg_ptrs [i]); } public IntPtr Handle { get { return handle; } } public string[] GetArgs (int argc) { int count = add_progname ? argc - 1 : argc; int idx = add_progname ? 1 : 0; string[] result = new string [count]; for (int i = 0; i < count; i++, idx++) result [i] = Marshaller.Utf8PtrToString (Marshal.ReadIntPtr (handle, idx * IntPtr.Size)); return result; } } }
lgpl-2.1
C#
dccf6119c20cffafd5c8d3ffde44d427d6956285
Use zip!
shiftkey/SignalR,shiftkey/SignalR
SignalR/Hubs/Lookup/DefaultParameterResolver.cs
SignalR/Hubs/Lookup/DefaultParameterResolver.cs
using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace SignalR.Hubs { public class DefaultParameterResolver : IParameterResolver { /// <summary> /// Resolves a parameter value based on the provided object. /// </summary> /// <param name="descriptor">Parameter descriptor.</param> /// <param name="value">Value to resolve the parameter value from.</param> /// <returns>The parameter value.</returns> public virtual object ResolveParameter(ParameterDescriptor descriptor, JToken value) { if (value.GetType() == descriptor.Type) { return value; } // A non generic implementation of ToObject<T> on JToken using (var jsonReader = new JTokenReader(value)) { var serializer = new JsonSerializer(); return serializer.Deserialize(jsonReader, descriptor.Type); } } /// <summary> /// Resolves method parameter values based on provided objects. /// </summary> /// <param name="method">Method descriptor.</param> /// <param name="values">List of values to resolve parameter values from.</param> /// <returns>Array of parameter values.</returns> public virtual object[] ResolveMethodParameters(MethodDescriptor method, params JToken[] values) { return method.Parameters.Zip(values, ResolveParameter).ToArray(); } } }
using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace SignalR.Hubs { public class DefaultParameterResolver : IParameterResolver { /// <summary> /// Resolves a parameter value based on the provided object. /// </summary> /// <param name="descriptor">Parameter descriptor.</param> /// <param name="value">Value to resolve the parameter value from.</param> /// <returns>The parameter value.</returns> public virtual object ResolveParameter(ParameterDescriptor descriptor, JToken value) { if (value.GetType() == descriptor.Type) { return value; } // A non generic implementation of ToObject<T> on JToken using (var jsonReader = new JTokenReader(value)) { var serializer = new JsonSerializer(); return serializer.Deserialize(jsonReader, descriptor.Type); } } /// <summary> /// Resolves method parameter values based on provided objects. /// </summary> /// <param name="method">Method descriptor.</param> /// <param name="values">List of values to resolve parameter values from.</param> /// <returns>Array of parameter values.</returns> public virtual object[] ResolveMethodParameters(MethodDescriptor method, params JToken[] values) { return method.Parameters .Select((p, index) => ResolveParameter(p, values[index])) .ToArray(); } } }
mit
C#
5a9ae8ddeb7bd006a424b4ef5c14f383c2487ec1
Add await to console.Log calls.
xamarin/WebSharp,xamarin/WebSharp,xamarin/WebSharp,xamarin/WebSharp,xamarin/WebSharp,xamarin/WebSharp
Tools/generator-electron-dotnet/generators/app/templates/dotnet-websharp/src/websharp.cs
Tools/generator-electron-dotnet/generators/app/templates/dotnet-websharp/src/websharp.cs
using System; using System.Threading.Tasks; using WebSharpJs.NodeJS; //namespace <%- wsClassName %> //{ public class Startup { static WebSharpJs.NodeJS.Console console; /// <summary> /// Default entry into managed code. /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task<object> Invoke(object input) { if (console == null) console = await WebSharpJs.NodeJS.Console.Instance(); try { await console.Log($"Hello: {input}"); } catch (Exception exc) { await console.Log($"extension exception: {exc.Message}"); } return null; } } //}
using System; using System.Threading.Tasks; using WebSharpJs.NodeJS; //namespace <%- wsClassName %> //{ public class Startup { static WebSharpJs.NodeJS.Console console; /// <summary> /// Default entry into managed code. /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task<object> Invoke(object input) { if (console == null) console = await WebSharpJs.NodeJS.Console.Instance(); try { console.Log($"Hello: {input}"); } catch (Exception exc) { console.Log($"extension exception: {exc.Message}"); } return null; } } //}
mit
C#
4de8786b3db252da44b78e7bc752031b88753888
Implement missing FontsHandler.FontFamilyAvailable
bbqchickenrobot/Eto-1,l8s/Eto,PowerOfCode/Eto,l8s/Eto,bbqchickenrobot/Eto-1,PowerOfCode/Eto,l8s/Eto,bbqchickenrobot/Eto-1,PowerOfCode/Eto
Source/Eto.Platform.Wpf/Drawing/FontsHandler.cs
Source/Eto.Platform.Wpf/Drawing/FontsHandler.cs
using Eto.Drawing; using System; using System.Collections.Generic; using System.Linq; using System.Text; using swm = System.Windows.Media; namespace Eto.Platform.Wpf.Drawing { public class FontsHandler : WidgetHandler<Widget>, IFonts { HashSet<string> availableFontFamilies; public IEnumerable<FontFamily> AvailableFontFamilies { get { return swm.Fonts.SystemFontFamilies.Select (r => new FontFamily (Generator, new FontFamilyHandler (r))); ; } } public bool FontFamilyAvailable (string fontFamily) { if (availableFontFamilies == null) { availableFontFamilies = new HashSet<string> (StringComparer.InvariantCultureIgnoreCase); foreach (var family in swm.Fonts.SystemFontFamilies) { availableFontFamilies.Add (family.Source); } } return availableFontFamilies.Contains (fontFamily); } } }
using Eto.Drawing; using System; using System.Collections.Generic; using System.Linq; using System.Text; using swm = System.Windows.Media; namespace Eto.Platform.Wpf.Drawing { public class FontsHandler : WidgetHandler<Widget>, IFonts { public IEnumerable<FontFamily> AvailableFontFamilies { get { return swm.Fonts.SystemFontFamilies.Select (r => new FontFamily(Generator, new FontFamilyHandler(r))); ; } } } }
bsd-3-clause
C#
043199512ff5cb381135dbe2a34d291a5ef89cdf
Add BGP header to all BGP message types
mstrother/BmpListener
BmpListener/Bmp/PeerUpNotification.cs
BmpListener/Bmp/PeerUpNotification.cs
using System; using System.Linq; using System.Net; using BmpListener.Bgp; namespace BmpListener.Bmp { public class PeerUpNotification : BmpMessage { public PeerUpNotification(BmpHeader bmpHeader, ArraySegment<byte> data) : base(bmpHeader, ref data) { ParseBody(data); } public IPAddress LocalAddress { get; set; } public ushort LocalPort { get; set; } public ushort RemotePort { get; set; } public BgpMessage SentOpenMessage { get; set; } public BgpMessage ReceivedOpenMessage { get; set; } public void ParseBody(ArraySegment<byte> data) { //if ((message.PeerHeader.Flags & (1 << 7)) != 0) //{ LocalAddress = new IPAddress(data.Take(16).ToArray()); //} LocalPort = data.ToUInt16(16); RemotePort = data.ToUInt16(18); var offset = data.Offset + 20; var count = data.Count - 20; data = new ArraySegment<byte>(data.Array, offset, count); SentOpenMessage = BgpMessage.GetBgpMessage(data); offset = data.Offset + SentOpenMessage.Header.Length; count = data.Count - SentOpenMessage.Header.Length; data = new ArraySegment<byte>(data.Array, offset, count); ReceivedOpenMessage = BgpMessage.GetBgpMessage(data); } } }
using System; using System.Linq; using System.Net; using BmpListener.Bgp; namespace BmpListener.Bmp { public class PeerUpNotification : BmpMessage { public PeerUpNotification(BmpHeader bmpHeader, ArraySegment<byte> data) : base(bmpHeader, ref data) { ParseBody(data); } public IPAddress LocalAddress { get; set; } public ushort LocalPort { get; set; } public ushort RemotePort { get; set; } public BgpMessage SentOpenMessage { get; set; } public BgpMessage ReceivedOpenMessage { get; set; } public void ParseBody(ArraySegment<byte> data) { //if ((message.PeerHeader.Flags & (1 << 7)) != 0) //{ LocalAddress = new IPAddress(data.Take(16).ToArray()); //} LocalPort = data.ToUInt16(16); RemotePort = data.ToUInt16(18); var offset = data.Offset + 20; var count = data.Count - 20; data = new ArraySegment<byte>(data.Array, offset, count); SentOpenMessage = BgpMessage.GetBgpMessage(data); offset = data.Offset + SentOpenMessage.Length; count = data.Count - SentOpenMessage.Length; data = new ArraySegment<byte>(data.Array, offset, count); ReceivedOpenMessage = BgpMessage.GetBgpMessage(data); } } }
mit
C#
fb0cf62ff2dbe8bb46a307fd8671344600601ac5
Add DebuggerDisplay to RequestKey.
tiesmaster/DCC,tiesmaster/DCC
Dcc/RequestKey.cs
Dcc/RequestKey.cs
using System.Diagnostics; using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; namespace Tiesmaster.Dcc { // ReSharper disable once UseNameofExpression [DebuggerDisplay("{DebuggerDisplay,nq}")] public struct RequestKey { private readonly string _method; private readonly PathString _path; public RequestKey(HttpRequest request) { _method = request.Method; _path = request.Path; } public async Task<TapedResponse> CreateTapeFromAsync(HttpResponseMessage httpResponseMessage) { var body = await httpResponseMessage.Content.ReadAsByteArrayAsync(); return new HttpClientTapedResponse(this, httpResponseMessage, body); } private string DebuggerDisplay => $"{_method}: {_path}"; } }
using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; namespace Tiesmaster.Dcc { public struct RequestKey { private readonly string _method; private readonly PathString _path; public RequestKey(HttpRequest request) { _method = request.Method; _path = request.Path; } public async Task<TapedResponse> CreateTapeFromAsync(HttpResponseMessage httpResponseMessage) { var body = await httpResponseMessage.Content.ReadAsByteArrayAsync(); return new HttpClientTapedResponse(this, httpResponseMessage, body); } } }
mit
C#
e01393f257a3210ea84ee42a855befe1da0c4430
Fix GitIsDetached
nuke-build/nuke,nuke-build/nuke,nuke-build/nuke,nuke-build/nuke
source/Nuke.Common/Tools/Git/GitTasks.cs
source/Nuke.Common/Tools/Git/GitTasks.cs
// Copyright 2021 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Linq; namespace Nuke.Common.Tools.Git { public static partial class GitTasks { public static bool GitIsDetached() { return GitIsDetached(workingDirectory: null); } public static bool GitIsDetached(string workingDirectory) { return !Git("branch --show-current", workingDirectory, logOutput: false).Any(); } public static bool GitHasCleanWorkingCopy() { return GitHasCleanWorkingCopy(workingDirectory: null); } public static bool GitHasCleanWorkingCopy(string workingDirectory) { return !Git("status --short", workingDirectory, logOutput: false).Any(); } public static string GitCurrentBranch() { return GitCurrentBranch(workingDirectory: null); } public static string GitCurrentBranch(string workingDirectory) { return Git("rev-parse --abbrev-ref HEAD", workingDirectory, logOutput: false).Select(x => x.Text).Single(); } public static string GitCurrentCommit() { return GitCurrentCommit(workingDirectory: null); } public static string GitCurrentCommit(string workingDirectory) { return Git("rev-parse HEAD", workingDirectory, logOutput: false).Select(x => x.Text).Single(); } } }
// Copyright 2021 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Linq; namespace Nuke.Common.Tools.Git { public static partial class GitTasks { public static bool GitIsDetached() { return GitIsDetached(workingDirectory: null); } public static bool GitIsDetached(string workingDirectory) { return !Git("symbolic-ref --short -q HEAD", workingDirectory, logOutput: false).Any(); } public static bool GitHasCleanWorkingCopy() { return GitHasCleanWorkingCopy(workingDirectory: null); } public static bool GitHasCleanWorkingCopy(string workingDirectory) { return !Git("status --short", workingDirectory, logOutput: false).Any(); } public static string GitCurrentBranch() { return GitCurrentBranch(workingDirectory: null); } public static string GitCurrentBranch(string workingDirectory) { return Git("rev-parse --abbrev-ref HEAD", workingDirectory, logOutput: false).Select(x => x.Text).Single(); } public static string GitCurrentCommit() { return GitCurrentCommit(workingDirectory: null); } public static string GitCurrentCommit(string workingDirectory) { return Git("rev-parse HEAD", workingDirectory, logOutput: false).Select(x => x.Text).Single(); } } }
mit
C#
98b5a136bfb71ab123d715f5b2242fd00ddad936
clean BaseEntity
WeihanLi/WeihanLi.Common,WeihanLi/WeihanLi.Common,WeihanLi/WeihanLi.Common
src/WeihanLi.Common/Models/BaseEntity.cs
src/WeihanLi.Common/Models/BaseEntity.cs
namespace WeihanLi.Common.Models { public class BaseEntity<TKey> { public TKey Id { get; set; } } public class BaseEntityWithDeleted<TKey> { public TKey Id { get; set; } public bool IsDeleted { get; set; } } public class BaseEntityWithReviewState<TKey> { public TKey Id { get; set; } public ReviewState State { get; set; } } public class BaseEntityWithReviewStateWithDeleted<TKey> { public TKey Id { get; set; } public ReviewState State { get; set; } public bool IsDeleted { get; set; } } public class BaseEntity : BaseEntity<int> { } public class BaseEntityWithDeleted : BaseEntityWithDeleted<int> { } public class BaseEntityWithReviewState : BaseEntityWithReviewState<int> { } public class BaseEntityWithReviewStateWithDeleted : BaseEntityWithReviewStateWithDeleted<int> { } }
namespace WeihanLi.Common.Models { public class BaseEntity<TKey> { public TKey Id { get; set; } } public class BaseEntityWithDeleted<TKey> { public TKey Id { get; set; } public bool IsDeleted { get; set; } } public class BaseEntityWithReviewState<TKey> { public TKey Id { get; set; } public ReviewState State { get; set; } } public class BaseEntityWithReviewStateWithDeleted<TKey> { public TKey Id { get; set; } public ReviewState State { get; set; } public bool IsDeleted { get; set; } } public class BaseEntity : BaseEntity<int> { } public class BaseEntityWithDeleted : BaseEntityWithDeleted<int> { } public class BaseEntityWithReviewState : BaseEntityWithReviewState<int> { } public class BaseEntityWithReviewStateWithDeleted : BaseEntityWithReviewStateWithDeleted<int> { } }
mit
C#
4fb1f5bc1dd5ca8f264c0535e3306f7cbef527ce
Use product_build database.
dbsafe/dbsafe
PgDbSafeTests/PgDatabaseClientTest.cs
PgDbSafeTests/PgDatabaseClientTest.cs
using DbSafe; using DbSafe.FileDefinition; using Microsoft.VisualStudio.TestTools.UnitTesting; using PgDbSafe; using System.Xml.Linq; namespace PgDbSafeTests { [TestClass] public class PgDatabaseClientTest { private PgDatabaseClient _target; [TestInitialize] public void Initialize() { _target = new PgDatabaseClient(); _target.ConnectionString = "Host=localhost;Database=product_build;Username=dbsafe;Password=dbsafe"; var deleteDataCommand = @" DELETE FROM public.product; DELETE FROM public.category; DELETE FROM public.supplier; "; _target.ExecuteCommand(deleteDataCommand); } // [Ignore("Uses Product_Build database from dbsafe-demo repo")] [TestMethod] public void Write_read_and_compare_records() { var datasetXml = @" <dataset name=""suppliers"" setIdentityInsert=""true"" table=""Supplier""> <data> <row id=""1"" name=""supplier-1"" contact_name=""contact-name-1"" contact_phone=""100-200-0001"" contact_email=""email-1@test.com"" /> <row id=""2"" name=""supplier-2"" contact_name=""contact-name-2"" contact_phone=""100-200-0002"" contact_email=""email-2@test.com"" /> <row id=""3"" name=""supplier-3"" contact_name=""contact-name-3"" contact_phone=""100-200-0003"" contact_email=""email-3@test.com"" /> </data> </dataset> "; var xml = XElement.Parse(datasetXml); var dataset = DatasetElement.Load(xml); _target.WriteTable(dataset); var formatterManager = new FormatterManager(); var selectRecordsQuery = "SELECT * FROM public.supplier;"; var actual = _target.ReadTable(selectRecordsQuery, formatterManager); DbSafeManagerHelper.CompareDatasets(dataset, actual, new string[] { "id" }, false, false); } } }
using DbSafe; using DbSafe.FileDefinition; using Microsoft.VisualStudio.TestTools.UnitTesting; using PgDbSafe; using System.Xml.Linq; namespace PgDbSafeTests { [TestClass] public class PgDatabaseClientTest { private PgDatabaseClient _target; [TestInitialize] public void Initialize() { _target = new PgDatabaseClient(); _target.ConnectionString = "Host=localhost;Database=product;Username=dbsafe;Password=dbsafe"; var deleteDataCommand = @" DELETE FROM public.product; DELETE FROM public.category; DELETE FROM public.supplier; "; _target.ExecuteCommand(deleteDataCommand); } // [Ignore("Uses Product_Build database from dbsafe-demo repo")] [TestMethod] public void Write_read_and_compare_records() { var datasetXml = @" <dataset name=""suppliers"" setIdentityInsert=""true"" table=""Supplier""> <data> <row id=""1"" name=""supplier-1"" contact_name=""contact-name-1"" contact_phone=""100-200-0001"" contact_email=""email-1@test.com"" /> <row id=""2"" name=""supplier-2"" contact_name=""contact-name-2"" contact_phone=""100-200-0002"" contact_email=""email-2@test.com"" /> <row id=""3"" name=""supplier-3"" contact_name=""contact-name-3"" contact_phone=""100-200-0003"" contact_email=""email-3@test.com"" /> </data> </dataset> "; var xml = XElement.Parse(datasetXml); var dataset = DatasetElement.Load(xml); _target.WriteTable(dataset); var formatterManager = new FormatterManager(); var selectRecordsQuery = "SELECT * FROM public.supplier;"; var actual = _target.ReadTable(selectRecordsQuery, formatterManager); DbSafeManagerHelper.CompareDatasets(dataset, actual, new string[] { "id" }, false, false); } } }
mit
C#
08d9c8c57a0a4118f27ce54f3e1a15c382a76562
Remove unused namespace
WaltChen/NDatabase,WaltChen/NDatabase
src/TypeResolution/TypeResolutionUtils.cs
src/TypeResolution/TypeResolutionUtils.cs
using System; namespace NDatabase.TypeResolution { /// <summary> /// Helper methods with regard to type resolution. /// </summary> internal static class TypeResolutionUtils { private static readonly ITypeResolver InternalTypeResolver = new CachedTypeResolver(new GenericTypeResolver()); /// <summary> /// Resolves the supplied type name into a <see cref="System.Type"/> /// instance. /// </summary> /// <param name="typeName"> /// The (possibly partially assembly qualified) name of a /// <see cref="System.Type"/>. /// </param> /// <returns> /// A resolved <see cref="System.Type"/> instance. /// </returns> /// <exception cref="System.TypeLoadException"> /// If the type cannot be resolved. /// </exception> public static Type ResolveType(string typeName) { return TypeRegistry.ResolveType(typeName) ?? InternalTypeResolver.Resolve(typeName); } } }
using System; using System.Diagnostics.Contracts; namespace NDatabase.TypeResolution { /// <summary> /// Helper methods with regard to type resolution. /// </summary> internal static class TypeResolutionUtils { private static readonly ITypeResolver InternalTypeResolver = new CachedTypeResolver(new GenericTypeResolver()); /// <summary> /// Resolves the supplied type name into a <see cref="System.Type"/> /// instance. /// </summary> /// <param name="typeName"> /// The (possibly partially assembly qualified) name of a /// <see cref="System.Type"/>. /// </param> /// <returns> /// A resolved <see cref="System.Type"/> instance. /// </returns> /// <exception cref="System.TypeLoadException"> /// If the type cannot be resolved. /// </exception> public static Type ResolveType(string typeName) { return TypeRegistry.ResolveType(typeName) ?? InternalTypeResolver.Resolve(typeName); } } }
apache-2.0
C#
a0b3abe9550143bd9d46681d6a8bacee16a0d8bf
rename purchase id parameter
raoulmillais/SevenDigital.Api.Wrapper,actionshrimp/SevenDigital.Api.Wrapper,minkaotic/SevenDigital.Api.Wrapper,danbadge/SevenDigital.Api.Wrapper,emashliles/SevenDigital.Api.Wrapper,danhaller/SevenDigital.Api.Wrapper,AnthonySteele/SevenDigital.Api.Wrapper,bettiolo/SevenDigital.Api.Wrapper,luiseduardohdbackup/SevenDigital.Api.Wrapper,bnathyuw/SevenDigital.Api.Wrapper,gregsochanik/SevenDigital.Api.Wrapper,mattgray/SevenDigital.Api.Wrapper,knocte/SevenDigital.Api.Wrapper
src/SevenDigital.Api.Wrapper/Extensions/HasPurchaseIdParameterExtensions.cs
src/SevenDigital.Api.Wrapper/Extensions/HasPurchaseIdParameterExtensions.cs
using SevenDigital.Api.Schema.ParameterDefinitions.Get; namespace SevenDigital.Api.Wrapper { public static class HasPurchaseIdParameterExtensions { public static IFluentApi<T> WithPurchaseId<T>(this IFluentApi<T> api, string basketId) where T : HasPurchaseIdParameter { api.WithParameter("basketId", basketId); return api; } } }
using SevenDigital.Api.Schema.ParameterDefinitions.Get; namespace SevenDigital.Api.Wrapper { public static class HasPurchaseIdParameter { public static IFluentApi<T> WithPurchaseId<T>(this IFluentApi<T> api, string basketId) where T : HasBasketParameter { api.WithParameter("basketId", basketId); return api; } } }
mit
C#
73a7ff2427e3d8c81c4d7f9b884a166e12def202
remove unused using
agrc/api.mapserv.utah.gov,agrc/api.mapserv.utah.gov,agrc/api.mapserv.utah.gov,agrc/api.mapserv.utah.gov
WebAPI.API/Controllers/HomeController.cs
WebAPI.API/Controllers/HomeController.cs
using System.Linq; using System.Web.Mvc; using WebAPI.API.Commands.Sgid; using WebAPI.API.Models.ViewModels; using WebAPI.Common.Executors; namespace WebAPI.API.Controllers { public class HomeController : Controller { #if !DEBUG [OutputCache(Duration=9999)] #endif [HttpGet] public ActionResult Index() { if (App.SgidCategories == null) { App.SgidCategories = CommandExecutor.ExecuteCommand(new GetSgidCategoriesCommand()); } var categories = App.SgidCategories.Select(item => new SelectListItem { Text = item, Value = item }).ToList(); var versions = new[] { new SelectListItem { Text = "10", Value = "10" } }; return View(new MainView() .WithSgidCategories(categories) .WithSgidVersions(versions)); } } }
using System.Globalization; using System.Linq; using System.Web.Mvc; using WebAPI.API.Commands.Sgid; using WebAPI.API.Models.ViewModels; using WebAPI.Common.Executors; namespace WebAPI.API.Controllers { public class HomeController : Controller { #if !DEBUG [OutputCache(Duration=9999)] #endif [HttpGet] public ActionResult Index() { if (App.SgidCategories == null) { App.SgidCategories = CommandExecutor.ExecuteCommand(new GetSgidCategoriesCommand()); } var categories = App.SgidCategories.Select(item => new SelectListItem { Text = item, Value = item }).ToList(); var versions = new[] { new SelectListItem { Text = "10", Value = "10" } }; return View(new MainView() .WithSgidCategories(categories) .WithSgidVersions(versions)); } } }
mit
C#
6c7d1fabbc5c887acdb68517cd197c11a0c7dcbc
make sure you have an exception to exclude
ucdavis/Purchasing,ucdavis/Purchasing,ucdavis/Purchasing
Purchasing.Mvc/App_Start/LogConfig.cs
Purchasing.Mvc/App_Start/LogConfig.cs
using System.Web; using Serilog; using SerilogWeb.Classic.Enrichers; namespace Purchasing.Mvc { /// <summary> /// Configure Application Logging /// </summary> public static class LogConfig { private static bool _loggingSetup; /// <summary> /// Configure Application Logging /// </summary> public static void ConfigureLogging() { if (_loggingSetup) return; //only setup logging once Log.Logger = new LoggerConfiguration() .WriteTo.Stackify() .Enrich.With<HttpSessionIdEnricher>() .Enrich.With<UserNameEnricher>() .Enrich.FromLogContext() .Filter.ByExcluding(e => e.Exception != null && e.Exception.GetType() == typeof (HttpException)) //filter out those 404s and headers exceptions .CreateLogger(); _loggingSetup = true; } } }
using System.Web; using Serilog; using SerilogWeb.Classic.Enrichers; namespace Purchasing.Mvc { /// <summary> /// Configure Application Logging /// </summary> public static class LogConfig { private static bool _loggingSetup; /// <summary> /// Configure Application Logging /// </summary> public static void ConfigureLogging() { if (_loggingSetup) return; //only setup logging once Log.Logger = new LoggerConfiguration() .WriteTo.Stackify() .Enrich.With<HttpSessionIdEnricher>() .Enrich.With<UserNameEnricher>() .Enrich.FromLogContext() .Filter.ByExcluding(e=>e.Exception.GetType() == typeof(HttpException)) //filter out those 404s and headers exceptions .CreateLogger(); _loggingSetup = true; } } }
mit
C#
ef36f1b3cf787c896d51b8362d9b5875ce008458
fix Constraint again (missed a NOT operator)
McSherry/Zener
Net/Constraint.cs
Net/Constraint.cs
/* * Copyright (c) 2014-2015, Liam McSherry * All Rights reserved. * * Released under BSD 3-Clause licence. See terms in * /LICENCE, or online: http://opensource.org/licenses/BSD-3-Clause */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace McSherry.Zener.Net { /// <summary> /// A class representing a constraint on the value of /// a variable in a format string. /// </summary> public sealed class Constraint { // The regex we'll use to match values. private readonly Regex _regex; // Whether we actually make a comparison. If this // is false, we always return true for a match. private readonly bool _doCompare; /// <summary> /// Creates a new Constraint. /// </summary> /// <param name="name">The name of the parameter to constrain.</param> /// <param name="regex">The regular expresson to constrain the value to.</param> public Constraint(string name, string regex) { if (String.IsNullOrWhiteSpace(name)) { throw new ArgumentException( "The name of the parameter cannot be null, empty, or white-space." ); } this.Name = name; _doCompare = !String.IsNullOrEmpty(this.Regex = regex); if (_doCompare) _regex = new Regex(regex); } /// <summary> /// The name of the parameter to constrain. /// </summary> public string Name { get; private set; } /// <summary> /// The regular expression that the value of /// the parameter will be checked against. /// </summary> public string Regex { get; private set; } /// <summary> /// Determines whether the provided value matches the constraint. /// </summary> /// <param name="value">The value to check.</param> /// <returns>True if the provided value is considered a match.</returns> public bool Match(string value) { return !_doCompare || _regex.IsMatch(value); } } }
/* * Copyright (c) 2014-2015, Liam McSherry * All Rights reserved. * * Released under BSD 3-Clause licence. See terms in * /LICENCE, or online: http://opensource.org/licenses/BSD-3-Clause */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace McSherry.Zener.Net { /// <summary> /// A class representing a constraint on the value of /// a variable in a format string. /// </summary> public sealed class Constraint { // The regex we'll use to match values. private readonly Regex _regex; // Whether we actually make a comparison. If this // is false, we always return true for a match. private readonly bool _doCompare; /// <summary> /// Creates a new Constraint. /// </summary> /// <param name="name">The name of the parameter to constrain.</param> /// <param name="regex">The regular expresson to constrain the value to.</param> public Constraint(string name, string regex) { if (String.IsNullOrWhiteSpace(name)) { throw new ArgumentException( "The name of the parameter cannot be null, empty, or white-space." ); } this.Name = name; _doCompare = String.IsNullOrEmpty(this.Regex = regex); if (_doCompare) _regex = new Regex(regex); } /// <summary> /// The name of the parameter to constrain. /// </summary> public string Name { get; private set; } /// <summary> /// The regular expression that the value of /// the parameter will be checked against. /// </summary> public string Regex { get; private set; } /// <summary> /// Determines whether the provided value matches the constraint. /// </summary> /// <param name="value">The value to check.</param> /// <returns>True if the provided value is considered a match.</returns> public bool Match(string value) { return !_doCompare || _regex.IsMatch(value); } } }
bsd-3-clause
C#
b0f6d183306bfd302e10233f43e83738bf8360b3
Remove Google Analytics from Error.cshtml
azyobuzin/NuGetCalcWeb,azyobuzin/NuGetCalcWeb
NuGetCalcWeb/Views/Error.cshtml
NuGetCalcWeb/Views/Error.cshtml
@using NuGetCalcWeb.ViewModels @inherits AppTemplateBase<ErrorModel> @{ Layout = "_Layout"; ViewBag.Title = "An error caused - NuGetCalc"; ViewBag.NoIndex = true; ViewBag.NoAnalytics = true; } <div class="container"> <h1>@Model.Header</h1> @if (!string.IsNullOrEmpty(Model.Message)) { <p>@Model.Message</p> } @if (!string.IsNullOrEmpty(Model.Detail)) { <pre>@Model.Detail</pre> } </div>
@using NuGetCalcWeb.ViewModels @inherits AppTemplateBase<ErrorModel> @{ Layout = "_Layout"; ViewBag.Title = "An error caused - NuGetCalc"; ViewBag.NoIndex = true; } <div class="container"> <h1>@Model.Header</h1> @if (!string.IsNullOrEmpty(Model.Message)) { <p>@Model.Message</p> } @if (!string.IsNullOrEmpty(Model.Detail)) { <pre>@Model.Detail</pre> } </div>
mit
C#
058e3f400544a948726936893e699639b4bea1a3
remove unused conditional
mstama/Trains
Trains/Models/Graph.cs
Trains/Models/Graph.cs
using System; using System.Collections.Generic; using System.Text; using Trains.Interfaces; namespace Trains.Models { /// <summary> /// Represents a graph /// </summary> public class Graph : IGraph { /// <summary> /// Towns registered /// </summary> public IDictionary<string, Town> Towns { get; } = new Dictionary<string, Town>(StringComparer.OrdinalIgnoreCase); /// <summary> /// Add or retrieve a route if exists /// </summary> /// <param name="origin"></param> /// <param name="dest"></param> /// <param name="distance"></param> /// <returns></returns> public Route AddRoute(string origin, string dest, int distance) { var originTown = AddTown(origin); if (!originTown.Routes.TryGetValue(dest, out Route route)) { route = new Route(originTown, AddTown(dest), distance); } else { route.Distance = distance; } return route; } /// <summary> /// Add or retrieve a town /// </summary> /// <param name="name"></param> /// <returns></returns> public Town AddTown(string name) { if (!Towns.TryGetValue(name, out Town town)) { town = new Town(this, name); } return town; } public override string ToString() { StringBuilder text = new StringBuilder(); foreach (var town in Towns) { text.AppendFormat("{0}\n", town); } foreach (var town in Towns.Values) { foreach (var route in town.Routes.Values) { text.AppendFormat("{0}{1}\n", town, route); } } return text.ToString(); } } }
using System; using System.Collections.Generic; using System.Text; using Trains.Interfaces; namespace Trains.Models { /// <summary> /// Represents a graph /// </summary> public class Graph : IGraph { /// <summary> /// Towns registered /// </summary> public IDictionary<string, Town> Towns { get; } = new Dictionary<string, Town>(StringComparer.OrdinalIgnoreCase); /// <summary> /// Add or retrieve a route if exists /// </summary> /// <param name="origin"></param> /// <param name="dest"></param> /// <param name="distance"></param> /// <returns></returns> public Route AddRoute(string origin, string dest, int distance) { var originTown = AddTown(origin); if (!originTown.Routes.TryGetValue(dest, out Route route)) { route = new Route(originTown, AddTown(dest), distance); } else { if (route.Distance != distance) { route.Distance = distance; } } return route; } /// <summary> /// Add or retrieve a town /// </summary> /// <param name="name"></param> /// <returns></returns> public Town AddTown(string name) { if (!Towns.TryGetValue(name, out Town town)) { town = new Town(this, name); } return town; } public override string ToString() { StringBuilder text = new StringBuilder(); foreach (var town in Towns) { text.AppendFormat("{0}\n", town); } foreach (var town in Towns.Values) { foreach (var route in town.Routes.Values) { text.AppendFormat("{0}{1}\n", town, route); } } return text.ToString(); } } }
mit
C#
eb4736f8a35c97d8d065800896475b6a659406fe
build version number bump
Pliner/EasyNetQ.Management.Client,EasyNetQ/EasyNetQ.Management.Client,chinaboard/EasyNetQ.Management.Client,alexwiese/EasyNetQ.Management.Client,LawrenceWard/EasyNetQ.Management.Client,micdenny/EasyNetQ.Management.Client,micdenny/EasyNetQ.Management.Client,Pliner/EasyNetQ.Management.Client,EasyNetQ/EasyNetQ.Management.Client
Source/Version.cs
Source/Version.cs
using System.Reflection; // EasyNetQ verion number: <major>.<minor>.0.<build> [assembly: AssemblyVersion("0.2.0.1")] // 0.2 Updgrade to RabbitMQ.Client 2.7.0.0 // 0.1 Initial
using System.Reflection; // EasyNetQ verion number: <major>.<minor>.0.<build> [assembly: AssemblyVersion("0.2.0.0")] // 0.2 Updgrade to RabbitMQ.Client 2.7.0.0 // 0.1 Initial
mit
C#
49b5055d281426187694a63467cb53c9bc1e5315
Use semver and update assembly version
Miaplaza/expression-utils
ExpressionUtils/Properties/AssemblyInfo.cs
ExpressionUtils/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("ExpressionUtils")] [assembly: AssemblyDescription("Efficient Processing, Compilation, and Execution of Expression Trees at Runtime")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("MiaPlaza")] [assembly: AssemblyProduct("MiaPlaza.ExpressionUtils.Properties")] [assembly: AssemblyCopyright("Copyright © 2017 - 2018")] [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)] [assembly: InternalsVisibleTo("ExpressionUtilsTest")] [assembly: InternalsVisibleTo("ExpressionUtilsPerf")] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("1c62f1c6-8c68-479e-a207-57cae199bff1")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("1.1.2")]
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("ExpressionUtils")] [assembly: AssemblyDescription("Efficient Processing, Compilation, and Execution of Expression Trees at Runtime")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("MiaPlaza")] [assembly: AssemblyProduct("MiaPlaza.ExpressionUtils.Properties")] [assembly: AssemblyCopyright("Copyright © 2017")] [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)] [assembly: InternalsVisibleTo("ExpressionUtilsTest")] [assembly: InternalsVisibleTo("ExpressionUtilsPerf")] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("1c62f1c6-8c68-479e-a207-57cae199bff1")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")]
mit
C#