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
ac16181cd9643171e6e457388b8e65b96ae5b7f2
Update bot builder history assembly version to 3.0.6
msft-shahins/BotBuilder,stevengum97/BotBuilder,stevengum97/BotBuilder,msft-shahins/BotBuilder,yakumo/BotBuilder,yakumo/BotBuilder,yakumo/BotBuilder,msft-shahins/BotBuilder,stevengum97/BotBuilder,msft-shahins/BotBuilder,yakumo/BotBuilder,stevengum97/BotBuilder
CSharp/Library/Microsoft.Bot.Builder.History/Properties/AssemblyInfo.cs
CSharp/Library/Microsoft.Bot.Builder.History/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("Microsoft.Bot.Builder.History")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Microsoft.Bot.Builder.History")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d2834d71-d7a2-451b-9a61-1488af049526")] // 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("3.0.6.0")] [assembly: AssemblyFileVersion("3.0.6.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("Microsoft.Bot.Builder.History")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Microsoft.Bot.Builder.History")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d2834d71-d7a2-451b-9a61-1488af049526")] // 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("3.0.5.0")] [assembly: AssemblyFileVersion("3.0.5.0")]
mit
C#
413899585109acec4bee4ef3ce5efac8ceaec9b7
Change response to be Json
Red-Folder/WebCrawl-Functions
WebCrawlStart/run.csx
WebCrawlStart/run.csx
#r "Microsoft.WindowsAzure.Storage" using System; using System.Net; using Microsoft.Azure; // Namespace for CloudConfigurationManager using Microsoft.WindowsAzure.Storage; // Namespace for CloudStorageAccount using Microsoft.WindowsAzure.Storage.Queue; // Namespace for Queue storage types public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) { log.Info($"Request to start WebCrawl"); var requestId = Guid.NewGuid(); HttpResponseMessage response = null; try { string storageConnectionString = System.Environment.GetEnvironmentVariable("APPSETTING_rfcwebcrawl_STORAGE"); // Parse the connection string and return a reference to the storage account. log.Info("Login to the storage account"); CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageConnectionString); // Create the queue client. log.Info("Create the queueClient"); CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient(); // Retrieve a reference to a container. log.Info("Create reference to the toWebCrawl queue"); CloudQueue queue = queueClient.GetQueueReference("towebcrawl"); // Create the queue if it doesn't already exist log.Info("Create the queue if needed"); queue.CreateIfNotExists(); // Create a message and add it to the queue. log.Info("Create the message"); CloudQueueMessage message = new CloudQueueMessage(requestId.ToString()); log.Info("Add the message"); queue.AddMessage(message); var result = new { id = requestId }; var message = JsonConvert.SerializeObject(result); log.Info("Returning OK"); response = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(message) }; response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); } catch (Exception ex) { log.Info($"Failed to handle request - exception thrown - {0}", ex.Message); response = new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent("An error has occurred. Refer to the server logs.") }; } return response; }
#r "Microsoft.WindowsAzure.Storage" using System; using System.Net; using Microsoft.Azure; // Namespace for CloudConfigurationManager using Microsoft.WindowsAzure.Storage; // Namespace for CloudStorageAccount using Microsoft.WindowsAzure.Storage.Queue; // Namespace for Queue storage types public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) { log.Info($"Request to start WebCrawl"); var requestId = Guid.NewGuid(); try { string storageConnectionString = System.Environment.GetEnvironmentVariable("APPSETTING_rfcwebcrawl_STORAGE"); // Parse the connection string and return a reference to the storage account. log.Info("Login to the storage account"); CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageConnectionString); // Create the queue client. log.Info("Create the queueClient"); CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient(); // Retrieve a reference to a container. log.Info("Create reference to the toWebCrawl queue"); CloudQueue queue = queueClient.GetQueueReference("towebcrawl"); // Create the queue if it doesn't already exist log.Info("Create the queue if needed"); queue.CreateIfNotExists(); // Create a message and add it to the queue. log.Info("Create the message"); CloudQueueMessage message = new CloudQueueMessage(requestId.ToString()); log.Info("Add the message"); queue.AddMessage(message); return req.CreateResponse(HttpStatusCode.OK, requestId); } catch (Exception ex) { log.Error(ex.Message); return req.CreateResponse(HttpStatusCode.InternalServerError, ex.Message); } }
mit
C#
0f34378abe6f0585a95b37a707714ba738980390
Change version
InfinniPlatform/Infinni.Node
.common/VersionInfo.cs
.common/VersionInfo.cs
using System.Reflection; [assembly: AssemblyVersion("1.0.8.0")] [assembly: AssemblyFileVersion("1.0.8.0")]
using System.Reflection; [assembly: AssemblyVersion("1.0.6.0")] [assembly: AssemblyFileVersion("1.0.6.0")]
mit
C#
af2759c187284fd3ebfa9043625363df681462e9
Add missing print to SimpleSatProgram.cs
google/or-tools,google/or-tools,or-tools/or-tools,or-tools/or-tools,or-tools/or-tools,or-tools/or-tools,or-tools/or-tools,google/or-tools,google/or-tools,google/or-tools,or-tools/or-tools,google/or-tools
ortools/sat/samples/SimpleSatProgram.cs
ortools/sat/samples/SimpleSatProgram.cs
// Copyright 2010-2018 Google LLC // 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; using Google.OrTools.Sat; public class SimpleSatProgram { static void Main() { // Creates the model. CpModel model = new CpModel(); // Creates the Boolean variable. IntVar x = model.NewBoolVar("x"); Console.WriteLine(x); } }
// Copyright 2010-2018 Google LLC // 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; using Google.OrTools.Sat; public class SimpleSatProgram { static void Main() { // Creates the model. CpModel model = new CpModel(); // Creates the Boolean variable. IntVar x = model.NewBoolVar("x"); } }
apache-2.0
C#
6d14c6fa78c7a0780b544937ff72691b970b8e56
fix copyright
OBeautifulCode/OBeautifulCode.AutoFakeItEasy
OBeautifulCode.AutoFakeItEasy.Test/Properties/AssemblyInfo.cs
OBeautifulCode.AutoFakeItEasy.Test/Properties/AssemblyInfo.cs
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="AssemblyInfo.cs" company="OBeautifulCode"> // Copyright (c) OBeautifulCode. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System; 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("OBeautifulCode.AutoFakeItEasy.Test")] [assembly: AssemblyDescription("OBeautifulCode.AutoFakeItEasy.Test")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("OBeautifulCode")] [assembly: AssemblyProduct("OBeautifulCode.AutoFakeItEasy.Test")] [assembly: AssemblyCopyright("Copyright (c) 2016 OBeautifulCode")] [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("f81f7a20-0b67-48c3-91d5-1b4313d06ac2")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: CLSCompliant(true)]
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="AssemblyInfo.cs" company="OBeautifulCode"> // Copyright (c) OBeautifulCode. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System; 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("OBeautifulCode.AutoFakeItEasy.Test")] [assembly: AssemblyDescription("OBeautifulCode.AutoFakeItEasy.Test")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("OBeautifulCode")] [assembly: AssemblyProduct("OBeautifulCode.AutoFakeItEasy.Test")] [assembly: AssemblyCopyright("Copyright © 2016 OBeautifulCode")] [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("f81f7a20-0b67-48c3-91d5-1b4313d06ac2")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: CLSCompliant(true)]
mit
C#
84b7a5353832f25c29c2393fdda35512ff96fc73
Rename Foo to FooCommand
appharbor/appharbor-cli
src/AppHarbor.Tests/TypeNameMatcherTest.cs
src/AppHarbor.Tests/TypeNameMatcherTest.cs
using System; using System.Collections.Generic; using Xunit; using Xunit.Extensions; namespace AppHarbor.Tests { public class TypeNameMatcherTest { interface IFoo { } class FooCommand : IFoo { } private static Type FooCommandType = typeof(FooCommand); [Fact] public void ShouldThrowIfInitializedWithUnnasignableType() { var exception = Assert.Throws<ArgumentException>(() => new TypeNameMatcher<IFoo>(new List<Type> { typeof(string) })); } [Theory] [InlineData("Foo")] [InlineData("foo")] public void ShouldGetTypeStartingWithCommandName(string commandName) { var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooCommandType }); Assert.Equal(FooCommandType, matcher.GetMatchedType(commandName, null)); } [Theory] [InlineData("Foo")] public void ShouldThrowWhenMoreThanOneTypeMatches(string commandName) { var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooCommandType, FooCommandType }); Assert.Throws<ArgumentException>(() => matcher.GetMatchedType(commandName, null)); } [Theory] [InlineData("Bar")] public void ShouldThrowWhenNoTypesMatches(string commandName) { var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooCommandType }); Assert.Throws<ArgumentException>(() => matcher.GetMatchedType(commandName, null)); } } }
using System; using System.Collections.Generic; using Xunit; using Xunit.Extensions; namespace AppHarbor.Tests { public class TypeNameMatcherTest { interface IFoo { } class Foo : IFoo { } private static Type FooType = typeof(Foo); [Fact] public void ShouldThrowIfInitializedWithUnnasignableType() { var exception = Assert.Throws<ArgumentException>(() => new TypeNameMatcher<IFoo>(new List<Type> { typeof(string) })); } [Theory] [InlineData("Foo")] [InlineData("foo")] public void ShouldGetTypeStartingWithCommandName(string commandName) { var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooType }); Assert.Equal(FooType, matcher.GetMatchedType(commandName, null)); } [Theory] [InlineData("Foo")] public void ShouldThrowWhenMoreThanOneTypeMatches(string commandName) { var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooType, FooType }); Assert.Throws<ArgumentException>(() => matcher.GetMatchedType(commandName, null)); } [Theory] [InlineData("Bar")] public void ShouldThrowWhenNoTypesMatches(string commandName) { var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooType }); Assert.Throws<ArgumentException>(() => matcher.GetMatchedType(commandName, null)); } } }
mit
C#
3c154a847253d26d719bf863894b3e213a165d5b
Remove unnecessary clone
smoogipooo/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,ppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,peppy/osu-framework
osu.Framework/Input/States/MidiState.cs
osu.Framework/Input/States/MidiState.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. namespace osu.Framework.Input.States { public class MidiState { public readonly ButtonStates<MidiKey> Keys = new ButtonStates<MidiKey>(); } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. namespace osu.Framework.Input.States { public class MidiState { public ButtonStates<MidiKey> Keys { get; private set; } = new ButtonStates<MidiKey>(); public MidiState Clone() { var clone = (MidiState)MemberwiseClone(); clone.Keys = Keys.Clone(); return clone; } } }
mit
C#
8094b502cb104dad68cb7b1df77e7c1841307e21
Remove test-specific logic from `RulesetConfigCache`
ppy/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,peppy/osu,ppy/osu,peppy/osu
osu.Game/Rulesets/RulesetConfigCache.cs
osu.Game/Rulesets/RulesetConfigCache.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Database; using osu.Game.Extensions; using osu.Game.Rulesets.Configuration; namespace osu.Game.Rulesets { public class RulesetConfigCache : Component, IRulesetConfigCache { private readonly RealmContextFactory realmFactory; private readonly RulesetStore rulesets; private readonly Dictionary<string, IRulesetConfigManager> configCache = new Dictionary<string, IRulesetConfigManager>(); public RulesetConfigCache(RealmContextFactory realmFactory, RulesetStore rulesets) { this.realmFactory = realmFactory; this.rulesets = rulesets; } protected override void LoadComplete() { base.LoadComplete(); var settingsStore = new SettingsStore(realmFactory); // let's keep things simple for now and just retrieve all the required configs at startup.. foreach (var ruleset in rulesets.AvailableRulesets) { if (string.IsNullOrEmpty(ruleset.ShortName)) continue; configCache[ruleset.ShortName] = ruleset.CreateInstance().CreateConfig(settingsStore); } } public IRulesetConfigManager GetConfigFor(Ruleset ruleset) { if (!IsLoaded) throw new InvalidOperationException($@"Cannot retrieve {nameof(IRulesetConfigManager)} before {nameof(RulesetConfigCache)} has loaded"); if (!configCache.TryGetValue(ruleset.RulesetInfo.ShortName, out var config)) throw new InvalidOperationException($@"Attempted to retrieve {nameof(IRulesetConfigManager)} for an unavailable ruleset {ruleset.GetDisplayString()}"); return config; } protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); // ensures any potential database operations are finalised before game destruction. foreach (var c in configCache.Values) c?.Dispose(); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Database; using osu.Game.Rulesets.Configuration; namespace osu.Game.Rulesets { public class RulesetConfigCache : Component, IRulesetConfigCache { private readonly RealmContextFactory realmFactory; private readonly RulesetStore rulesets; private readonly Dictionary<string, IRulesetConfigManager> configCache = new Dictionary<string, IRulesetConfigManager>(); public RulesetConfigCache(RealmContextFactory realmFactory, RulesetStore rulesets) { this.realmFactory = realmFactory; this.rulesets = rulesets; } protected override void LoadComplete() { base.LoadComplete(); var settingsStore = new SettingsStore(realmFactory); // let's keep things simple for now and just retrieve all the required configs at startup.. foreach (var ruleset in rulesets.AvailableRulesets) { if (string.IsNullOrEmpty(ruleset.ShortName)) continue; configCache[ruleset.ShortName] = ruleset.CreateInstance().CreateConfig(settingsStore); } } public IRulesetConfigManager GetConfigFor(Ruleset ruleset) { if (!configCache.TryGetValue(ruleset.RulesetInfo.ShortName, out var config)) // any ruleset request which wasn't initialised on startup should not be stored to realm. // this should only be used by tests. return ruleset.CreateConfig(null); return config; } protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); // ensures any potential database operations are finalised before game destruction. foreach (var c in configCache.Values) c?.Dispose(); } } }
mit
C#
b3628e541136d7024eba0b83e4ca91231755babb
Add comments to CameraFollow
momo-the-monster/workshop-trails
Assets/PDXcc/Trails/Code/CameraFollow.cs
Assets/PDXcc/Trails/Code/CameraFollow.cs
using UnityEngine; using System.Collections; namespace pdxcc { public class CameraFollow : MonoBehaviour { // Target for the camera to follow public Transform target; // Distance to maintain between camera and target public Vector3 offset; // How quickly to follow public float speed = 1f; void Update() { // Get the position of the target, add the offset Vector3 targetPosition = target.position + offset; // Lerp between the current position and the target position using deltaTime for consistency transform.position = Vector3.Lerp(transform.position, targetPosition, speed * Time.deltaTime); } } }
using UnityEngine; using System.Collections; namespace pdxcc { public class CameraFollow : MonoBehaviour { public GameObject target; public Vector3 offset; public float speed = 1f; void Start() { } void Update() { Vector3 targetPosition = target.transform.position + offset; transform.position = Vector3.Lerp(transform.position, targetPosition, speed * Time.deltaTime); } } }
mit
C#
0991f4db4df3f75164c80cb254360ef84b32eac6
Build 1.2.8.8
DataBooster/DbWebApi,DataBooster/DbWebApi,DataBooster/DbWebApi,DataBooster/DbWebApi
Server/DataBooster.DbWebApi/Razor/SerializableResponseData.cs
Server/DataBooster.DbWebApi/Razor/SerializableResponseData.cs
// Copyright (c) 2015 Abel Cheng <abelcys@gmail.com> and other contributors. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // Repository: https://github.com/DataBooster/DbWebApi using System; using System.Collections.Generic; using DbParallel.DataAccess; namespace DataBooster.DbWebApi.Razor { /// <summary> /// The model needs to be serializable since Isolated RazorEngine will run the generated code within another AppDomain. /// </summary> [Serializable] public class SerializableResponseData { public IList<IList<BindableDynamicObject>> ResultSets { get; set; } public BindableDynamicObject OutputParameters { get; set; } public object ReturnValue { get; set; } public SerializableResponseData() { } public SerializableResponseData(StoredProcedureResponse spResponse) { if (spResponse == null) throw new ArgumentNullException("spResponse"); ResultSets = spResponse.ResultSets; OutputParameters = spResponse.OutputParameters; ReturnValue = spResponse.ReturnValue; } } }
// Copyright (c) 2015 Abel Cheng <abelcys@gmail.com> and other contributors. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // Repository: https://github.com/DataBooster/DbWebApi using System; using System.Collections.Generic; using DbParallel.DataAccess; namespace DataBooster.DbWebApi.Razor { /// <summary> /// The data model needs to be serializable since the Isolated RazorEngine will run the generated code within another AppDomain. /// </summary> [Serializable] public class SerializableResponseData { public IList<IList<BindableDynamicObject>> ResultSets { get; set; } public BindableDynamicObject OutputParameters { get; set; } public object ReturnValue { get; set; } public SerializableResponseData() { } public SerializableResponseData(StoredProcedureResponse spResponse) { if (spResponse == null) throw new ArgumentNullException("spResponse"); ResultSets = spResponse.ResultSets; OutputParameters = spResponse.OutputParameters; ReturnValue = spResponse.ReturnValue; } } }
mit
C#
3db42bd629b64d39d5893c68b43d9adb497ad913
allow further args down the line to override input in piping
darvell/Coremero
Coremero/Coremero.Plugin.Classic/Pipe.cs
Coremero/Coremero.Plugin.Classic/Pipe.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Coremero.Commands; using Coremero.Messages; using Coremero.Registry; using Coremero.Utilities; namespace Coremero.Plugin.Classic { public class Pipe : IPlugin { private CommandRegistry _commandRegistry; public Pipe(CommandRegistry cmdRegistry) { _commandRegistry = cmdRegistry; } [Command("pipe")] public async Task<IMessage> PipeCommand(IInvocationContext context, IMessage message) { List<string> cmds = string.Join(" ", message.Text.GetCommandArguments()).Split('|').ToList(); Message basicMessage = Message.Create(message.Text, message.Attachments?.ToArray()); basicMessage.Text = string.Join(" ",cmds.First().Split(' ').Skip(1).ToList()).Trim(); foreach (var cmd in cmds) { List<string> call = cmd.Trim().Split(' ').ToList(); if (!_commandRegistry.Exists(call.First())) { continue; } IMessage result = await _commandRegistry.ExecuteCommandAsync(call.First(), context, call.Count == 1 ? basicMessage : Message.Create(string.Join(" ", call.Skip(1)))); if (!string.IsNullOrEmpty(result.Text)) { basicMessage.Text = result.Text; } if (result.Attachments != null) { if (basicMessage.Attachments?.Count > 0) { // Prevent leak since we're going out of scope basicMessage.Attachments.ForEach(x => x.Contents?.Dispose()); } basicMessage.Attachments = result.Attachments; } } return basicMessage; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Coremero.Commands; using Coremero.Messages; using Coremero.Registry; using Coremero.Utilities; namespace Coremero.Plugin.Classic { public class Pipe : IPlugin { private CommandRegistry _commandRegistry; public Pipe(CommandRegistry cmdRegistry) { _commandRegistry = cmdRegistry; } [Command("pipe")] public async Task<IMessage> PipeCommand(IInvocationContext context, IMessage message) { List<string> cmds = string.Join(" ", message.Text.GetCommandArguments()).Split('|').ToList(); Message basicMessage = Message.Create(message.Text, message.Attachments?.ToArray()); basicMessage.Text = string.Join(" ",cmds.First().Split(' ').Skip(1).ToList()).Trim(); foreach (var cmd in cmds) { string cmdCall = cmd.Trim().Split(' ').First().Trim(); if (!_commandRegistry.Exists(cmdCall)) { continue; } IMessage result = await _commandRegistry.ExecuteCommandAsync(cmdCall, context, basicMessage); if (!string.IsNullOrEmpty(result.Text)) { basicMessage.Text = result.Text; } if (result.Attachments != null) { if (basicMessage.Attachments?.Count > 0) { // Prevent leak since we're going out of scope basicMessage.Attachments.ForEach(x => x.Contents?.Dispose()); } basicMessage.Attachments = result.Attachments; } } return basicMessage; } } }
mit
C#
8b55cdaa53e2e6ea9798384144c5faaa3af52d49
Update NotFoundHttpHandler to handle '/' not found correctly
jmptrader/jessica,jmptrader/jessica,jmptrader/jessica
src/Jessica/Routing/NotFoundHttpHandler.cs
src/Jessica/Routing/NotFoundHttpHandler.cs
using System.Web; using System.Web.Routing; using Jessica.Extensions; namespace Jessica.Routing { public class NotFoundHttpHandler : IHttpHandler { RequestContext _requestContext; public NotFoundHttpHandler(RequestContext requestContext) { _requestContext = requestContext; } public void ProcessRequest(HttpContext context) { var route = _requestContext.RouteData.Values["route"] ?? ""; var html = @" <!DOCTYPE html> <html> <head> <style type='text/css'> body { text-align:center;font-family:helvetica,arial;font-size:22px;color:#888;margin:20px } #c { margin:0 auto;width:500px;text-align:left } </style> </head> <body> <h1>Oops, Jessica doesn't know this line.</h1> <div id='c'> <p>Try this in your module:</p> <pre>#{method}(""/#{route}"", p => ""Hello world!"");</pre> </div> </body> </html> "; html = html.Replace("#{method}", context.Request.HttpMethod.ToTitleCase()); html = html.Replace("#{route}", route.ToString()); context.Response.StatusCode = 404; context.Response.ContentType = "text/html"; context.Response.Write(html); context.Response.End(); } public bool IsReusable { get { return true; } } } }
using System.Web; using System.Web.Routing; using Jessica.Extensions; namespace Jessica.Routing { public class NotFoundHttpHandler : IHttpHandler { RequestContext _requestContext; public NotFoundHttpHandler(RequestContext requestContext) { _requestContext = requestContext; } public void ProcessRequest(HttpContext context) { var html = @" <!DOCTYPE html> <html> <head> <style type='text/css'> body { text-align:center;font-family:helvetica,arial;font-size:22px;color:#888;margin:20px } #c { margin:0 auto;width:500px;text-align:left } </style> </head> <body> <h1>Oops, Jessica doesn't know this line.</h1> <div id='c'> <p>Try this in your module:</p> <pre>#{method}(""/#{route}"", p => ""Hello world!"");</pre> </div> </body> </html> "; html = html.Replace("#{method}", context.Request.HttpMethod.ToTitleCase()); html = html.Replace("#{route}", _requestContext.RouteData.Values["route"].ToString()); context.Response.StatusCode = 404; context.Response.ContentType = "text/html"; context.Response.Write(html); context.Response.End(); } public bool IsReusable { get { return true; } } } }
mit
C#
15364eeb923d5556a956d840938ecab8c90440e2
Update copyright
InfinniPlatform/Infinni.Node
.files/Packaging/GlobalAssemblyInfo.cs
.files/Packaging/GlobalAssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Infinnity Solutions")] [assembly: AssemblyProduct("InfinniPlatform")] [assembly: AssemblyCopyright("Copyright © Infinnity Solutions 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyConfiguration("")] // TeamCity File Content Replacer: Add build number // Look in: */Packaging/GlobalAssemblyInfo.cs // Find what: ((AssemblyVersion|AssemblyFileVersion)\s*\(\s*@?\")(?<major>[0-9]+)\.(?<minor>[0-9]+)\.(?<patch>[0-9]+)\.(?<build>[0-9]+)(\"\s*\)) // Replace with: $1$3.$4.$5.\%build.number%$7 [assembly: AssemblyVersion("1.2.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")] // TeamCity File Content Replacer: Add VCS hash // Look in: */Packaging/GlobalAssemblyInfo.cs // Find what: (AssemblyInformationalVersion\s*\(\s*@?\").*?(\"\s*\)) // Replace with: $1\%build.vcs.number%$2 [assembly: AssemblyInformationalVersion("")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Infinnity Solutions")] [assembly: AssemblyProduct("InfinniPlatform")] [assembly: AssemblyCopyright("Copyright © Infinnity Solutions 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyConfiguration("")] // TeamCity File Content Replacer: Add build number // Look in: */Packaging/GlobalAssemblyInfo.cs // Find what: ((AssemblyVersion|AssemblyFileVersion)\s*\(\s*@?\")(?<major>[0-9]+)\.(?<minor>[0-9]+)\.(?<patch>[0-9]+)\.(?<build>[0-9]+)(\"\s*\)) // Replace with: $1$3.$4.$5.\%build.number%$7 [assembly: AssemblyVersion("1.2.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")] // TeamCity File Content Replacer: Add VCS hash // Look in: */Packaging/GlobalAssemblyInfo.cs // Find what: (AssemblyInformationalVersion\s*\(\s*@?\").*?(\"\s*\)) // Replace with: $1\%build.vcs.number%$2 [assembly: AssemblyInformationalVersion("")]
mit
C#
ebe81c8ec971d35d178c7a0c3684ceaf1ed63837
Remove duplicate using
oysteinkrog/SQLite.Net-PCL,fernandovm/SQLite.Net-PCL
src/SQLite.Net/SQLiteConnectionWithLock.cs
src/SQLite.Net/SQLiteConnectionWithLock.cs
// // Copyright (c) 2012 Krueger Systems, Inc. // Copyright (c) 2013 ystein Krog (oystein.krog@gmail.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Threading; using JetBrains.Annotations; using SQLite.Net.Interop; namespace SQLite.Net { public class SQLiteConnectionWithLock : SQLiteConnection { private readonly object _lockPoint = new object(); [PublicAPI] public SQLiteConnectionWithLock([NotNull] ISQLitePlatform sqlitePlatform, [NotNull] SQLiteConnectionString connectionString, IDictionary<string, TableMapping> tableMappings = null, IDictionary<Type, string> extraTypeMappings = null) : base(sqlitePlatform, connectionString.DatabasePath, connectionString.OpenFlags, connectionString.StoreDateTimeAsTicks, connectionString.Serializer, tableMappings, extraTypeMappings, connectionString.Resolver) { } [PublicAPI] public IDisposable Lock() { return new LockWrapper(_lockPoint); } private class LockWrapper : IDisposable { private readonly object _lockPoint; public LockWrapper([NotNull] object lockPoint) { _lockPoint = lockPoint; Monitor.Enter(_lockPoint); } public void Dispose() { Monitor.Exit(_lockPoint); } } } }
// // Copyright (c) 2012 Krueger Systems, Inc. // Copyright (c) 2013 ystein Krog (oystein.krog@gmail.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Threading; using JetBrains.Annotations; using SQLite.Net.Interop; using System.Collections.Generic; namespace SQLite.Net { public class SQLiteConnectionWithLock : SQLiteConnection { private readonly object _lockPoint = new object(); [PublicAPI] public SQLiteConnectionWithLock([NotNull] ISQLitePlatform sqlitePlatform, [NotNull] SQLiteConnectionString connectionString, IDictionary<string, TableMapping> tableMappings = null, IDictionary<Type, string> extraTypeMappings = null) : base(sqlitePlatform, connectionString.DatabasePath, connectionString.OpenFlags, connectionString.StoreDateTimeAsTicks, connectionString.Serializer, tableMappings, extraTypeMappings, connectionString.Resolver) { } [PublicAPI] public IDisposable Lock() { return new LockWrapper(_lockPoint); } private class LockWrapper : IDisposable { private readonly object _lockPoint; public LockWrapper([NotNull] object lockPoint) { _lockPoint = lockPoint; Monitor.Enter(_lockPoint); } public void Dispose() { Monitor.Exit(_lockPoint); } } } }
mit
C#
7da802ffcc82ca2439a3486b5ce39e6bbb23c613
enable disc merge using disc number
jasonracey/iTunesAssistant
iTunesAssistantLib/TrackComparerFactory.cs
iTunesAssistantLib/TrackComparerFactory.cs
using System.Collections.Generic; using iTunesLib; namespace iTunesAssistantLib { public class TrackComparerFactory { public static IComparer<IITTrack> GetTrackComparer(List<IITTrack> tracks) { var trackNumbers = new Dictionary<string, int>(); foreach (var track in tracks) { var key = track.GetKey(); if (track.TrackNumber != 0 && !trackNumbers.ContainsKey(key)) { trackNumbers.Add(key, track.TrackNumber); } else { return new TrackNameComparer(); } } return new TrackDiscAndNumberComparer(); } } public class TrackNameComparer : IComparer<IITTrack> { public int Compare(IITTrack t1, IITTrack t2) { return string.CompareOrdinal(t1.Name, t2.Name); } } public class TrackDiscAndNumberComparer : IComparer<IITTrack> { public int Compare(IITTrack t1, IITTrack t2) { return t1.GetKey().CompareTo(t2.GetKey()); } } public static class TrackKey { public static string GetKey(this IITTrack track) { var discNumberString = GetPaddedNumberString(track.DiscNumber); var trackNumberString = GetPaddedNumberString(track.TrackNumber); return $"{discNumberString}-{trackNumberString}"; } private static string GetPaddedNumberString(int number) { // assumes range of 1-99 return number < 10 ? $"0{number}" : number.ToString(); } } }
using System.Collections.Generic; using iTunesLib; namespace iTunesAssistantLib { public class TrackComparerFactory { public static IComparer<IITTrack> GetTrackComparer(List<IITTrack> tracks) { var trackNumbers = new Dictionary<int, int>(); foreach (var track in tracks) { if (track.TrackNumber != 0 && !trackNumbers.ContainsKey(track.TrackNumber)) { trackNumbers.Add(track.TrackNumber, track.TrackNumber); } else { return new TrackNameComparer(); } } return new TrackNumberComparer(); } } public class TrackNameComparer : IComparer<IITTrack> { public int Compare(IITTrack x, IITTrack y) { return string.CompareOrdinal(x.Name, y.Name); } } public class TrackNumberComparer : IComparer<IITTrack> { public int Compare(IITTrack x, IITTrack y) { return x.TrackNumber.CompareTo(y.TrackNumber); } } }
mit
C#
a0131b8b25a739de25dac928ec76715597ec8e36
Fix slider velocity not being applied.
DrabWeb/osu,DrabWeb/osu,NotKyon/lolisu,peppy/osu,ppy/osu,Nabile-Rahmani/osu,smoogipoo/osu,johnneijzen/osu,NeoAdonis/osu,EVAST9919/osu,peppy/osu-new,theguii/osu,ZLima12/osu,Drezi126/osu,UselessToucan/osu,nyaamara/osu,ppy/osu,DrabWeb/osu,default0/osu,peppy/osu,EVAST9919/osu,ppy/osu,smoogipoo/osu,naoey/osu,2yangk23/osu,UselessToucan/osu,NeoAdonis/osu,NeoAdonis/osu,johnneijzen/osu,tacchinotacchi/osu,osu-RP/osu-RP,naoey/osu,ZLima12/osu,Damnae/osu,Frontear/osuKyzer,peppy/osu,smoogipoo/osu,2yangk23/osu,smoogipooo/osu,naoey/osu,RedNesto/osu,UselessToucan/osu
osu.Game/Beatmaps/Beatmap.cs
osu.Game/Beatmaps/Beatmap.cs
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using OpenTK.Graphics; using osu.Game.Beatmaps.Timing; using osu.Game.Database; using osu.Game.Modes.Objects; namespace osu.Game.Beatmaps { public class Beatmap { public BeatmapInfo BeatmapInfo { get; set; } public BeatmapMetadata Metadata => BeatmapInfo?.Metadata ?? BeatmapInfo?.BeatmapSet?.Metadata; public List<HitObject> HitObjects { get; set; } public List<ControlPoint> ControlPoints { get; set; } public List<Color4> ComboColors { get; set; } public double BeatLengthAt(double time, bool applyMultipliers = false) { int point = 0; int samplePoint = 0; for (int i = 0; i < ControlPoints.Count; i++) if (ControlPoints[i].Time <= time) { if (ControlPoints[i].TimingChange) point = i; else samplePoint = i; } double mult = 1; if (applyMultipliers && samplePoint > point) mult = ControlPoints[samplePoint].VelocityAdjustment; return ControlPoints[point].BeatLength * mult; } } }
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using OpenTK.Graphics; using osu.Game.Beatmaps.Timing; using osu.Game.Database; using osu.Game.Modes.Objects; namespace osu.Game.Beatmaps { public class Beatmap { public BeatmapInfo BeatmapInfo { get; set; } public BeatmapMetadata Metadata => BeatmapInfo?.Metadata ?? BeatmapInfo?.BeatmapSet?.Metadata; public List<HitObject> HitObjects { get; set; } public List<ControlPoint> ControlPoints { get; set; } public List<Color4> ComboColors { get; set; } public double BeatLengthAt(double time, bool applyMultipliers = false) { int point = 0; int samplePoint = 0; for (int i = 0; i < ControlPoints.Count; i++) if (ControlPoints[i].Time <= time) { if (ControlPoints[i].TimingChange) point = i; else samplePoint = i; } double mult = 1; if (applyMultipliers && samplePoint > point && ControlPoints[samplePoint].BeatLength < 0) mult = ControlPoints[samplePoint].VelocityAdjustment; return ControlPoints[point].BeatLength * mult; } } }
mit
C#
72079893f163242bdec38487396a94e625eb3af4
Initialize CreateCommand with AppHarborApi
appharbor/appharbor-cli
src/AppHarbor/Commands/CreateCommand.cs
src/AppHarbor/Commands/CreateCommand.cs
using System; namespace AppHarbor.Commands { public class CreateCommand : ICommand { private readonly AppHarborApi _appHarborApi; public CreateCommand(AppHarborApi appHarborApi) { _appHarborApi = appHarborApi; } public void Execute(string[] arguments) { throw new NotImplementedException(); } } }
using System; namespace AppHarbor.Commands { public class CreateCommand : ICommand { public void Execute(string[] arguments) { throw new NotImplementedException(); } } }
mit
C#
aa129f54cd84252cdcc0ff39ced1c48e5d971db8
Speed up GetAll calls slightly
canton7/Stylet,cH40z-Lord/Stylet,cH40z-Lord/Stylet,canton7/Stylet
Stylet/StyletIoC/Internal/Registrations/GetAllRegistration.cs
Stylet/StyletIoC/Internal/Registrations/GetAllRegistration.cs
using StyletIoC.Creation; using System; using System.Linq; using System.Linq.Expressions; using System.Threading; namespace StyletIoC.Internal.Registrations { /// <summary> /// Knows how to generate an IEnumerable{T}, which contains all implementations of T /// </summary> internal class GetAllRegistration : IRegistration { private readonly IRegistrationContext parentContext; public string Key { get; private set; } private readonly Type _type; public Type Type { get { return this._type; } } private Expression expression; private readonly object generatorLock = new object(); private Func<IRegistrationContext, object> generator; public GetAllRegistration(Type type, IRegistrationContext parentContext, string key) { this.Key = key; this._type = type; this.parentContext = parentContext; } public Func<IRegistrationContext, object> GetGenerator() { if (this.generator != null) return this.generator; lock (this.generatorLock) { if (this.generator == null) { var registrationContext = Expression.Parameter(typeof(IRegistrationContext), "registrationContext"); this.generator = Expression.Lambda<Func<IRegistrationContext, object>>(this.GetInstanceExpression(registrationContext), registrationContext).Compile(); } return this.generator; } } public Expression GetInstanceExpression(ParameterExpression registrationContext) { if (this.expression != null) return this.expression; var instanceExpressions = this.parentContext.GetAllRegistrations(this.Type.GenericTypeArguments[0], this.Key, false).Select(x => x.GetInstanceExpression(registrationContext)).ToArray(); var listCtor = this.Type.GetConstructor(new[] { typeof(int) }); // ctor which takes capacity var listNew = Expression.New(listCtor, Expression.Constant(instanceExpressions.Length)); Expression list = instanceExpressions.Any() ? (Expression)Expression.ListInit(listNew, instanceExpressions) : listNew; Interlocked.CompareExchange(ref this.expression, list, null); return this.expression; } } }
using StyletIoC.Creation; using System; using System.Linq; using System.Linq.Expressions; using System.Threading; namespace StyletIoC.Internal.Registrations { /// <summary> /// Knows how to generate an IEnumerable{T}, which contains all implementations of T /// </summary> internal class GetAllRegistration : IRegistration { private readonly IRegistrationContext parentContext; public string Key { get; private set; } private readonly Type _type; public Type Type { get { return this._type; } } private Expression expression; private readonly object generatorLock = new object(); private Func<IRegistrationContext, object> generator; public GetAllRegistration(Type type, IRegistrationContext parentContext, string key) { this.Key = key; this._type = type; this.parentContext = parentContext; } public Func<IRegistrationContext, object> GetGenerator() { if (this.generator != null) return this.generator; lock (this.generatorLock) { if (this.generator == null) { var registrationContext = Expression.Parameter(typeof(IRegistrationContext), "registrationContext"); this.generator = Expression.Lambda<Func<IRegistrationContext, object>>(this.GetInstanceExpression(registrationContext), registrationContext).Compile(); } return this.generator; } } public Expression GetInstanceExpression(ParameterExpression registrationContext) { if (this.expression != null) return this.expression; var listNew = Expression.New(this.Type); var instanceExpressions = this.parentContext.GetAllRegistrations(this.Type.GenericTypeArguments[0], this.Key, false).Select(x => x.GetInstanceExpression(registrationContext)); Expression list = instanceExpressions.Any() ? (Expression)Expression.ListInit(listNew, instanceExpressions) : listNew; Interlocked.CompareExchange(ref this.expression, list, null); return this.expression; } } }
mit
C#
27b18166e3b8503a711ba6afd984d188456dcdb9
Bump version
canton7/SyncTrayzor,canton7/SyncTrayzor,canton7/SyncTrayzor
src/SyncTrayzor/Properties/AssemblyInfo.cs
src/SyncTrayzor/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SyncTrayzor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SyncTrayzor")] [assembly: AssemblyCopyright("Copyright © Antony Male 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.7.0")] [assembly: AssemblyFileVersion("1.0.7.0")]
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SyncTrayzor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SyncTrayzor")] [assembly: AssemblyCopyright("Copyright © Antony Male 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.6.0")] [assembly: AssemblyFileVersion("1.0.6.0")]
mit
C#
abdfd402d510079481c70a3b5fbfe1d44ca93792
change namespace of SuppressBecause
OBeautifulCode/OBeautifulCode.Build
Analyzers/analyzers/SuppressBecause.cs
Analyzers/analyzers/SuppressBecause.cs
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="SuppressBecause.cs" company="OBeautifulCode"> // Copyright (c) OBeautifulCode 2018. All rights reserved. // </copyright> // <auto-generated> // Sourced from NuGet package. Will be overwritten with package update except in OBeautifulCode.Build source. // </auto-generated> // -------------------------------------------------------------------------------------------------------------------- namespace OBeautifulCode.Build.Analyzers { using System.CodeDom.Compiler; using System.Diagnostics.CodeAnalysis; /// <summary> /// Standard justifications for analysis suppression. /// </summary> [ExcludeFromCodeCoverage] [GeneratedCode("OBeautifulCode.Build.Analyzers", "See package version number")] internal static class SuppressBecause { /// <summary> /// Console executable does not need the [assembly: CLSCompliant(true)] as it should not be shared as an assembly for reference. /// </summary> public const string CA1014_MarkAssembliesWithClsCompliant_ConsoleExeDoesNotNeedToBeClsCompliant = "Console executable does not need the [assembly: CLSCompliant(true)] as it should not be shared as an assembly for reference."; /// <summary> /// We prefer to read <see cref="System.Guid" />'s string representation as lowercase. /// </summary> public const string CA1308_NormalizeStringsToUppercase_PreferGuidLowercase = "We prefer to read System.Guid's string representation as lowercase."; } }
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="SuppressBecause.cs" company="OBeautifulCode"> // Copyright (c) OBeautifulCode 2018. All rights reserved. // </copyright> // <auto-generated> // Sourced from NuGet package. Will be overwritten with package update except in OBeautifulCode.Build source. // </auto-generated> // -------------------------------------------------------------------------------------------------------------------- namespace NAMESPACETOKEN { using System.CodeDom.Compiler; using System.Diagnostics.CodeAnalysis; /// <summary> /// Standard justifications for analysis suppression. /// </summary> [ExcludeFromCodeCoverage] [GeneratedCode("OBeautifulCode.Build.Analyzers", "See package version number")] internal static class SuppressBecause { /// <summary> /// Console executable does not need the [assembly: CLSCompliant(true)] as it should not be shared as an assembly for reference. /// </summary> public const string CA1014_MarkAssembliesWithClsCompliant_ConsoleExeDoesNotNeedToBeClsCompliant = "Console executable does not need the [assembly: CLSCompliant(true)] as it should not be shared as an assembly for reference."; /// <summary> /// We prefer to read <see cref="System.Guid" />'s string representation as lowercase. /// </summary> public const string CA1308_NormalizeStringsToUppercase_PreferGuidLowercase = "We prefer to read System.Guid's string representation as lowercase."; } }
mit
C#
c2c082410e904d5077baf4cc8d069b4aec2ed8f1
Fix runner test
AzureRT/azure-powershell,AzureRT/azure-powershell,AzureRT/azure-powershell,AzureRT/azure-powershell,AzureRT/azure-powershell,AzureRT/azure-powershell
src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VMDynamicTests.cs
src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VMDynamicTests.cs
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- using Microsoft.WindowsAzure.Commands.ScenarioTest; using Xunit; namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests { public partial class VMDynamicTests { public VMDynamicTests() {} public VMDynamicTests(Xunit.Abstractions.ITestOutputHelper output) { ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output)); } [Fact(Skip = "TODO: only works for live mode")] [Trait(Category.AcceptanceType, Category.CheckIn)] public void RunVMDynamicTests() { ComputeTestController.NewInstance.RunPsTest("Run-VMDynamicTests -num_total_generated_tests 1"); } } }
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- using Microsoft.WindowsAzure.Commands.ScenarioTest; using Xunit; namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests { public partial class VMDynamicTests { public VMDynamicTests(Xunit.Abstractions.ITestOutputHelper output) { ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output)); } [Fact(Skip = "TODO: only works for live mode")] [Trait(Category.AcceptanceType, Category.CheckIn)] public void RunVMDynamicTests() { ComputeTestController.NewInstance.RunPsTest("Run-VMDynamicTests -num_total_generated_tests 1"); } } }
apache-2.0
C#
908e1773b8d7a15e1c5765b5269e68f629e2b50a
Add new assert checks
patchkit-net/patchkit-patcher-unity,patchkit-net/patchkit-patcher-unity,mohsansaleem/patchkit-patcher-unity,patchkit-net/patchkit-patcher-unity,mohsansaleem/patchkit-patcher-unity,patchkit-net/patchkit-patcher-unity
src/Assets/Scripts/Debug/AssertChecks.cs
src/Assets/Scripts/Debug/AssertChecks.cs
using UnityEngine.Assertions; namespace PatchKit.Unity.Patcher.Debug { public class AssertChecks : BaseChecks { static AssertChecks() { Assert.raiseExceptions = true; } private static ValidationFailedHandler ArgumentValidationFailed(string name) { return message => Assert.IsTrue(true, string.Format("Argument \"{0}\": {1}", name, message)); } public static void IsTrue(bool condition, string message) { Assert.IsTrue(condition, message); } public static void IsFalse(bool condition, string message) { Assert.IsFalse(condition, message); } public static void AreEqual<T>(T expected, T actual, string message) { Assert.AreEqual(expected, actual, message); } public static void AreNotEqual<T>(T expected, T actual, string message) { Assert.AreNotEqual(expected, actual, message); } public static void IsNotNull<T>(T value, string message) where T : class { Assert.IsNotNull(value, message); } public static void IsNull<T>(T value, string message) where T : class { Assert.IsNull(value, message); } public static void ArgumentNotNull(object value, string name) { NotNull(value, ArgumentValidationFailed(name)); } public static void MethodCalledOnlyOnce(ref bool hasBeenCalled, string methodName) { IsFalse(hasBeenCalled, string.Format("Method \"{0}\" cannot be called more than once.", methodName)); hasBeenCalled = true; } public static void ApplicationIsInstalled(App app) { IsTrue(app.IsInstalled(), "Application is not installed."); } public static void ApplicationVersionEquals(App app, int versionId) { ApplicationIsInstalled(app); AreEqual(app.GetInstalledVersionId(), versionId, "Application versions don't match."); } } }
using UnityEngine.Assertions; namespace PatchKit.Unity.Patcher.Debug { public class AssertChecks : BaseChecks { static AssertChecks() { Assert.raiseExceptions = true; } private static ValidationFailedHandler ArgumentValidationFailed(string name) { return message => Assert.IsTrue(true, string.Format("Argument \"{0}\": {1}", name, message)); } public static void IsTrue(bool condition, string message) { Assert.IsTrue(condition, message); } public static void IsFalse(bool condition, string message) { Assert.IsFalse(condition, message); } public static void AreEqual<T>(T expected, T actual, string message) { Assert.AreEqual(expected, actual, message); } public static void AreNotEqual<T>(T expected, T actual, string message) { Assert.AreNotEqual(expected, actual, message); } public static void ArgumentNotNull(object value, string name) { NotNull(value, ArgumentValidationFailed(name)); } public static void MethodCalledOnlyOnce(ref bool hasBeenCalled, string methodName) { IsFalse(hasBeenCalled, string.Format("Method \"{0}\" cannot be called more than once.", methodName)); hasBeenCalled = true; } public static void ApplicationIsInstalled(App app) { IsTrue(app.IsInstalled(), "Application is not installed."); } public static void ApplicationVersionEquals(App app, int versionId) { ApplicationIsInstalled(app); AreEqual(app.GetInstalledVersionId(), versionId, "Application versions don't match."); } } }
mit
C#
f8d561b7bd074a9ce4b9b1d3213cdbf3a285cb88
Update KentBoogaart.cs
stvansolano/planetxamarin,planetxamarin/planetxamarin,beraybentesen/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,MabroukENG/planetxamarin,MabroukENG/planetxamarin,beraybentesen/planetxamarin,stvansolano/planetxamarin,beraybentesen/planetxamarin,stvansolano/planetxamarin,planetxamarin/planetxamarin,MabroukENG/planetxamarin
src/Firehose.Web/Authors/KentBoogaart.cs
src/Firehose.Web/Authors/KentBoogaart.cs
using Firehose.Web.Infrastructure; using System; using System.Collections.Generic; namespace Firehose.Web.Authors { public class KentBoogaart : IAmAMicrosoftMVP { public string FirstName => "Kent"; public string LastName => "Boogaart"; public string StateOrRegion => "Australia"; public string EmailAddress => "kent.boogaart@gmail.com"; public string Title => "kick-ass software engineer"; public Uri WebSite => new Uri("http://kent-boogaart.com/"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://kent-boogaart.com/atom.xml"); } } public string TwitterHandle => "kent_boogaart"; public DateTime FirstAwarded => new DateTime(2009, 04, 01); public string GravatarHash => ""; } }
using Firehose.Web.Infrastructure; using System; using System.Collections.Generic; namespace Firehose.Web.Authors { public class KentBoogaart : IAmAMicrosoftMVP { public string FirstName => "Kent"; public string LastName => "Boogaart"; public string StateOrRegion => "Australia"; public string EmailAddress => "kent.boogaart@gmail.com"; public string Title => "Xamarin Developer | Microsoft MVP"; public Uri WebSite => new Uri("http://kent-boogaart.com/"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://kent-boogaart.com/atom.xml"); } } public string TwitterHandle => "kent_boogaart"; public DateTime FirstAwarded => new DateTime(2009, 04, 01); public string GravatarHash => ""; } }
mit
C#
2a67602da1ca1474e12f5d8455f9b6d5fc930495
Update asset menu entries
bartlomiejwolk/AnimationPathAnimator
Editor/AssetCreator.cs
Editor/AssetCreator.cs
using ATP.SimplePathAnimator.Animator; using ATP.SimplePathAnimator.Events; using UnityEditor; namespace ATP.SimplePathAnimator { // TODO Specify name for newly created asset. public class AssetCreator { [MenuItem("Assets/Create/ATP/SimplePathAnimator/Path Data")] private static void CreatePathAsset() { ScriptableObjectUtility.CreateAsset<PathData>(); } [MenuItem("Assets/Create/ATP/SimplePathAnimator/Events Data")] private static void CreateAnimatorEventsDataAsset() { ScriptableObjectUtility.CreateAsset<AnimatorEventsData>(); } [MenuItem("Assets/Create/ATP/SimplePathAnimator/Path Animator Settings")] private static void CreateAnimatorSettingsAsset() { ScriptableObjectUtility.CreateAsset<AnimatorSettings>(); } [MenuItem("Assets/Create/ATP/SimplePathAnimator/Path Events Settings")] private static void CreatePathEventsSettingsAsset() { ScriptableObjectUtility.CreateAsset<PathEventsSettings>(); } } }
using ATP.SimplePathAnimator.Animator; using ATP.SimplePathAnimator.Events; using UnityEditor; namespace ATP.SimplePathAnimator { // TODO Specify name for newly created asset. public class AssetCreator { [MenuItem("Assets/Create/ATP/SimplePathAnimator/Path")] private static void CreatePathAsset() { ScriptableObjectUtility.CreateAsset<PathData>(); } [MenuItem("Assets/Create/ATP/SimplePathAnimator/Events")] private static void CreateAnimatorEventsDataAsset() { ScriptableObjectUtility.CreateAsset<AnimatorEventsData>(); } [MenuItem("Assets/Create/ATP/SimplePathAnimator/Animator Settings")] private static void CreateAnimatorSettingsAsset() { ScriptableObjectUtility.CreateAsset<AnimatorSettings>(); } [MenuItem("Assets/Create/ATP/SimplePathAnimator/Path Events Settings")] private static void CreatePathEventsSettingsAsset() { ScriptableObjectUtility.CreateAsset<PathEventsSettings>(); } } }
mit
C#
df807c819e6705ea082d79541a59c79cbf3a57e1
Fix incorrect merge
caslan/MIEngine,faxue-msft/MIEngine,wesrupert/MIEngine,caslan/MIEngine,wesrupert/MIEngine,edumunoz/MIEngine,devilman3d/MIEngine,edumunoz/MIEngine,caslan/MIEngine,rajkumar42/MIEngine,edumunoz/MIEngine,pieandcakes/MIEngine,pieandcakes/MIEngine,orbitcowboy/MIEngine,Microsoft/MIEngine,chuckries/MIEngine,edumunoz/MIEngine,csiusers/MIEngine,chuckries/MIEngine,rajkumar42/MIEngine,devilman3d/MIEngine,orbitcowboy/MIEngine,faxue-msft/MIEngine,devilman3d/MIEngine,pieandcakes/MIEngine,chuckries/MIEngine,Microsoft/MIEngine,rajkumar42/MIEngine,Microsoft/MIEngine,chuckries/MIEngine,orbitcowboy/MIEngine,rajkumar42/MIEngine,wesrupert/MIEngine,orbitcowboy/MIEngine,pieandcakes/MIEngine,csiusers/MIEngine,Microsoft/MIEngine,devilman3d/MIEngine,faxue-msft/MIEngine,csiusers/MIEngine,caslan/MIEngine,wesrupert/MIEngine,csiusers/MIEngine,faxue-msft/MIEngine
src/MICore/Transports/LocalTransport.cs
src/MICore/Transports/LocalTransport.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Collections.Generic; using System.Text; using System.Threading; using System.Diagnostics; using System.IO; using System.Collections.Specialized; using System.Collections; using System.Runtime.InteropServices; namespace MICore { public class LocalTransport : PipeTransport { public LocalTransport() { } public override void InitStreams(LaunchOptions options, out StreamReader reader, out StreamWriter writer) { LocalLaunchOptions localOptions = (LocalLaunchOptions)options; string miDebuggerDir = System.IO.Path.GetDirectoryName(localOptions.MIDebuggerPath); Process proc = new Process(); proc.StartInfo.FileName = localOptions.MIDebuggerPath; proc.StartInfo.Arguments = "--interpreter=mi"; proc.StartInfo.WorkingDirectory = miDebuggerDir; // On Windows, GDB locally requires that the directory be on the PATH, being the working directory isn't good enough if (PlatformUtilities.IsWindows() && options.DebuggerMIMode == MIMode.Gdb) { string path = proc.StartInfo.GetEnvironmentVariable("PATH"); path = (string.IsNullOrEmpty(path) ? miDebuggerDir : path + ";" + miDebuggerDir); proc.StartInfo.SetEnvironmentVariable("PATH", path); } foreach (EnvironmentEntry entry in localOptions.Environment) { proc.StartInfo.SetEnvironmentVariable(entry.Name, entry.Value); } InitProcess(proc, out reader, out writer); } protected override string GetThreadName() { return "MI.LocalTransport"; } } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Collections.Generic; using System.Text; using System.Threading; using System.Diagnostics; using System.IO; using System.Collections.Specialized; using System.Collections; using System.Runtime.InteropServices; namespace MICore { public class LocalTransport : PipeTransport { public LocalTransport() { } public override void InitStreams(LaunchOptions options, out StreamReader reader, out StreamWriter writer) { LocalLaunchOptions localOptions = (LocalLaunchOptions)options; string miDebuggerDir = System.IO.Path.GetDirectoryName(localOptions.MIDebuggerPath); Process proc = new Process(); proc.StartInfo.FileName = localOptions.MIDebuggerPath; proc.StartInfo.Arguments = "--interpreter=mi"; proc.StartInfo.WorkingDirectory = miDebuggerDir; // On Windows, GDB locally requires that the directory be on the PATH, being the working directory isn't good enough if (PlatformUtilities.IsWindows() && options.DebuggerMIMode == MIMode.Gdb) { string path = processStartInfo.GetEnvironmentVariable("PATH"); path = (string.IsNullOrEmpty(path) ? miDebuggerDir : path + ";" + miDebuggerDir); processStartInfo.SetEnvironmentVariable("PATH", path); } foreach (EnvironmentEntry entry in localOptions.Environment) { processStartInfo.SetEnvironmentVariable(entry.Name, entry.Value); } InitProcess(proc, out reader, out writer); } protected override string GetThreadName() { return "MI.LocalTransport"; } } }
mit
C#
6dc8d8e0857b484a118eb7ec3a55fec497f47da7
Check if logger is null and throw
merbla/serilog,CaioProiete/serilog,serilog/serilog,merbla/serilog,serilog/serilog
src/Serilog/Core/ForContextExtension.cs
src/Serilog/Core/ForContextExtension.cs
using System; using Serilog.Events; namespace Serilog { /// <summary> /// Extension method 'ForContext' for ILogger. /// </summary> public static class ForContextExtension { /// <summary> /// Create a logger that enriches log events with the specified property based on log event level. /// </summary> /// <typeparam name="TValue"> The type of the property value. </typeparam> /// <param name="logger">The logger</param> /// <param name="level">The log event level used to determine if log is enriched with property.</param> /// <param name="propertyName">The name of the property. Must be non-empty.</param> /// <param name="value">The property value.</param> /// <param name="destructureObjects">If true, the value will be serialized as a structured /// object if possible; if false, the object will be recorded as a scalar or simple array.</param> /// <returns>A logger that will enrich log events as specified.</returns> /// <returns></returns> public static ILogger ForContext<TValue>( this ILogger logger, LogEventLevel level, string propertyName, TValue value, bool destructureObjects = false) { if (logger == null) throw new ArgumentNullException(nameof(logger)); return !logger.IsEnabled(level) ? logger : logger.ForContext(propertyName, value, destructureObjects); } } }
using Serilog.Events; namespace Serilog { /// <summary> /// Extension method 'ForContext' for ILogger. /// </summary> public static class ForContextExtension { /// <summary> /// Create a logger that enriches log events with the specified property based on log event level. /// </summary> /// <typeparam name="TValue"> The type of the property value. </typeparam> /// <param name="logger">The logger</param> /// <param name="level">The log event level used to determine if log is enriched with property.</param> /// <param name="propertyName">The name of the property. Must be non-empty.</param> /// <param name="value">The property value.</param> /// <param name="destructureObjects">If true, the value will be serialized as a structured /// object if possible; if false, the object will be recorded as a scalar or simple array.</param> /// <returns>A logger that will enrich log events as specified.</returns> /// <returns></returns> public static ILogger ForContext<TValue>( this ILogger logger, LogEventLevel level, string propertyName, TValue value, bool destructureObjects = false) { return !logger.IsEnabled(level) ? logger : logger.ForContext(propertyName, value, destructureObjects); } } }
apache-2.0
C#
3392e8a6ac74faa23bfa71f1146c319e908bfa58
Add global sprite batch to graphics 2d
Faseway/GameLibrary
GameLibrary/Code/Rendering/Graphics2D.cs
GameLibrary/Code/Rendering/Graphics2D.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Faseway.GameLibrary.Components; namespace Faseway.GameLibrary.Rendering { public class Graphics2D : IComponent { // Properties /// <summary> /// Gets the graphics device. /// </summary> public GraphicsDevice GraphicsDevice { get; private set; } /// <summary> /// Gets a pixel. /// </summary> public Texture2D Pixel { get; private set; } /// <summary> /// Gets the default sprite font. /// </summary> public SpriteFont Font { get; private set; } /// <summary> /// Gets a sprite batch. /// </summary> public SpriteBatch SpriteBatch { get; private set; } // Constructor /// <summary> /// Initializes a new instance of the <see cref="Faseway.GameLibrary.Rendering.Graphics2D"/> class. /// </summary> /// <param name="graphicsDevice">A reference to the <see cref="Microsoft.Xna.Framework.Graphics.GraphicsDevice"/>.</param> public Graphics2D(GraphicsDevice graphicsDevice) { GraphicsDevice = graphicsDevice; try { Pixel = new Texture2D(graphicsDevice, 1, 1); Pixel.SetData<Color>(new Color[] { Color.White }); Font = Seed.Components.GetAndRequire<XnaReference>().GetAndRequire<ContentManager>().Load<SpriteFont>("Data//Fonts//Default"); SpriteBatch = new SpriteBatch(graphicsDevice); } catch (Exception ex) { MsgBox.Show(MsgBoxIcon.Error, "Graphics2D::Initialize", "Could not initialize Graphics2D"); throw ex; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Faseway.GameLibrary.Components; namespace Faseway.GameLibrary.Rendering { public class Graphics2D : IComponent { // Properties /// <summary> /// Gets the graphics device. /// </summary> public GraphicsDevice GraphicsDevice { get; private set; } /// <summary> /// Gets a pixel. /// </summary> public Texture2D Pixel { get; private set; } /// <summary> /// Gets the default sprite font. /// </summary> public SpriteFont Font { get; private set; } // Constructor /// <summary> /// Initializes a new instance of the <see cref="Faseway.GameLibrary.Rendering.Graphics2D"/> class. /// </summary> /// <param name="graphicsDevice">A reference to the <see cref="Microsoft.Xna.Framework.Graphics.GraphicsDevice"/>.</param> public Graphics2D(GraphicsDevice graphicsDevice) { GraphicsDevice = graphicsDevice; try { Pixel = new Texture2D(graphicsDevice, 1, 1); Pixel.SetData<Color>(new Color[] { Color.White }); Font = Seed.Components.GetAndRequire<XnaReference>().GetAndRequire<ContentManager>().Load<SpriteFont>("Data//Fonts//Default"); } catch (Exception ex) { MsgBox.Show(MsgBoxIcon.Error, "Graphics2D::Initialize", "Could not initialize Graphics2D"); throw ex; } } } }
mit
C#
596fbfe5e8bb9341f587e9e4ac0cafb0b87857b3
Use default C# formatting options for generated code.
Giorgi/Dynamic-PInvoke
DemoPinvokeConsoleApplication/Program.cs
DemoPinvokeConsoleApplication/Program.cs
using System.IO; using System.Reflection; using Roslyn.Compilers; using Roslyn.Compilers.CSharp; using Roslyn.Services; using Roslyn.Services.Formatting; namespace DemoPinvokeConsoleApplication { class Program { static void Main(string[] args) { var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var input = Path.Combine(directory, @"..\..\PInvoke.cs"); var syntaxTree = SyntaxTree.ParseFile(Path.GetFullPath(input)); var root = syntaxTree.GetRoot(); var compilation = Compilation.Create("PinvokeRewriter") .AddSyntaxTrees(syntaxTree) .AddReferences(new MetadataFileReference(typeof(object).Assembly.Location)); var semanticModel = compilation.GetSemanticModel(syntaxTree); var pinvokeRewriter = new PinvokeRewriter(semanticModel); var rewritten = pinvokeRewriter.Visit(root).Format(FormattingOptions.GetDefaultOptions()).GetFormattedRoot(); using (var writer = new StreamWriter(Path.GetFullPath(Path.Combine(directory, @"..\..\PInvokeRewritten.cs")))) { rewritten.WriteTo(writer); } } } }
using System.IO; using System.Reflection; using Roslyn.Compilers; using Roslyn.Compilers.CSharp; namespace DemoPinvokeConsoleApplication { class Program { static void Main(string[] args) { var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var input = Path.Combine(directory, @"..\..\PInvoke.cs"); var syntaxTree = SyntaxTree.ParseFile(Path.GetFullPath(input)); var root = syntaxTree.GetRoot(); var compilation = Compilation.Create("PinvokeRewriter") .AddSyntaxTrees(syntaxTree) .AddReferences(new MetadataFileReference(typeof(object).Assembly.Location)); var semanticModel = compilation.GetSemanticModel(syntaxTree); var pinvokeRewriter = new PinvokeRewriter(semanticModel); var rewritten = pinvokeRewriter.Visit(root).NormalizeWhitespace(); using (var writer = new StreamWriter(Path.GetFullPath(Path.Combine(directory, @"..\..\PInvokeRewritten.cs")))) { rewritten.WriteTo(writer); } } } }
mit
C#
8dcbc7feba9223ba9a1f005769cf7a9eb6525d02
Bump version
oozcitak/imagelistview
ImageListView/Properties/AssemblyInfo.cs
ImageListView/Properties/AssemblyInfo.cs
// ImageListView - A listview control for image files // Copyright (C) 2009 Ozgur Ozcitak // // 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. // // Ozgur Ozcitak (ozcitak@yahoo.com) 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("ImageListView")] [assembly: AssemblyDescription("A ListView like control for displaying image files with asynchronously loaded thumbnails.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Özgür Özçıtak")] [assembly: AssemblyProduct("ImageListView")] [assembly: AssemblyCopyright("Copyright © 2013 Özgür Özçıtak")] [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("3eb67a8d-4c80-4c11-944d-c99ef0ec7eb9")] // 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("13.8.2.0")] [assembly: AssemblyFileVersion("13.8.2.0")]
// ImageListView - A listview control for image files // Copyright (C) 2009 Ozgur Ozcitak // // 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. // // Ozgur Ozcitak (ozcitak@yahoo.com) 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("ImageListView")] [assembly: AssemblyDescription("A ListView like control for displaying image files with asynchronously loaded thumbnails.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Özgür Özçıtak")] [assembly: AssemblyProduct("ImageListView")] [assembly: AssemblyCopyright("Copyright © 2013 Özgür Özçıtak")] [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("3eb67a8d-4c80-4c11-944d-c99ef0ec7eb9")] // 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("13.8.1.0")] [assembly: AssemblyFileVersion("13.8.1.0")]
apache-2.0
C#
65ad52c26cbdee036e616b61263c214abf3b8a27
Increase the maximum time we wait for long running tests from 5 to 10.
eric-davis/JustSaying,Intelliflo/JustSaying,Intelliflo/JustSaying
JustSaying.TestingFramework/Patiently.cs
JustSaying.TestingFramework/Patiently.cs
using System; using System.Threading; using NUnit.Framework; namespace JustSaying.TestingFramework { public static class Patiently { public static void VerifyExpectation(Action expression) { VerifyExpectation(expression, 5.Seconds()); } public static void VerifyExpectation(Action expression, TimeSpan timeout) { bool hasTimedOut; var started = DateTime.Now; do { try { expression.Invoke(); return; } catch { } hasTimedOut = timeout < DateTime.Now - started; Thread.Sleep(TimeSpan.FromMilliseconds(50)); Console.WriteLine("Waiting for {0} ms - Still Checking.", (DateTime.Now - started).TotalMilliseconds); } while (!hasTimedOut); expression.Invoke(); } public static void AssertThat(Func<bool> func) { AssertThat(func, 10.Seconds()); } public static void AssertThat(Func<bool> func, TimeSpan timeout) { bool result; bool hasTimedOut; var started = DateTime.Now; do { result = func.Invoke(); hasTimedOut = timeout < DateTime.Now - started; Thread.Sleep(TimeSpan.FromMilliseconds(50)); Console.WriteLine("Waiting for {0} ms - Still Checking.", (DateTime.Now - started).TotalMilliseconds); } while (!result && !hasTimedOut); Assert.True(result); } } public static class Extensions { public static TimeSpan Seconds(this int seconds) { return TimeSpan.FromSeconds(seconds); } } }
using System; using System.Threading; using NUnit.Framework; namespace JustSaying.TestingFramework { public static class Patiently { public static void VerifyExpectation(Action expression) { VerifyExpectation(expression, 5.Seconds()); } public static void VerifyExpectation(Action expression, TimeSpan timeout) { bool hasTimedOut; var started = DateTime.Now; do { try { expression.Invoke(); return; } catch { } hasTimedOut = timeout < DateTime.Now - started; Thread.Sleep(TimeSpan.FromMilliseconds(50)); Console.WriteLine("Waiting for {0} ms - Still Checking.", (DateTime.Now - started).TotalMilliseconds); } while (!hasTimedOut); expression.Invoke(); } public static void AssertThat(Func<bool> func) { AssertThat(func, 5.Seconds()); } public static void AssertThat(Func<bool> func, TimeSpan timeout) { bool result; bool hasTimedOut; var started = DateTime.Now; do { result = func.Invoke(); hasTimedOut = timeout < DateTime.Now - started; Thread.Sleep(TimeSpan.FromMilliseconds(50)); Console.WriteLine("Waiting for {0} ms - Still Checking.", (DateTime.Now - started).TotalMilliseconds); } while (!result && !hasTimedOut); Assert.True(result); } } public static class Extensions { public static TimeSpan Seconds(this int seconds) { return TimeSpan.FromSeconds(seconds); } } }
apache-2.0
C#
f7361824d79bb15502f0d4b28cbf66aa6d73c4db
optimize cs
kbilsted/LineCounter.Net
LineCounter/Strategies/CSharpStrategy.cs
LineCounter/Strategies/CSharpStrategy.cs
using System; using System.IO; using LineCounter; namespace TeamBinary.LineCounter { class CSharpStrategy : IStrategy { static TrimStringLens l = new TrimStringLens(); public Statistics Count(string path) { var res = new Statistics(); var lines = File.ReadAllLines(path); foreach (var line in lines) { l.SetValue(line); if (l.IsWhitespace()) continue; if (l == "{" || l == "}" || l == ";") continue; if (l.StartsWithOrdinal("/")) { if (l.StartsWithOrdinal("/// ")) { if (l == "/// <summary>" || l == "/// </summary>") continue; res.DocumentationLines++; continue; } if (l.StartsWithOrdinal("//")) continue; } res.CodeLines++; } return res; } } }
using System; using System.IO; using LineCounter; namespace TeamBinary.LineCounter { class CSharpStrategy : IStrategy { static TrimStringLens l = new TrimStringLens(); public Statistics Count(string path) { var res = new Statistics(); var lines = File.ReadAllLines(path); foreach (var line in lines) { l.SetValue(line); if (l.IsWhitespace()) continue; if (l == "{" || l == "}" || l == ";") continue; if (l.StartsWithOrdinal("/")) { if (l == "/// <summary>" || l == "/// </summary>") continue; if (l.StartsWithOrdinal("/// ")) res.DocumentationLines++; if (l.StartsWithOrdinal("//")) continue; } res.CodeLines++; } return res; } } }
apache-2.0
C#
5f6ed3816ef3c7d7a785950773f01fb9c35629c4
update AssemblyInfo
p76984275/MahApps.Metro,psinl/MahApps.Metro,xxMUROxx/MahApps.Metro,batzen/MahApps.Metro,jumulr/MahApps.Metro,pfattisc/MahApps.Metro,chuuddo/MahApps.Metro,Danghor/MahApps.Metro,ye4241/MahApps.Metro,MahApps/MahApps.Metro,Jack109/MahApps.Metro,Evangelink/MahApps.Metro
MahApps.Metro/Properties/AssemblyInfo.cs
MahApps.Metro/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Markup; [assembly: AssemblyCopyright("Copyright © MahApps.Metro 2011-2016")] [assembly: ComVisible(false)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: XmlnsDefinition("http://metro.mahapps.com/winfx/xaml/shared", "MahApps.Metro.Behaviours")] [assembly: XmlnsDefinition("http://metro.mahapps.com/winfx/xaml/shared", "MahApps.Metro.Converters")] [assembly: XmlnsDefinition("http://metro.mahapps.com/winfx/xaml/controls", "MahApps.Metro.Controls")] [assembly: AssemblyVersion("1.2.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyTitleAttribute("MahApps.Metro")] [assembly: AssemblyDescriptionAttribute("Toolkit for creating Metro styled WPF apps")] [assembly: AssemblyProductAttribute("MahApps.Metro")] [assembly: AssemblyCompany("MahApps")]
using System.Reflection; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Markup; [assembly: AssemblyCopyright("Copyright © MahApps.Metro 2011-2016")] [assembly: ComVisible(false)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: XmlnsDefinition("http://metro.mahapps.com/winfx/xaml/shared", "MahApps.Metro.Behaviours")] [assembly: XmlnsDefinition("http://metro.mahapps.com/winfx/xaml/shared", "MahApps.Metro.Converters")] [assembly: XmlnsDefinition("http://metro.mahapps.com/winfx/xaml/controls", "MahApps.Metro.Controls")] [assembly: AssemblyVersion("1.2.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyTitleAttribute("MahApps.Metro")] [assembly: AssemblyDescriptionAttribute("Toolkit for creating Metro styled WPF apps")] [assembly: AssemblyProductAttribute("MahApps.Metro 1.2.0")] [assembly: AssemblyCompany("MahApps")]
mit
C#
0a1dd45e446bc35615d019a734047ed662e6fd48
Improve responses from pdf controller
mondeun/PdfAutofill
PdfAutofill/Controllers/PdfController.cs
PdfAutofill/Controllers/PdfController.cs
using System.Linq; using Microsoft.AspNetCore.Mvc; using PdfAutofill.Model; using PdfAutofill.Service; using PdfAutofill.Service.Impl; namespace PdfAutofill.Controllers { [Route("api/[controller]")] public class PdfController : Controller { private readonly IPdfService _service = new PdfService(); [HttpGet] public IActionResult Get([FromHeader(Name = "url")]string url) { if (!string.IsNullOrWhiteSpace(url)) { _service.InitDocument(url); return Ok(_service.GetAcroFields().Select(x => x.Key).ToList()); } ModelState.AddModelError("url", "Url is missing"); return BadRequest(ModelState); } [HttpPost] public IActionResult Post([FromBody]PdfViewModel model) { _service.InitDocument(model); var pdf = _service.FillPdf(model); // TODO Exception handling and validation return Ok(pdf); } } }
using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Mvc; using PdfAutofill.Model; using PdfAutofill.Service; using PdfAutofill.Service.Impl; namespace PdfAutofill.Controllers { [Route("api/[controller]")] public class PdfController : Controller { private readonly IPdfService _service = new PdfService(); [HttpGet] public List<string> Get([FromHeader(Name = "url")]string url) { if (!string.IsNullOrWhiteSpace(url)) { _service.InitDocument(url); return _service.GetAcroFields().Select(x => x.Key).ToList(); } return null; } [HttpPost] public string Post([FromBody]PdfViewModel model) { _service.InitDocument(model); var pdf = _service.FillPdf(model); // TODO Exception handling and validation return pdf; } } }
agpl-3.0
C#
d2324786e8555ab44fd368d875cf1a3057be3685
Remove cursor color type for now
BigEggTools/PowerMode
PowerMode/Settings/ParticlesColorType.cs
PowerMode/Settings/ParticlesColorType.cs
namespace BigEgg.Tools.PowerMode.Settings { public enum ParticlesColorType { Random, Fixed } }
namespace BigEgg.Tools.PowerMode.Settings { public enum ParticlesColorType { Cursor, Random, Fixed } }
mit
C#
0536c5afa0403eacf0499c6be2dff3bf7b21ba41
Add method to unescape string.
NickCraver/dotless,r2i-sitecore/dotless,rytmis/dotless,modulexcite/dotless,modulexcite/dotless,modulexcite/dotless,NickCraver/dotless,r2i-sitecore/dotless,r2i-sitecore/dotless,dotless/dotless,modulexcite/dotless,NickCraver/dotless,r2i-sitecore/dotless,r2i-sitecore/dotless,r2i-sitecore/dotless,NickCraver/dotless,rytmis/dotless,rytmis/dotless,modulexcite/dotless,rytmis/dotless,rytmis/dotless,rytmis/dotless,rytmis/dotless,modulexcite/dotless,r2i-sitecore/dotless,dotless/dotless,modulexcite/dotless
dotlessjs.Core/Tree/Quoted.cs
dotlessjs.Core/Tree/Quoted.cs
using System.Text.RegularExpressions; using dotless.Infrastructure; namespace dotless.Tree { public class Quoted : Node { public string Value { get; set; } public string Contents { get; set; } public Quoted(string value, string contents) { Value = value; Contents = contents; } public Quoted(string value) : this(value, value) { } public override string ToCSS(Env env) { return Value; } private readonly Regex _unescape = new Regex(@"(^|[^\\])\\(.)"); public string UnescapeContents() { return _unescape.Replace(Contents, @"$1$2"); } } }
using dotless.Infrastructure; namespace dotless.Tree { public class Quoted : Node { public string Value { get; set; } public string Contents { get; set; } public Quoted(string value, string contents) { Value = value; Contents = contents; } public override string ToCSS(Env env) { return Value; } } }
apache-2.0
C#
e88e32cb0622474a8d49eb3503533428bca2ad67
Revert visibility change and add null check
ppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework
osu.Framework/Audio/Callbacks/DataStreamFileProcedures.cs
osu.Framework/Audio/Callbacks/DataStreamFileProcedures.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.IO; #nullable enable namespace osu.Framework.Audio.Callbacks { /// <summary> /// Implementation of <see cref="IFileProcedures"/> that supports reading from a <see cref="Stream"/>. /// </summary> public class DataStreamFileProcedures : IFileProcedures { private readonly Stream dataStream; public DataStreamFileProcedures(Stream data) { dataStream = data ?? throw new ArgumentNullException(nameof(data)); } public void Close(IntPtr user) { } public long Length(IntPtr user) { if (!dataStream.CanSeek) return 0; try { return dataStream.Length; } catch { return 0; } } public unsafe int Read(IntPtr buffer, int length, IntPtr user) { if (!dataStream.CanRead) return 0; try { return dataStream.Read(new Span<byte>((void*)buffer, length)); } catch { return 0; } } public bool Seek(long offset, IntPtr user) { if (!dataStream.CanSeek) return false; try { return dataStream.Seek(offset, SeekOrigin.Begin) == offset; } catch { return false; } } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.IO; #nullable enable namespace osu.Framework.Audio.Callbacks { /// <summary> /// Implementation of <see cref="IFileProcedures"/> that supports reading from a <see cref="Stream"/>. /// </summary> internal class DataStreamFileProcedures : IFileProcedures { private readonly Stream dataStream; public DataStreamFileProcedures(Stream data) { dataStream = data; } public void Close(IntPtr user) { } public long Length(IntPtr user) { if (!dataStream.CanSeek) return 0; try { return dataStream.Length; } catch { return 0; } } public unsafe int Read(IntPtr buffer, int length, IntPtr user) { if (!dataStream.CanRead) return 0; try { return dataStream.Read(new Span<byte>((void*)buffer, length)); } catch { return 0; } } public bool Seek(long offset, IntPtr user) { if (!dataStream.CanSeek) return false; try { return dataStream.Seek(offset, SeekOrigin.Begin) == offset; } catch { return false; } } } }
mit
C#
f9976e21e7d38292bb0f63118f11f65c17edef82
Use notification instead of debug to allow testing outside of editor
loicteixeira/gj-unity-api
Assets/Tests/Load/LoadTest.cs
Assets/Tests/Load/LoadTest.cs
using UnityEngine; using UnityEngine.UI; using System.Collections; public class LoadTest : MonoBehaviour { public void SignInButtonClicked() { GameJolt.UI.Manager.Instance.ShowSignIn((bool success) => { if (success) { GameJolt.UI.Manager.Instance.QueueNotification("Welcome"); } else { GameJolt.UI.Manager.Instance.QueueNotification("Closed the window :("); } }); } public void IsSignedInButtonClicked() { if (GameJolt.API.Manager.Instance.CurrentUser != null) { GameJolt.UI.Manager.Instance.QueueNotification( "Signed in as " + GameJolt.API.Manager.Instance.CurrentUser.Name); } else { GameJolt.UI.Manager.Instance.QueueNotification("Not Signed In :("); } } public void LoadSceneButtonClicked(string sceneName) { Debug.Log("Loading Scene " + sceneName); #if UNITY_5_0 || UNITY_5_1 || UNITY_5_2 Application.LoadLevel(sceneName); #else UnityEngine.SceneManagement.SceneManager.LoadScene(sceneName); #endif } }
using UnityEngine; using UnityEngine.UI; using System.Collections; public class LoadTest : MonoBehaviour { public void SignInButtonClicked() { GameJolt.UI.Manager.Instance.ShowSignIn((bool success) => { if (success) { Debug.Log("Logged In"); } else { Debug.Log("Dismissed"); } }); } public void IsSignedInButtonClicked() { bool isSignedIn = GameJolt.API.Manager.Instance.CurrentUser != null; if (isSignedIn) { Debug.Log("Signed In"); } else { Debug.Log("Not Signed In"); } } public void LoadSceneButtonClicked(string sceneName) { Debug.Log("Loading Scene " + sceneName); #if UNITY_5_0 || UNITY_5_1 || UNITY_5_2 Application.LoadLevel(sceneName); #else UnityEngine.SceneManagement.SceneManager.LoadScene(sceneName); #endif } }
mit
C#
387227f3909f34fba142f6814d0464f601d640b4
Add comments for none generic generator
inputfalken/Sharpy
GeneratorAPI/IGenerator.cs
GeneratorAPI/IGenerator.cs
namespace GeneratorAPI { /// <summary> /// Represents a generic generator which can generate any ammount of elements. /// </summary> /// <typeparam name="T"></typeparam> public interface IGenerator<out T> : IGenerator { /// <summary> /// Generate next element. /// </summary> new T Generate(); } /// <summary> /// Represent a generator which can generate any ammount of elements. /// </summary> public interface IGenerator { /// <summary> /// Generate next element. /// </summary> object Generate(); } }
namespace GeneratorAPI { /// <summary> /// Represents a generic generator which can generate any ammount of elements. /// </summary> /// <typeparam name="T"></typeparam> public interface IGenerator<out T> : IGenerator { /// <summary> /// Generate next element. /// </summary> new T Generate(); } public interface IGenerator { object Generate(); } }
mit
C#
f91dd06a3d2c0b70c8a92f757955ef40c30edf09
add test for loadAllEvents
Pondidum/Ledger.Stores.Fs,Pondidum/Ledger.Stores.Fs
Ledger.Stores.Fs.Tests/LoadAllTests.cs
Ledger.Stores.Fs.Tests/LoadAllTests.cs
using System; using System.IO; using System.Linq; using Ledger.Acceptance; using Ledger.Acceptance.TestDomain.Events; using Ledger.Acceptance.TestObjects; using Shouldly; using Xunit; namespace Ledger.Stores.Fs.Tests { public class LoadAllTests { private const string StreamName = "LoadStream"; private readonly string _root; private readonly FileEventStore _store; private readonly IncrementingStamper _stamper; public LoadAllTests() { _root = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); Directory.CreateDirectory(_root); _store = new FileEventStore(_root); _stamper = new IncrementingStamper(); } [Fact] public void When_loading_all_keys() { var firstID = Guid.NewGuid(); var secondID = Guid.NewGuid(); using (var writer = _store.CreateWriter<Guid>(StreamName)) { writer.SaveEvents(new[] { new TestEvent { AggregateID = firstID, Stamp = _stamper.GetNext() }, new TestEvent { AggregateID = firstID, Stamp = _stamper.GetNext() }, new TestEvent { AggregateID = secondID, Stamp = _stamper.GetNext() }, new TestEvent { AggregateID = firstID, Stamp = _stamper.GetNext() }, new TestEvent { AggregateID = secondID, Stamp = _stamper.GetNext() }, }); } using (var reader = _store.CreateReader<Guid>(StreamName)) { reader.LoadAllKeys().ShouldBe(new[] { firstID, secondID }, true); } } [Fact] public void When_loading_all_events() { var firstID = Guid.NewGuid(); var secondID = Guid.NewGuid(); using (var writer = _store.CreateWriter<Guid>(StreamName)) { writer.SaveEvents(new IDomainEvent<Guid>[] { new CandidateCreated { AggregateID = firstID, Stamp = _stamper.GetNext() }, new AddEmailAddress { AggregateID = firstID, Stamp = _stamper.GetNext() }, new FixNameSpelling { AggregateID = secondID, Stamp = _stamper.GetNext() }, new NameChangedByDeedPoll { AggregateID = firstID, Stamp = _stamper.GetNext() }, new AddEmailAddress { AggregateID = secondID, Stamp = _stamper.GetNext() }, }); } using (var reader = _store.CreateReader<Guid>(StreamName)) { reader.LoadAllEvents().Select(e => e.GetType()).ShouldBe(new[] { typeof(CandidateCreated), typeof(AddEmailAddress), typeof(FixNameSpelling), typeof(NameChangedByDeedPoll), typeof(AddEmailAddress) }); } } } }
using System; using System.IO; using Ledger.Acceptance; using Ledger.Acceptance.TestObjects; using Shouldly; using Xunit; namespace Ledger.Stores.Fs.Tests { public class LoadAllTests { private const string StreamName = "LoadStream"; private readonly string _root; private readonly FileEventStore _store; private readonly IncrementingStamper _stamper; public LoadAllTests() { _root = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); Directory.CreateDirectory(_root); _store = new FileEventStore(_root); _stamper = new IncrementingStamper(); } [Fact] public void When_loading_all_keys() { var firstID = Guid.NewGuid(); var secondID = Guid.NewGuid(); using (var writer = _store.CreateWriter<Guid>(StreamName)) { writer.SaveEvents(new[] { new TestEvent { AggregateID = firstID, Stamp = _stamper.GetNext() }, new TestEvent { AggregateID = firstID, Stamp = _stamper.GetNext() }, new TestEvent { AggregateID = secondID, Stamp = _stamper.GetNext() }, new TestEvent { AggregateID = firstID, Stamp = _stamper.GetNext() }, new TestEvent { AggregateID = secondID, Stamp = _stamper.GetNext() }, }); } using (var reader = _store.CreateReader<Guid>(StreamName)) { reader.LoadAllKeys().ShouldBe(new[] { firstID, secondID }, true); } } } }
lgpl-2.1
C#
5730b8dcd0aa5b27e7cbc3b475716c4211d6c46e
bump version down
kalotay/Log4Rx.NET
Log4Rx/Log4Rx/Properties/AssemblyInfo.cs
Log4Rx/Log4Rx/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("Log4Rx")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Log4Rx")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("930b8b83-e836-43de-adeb-3d88382ffa8c")] // 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.0.0.0")] [assembly: AssemblyFileVersion("0.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Log4Rx")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Log4Rx")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("930b8b83-e836-43de-adeb-3d88382ffa8c")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
51bfde8d121450065e2e94022d87be2bcabac632
Allow UuidTypeConverter to convert to Nullable<Uuid>.
brendanjbaker/Bakery
src/Bakery/UuidTypeConverter.cs
src/Bakery/UuidTypeConverter.cs
namespace Bakery { using System; using System.ComponentModel; using System.Globalization; public class UuidTypeConverter : TypeConverter { public override Boolean CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return sourceType == typeof(String) || sourceType == typeof(Guid); } public override Boolean CanConvertTo(ITypeDescriptorContext context, Type destinationType) { return destinationType == typeof(Uuid) || destinationType == typeof(Uuid?); } public override Object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) { if (value == null) return null; if (value.GetType() == typeof(String)) return FromString(value.ToString()); if (value.GetType() == typeof(Guid)) return new Uuid((Guid)value); return null; } public override Object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, Object value, Type destinationType) { if (value == null) return null; if (value.GetType() == typeof(Guid)) return new Uuid((Guid)value); return null; } private static Object FromString(String @string) { Guid guid; if (!Guid.TryParse(@string, out guid)) return null; return new Uuid(guid); } } }
namespace Bakery { using System; using System.ComponentModel; using System.Globalization; public class UuidTypeConverter : TypeConverter { public override Boolean CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return sourceType == typeof(String) || sourceType == typeof(Guid); } public override Boolean CanConvertTo(ITypeDescriptorContext context, Type destinationType) { return destinationType == typeof(Uuid); } public override Object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) { if (value == null) return null; if (value.GetType() == typeof(String)) return FromString(value.ToString()); if (value.GetType() == typeof(Guid)) return new Uuid((Guid)value); return null; } public override Object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, Object value, Type destinationType) { if (value == null) return null; if (value.GetType() == typeof(Guid)) return new Uuid((Guid)value); return null; } private static Object FromString(String @string) { Guid guid; if (!Guid.TryParse(@string, out guid)) return null; return new Uuid(guid); } } }
mit
C#
d3890ebb63cd520556b7f7ebc51cba0a1b8d011c
fix bug audioManager et potion
ifgx/rtm-phase2
Assets/scripts/item/Potion.cs
Assets/scripts/item/Potion.cs
using UnityEngine; using System.Collections; /** * @author Adrien D * @version 1.0 */ /** * Potion script */ public abstract class Potion : MonoBehaviour { private AudioManager audioManager; public Potion(){ } public Vector3 GetPosition() { float x = this.transform.position.x; float y = this.transform.position.y; float z = this.transform.position.z; return new Vector3(x,y,z); } void Update() { if (audioManager == null) { audioManager = GameObject.Find("Main Camera").GetComponent<AudioManager>(); } } /** * Triggers the effect on collision with the Hero */ void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { Hero hero = other.gameObject.GetComponentInParent<Hero> (); triggerEffect (hero); audioManager.playPotionSound(); GameModel.PotionsInGame.Remove (this); Destroy(this.gameObject); } } /** * Do the effet of the potion on the hero */ protected abstract void triggerEffect(Hero hero); }
using UnityEngine; using System.Collections; /** * @author Adrien D * @version 1.0 */ /** * Potion script */ public abstract class Potion : MonoBehaviour { private AudioManager audioManager; public Potion(){ audioManager = GameObject.Find("Main Camera").GetComponent<AudioManager>(); } public Vector3 GetPosition() { float x = this.transform.position.x; float y = this.transform.position.y; float z = this.transform.position.z; return new Vector3(x,y,z); } /** * Triggers the effect on collision with the Hero */ void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { Hero hero = other.gameObject.GetComponentInParent<Hero> (); triggerEffect (hero); audioManager.playPotionSound(); GameModel.PotionsInGame.Remove (this); Destroy(this.gameObject); } } /** * Do the effet of the potion on the hero */ protected abstract void triggerEffect(Hero hero); }
cc0-1.0
C#
490c0c70d6c144a2ab0a76dc696aa91e071c67b0
Format comments.
AIWolfSharp/AIWolfCore,AIWolfSharp/AIWolf_NET
AIWolfLibCommon/Data/Guard.cs
AIWolfLibCommon/Data/Guard.cs
// // Guard.cs // // Copyright (c) 2016 Takashi OTSUKI // // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // using System.Runtime.Serialization; namespace AIWolf.Common.Data { /// <summary> /// Guard class. /// </summary> /// <remarks></remarks> [DataContract] public class Guard { /// <summary> /// The day of the guard. /// </summary> /// <value>The day of the guard.</value> [DataMember(Name = "day")] public int Day { get; } /// <summary> /// The agent of the bodyguard. /// </summary> /// <value>The agent of the bodyguard.</value> [DataMember(Name = "agent")] public Agent Agent { get; } /// <summary> /// The agent guarded by the bodyguard. /// </summary> /// <value>The agent guarded.</value> [DataMember(Name = "target")] public Agent Target { get; } /// <summary> /// Initializes a new instance of this class. /// </summary> /// <param name="day">The day of guard.</param> /// <param name="agent">The agent of the bodyguard.</param> /// <param name="target">The agent guarded by the bodyguard.</param> public Guard(int day, Agent agent, Agent target) { Day = day; Agent = agent; Target = target; } /// <summary> /// Returns a string that represents the current object. /// </summary> /// <returns>A string that represents the current object.</returns> /// <remarks></remarks> public override string ToString() { return Agent + " guarded " + Target + "@" + Day; } } }
// // Guard.cs // // Copyright (c) 2016 Takashi OTSUKI // // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // using System.Runtime.Serialization; namespace AIWolf.Common.Data { /// <summary> /// Information of the guard carried out by the bodyguard. /// </summary> /// <remarks></remarks> [DataContract] public class Guard { /// <summary> /// The day of the guard. /// </summary> /// <value>The day of the guard.</value> /// <remarks></remarks> [DataMember(Name = "day")] public int Day { get; } /// <summary> /// The agent of the bodyguard. /// </summary> /// <value>The agent of the bodyguard.</value> /// <remarks></remarks> [DataMember(Name = "agent")] public Agent Agent { get; } /// <summary> /// The agent guarded by the bodyguard. /// </summary> /// <value>The agent guarded.</value> /// <remarks></remarks> [DataMember(Name = "target")] public Agent Target { get; } /// <summary> /// Initializes a new instance of Guard class. /// </summary> /// <param name="day">The day of guard.</param> /// <param name="agent">The agent of the bodyguard.</param> /// <param name="target">The agent guarded by the bodyguard.</param> /// <remarks></remarks> public Guard(int day, Agent agent, Agent target) { Day = day; Agent = agent; Target = target; } /// <summary> /// Returns a string that represents the current object. /// </summary> /// <returns>A string that represents the current object.</returns> /// <remarks></remarks> public override string ToString() { return Agent + " guarded " + Target + "@" + Day; } } }
mit
C#
7e3495bb26f86ddaa0d909dc1c95ceaf26302303
Remove LINQ dependency
mstrother/BmpListener
BmpListener/Bgp/Capability.cs
BmpListener/Bgp/Capability.cs
using System; namespace BmpListener.Bgp { public abstract class Capability { protected Capability(ArraySegment<byte> data) { var offset = data.Offset; CapabilityType = (CapabilityCode)data.Array[offset]; Length = data.Array[data.Offset + 1]; } public CapabilityCode CapabilityType { get; } public int Length { get; } public static Capability GetCapability(ArraySegment<byte> data) { var offset = data.Offset; var capabilityType = (CapabilityCode)data.Array[offset]; switch (capabilityType) { case CapabilityCode.Multiprotocol: return new CapabilityMultiProtocol(data); case CapabilityCode.RouteRefresh: return new CapabilityRouteRefresh(data); case CapabilityCode.GracefulRestart: return new CapabilityGracefulRestart(data); case CapabilityCode.FourOctetAs: return new CapabilityFourOctetAsNumber(data); case CapabilityCode.AddPath: return new CapabilityAddPath(data); case CapabilityCode.EnhancedRouteRefresh: return new CapabilityEnhancedRouteRefresh(data); case CapabilityCode.CiscoRouteRefresh: return new CapabilityCiscoRouteRefresh(data); default: return null; } } } }
using System; using System.Linq; namespace BmpListener.Bgp { public abstract class Capability { //private readonly int length; protected Capability(ArraySegment<byte> data) { CapabilityType = (CapabilityCode)data.First(); Length = data.ElementAt(1); } public CapabilityCode CapabilityType { get; } public int Length { get; } public bool ShouldSerializeLength() { return false; } public static Capability GetCapability(ArraySegment<byte> data) { var capabilityType = (CapabilityCode)data.First(); switch (capabilityType) { case CapabilityCode.Multiprotocol: return new CapabilityMultiProtocol(data); case CapabilityCode.RouteRefresh: return new CapabilityRouteRefresh(data); case CapabilityCode.GracefulRestart: return new CapabilityGracefulRestart(data); case CapabilityCode.FourOctetAs: return new CapabilityFourOctetAsNumber(data); case CapabilityCode.AddPath: return new CapabilityAddPath(data); case CapabilityCode.EnhancedRouteRefresh: return new CapabilityEnhancedRouteRefresh(data); case CapabilityCode.CiscoRouteRefresh: return new CapabilityCiscoRouteRefresh(data); default: return null; } } } }
mit
C#
2caff2c1341a4bc4b8f8cae0da859ec7ccf09d7c
use Rusty.Core for dummy MsgBox call
maul-esel/CobaltAHK,maul-esel/CobaltAHK
CobaltAHK/ExpressionTree/Scope.cs
CobaltAHK/ExpressionTree/Scope.cs
using System; using System.Collections.Generic; using System.Linq.Expressions; namespace CobaltAHK.ExpressionTree { public class Scope { public Scope() : this(null) { } public Scope(Scope parentScope) { parent = parentScope; #if DEBUG var msgbox = Expression.Lambda<Action>( Expression.Block( Expression.Call(typeof(IronAHK.Rusty.Core).GetMethod("MsgBox", new[] { typeof(string) }), Expression.Constant("MSGBOX dummy")) ) ); AddFunction("MsgBox", msgbox); #endif } private readonly Scope parent; public bool IsRoot { get { return parent == null; } } private readonly IDictionary<string, LambdaExpression> functions = new Dictionary<string, LambdaExpression>(); public void AddFunction(string name, LambdaExpression func) { functions[name.ToLower()] = func; } public LambdaExpression ResolveFunction(string name) { if (functions.ContainsKey(name.ToLower())) { return functions[name.ToLower()]; } else if (parent != null) { return parent.ResolveFunction(name); } throw new Exception(); // todo } private readonly IDictionary<string, ParameterExpression> variables = new Dictionary<string, ParameterExpression>(); public void AddVariable(string name, ParameterExpression variable) { variables.Add(name.ToLower(), variable); } public ParameterExpression ResolveVariable(string name) { if (!variables.ContainsKey(name.ToLower())) { AddVariable(name, Expression.Parameter(typeof(object), name)); } return variables[name.ToLower()]; } // todo: RootScope() initialized with builtin functions and commands } }
using System; using System.Collections.Generic; using System.Linq.Expressions; namespace CobaltAHK.ExpressionTree { public class Scope { public Scope() : this(null) { } public Scope(Scope parentScope) { parent = parentScope; #if DEBUG var msgbox = Expression.Lambda<Action>( Expression.Block( Expression.Call(typeof(Scope).GetMethod("MsgBox", new[] { typeof(string) }), Expression.Constant("MSGBOX dummy")) ) ); AddFunction("MsgBox", msgbox); #endif } #if DEBUG public static void MsgBox(string text) { Console.WriteLine(text); } #endif private readonly Scope parent; public bool IsRoot { get { return parent == null; } } private readonly IDictionary<string, LambdaExpression> functions = new Dictionary<string, LambdaExpression>(); public void AddFunction(string name, LambdaExpression func) { functions[name.ToLower()] = func; } public LambdaExpression ResolveFunction(string name) { if (functions.ContainsKey(name.ToLower())) { return functions[name.ToLower()]; } else if (parent != null) { return parent.ResolveFunction(name); } throw new Exception(); // todo } private readonly IDictionary<string, ParameterExpression> variables = new Dictionary<string, ParameterExpression>(); public void AddVariable(string name, ParameterExpression variable) { variables.Add(name.ToLower(), variable); } public ParameterExpression ResolveVariable(string name) { if (!variables.ContainsKey(name.ToLower())) { AddVariable(name, Expression.Parameter(typeof(object), name)); } return variables[name.ToLower()]; } // todo: RootScope() initialized with builtin functions and commands } }
mit
C#
2c8adffc55598a8af1ce1e8eda69866dd2da258e
call ChangeRoom() on Collision with door
whoa-algebraic/game-off-2016,virtuoushub/game-off-2016,virtuoushub/game-off-2016,virtuoushub/game-off-2016,whoa-algebraic/game-off-2016,whoa-algebraic/game-off-2016
Assets/Scripts/DoorDetails.cs
Assets/Scripts/DoorDetails.cs
using UnityEngine; using System.Collections; public class DoorDetails : MonoBehaviour { public int Id; private int connectedRoomId; private int connectedDoorId; // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void OnCollisionEnter2D() { Debug.Log("collision detected, connecting to room " + connectedRoomId + " door " + connectedDoorId); Managers.RoomNavigationManager.ChangeRoom(connectedRoomId, connectedDoorId); } public void SetConnectedDoor(int roomId, int doorId) { connectedRoomId = roomId; connectedDoorId = doorId; } }
using UnityEngine; using System.Collections; public class DoorDetails : MonoBehaviour { public int Id; private int connectedRoomId; private int connectedDoorId; // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void OnCollisionEnter2D() { Debug.Log("collision detected, connecting to room " + connectedRoomId + " door " + connectedDoorId); } public void SetConnectedDoor(int roomId, int doorId) { connectedRoomId = roomId; connectedDoorId = doorId; } }
mit
C#
af6cabdee789ffdffca26e1893bafd6daf695643
Set velocity and forward vector when resetting ball position
Double-Fine-Game-Club/pongball
Assets/scripts/entity/Ball.cs
Assets/scripts/entity/Ball.cs
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; public class Ball : NetworkBehaviour { private Rigidbody rigidBody = null; private Vector3 startingPosition = Vector3.zero; float minimumVelocity = 5; float startingMinVelocity = -10; float startingMaxVelocity = 10; // Use this for initialization void Start () { if (!isServer) return; rigidBody = GetComponent<Rigidbody>(); startingPosition = transform.position; } private void FixedUpdate() { if (!isServer) return; if (rigidBody.velocity.magnitude < minimumVelocity) { rigidBody.velocity = rigidBody.velocity * 1.25f; } } public void ResetPosition() { if (!isServer) return; rigidBody.velocity = Vector3.zero; transform.forward = new Vector3(1, 0, 1); transform.position = startingPosition; } }
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; public class Ball : NetworkBehaviour { private Rigidbody rigidBody = null; private Vector3 startingPosition = Vector3.zero; float minimumVelocity = 5; float startingMinVelocity = -10; float startingMaxVelocity = 10; // Use this for initialization void Start () { if (!isServer) return; rigidBody = GetComponent<Rigidbody>(); startingPosition = transform.position; } private void FixedUpdate() { if (!isServer) return; if (rigidBody.velocity.magnitude < minimumVelocity) { rigidBody.velocity = rigidBody.velocity * 1.25f; } } public void ResetPosition() { if (!isServer) return; transform.position = startingPosition; } }
mit
C#
1964f76691f3bbd4e7abcca5d72e0644c4a1dbcd
Add CloudinaryInfo
dataccountzXJ9/Lynx
Lynx/Database/Models/LynxModel.cs
Lynx/Database/Models/LynxModel.cs
using Lynx.Database; using System.Collections.Generic; namespace Lynx.Models.Database { public class LynxModel { public string BotToken { get; set; } public string BotPrefix { get; set; } public string ClarifaiAPIKey { get; set; } public bool Debug { get; set; } public string Id { get; set; } public string GoogleAPIKey { get; set; } public int MessagesReceived { get; set; } public int CommandsTriggered { get; set; } public List<string> BotGames { get; set; } = new List<string>(); public List<string> EvalImports { get; set; } = new List<string>(); public CloudinaryInfo Cloudinary { get; set; } = new CloudinaryInfo(); } }
using System.Collections.Generic; namespace Lynx.Models.Database { public class LynxModel { public string BotToken { get; set; } public string BotPrefix { get; set; } public string ClarifaiAPIKey { get; set; } public bool Debug { get; set; } public string Id { get; set; } public string GoogleAPIKey { get; set; } public int MessagesReceived { get; set; } public int CommandsTriggered { get; set; } public List<string> BotGames { get; set; } = new List<string>(); public List<string> EvalImports { get; set; } = new List<string>(); } }
mit
C#
61618e17fb7b66f631e7aac5b358d5a21559322c
Update Transpilers.cs
pardeike/Harmony
Harmony/Public/Transpilers.cs
Harmony/Public/Transpilers.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Reflection.Emit; namespace HarmonyLib { /// <summary>A collection of commonly used transpilers</summary> /// public static class Transpilers { /// <summary>A transpiler that replaces all occurrences of a given method with another one using the same signature</summary> /// <param name="instructions">The enumeration of <see cref="CodeInstruction"/> to act on</param> /// <param name="from">Method or constructor to search for</param> /// <param name="to">Method or constructor to replace with</param> /// <returns>Modified enumeration of <see cref="CodeInstruction"/></returns> /// public static IEnumerable<CodeInstruction> MethodReplacer(this IEnumerable<CodeInstruction> instructions, MethodBase from, MethodBase to) { if (from is null) throw new ArgumentException("Unexpected null argument", nameof(from)); if (to is null) throw new ArgumentException("Unexpected null argument", nameof(to)); foreach (var instruction in instructions) { var method = instruction.operand as MethodBase; if (method == from) { instruction.opcode = to.IsConstructor ? OpCodes.Newobj : OpCodes.Call; instruction.operand = to; } yield return instruction; } } /// <summary>A transpiler that alters instructions that match a predicate by calling an action</summary> /// <param name="instructions">The enumeration of <see cref="CodeInstruction"/> to act on</param> /// <param name="predicate">A predicate selecting the instructions to change</param> /// <param name="action">An action to apply to matching instructions</param> /// <returns>Modified enumeration of <see cref="CodeInstruction"/></returns> /// public static IEnumerable<CodeInstruction> Manipulator(this IEnumerable<CodeInstruction> instructions, Func<CodeInstruction, bool> predicate, Action<CodeInstruction> action) { if (predicate is null) throw new ArgumentNullException(nameof(predicate)); if (action is null) throw new ArgumentNullException(nameof(action)); return instructions.Select(instruction => { if (predicate(instruction)) action(instruction); return instruction; }).AsEnumerable(); } /// <summary>A transpiler that logs a text at the beginning of the method</summary> /// <param name="instructions">The instructions to act on</param> /// <param name="text">The log text</param> /// <returns>Modified enumeration of <see cref="CodeInstruction"/></returns> /// public static IEnumerable<CodeInstruction> DebugLogger(this IEnumerable<CodeInstruction> instructions, string text) { yield return new CodeInstruction(OpCodes.Ldstr, text); yield return new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(FileLog), nameof(FileLog.Log))); foreach (var instruction in instructions) yield return instruction; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Reflection.Emit; namespace HarmonyLib { /// <summary>A collection of commonly used transpilers</summary> /// public static class Transpilers { /// <summary>A transpiler that replaces all occurrences of a given method with another one</summary> /// <param name="instructions">The enumeration of <see cref="CodeInstruction"/> to act on</param> /// <param name="from">Method or constructor to search for</param> /// <param name="to">Method or constructor to replace with</param> /// <returns>Modified enumeration of <see cref="CodeInstruction"/></returns> /// public static IEnumerable<CodeInstruction> MethodReplacer(this IEnumerable<CodeInstruction> instructions, MethodBase from, MethodBase to) { if (from is null) throw new ArgumentException("Unexpected null argument", nameof(from)); if (to is null) throw new ArgumentException("Unexpected null argument", nameof(to)); foreach (var instruction in instructions) { var method = instruction.operand as MethodBase; if (method == from) { instruction.opcode = to.IsConstructor ? OpCodes.Newobj : OpCodes.Call; instruction.operand = to; } yield return instruction; } } /// <summary>A transpiler that alters instructions that match a predicate by calling an action</summary> /// <param name="instructions">The enumeration of <see cref="CodeInstruction"/> to act on</param> /// <param name="predicate">A predicate selecting the instructions to change</param> /// <param name="action">An action to apply to matching instructions</param> /// <returns>Modified enumeration of <see cref="CodeInstruction"/></returns> /// public static IEnumerable<CodeInstruction> Manipulator(this IEnumerable<CodeInstruction> instructions, Func<CodeInstruction, bool> predicate, Action<CodeInstruction> action) { if (predicate is null) throw new ArgumentNullException(nameof(predicate)); if (action is null) throw new ArgumentNullException(nameof(action)); return instructions.Select(instruction => { if (predicate(instruction)) action(instruction); return instruction; }).AsEnumerable(); } /// <summary>A transpiler that logs a text at the beginning of the method</summary> /// <param name="instructions">The instructions to act on</param> /// <param name="text">The log text</param> /// <returns>Modified enumeration of <see cref="CodeInstruction"/></returns> /// public static IEnumerable<CodeInstruction> DebugLogger(this IEnumerable<CodeInstruction> instructions, string text) { yield return new CodeInstruction(OpCodes.Ldstr, text); yield return new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(FileLog), nameof(FileLog.Log))); foreach (var instruction in instructions) yield return instruction; } } }
mit
C#
f49ae738a91a01b17c543785dbf617ac6b9266ce
resolve Jason's comments
markradacz/monotouch-samples,hongnguyenpro/monotouch-samples,haithemaraissia/monotouch-samples,a9upam/monotouch-samples,iFreedive/monotouch-samples,andypaul/monotouch-samples,albertoms/monotouch-samples,sakthivelnagarajan/monotouch-samples,nelzomal/monotouch-samples,YOTOV-LIMITED/monotouch-samples,YOTOV-LIMITED/monotouch-samples,sakthivelnagarajan/monotouch-samples,sakthivelnagarajan/monotouch-samples,labdogg1003/monotouch-samples,nervevau2/monotouch-samples,xamarin/monotouch-samples,haithemaraissia/monotouch-samples,hongnguyenpro/monotouch-samples,haithemaraissia/monotouch-samples,xamarin/monotouch-samples,W3SS/monotouch-samples,markradacz/monotouch-samples,YOTOV-LIMITED/monotouch-samples,hongnguyenpro/monotouch-samples,nelzomal/monotouch-samples,a9upam/monotouch-samples,peteryule/monotouch-samples,hongnguyenpro/monotouch-samples,davidrynn/monotouch-samples,albertoms/monotouch-samples,YOTOV-LIMITED/monotouch-samples,davidrynn/monotouch-samples,kingyond/monotouch-samples,haithemaraissia/monotouch-samples,sakthivelnagarajan/monotouch-samples,nervevau2/monotouch-samples,labdogg1003/monotouch-samples,a9upam/monotouch-samples,andypaul/monotouch-samples,labdogg1003/monotouch-samples,robinlaide/monotouch-samples,nervevau2/monotouch-samples,albertoms/monotouch-samples,W3SS/monotouch-samples,peteryule/monotouch-samples,peteryule/monotouch-samples,robinlaide/monotouch-samples,nelzomal/monotouch-samples,xamarin/monotouch-samples,andypaul/monotouch-samples,W3SS/monotouch-samples,nervevau2/monotouch-samples,andypaul/monotouch-samples,labdogg1003/monotouch-samples,nelzomal/monotouch-samples,davidrynn/monotouch-samples,markradacz/monotouch-samples,robinlaide/monotouch-samples,davidrynn/monotouch-samples,peteryule/monotouch-samples,iFreedive/monotouch-samples,kingyond/monotouch-samples,a9upam/monotouch-samples,robinlaide/monotouch-samples,kingyond/monotouch-samples,iFreedive/monotouch-samples
Chat/Chat/Cells/BubbleCell.cs
Chat/Chat/Cells/BubbleCell.cs
using System; using UIKit; using CoreGraphics; namespace Chat { public abstract class BubbleCell : UITableViewCell { public UIImageView BubbleImageView { get; private set; } public UILabel MessageLabel { get; private set; } public UIImage BubbleImage { get; set; } public UIImage BubbleHighlightedImage { get; set; } Message msg; public Message Message { get { return msg; } set { msg = value; BubbleImageView.Image = BubbleImage; BubbleImageView.HighlightedImage = BubbleHighlightedImage; MessageLabel.Text = msg.Text; MessageLabel.UserInteractionEnabled = true; BubbleImageView.UserInteractionEnabled = false; } } public BubbleCell (IntPtr handle) : base (handle) { Initialize (); } public BubbleCell () { Initialize (); } void Initialize () { BubbleImageView = new UIImageView { TranslatesAutoresizingMaskIntoConstraints = false }; MessageLabel = new UILabel { TranslatesAutoresizingMaskIntoConstraints = false, Lines = 0, PreferredMaxLayoutWidth = 220f }; ContentView.AddSubviews (BubbleImageView, MessageLabel); } public override void SetSelected (bool selected, bool animated) { base.SetSelected (selected, animated); BubbleImageView.Highlighted = selected; } protected static UIImage CreateColoredImage (UIColor color, UIImage mask) { var rect = new CGRect (CGPoint.Empty, mask.Size); UIGraphics.BeginImageContextWithOptions (mask.Size, false, mask.CurrentScale); CGContext context = UIGraphics.GetCurrentContext (); mask.DrawAsPatternInRect (rect); context.SetFillColor (color.CGColor); context.SetBlendMode (CGBlendMode.SourceAtop); context.FillRect (rect); UIImage result = UIGraphics.GetImageFromCurrentImageContext (); UIGraphics.EndImageContext (); return result; } protected static UIImage CreateBubbleWithBorder (UIImage bubbleImg, UIColor bubbleColor) { bubbleImg = CreateColoredImage (bubbleColor, bubbleImg); CGSize size = bubbleImg.Size; UIGraphics.BeginImageContextWithOptions (size, false, 0); var rect = new CGRect (CGPoint.Empty, size); bubbleImg.Draw (rect); var result = UIGraphics.GetImageFromCurrentImageContext (); UIGraphics.EndImageContext (); return result; } } }
using System; using UIKit; using CoreGraphics; namespace Chat { public abstract class BubbleCell : UITableViewCell { public UIImageView BubbleImageView { get; private set; } public UILabel MessageLabel { get; private set; } public UIImage BubbleImage { get; set; } public UIImage BubbleHighlightedImage { get; set; } Message msg; public Message Message { get { return msg; } set { msg = value; BubbleImageView.Image = BubbleImage; BubbleImageView.HighlightedImage = BubbleHighlightedImage; MessageLabel.Text = msg.Text; MessageLabel.UserInteractionEnabled = true; BubbleImageView.UserInteractionEnabled = false; } } public BubbleCell (IntPtr handle) : base (handle) { Initialize (); } public BubbleCell () { Initialize (); } void Initialize () { BubbleImageView = new UIImageView { TranslatesAutoresizingMaskIntoConstraints = false }; MessageLabel = new UILabel { TranslatesAutoresizingMaskIntoConstraints = false, Lines = 0, PreferredMaxLayoutWidth = 220f }; ContentView.AddSubview (BubbleImageView); ContentView.AddSubview (MessageLabel); } public override void SetSelected (bool selected, bool animated) { base.SetSelected (selected, animated); BubbleImageView.Highlighted = selected; } protected static UIImage CreateColoredImage (UIColor color, UIImage mask) { var rect = new CGRect (CGPoint.Empty, mask.Size); UIGraphics.BeginImageContextWithOptions (mask.Size, false, mask.CurrentScale); CGContext context = UIGraphics.GetCurrentContext (); mask.DrawAsPatternInRect (rect); context.SetFillColor (color.CGColor); context.SetBlendMode (CGBlendMode.SourceAtop); context.FillRect (rect); UIImage result = UIGraphics.GetImageFromCurrentImageContext (); UIGraphics.EndImageContext (); return result; } protected static UIImage CreateBubbleWithBorder (UIImage bubbleImg, UIColor bubbleColor) { bubbleImg = CreateColoredImage (bubbleColor, bubbleImg); CGSize size = bubbleImg.Size; UIGraphics.BeginImageContextWithOptions (size, false, 0); var rect = new CGRect (CGPoint.Empty, size); bubbleImg.Draw (rect); var result = UIGraphics.GetImageFromCurrentImageContext (); UIGraphics.EndImageContext (); return result; } } }
mit
C#
e992335f8eb1f907b3bcae908b094509049f2916
Update Applications.cs
datanets/kask-kiosk,datanets/kask-kiosk
Models/Applications.cs
Models/Applications.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Empty.Models { public class Applications { public int Application_ID { get; set; } public string ApplicationStatus { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Empty.Models { public class Applications { public int PK { get; set; } public char applicationStatus { get; set; } } }
mit
C#
358bb5c310a0399e762a9821b2f8ab96f7ae7fd9
Add license disclaimer
windygu/CefSharp,NumbersInternational/CefSharp,ruisebastiao/CefSharp,Livit/CefSharp,wangzheng888520/CefSharp,windygu/CefSharp,VioletLife/CefSharp,VioletLife/CefSharp,Livit/CefSharp,zhangjingpu/CefSharp,joshvera/CefSharp,jamespearce2006/CefSharp,illfang/CefSharp,AJDev77/CefSharp,twxstar/CefSharp,dga711/CefSharp,ITGlobal/CefSharp,Octopus-ITSM/CefSharp,twxstar/CefSharp,windygu/CefSharp,wangzheng888520/CefSharp,haozhouxu/CefSharp,Haraguroicha/CefSharp,dga711/CefSharp,VioletLife/CefSharp,yoder/CefSharp,windygu/CefSharp,AJDev77/CefSharp,Haraguroicha/CefSharp,rover886/CefSharp,ITGlobal/CefSharp,jamespearce2006/CefSharp,Haraguroicha/CefSharp,Haraguroicha/CefSharp,rlmcneary2/CefSharp,zhangjingpu/CefSharp,haozhouxu/CefSharp,joshvera/CefSharp,jamespearce2006/CefSharp,ruisebastiao/CefSharp,rover886/CefSharp,wangzheng888520/CefSharp,rlmcneary2/CefSharp,ITGlobal/CefSharp,illfang/CefSharp,illfang/CefSharp,wangzheng888520/CefSharp,ruisebastiao/CefSharp,Livit/CefSharp,haozhouxu/CefSharp,Octopus-ITSM/CefSharp,yoder/CefSharp,Octopus-ITSM/CefSharp,haozhouxu/CefSharp,Livit/CefSharp,battewr/CefSharp,rover886/CefSharp,gregmartinhtc/CefSharp,illfang/CefSharp,battewr/CefSharp,VioletLife/CefSharp,AJDev77/CefSharp,dga711/CefSharp,rlmcneary2/CefSharp,ruisebastiao/CefSharp,gregmartinhtc/CefSharp,yoder/CefSharp,twxstar/CefSharp,gregmartinhtc/CefSharp,NumbersInternational/CefSharp,battewr/CefSharp,dga711/CefSharp,twxstar/CefSharp,Octopus-ITSM/CefSharp,yoder/CefSharp,zhangjingpu/CefSharp,jamespearce2006/CefSharp,zhangjingpu/CefSharp,ITGlobal/CefSharp,rover886/CefSharp,joshvera/CefSharp,joshvera/CefSharp,jamespearce2006/CefSharp,NumbersInternational/CefSharp,NumbersInternational/CefSharp,battewr/CefSharp,rlmcneary2/CefSharp,Haraguroicha/CefSharp,AJDev77/CefSharp,gregmartinhtc/CefSharp,rover886/CefSharp
CefSharp/TransitionType.cs
CefSharp/TransitionType.cs
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; namespace CefSharp { [Flags] public enum TransitionType : uint { /// <summary> /// Source is a link click or the JavaScript window.open function. This is /// also the default value for requests like sub-resource loads that are not navigations. /// </summary> LinkClicked = 0, /// <summary> /// Source is some other "explicit" navigation action such as creating a new /// browser or using the LoadURL function. This is also the default value /// for navigations where the actual type is unknown. /// </summary> Explicit = 1, /// <summary> /// Source is a subframe navigation. This is any content that is automatically /// loaded in a non-toplevel frame. For example, if a page consists of several /// frames containing ads, those ad URLs will have this transition type. /// The user may not even realize the content in these pages is a separate /// frame, so may not care about the URL. /// </summary> AutoSubFrame = 3, /// <summary> /// Source is a subframe navigation explicitly requested by the user that will /// generate new navigation entries in the back/forward list. These are /// probably more important than frames that were automatically loaded in /// the background because the user probably cares about the fact that this /// link was loaded. /// </summary> ManualSubFrame = 4, /// <summary> /// Source is a form submission by the user. NOTE: In some situations /// submitting a form does not result in this transition type. This can happen /// if the form uses a script to submit the contents. /// </summary> FormSubmit = 7, /// <summary> /// Source is a "reload" of the page via the Reload function or by re-visiting /// the same URL. NOTE: This is distinct from the concept of whether a /// particular load uses "reload semantics" (i.e. bypasses cached data). /// </summary> Reload = 8, /// <summary> /// General mask defining the bits used for the source values. /// </summary> SourceMask = 0xFF, /// <summary> /// Attempted to visit a URL but was blocked. /// </summary> Blocked = 0x00800000, /// <summary> /// Used the Forward or Back function to navigate among browsing history. /// </summary> ForwardBack = 0x01000000, /// <summary> /// The beginning of a navigation chain. /// </summary> ChainStart = 0x10000000, /// <summary> /// The last transition in a redirect chain. /// </summary> ChainEnd = 0x20000000, /// <summary> /// Redirects caused by JavaScript or a meta refresh tag on the page. /// </summary> CliendRedirect = 0x40000000, /// <summary> /// Redirects sent from the server by HTTP headers. /// </summary> ServerRedirect = 0x80000000, /// <summary> /// Used to test whether a transition involves a redirect. /// </summary> IsRedirect = 0xC0000000, /// <summary> /// General mask defining the bits used for the qualifiers. /// </summary> QualifierMask = 0xFFFFFF00 }; }
using System; namespace CefSharp { [Flags] public enum TransitionType : uint { /// <summary> /// Source is a link click or the JavaScript window.open function. This is /// also the default value for requests like sub-resource loads that are not navigations. /// </summary> LinkClicked = 0, /// <summary> /// Source is some other "explicit" navigation action such as creating a new /// browser or using the LoadURL function. This is also the default value /// for navigations where the actual type is unknown. /// </summary> Explicit = 1, /// <summary> /// Source is a subframe navigation. This is any content that is automatically /// loaded in a non-toplevel frame. For example, if a page consists of several /// frames containing ads, those ad URLs will have this transition type. /// The user may not even realize the content in these pages is a separate /// frame, so may not care about the URL. /// </summary> AutoSubFrame = 3, /// <summary> /// Source is a subframe navigation explicitly requested by the user that will /// generate new navigation entries in the back/forward list. These are /// probably more important than frames that were automatically loaded in /// the background because the user probably cares about the fact that this /// link was loaded. /// </summary> ManualSubFrame = 4, /// <summary> /// Source is a form submission by the user. NOTE: In some situations /// submitting a form does not result in this transition type. This can happen /// if the form uses a script to submit the contents. /// </summary> FormSubmit = 7, /// <summary> /// Source is a "reload" of the page via the Reload function or by re-visiting /// the same URL. NOTE: This is distinct from the concept of whether a /// particular load uses "reload semantics" (i.e. bypasses cached data). /// </summary> Reload = 8, /// <summary> /// General mask defining the bits used for the source values. /// </summary> SourceMask = 0xFF, /// <summary> /// Attempted to visit a URL but was blocked. /// </summary> Blocked = 0x00800000, /// <summary> /// Used the Forward or Back function to navigate among browsing history. /// </summary> ForwardBack = 0x01000000, /// <summary> /// The beginning of a navigation chain. /// </summary> ChainStart = 0x10000000, /// <summary> /// The last transition in a redirect chain. /// </summary> ChainEnd = 0x20000000, /// <summary> /// Redirects caused by JavaScript or a meta refresh tag on the page. /// </summary> CliendRedirect = 0x40000000, /// <summary> /// Redirects sent from the server by HTTP headers. /// </summary> ServerRedirect = 0x80000000, /// <summary> /// Used to test whether a transition involves a redirect. /// </summary> IsRedirect = 0xC0000000, /// <summary> /// General mask defining the bits used for the qualifiers. /// </summary> QualifierMask = 0xFFFFFF00 }; }
bsd-3-clause
C#
f81ebe7ffdb682a5938a0d654487d28eeaac11f7
Simplify datetime validation to compare Date value only.
mconnew/wcf,mconnew/wcf,dotnet/wcf,imcarolwang/wcf,mconnew/wcf,StephenBonikowsky/wcf,imcarolwang/wcf,imcarolwang/wcf,dotnet/wcf,StephenBonikowsky/wcf,dotnet/wcf
src/System.ServiceModel.Security/tests/IdentityModel/GenericXmlSecurityTokenTest.cs
src/System.ServiceModel.Security/tests/IdentityModel/GenericXmlSecurityTokenTest.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.Collections.ObjectModel; using System.IdentityModel.Tokens; using System.Xml; using Infrastructure.Common; using Xunit; public static class GenericXmlSecurityTokenTest { [WcfFact] public static void Ctor_Default_Properties() { XmlDocument doc = new XmlDocument(); XmlElement tokenXml = doc.CreateElement("ElementName"); XmlAttribute attr = doc.CreateAttribute("Id", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"); string attrValue = "Value for Attribute Name Id"; attr.Value = attrValue; tokenXml.Attributes.Append(attr); UserNameSecurityToken proofToken = new UserNameSecurityToken("user", "password"); GenericXmlSecurityToken gxst = new GenericXmlSecurityToken(tokenXml, proofToken, DateTime.UtcNow, DateTime.MaxValue, null, null, null); Assert.NotNull(gxst); Assert.NotNull(gxst.Id); Assert.Equal(attrValue, gxst.Id); Assert.Equal(DateTime.UtcNow.Date, gxst.ValidFrom.Date); Assert.Equal(DateTime.MaxValue.Date, gxst.ValidTo.Date); Assert.NotNull(gxst.SecurityKeys); Assert.Equal(proofToken.SecurityKeys, gxst.SecurityKeys); //ProofToken is null GenericXmlSecurityToken gxst2 = new GenericXmlSecurityToken(tokenXml, null, DateTime.MinValue, DateTime.MaxValue, null, null, null); Assert.NotNull(gxst2.SecurityKeys); Assert.Equal(new ReadOnlyCollection<SecurityKey>(new List<SecurityKey>()), gxst2.SecurityKeys); //TokenXml is null Assert.Throws<System.ArgumentNullException>(() => new GenericXmlSecurityToken(null, null, DateTime.MinValue, DateTime.MaxValue, null, null, null)); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IdentityModel.Tokens; using System.Xml; using Infrastructure.Common; using Xunit; public static class GenericXmlSecurityTokenTest { [WcfFact] public static void Ctor_Default_Properties() { XmlDocument doc = new XmlDocument(); XmlElement tokenXml = doc.CreateElement("ElementName"); XmlAttribute attr = doc.CreateAttribute("Id", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"); string attrValue = "Value for Attribute Name Id"; attr.Value = attrValue; tokenXml.Attributes.Append(attr); UserNameSecurityToken proofToken = new UserNameSecurityToken("user", "password"); GenericXmlSecurityToken gxst = new GenericXmlSecurityToken(tokenXml, proofToken, DateTime.MinValue, DateTime.MaxValue, null, null, null); Assert.NotNull(gxst); Assert.NotNull(gxst.Id); Assert.Equal(attrValue, gxst.Id); Assert.Equal(DateTime.MinValue, gxst.ValidFrom); Assert.Equal(DateTime.MaxValue.Date, gxst.ValidTo.Date); Assert.NotNull(gxst.SecurityKeys); Assert.Equal(proofToken.SecurityKeys, gxst.SecurityKeys); //ProofToken is null GenericXmlSecurityToken gxst2 = new GenericXmlSecurityToken(tokenXml, null, DateTime.MinValue, DateTime.MaxValue, null, null, null); Assert.NotNull(gxst2.SecurityKeys); Assert.Equal(new ReadOnlyCollection<SecurityKey>(new List<SecurityKey>()), gxst2.SecurityKeys); //TokenXml is null Assert.Throws<System.ArgumentNullException>(() => new GenericXmlSecurityToken(null, null, DateTime.MinValue, DateTime.MaxValue, null, null, null)); } }
mit
C#
d9609c6c9e9eb7f72c1c949dfb6cc498d542beae
Add validation rule
ahanusa/facile.net,peasy/Samples,peasy/Samples,peasy/Peasy.NET,peasy/Samples,ahanusa/Peasy.NET
Orders.com.BLL/IntentoryItemService.cs
Orders.com.BLL/IntentoryItemService.cs
using System; using Orders.com.Core.DataProxy; using Orders.com.Core.Domain; using Facile.Core; using Facile.Extensions; using System.Collections.Generic; using Facile.Core.Extensions; namespace Orders.com.BLL { public class InventoryItemService : OrdersDotComServiceBase<InventoryItem> { public InventoryItemService(IInventoryItemDataProxy dataProxy) : base(dataProxy) { } /// <summary> /// Not supported. All updates to inventory must be made via Increment and Decrement commands /// </summary> /// <param name="entity"></param> /// <returns></returns> public override ICommand<InventoryItem> UpdateCommand(InventoryItem entity) { throw new NotImplementedException(); } public ICommand<InventoryItem> DecrementQuantityOnHandCommand(long productID, decimal quantity) { var proxy = DataProxy as IInventoryItemDataProxy; return new ServiceCommand<InventoryItem> ( executeMethod: () => proxy.DecrementQuantityOnHand(productID, quantity), executeAsyncMethod: () => proxy.DecrementQuantityOnHandAsync(productID, quantity), getValidationRulesMethod: () => new[] { quantity.CreateValueRequiredRule("quantity") }.GetBusinessRulesResults(this.GetType().Name) ); } public ICommand<InventoryItem> IncrementQuantityOnHandCommand(long productID, decimal quantity) { var proxy = DataProxy as IInventoryItemDataProxy; return new ServiceCommand<InventoryItem> ( executeMethod: () => proxy.IncrementQuantityOnHand(productID, quantity), executeAsyncMethod: () => proxy.IncrementQuantityOnHandAsync(productID, quantity) ); } public ICommand<InventoryItem> GetByProductCommand(long productID) { var proxy = DataProxy as IInventoryItemDataProxy; return new ServiceCommand<InventoryItem> ( executeMethod: () => proxy.GetByProduct(productID), executeAsyncMethod: () => proxy.GetByProductAsync(productID) ); } } }
using System; using Orders.com.Core.DataProxy; using Orders.com.Core.Domain; using Facile.Core; using System.Collections.Generic; namespace Orders.com.BLL { public class InventoryItemService : OrdersDotComServiceBase<InventoryItem> { public InventoryItemService(IInventoryItemDataProxy dataProxy) : base(dataProxy) { } /// <summary> /// Not supported. All updates to inventory must be made via Increment and Decrement commands /// </summary> /// <param name="entity"></param> /// <returns></returns> public override ICommand<InventoryItem> UpdateCommand(InventoryItem entity) { throw new NotImplementedException(); } public ICommand<InventoryItem> DecrementQuantityOnHandCommand(long productID, decimal quantity) { var proxy = DataProxy as IInventoryItemDataProxy; return new ServiceCommand<InventoryItem> ( executeMethod: () => proxy.DecrementQuantityOnHand(productID, quantity), executeAsyncMethod: () => proxy.DecrementQuantityOnHandAsync(productID, quantity) ); } public ICommand<InventoryItem> IncrementQuantityOnHandCommand(long productID, decimal quantity) { var proxy = DataProxy as IInventoryItemDataProxy; return new ServiceCommand<InventoryItem> ( executeMethod: () => proxy.IncrementQuantityOnHand(productID, quantity), executeAsyncMethod: () => proxy.IncrementQuantityOnHandAsync(productID, quantity) ); } public ICommand<InventoryItem> GetByProductCommand(long productID) { var proxy = DataProxy as IInventoryItemDataProxy; return new ServiceCommand<InventoryItem> ( executeMethod: () => proxy.GetByProduct(productID), executeAsyncMethod: () => proxy.GetByProductAsync(productID) ); } } }
mit
C#
2f436342edead059eb1561a928efda37e876b926
Update Version
AyrA/fcfh
fcfh/Properties/AssemblyInfo.cs
fcfh/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("fcfh")] [assembly: AssemblyDescription("Encodes and Decodes files into/from Images")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("/u/AyrA_ch")] [assembly: AssemblyProduct("fcfh")] [assembly: AssemblyCopyright("Copyright © /u/AyrA_ch 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)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("2c4b3a52-13f0-4183-a0b9-ad51c8ba22c3")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.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("fcfh")] [assembly: AssemblyDescription("Encodes and Decodes files into/from Images")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("/u/AyrA_ch")] [assembly: AssemblyProduct("fcfh")] [assembly: AssemblyCopyright("Copyright © /u/AyrA_ch 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)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("2c4b3a52-13f0-4183-a0b9-ad51c8ba22c3")] // 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")]
mit
C#
db5e6d06fe41901f884497de9d6135404adc1e09
change text on button
IdentityModel/AuthorizationServer,IdentityModel/AuthorizationServer,s093294/Thinktecture.AuthorizationServer,yfann/AuthorizationServer,yfann/AuthorizationServer,s093294/Thinktecture.AuthorizationServer
source/WebHost/Areas/Admin/Views/Application/Scope.cshtml
source/WebHost/Areas/Admin/Views/Application/Scope.cshtml
@{ ViewBag.Title = "Scope"; } <h2><span data-bind="text: editDescription"></span> Scope</h2> <ul class="nav nav-pills hide" data-bind="css: { hide: !menusEnabled() }"> <li> <a data-href="@Url.Action("ScopeClients")" data-bind="attr: { href: $element.dataset.href + '#' + $data.id() }">Clients</a> </li> </ul> <fieldset> <legend></legend> <div> <label for="name">Name</label> <input id="name" data-bind="value: name, valueUpdate: 'keyup'" /> <label class="text-error" data-bind="text: nameError"></label> </div> <div> <label for="description">Description</label> <input id="description" data-bind="value: description, valueUpdate: 'keyup'" /> <label class="text-error" data-bind="text: descriptionError"></label> </div> <div> <label for="emphasize" class="checkbox"> <input id="emphasize" data-bind="checked: emphasize" type="checkbox" /> Emphasize </label> </div> <div><button class="btn btn-primary" data-bind="click:save, disable: anyErrors">Save</button></div> </fieldset> @section scripts { <script src="~/Areas/Admin/Scripts/Scope.js"></script> }
@{ ViewBag.Title = "Scope"; } <h2><span data-bind="text: editDescription"></span> Scope</h2> <ul class="nav nav-pills hide" data-bind="css: { hide: !menusEnabled() }"> <li> <a data-href="@Url.Action("ScopeClients")" data-bind="attr: { href: $element.dataset.href + '#' + $data.id() }">Clients</a> </li> </ul> <fieldset> <legend></legend> <div> <label for="name">Name</label> <input id="name" data-bind="value: name, valueUpdate: 'keyup'" /> <label class="text-error" data-bind="text: nameError"></label> </div> <div> <label for="description">Description</label> <input id="description" data-bind="value: description, valueUpdate: 'keyup'" /> <label class="text-error" data-bind="text: descriptionError"></label> </div> <div> <label for="emphasize" class="checkbox"> <input id="emphasize" data-bind="checked: emphasize" type="checkbox" /> Emphasize </label> </div> <div><button class="btn btn-primary" data-bind="click:save, disable: anyErrors">Add</button></div> </fieldset> @section scripts { <script src="~/Areas/Admin/Scripts/Scope.js"></script> }
bsd-3-clause
C#
41b6a9ed6a4ee0df7f3eddca404d1f170430d73b
Remove excess IPageObject<TOwner> generic type constraint from ScrollBehaviorAttribute.Execute method
atata-framework/atata,atata-framework/atata,YevgeniyShunevych/Atata,YevgeniyShunevych/Atata
src/Atata/Attributes/Behaviors/ScrollBehaviorAttribute.cs
src/Atata/Attributes/Behaviors/ScrollBehaviorAttribute.cs
namespace Atata { /// <summary> /// Represents the base behavior class for scrolling to control. /// </summary> public abstract class ScrollBehaviorAttribute : MulticastAttribute { public abstract void Execute<TOwner>(IControl<TOwner> control) where TOwner : PageObject<TOwner>; } }
namespace Atata { /// <summary> /// Represents the base behavior class for scrolling to control. /// </summary> public abstract class ScrollBehaviorAttribute : MulticastAttribute { public abstract void Execute<TOwner>(IControl<TOwner> control) where TOwner : PageObject<TOwner>, IPageObject<TOwner>; } }
apache-2.0
C#
3f5519e18b10cbbde7ab55877317c9505535c56c
Fix MAL result invalid Url property
bcanseco/common-bot-library,bcanseco/common-bot-library
src/CommonBotLibrary/Services/Models/MyAnimeListResult.cs
src/CommonBotLibrary/Services/Models/MyAnimeListResult.cs
using System; using System.Net; using System.Text.RegularExpressions; using System.Xml.Linq; using CommonBotLibrary.Interfaces.Models; namespace CommonBotLibrary.Services.Models { public class MyAnimeListResult : AnimeBase, IWebpage, IEquatable<MyAnimeListResult> { public MyAnimeListResult(XContainer xml) { Id = (int)xml.Element("id"); Title = (string)xml.Element("title"); English = (string)xml.Element("english"); Synonyms = (string)xml.Element("synonyms"); Episodes = (int)xml.Element("episodes"); Score = (double)xml.Element("score"); Type = (string)xml.Element("type"); Status = (string)xml.Element("status"); StartDate = (string)xml.Element("start_date"); EndDate = (string)xml.Element("end_date"); Image = (string)xml.Element("image"); // Remove BBcode and other extraneous characters Synopsis = WebUtility.HtmlDecode(Regex .Replace((string)xml.Element("synopsis"), @"\[.*?\]|<.*?>", "")); } /// <summary> /// Unique MyAnimeList anime identifier. /// </summary> public int Id { get; } public string Url => $"https://myanimelist.net/anime/{Id}"; #region IEquatable members public bool Equals(MyAnimeListResult other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Id == other.Id; } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; var other = obj as MyAnimeListResult; return other != null && Equals(other); } public override int GetHashCode() => Id; public static bool operator ==(MyAnimeListResult left, MyAnimeListResult right) => Equals(left, right); public static bool operator !=(MyAnimeListResult left, MyAnimeListResult right) => !Equals(left, right); #endregion } }
using System; using System.Net; using System.Text.RegularExpressions; using System.Xml.Linq; using CommonBotLibrary.Interfaces.Models; namespace CommonBotLibrary.Services.Models { public class MyAnimeListResult : AnimeBase, IWebpage, IEquatable<MyAnimeListResult> { public MyAnimeListResult(XContainer xml) { Id = (int)xml.Element("id"); Title = (string)xml.Element("title"); English = (string)xml.Element("english"); Synonyms = (string)xml.Element("synonyms"); Episodes = (int)xml.Element("episodes"); Score = (double)xml.Element("score"); Type = (string)xml.Element("type"); Status = (string)xml.Element("status"); StartDate = (string)xml.Element("start_date"); EndDate = (string)xml.Element("end_date"); Image = (string)xml.Element("image"); // Remove BBcode and other extraneous characters Synopsis = WebUtility.HtmlDecode(Regex .Replace((string)xml.Element("synopsis"), @"\[.*?\]|<.*?>", "")); } /// <summary> /// Unique MyAnimeList anime identifier. /// </summary> public int Id { get; } public string Url => "$https://myanimelist.net/anime/{Id}"; #region IEquatable members public bool Equals(MyAnimeListResult other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Id == other.Id; } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; var other = obj as MyAnimeListResult; return other != null && Equals(other); } public override int GetHashCode() => Id; public static bool operator ==(MyAnimeListResult left, MyAnimeListResult right) => Equals(left, right); public static bool operator !=(MyAnimeListResult left, MyAnimeListResult right) => !Equals(left, right); #endregion } }
mit
C#
eb437e7a8857b9d7b7e8cf8875eed715c30cf34c
Fix the wrong conditional statement.
pratikkagda/nuget,mrward/NuGet.V2,zskullz/nuget,chocolatey/nuget-chocolatey,alluran/node.net,dolkensp/node.net,atheken/nuget,mrward/NuGet.V2,dolkensp/node.net,zskullz/nuget,indsoft/NuGet2,oliver-feng/nuget,rikoe/nuget,akrisiun/NuGet,antiufo/NuGet2,chocolatey/nuget-chocolatey,dolkensp/node.net,mrward/NuGet.V2,OneGet/nuget,pratikkagda/nuget,mono/nuget,oliver-feng/nuget,chocolatey/nuget-chocolatey,pratikkagda/nuget,rikoe/nuget,ctaggart/nuget,rikoe/nuget,indsoft/NuGet2,jholovacs/NuGet,antiufo/NuGet2,themotleyfool/NuGet,oliver-feng/nuget,GearedToWar/NuGet2,jmezach/NuGet2,indsoft/NuGet2,antiufo/NuGet2,xoofx/NuGet,mono/nuget,akrisiun/NuGet,jmezach/NuGet2,alluran/node.net,mrward/nuget,xero-github/Nuget,mrward/NuGet.V2,RichiCoder1/nuget-chocolatey,jholovacs/NuGet,OneGet/nuget,mrward/nuget,xoofx/NuGet,OneGet/nuget,antiufo/NuGet2,jholovacs/NuGet,mono/nuget,zskullz/nuget,zskullz/nuget,chocolatey/nuget-chocolatey,xoofx/NuGet,mrward/nuget,antiufo/NuGet2,oliver-feng/nuget,kumavis/NuGet,rikoe/nuget,GearedToWar/NuGet2,jmezach/NuGet2,mrward/NuGet.V2,kumavis/NuGet,oliver-feng/nuget,chester89/nugetApi,pratikkagda/nuget,RichiCoder1/nuget-chocolatey,chocolatey/nuget-chocolatey,chocolatey/nuget-chocolatey,mrward/nuget,anurse/NuGet,mrward/NuGet.V2,RichiCoder1/nuget-chocolatey,jmezach/NuGet2,xoofx/NuGet,dolkensp/node.net,mrward/nuget,pratikkagda/nuget,xoofx/NuGet,alluran/node.net,indsoft/NuGet2,indsoft/NuGet2,jholovacs/NuGet,jmezach/NuGet2,themotleyfool/NuGet,themotleyfool/NuGet,indsoft/NuGet2,jholovacs/NuGet,ctaggart/nuget,chester89/nugetApi,ctaggart/nuget,xoofx/NuGet,jholovacs/NuGet,antiufo/NuGet2,alluran/node.net,RichiCoder1/nuget-chocolatey,anurse/NuGet,atheken/nuget,oliver-feng/nuget,GearedToWar/NuGet2,ctaggart/nuget,GearedToWar/NuGet2,jmezach/NuGet2,OneGet/nuget,mrward/nuget,RichiCoder1/nuget-chocolatey,RichiCoder1/nuget-chocolatey,GearedToWar/NuGet2,mono/nuget,GearedToWar/NuGet2,pratikkagda/nuget
src/Dialog/PackageManagerUI/SmartOutputConsoleProvider.cs
src/Dialog/PackageManagerUI/SmartOutputConsoleProvider.cs
using NuGet.OutputWindowConsole; using NuGetConsole; namespace NuGet.Dialog.PackageManagerUI { internal class SmartOutputConsoleProvider : IOutputConsoleProvider { private readonly IOutputConsoleProvider _baseProvider; private bool _isFirstTime = true; public SmartOutputConsoleProvider(IOutputConsoleProvider baseProvider) { _baseProvider = baseProvider; } public IConsole CreateOutputConsole(bool requirePowerShellHost) { IConsole console = _baseProvider.CreateOutputConsole(requirePowerShellHost); if (_isFirstTime) { // the first time the console is accessed after dialog is opened, we clear the console. console.Clear(); _isFirstTime = false; } return console; } } }
using NuGet.OutputWindowConsole; using NuGetConsole; namespace NuGet.Dialog.PackageManagerUI { internal class SmartOutputConsoleProvider : IOutputConsoleProvider { private readonly IOutputConsoleProvider _baseProvider; private bool _isFirstTime = true; public SmartOutputConsoleProvider(IOutputConsoleProvider baseProvider) { _baseProvider = baseProvider; } public IConsole CreateOutputConsole(bool requirePowerShellHost) { IConsole console = _baseProvider.CreateOutputConsole(requirePowerShellHost); if (_isFirstTime) { // the first time the console is accessed after dialog is opened, we clear the console. console.Clear(); } else { _isFirstTime = false; } return console; } } }
apache-2.0
C#
9584881fc265c092c79c91660bbea9ec958ad8dd
Update PersonalDataAttribute.cs (#36067)
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
src/Identity/Extensions.Core/src/PersonalDataAttribute.cs
src/Identity/Extensions.Core/src/PersonalDataAttribute.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; namespace Microsoft.AspNetCore.Identity { /// <summary> /// Used to indicate that a something is considered personal data. /// </summary> [AttributeUsage(AttributeTargets.Property)] public class PersonalDataAttribute : Attribute { } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; namespace Microsoft.AspNetCore.Identity { /// <summary> /// Used to indicate that a something is considered personal data. /// </summary> [AttributeUsage(AttributeTargets.All)] public class PersonalDataAttribute : Attribute { } }
apache-2.0
C#
e785d499b29dcfdb568a2222b2bbefc0d91c9c1e
Change parameter names in FluentAstBuilder
akatakritos/SassSharp
SassSharp/Ast/FluentAstBuilder.cs
SassSharp/Ast/FluentAstBuilder.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SassSharp.Ast { public class FluentAstBuilder { private IList<Node> nodes; public FluentAstBuilder() { nodes = new List<Node>(); } public FluentAstBuilder Node(string selector, Action<FluentNodeBuilder> setup) { nodes.Add(FluentNodeBuilder.CreateNode(selector, setup)); return this; } public SassSyntaxTree Build() { return new SassSyntaxTree(nodes); } public class FluentNodeBuilder { private IList<Declaration> declarations; private IList<Node> children; public FluentNodeBuilder(IList<Declaration> declarations, IList<Node> children) { this.declarations = declarations; this.children = children; } public void Declaration(string property, string value) { declarations.Add(new Declaration(property, value)); } public void Child(string selector, Action<FluentNodeBuilder> setup) { children.Add(FluentNodeBuilder.CreateNode(selector, setup)); } public static Node CreateNode(string selector, Action<FluentNodeBuilder> setup) { var declarations = new List<Declaration>(); var children = new List<Node>(); var builder = new FluentNodeBuilder(declarations, children); setup(builder); return Ast.Node.Create(selector, DeclarationSet.FromList(declarations), children); } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SassSharp.Ast { public class FluentAstBuilder { private IList<Node> nodes; public FluentAstBuilder() { nodes = new List<Node>(); } public FluentAstBuilder Node(string selector, Action<FluentNodeBuilder> nodeBuilder) { nodes.Add(FluentNodeBuilder.CreateNode(selector, nodeBuilder)); return this; } public SassSyntaxTree Build() { return new SassSyntaxTree(nodes); } public class FluentNodeBuilder { private IList<Declaration> declarations; private IList<Node> children; public FluentNodeBuilder(IList<Declaration> declarations, IList<Node> children) { this.declarations = declarations; this.children = children; } public void Declaration(string property, string value) { declarations.Add(new Declaration(property, value)); } public void Child(string selector, Action<FluentNodeBuilder> nodeBuilder) { children.Add(FluentNodeBuilder.CreateNode(selector, nodeBuilder)); } public static Node CreateNode(string selector, Action<FluentNodeBuilder> nodeBuilder) { var declarations = new List<Declaration>(); var children = new List<Node>(); var builder = new FluentNodeBuilder(declarations, children); nodeBuilder(builder); return Ast.Node.Create(selector, DeclarationSet.FromList(declarations), children); } } } }
mit
C#
b5c7bdc8ad9c33413f4db93998ec60b1642ed70f
Update CIDSizeInfo.cs
EricZimmerman/RegistryPlugins
RegistryPlugin.CIDSizeMRU/CIDSizeInfo.cs
RegistryPlugin.CIDSizeMRU/CIDSizeInfo.cs
using System; using RegistryPluginBase.Interfaces; namespace RegistryPlugin.CIDSizeMRU { public class CIDSizeInfo:IValueOut { public CIDSizeInfo(string exeName, int mruPos, DateTimeOffset? openedOn) { Executable = exeName; MRUPosition = mruPos; OpenedOn = openedOn?.UtcDateTime; } public string Executable { get; } public int MRUPosition { get; } public DateTime? OpenedOn { get; } public string BatchKeyPath { get; set; } public string BatchValueName { get; set; } public string BatchValueData1 => $"{Executable}"; public string BatchValueData2=> $"Opened: {OpenedOn?.ToUniversalTime():yyyy-MM-dd HH:mm:ss.fffffff}"; public string BatchValueData3 => $"Mru: {MRUPosition}"; } }
using System; using RegistryPluginBase.Interfaces; namespace RegistryPlugin.CIDSizeMRU { public class CIDSizeInfo:IValueOut { public CIDSizeInfo(string exeName, int mruPos, DateTimeOffset? openedOn) { Executable = exeName; MRUPosition = mruPos; OpenedOn = openedOn?.UtcDateTime; } public string Executable { get; } public int MRUPosition { get; } public DateTime? OpenedOn { get; } public string BatchKeyPath { get; set; } public string BatchValueName { get; set; } public string BatchValueData1 => $"{Executable}"; public string BatchValueData2=> $"Opened: {OpenedOn?.ToUniversalTime():yyyy-MM-dd HH:mm:ss.fffffff})"; public string BatchValueData3 => $"Mru: {MRUPosition}"; } }
mit
C#
9850579b0df397e0582f112d56fe194b3e3ba64c
add infrastructure/servers
lvermeulen/BuildMaster.Net
src/BuildMaster.Net/Infrastructure/BuildMasterClient.cs
src/BuildMaster.Net/Infrastructure/BuildMasterClient.cs
using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; using BuildMaster.Net.Infrastructure.Models; using Flurl.Http; // ReSharper disable CheckNamespace namespace BuildMaster.Net { public partial class BuildMasterClient { private IFlurlClient GetInfrastructureApiClient(string path, object queryParamValues = null) => GetApiClient("/api/infrastructure") .AppendPathSegment(path) .SetQueryParams(queryParamValues) .AllowAnyHttpStatus(); public async Task<IEnumerable<Server>> ListServersAsync() { var response = await GetInfrastructureApiClient("servers/list") .PostAsync(new StringContent("")) .ReceiveJson<IEnumerable<Server>>(); return response; //TODO: inline } public async Task<Server> CreateServerAsync(Server server) { var response = await GetInfrastructureApiClient($"servers/create/{server?.Name}") .PostJsonAsync(server) .ReceiveJson<Server>(); return response; //TODO: inline } public async Task<Server> UpdateServerAsync(Server server) { var response = await GetInfrastructureApiClient($"servers/update/{server?.Name}") .PostJsonAsync(server) .ReceiveJson<Server>(); return response; //TODO: inline } public async Task<Server> DeleteServerAsync(Server server) { var response = await GetInfrastructureApiClient($"servers/delete/{server?.Name}") .PostJsonAsync(server) .ReceiveJson<Server>(); return response; //TODO: inline } } }
using Flurl.Http; // ReSharper disable CheckNamespace namespace BuildMaster.Net { public partial class BuildMasterClient { private IFlurlClient GetInfrastructureApiClient(string path, object queryParamValues = null) => GetApiClient("/api/infrastructure") .AppendPathSegment(path) .SetQueryParams(queryParamValues) .AllowAnyHttpStatus(); } }
mit
C#
5d1c216846782b888eeeaaabce985ab325b8b8ca
use tls1.2 for WebProxyRequests
0x53A/Paket,0x53A/Paket,theimowski/Paket,thinkbeforecoding/Paket,mrinaldi/Paket,inosik/Paket,cloudRoutine/Paket,sergey-tihon/Paket,jam40jeff/Paket,thinkbeforecoding/Paket,vbfox/Paket,baronfel/Paket,mrinaldi/Paket,0x53A/Paket,cloudRoutine/Paket,isaacabraham/Paket,thinkbeforecoding/Paket,mrinaldi/Paket,thinkbeforecoding/Paket,jam40jeff/Paket,vbfox/Paket,cloudRoutine/Paket,0x53A/Paket,NatElkins/Paket,NatElkins/Paket,fsprojects/Paket,vbfox/Paket,inosik/Paket,theimowski/Paket,sergey-tihon/Paket,vbfox/Paket,isaacabraham/Paket,cloudRoutine/Paket,NatElkins/Paket,mrinaldi/Paket,NatElkins/Paket,isaacabraham/Paket,fsprojects/Paket,baronfel/Paket,isaacabraham/Paket
src/Paket.Bootstrapper/HelperProxies/WebRequestProxy.cs
src/Paket.Bootstrapper/HelperProxies/WebRequestProxy.cs
using System.IO; using System.Net; namespace Paket.Bootstrapper.HelperProxies { public class WebRequestProxy : IWebRequestProxy { public WebRequestProxy() { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; Client = new WebClient(); } private WebClient Client { get; set; } public string DownloadString(string address) { BootstrapperHelper.PrepareWebClient(Client, address); return Client.DownloadString(address); } public Stream GetResponseStream(string url) { var request = BootstrapperHelper.PrepareWebRequest(url); using (var httpResponse = (HttpWebResponse)request.GetResponse()) { return httpResponse.GetResponseStream(); } } public void DownloadFile(string url, string targetLocation) { BootstrapperHelper.PrepareWebClient(Client, url); Client.DownloadFile(url, targetLocation); } } }
using System.IO; using System.Net; namespace Paket.Bootstrapper.HelperProxies { public class WebRequestProxy : IWebRequestProxy { public WebRequestProxy() { Client = new WebClient(); } private WebClient Client { get; set; } public string DownloadString(string address) { BootstrapperHelper.PrepareWebClient(Client, address); return Client.DownloadString(address); } public Stream GetResponseStream(string url) { var request = BootstrapperHelper.PrepareWebRequest(url); using (var httpResponse = (HttpWebResponse)request.GetResponse()) { return httpResponse.GetResponseStream(); } } public void DownloadFile(string url, string targetLocation) { BootstrapperHelper.PrepareWebClient(Client, url); Client.DownloadFile(url, targetLocation); } } }
mit
C#
278afa3380fed4bb1596fcca7006f6032c569629
delete a broken MC input in intel-syntax-encoding.s.cs
bigendiansmalls/capstone,sigma-random/capstone,fvrmatteo/capstone,code4bones/capstone,krytarowski/capstone,zneak/capstone,xia0pin9/capstone,zneak/capstone,pombredanne/capstone,krytarowski/capstone,bSr43/capstone,AmesianX/capstone,techvoltage/capstone,sigma-random/capstone,pranith/capstone,8l/capstone,capturePointer/capstone,pombredanne/capstone,bigendiansmalls/capstone,07151129/capstone,NeilBryant/capstone,pranith/capstone,bowlofstew/capstone,dynm/capstone,AmesianX/capstone,angelabier1/capstone,bowlofstew/capstone,sigma-random/capstone,bSr43/capstone,pyq881120/capstone,xia0pin9/capstone,07151129/capstone,NeilBryant/capstone,sephiroth99/capstone,nplanel/capstone,07151129/capstone,nplanel/capstone,sigma-random/capstone,8l/capstone,techvoltage/capstone,zneak/capstone,fvrmatteo/capstone,techvoltage/capstone,bSr43/capstone,techvoltage/capstone,dynm/capstone,capturePointer/capstone,dynm/capstone,AmesianX/capstone,AmesianX/capstone,bughoho/capstone,bSr43/capstone,nplanel/capstone,bughoho/capstone,techvoltage/capstone,sephiroth99/capstone,pranith/capstone,zneak/capstone,capturePointer/capstone,8l/capstone,code4bones/capstone,nplanel/capstone,07151129/capstone,pyq881120/capstone,bigendiansmalls/capstone,zneak/capstone,8l/capstone,zneak/capstone,zuloloxi/capstone,fvrmatteo/capstone,pranith/capstone,nplanel/capstone,sephiroth99/capstone,zuloloxi/capstone,xia0pin9/capstone,angelabier1/capstone,capturePointer/capstone,pombredanne/capstone,xia0pin9/capstone,NeilBryant/capstone,angelabier1/capstone,bowlofstew/capstone,dynm/capstone,capturePointer/capstone,NeilBryant/capstone,angelabier1/capstone,nplanel/capstone,pyq881120/capstone,8l/capstone,bughoho/capstone,krytarowski/capstone,capturePointer/capstone,07151129/capstone,bigendiansmalls/capstone,pyq881120/capstone,bigendiansmalls/capstone,07151129/capstone,techvoltage/capstone,pombredanne/capstone,pombredanne/capstone,fvrmatteo/capstone,code4bones/capstone,bigendiansmalls/capstone,bSr43/capstone,pranith/capstone,xia0pin9/capstone,AmesianX/capstone,xia0pin9/capstone,code4bones/capstone,pombredanne/capstone,sigma-random/capstone,code4bones/capstone,sephiroth99/capstone,code4bones/capstone,pyq881120/capstone,dynm/capstone,bowlofstew/capstone,NeilBryant/capstone,angelabier1/capstone,bowlofstew/capstone,bigendiansmalls/capstone,sigma-random/capstone,capturePointer/capstone,sephiroth99/capstone,krytarowski/capstone,krytarowski/capstone,8l/capstone,zuloloxi/capstone,bughoho/capstone,nplanel/capstone,fvrmatteo/capstone,pyq881120/capstone,zuloloxi/capstone,bughoho/capstone,code4bones/capstone,krytarowski/capstone,zuloloxi/capstone,pyq881120/capstone,bughoho/capstone,8l/capstone,angelabier1/capstone,fvrmatteo/capstone,zuloloxi/capstone,xia0pin9/capstone,07151129/capstone,krytarowski/capstone,bughoho/capstone,dynm/capstone,pranith/capstone,sigma-random/capstone,AmesianX/capstone,zneak/capstone,angelabier1/capstone,pombredanne/capstone,AmesianX/capstone,pranith/capstone,NeilBryant/capstone,bowlofstew/capstone,dynm/capstone,sephiroth99/capstone,zuloloxi/capstone,bowlofstew/capstone,techvoltage/capstone,fvrmatteo/capstone,NeilBryant/capstone,bSr43/capstone,sephiroth99/capstone,bSr43/capstone
suite/MC/X86/intel-syntax-encoding.s.cs
suite/MC/X86/intel-syntax-encoding.s.cs
# CS_ARCH_X86, CS_MODE_64, None 0x66,0x83,0xf0,0x0c = xor ax, 12 0x83,0xf0,0x0c = xor eax, 12 0x48,0x83,0xf0,0x0c = xor rax, 12 0x66,0x83,0xc8,0x0c = or ax, 12 0x83,0xc8,0x0c = or eax, 12 0x48,0x83,0xc8,0x0c = or rax, 12 0x66,0x83,0xf8,0x0c = cmp ax, 12 0x83,0xf8,0x0c = cmp eax, 12 0x48,0x83,0xf8,0x0c = cmp rax, 12 0x48,0x89,0x44,0x24,0xf0 = mov QWORD PTR [RSP - 16], RAX 0x66,0x83,0xc0,0xf4 = add ax, -12 0x83,0xc0,0xf4 = add eax, -12 0x48,0x83,0xc0,0xf4 = add rax, -12 0x66,0x83,0xd0,0xf4 = adc ax, -12 0x83,0xd0,0xf4 = adc eax, -12 0x48,0x83,0xd0,0xf4 = adc rax, -12 0x66,0x83,0xd8,0xf4 = sbb ax, -12 0x83,0xd8,0xf4 = sbb eax, -12 0x48,0x83,0xd8,0xf4 = sbb rax, -12 0x66,0x83,0xf8,0xf4 = cmp ax, -12 0x83,0xf8,0xf4 = cmp eax, -12 0x48,0x83,0xf8,0xf4 = cmp rax, -12 0xf2,0x0f,0x10,0x2c,0x25,0xf8,0xff,0xff,0xff = movsd XMM5, QWORD PTR [-8] 0xd1,0xe7 = shl EDI, 1 0x0f,0xc2,0xd1,0x01 = cmpltps XMM2, XMM1 0xc3 = ret 0xcb = retf 0xc2,0x08,0x00 = ret 8 0xca,0x08,0x00 = retf 8
# CS_ARCH_X86, CS_MODE_64, None 0x66,0x83,0xf0,0x0c = xor ax, 12 0x83,0xf0,0x0c = xor eax, 12 0x48,0x83,0xf0,0x0c = xor rax, 12 0x66,0x83,0xc8,0x0c = or ax, 12 0x83,0xc8,0x0c = or eax, 12 0x48,0x83,0xc8,0x0c = or rax, 12 0x66,0x83,0xf8,0x0c = cmp ax, 12 0x83,0xf8,0x0c = cmp eax, 12 0x48,0x83,0xf8,0x0c = cmp rax, 12 0x48,0x89,0x44,0x24,0xf0 = mov QWORD PTR [RSP - 16], RAX 0x66,0x83,0xc0,0xf4 = add ax, -12 0x83,0xc0,0xf4 = add eax, -12 0x48,0x83,0xc0,0xf4 = add rax, -12 0x66,0x83,0xd0,0xf4 = adc ax, -12 0x83,0xd0,0xf4 = adc eax, -12 0x48,0x83,0xd0,0xf4 = adc rax, -12 0x66,0x83,0xd8,0xf4 = sbb ax, -12 0x83,0xd8,0xf4 = sbb eax, -12 0x48,0x83,0xd8,0xf4 = sbb rax, -12 0x66,0x83,0xf8,0xf4 = cmp ax, -12 0x83,0xf8,0xf4 = cmp eax, -12 0x48,0x83,0xf8,0xf4 = cmp rax, -12 0xeb,A = jmp LBB0_3 0xf2,0x0f,0x10,0x2c,0x25,0xf8,0xff,0xff,0xff = movsd XMM5, QWORD PTR [-8] 0xd1,0xe7 = shl EDI, 1 0x0f,0xc2,0xd1,0x01 = cmpltps XMM2, XMM1 0xc3 = ret 0xcb = retf 0xc2,0x08,0x00 = ret 8 0xca,0x08,0x00 = retf 8
bsd-3-clause
C#
7cb38f774a9f40ec48b52c3ca4a97810aafb4128
Update b/c of new dockpanel
superputty/superputty,alsanchez/SuperPutty
SuperPutty/ToolWindow.Designer.cs
SuperPutty/ToolWindow.Designer.cs
namespace SuperPutty { partial class ToolWindow { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ToolWindow)); this.SuspendLayout(); // // ToolWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(279, 253); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "ToolWindow"; this.Text = "ToolWindow"; this.ResumeLayout(false); } #endregion } }
namespace SuperPutty { partial class ToolWindow { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ToolWindow)); this.SuspendLayout(); // // ToolWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 264); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "ToolWindow"; this.Text = "ToolWindow"; this.ResumeLayout(false); } #endregion } }
mit
C#
03de129346e598be247829982069211ab16ce8c9
Update to 1.4.
darrencauthon/AutoMoq,darrencauthon/AutoMoq,darrencauthon/AutoMoq
src/AutoMoq/Properties/AssemblyInfo.cs
src/AutoMoq/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("AutoMoq")] [assembly: AssemblyDescription("Automocker for Moq.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("DEG")] [assembly: AssemblyProduct("AutoMoq")] [assembly: AssemblyCopyright("Copyright Darren Cauthon 2010")] [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("e6f813c5-0225-4f79-824c-ac21b49decc9")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.4.0.0")] [assembly: AssemblyFileVersion("1.4.0.0")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("AutoMoq")] [assembly: AssemblyDescription("Automocker for Moq.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("DEG")] [assembly: AssemblyProduct("AutoMoq")] [assembly: AssemblyCopyright("Copyright Darren Cauthon 2010")] [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("e6f813c5-0225-4f79-824c-ac21b49decc9")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.3.0.0")] [assembly: AssemblyFileVersion("1.3.0.0")]
mit
C#
a8d57ffb1187ef15da6de8019c65008aa6ec6d67
increment to 0.14.0
config-r/config-r
src/ConfigR/Properties/AssemblyInfo.cs
src/ConfigR/Properties/AssemblyInfo.cs
// <copyright file="AssemblyInfo.cs" company="ConfigR contributors"> // Copyright (c) ConfigR contributors. (configr.net@gmail.com) // </copyright> using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("ConfigR")] [assembly: AssemblyDescription("Write your .NET configuration files in C#.")] [assembly: AssemblyCompany("ConfigR contributors")] [assembly: AssemblyProduct("ConfigR")] [assembly: AssemblyCopyright("Copyright (c) ConfigR contributors. (configr.net@gmail.com)")] [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: AssemblyVersion("0.14.0")] [assembly: AssemblyFileVersion("0.14.0")] [assembly: AssemblyInformationalVersion("0.14.0")]
// <copyright file="AssemblyInfo.cs" company="ConfigR contributors"> // Copyright (c) ConfigR contributors. (configr.net@gmail.com) // </copyright> using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("ConfigR")] [assembly: AssemblyDescription("Write your .NET configuration files in C#.")] [assembly: AssemblyCompany("ConfigR contributors")] [assembly: AssemblyProduct("ConfigR")] [assembly: AssemblyCopyright("Copyright (c) ConfigR contributors. (configr.net@gmail.com)")] [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: AssemblyVersion("0.13.0")] [assembly: AssemblyFileVersion("0.13.0")] [assembly: AssemblyInformationalVersion("0.13.0")]
mit
C#
fb9c8e99eec35456cdd55e9472115b151d4c66bb
Support StringEnums that are lists
twilio/twilio-csharp
Twilio/Converters/StringEnumConverter.cs
Twilio/Converters/StringEnumConverter.cs
using System; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Collections.Generic; using System.Collections; using Twilio.Types; namespace Twilio.Converters { public class StringEnumConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { var t = JToken.FromObject(value.ToString()); t.WriteTo(writer); } public override object ReadJson( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) { if (reader.Value == null) { if (objectType.GenericTypeArguments.Length == 0) { return null; } var constructedListType = MakeGenericType(objectType); var results = (IList) Activator.CreateInstance(constructedListType); reader.Read(); while (reader.Value != null) { var e = CreateEnum(objectType); e.FromString(reader.Value as string); results.Add(e); reader.Read(); } return results; } var instance = (StringEnum) Activator.CreateInstance(objectType); instance.FromString(reader.Value as string); return instance; } public override bool CanConvert(Type objectType) { return objectType == typeof(Enum); } private static Type MakeGenericType(Type objectType) { var listType = typeof(List<>); #if NET40 return listType.MakeGenericType(objectType.GenericTypeArguments[0]); #else return listType.MakeGenericType(objectType.GetGenericArguments()[0]); #endif } private static StringEnum CreateEnum(Type objectType) { #if NET40 return (StringEnum) Activator.CreateInstance(objectType.GenericTypeArguments[0]); #else return (StringEnum) Activator.CreateInstance(objectType.GetGenericArguments()[0]); #endif } } }
using System; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Collections.Generic; using System.Collections; using Twilio.Types; namespace Twilio.Converters { public class StringEnumConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { var t = JToken.FromObject(value.ToString()); t.WriteTo(writer); } public override object ReadJson( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) { if (reader.Value == null) { return reader.Value; } var instance = (StringEnum) Activator.CreateInstance(objectType); instance.FromString(reader.Value as string); return instance; } public override bool CanConvert(Type objectType) { return objectType == typeof(Enum); } private static Type MakeGenericType(Type objectType) { var listType = typeof(List<>); #if NET40 return listType.MakeGenericType(objectType.GenericTypeArguments[0]); #else return listType.MakeGenericType(objectType.GetGenericArguments()[0]); #endif } private static StringEnum CreateEnum(Type objectType) { #if NET40 return (StringEnum) Activator.CreateInstance(objectType.GenericTypeArguments[0]); #else return (StringEnum) Activator.CreateInstance(objectType.GetGenericArguments()[0]); #endif } } }
mit
C#
82a4c4a82046b1ac59cb17540d4695c0bd598dec
Make getinfo obsolete
lontivero/NBitcoin,MetacoSA/NBitcoin,MetacoSA/NBitcoin,NicolasDorier/NBitcoin
NBitcoin/RPC/RPCOperations.cs
NBitcoin/RPC/RPCOperations.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NBitcoin.RPC { //from rpcserver.h public enum RPCOperations { getconnectioncount, getpeerinfo, ping, addnode, getaddednodeinfo, getnettotals, dumpprivkey, importprivkey, importaddress, dumpwallet, importwallet, getgenerate, setgenerate, generate, getnetworkhashps, gethashespersec, getmininginfo, prioritisetransaction, getwork, getblocktemplate, submitblock, estimatefee, estimatesmartfee, getnewaddress, getaccountaddress, getrawchangeaddress, setaccount, getaccount, getaddressesbyaccount, sendtoaddress, signmessage, verifymessage, getreceivedbyaddress, getreceivedbyaccount, getbalance, getunconfirmedbalance, movecmd, sendfrom, sendmany, addmultisigaddress, createmultisig, listreceivedbyaddress, listreceivedbyaccount, listtransactions, listaddressgroupings, listaccounts, listsinceblock, gettransaction, backupwallet, keypoolrefill, walletpassphrase, walletpassphrasechange, walletlock, encryptwallet, validateaddress, [Obsolete("Deprecated in Bitcoin Core 0.16.0 use getblockchaininfo, getnetworkinfo, getwalletinfo or getmininginfo instead")] getinfo, getwalletinfo, getblockchaininfo, getnetworkinfo, getrawtransaction, listunspent, lockunspent, listlockunspent, createrawtransaction, decoderawtransaction, decodescript, signrawtransaction, sendrawtransaction, gettxoutproof, verifytxoutproof, getblockcount, getbestblockhash, getdifficulty, settxfee, getmempoolinfo, getrawmempool, getblockhash, getblock, gettxoutsetinfo, gettxout, verifychain, getchaintips } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NBitcoin.RPC { //from rpcserver.h public enum RPCOperations { getconnectioncount, getpeerinfo, ping, addnode, getaddednodeinfo, getnettotals, dumpprivkey, importprivkey, importaddress, dumpwallet, importwallet, getgenerate, setgenerate, generate, getnetworkhashps, gethashespersec, getmininginfo, prioritisetransaction, getwork, getblocktemplate, submitblock, estimatefee, estimatesmartfee, getnewaddress, getaccountaddress, getrawchangeaddress, setaccount, getaccount, getaddressesbyaccount, sendtoaddress, signmessage, verifymessage, getreceivedbyaddress, getreceivedbyaccount, getbalance, getunconfirmedbalance, movecmd, sendfrom, sendmany, addmultisigaddress, createmultisig, listreceivedbyaddress, listreceivedbyaccount, listtransactions, listaddressgroupings, listaccounts, listsinceblock, gettransaction, backupwallet, keypoolrefill, walletpassphrase, walletpassphrasechange, walletlock, encryptwallet, validateaddress, getinfo, getwalletinfo, getblockchaininfo, getnetworkinfo, getrawtransaction, listunspent, lockunspent, listlockunspent, createrawtransaction, decoderawtransaction, decodescript, signrawtransaction, sendrawtransaction, gettxoutproof, verifytxoutproof, getblockcount, getbestblockhash, getdifficulty, settxfee, getmempoolinfo, getrawmempool, getblockhash, getblock, gettxoutsetinfo, gettxout, verifychain, getchaintips } }
mit
C#
c6b287aa4f165f47264309c60e636a26651ec02e
Add NotificationFeatureSupported and AlarmFeatureSupported peoperties to WellKnownServerFeatures class.
ZEISS-PiWeb/PiWeb-Api
src/Common/Data/WellKnownServerFeatures.cs
src/Common/Data/WellKnownServerFeatures.cs
#region copyright /* * * * * * * * * * * * * * * * * * * * * * * * * */ /* Carl Zeiss IMT (IZfM Dresden) */ /* Softwaresystem PiWeb */ /* (c) Carl Zeiss 2015 */ /* * * * * * * * * * * * * * * * * * * * * * * * * */ #endregion using Zeiss.IMT.PiWeb.Api.DataService.Rest; namespace Zeiss.IMT.PiWeb.Api.Common.Data { /// <summary> /// Static class with constants that are used by <see cref="ServiceInformation.FeatureList"/> /// to indicate the availability of certain server features. /// </summary> public static class WellKnownServerFeatures { /// <summary>Server supports server side querying of merged measurements (like a primary key for measurement search).</summary> public const string MergeAttributes = "MergeAttributes"; /// <summary>Server supports defining conditions ('MergeCondition' + 'MergeMasterPart') /// for server side querying of merged measurements (like a primary key for measurement search).</summary> public const string MergeConditions = "MergeConditions"; /// <summary>Server supports the measurement aggregation feature.</summary> public const string MeasurementAggregation = "MeasurementAggregation"; /// <summary>Server supports the distinct search for specific attribute values.</summary> public const string DistinctMeasurementSearch = "DistinctMeasurementSearch"; /// <summary>The server database is readonly and cannot be modified.</summary> public const string ReadOnlyDatabase = "ReadOnlyDB"; /// <summary>The server does not support jobs.</summary> public const string JobEngineNotSupported = "JobEngineNotSupported"; /// <summary>The server supports characteristics below the root part and measurements attached to the root part.</summary> public const string CharacteristicsBelowRoot = "CharacteristicsBelowRoot"; /// <summary>The server supports the modification of catalog attributes without data loss /// (without this feature the only possibility is to delete and recreated the catalog).</summary> public const string CatalogAttributesUpdate = "CatalogAttributesUpdate"; /// <summary>The server supports the ignore search filter flag for users and groups.</summary> public const string IgnoreSearchFilterSupport = "IgnoreSearchFilterSupport"; /// <summary>The server supports measurement filter attributes with a LastN value greater than <see cref="short.MaxValue"/>.</summary> public const string MeasurementLimitResultInt32 = "MeasurementLimitResultInt32"; /// <summary>The server supports generation of notifications.</summary> public const string NotificationFeatureSupported = "NotificationFeatureSupported"; /// <summary>The server supports internal generation of event based alarms.</summary> public const string AlarmFeatureSupported = "AlarmFeatureSupported"; } }
#region copyright /* * * * * * * * * * * * * * * * * * * * * * * * * */ /* Carl Zeiss IMT (IZfM Dresden) */ /* Softwaresystem PiWeb */ /* (c) Carl Zeiss 2015 */ /* * * * * * * * * * * * * * * * * * * * * * * * * */ #endregion using Zeiss.IMT.PiWeb.Api.DataService.Rest; namespace Zeiss.IMT.PiWeb.Api.Common.Data { /// <summary> /// Static class with constants that are used by <see cref="ServiceInformation.FeatureList"/> /// to indicate the availability of certain server features. /// </summary> public static class WellKnownServerFeatures { /// <summary>Server supports server side querying of merged measurements (like a primary key for measurement search).</summary> public const string MergeAttributes = "MergeAttributes"; /// <summary>Server supports defining conditions ('MergeCondition' + 'MergeMasterPart') /// for server side querying of merged measurements (like a primary key for measurement search).</summary> public const string MergeConditions = "MergeConditions"; /// <summary>Server supports the measurement aggregation feature.</summary> public const string MeasurementAggregation = "MeasurementAggregation"; /// <summary>Server supports the distinct search for specific attribute values.</summary> public const string DistinctMeasurementSearch = "DistinctMeasurementSearch"; /// <summary>The server database is readonly and cannot be modified.</summary> public const string ReadOnlyDatabase = "ReadOnlyDB"; /// <summary>The server does not support jobs.</summary> public const string JobEngineNotSupported = "JobEngineNotSupported"; /// <summary>The server supports characteristics below the root part and messurements attached to the root part.</summary> public const string CharacteristicsBelowRoot = "CharacteristicsBelowRoot"; /// <summary>The server supports the modification of catalog attributes without data loss /// (without this feature the only possibility is to delete and recreated the catalog).</summary> public const string CatalogAttributesUpdate = "CatalogAttributesUpdate"; /// <summary>The server supports the ignore search filter flag for users and groups.</summary> public const string IgnoreSearchFilterSupport = "IgnoreSearchFilterSupport"; /// <summary>The server supports measurement filter attributes with a LastN value greater than <see cref="short.MaxValue"/>.</summary> public const string MeasurementLimitResultInt32 = "MeasurementLimitResultInt32"; } }
bsd-3-clause
C#
4b52e405a4119e50709abe3ddb8ead99d1d15be0
Fix script compilation settings (#4853)
elastic/elasticsearch-net,elastic/elasticsearch-net
tests/Tests.Core/ManagedElasticsearch/Clusters/ClientTestClusterBase.cs
tests/Tests.Core/ManagedElasticsearch/Clusters/ClientTestClusterBase.cs
// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information using System.IO; using Elastic.Elasticsearch.Ephemeral; using Elastic.Elasticsearch.Ephemeral.Plugins; using Elastic.Elasticsearch.Xunit; using Elastic.Stack.ArtifactsApi.Products; using Elasticsearch.Net; using Nest; using Tests.Configuration; using Tests.Core.Client; using Tests.Core.Extensions; using Tests.Core.ManagedElasticsearch.Tasks; using Tests.Domain.Extensions; namespace Tests.Core.ManagedElasticsearch.Clusters { public abstract class ClientTestClusterBase : XunitClusterBase<ClientTestClusterConfiguration>, INestTestCluster { protected ClientTestClusterBase() : this(new ClientTestClusterConfiguration()) { } protected ClientTestClusterBase(params ElasticsearchPlugin[] plugins) : this(new ClientTestClusterConfiguration(plugins)) { } protected ClientTestClusterBase(ClientTestClusterConfiguration configuration) : base(configuration) { } public IElasticClient Client => this.GetOrAddClient(s => ConnectionSettings(s.ApplyDomainSettings())); protected virtual ConnectionSettings ConnectionSettings(ConnectionSettings s) => s; protected sealed override void SeedCluster() { Client.Cluster.Health(new ClusterHealthRequest { WaitForStatus = WaitForStatus.Green }); SeedNode(); Client.Cluster.Health(new ClusterHealthRequest { WaitForStatus = WaitForStatus.Green }); } protected virtual void SeedNode() { } } public class ClientTestClusterConfiguration : XunitClusterConfiguration { public ClientTestClusterConfiguration(params ElasticsearchPlugin[] plugins) : this(numberOfNodes: 1, plugins: plugins) { } public ClientTestClusterConfiguration(ClusterFeatures features = ClusterFeatures.None, int numberOfNodes = 1, params ElasticsearchPlugin[] plugins ) : base(TestClient.Configuration.ElasticsearchVersion, features, new ElasticsearchPlugins(plugins), numberOfNodes) { TestConfiguration = TestClient.Configuration; ShowElasticsearchOutputAfterStarted = TestConfiguration.ShowElasticsearchOutputAfterStarted; HttpFiddlerAware = true; CacheEsHomeInstallation = true; Add(AttributeKey("testingcluster"), "true"); Add(AttributeKey("gateway"), "true"); Add("search.remote.connect", "true", "<8.0.0"); Add("node.remote_cluster_client", "true", ">=8.0.0-SNAPSHOT"); Add($"script.max_compilations_per_minute", "10000", "<6.0.0-rc1"); Add($"script.max_compilations_rate", "10000/1m", ">=6.0.0-rc1 <7.9.0-SNAPSHOT"); Add($"script.disable_max_compilations_rate", "true", ">=7.9.0-SNAPSHOT"); Add($"script.inline", "true", "<5.5.0"); Add($"script.stored", "true", ">5.0.0-alpha1 <5.5.0"); Add($"script.indexed", "true", "<5.0.0-alpha1"); Add($"script.allowed_types", "inline,stored", ">=5.5.0"); AdditionalBeforeNodeStartedTasks.Add(new WriteAnalysisFiles()); } public string AnalysisFolder => Path.Combine(FileSystem.ConfigPath, "analysis"); public TestConfigurationBase TestConfiguration { get; } } }
// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information using System.IO; using Elastic.Elasticsearch.Ephemeral; using Elastic.Elasticsearch.Ephemeral.Plugins; using Elastic.Elasticsearch.Xunit; using Elastic.Stack.ArtifactsApi.Products; using Elasticsearch.Net; using Nest; using Tests.Configuration; using Tests.Core.Client; using Tests.Core.Extensions; using Tests.Core.ManagedElasticsearch.Tasks; using Tests.Domain.Extensions; namespace Tests.Core.ManagedElasticsearch.Clusters { public abstract class ClientTestClusterBase : XunitClusterBase<ClientTestClusterConfiguration>, INestTestCluster { protected ClientTestClusterBase() : this(new ClientTestClusterConfiguration()) { } protected ClientTestClusterBase(params ElasticsearchPlugin[] plugins) : this(new ClientTestClusterConfiguration(plugins)) { } protected ClientTestClusterBase(ClientTestClusterConfiguration configuration) : base(configuration) { } public IElasticClient Client => this.GetOrAddClient(s => ConnectionSettings(s.ApplyDomainSettings())); protected virtual ConnectionSettings ConnectionSettings(ConnectionSettings s) => s; protected sealed override void SeedCluster() { Client.Cluster.Health(new ClusterHealthRequest { WaitForStatus = WaitForStatus.Green }); SeedNode(); Client.Cluster.Health(new ClusterHealthRequest { WaitForStatus = WaitForStatus.Green }); } protected virtual void SeedNode() { } } public class ClientTestClusterConfiguration : XunitClusterConfiguration { public ClientTestClusterConfiguration(params ElasticsearchPlugin[] plugins) : this(numberOfNodes: 1, plugins: plugins) { } public ClientTestClusterConfiguration(ClusterFeatures features = ClusterFeatures.None, int numberOfNodes = 1, params ElasticsearchPlugin[] plugins ) : base(TestClient.Configuration.ElasticsearchVersion, features, new ElasticsearchPlugins(plugins), numberOfNodes) { TestConfiguration = TestClient.Configuration; ShowElasticsearchOutputAfterStarted = TestConfiguration.ShowElasticsearchOutputAfterStarted; HttpFiddlerAware = true; CacheEsHomeInstallation = true; Add(AttributeKey("testingcluster"), "true"); Add(AttributeKey("gateway"), "true"); Add("search.remote.connect", "true", "<8.0.0"); Add("node.remote_cluster_client", "true", ">=8.0.0-SNAPSHOT"); Add($"script.max_compilations_per_minute", "10000", "<6.0.0-rc1"); Add($"script.max_compilations_rate", "10000/1m", ">=6.0.0-rc1"); Add($"script.inline", "true", "<5.5.0"); Add($"script.stored", "true", ">5.0.0-alpha1 <5.5.0"); Add($"script.indexed", "true", "<5.0.0-alpha1"); Add($"script.allowed_types", "inline,stored", ">=5.5.0"); AdditionalBeforeNodeStartedTasks.Add(new WriteAnalysisFiles()); } public string AnalysisFolder => Path.Combine(FileSystem.ConfigPath, "analysis"); public TestConfigurationBase TestConfiguration { get; } } }
apache-2.0
C#
b2011a339848413e333f2d4612b7e8bbea3e43b7
Adjust admin layout
PioneerCode/pioneer-blog,PioneerCode/pioneer-blog,PioneerCode/pioneer-blog,PioneerCode/pioneer-blog
src/Pioneer.Blog/Areas/Admin/Views/Shared/_LayoutAdmin.cshtml
src/Pioneer.Blog/Areas/Admin/Views/Shared/_LayoutAdmin.cshtml
@{ Layout = "~/Views/Shared/_Layout.cshtml"; } @section headEnd { <base href="/admin/portal"> <link href="~/admin/styles.css" rel="stylesheet" /> } <section class="body-content-admin"> <header> <div class="clearfix"> <div class="home float-left"> <a href="/"> <i class="fa fa-home" aria-hidden="true"></i> Pioneer Code </a> </div> <div class="float-right"> @await Html.PartialAsync("_LoginPartial") </div> </div> </header> @RenderBody() </section> @section bodyEnd { <script type="text/javascript" src="~/admin/polyfills.js"></script> <script type="text/javascript" src="~/admin/vendor.js"></script> <script type="text/javascript" src="~/admin/app.js"></script> <script type="text/javascript" src="~/admin/styles.js"></script> }
@{ Layout = "~/Views/Shared/_Layout.cshtml"; } @section headEnd { <base href="/admin/portal"> <link href="~/admin/styles.css" rel="stylesheet" /> } <section class="body-content-admin"> <header> <div class="clearfix"> <div class="home float-left"> <a href="/"> <i class="fa fa-home" aria-hidden="true"></i> Pioneer Code </a> </div> <div class="float-right"> @await Html.PartialAsync("_LoginPartial") </div> </div> </header> <div class="admin-canvas"> @RenderBody() </div> </section> @section bodyEnd { <script type="text/javascript" src="~/admin/polyfills.js"></script> <script type="text/javascript" src="~/admin/vendor.js"></script> <script type="text/javascript" src="~/admin/app.js"></script> <script type="text/javascript" src="~/admin/styles.js"></script> }
mit
C#
0f711b3a4db40b6d609b0cee90f63e6856ce606a
Read colors using values between 0-255 instead of 0-1.
samfun123/KtaneTwitchPlays,CaitSith2/KtaneTwitchPlays
Assets/Scripts/Helpers/SettingsConverter.cs
Assets/Scripts/Helpers/SettingsConverter.cs
using Newtonsoft.Json; using System; using System.Linq; using UnityEngine; class SettingsConverter { public static string Serialize(object obj) { return JsonConvert.SerializeObject(obj, Formatting.Indented, new ColorConverter()); } public static T Deserialize<T>(string json) { return JsonConvert.DeserializeObject<T>(json, new ColorConverter()); } } class ColorConverter : JsonConverter { private int? ParseInt(string number) { int i; return int.TryParse(number, out i) ? (int?) i : null; } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { Color color = (Color) value; string format = string.Format("{0}, {1}, {2}", (int) (color.r * 255), (int) (color.g * 255), (int) (color.b * 255)); if (color.a != 1) format += ", " + (int) (color.a * 255); writer.WriteValue(format); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var parts = ((string) reader.Value).Split(',').Select(str => ParseInt(str.Trim())); if (parts.Any(x => x == null)) return existingValue; var values = parts.Select(i => (int) i / 255f).ToArray(); switch (values.Count()) { case 3: return new Color(values[0], values[1], values[2]); case 4: return new Color(values[0], values[1], values[2], values[3]); default: return existingValue; } } public override bool CanConvert(Type objectType) { return typeof(Color) == objectType; } }
using Newtonsoft.Json; using System; using System.Linq; using UnityEngine; class SettingsConverter { public static string Serialize(object obj) { return JsonConvert.SerializeObject(obj, Formatting.Indented, new ColorConverter()); } public static T Deserialize<T>(string json) { return JsonConvert.DeserializeObject<T>(json, new ColorConverter()); } } class ColorConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { Color color = (Color) value; if (color.a == 1) writer.WriteValue(string.Format("{0}, {1}, {2}", color.r, color.g, color.b)); else writer.WriteValue(string.Format("{0}, {1}, {2}, {3}", color.r, color.g, color.b, color.a)); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { try { var values = ((string) reader.Value).Split(',').Select(x => float.Parse(x.Trim())).ToArray(); switch (values.Count()) { case 3: return new Color(values[0], values[1], values[2]); case 4: return new Color(values[0], values[1], values[2], values[3]); default: return null; } } catch { return null; } } public override bool CanConvert(Type objectType) { return typeof(Color) == objectType; } }
mit
C#
1bb841d33dcfe76120880d5a22125a72abfff03f
fix CatContext Serialize
chinaboard/PureCat
PureCat/Context/CatContext.cs
PureCat/Context/CatContext.cs
using System; using System.Collections; using System.Collections.Generic; namespace PureCat.Context { public class CatContext { private Dictionary<string, string> _dict = new Dictionary<string, string>(); private const string _catRootId = "X-Cat-RootId"; private const string _catParentId = "X-Cat-ParentId"; private const string _catChildId = "X-Cat-Id"; public string CatRootId { get { return this[_catRootId]; } set { this[_catRootId] = value; } } public string CatParentId { get { return this[_catParentId]; } set { this[_catParentId] = value; } } public string CatChildId { get { return this[_catChildId]; } set { this[_catChildId] = value; } } public string ContextName { get; private set; } public CatContext(string contextName = null) { ContextName = contextName ?? Environment.MachineName; } public string this[string key] { get { return _dict.ContainsKey(key) ? _dict[key] : null; } set { _dict[key] = value; } } public IEnumerator<KeyValuePair<string, string>> GetEnumerator() { foreach (var item in _dict) yield return item; } } }
using System; using System.Collections; using System.Collections.Generic; namespace PureCat.Context { public class CatContext : IEnumerable<KeyValuePair<string, string>> { private Dictionary<string, string> _dict = new Dictionary<string, string>(); private const string _catRootId = "X-Cat-RootId"; private const string _catParentId = "X-Cat-ParentId"; private const string _catChildId = "X-Cat-Id"; public string CatRootId { get { return this[_catRootId]; } set { this[_catRootId] = value; } } public string CatParentId { get { return this[_catParentId]; } set { this[_catParentId] = value; } } public string CatChildId { get { return this[_catChildId]; } set { this[_catChildId] = value; } } public string ContextName { get; private set; } public CatContext(string contextName = null) { ContextName = contextName ?? Environment.MachineName; } public string this[string key] { get { return _dict.ContainsKey(key) ? _dict[key] : null; } set { _dict[key] = value; } } public IEnumerator<KeyValuePair<string, string>> GetEnumerator() { foreach (var item in _dict) yield return item; } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } }
mit
C#
08ed10d7d31d058cc25ff3cc606c3c76fff39b9b
Create server side API for single multiple answer question
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(); } /// <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> /// Adding single multiple answer question into SingleMultipleAnswerQuestion model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); _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(); } } }
mit
C#
a80e8aa01827461c6e31c28528d944fce3aa229b
Fix NRE
gavazquez/LunaMultiPlayer,DaggerES/LunaMultiPlayer,gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer
Client/Extensions/CelestialBodyExtension.cs
Client/Extensions/CelestialBodyExtension.cs
using System; namespace LunaClient.Extensions { public static class CelestialBodyExtension { public static double SiderealDayLength(this CelestialBody body) { if (body == null) return 0; var siderealOrbitalPeriod = 6.28318530717959 * Math.Sqrt(Math.Pow(Math.Abs(body.orbit.semiMajorAxis), 3) / body.orbit.referenceBody.gravParameter); return body.rotationPeriod * siderealOrbitalPeriod / (siderealOrbitalPeriod + body.rotationPeriod); } } }
using System; namespace LunaClient.Extensions { public static class CelestialBodyExtension { public static double SiderealDayLength(this CelestialBody body) { var siderealOrbitalPeriod = 6.28318530717959 * Math.Sqrt(Math.Pow(Math.Abs(body.orbit.semiMajorAxis), 3) / body.orbit.referenceBody.gravParameter); return body.rotationPeriod * siderealOrbitalPeriod / (siderealOrbitalPeriod + body.rotationPeriod); } } }
mit
C#
42a93f448e21e46224f0017db3bcc544316bb9ac
Set the document language to English
alastairs/cgowebsite,alastairs/cgowebsite
src/CGO.Web/Views/Shared/_Layout.cshtml
src/CGO.Web/Views/Shared/_Layout.cshtml
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> @Styles.Render("~/Content/themes/base/css", "~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> @RenderBody() @Scripts.Render("~/bundles/jquery") @RenderSection("scripts", required: false) </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> @Styles.Render("~/Content/themes/base/css", "~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> @RenderBody() @Scripts.Render("~/bundles/jquery") @RenderSection("scripts", required: false) </body> </html>
mit
C#
4553997f58528ed9df0058102194d88d9a74125b
Update Oneway.cs
hprose/hprose-dotnet
src/Hprose.RPC.Plugins/Oneway/Oneway.cs
src/Hprose.RPC.Plugins/Oneway/Oneway.cs
/*--------------------------------------------------------*\ | | | hprose | | | | Official WebSite: https://hprose.com | | | | Oneway.cs | | | | Oneway plugin for C#. | | | | LastModified: Mar 26, 2020 | | Author: Ma Bingyao <andot@hprose.com> | | | \*________________________________________________________*/ using System.IO; using System.Threading.Tasks; namespace Hprose.RPC.Plugins.Oneway { public static class Oneway { public static async Task<Stream> Handler(Stream request, Context context, NextIOHandler next) { var result = next(request, context); if (context.Contains("Oneway")) { return null; } return await result.ConfigureAwait(false); } } }
/*--------------------------------------------------------*\ | | | hprose | | | | Official WebSite: https://hprose.com | | | | Oneway.cs | | | | Oneway plugin for C#. | | | | LastModified: Feb 2, 2019 | | Author: Ma Bingyao <andot@hprose.com> | | | \*________________________________________________________*/ using System.Threading.Tasks; namespace Hprose.RPC.Plugins.Oneway { public static class Oneway { public static async Task<object> Handler(string name, object[] args, Context context, NextInvokeHandler next) { var result = next(name, args, context); if (context.Contains("Oneway")) { return null; } return await result.ConfigureAwait(false); } } }
mit
C#
2585e15c389aca4f39887b6d624990efbb2c822d
Create object fields for save directory and image type
robertgreiner/Slapshot
Slapshot/Slapshot.cs
Slapshot/Slapshot.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Imaging; using System.Linq; using System.Text; using System.Windows.Forms; namespace Slapshot { public partial class Slapshot : Form { private string SaveDirectory; private ImageFormat SaveFormat; public Slapshot() { SaveDirectory = "."; SaveFormat = ImageFormat.Png; InitializeComponent(); } private void Slapshot_SizeChanged(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized) { minimizeToTray(); } } private void Slapshot_Load(object sender, EventArgs e) { minimizeToTray(); } private void minimizeToTray() { ApplicationIcon.Visible = true; this.WindowState = FormWindowState.Minimized; this.ShowInTaskbar = false; } private void CaptureMenuItem_Click(object sender, EventArgs e) { var screenshot = new Screenshot(SaveDirectory, SaveFormat); screenshot.CaptureEntireScreen(); } private void CloseMenuItem_Click(object sender, EventArgs e) { this.Close(); } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Imaging; using System.Linq; using System.Text; using System.Windows.Forms; namespace Slapshot { public partial class Slapshot : Form { public Slapshot() { InitializeComponent(); } private void Slapshot_SizeChanged(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized) { minimizeToTray(); } } private void Slapshot_Load(object sender, EventArgs e) { minimizeToTray(); } private void minimizeToTray() { ApplicationIcon.Visible = true; this.WindowState = FormWindowState.Minimized; this.ShowInTaskbar = false; } private void CaptureMenuItem_Click(object sender, EventArgs e) { var screenshot = new Screenshot(".", ImageFormat.Png); screenshot.CaptureEntireScreen(); } private void CloseMenuItem_Click(object sender, EventArgs e) { this.Close(); } } }
mit
C#
a54f570a7666e9697e99b0838472156e3c22a7a5
Update website URI to root domain
planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell
src/Firehose.Web/Authors/MattBobke.cs
src/Firehose.Web/Authors/MattBobke.cs
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; public class MattBobke : IAmACommunityMember, IFilterMyBlogPosts { public string FirstName => "Matt"; public string LastName => "Bobke"; public string ShortBioOrTagLine => "Desktop Support Specialist with admninistrative tendencies excited about PowerShell and automation."; public string StateOrRegion => "California, United States"; public string GravatarHash => "6f38a96cd055f95eacd1d3d102e309fa"; public string EmailAddress => "matt@mattbobke.com"; public string TwitterHandle => "MattBobke"; public string GitHubHandle => "mcbobke"; public GeoPosition Position => new GeoPosition(33.6469, -117.6861); public Uri WebSite => new Uri("https://mattbobke.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://mattbobke.com/feed/atom/"); } } public bool Filter(SyndicationItem item) { // This filters out only the posts that have the "PowerShell" category return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell")); } }
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; public class MattBobke : IAmACommunityMember, IFilterMyBlogPosts { public string FirstName => "Matt"; public string LastName => "Bobke"; public string ShortBioOrTagLine => "Desktop Support Specialist with admninistrative tendencies excited about PowerShell and automation."; public string StateOrRegion => "California, United States"; public string GravatarHash => "6f38a96cd055f95eacd1d3d102e309fa"; public string EmailAddress => "matt@mattbobke.com"; public string TwitterHandle => "MattBobke"; public string GitHubHandle => "mcbobke"; public GeoPosition Position => new GeoPosition(33.6469, -117.6861); public Uri WebSite => new Uri("https://blog.mattbobke.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://blog.mattbobke.com/feed/atom/"); } } public bool Filter(SyndicationItem item) { // This filters out only the posts that have the "PowerShell" category return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell")); } }
mit
C#
b77fe41a745dc33c83acb7330784eaac592117a2
Add ImportTestAsync, ImportUpdateTestAsync
ats124/backlog4net
src/Backlog4net.Test/ImportMethodsTest.cs
src/Backlog4net.Test/ImportMethodsTest.cs
using System; using System.Collections.Generic; using System.Linq; using System.IO; using System.Runtime.Remoting; using System.Text; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Backlog4net.Test { using Api; using Api.Option; using Backlog4net.Internal.Json; using Backlog4net.Internal.Json.Activities; using Conf; using Newtonsoft.Json; using TestConfig; [TestClass] public class ImportMethodsTest { private static BacklogClient client; private static GeneralConfig generalConfig; private static string projectKey; private static long projectId; private static User anotherUser; private static IList<IssueType> issueTypes; [ClassInitialize] public static async Task SetupClient(TestContext context) { generalConfig = GeneralConfig.Instance.Value; var conf = new BacklogJpConfigure(generalConfig.SpaceKey); conf.ApiKey = generalConfig.ApiKey; client = new BacklogClientFactory(conf).NewClient(); var users = await client.GetUsersAsync(); projectKey = generalConfig.ProjectKey; var project = await client.GetProjectAsync(projectKey); projectId = project.Id; issueTypes = await client.GetIssueTypesAsync(projectId); var conf2 = new BacklogJpConfigure(generalConfig.SpaceKey); conf2.ApiKey = generalConfig.ApiKey2; var client2 = new BacklogClientFactory(conf).NewClient(); anotherUser = await client2.GetMyselfAsync(); } [TestMethod] public async Task ImportTestAsync() { var issue = await client.ImportIssueAsync(new ImportIssueParams(projectId, "ImportTest", issueTypes.First().Id, IssuePriorityType.High) { Description = "Description", CreatedUserId = anotherUser.Id, Created = new DateTime(2017, 8, 1, 10, 5, 10, DateTimeKind.Utc), }); Assert.AreEqual(issue.Description, "Description"); Assert.AreEqual(issue.CreatedUser.Id, anotherUser.Id); Assert.AreEqual(issue.Created, new DateTime(2017, 8, 1, 10, 5, 10, DateTimeKind.Utc)); await client.DeleteIssueAsync(issue.Id); } [TestMethod] public async Task ImportUpdateTestAsync() { var issue = await client.CreateIssueAsync(new CreateIssueParams(projectId, "ImportUpdatedTest", issueTypes.First().Id, IssuePriorityType.High)); var issueUpdated = await client.ImportUpdateIssueAsync(new ImportUpdateIssueParams(issue.Id) { Summary = "ImportUpdatedTestUpdated", UpdatedUserId = anotherUser.Id, Updated = new DateTime(2017, 8, 2, 10, 5, 10, DateTimeKind.Utc), }); Assert.AreEqual(issueUpdated.UpdatedUser.Id, anotherUser.Id); Assert.AreEqual(issueUpdated.Updated, new DateTime(2017, 8, 2, 10, 5, 10, DateTimeKind.Utc)); await client.DeleteIssueAsync(issue.Id); } } }
using System; using System.Collections.Generic; using System.Linq; using System.IO; using System.Runtime.Remoting; using System.Text; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Backlog4net.Test { using Api; using Api.Option; using Backlog4net.Internal.Json; using Backlog4net.Internal.Json.Activities; using Conf; using Newtonsoft.Json; using TestConfig; [TestClass] public class ImportMethodsTest { private static BacklogClient client; private static GeneralConfig generalConfig; private static string projectKey; private static long projectId; private static User anotherUser; [ClassInitialize] public static async Task SetupClient(TestContext context) { generalConfig = GeneralConfig.Instance.Value; var conf = new BacklogJpConfigure(generalConfig.SpaceKey); conf.ApiKey = generalConfig.ApiKey; client = new BacklogClientFactory(conf).NewClient(); var users = await client.GetUsersAsync(); projectKey = generalConfig.ProjectKey; var project = await client.GetProjectAsync(projectKey); projectId = project.Id; var conf2 = new BacklogJpConfigure(generalConfig.SpaceKey); conf2.ApiKey = generalConfig.ApiKey2; var client2 = new BacklogClientFactory(conf).NewClient(); anotherUser = await client2.GetMyselfAsync(); } } }
mit
C#
cfbd1108a7328af5cbc5d532ada4c6a8915d9d2f
Remove Category link in menu
webSportENIProject/webSport,webSportENIProject/webSport
WUI/Views/Shared/_Menu.cshtml
WUI/Views/Shared/_Menu.cshtml
<li>@Html.ActionLink("Courses", "Index", "Race")</li> @if (User.IsInRole("Administrateur")) { <li>@Html.ActionLink("Liste des points", "Index", "Point")</li> <li>@Html.ActionLink("Importer les résultats", "Import", "Resultat")</li> } @if (User.IsInRole("Administrateur")) { <li>@Html.ActionLink("Type de Point", "Index", "TypePoint")</li> } @if (Request.IsAuthenticated) { <li>@Html.ActionLink("Mes Inscriptions", "Index", "Participant")</li> }
<li>@Html.ActionLink("Courses", "Index", "Race")</li> <li>@Html.ActionLink("Catégories", "Index", "Category")</li> @if (User.IsInRole("Administrateur")) { <li>@Html.ActionLink("Liste des points", "Index", "Point")</li> <li>@Html.ActionLink("Importer les résultats", "Import", "Resultat")</li> } @if (User.IsInRole("Administrateur")) { <li>@Html.ActionLink("Type de Point", "Index", "TypePoint")</li> } @if (Request.IsAuthenticated) { <li>@Html.ActionLink("Mes Inscriptions", "Index", "Participant")</li> }
apache-2.0
C#
9bcbf094679c9cab2c266baa3b9b5b4f862fd7da
Disable ConsoleLogAdapter in test output
github-for-unity/Unity,github-for-unity/Unity,github-for-unity/Unity
src/tests/IntegrationTests/SetUpFixture.cs
src/tests/IntegrationTests/SetUpFixture.cs
using System; using GitHub.Unity; using NUnit.Framework; namespace IntegrationTests { [SetUpFixture] public class SetUpFixture { [SetUp] public void Setup() { Logging.TracingEnabled = true; Logging.LogAdapter = new MultipleLogAdapter( new FileLogAdapter($"..\\{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}-integration-tests.log") //, new ConsoleLogAdapter() ); } } }
using System; using GitHub.Unity; using NUnit.Framework; namespace IntegrationTests { [SetUpFixture] public class SetUpFixture { [SetUp] public void Setup() { Logging.TracingEnabled = true; Logging.LogAdapter = new MultipleLogAdapter( new FileLogAdapter($"..\\{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}-integration-tests.log") , new ConsoleLogAdapter() ); } } }
mit
C#
2525de24467f57006a875853deb8123fc8c1f6b1
Update kind functionapp -> functionappdev
projectkudu/AzureFunctions,agruning/azure-functions-ux,chunye/azure-functions-ux,agruning/azure-functions-ux,agruning/azure-functions-ux,projectkudu/AzureFunctions,projectkudu/AzureFunctions,projectkudu/WebJobsPortal,projectkudu/AzureFunctions,chunye/azure-functions-ux,projectkudu/WebJobsPortal,projectkudu/WebJobsPortal,agruning/azure-functions-ux,chunye/azure-functions-ux,projectkudu/WebJobsPortal,agruning/azure-functions-ux,chunye/azure-functions-ux,chunye/azure-functions-ux
AzureFunctions/Common/Constants.cs
AzureFunctions/Common/Constants.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace AzureFunctions.Common { public static class Constants { public const string SubscriptionTemplate = "{0}/subscriptions/{1}?api-version={2}"; public const string CSMApiVersion = "2014-04-01"; public const string CSMUrl = "https://management.azure.com"; public const string X_MS_OAUTH_TOKEN = "X-MS-OAUTH-TOKEN"; public const string ClientTokenHeader = "client-token"; public const string ApplicationJson = "application/json"; public const string AzureStorageAppSettingsName = "AzureWebJobsStorage"; public const string AzureStorageDashboardAppSettingsName = "AzureWebJobsDashboard"; public const string StorageConnectionStringTemplate = "DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}"; public const string PublishingUserName = "publishingUserName"; public const string PublishingPassword = "publishingPassword"; public const string FunctionsResourceGroupName = "AzureFunctions"; public const string FunctionsSitePrefix = "Functions"; public const string FunctionsStorageAccountNamePrefix = "AzureFunctions"; public const string UserAgent = "Functions/1.0"; public const string GeoRegion = "GeoRegion"; public const string WebAppArmType = "Microsoft.Web/sites"; public const string StorageAccountArmType = "Microsoft.Storage/storageAccounts"; public const string TryAppServiceResourceGroupPrefix = "TRY_RG_"; public const string TryAppServiceTenantId = "6224bcc1-1690-4d04-b905-92265f948dad"; public const string TryAppServiceCreateUrl = "https://tryappservice.azure.com/api/resource?x-ms-routing-name=next"; public const string SavedFunctionsContainer = "sfc"; public const string FunctionAppArmKind = "functionappdev"; public const string MetadataJson = "metadata.json"; public const string FunctionsExtensionVersion = "FUNCTIONS_EXTENSION_VERSION"; public const string Latest = "latest"; } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace AzureFunctions.Common { public static class Constants { public const string SubscriptionTemplate = "{0}/subscriptions/{1}?api-version={2}"; public const string CSMApiVersion = "2014-04-01"; public const string CSMUrl = "https://management.azure.com"; public const string X_MS_OAUTH_TOKEN = "X-MS-OAUTH-TOKEN"; public const string ClientTokenHeader = "client-token"; public const string ApplicationJson = "application/json"; public const string AzureStorageAppSettingsName = "AzureWebJobsStorage"; public const string AzureStorageDashboardAppSettingsName = "AzureWebJobsDashboard"; public const string StorageConnectionStringTemplate = "DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}"; public const string PublishingUserName = "publishingUserName"; public const string PublishingPassword = "publishingPassword"; public const string FunctionsResourceGroupName = "AzureFunctions"; public const string FunctionsSitePrefix = "Functions"; public const string FunctionsStorageAccountNamePrefix = "AzureFunctions"; public const string UserAgent = "Functions/1.0"; public const string GeoRegion = "GeoRegion"; public const string WebAppArmType = "Microsoft.Web/sites"; public const string StorageAccountArmType = "Microsoft.Storage/storageAccounts"; public const string TryAppServiceResourceGroupPrefix = "TRY_RG_"; public const string TryAppServiceTenantId = "6224bcc1-1690-4d04-b905-92265f948dad"; public const string TryAppServiceCreateUrl = "https://tryappservice.azure.com/api/resource?x-ms-routing-name=next"; public const string SavedFunctionsContainer = "sfc"; public const string FunctionAppArmKind = "functionapp"; public const string MetadataJson = "metadata.json"; public const string FunctionsExtensionVersion = "FUNCTIONS_EXTENSION_VERSION"; public const string Latest = "latest"; } }
apache-2.0
C#
6d1c15130aadd62ad8360881d1077202c7153827
Remove unnecessary code
DkoSoftware/WebPlataform,DkoSoftware/WebPlataform
FamintusApi/Controllers/ValuesController.cs
FamintusApi/Controllers/ValuesController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; namespace FamintusApi.Controllers { public class ValuesController : ApiController { // GET api/values public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; } // GET api/values/5 public string Get(int id) { return "value"; } // POST api/values public void Post([FromBody]string value) { } // PUT api/values/5 public void Put(int id, [FromBody]string value) { } // DELETE api/values/5 public void Delete(int id) { } } }
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; namespace FamintusApi.Controllers { public class ValuesController : ApiController { // GET api/values public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; } // GET api/values/5 public string Get(int id) { String value = null; if (value.IsNormalized()) { Console.WriteLine("Boo..."); } return "value"; } // POST api/values public void Post([FromBody]string value) { } // PUT api/values/5 public void Put(int id, [FromBody]string value) { } // DELETE api/values/5 public void Delete(int id) { } } }
mit
C#
a29ac5970b1b701fed715d77892e0b691ed5f961
Fix unit-test
SharpeRAD/Cake.Powershell,SharpeRAD/Cake.Powershell
src/PowerShell.Tests/Tests/FileTests.cs
src/PowerShell.Tests/Tests/FileTests.cs
#region Using Statements using Cake.Core.IO; using System.Linq; using System.Collections.ObjectModel; using System.Management.Automation; using Xunit; #endregion namespace Cake.Powershell.Tests { public class FileTests { [Fact] public void Should_Start_Local_File() { Collection<PSObject> results = CakeHelper.CreatePowershellRunner().Start(new FilePath("../../Scripts/Test.ps1"), new PowershellSettings()); Assert.True((results != null) && (results.Count > 0), "Check Rights"); } [Fact] public void Should_Start_File_With_Parameters() { Collection<PSObject> results = CakeHelper.CreatePowershellRunner().Start(new FilePath("../../Scripts/Test.ps1"), new PowershellSettings().WithArguments(args => args.Append("Service", "eventlog"))); Assert.True((results != null) && (results.Count >= 1), "Check Rights"); } [Fact] public void Should_Return_Result_With_Error_Code() { Collection<PSObject> results = CakeHelper.CreatePowershellRunner().Start(new FilePath("../../Scripts/FailingScript.ps1"), new PowershellSettings()); Assert.True(results != null && results.Count >= 1, "Check Rights"); Assert.True(results.FirstOrDefault(r => r.BaseObject.ToString().Contains("Cannot find path")) != null); Assert.Equal("1", results[0].BaseObject.ToString()); } /* [Fact] public void Should_Start_Remote_File() { Collection<PSObject> results = CakeHelper.CreatePowershellRunner().Start(new FilePath("../../Scripts/Test.ps1"), new PowershellSettings() { ComputerName = "remote-machine" }); Assert.True((results != null) && (results.Count > 0), "Check Rights"); } */ } }
#region Using Statements using Cake.Core.IO; using System.Collections.ObjectModel; using System.Management.Automation; using Xunit; #endregion namespace Cake.Powershell.Tests { public class FileTests { [Fact] public void Should_Start_Local_File() { Collection<PSObject> results = CakeHelper.CreatePowershellRunner().Start(new FilePath("../../Scripts/Test.ps1"), new PowershellSettings()); Assert.True((results != null) && (results.Count > 0), "Check Rights"); } [Fact] public void Should_Start_File_With_Parameters() { Collection<PSObject> results = CakeHelper.CreatePowershellRunner().Start(new FilePath("../../Scripts/Test.ps1"), new PowershellSettings().WithArguments(args => args.Append("Service", "eventlog"))); Assert.True((results != null) && (results.Count >= 1), "Check Rights"); } [Fact] public void Should_Return_Result_With_Error_Code() { Collection<PSObject> results = CakeHelper.CreatePowershellRunner().Start(new FilePath("../../Scripts/FailingScript.ps1"), new PowershellSettings()); Assert.True(results != null && results.Count == 1, "Check Rights"); Assert.Equal("1", results[0].BaseObject.ToString()); } /* [Fact] public void Should_Start_Remote_File() { Collection<PSObject> results = CakeHelper.CreatePowershellRunner().Start(new FilePath("../../Scripts/Test.ps1"), new PowershellSettings() { ComputerName = "remote-machine" }); Assert.True((results != null) && (results.Count > 0), "Check Rights"); } */ } }
mit
C#
53fd7588c4b606d30dbbd8da382a6101170adb49
Fix incorrect increment when assigning a new tick value [#18] (#20)
Mpdreamz/shellprogressbar
src/ShellProgressBar/ProgressBarBase.cs
src/ShellProgressBar/ProgressBarBase.cs
using System; using System.Collections.Concurrent; using System.Text; using System.Threading; namespace ShellProgressBar { public abstract class ProgressBarBase { static ProgressBarBase() { Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); } protected readonly DateTime _startDate = DateTime.Now; private int _maxTicks; private int _currentTick; private string _message; protected ProgressBarBase(int maxTicks, string message, ProgressBarOptions options) { this._maxTicks = Math.Max(0, maxTicks); this._message = message; this.Options = options ?? ProgressBarOptions.Default; } internal ProgressBarOptions Options { get; } internal ConcurrentBag<ChildProgressBar> Children { get; } = new ConcurrentBag<ChildProgressBar>(); protected abstract void DisplayProgress(); protected virtual void Grow(ProgressBarHeight direction) { } protected virtual void OnDone() { } public DateTime? EndTime { get; protected set; } public ConsoleColor ForeGroundColor => EndTime.HasValue ? this.Options.ForegroundColorDone ?? this.Options.ForegroundColor : this.Options.ForegroundColor; public int CurrentTick => _currentTick; public int MaxTicks { get => _maxTicks; set { Interlocked.Exchange(ref _maxTicks, value); DisplayProgress(); } } public string Message { get => _message; set { Interlocked.Exchange(ref _message, value); DisplayProgress(); } } public double Percentage { get { var percentage = Math.Max(0, Math.Min(100, (100.0 / this._maxTicks) * this._currentTick)); // Gracefully handle if the percentage is NaN due to division by 0 if (double.IsNaN(percentage) || percentage < 0) percentage = 100; return percentage; } } public bool Collapse => this.EndTime.HasValue && this.Options.CollapseWhenFinished; public ChildProgressBar Spawn(int maxTicks, string message, ProgressBarOptions options = null) { var pbar = new ChildProgressBar(maxTicks, message, DisplayProgress, options, this.Grow); this.Children.Add(pbar); DisplayProgress(); return pbar; } public void Tick(string message = null) { Interlocked.Increment(ref _currentTick); FinishTick(message); } public void Tick(int newTickCount, string message = null) { Interlocked.Exchange(ref _currentTick, newTickCount); FinishTick(message); } private void FinishTick(string message) { if (message != null) Interlocked.Exchange(ref _message, message); if (_currentTick >= _maxTicks) { this.EndTime = DateTime.Now; this.OnDone(); } DisplayProgress(); } } }
using System; using System.Collections.Concurrent; using System.Text; using System.Threading; namespace ShellProgressBar { public abstract class ProgressBarBase { static ProgressBarBase() { Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); } protected readonly DateTime _startDate = DateTime.Now; private int _maxTicks; private int _currentTick; private string _message; protected ProgressBarBase(int maxTicks, string message, ProgressBarOptions options) { this._maxTicks = Math.Max(0, maxTicks); this._message = message; this.Options = options ?? ProgressBarOptions.Default; } internal ProgressBarOptions Options { get; } internal ConcurrentBag<ChildProgressBar> Children { get; } = new ConcurrentBag<ChildProgressBar>(); protected abstract void DisplayProgress(); protected virtual void Grow(ProgressBarHeight direction) { } protected virtual void OnDone() { } public DateTime? EndTime { get; protected set; } public ConsoleColor ForeGroundColor => EndTime.HasValue ? this.Options.ForegroundColorDone ?? this.Options.ForegroundColor : this.Options.ForegroundColor; public int CurrentTick => _currentTick; public int MaxTicks { get => _maxTicks; set { Interlocked.Exchange(ref _maxTicks, value); DisplayProgress(); } } public string Message { get => _message; set { Interlocked.Exchange(ref _message, value); DisplayProgress(); } } public double Percentage { get { var percentage = Math.Max(0, Math.Min(100, (100.0 / this._maxTicks) * this._currentTick)); // Gracefully handle if the percentage is NaN due to division by 0 if (double.IsNaN(percentage) || percentage < 0) percentage = 100; return percentage; } } public bool Collapse => this.EndTime.HasValue && this.Options.CollapseWhenFinished; public ChildProgressBar Spawn(int maxTicks, string message, ProgressBarOptions options = null) { var pbar = new ChildProgressBar(maxTicks, message, DisplayProgress, options, this.Grow); this.Children.Add(pbar); DisplayProgress(); return pbar; } public void Tick(string message = null) { FinishTick(message); } public void Tick(int newTickCount, string message = null) { Interlocked.Exchange(ref _currentTick, newTickCount); FinishTick(message); } private void FinishTick(string message) { Interlocked.Increment(ref _currentTick); if (message != null) Interlocked.Exchange(ref _message, message); if (_currentTick >= _maxTicks) { this.EndTime = DateTime.Now; this.OnDone(); } DisplayProgress(); } } }
mit
C#
419ea36284692ab5245a1b285649167b2cb5a5c9
Remove row div.
strayfatty/ShowFeed,strayfatty/ShowFeed
src/ShowFeed/Views/Account/LogIn.cshtml
src/ShowFeed/Views/Account/LogIn.cshtml
@model ShowFeed.ViewModels.AccountLogInViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } <div class="page-header"> <h3>Log In</h3> </div> <form class="form-horizontal" action="@Url.RouteUrl("login")" method="post"> <div class="form-group"> @Html.LabelFor(m => m.Username, new { @class = "col-md-2 control-label" }) <div class="col-md-6"> @Html.TextBoxFor(m => m.Username, new { @class = "form-control", placeholder = "Username" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) <div class="col-md-6"> @Html.PasswordFor(m => m.Password, new { @class = "form-control", placeholder = "Password" }) </div> </div> <div class="col-md-8"> <button type="submit" class="btn btn-lg btn-primary btn-block">Log In</button> </div> </form>
@model ShowFeed.ViewModels.AccountLogInViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } <div class="page-header"> <h3>Log In</h3> </div> <div class="row"> <form class="form-horizontal" action="@Url.RouteUrl("login")" method="post"> <div class="form-group"> @Html.LabelFor(m => m.Username, new { @class = "col-md-2 control-label" }) <div class="col-md-6"> @Html.TextBoxFor(m => m.Username, new { @class = "form-control", placeholder = "Username" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) <div class="col-md-6"> @Html.PasswordFor(m => m.Password, new { @class = "form-control", placeholder = "Password" }) </div> </div> <div class="col-md-8"> <button type="submit" class="btn btn-lg btn-primary btn-block">Log In</button> </div> </form> </div>
mit
C#
b8e02ca7e4302116e747552ec9caa8a167ed6aaf
Bump version to 0.8
arnovb-github/CmcLibNet
Properties/AssemblyInfo.cs
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("CmcLibNet")] [assembly: AssemblyDescription("CmcLibNet is a .NET library for using the Commence RM API")] [assembly: AssemblyConfiguration("Beta release")] [assembly: AssemblyCompany("Vovin IT Services")] [assembly: AssemblyProduct("Vovin.CmcLibNet")] [assembly: AssemblyCopyright("© 2015-2019 - Vovin IT Services")] [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("596721c3-57e8-4cfa-931e-cf7118dd8ee6")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.0.0")] // [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyVersion("0.8.*")] //[assembly: AssemblyFileVersion("0.6.*")]
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("CmcLibNet")] [assembly: AssemblyDescription("CmcLibNet is a .NET library for using the Commence RM API")] [assembly: AssemblyConfiguration("Beta release")] [assembly: AssemblyCompany("Vovin IT Services")] [assembly: AssemblyProduct("Vovin.CmcLibNet")] [assembly: AssemblyCopyright("© 2015-2019 - Vovin IT Services")] [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("596721c3-57e8-4cfa-931e-cf7118dd8ee6")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.0.0")] // [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyVersion("0.7.*")] //[assembly: AssemblyFileVersion("0.6.*")]
mit
C#
0e82900753f66d61347a3356bd58f930677d7497
Update copyright
github/GitPad
Properties/AssemblyInfo.cs
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("Gitpad")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("GitHub")] [assembly: AssemblyProduct("Gitpad")] [assembly: AssemblyCopyright("Copyright © GitHub 2011-2012")] [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("ea27d850-aefe-4def-95eb-b0009789c585")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.3.0.0")] [assembly: AssemblyFileVersion("1.3.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("Gitpad")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("GitHub")] [assembly: AssemblyProduct("Gitpad")] [assembly: AssemblyCopyright("Copyright © GitHub 2011")] [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("ea27d850-aefe-4def-95eb-b0009789c585")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.3.0.0")] [assembly: AssemblyFileVersion("1.3.0.0")]
mit
C#
3cf61dce7b5c66778bcaa9312f73efe1ee83a491
Move hardcoded values into static fields
billboga/silverpop-dotnet-api,kendaleiv/silverpop-dotnet-api,kendaleiv/silverpop-dotnet-api,ritterim/silverpop-dotnet-api
test/Silverpop.Core.Performance/Program.cs
test/Silverpop.Core.Performance/Program.cs
using System; using System.Collections.Generic; using System.Linq; namespace Silverpop.Core.Performance { internal class Program { private static IEnumerable<int> TestRecipientCounts = new List<int>() { 1000000, 5000000, }; private static int TestRecipientsPerBatch = 5000; private static void Main(string[] args) { var tagValue = new string( Enumerable.Repeat("ABC", 1000) .SelectMany(x => x) .ToArray()); var personalizationTags = new TestPersonalizationTags() { TagA = tagValue, TagB = tagValue, TagC = tagValue, TagD = tagValue, TagE = tagValue, TagF = tagValue, TagG = tagValue, TagH = tagValue, TagI = tagValue, TagJ = tagValue, TagK = tagValue, TagL = tagValue, TagM = tagValue, TagN = tagValue, TagO = tagValue }; var numberOfTags = personalizationTags.GetType().GetProperties().Count(); foreach (var testRecipientCount in TestRecipientCounts) { Console.WriteLine( "Testing {0} recipients with {1} tags using batches of {2}:", testRecipientCount, numberOfTags, TestRecipientsPerBatch); new TransactMessagePerformance() .InvokeGetRecipientBatchedMessages( testRecipientCount, TestRecipientsPerBatch, personalizationTags); } Console.ReadLine(); } } }
using System; using System.Collections.Generic; using System.Linq; namespace Silverpop.Core.Performance { internal class Program { private static void Main(string[] args) { var tagValue = new string( Enumerable.Repeat("ABC", 1000) .SelectMany(x => x) .ToArray()); var personalizationTags = new TestPersonalizationTags() { TagA = tagValue, TagB = tagValue, TagC = tagValue, TagD = tagValue, TagE = tagValue, TagF = tagValue, TagG = tagValue, TagH = tagValue, TagI = tagValue, TagJ = tagValue, TagK = tagValue, TagL = tagValue, TagM = tagValue, TagN = tagValue, TagO = tagValue }; var numberOfTags = personalizationTags.GetType().GetProperties().Count(); Console.WriteLine("Testing 1 million recipients with {0} tags using batches of 5000:", numberOfTags); new TransactMessagePerformance() .InvokeGetRecipientBatchedMessages(1000000, 5000, personalizationTags); Console.WriteLine("Testing 5 million recipients with {0} tags using batches of 5000:", numberOfTags); new TransactMessagePerformance() .InvokeGetRecipientBatchedMessages(5000000, 5000, personalizationTags); Console.ReadLine(); } } }
mit
C#
a6482210026a85a1897776dfbf5c41519aa44f77
Add SupportedInterface strings to allow discovery. Including VideoApp for new directive.
stoiveyp/alexa-skills-dotnet,timheuer/alexa-skills-dotnet
Alexa.NET/Request/SupportedInterfaces.cs
Alexa.NET/Request/SupportedInterfaces.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Alexa.NET.Request { public static class SupportedInterfaces { public const string Display = "Display"; public const string AudioPlayer = "AudioPlayer"; public const string VideoApp = "VideoApp"; } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Alexa.NET.Request { public class SupportedInterfaces { } }
mit
C#
c539d01c1726bded71e3f6d32210b9a520ca7c91
Fix test for 64-bit platforms
cshung/coreclr,cshung/coreclr,wtgodbe/coreclr,poizan42/coreclr,wtgodbe/coreclr,poizan42/coreclr,wtgodbe/coreclr,krk/coreclr,poizan42/coreclr,wtgodbe/coreclr,cshung/coreclr,krk/coreclr,poizan42/coreclr,krk/coreclr,krk/coreclr,poizan42/coreclr,wtgodbe/coreclr,krk/coreclr,cshung/coreclr,krk/coreclr,wtgodbe/coreclr,cshung/coreclr,poizan42/coreclr,cshung/coreclr
tests/src/JIT/Methodical/largeframes/skip4/skippage4.cs
tests/src/JIT/Methodical/largeframes/skip4/skippage4.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. // Passing a very large struct by value on the stack, on arm32 and x86, // can cause it to be copied from a temp to the outgoing space without // probing the stack. using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; namespace BigFrames { [StructLayout(LayoutKind.Explicit)] public struct LargeStructWithRef { [FieldOffset(0)] public int i1; [FieldOffset(65496)] // Must be 8-byte aligned for test to work on 64-bit platforms. public Object o1; } public class Test { public static int iret = 1; [MethodImplAttribute(MethodImplOptions.NoInlining)] public static void TestWrite(LargeStructWithRef s) { Console.Write("Enter TestWrite: "); Console.WriteLine(s.o1.GetHashCode()); iret = 100; } [MethodImplAttribute(MethodImplOptions.NoInlining)] public static void Test1() { Console.WriteLine("Enter Test1"); LargeStructWithRef s = new LargeStructWithRef(); s.o1 = new Object(); TestWrite(s); } public static int Main() { Test1(); if (iret == 100) { Console.WriteLine("TEST PASSED"); } else { Console.WriteLine("TEST FAILED"); } return iret; } } }
// 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. // Passing a very large struct by value on the stack, on arm32 and x86, // can cause it to be copied from a temp to the outgoing space without // probing the stack. using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; namespace BigFrames { [StructLayout(LayoutKind.Explicit)] public struct LargeStructWithRef { [FieldOffset(0)] public int i1; [FieldOffset(65500)] public Object o1; } public class Test { public static int iret = 1; [MethodImplAttribute(MethodImplOptions.NoInlining)] public static void TestWrite(LargeStructWithRef s) { Console.Write("Enter TestWrite: "); Console.WriteLine(s.o1.GetHashCode()); iret = 100; } [MethodImplAttribute(MethodImplOptions.NoInlining)] public static void Test1() { Console.WriteLine("Enter Test1"); LargeStructWithRef s = new LargeStructWithRef(); s.o1 = new Object(); TestWrite(s); } public static int Main() { Test1(); if (iret == 100) { Console.WriteLine("TEST PASSED"); } else { Console.WriteLine("TEST FAILED"); } return iret; } } }
mit
C#
c30096580813d0d0d9655d0e7cbe9fbc652aef57
Add slot for datasource
tobyclh/UnityCNTK,tobyclh/UnityCNTK
Assets/UnityCNTK/Scripts/Models/Model.cs
Assets/UnityCNTK/Scripts/Models/Model.cs
using System.Collections; using System.Collections.Generic; using UnityEngine.Assertions; using System.Linq; using UnityEngine; using System.Timers; using System.Threading; using System.Threading.Tasks; using CNTK; using System; using UnityEngine.Events; namespace UnityCNTK { /// <summary> /// Base class for all models /// currently only SISO (Single In Single Out) model is supported, which should cover most cases /// </summary> public class Model<U, V> : _Model { public DataSource<U> dataSource; public virtual async Task<V> Evaluate(U input) { if (!isReady) { Debug.LogError("A model can only evaluate 1 object at a time"); } isReady = false; var inputVal = OnPreprocess(input); if (function == null) LoadModel(); Assert.IsNotNull(function); var output = await Task.Run(() => { Debug.Log("Evaluation"); var outputPair = new Dictionary<Variable, Value>() { { function.Output, null } }; var variable = function.Arguments.Single(); var inputPair = new Dictionary<Variable, Value>() { { variable, inputVal } }; function.Evaluate(inputPair, outputPair, CNTKManager.device); var _output = OnPostProcess(outputPair.Single().Value); isReady = true; return _output; }); return output; } public virtual Value OnPreprocess(U input) { throw new NotImplementedException(); } public virtual V OnPostProcess(Value output) { throw new NotImplementedException(); } } }
using System.Collections; using System.Collections.Generic; using UnityEngine.Assertions; using System.Linq; using UnityEngine; using System.Timers; using System.Threading; using System.Threading.Tasks; using CNTK; using System; using UnityEngine.Events; namespace UnityCNTK { /// <summary> /// Base class for all models /// currently only SISO (Single In Single Out) model is supported, which should cover most cases /// </summary> public class Model<U, V> : _Model { public virtual async Task<V> Evaluate(U input) { if (!isReady) { Debug.LogError("A model can only evaluate 1 object at a time"); } isReady = false; var inputVal = OnPreprocess(input); if (function == null) LoadModel(); Assert.IsNotNull(function); var output = await Task.Run(() => { Debug.Log("Evaluation"); var outputPair = new Dictionary<Variable, Value>() { { function.Output, null } }; var variable = function.Arguments.Single(); var inputPair = new Dictionary<Variable, Value>() { { variable, inputVal } }; function.Evaluate(inputPair, outputPair, CNTKManager.device); var _output = OnPostProcess(outputPair.Single().Value); isReady = true; return _output; }); return output; } public virtual Value OnPreprocess(U input) { throw new NotImplementedException(); } public virtual V OnPostProcess(Value output) { throw new NotImplementedException(); } } }
mit
C#
f3695cde54df4f7cc1ad98827628905cff2e3e34
Fix typo.
Invenietis/CK-AspNet-Auth,Invenietis/CK-AspNet-Auth,Invenietis/CK-AspNet-Auth,Invenietis/CK-AspNet-Auth
CK.AspNet.Auth/Extensions/IWebFrontAuthDynamicScopeProvider.cs
CK.AspNet.Auth/Extensions/IWebFrontAuthDynamicScopeProvider.cs
using CK.Auth; using CK.Core; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace CK.AspNet.Auth { /// <summary> /// Optional service that can handle dynamic scopes. /// </summary> public interface IWebFrontAuthDynamicScopeProvider : ISingletonAutoService { /// <summary> /// Called at the start of the external login flow. /// </summary> /// <param name="m">The monitor to use.</param> /// <param name="context">The context.</param> /// <returns>Scopes that should be submitted.</returns> Task<string[]> GetScopesAsync( IActivityMonitor m, WebFrontAuthStartLoginContext context ); /// <summary> /// Called once the authentication ticket has been received and scopes accepted or rejected by the user. /// </summary> /// <param name="m">The monitor to use.</param> /// <param name="c">Current http context.</param> /// <param name="current">Authenticated user information.</param> /// <param name="scopes">The scopes that have been accepted.</param> /// <returns>The awaitable.</returns> Task SetReceivedScopesAsync( IActivityMonitor m, HttpContext c, IAuthenticationInfo current, IReadOnlyList<string> scopes ); } }
using CK.Auth; using CK.Core; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace CK.AspNet.Auth { /// <summary> /// Optional service that can handle dynamic scopes. /// </summary> public interface IWebFrontAuthDynamicScopeProvider : ISingletonAutoService { /// <summary> /// Called at the start of the external login flow. /// </summary> /// <param name="m">The monitor to use.</param> /// <param name="context">The context.</param> /// <returns>Scopes that should be submitted.</returns> Task<string[]> GetScopesAsync( IActivityMonitor m, WebFrontAuthStartLoginContext context ); /// <summary> /// Called once the authentication ticket has been received and scopes accepted or rejected by the user. /// </summary> /// <param name="m">The monitor to use.</param> /// <param name="c">Current http context.</param> /// <param name="current">Authenticated user information.</param> /// <param name="scopes">The scopes that have been accepted.</param> /// <returns>The awaitable.</returns> Task SetReveivedScopesAsync( IActivityMonitor m, HttpContext c, IAuthenticationInfo current, IReadOnlyList<string> scopes ); } }
mit
C#
85e733933c03d2a5a2b69b36c684bb6295fe04f3
Fix teamcity build
martin211/aimp_dotnet,martin211/aimp_dotnet,martin211/aimp_dotnet,martin211/aimp_dotnet,martin211/aimp_dotnet
build/GitVersion/GitVersionAttribute2.cs
build/GitVersion/GitVersionAttribute2.cs
// ---------------------------------------------------- // // AIMP DotNet SDK // // Copyright (c) 2014 - 2020 Evgeniy Bogdan // https://github.com/martin211/aimp_dotnet // // Mail: mail4evgeniy@gmail.com // // ---------------------------------------------------- using System.Reflection; using Nuke.Common.CI.AppVeyor; using Nuke.Common.CI.AzurePipelines; using Nuke.Common.CI.TeamCity; using Nuke.Common.Tooling; using Nuke.Common.Tools.GitVersion; namespace Aimp.DotNet.Build { public class GitVersion2Attribute : GitVersionAttribute { public string UserName { get; set; } public string Password { get; set; } public GitVersion2Attribute() { Framework = "netcoreapp3.1"; } public override object GetValue(MemberInfo member, object instance) { var gitVersion = GitVersionTasks.GitVersion(s => s .SetFramework(Framework) .SetNoFetch(NoFetch) .DisableLogOutput() .SetUsername(UserName) .SetPassword(Password) .SetOutput(GitVersionOutput.buildserver) .SetUpdateAssemblyInfo(UpdateAssemblyInfo)) .Result; if (UpdateBuildNumber) { AzurePipelines.Instance?.UpdateBuildNumber(gitVersion.FullSemVer); TeamCity.Instance?.SetBuildNumber(gitVersion.FullSemVer); AppVeyor.Instance?.UpdateBuildNumber($"{gitVersion.FullSemVer}.build.{AppVeyor.Instance.BuildNumber}"); } return gitVersion; } } }
// ---------------------------------------------------- // // AIMP DotNet SDK // // Copyright (c) 2014 - 2020 Evgeniy Bogdan // https://github.com/martin211/aimp_dotnet // // Mail: mail4evgeniy@gmail.com // // ---------------------------------------------------- using System.Reflection; using Nuke.Common.CI.AppVeyor; using Nuke.Common.CI.AzurePipelines; using Nuke.Common.CI.TeamCity; using Nuke.Common.Tooling; using Nuke.Common.Tools.GitVersion; namespace Aimp.DotNet.Build { public class GitVersion2Attribute : GitVersionAttribute { public string UserName { get; set; } public string Password { get; set; } public GitVersion2Attribute() { Framework = "netcoreapp3.1"; } public override object GetValue(MemberInfo member, object instance) { var gitVersion = GitVersionTasks.GitVersion(s => s .SetFramework(Framework) .SetNoFetch(NoFetch) .DisableLogOutput() .SetUsername(UserName) .SetPassword(Password) .SetUpdateAssemblyInfo(UpdateAssemblyInfo)) .Result; if (UpdateBuildNumber) { AzurePipelines.Instance?.UpdateBuildNumber(gitVersion.FullSemVer); TeamCity.Instance?.SetBuildNumber(gitVersion.FullSemVer); AppVeyor.Instance?.UpdateBuildNumber($"{gitVersion.FullSemVer}.build.{AppVeyor.Instance.BuildNumber}"); } return gitVersion; } } }
apache-2.0
C#
900bc3146cf986948dcba649e87a1b0b6f1638a3
clear guild members on different task to avoid deadlocks
Foglio1024/Tera-custom-cooldowns,Foglio1024/Tera-custom-cooldowns
TCC.Core/Data/GuildInfo.cs
TCC.Core/Data/GuildInfo.cs
using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Nostrum; using TeraDataLite; namespace TCC.Data { public class GuildInfo { public bool InGuild { get; private set; } public GuildMemberData Master { get; private set; } public TSObservableCollection<GuildMemberData> Members { get; private set; } = new TSObservableCollection<GuildMemberData>(); public bool AmIMaster { get; private set; } public string NameOf(uint id) { var found = Members.ToSyncList().FirstOrDefault(m => m.PlayerId == id); return found.Name != "" ? found.Name : "Unknown player"; } public void Set(List<GuildMemberData> mMembers, uint masterId, string masterName) { mMembers.ForEach(m => { if (Has(m.Name)) return; Members.Add(m); }); //var toRemove = new List<GuildMemberData>(); //Members.ToSyncList().ForEach(m => //{ // if (mMembers.All(f => f.PlayerId != m.PlayerId)) toRemove.Add(m); //}); //toRemove.ForEach(m => Members.Remove(m)); InGuild = true; SetMaster(masterId, masterName); } public bool Has(string name) { return Members.ToSyncList().Any(m => m.Name == name); } public void Clear() { Task.Run(() => Members.Clear()); InGuild = false; Master = default; AmIMaster = false; } public void SetMaster(uint playerId, string playerName) { Master = new GuildMemberData { Name = playerName, PlayerId = playerId }; AmIMaster = Master.Name == Game.Me.Name; } } }
using System.Collections.Generic; using System.Linq; using Nostrum; using TeraDataLite; namespace TCC.Data { public class GuildInfo { public bool InGuild { get; private set; } public GuildMemberData Master { get; private set; } public TSObservableCollection<GuildMemberData> Members { get; private set; } = new TSObservableCollection<GuildMemberData>(); public bool AmIMaster { get; private set; } public string NameOf(uint id) { var found = Members.ToSyncList().FirstOrDefault(m => m.PlayerId == id); return found.Name != "" ? found.Name : "Unknown player"; } public void Set(List<GuildMemberData> mMembers, uint masterId, string masterName) { mMembers.ForEach(m => { if (Has(m.Name)) return; Members.Add(m); }); //var toRemove = new List<GuildMemberData>(); //Members.ToSyncList().ForEach(m => //{ // if (mMembers.All(f => f.PlayerId != m.PlayerId)) toRemove.Add(m); //}); //toRemove.ForEach(m => Members.Remove(m)); InGuild = true; SetMaster(masterId, masterName); } public bool Has(string name) { return Members.ToSyncList().Any(m => m.Name == name); } public void Clear() { Members.Clear(); InGuild = false; Master = default; AmIMaster = false; } public void SetMaster(uint playerId, string playerName) { Master = new GuildMemberData { Name = playerName, PlayerId = playerId }; AmIMaster = Master.Name == Game.Me.Name; } } }
mit
C#
2d544cbe3933a5b6baeaa247fa2a294b49e44e40
Update PlusPersonResponse.cs
pdcdeveloper/QpGoogleApi
OAuth/Models/PlusPersonResponse.cs
OAuth/Models/PlusPersonResponse.cs
/* Date : Monday, June 13, 2016 Author : pdcdeveloper (https://github.com/pdcdeveloper) Objective : Version : 1.0 */ using Newtonsoft.Json; namespace QPGoogleAPI.OAuth.Models { /// /// <remarks> /// /// Scopes: /// https://www.googleapis.com/auth/userinfo.profile /// https://www.googleapis.com/auth/userinfo.email /// /// GET https://www.googleapis.com/plus/v1/people/me /// /// </remarks> /// public class PlusPersonResponse { // // Always "plus#person" // [JsonProperty("kind")] public string Kind { get; set; } [JsonProperty("displayName")] public string DisplayName { get; set; } [JsonProperty("name")] public Name Name { get; set; } [JsonProperty("language")] public string Language { get; set; } [JsonProperty("isPlusUser")] public bool IsPlusUser { get; set; } [JsonProperty("image")] public Image Image { get; set; } [JsonProperty("emails")] public Emails[] Emails { get; set; } [JsonProperty("etag")] public string Etag { get; set; } [JsonProperty("verified")] public bool Verified { get; set; } [JsonProperty("id")] public string Id { get; set; } [JsonProperty("objectType")] public string ObjectType { get; set; } } public class Name { [JsonProperty("givenName")] public string GivenName { get; set; } [JsonProperty("familyName")] public string FamilyName { get; set; } } public class Image { [JsonProperty("url")] public string Url { get; set; } [JsonProperty("isDefault")] public bool IsDefault { get; set; } } public class Emails { [JsonProperty("type")] public string Type { get; set; } [JsonProperty("value")] public string Value { get; set; } } }
/* Date : Monday, June 13, 2016 Author : QualiP (https://github.com/QualiP) Objective : Version : 1.0 */ using Newtonsoft.Json; namespace QPGoogleAPI.OAuth.Models { /// /// <remarks> /// /// Scopes: /// https://www.googleapis.com/auth/userinfo.profile /// https://www.googleapis.com/auth/userinfo.email /// /// GET https://www.googleapis.com/plus/v1/people/me /// /// </remarks> /// public class PlusPersonResponse { // // Always "plus#person" // [JsonProperty("kind")] public string Kind { get; set; } [JsonProperty("displayName")] public string DisplayName { get; set; } [JsonProperty("name")] public Name Name { get; set; } [JsonProperty("language")] public string Language { get; set; } [JsonProperty("isPlusUser")] public bool IsPlusUser { get; set; } [JsonProperty("image")] public Image Image { get; set; } [JsonProperty("emails")] public Emails[] Emails { get; set; } [JsonProperty("etag")] public string Etag { get; set; } [JsonProperty("verified")] public bool Verified { get; set; } [JsonProperty("id")] public string Id { get; set; } [JsonProperty("objectType")] public string ObjectType { get; set; } } public class Name { [JsonProperty("givenName")] public string GivenName { get; set; } [JsonProperty("familyName")] public string FamilyName { get; set; } } public class Image { [JsonProperty("url")] public string Url { get; set; } [JsonProperty("isDefault")] public bool IsDefault { get; set; } } public class Emails { [JsonProperty("type")] public string Type { get; set; } [JsonProperty("value")] public string Value { get; set; } } }
mit
C#
bfb3a81ff197ac20b2c10d8c2ba1c3b44657a32c
Use expression bodied function
githuis/BolTDL,githuis/BolTDL
BolTDL/BolTDLCore.NetStandard/ToDoList.cs
BolTDL/BolTDLCore.NetStandard/ToDoList.cs
using System.Collections.Generic; using BolTDLCore.NetStandard.Tasks; using Newtonsoft.Json; namespace BolTDLCore.NetStandard { public class ToDoList { [JsonProperty("listtitle")] public string Name { get; private set; } public int Length => Tasks.Count; public List<BolTask> GetAllTasks => Tasks; private List<BolTask> Tasks; [JsonConstructor] public ToDoList() { Tasks = new List<BolTask>(); } public ToDoList(string name) { Tasks = new List<BolTask>(); Name = name; } public void SetName(string newName) { Name = newName; } public void AddTask(BolTask tsk) { //TODO Validate input? Tasks.Add(tsk); } public BolTask GetTaskAt(int index) { return Tasks[index]; } public void DeleteTaskAt (int index) { Tasks.RemoveAt(index); } } }
using System.Collections.Generic; using BolTDLCore.NetStandard.Tasks; using Newtonsoft.Json; namespace BolTDLCore.NetStandard { public class ToDoList { [JsonProperty("listtitle")] public string Name { get; private set; } public int Length { get { return Tasks.Count; } } public List<BolTask> GetAllTasks { get { return Tasks; } } private List<BolTask> Tasks; [JsonConstructor] public ToDoList() { Tasks = new List<BolTask>(); } public ToDoList(string name) { Tasks = new List<BolTask>(); Name = name; } public void SetName(string newName) { Name = newName; } public void AddTask(BolTask tsk) { //TODO Validate input? Tasks.Add(tsk); } public BolTask GetTaskAt(int index) { return Tasks[index]; } public void DeleteTaskAt (int index) { Tasks.RemoveAt(index); } } }
mit
C#