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 |
---|---|---|---|---|---|---|---|---|
5382706466d36bdd02a000f0a9928c909f2df114
|
test fix
|
fschwiet/DreamNJasmine
|
NJasmine.Tests/PassingFixtures/test_name_joins_specification.cs
|
NJasmine.Tests/PassingFixtures/test_name_joins_specification.cs
|
using NJasmine;
using NUnit.Framework;
namespace NJasmineTests.PassingFixtures
{
[Explicit]
[RunExternal(true, ExpectedStrings = new string[]
{
@"NJasmineTests.PassingFixtures.test_name_joins_specification, simple test",
@"NJasmineTests.PassingFixtures.test_name_joins_specification, simple describe, simple test",
})]
public class test_name_joins_specification : NJasmineFixture
{
public override void Specify()
{
it("simple test");
describe("simple describe", delegate
{
it("simple test");
});
}
}
}
|
using NJasmine;
using NUnit.Framework;
namespace NJasmineTests.PassingFixtures
{
[Explicit]
[RunExternal(true, ExpectedStrings = new string[]
{
@"NJasmineTests.FailingFixtures.test_name_joins_specification, simple test",
@"NJasmineTests.FailingFixtures.test_name_joins_specification, simple describe, simple test",
})]
public class test_name_joins_specification : NJasmineFixture
{
public override void Specify()
{
it("simple test");
describe("simple describe", delegate
{
it("simple test");
});
}
}
}
|
mit
|
C#
|
f16a415fe784efc36745e049e28fe51f2794c8f9
|
Add 'fix squiggly' to the test case
|
karthiknadig/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,karthiknadig/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,karthiknadig/RTVS,AlexanderSher/RTVS,AlexanderSher/RTVS,AlexanderSher/RTVS,MikhailArkhipov/RTVS,MikhailArkhipov/RTVS,karthiknadig/RTVS,AlexanderSher/RTVS,AlexanderSher/RTVS,MikhailArkhipov/RTVS,MikhailArkhipov/RTVS,MikhailArkhipov/RTVS
|
src/R/Editor/Application.Test/Validation/ErrorTagTest.cs
|
src/R/Editor/Application.Test/Validation/ErrorTagTest.cs
|
using System.Diagnostics.CodeAnalysis;
using Microsoft.R.Editor.Application.Test.TestShell;
using Microsoft.R.Editor.ContentType;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.R.Editor.Application.Test.Validation {
[ExcludeFromCodeCoverage]
[TestClass]
public class ErrorTagTest {
[TestMethod]
[TestCategory("Interactive")]
public void R_ErrorTagsTest01() {
using (var script = new TestScript(RContentTypeDefinition.ContentType)) {
// Force tagger creation
var tagSpans = script.GetErrorTagSpans();
script.Type("x <- {");
script.Delete();
script.DoIdle(500);
tagSpans = script.GetErrorTagSpans();
string errorTags = script.WriteErrorTags(tagSpans);
Assert.AreEqual("[5 - 6] } expected\r\n", errorTags);
script.Type("}");
script.DoIdle(500);
tagSpans = script.GetErrorTagSpans();
Assert.AreEqual(0, tagSpans.Count);
}
}
}
}
|
using System.Diagnostics.CodeAnalysis;
using Microsoft.R.Editor.Application.Test.TestShell;
using Microsoft.R.Editor.ContentType;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.R.Editor.Application.Test.Validation {
[ExcludeFromCodeCoverage]
[TestClass]
public class ErrorTagTest {
[TestMethod]
[TestCategory("Interactive")]
public void R_ErrorTagsTest01() {
using (var script = new TestScript(RContentTypeDefinition.ContentType)) {
// Force tagger creation
var tagSpans = script.GetErrorTagSpans();
script.Type("x <- {");
script.Delete();
script.DoIdle(500);
tagSpans = script.GetErrorTagSpans();
string errorTags = script.WriteErrorTags(tagSpans);
Assert.AreEqual("[5 - 6] } expected\r\n", errorTags);
}
}
}
}
|
mit
|
C#
|
8b4fcf1a0896d7b35c0e4a3efae74d0fbcff19bf
|
Fix direction icons (#10592)
|
space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14
|
Content.Client/UserInterface/Controls/DirectionIcon.cs
|
Content.Client/UserInterface/Controls/DirectionIcon.cs
|
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
namespace Content.Client.UserInterface.Controls;
/// <summary>
/// Simple control that shows an arrow pointing in some direction.
/// </summary>
/// <remarks>
/// The actual arrow and other icons are defined in the style sheet.
/// </remarks>
public sealed class DirectionIcon : TextureRect
{
public static string StyleClassDirectionIconArrow = "direction-icon-arrow"; // south pointing arrow
public static string StyleClassDirectionIconHere = "direction-icon-here"; // "you have reached your destination"
public static string StyleClassDirectionIconUnknown = "direction-icon-unknown"; // unknown direction / error
private Angle? _rotation;
public Angle? Rotation
{
get => _rotation;
set
{
_rotation = value;
SetOnlyStyleClass(value == null ? StyleClassDirectionIconUnknown : StyleClassDirectionIconArrow);
}
}
public DirectionIcon()
{
Stretch = StretchMode.KeepAspectCentered;
SetOnlyStyleClass(StyleClassDirectionIconUnknown);
}
public DirectionIcon(Direction direction) : this()
{
Rotation = direction.ToAngle();
}
/// <summary>
/// Creates an icon with an arrow pointing in some direction.
/// </summary>
/// <param name="direction">The direction</param>
/// <param name="relativeAngle">The relative angle. This may be the players eye rotation, the grid rotation, or
/// maybe the world rotation of the entity that owns some BUI</param>
/// <param name="snap">If true, will snap the nearest cardinal or diagonal direction</param>
/// <param name="minDistance">If the distance is less than this, the arrow icon will be replaced by some other indicator</param>
public DirectionIcon(Vector2 direction, Angle relativeAngle, bool snap, float minDistance = 0.1f) : this()
{
if (direction.EqualsApprox(Vector2.Zero, minDistance))
{
SetOnlyStyleClass(StyleClassDirectionIconHere);
return;
}
var rotation = direction.ToWorldAngle() - relativeAngle;
Rotation = snap ? rotation.GetDir().ToAngle() : rotation;
}
protected override void Draw(DrawingHandleScreen handle)
{
if (_rotation != null)
{
var offset = (-_rotation.Value).RotateVec(Size * UIScale / 2) - Size * UIScale / 2;
handle.SetTransform(Matrix3.CreateTransform(GlobalPixelPosition - offset, -_rotation.Value));
}
base.Draw(handle);
}
}
|
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
namespace Content.Client.UserInterface.Controls;
/// <summary>
/// Simple control that shows an arrow pointing in some direction.
/// </summary>
/// <remarks>
/// The actual arrow and other icons are defined in the style sheet.
/// </remarks>
public sealed class DirectionIcon : TextureRect
{
public static string StyleClassDirectionIconArrow = "direction-icon-arrow"; // south pointing arrow
public static string StyleClassDirectionIconHere = "direction-icon-here"; // "you have reached your destination"
public static string StyleClassDirectionIconUnknown = "direction-icon-unknown"; // unknown direction / error
private Angle? _rotation;
public Angle? Rotation
{
get => _rotation;
set
{
_rotation = value;
SetOnlyStyleClass(value == null ? StyleClassDirectionIconUnknown : StyleClassDirectionIconArrow);
}
}
public DirectionIcon()
{
Stretch = StretchMode.KeepAspectCentered;
SetOnlyStyleClass(StyleClassDirectionIconUnknown);
}
public DirectionIcon(Direction direction) : this()
{
Rotation = direction.ToAngle();
}
/// <summary>
/// Creates an icon with an arrow pointing in some direction.
/// </summary>
/// <param name="direction">The direction</param>
/// <param name="relativeAngle">The relative angle. This may be the players eye rotation, the grid rotation, or
/// maybe the world rotation of the entity that owns some BUI</param>
/// <param name="snap">If true, will snap the nearest cardinal or diagonal direction</param>
/// <param name="minDistance">If the distance is less than this, the arrow icon will be replaced by some other indicator</param>
public DirectionIcon(Vector2 direction, Angle relativeAngle, bool snap, float minDistance = 0.1f) : this()
{
if (direction.EqualsApprox(Vector2.Zero, minDistance))
{
SetOnlyStyleClass(StyleClassDirectionIconHere);
return;
}
var rotation = direction.ToWorldAngle() - relativeAngle;
Rotation = snap ? rotation.GetDir().ToAngle() : rotation;
}
protected override void Draw(DrawingHandleScreen handle)
{
if (_rotation != null)
{
var offset = (-_rotation.Value).RotateVec(Size * UIScale / 2) - Size * UIScale / 2;
handle.SetTransform(Matrix3.CreateTransform(GlobalPixelPosition - offset, -_rotation.Value));
}
handle.SetTransform(Matrix3.Identity);
base.Draw(handle);
}
}
|
mit
|
C#
|
8093645ae7a8be223af4a43cdd21eccf90964ff9
|
Allow the scope popping code to work correctly when all you have is the Interface.
|
gordonwatts/LINQtoROOT,gordonwatts/LINQtoROOT,gordonwatts/LINQtoROOT
|
LINQToTTree/LinqToTTreeInterfacesLib/IGeneratedCode.cs
|
LINQToTTree/LinqToTTreeInterfacesLib/IGeneratedCode.cs
|
namespace LinqToTTreeInterfacesLib
{
/// <summary>
/// Interface for implementing an object that will contain a complete single query
/// </summary>
public interface IGeneratedCode
{
/// <summary>
/// Add a new statement to the current spot where the "writing" currsor is pointed.
/// </summary>
/// <param name="s"></param>
void Add(IStatement s);
/// <summary>
/// Book a variable at the inner most scope
/// </summary>
/// <param name="v"></param>
void Add(IVariable v);
/// <summary>
/// This variable's inital value is "complex" and must be transfered over the wire in some way other than staight into the code
/// (for example, a ROOT object that needs to be written to a TFile).
/// </summary>
/// <param name="v"></param>
void QueueForTransfer(string key, object value);
/// <summary>
/// Returns the outter most coding block
/// </summary>
IBookingStatementBlock CodeBody { get; }
/// <summary>
/// Adds an include file to be included for this query's C++ file.
/// </summary>
/// <param name="filename"></param>
void AddIncludeFile(string filename);
/// <summary>
/// Set the result of the current code contex.
/// </summary>
/// <param name="result"></param>
void SetResult(IVariable result);
/// <summary>
/// Returns the value that is the result of this calculation.
/// </summary>
IVariable ResultValue { get; }
/// <summary>
/// Get/Set teh current scope...
/// </summary>
object CurrentScope { get; set; }
}
}
|
namespace LinqToTTreeInterfacesLib
{
/// <summary>
/// Interface for implementing an object that will contain a complete single query
/// </summary>
public interface IGeneratedCode
{
/// <summary>
/// Add a new statement to the current spot where the "writing" currsor is pointed.
/// </summary>
/// <param name="s"></param>
void Add(IStatement s);
/// <summary>
/// Book a variable at the inner most scope
/// </summary>
/// <param name="v"></param>
void Add(IVariable v);
/// <summary>
/// This variable's inital value is "complex" and must be transfered over the wire in some way other than staight into the code
/// (for example, a ROOT object that needs to be written to a TFile).
/// </summary>
/// <param name="v"></param>
void QueueForTransfer(string key, object value);
/// <summary>
/// Returns the outter most coding block
/// </summary>
IBookingStatementBlock CodeBody { get; }
/// <summary>
/// Adds an include file to be included for this query's C++ file.
/// </summary>
/// <param name="filename"></param>
void AddIncludeFile(string filename);
/// <summary>
/// Set the result of the current code contex.
/// </summary>
/// <param name="result"></param>
void SetResult(IVariable result);
/// <summary>
/// Returns the value that is the result of this calculation.
/// </summary>
IVariable ResultValue { get; }
}
}
|
lgpl-2.1
|
C#
|
0f94de5e73e00c6195c524122666206ac4249bdb
|
Fix adding to list
|
OlegAxenow/Method.Injection
|
Method.Inject.Spec/Injections/DoWorkInjectionDirect.cs
|
Method.Inject.Spec/Injections/DoWorkInjectionDirect.cs
|
using Method.Inject.Spec.Types;
namespace Method.Inject.Spec.Injections
{
/// <summary>
/// Test direct type injection (without interfaces).
/// </summary>
public class DoWorkInjectionDirect : MethodInjection
{
public virtual void DoWork(BaseType instance, string parameter)
{
instance.CallsLog.Add(GetType().Name + ".DoWorkInjectionDirect(" + parameter + ")");
}
}
}
|
using Method.Inject.Spec.Types;
namespace Method.Inject.Spec.Injections
{
public class DoWorkInjectionDirect : MethodInjection
{
public virtual void DoWork(BaseType instance, string parameter)
{
instance.CallsLog.Add(GetType().Name + ".DoWork(" + parameter + ")");
}
}
}
|
mit
|
C#
|
e321d6c370e794e13316c818cb12f37601e3926b
|
Disable a test hanging on TeamCity for Linux
|
gmartin7/libpalaso,ermshiperete/libpalaso,gtryus/libpalaso,glasseyes/libpalaso,glasseyes/libpalaso,gmartin7/libpalaso,sillsdev/libpalaso,glasseyes/libpalaso,gtryus/libpalaso,glasseyes/libpalaso,gtryus/libpalaso,sillsdev/libpalaso,sillsdev/libpalaso,gmartin7/libpalaso,ermshiperete/libpalaso,sillsdev/libpalaso,gmartin7/libpalaso,ermshiperete/libpalaso,gtryus/libpalaso,ermshiperete/libpalaso
|
SIL.Windows.Forms.Tests/Progress/LogBox/LogBoxTests.cs
|
SIL.Windows.Forms.Tests/Progress/LogBox/LogBoxTests.cs
|
using System;
using NUnit.Framework;
namespace SIL.Windows.Forms.Tests.Progress.LogBox
{
[TestFixture]
public class LogBoxTests
{
private Windows.Forms.Progress.LogBox progress;
[Test]
[Category("KnownMonoIssue")] // this test hangs on TeamCity for Linux
public void ShowLogBox()
{
Console.WriteLine("Showing LogBox");
using (var e = new LogBoxFormForTest())
{
progress = e.progress;
progress.WriteMessage("LogBox test");
progress.ShowVerbose = true;
for (int i = 0; i < 1000; i++)
{
progress.WriteVerbose(".");
}
progress.WriteMessage("done");
Console.WriteLine(progress.Text);
Console.WriteLine(progress.Rtf);
Console.WriteLine("Finished");
}
}
}
}
|
using System;
using NUnit.Framework;
namespace SIL.Windows.Forms.Tests.Progress.LogBox
{
[TestFixture]
public class LogBoxTests
{
private Windows.Forms.Progress.LogBox progress;
[Test]
public void ShowLogBox()
{
Console.WriteLine("Showing LogBox");
using (var e = new LogBoxFormForTest())
{
progress = e.progress;
progress.WriteMessage("LogBox test");
progress.ShowVerbose = true;
for (int i = 0; i < 1000; i++)
{
progress.WriteVerbose(".");
}
progress.WriteMessage("done");
Console.WriteLine(progress.Text);
Console.WriteLine(progress.Rtf);
Console.WriteLine("Finished");
}
}
}
}
|
mit
|
C#
|
42b7bfe4e70ed7282881958471201b5f0b2ce2c2
|
Add extension method to call Fetch on destination instance, e.g. _myFolder.Fetch ('dropbox://myfile.png')
|
stampsy/Stampsy.ImageSource
|
Extensions.cs
|
Extensions.cs
|
using System;
using System.Reactive.Linq;
using System.Threading.Tasks;
namespace Stampsy.ImageSource
{
public static class Extensions
{
public static Task<TRequest> Fetch<TRequest> (this IDestination<TRequest> destination, Uri url)
where TRequest : Request
{
return ImageSource.Fetch (url, destination);
}
internal static IObservable<T> SurroundWith<T> (this IObservable<T> a, IObservable<T> b)
{
return b.Concat (a).Concat (b);
}
internal static void RouteExceptions<T> (this Task task, IObserver<T> observer)
{
task.ContinueWith (t => {
observer.OnError (t.Exception.Flatten ());
}, TaskContinuationOptions.OnlyOnFaulted);
}
internal static void RouteExceptions<T> (this Task task, TaskCompletionSource<T> tcs)
{
task.ContinueWith (t => {
tcs.TrySetException (t.Exception.Flatten ());
}, TaskContinuationOptions.OnlyOnFaulted);
}
}
}
|
using System;
using System.Reactive.Linq;
using System.Threading.Tasks;
namespace Stampsy.ImageSource
{
internal static class Extensions
{
public static IObservable<T> SurroundWith<T> (this IObservable<T> a, IObservable<T> b)
{
return b.Concat (a).Concat (b);
}
public static void RouteExceptions<T> (this Task task, IObserver<T> observer)
{
task.ContinueWith (t => {
observer.OnError (t.Exception.Flatten ());
}, TaskContinuationOptions.OnlyOnFaulted);
}
public static void RouteExceptions<T> (this Task task, TaskCompletionSource<T> tcs)
{
task.ContinueWith (t => {
tcs.TrySetException (t.Exception.Flatten ());
}, TaskContinuationOptions.OnlyOnFaulted);
}
}
}
|
mit
|
C#
|
03fd813e824c0dd34817f95a6fd04907f8a9fc62
|
Update SingleNodeQueueProvider.cs
|
danielgerlag/workflow-core
|
src/WorkflowCore/Services/DefaultProviders/SingleNodeQueueProvider.cs
|
src/WorkflowCore/Services/DefaultProviders/SingleNodeQueueProvider.cs
|
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using WorkflowCore.Interface;
namespace WorkflowCore.Services
{
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
/// <summary>
/// Single node in-memory implementation of IQueueProvider
/// </summary>
public class SingleNodeQueueProvider : IQueueProvider
{
private readonly Dictionary<QueueType, BlockingCollection<string>> _queues = new Dictionary<QueueType, BlockingCollection<string>>()
{
[QueueType.Workflow] = new BlockingCollection<string>(),
[QueueType.Event] = new BlockingCollection<string>(),
[QueueType.Index] = new BlockingCollection<string>()
};
public bool IsDequeueBlocking => false;
public async Task QueueWork(string id, QueueType queue)
{
_queues[queue].Add(id);
}
public async Task<string> DequeueWork(QueueType queue, CancellationToken cancellationToken)
{
if (_queues[queue].TryTake(out string id))
return id;
return null;
}
public Task Start()
{
return Task.CompletedTask;
}
public Task Stop()
{
return Task.CompletedTask;
}
public void Dispose()
{
}
}
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
}
|
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using WorkflowCore.Interface;
namespace WorkflowCore.Services
{
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
/// <summary>
/// Single node in-memory implementation of IQueueProvider
/// </summary>
public class SingleNodeQueueProvider : IQueueProvider
{
private readonly Dictionary<QueueType, BlockingCollection<string>> _queues = new Dictionary<QueueType, BlockingCollection<string>>()
{
[QueueType.Workflow] = new BlockingCollection<string>(),
[QueueType.Event] = new BlockingCollection<string>(),
[QueueType.Index] = new BlockingCollection<string>()
};
public bool IsDequeueBlocking => true;
public async Task QueueWork(string id, QueueType queue)
{
_queues[queue].Add(id);
}
public async Task<string> DequeueWork(QueueType queue, CancellationToken cancellationToken)
{
if (_queues[queue].TryTake(out string id, 100, cancellationToken))
return id;
return null;
}
public Task Start()
{
return Task.CompletedTask;
}
public Task Stop()
{
return Task.CompletedTask;
}
public void Dispose()
{
}
}
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
}
|
mit
|
C#
|
8fb1f8f55e5d369e571b4645aa7c7ec6ef38c37b
|
Access operator for array is now "item"
|
hahoyer/reni.cs,hahoyer/reni.cs,hahoyer/reni.cs
|
src/reni2/FeatureTest/Reference/ArrayElementType.cs
|
src/reni2/FeatureTest/Reference/ArrayElementType.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using hw.UnitTest;
namespace Reni.FeatureTest.Reference
{
[TestFixture]
[ArrayElementType1]
[Target(@"
a: 'Text';
t: a type item;
t dump_print
")]
[Output("(bit)*8[text_item]")]
public sealed class ArrayElementType : CompilerTest {}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using hw.UnitTest;
namespace Reni.FeatureTest.Reference
{
[TestFixture]
[ArrayElementType1]
[Target(@"
a: 'Text';
t: a type >>;
t dump_print
")]
[Output("(bit)*8[text_item]")]
public sealed class ArrayElementType : CompilerTest {}
}
|
mit
|
C#
|
1bcf9e1d8006be0f7a8d207bc121bc544b5279c5
|
Update LogPile.cs
|
joshyy/LogPile
|
LogPile/LogPile.cs
|
LogPile/LogPile.cs
|
/*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* 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 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.
*
* For more information, please refer to <http://unlicense.org>
*/
using System;
using System.IO;
using System.Reflection;
public class LogPile {
//defaults - use config file to customize
static string dateFormatFileNm = "yyyy-MM-dd"; //easily control file name rollover by using H, m or s in dateFormatFileNm. Default is daily.
static string dateFormatLog = "yyyy-MM-dd HH:mm:ss:fff";
static string dir = Environment.CurrentDirectory;
static string fileNm = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
static string fileExt = ".logpile";
internal static void WriteLine(string level, string message) {
DateTime date = DateTime.Now;
string logFile = Path.Combine(dir, fileNm + "_" + date.ToString(dateFormatFileNm) + fileExt);
string className = "ClassNameHere"; // todo:
using (StreamWriter w = new StreamWriter(logFile, true)) {
w.WriteLine(string.Format("{0}|{1}|{2}|{3}", date.ToString(dateFormatLog), level, className, message));
}
}
public static void Info(string message) {
WriteLine("INFO", message);
}
public static void Debug(string message) {
WriteLine("DEBUG", message);
}
public static void Warn(string message) {
WriteLine("WARN", message);
}
public static void Fatal(string message) {
WriteLine("FATAL", message);
}
public static void Error(string message) {
WriteLine("ERROR", message);
}
public static void Custom(string level, string message) {
WriteLine(level, message);
}
}
|
using System;
using System.IO;
using System.Reflection;
public class LogPile {
//defaults - use config file to customize
static string dateFormatFileNm = "yyyy-MM-dd"; //easily control file name rollover by using H, m or s in dateFormatFileNm. Default is daily.
static string dateFormatLog = "yyyy-MM-dd HH:mm:ss:fff";
static string dir = Environment.CurrentDirectory;
static string fileNm = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
static string fileExt = ".logpile";
internal static void WriteLine(string level, string message) {
DateTime date = DateTime.Now;
string logFile = Path.Combine(dir, fileNm + "_" + date.ToString(dateFormatFileNm) + fileExt);
string className = "ClassNameHere"; // todo:
using (StreamWriter w = new StreamWriter(logFile, true)) {
w.WriteLine(string.Format("{0}|{1}|{2}|{3}", date.ToString(dateFormatLog), level, className, message));
}
}
public static void Info(string message) {
WriteLine("INFO", message);
}
public static void Debug(string message) {
WriteLine("DEBUG", message);
}
public static void Warn(string message) {
WriteLine("WARN", message);
}
public static void Fatal(string message) {
WriteLine("FATAL", message);
}
public static void Error(string message) {
WriteLine("ERROR", message);
}
public static void Custom(string level, string message) {
WriteLine(level, message);
}
}
|
unlicense
|
C#
|
56fe07b5f9c0b653b581a431ae2d25bcd958cec1
|
remove DEBUG check
|
ssg/SimpleBase,ssg/SimpleBase
|
benchmark/EncoderBenchmarks.cs
|
benchmark/EncoderBenchmarks.cs
|
using System;
using BenchmarkDotNet.Attributes;
using SimpleBase;
namespace benchmark;
public class EncoderBenchmarks
{
private readonly byte[] buffer = new byte[64];
[Benchmark(Baseline = true)]
public string DotNet_Base64() => Convert.ToBase64String(buffer);
[Benchmark]
public string SimpleBase_Base16_UpperCase() => SimpleBase.Base16.UpperCase.Encode(buffer);
[Benchmark]
public string SimpleBase_Base32_CrockfordWithPadding() => SimpleBase.Base32.Crockford.Encode(buffer, padding: true);
[Benchmark]
public string SimpleBase_Base85_Z85() => Base85.Z85.Encode(buffer);
[Benchmark]
public string SimpleBase_Base58_Bitcoin() => Base58.Bitcoin.Encode(buffer);
}
|
using System;
using BenchmarkDotNet.Attributes;
using SimpleBase;
namespace benchmark;
#if DEBUG
#error Benchmarks on DEBUG mode aren't supported. Switch to "Release" configuration and try again.
#endif
public class EncoderBenchmarks
{
private readonly byte[] buffer = new byte[64];
[Benchmark(Baseline = true)]
public string DotNet_Base64() => Convert.ToBase64String(buffer);
[Benchmark]
public string SimpleBase_Base16_UpperCase() => SimpleBase.Base16.UpperCase.Encode(buffer);
[Benchmark]
public string SimpleBase_Base32_CrockfordWithPadding() => SimpleBase.Base32.Crockford.Encode(buffer, padding: true);
[Benchmark]
public string SimpleBase_Base85_Z85() => Base85.Z85.Encode(buffer);
[Benchmark]
public string SimpleBase_Base58_Bitcoin() => Base58.Bitcoin.Encode(buffer);
}
|
apache-2.0
|
C#
|
4838ea9150063b4c43d6e957cad59c10cd061381
|
test commit
|
XzXzTeam/BookShop
|
Model/Book.cs
|
Model/Book.cs
|
namespace Model
{
public class Book : PersistableObject
{
public string Name { get; set; }
public string Publisher { get; set; }
}
}
|
namespace Model
{
public class Book : PersistableObject
{
public string Name { get; set; }
}
}
|
epl-1.0
|
C#
|
701b53256beb9114a05887aa8d0899e040b20e59
|
Add scorev2 to mods
|
stanriders/den0bot,stanriders/den0bot
|
den0bot.Modules.Osu/Osu/Types/Mods.cs
|
den0bot.Modules.Osu/Osu/Types/Mods.cs
|
// den0bot (c) StanR 2019 - MIT License
using System;
namespace den0bot.Modules.Osu.Osu.Types
{
/// <summary>
/// Bitwise list of all mods
/// </summary>
[Flags]
public enum Mods
{
None = 0,
NF = 1,
EZ = 2,
TD = 4, // previously NoVideo, now TouchDevice
HD = 8,
HR = 16,
SD = 32,
DT = 64,
HT = 256,
NC = 512, // Only set along with DoubleTime. i.e: NC only gives 576
FL = 1024,
SO = 4096,
PF = 16384, // Only set along with SuddenDeath. i.e: PF only gives 16416
V2 = 536870912,
DifficultyChanging = NC | HT | DT | HR | EZ, // FL changes difficulty but osu! api doesn't think so
/*
Key4 = 32768,
Key5 = 65536,
Key6 = 131072,
Key7 = 262144,
Key8 = 524288,
FadeIn = 1048576,
Random = 2097152,
LastMod = 4194304,
Key9 = 16777216,
Key10 = 33554432,
Key1 = 67108864,
Key3 = 134217728,
Key2 = 268435456
*/
}
}
|
// den0bot (c) StanR 2019 - MIT License
using System;
namespace den0bot.Modules.Osu.Osu.Types
{
/// <summary>
/// Bitwise list of all mods
/// </summary>
[Flags]
public enum Mods
{
None = 0,
NF = 1,
EZ = 2,
TD = 4, // previously NoVideo, now TouchDevice
HD = 8,
HR = 16,
SD = 32,
DT = 64,
HT = 256,
NC = 512, // Only set along with DoubleTime. i.e: NC only gives 576
FL = 1024,
SO = 4096,
PF = 16384, // Only set along with SuddenDeath. i.e: PF only gives 16416
DifficultyChanging = NC | HT | DT | HR | EZ, // FL changes difficulty but osu! api doesn't think so
/*
Key4 = 32768,
Key5 = 65536,
Key6 = 131072,
Key7 = 262144,
Key8 = 524288,
FadeIn = 1048576,
Random = 2097152,
LastMod = 4194304,
Key9 = 16777216,
Key10 = 33554432,
Key1 = 67108864,
Key3 = 134217728,
Key2 = 268435456
*/
}
}
|
mit
|
C#
|
bc90793b1c59da7ca83bb9a5ca4b6ae1fcd62c72
|
Trim whitespace
|
2yangk23/osu,EVAST9919/osu,DrabWeb/osu,naoey/osu,ppy/osu,EVAST9919/osu,UselessToucan/osu,2yangk23/osu,UselessToucan/osu,johnneijzen/osu,smoogipoo/osu,ppy/osu,naoey/osu,johnneijzen/osu,peppy/osu,UselessToucan/osu,NeoAdonis/osu,smoogipooo/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,Frontear/osuKyzer,naoey/osu,smoogipoo/osu,DrabWeb/osu,ZLima12/osu,DrabWeb/osu,ZLima12/osu,peppy/osu,Nabile-Rahmani/osu,peppy/osu-new,smoogipoo/osu,peppy/osu
|
osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs
|
osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Configuration;
namespace osu.Game.Overlays.Settings.Sections.Gameplay
{
public class GeneralSettings : SettingsSubsection
{
protected override string Header => "General";
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
Children = new Drawable[]
{
new SettingsSlider<double>
{
LabelText = "Background dim",
Bindable = config.GetBindable<double>(OsuSetting.DimLevel),
KeyboardStep = 0.1f
},
new SettingsSlider<double>
{
LabelText = "Background blur",
Bindable = config.GetBindable<double>(OsuSetting.BlurLevel),
KeyboardStep = 0.1f
},
new SettingsCheckbox
{
LabelText = "Show score overlay",
Bindable = config.GetBindable<bool>(OsuSetting.ShowInterface)
},
new SettingsCheckbox
{
LabelText = "Always show key overlay",
Bindable = config.GetBindable<bool>(OsuSetting.KeyOverlay)
},
};
}
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Configuration;
namespace osu.Game.Overlays.Settings.Sections.Gameplay
{
public class GeneralSettings : SettingsSubsection
{
protected override string Header => "General";
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
Children = new Drawable[]
{
new SettingsSlider<double>
{
LabelText = "Background dim",
Bindable = config.GetBindable<double>(OsuSetting.DimLevel),
KeyboardStep = 0.1f
},
new SettingsSlider<double>
{
LabelText = "Background blur",
Bindable = config.GetBindable<double>(OsuSetting.BlurLevel),
KeyboardStep = 0.1f
},
new SettingsCheckbox
{
LabelText = "Show score overlay",
Bindable = config.GetBindable<bool>(OsuSetting.ShowInterface)
},
new SettingsCheckbox
{
LabelText = "Always show key overlay",
Bindable = config.GetBindable<bool>(OsuSetting.KeyOverlay)
},
};
}
}
}
|
mit
|
C#
|
4a65ecb408417b2b0c642ed63e96c1281e15a9e3
|
remove limitation on AppSettings table value column
|
luchaoshuai/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,verdentk/aspnetboilerplate,carldai0106/aspnetboilerplate,ryancyq/aspnetboilerplate,carldai0106/aspnetboilerplate,ilyhacker/aspnetboilerplate,carldai0106/aspnetboilerplate,ryancyq/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,carldai0106/aspnetboilerplate,ryancyq/aspnetboilerplate,verdentk/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,ilyhacker/aspnetboilerplate,ilyhacker/aspnetboilerplate,verdentk/aspnetboilerplate,luchaoshuai/aspnetboilerplate,ryancyq/aspnetboilerplate
|
src/Abp.Zero.Common/Configuration/Setting.cs
|
src/Abp.Zero.Common/Configuration/Setting.cs
|
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
namespace Abp.Configuration
{
/// <summary>
/// Represents a setting for a tenant or user.
/// </summary>
[Table("AbpSettings")]
public class Setting : AuditedEntity<long>, IMayHaveTenant
{
/// <summary>
/// Maximum length of the <see cref="Name"/> property.
/// </summary>
public const int MaxNameLength = 256;
/// <summary>
/// TenantId for this setting.
/// TenantId is null if this setting is not Tenant level.
/// </summary>
public virtual int? TenantId { get; set; }
/// <summary>
/// UserId for this setting.
/// UserId is null if this setting is not user level.
/// </summary>
public virtual long? UserId { get; set; }
/// <summary>
/// Unique name of the setting.
/// </summary>
[Required]
[StringLength(MaxNameLength)]
public virtual string Name { get; set; }
/// <summary>
/// Value of the setting.
/// </summary>
public virtual string Value { get; set; }
/// <summary>
/// Creates a new <see cref="Setting"/> object.
/// </summary>
public Setting()
{
}
/// <summary>
/// Creates a new <see cref="Setting"/> object.
/// </summary>
/// <param name="tenantId">TenantId for this setting</param>
/// <param name="userId">UserId for this setting</param>
/// <param name="name">Unique name of the setting</param>
/// <param name="value">Value of the setting</param>
public Setting(int? tenantId, long? userId, string name, string value)
{
TenantId = tenantId;
UserId = userId;
Name = name;
Value = value;
}
}
}
|
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
namespace Abp.Configuration
{
/// <summary>
/// Represents a setting for a tenant or user.
/// </summary>
[Table("AbpSettings")]
public class Setting : AuditedEntity<long>, IMayHaveTenant
{
/// <summary>
/// Maximum length of the <see cref="Name"/> property.
/// </summary>
public const int MaxNameLength = 256;
/// <summary>
/// Maximum length of the <see cref="Value"/> property.
/// </summary>
public const int MaxValueLength = 2000;
/// <summary>
/// TenantId for this setting.
/// TenantId is null if this setting is not Tenant level.
/// </summary>
public virtual int? TenantId { get; set; }
/// <summary>
/// UserId for this setting.
/// UserId is null if this setting is not user level.
/// </summary>
public virtual long? UserId { get; set; }
/// <summary>
/// Unique name of the setting.
/// </summary>
[Required]
[StringLength(MaxNameLength)]
public virtual string Name { get; set; }
/// <summary>
/// Value of the setting.
/// </summary>
[StringLength(MaxValueLength)]
public virtual string Value { get; set; }
/// <summary>
/// Creates a new <see cref="Setting"/> object.
/// </summary>
public Setting()
{
}
/// <summary>
/// Creates a new <see cref="Setting"/> object.
/// </summary>
/// <param name="tenantId">TenantId for this setting</param>
/// <param name="userId">UserId for this setting</param>
/// <param name="name">Unique name of the setting</param>
/// <param name="value">Value of the setting</param>
public Setting(int? tenantId, long? userId, string name, string value)
{
TenantId = tenantId;
UserId = userId;
Name = name;
Value = value;
}
}
}
|
mit
|
C#
|
6a213c5d39826ff3a83765e59432c6dc14696840
|
Prepare for new implementation of Aggregate Atomic Action
|
Elders/Cronus,Elders/Cronus
|
src/Elders.Cronus/Properties/AssemblyInfo.cs
|
src/Elders.Cronus/Properties/AssemblyInfo.cs
|
// <auto-generated/>
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitleAttribute("Elders.Cronus")]
[assembly: AssemblyDescriptionAttribute("Elders.Cronus")]
[assembly: ComVisibleAttribute(false)]
[assembly: AssemblyProductAttribute("Elders.Cronus")]
[assembly: AssemblyCopyrightAttribute("Copyright © 2015")]
[assembly: AssemblyVersionAttribute("2.4.0.0")]
[assembly: AssemblyFileVersionAttribute("2.4.0.0")]
[assembly: AssemblyInformationalVersionAttribute("2.4.0-beta.1+1.Branch.release/2.4.0.Sha.3e4f8834fa8a63812fbfc3121045ffd5f065c6af")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "2.4.0.0";
}
}
|
// <auto-generated/>
using System.Reflection;
[assembly: AssemblyTitleAttribute("Elders.Cronus")]
[assembly: AssemblyDescriptionAttribute("Elders.Cronus")]
[assembly: AssemblyProductAttribute("Elders.Cronus")]
[assembly: AssemblyVersionAttribute("2.0.0")]
[assembly: AssemblyInformationalVersionAttribute("2.0.0")]
[assembly: AssemblyFileVersionAttribute("2.0.0")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "2.0.0";
}
}
|
apache-2.0
|
C#
|
b81cf35f72fd202acfd4ff2d2ba5fc1f71c8fe3d
|
Fix C# 9 syntax
|
mattwcole/gelf-extensions-logging
|
src/Gelf.Extensions.Logging/TcpGelfClient.cs
|
src/Gelf.Extensions.Logging/TcpGelfClient.cs
|
using System.IO;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Gelf.Extensions.Logging
{
public class TcpGelfClient : IGelfClient
{
private readonly ReaderWriterLockSlim _lockSlim = new();
private readonly GelfLoggerOptions _options;
private TcpClient? _client;
private Stream? _stream;
public TcpGelfClient(GelfLoggerOptions options)
{
_options = options;
}
public void Dispose()
{
_lockSlim.Dispose();
_stream?.Dispose();
_client?.Dispose();
}
public async Task SendMessageAsync(GelfMessage message)
{
var messageBytes = Encoding.UTF8.GetBytes(message.ToJson() + '\0');
try
{
var stream = GetStream();
await stream.WriteAsync(messageBytes, 0, messageBytes.Length);
}
catch (SocketException)
{
if (_options.ThrowTcpExceptions)
throw;
}
}
private Stream GetStream()
{
_lockSlim.EnterUpgradeableReadLock();
try
{
if (_client?.Connected == true && _stream != null)
return _stream;
_lockSlim.EnterWriteLock();
try
{
_client = new TcpClient(_options.Host!, _options.Port) {SendTimeout = _options.TcpTimeoutMs};
_stream = _client.GetStream();
return _stream;
}
finally
{
_lockSlim.ExitWriteLock();
}
}
finally
{
_lockSlim.ExitUpgradeableReadLock();
}
}
}
}
|
using System.IO;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Gelf.Extensions.Logging;
public class TcpGelfClient : IGelfClient
{
private readonly ReaderWriterLockSlim _lockSlim = new();
private readonly GelfLoggerOptions _options;
private TcpClient? _client;
private Stream? _stream;
public TcpGelfClient(GelfLoggerOptions options)
{
_options = options;
}
public void Dispose()
{
_lockSlim.Dispose();
_stream?.Dispose();
_client?.Dispose();
}
public async Task SendMessageAsync(GelfMessage message)
{
var messageBytes = Encoding.UTF8.GetBytes(message.ToJson() + '\0');
try
{
var stream = GetStream();
await stream.WriteAsync(messageBytes, 0, messageBytes.Length);
}
catch (SocketException)
{
if (_options.ThrowTcpExceptions)
throw;
}
}
private Stream GetStream()
{
_lockSlim.EnterUpgradeableReadLock();
try
{
if (_client?.Connected == true && _stream != null)
return _stream;
_lockSlim.EnterWriteLock();
try
{
_client =
new TcpClient(_options.Host!, _options.Port) {SendTimeout = _options.TcpTimeoutMs};
_stream = _client.GetStream();
return _stream;
}
finally
{
_lockSlim.ExitWriteLock();
}
}
finally
{
_lockSlim.ExitUpgradeableReadLock();
}
}
}
|
mit
|
C#
|
08993d4437df83b22b01ed54158b1e50c0b49c06
|
Update AssemblyVersion to 4.0.0.0 (see #142)
|
mganss/HtmlSanitizer
|
src/HtmlSanitizer/Properties/AssemblyInfo.cs
|
src/HtmlSanitizer/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
#if !NETSTANDARD
// 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("16af04e9-e712-417e-b749-c8d10148dda9")]
#endif
[assembly: AssemblyVersion("4.0.0.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
#if !NETSTANDARD
// 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("16af04e9-e712-417e-b749-c8d10148dda9")]
#endif
[assembly: AssemblyVersion("3.0.0.0")]
|
mit
|
C#
|
9bbf7d68eefca8499b71725629dfcd9d17fb2dd3
|
increase version no
|
gigya/microdot
|
SolutionVersion.cs
|
SolutionVersion.cs
|
#region Copyright
// Copyright 2017 Gigya Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Gigya Inc.")]
[assembly: AssemblyCopyright("© 2017 Gigya Inc.")]
[assembly: AssemblyDescription("Microdot Framework")]
[assembly: AssemblyVersion("1.5.4.0")]
[assembly: AssemblyFileVersion("1.5.4.0")]
[assembly: AssemblyInformationalVersion("1.5.4.0")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
|
#region Copyright
// Copyright 2017 Gigya Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Gigya Inc.")]
[assembly: AssemblyCopyright("© 2017 Gigya Inc.")]
[assembly: AssemblyDescription("Microdot Framework")]
[assembly: AssemblyVersion("1.5.3.0")]
[assembly: AssemblyFileVersion("1.5.3.0")]
[assembly: AssemblyInformationalVersion("1.5.3.0")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
|
apache-2.0
|
C#
|
f7c3193a7739e288ffa47a44832de08e919c5944
|
Return a value, in fact a float (using managed DBus extensions)
|
tmds/Tmds.DBus
|
TestServer.cs
|
TestServer.cs
|
// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
using NDesk.DBus;
using org.freedesktop.DBus;
using System.IO;
using System.Net;
using System.Net.Sockets;
using Mono.Unix;
public class TestServer
{
//TODO: complete this test daemon/server example, and a client
//TODO: maybe generalise it and integrate it into the core
public static void Main (string[] args)
{
bool isServer;
if (args.Length == 1 && args[0] == "server")
isServer = true;
else if (args.Length == 1 && args[0] == "client")
isServer = false;
else {
Console.Error.WriteLine ("Usage: test-server [server|client]");
return;
}
string addr = "unix:abstract=/tmp/dbus-ABCDEFGHIJ";
Connection conn;
DemoObject demo;
ObjectPath myOpath = new ObjectPath ("/test");
string myNameReq = "org.ndesk.test";
if (!isServer) {
conn = new Connection (false);
conn.Open (addr);
demo = conn.GetObject<DemoObject> (myNameReq, myOpath);
float ret = demo.Hello ("hi from test client", 21);
Console.WriteLine ("Returned float: " + ret);
} else {
string path;
bool abstr;
Address.Parse (addr, out path, out abstr);
AbstractUnixEndPoint ep = new AbstractUnixEndPoint (path);
Socket server = new Socket (AddressFamily.Unix, SocketType.Stream, 0);
server.Bind (ep);
server.Listen (1);
Console.WriteLine ("Waiting for client on " + addr);
Socket client = server.Accept ();
Console.WriteLine ("Client accepted");
//this might well be wrong, untested and doesn't yet work here onwards
conn = new Connection (false);
//conn.Open (path, @abstract);
conn.sock = client;
conn.sock.Blocking = true;
conn.ns = new NetworkStream (conn.sock);
Connection.tmpConn = conn;
demo = new DemoObject ();
conn.Marshal (demo, "org.ndesk.test");
//TODO: handle lost connections etc.
while (true)
conn.Iterate ();
}
}
}
[Interface ("org.ndesk.test")]
public class DemoObject : MarshalByRefObject
{
public float Hello (string arg0, int arg1)
{
Console.WriteLine ("Got a Hello(" + arg0 + ", " + arg1 +")");
return (float)arg1/2;
}
}
|
// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
using NDesk.DBus;
using org.freedesktop.DBus;
using System.IO;
using System.Net;
using System.Net.Sockets;
using Mono.Unix;
public class TestServer
{
//TODO: complete this test daemon/server example, and a client
//TODO: maybe generalise it and integrate it into the core
public static void Main (string[] args)
{
bool isServer;
if (args.Length == 1 && args[0] == "server")
isServer = true;
else if (args.Length == 1 && args[0] == "client")
isServer = false;
else {
Console.Error.WriteLine ("Usage: test-server [server|client]");
return;
}
string addr = "unix:abstract=/tmp/dbus-ABCDEFGHIJ";
Connection conn;
DemoObject demo;
ObjectPath myOpath = new ObjectPath ("/test");
string myNameReq = "org.ndesk.test";
if (!isServer) {
conn = new Connection (false);
conn.Open (addr);
demo = conn.GetObject<DemoObject> (myNameReq, myOpath);
demo.Hello ("hi from test client", 21);
} else {
string path;
bool abstr;
Address.Parse (addr, out path, out abstr);
AbstractUnixEndPoint ep = new AbstractUnixEndPoint (path);
Socket server = new Socket (AddressFamily.Unix, SocketType.Stream, 0);
server.Bind (ep);
server.Listen (1);
Console.WriteLine ("Waiting for client on " + addr);
Socket client = server.Accept ();
Console.WriteLine ("Client accepted");
//this might well be wrong, untested and doesn't yet work here onwards
conn = new Connection (false);
//conn.Open (path, @abstract);
conn.sock = client;
conn.sock.Blocking = true;
conn.ns = new NetworkStream (conn.sock);
Connection.tmpConn = conn;
demo = new DemoObject ();
conn.Marshal (demo, "org.ndesk.test");
//TODO: handle lost connections etc.
while (true)
conn.Iterate ();
}
}
}
[Interface ("org.ndesk.test")]
public class DemoObject : MarshalByRefObject
{
public void Hello (string arg0, int arg1)
{
Console.WriteLine ("Got a Hello(" + arg0 + ", " + arg1 +")");
}
}
|
mit
|
C#
|
68c212e814b0ac38db25a29bd9f6cfc953514f34
|
Enable raven db in master
|
Vavro/DragonContracts,Vavro/DragonContracts
|
DragonContracts/DragonContracts/Base/RavenDbController.cs
|
DragonContracts/DragonContracts/Base/RavenDbController.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
using System.Web.Http.Controllers;
using DragonContracts.Indexes;
using DragonContracts.Models;
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.Embedded;
using Raven.Client.Indexes;
using Raven.Database.Config;
using Raven.Database.Server.Responders;
namespace DragonContracts.Base
{
public abstract class RavenDbController : ApiController
{
private const int RavenWebUiPort = 8081;
public IDocumentStore Store { get { return LazyDocStore.Value; } }
private static readonly Lazy<IDocumentStore> LazyDocStore = new Lazy<IDocumentStore>(() =>
{
var docStore = new EmbeddableDocumentStore()
{
DataDirectory = "App_Data/Raven",
UseEmbeddedHttpServer = true,
Configuration = { Port = RavenWebUiPort }
};
Raven.Database.Server.NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(RavenWebUiPort);
docStore.Initialize();
IndexCreation.CreateIndexes(typeof(Contracts_SubjectAndNames).Assembly, docStore);
return docStore;
});
public IAsyncDocumentSession Session { get; set; }
public async override Task<HttpResponseMessage> ExecuteAsync(
HttpControllerContext controllerContext,
CancellationToken cancellationToken)
{
using (Session = Store.OpenAsyncSession())
{
var result = await base.ExecuteAsync(controllerContext, cancellationToken);
await Session.SaveChangesAsync();
return result;
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
using System.Web.Http.Controllers;
using DragonContracts.Indexes;
using DragonContracts.Models;
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.Embedded;
using Raven.Client.Indexes;
using Raven.Database.Config;
using Raven.Database.Server.Responders;
namespace DragonContracts.Base
{
public abstract class RavenDbController : ApiController
{
private const int RavenWebUiPort = 8081;
public IDocumentStore Store { get { return LazyDocStore.Value; } }
private static readonly Lazy<IDocumentStore> LazyDocStore = new Lazy<IDocumentStore>(() =>
{
var docStore = new EmbeddableDocumentStore()
{
DataDirectory = "App_Data/Raven",
//UseEmbeddedHttpServer = true,
//Configuration = { Port = RavenWebUiPort }
};
Raven.Database.Server.NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(RavenWebUiPort);
docStore.Initialize();
IndexCreation.CreateIndexes(typeof(Contracts_SubjectAndNames).Assembly, docStore);
return docStore;
});
public IAsyncDocumentSession Session { get; set; }
public async override Task<HttpResponseMessage> ExecuteAsync(
HttpControllerContext controllerContext,
CancellationToken cancellationToken)
{
using (Session = Store.OpenAsyncSession())
{
var result = await base.ExecuteAsync(controllerContext, cancellationToken);
await Session.SaveChangesAsync();
return result;
}
}
}
}
|
mit
|
C#
|
cd2023d09699ce2cee27665f0f5e36e9b8914d66
|
update font (#720)
|
reactiveui/website,reactiveui/website,reactiveui/website,reactiveui/website
|
input/_Head.cshtml
|
input/_Head.cshtml
|
<link rel="apple-touch-icon" sizes="180x180" href="@Context.GetLink("/assets/img/favicons/apple-touch-icon.png")">
<link rel="icon" type="image/png" sizes="32x32" href="@Context.GetLink("/assets/img/favicons/favicon-32x32.png")">
<link rel="icon" type="image/png" sizes="16x16" href="@Context.GetLink("/assets/img/favicons/favicon-16x16.png")">
<link rel="manifest" href="@Context.GetLink("/assets/img/favicons/manifest.json")"/>
<link rel="shortcut icon" type="image/x-icon" href="@Context.GetLink("/assets/img/favicons/favicon.ico")"/>
<link rel="mask-icon" href="@Context.GetLink("/assets/img/favicons/safari-pinned-tab.svg")" color="#319af3">
<meta name="msapplication-config" content="@Context.GetLink("/assets/img/favicons/browserconfig.xml")" />
<meta name="msapplication-TileColor" content="#319af3">
<meta name="theme-color" content="#319af3">
<link rel="alternate" type="application/atom+xml" title="ReactiveUI" href="/rss" />
<meta property="og:url" content="@Context.GetLink(Model, true)" />
<meta property="og:type" content="article" />
<meta property="og:title" content="@ViewData[Keys.Title]" />
<meta property="og:image" content="https://reactiveui.net/assets/img/facebook-card.png" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@@reactivexui" />
<meta name="twitter:creator" content="@@reactivexui" />
<meta name="twitter:title" content="@ViewData[Keys.Title]" />
<meta name="twitter:image" content="https://reactiveui.net/assets/img/twitter-card.png" />
<meta name="twitter:image:alt" content="An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Dosis:wght@700&family=Source+Sans+Pro:wght@300;400&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
|
<link rel="apple-touch-icon" sizes="180x180" href="@Context.GetLink("/assets/img/favicons/apple-touch-icon.png")">
<link rel="icon" type="image/png" sizes="32x32" href="@Context.GetLink("/assets/img/favicons/favicon-32x32.png")">
<link rel="icon" type="image/png" sizes="16x16" href="@Context.GetLink("/assets/img/favicons/favicon-16x16.png")">
<link rel="manifest" href="@Context.GetLink("/assets/img/favicons/manifest.json")"/>
<link rel="shortcut icon" type="image/x-icon" href="@Context.GetLink("/assets/img/favicons/favicon.ico")"/>
<link rel="mask-icon" href="@Context.GetLink("/assets/img/favicons/safari-pinned-tab.svg")" color="#319af3">
<meta name="msapplication-config" content="@Context.GetLink("/assets/img/favicons/browserconfig.xml")" />
<meta name="msapplication-TileColor" content="#319af3">
<meta name="theme-color" content="#319af3">
<link rel="alternate" type="application/atom+xml" title="ReactiveUI" href="/rss" />
<meta property="og:url" content="@Context.GetLink(Model, true)" />
<meta property="og:type" content="article" />
<meta property="og:title" content="@ViewData[Keys.Title]" />
<meta property="og:image" content="https://reactiveui.net/assets/img/facebook-card.png" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@@reactivexui" />
<meta name="twitter:creator" content="@@reactivexui" />
<meta name="twitter:title" content="@ViewData[Keys.Title]" />
<meta name="twitter:image" content="https://reactiveui.net/assets/img/twitter-card.png" />
<meta name="twitter:image:alt" content="An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms" />
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400|Dosis:700" rel="stylesheet" type="text/css" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
|
mit
|
C#
|
2d0bc8d0e628fa064d640c700c4e2296af6daaab
|
добавить поле old_amount
|
vknet/vk,vknet/vk
|
VkNet/Model/Price.cs
|
VkNet/Model/Price.cs
|
using System;
using Newtonsoft.Json;
using VkNet.Utils;
namespace VkNet.Model
{
/// <summary>
/// Цена.
/// </summary>
[Serializable]
public class Price
{
/// <summary>
/// Целочисленное значение цены, умноженное на 100.
/// </summary>
[JsonProperty("amount")]
public long? Amount { get; set; }
/// <summary>
/// Валюта.
/// </summary>
[JsonProperty("currency")]
public Currency Currency { get; set; }
/// <summary>
/// Старая цена товара в сотых долях единицы валюты.
/// </summary>
[JsonProperty("old_amount")]
public long? OldAmount { get; set; }
/// <summary>
/// Строка с локализованной ценой и валютой.
/// </summary>
[JsonProperty("text")]
public string Text { get; set; }
/// <summary>
/// Разобрать из json.
/// </summary>
/// <param name="response"> Ответ сервера. </param>
/// <returns> </returns>
public static Price FromJson(VkResponse response)
{
var price = new Price
{
Amount = response["amount"],
Currency = response["currency"],
OldAmount = response["old_amount"],
Text = response["text"]
};
return price;
}
}
}
|
using System;
using VkNet.Utils;
namespace VkNet.Model
{
/// <summary>
/// Цена.
/// </summary>
[Serializable]
public class Price
{
/// <summary>
/// Целочисленное значение цены, умноженное на 100.
/// </summary>
public long? Amount { get; set; }
/// <summary>
/// Валюта.
/// </summary>
public Currency Currency { get; set; }
/// <summary>
/// Строка с локализованной ценой и валютой.
/// </summary>
public string Text { get; set; }
/// <summary>
/// Разобрать из json.
/// </summary>
/// <param name="response"> Ответ сервера. </param>
/// <returns> </returns>
public static Price FromJson(VkResponse response)
{
var price = new Price
{
Amount = response[key: "amount"]
, Currency = response[key: "currency"]
, Text = response[key: "text"]
};
return price;
}
}
}
|
mit
|
C#
|
51107acdffd3978fe73840fdaa137f651de7e561
|
Improve section behaviour.
|
Damnae/osu,smoogipooo/osu,NeoAdonis/osu,smoogipoo/osu,johnneijzen/osu,ppy/osu,peppy/osu,EVAST9919/osu,NeoAdonis/osu,Nabile-Rahmani/osu,ppy/osu,naoey/osu,2yangk23/osu,naoey/osu,UselessToucan/osu,peppy/osu,smoogipoo/osu,ZLima12/osu,UselessToucan/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,Drezi126/osu,DrabWeb/osu,peppy/osu-new,peppy/osu,DrabWeb/osu,DrabWeb/osu,naoey/osu,2yangk23/osu,ppy/osu,EVAST9919/osu,Frontear/osuKyzer,ZLima12/osu,johnneijzen/osu
|
osu.Game/Users/Profile/ProfileSection.cs
|
osu.Game/Users/Profile/ProfileSection.cs
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Users.Profile
{
public abstract class ProfileSection : FillFlowContainer
{
public abstract string Title { get; }
private readonly FillFlowContainer content;
protected override Container<Drawable> Content => content;
protected ProfileSection()
{
Direction = FillDirection.Vertical;
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
InternalChildren = new Drawable[]
{
new OsuSpriteText
{
Text = Title,
TextSize = 16,
Font = @"Exo2.0-RegularItalic",
Margin = new MarginPadding
{
Horizontal = UserProfile.CONTENT_X_MARGIN,
Vertical = 20
}
},
content = new FillFlowContainer
{
Direction = FillDirection.Vertical,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Margin = new MarginPadding
{
Horizontal = UserProfile.CONTENT_X_MARGIN,
Bottom = 20
}
},
new Box
{
RelativeSizeAxes = Axes.X,
Height = 1,
Colour = OsuColour.Gray(34),
EdgeSmoothness = new Vector2(1)
}
};
}
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Users.Profile
{
public abstract class ProfileSection : FillFlowContainer
{
public abstract string Title { get; }
protected ProfileSection()
{
Margin = new MarginPadding { Horizontal = UserProfile.CONTENT_X_MARGIN };
Direction = FillDirection.Vertical;
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
Children = new Drawable[]
{
new OsuSpriteText
{
Text = Title,
TextSize = 16,
Font = @"Exo2.0-RegularItalic",
Margin = new MarginPadding { Vertical = 20 }
},
new Box
{
RelativeSizeAxes = Axes.X,
Height = 1,
Colour = OsuColour.Gray(34),
Depth = float.MinValue
}
};
}
}
}
|
mit
|
C#
|
a8756915bb0199fff6d3acc9194215255dd2b31b
|
Remove invalid characters from slug, but keep in title.
|
VenusInterns/BlogTemplate,VenusInterns/BlogTemplate,VenusInterns/BlogTemplate
|
BlogTemplate/Services/SlugGenerator.cs
|
BlogTemplate/Services/SlugGenerator.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BlogTemplate.Models;
namespace BlogTemplate.Services
{
public class SlugGenerator
{
private BlogDataStore _dataStore;
public SlugGenerator(BlogDataStore dataStore)
{
_dataStore = dataStore;
}
public string CreateSlug(string title)
{
string tempTitle = title;
char[] invalidChars = Path.GetInvalidFileNameChars();
foreach (char c in invalidChars)
{
tempTitle = tempTitle.Replace(c.ToString(), "");
}
string slug = tempTitle.Replace(" ", "-");
int count = 0;
string tempSlug = slug;
while (_dataStore.CheckSlugExists(tempSlug))
{
count++;
tempSlug = $"{slug}-{count}";
}
return tempSlug;
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BlogTemplate.Models;
namespace BlogTemplate.Services
{
public class SlugGenerator
{
private BlogDataStore _dataStore;
public SlugGenerator(BlogDataStore dataStore)
{
_dataStore = dataStore;
}
public string CreateSlug(string title)
{
Encoding utf8 = new UTF8Encoding(true);
string tempTitle = title;
char[] invalidChars = Path.GetInvalidPathChars();
foreach (char c in invalidChars)
{
string s = c.ToString();
string decodedS = utf8.GetString(c);
if (tempTitle.Contains(s))
{
int removeIdx = tempTitle.IndexOf(s);
tempTitle = tempTitle.Remove(removeIdx);
}
}
string slug = title.Replace(" ", "-");
int count = 0;
string tempSlug = slug;
while (_dataStore.CheckSlugExists(tempSlug))
{
count++;
tempSlug = $"{slug}-{count}";
}
return tempSlug;
}
}
}
|
mit
|
C#
|
fbefa0d91e4563adc0533e3089f03049d5d1116e
|
Change default dps update rate to 0
|
quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot
|
CactbotOverlay/CactbotOverlayConfig.cs
|
CactbotOverlay/CactbotOverlayConfig.cs
|
using RainbowMage.OverlayPlugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace Cactbot {
public class CactbotOverlayConfig : OverlayConfigBase {
public static string CactbotAssemblyUri {
get { return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); }
}
public static string CactbotDllRelativeUserUri {
get { return System.IO.Path.Combine(CactbotAssemblyUri, "../cactbot/user/"); }
}
public CactbotOverlayConfig(string name)
: base(name) {
// Cactbot only supports visibility toggling with the hotkey.
// It assumes all overlays are always locked and either are
// clickthru or not on a more permanent basis.
GlobalHotkeyType = GlobalHotkeyType.ToggleVisible;
}
private CactbotOverlayConfig() : base(null) {
}
public override Type OverlayType {
get { return typeof(CactbotOverlay); }
}
public bool LogUpdatesEnabled = true;
public double DpsUpdatesPerSecond = 0;
public string OverlayData = null;
public string RemoteVersionSeen = "0.0";
public string UserConfigFile = "";
}
}
|
using RainbowMage.OverlayPlugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace Cactbot {
public class CactbotOverlayConfig : OverlayConfigBase {
public static string CactbotAssemblyUri {
get { return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); }
}
public static string CactbotDllRelativeUserUri {
get { return System.IO.Path.Combine(CactbotAssemblyUri, "../cactbot/user/"); }
}
public CactbotOverlayConfig(string name)
: base(name) {
// Cactbot only supports visibility toggling with the hotkey.
// It assumes all overlays are always locked and either are
// clickthru or not on a more permanent basis.
GlobalHotkeyType = GlobalHotkeyType.ToggleVisible;
}
private CactbotOverlayConfig() : base(null) {
}
public override Type OverlayType {
get { return typeof(CactbotOverlay); }
}
public bool LogUpdatesEnabled = true;
public double DpsUpdatesPerSecond = 3;
public string OverlayData = null;
public string RemoteVersionSeen = "0.0";
public string UserConfigFile = "";
}
}
|
apache-2.0
|
C#
|
5fda5b8c0b63d308b9a7b43c64b7c0cdd5ba8342
|
Edit AssemblyInfo
|
Vtek/Bartender
|
Cheers.Cqrs/Properties/AssemblyInfo.cs
|
Cheers.Cqrs/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Cheers.Cqrs")]
[assembly: AssemblyDescription("Cheers CQRS contracts")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CheersTeam")]
[assembly: AssemblyProduct("Cheers")]
[assembly: AssemblyCopyright("© 2016 CheersTeam")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.1.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Cheers.Cqrs")]
[assembly: AssemblyDescription("Cheers CQRS contracts")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Valtech")]
[assembly: AssemblyProduct("Cheers")]
[assembly: AssemblyCopyright("© 2016 Valtech")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.1.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
|
mit
|
C#
|
33abb512316fba3a563f329498ca8f7c8496c459
|
Update Result.cs
|
nmarazov/Team-Sazerac
|
OOPTeamwork/OOPTeamwork/Core/Result.cs
|
OOPTeamwork/OOPTeamwork/Core/Result.cs
|
using System;
namespace OOPTeamwork.Core
{
public static class Result
{
private static int playerOneNumOfWins;
private static int playerTwoNumOfWins;
public static void PlayerWin(int playerNum)
{
if (playerNum == 1)
{
playerOneNumOfWins++;
}
if (playerNum == 2)
{
playerTwoNumOfWins++;
}
}
public static void PrintResult()
{
Console.WriteLine("The result is:");
Console.ForegroundColor = System.ConsoleColor.Red;
Console.WriteLine("Player 1: {0} wins", playerOneNumOfWins);
Console.ForegroundColor = System.ConsoleColor.Blue;
Console.WriteLine("Player 2: {0} wins", playerTwoNumOfWins);
Console.ForegroundColor = ConsoleColor.Gray;
}
public static void ClearResult()
{
playerOneNumOfWins = 0;
playerTwoNumOfWins = 0;
}
}
}
|
using System;
using System.Text;
namespace OOPTeamwork.Core
{
public class Result
{
private static Result instance;
private int playerOneNumOfWins;
private int playerTwoNumOfWins;
private Result()
{
}
public static Result Instance
{
get
{
if (instance == null)
{
instance = new Result();
}
return instance;
}
}
public int PlayerOneNumOfWins
{
get { return playerOneNumOfWins; }
private set { playerOneNumOfWins = value; }
}
public int PlayerTwoNumOfWins
{
get { return playerTwoNumOfWins; }
private set { playerTwoNumOfWins = value; }
}
public void PlayerWin(int playerNum)
{
if (playerNum % 2 == 1)
{
playerOneNumOfWins++;
}
if (playerNum % 2 == 0)
{
playerTwoNumOfWins++;
}
}
public string PrintResult()
{
var result = new StringBuilder();
result.AppendLine("The result is:");
result.AppendLine($"Red player: {PlayerOneNumOfWins} wins");
result.AppendLine($"Blue player: {PlayerTwoNumOfWins} wins");
return result.ToString();
}
public void ClearResult()
{
this.PlayerOneNumOfWins = 0;
this.PlayerTwoNumOfWins = 0;
}
}
}
|
mit
|
C#
|
84b6f3ac32c6a99e6547ab11096efd7118cd521c
|
update clock label
|
kaseya/Room-Booking-IoT
|
RB-IoT-App/RB-IoT-App/MainPage.xaml.cs
|
RB-IoT-App/RB-IoT-App/MainPage.xaml.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace RB_IoT_App
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
Settings settings = new Settings();
public MainPage()
{
this.InitializeComponent();
this.Label_RoomName.Text = settings.RoomName;
DispatcherTimer timer = new DispatcherTimer();
timer.Tick += RefreshClock;
timer.Start();
}
private void RefreshClock(object sender, object e)
{
DateTime dt = DateTime.Now;
Label_CurrentTime.Text = dt.ToString("MM/dd HH:mm:ss");
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace RB_IoT_App
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
Settings settings = new Settings();
public MainPage()
{
this.InitializeComponent();
this.Label_RoomName.Text = settings.RoomName;
}
}
}
|
apache-2.0
|
C#
|
4f11f0730259acae29ec165bedf43887fbdab02a
|
Support different byte encoders for authentication data.
|
rob-blackbourn/JetBlack.MessageBus
|
JetBlack.MessageBus.TopicBus/Adapters/TypedClient.cs
|
JetBlack.MessageBus.TopicBus/Adapters/TypedClient.cs
|
using System;
using System.Net.Sockets;
using System.Reactive.Concurrency;
using System.Threading;
using JetBlack.MessageBus.Common.IO;
using JetBlack.MessageBus.TopicBus.Messages;
namespace JetBlack.MessageBus.TopicBus.Adapters
{
public class TypedClient<TData> : TypedClient<TData, TData>
{
public TypedClient(Socket socket, IByteEncoder<TData> byteEncoder, int maxBufferPoolSize, int maxBufferSize, IScheduler scheduler, CancellationToken token)
: base(socket, byteEncoder, byteEncoder, maxBufferPoolSize, maxBufferSize, scheduler, token)
{
}
}
public class TypedClient<TData, TAuthenticationData> : Client
{
public event EventHandler<DataReceivedEventArgs<TData>> OnDataReceived;
public event EventHandler<AuthenticationResponseEventArgs<TAuthenticationData>> OnAuthenticationResponse;
private readonly IByteEncoder<TData> _byteEncoder;
private readonly IByteEncoder<TAuthenticationData> _authenticationByteEncoder;
public TypedClient(Socket socket, IByteEncoder<TData> byteEncoder, IByteEncoder<TAuthenticationData> authenticationByteEncoder, int maxBufferPoolSize, int maxBufferSize, IScheduler scheduler, CancellationToken token)
: base(socket, maxBufferPoolSize, maxBufferSize, scheduler, token)
{
_byteEncoder = byteEncoder;
_authenticationByteEncoder = authenticationByteEncoder;
}
public void Send(int clientId, string topic, bool isImage, TData data)
{
Send(clientId, topic, isImage, _byteEncoder.Encode(data));
}
public void Publish(string topic, bool isImage, TData data)
{
Publish(topic, isImage, _byteEncoder.Encode(data));
}
public void RequestAuthentication(TData data)
{
RequestAuthentication(_byteEncoder.Encode(data));
}
protected override void RaiseOnData(string topic, byte[] data, bool isImage)
{
var handler = OnDataReceived;
if (handler != null)
handler(this, new DataReceivedEventArgs<TData>(topic, _byteEncoder.Decode(data), isImage));
}
protected override void RaiseOnAuthenticationResponse(AuthenticationStatus status, byte[] data)
{
var handler = OnAuthenticationResponse;
if (handler != null)
OnAuthenticationResponse(this, new AuthenticationResponseEventArgs<TAuthenticationData>(status, _authenticationByteEncoder.Decode(data)));
}
}
}
|
using System;
using System.Net.Sockets;
using System.Reactive.Concurrency;
using System.Threading;
using JetBlack.MessageBus.Common.IO;
using JetBlack.MessageBus.TopicBus.Messages;
namespace JetBlack.MessageBus.TopicBus.Adapters
{
public class TypedClient<TData> : Client
{
public event EventHandler<DataReceivedEventArgs<TData>> OnDataReceived;
public event EventHandler<AuthenticationResponseEventArgs<TData>> OnAuthenticationResponse;
private readonly IByteEncoder<TData> _byteEncoder;
public TypedClient(Socket socket, IByteEncoder<TData> byteEncoder, int maxBufferPoolSize, int maxBufferSize, IScheduler scheduler, CancellationToken token)
: base(socket, maxBufferPoolSize, maxBufferSize, scheduler, token)
{
_byteEncoder = byteEncoder;
}
public void Send(int clientId, string topic, bool isImage, TData data)
{
Send(clientId, topic, isImage, _byteEncoder.Encode(data));
}
public void Publish(string topic, bool isImage, TData data)
{
Publish(topic, isImage, _byteEncoder.Encode(data));
}
public void RequestAuthentication(TData data)
{
RequestAuthentication(_byteEncoder.Encode(data));
}
protected override void RaiseOnData(string topic, byte[] data, bool isImage)
{
var handler = OnDataReceived;
if (handler != null)
handler(this, new DataReceivedEventArgs<TData>(topic, _byteEncoder.Decode(data), isImage));
}
protected override void RaiseOnAuthenticationResponse(AuthenticationStatus status, byte[] data)
{
var handler = OnAuthenticationResponse;
if (handler != null)
OnAuthenticationResponse(this, new AuthenticationResponseEventArgs<TData>(status, _byteEncoder.Decode(data)));
}
}
}
|
mit
|
C#
|
2491583c2463295c80c0ee06b8e4ad839a47795c
|
Enable tests running on !Windows too.
|
bojanrajkovic/pingu
|
src/Pingu.Tests/ToolHelper.cs
|
src/Pingu.Tests/ToolHelper.cs
|
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
namespace Pingu.Tests
{
class ToolHelper
{
public static ProcessResult RunPngCheck(string path)
{
var asm = typeof(ToolHelper).GetTypeInfo().Assembly;
var assemblyDir = Path.GetDirectoryName(asm.Location);
// It'll be on the path on Linux/Mac, we ship it for Windows.
var pngcheckPath = Path.DirectorySeparatorChar == '\\' ? Path.Combine(
assemblyDir,
"..",
"..",
"..",
"..",
"..",
"tools",
"pngcheck.exe") : "pngcheck";
return Exe(pngcheckPath, "-v", path);
}
public static ProcessResult Exe(string command, params string[] args)
{
var startInfo = new ProcessStartInfo {
FileName = command,
Arguments = string.Join(
" ",
args.Where(x => !string.IsNullOrWhiteSpace(x))
.Select(x => "\"" + x + "\"")
),
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
};
var proc = Process.Start(startInfo);
var @out = proc.StandardOutput.ReadToEnd();
var err = proc.StandardError.ReadToEnd();
proc.WaitForExit(20000);
return new ProcessResult {
ExitCode = proc.ExitCode,
StandardOutput = @out,
StandardError = err
};
}
}
}
|
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
namespace Pingu.Tests
{
class ToolHelper
{
public static ProcessResult RunPngCheck(string path)
{
var asm = typeof(ToolHelper).GetTypeInfo().Assembly;
var assemblyDir = Path.GetDirectoryName(asm.Location);
var pngcheckPath = Path.Combine(
assemblyDir,
"..",
"..",
"..",
"..",
"..",
"tools",
"pngcheck.exe");
return Exe(pngcheckPath, "-v", path);
}
public static ProcessResult Exe(string command, params string[] args)
{
var startInfo = new ProcessStartInfo {
FileName = command,
Arguments = string.Join(
" ",
args.Where(x => !string.IsNullOrWhiteSpace(x))
.Select(x => "\"" + x + "\"")
),
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
};
var proc = Process.Start(startInfo);
var @out = proc.StandardOutput.ReadToEnd();
var err = proc.StandardError.ReadToEnd();
proc.WaitForExit(20000);
return new ProcessResult {
ExitCode = proc.ExitCode,
StandardOutput = @out,
StandardError = err
};
}
}
}
|
mit
|
C#
|
7dc244d6446ec5dd01b578e24fa0a2682a89fa7a
|
Annotate return types
|
bowencode/Squirrel.Windows,markwal/Squirrel.Windows,Katieleeb84/Squirrel.Windows,markuscarlen/Squirrel.Windows,Katieleeb84/Squirrel.Windows,1gurucoder/Squirrel.Windows,flagbug/Squirrel.Windows,willdean/Squirrel.Windows,punker76/Squirrel.Windows,aneeff/Squirrel.Windows,kenbailey/Squirrel.Windows,Suninus/Squirrel.Windows,JonMartinTx/AS400Report,markwal/Squirrel.Windows,1gurucoder/Squirrel.Windows,ruisebastiao/Squirrel.Windows,awseward/Squirrel.Windows,cguedel/Squirrel.Windows,hammerandchisel/Squirrel.Windows,vaginessa/Squirrel.Windows,BloomBooks/Squirrel.Windows,BloomBooks/Squirrel.Windows,aneeff/Squirrel.Windows,bowencode/Squirrel.Windows,awseward/Squirrel.Windows,josenbo/Squirrel.Windows,NeilSorensen/Squirrel.Windows,markuscarlen/Squirrel.Windows,sickboy/Squirrel.Windows,vaginessa/Squirrel.Windows,BloomBooks/Squirrel.Windows,airtimemedia/Squirrel.Windows,Suninus/Squirrel.Windows,hammerandchisel/Squirrel.Windows,yovannyr/Squirrel.Windows,kenbailey/Squirrel.Windows,jbeshir/Squirrel.Windows,ChaseFlorell/Squirrel.Windows,flagbug/Squirrel.Windows,GeertvanHorrik/Squirrel.Windows,ChaseFlorell/Squirrel.Windows,willdean/Squirrel.Windows,Squirrel/Squirrel.Windows,Squirrel/Squirrel.Windows,cguedel/Squirrel.Windows,josenbo/Squirrel.Windows,markwal/Squirrel.Windows,EdZava/Squirrel.Windows,akrisiun/Squirrel.Windows,BarryThePenguin/Squirrel.Windows,GeertvanHorrik/Squirrel.Windows,airtimemedia/Squirrel.Windows,BarryThePenguin/Squirrel.Windows,Suninus/Squirrel.Windows,JonMartinTx/AS400Report,awseward/Squirrel.Windows,NeilSorensen/Squirrel.Windows,sickboy/Squirrel.Windows,vaginessa/Squirrel.Windows,allanrsmith/Squirrel.Windows,jbeshir/Squirrel.Windows,jochenvangasse/Squirrel.Windows,EdZava/Squirrel.Windows,allanrsmith/Squirrel.Windows,ruisebastiao/Squirrel.Windows,markuscarlen/Squirrel.Windows,cguedel/Squirrel.Windows,willdean/Squirrel.Windows,GeertvanHorrik/Squirrel.Windows,jochenvangasse/Squirrel.Windows,JonMartinTx/AS400Report,punker76/Squirrel.Windows,yovannyr/Squirrel.Windows,flagbug/Squirrel.Windows,NeilSorensen/Squirrel.Windows,punker76/Squirrel.Windows,1gurucoder/Squirrel.Windows,Squirrel/Squirrel.Windows,BarryThePenguin/Squirrel.Windows,ChaseFlorell/Squirrel.Windows,aneeff/Squirrel.Windows,sickboy/Squirrel.Windows,Katieleeb84/Squirrel.Windows,bowencode/Squirrel.Windows,jbeshir/Squirrel.Windows,hammerandchisel/Squirrel.Windows,yovannyr/Squirrel.Windows,EdZava/Squirrel.Windows,ruisebastiao/Squirrel.Windows,kenbailey/Squirrel.Windows,jochenvangasse/Squirrel.Windows,airtimemedia/Squirrel.Windows,allanrsmith/Squirrel.Windows,josenbo/Squirrel.Windows
|
src/Squirrel/NativeMethods.cs
|
src/Squirrel/NativeMethods.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Squirrel
{
static class NativeMethods
{
[DllImport("version.dll", SetLastError = true)]
[return:MarshalAs(UnmanagedType.Bool)] public static extern bool GetFileVersionInfo(
string lpszFileName,
IntPtr dwHandleIgnored,
int dwLen,
[MarshalAs(UnmanagedType.LPArray)] byte[] lpData);
[DllImport("version.dll", SetLastError = true)]
public static extern int GetFileVersionInfoSize(
string lpszFileName,
IntPtr dwHandleIgnored);
[DllImport("version.dll")]
[return:MarshalAs(UnmanagedType.Bool)] public static extern bool VerQueryValue(
byte[] pBlock,
string pSubBlock,
out IntPtr pValue,
out int len);
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Squirrel
{
static class NativeMethods
{
[DllImport("version.dll", SetLastError = true)]
public static extern bool GetFileVersionInfo(
string lpszFileName,
IntPtr dwHandleIgnored,
int dwLen,
[MarshalAs(UnmanagedType.LPArray)] byte[] lpData);
[DllImport("version.dll", SetLastError = true)]
public static extern int GetFileVersionInfoSize(
string lpszFileName,
IntPtr dwHandleIgnored);
[DllImport("version.dll")]
public static extern bool VerQueryValue(byte[] pBlock, string pSubBlock, out IntPtr pValue, out int len);
}
}
|
mit
|
C#
|
76e2836875985193f5fa33d5707c5c8b570e3f87
|
Update ValuesOut.cs
|
EricZimmerman/RegistryPlugins
|
RegistryPlugin.BluetoothServicesBthPort/ValuesOut.cs
|
RegistryPlugin.BluetoothServicesBthPort/ValuesOut.cs
|
using System;
using RegistryPluginBase.Interfaces;
namespace RegistryPlugin.BluetoothServicesBthPort
{
public class ValuesOut:IValueOut
{
public ValuesOut(string btname, string address, DateTimeOffset? lastSeenKey)
{
Name = btname;
Address = address;
LastSeen = lastSeenKey?.UtcDateTime;
}
public string Name { get; }
public string Address { get; }
public DateTime? LastSeen { get; }
public string BatchKeyPath { get; set; }
public string BatchValueName { get; set; }
public string BatchValueData1 => $"Name: {Name}";
public string BatchValueData2 => $"Last seen: {LastSeen?.ToUniversalTime():yyyy-MM-dd HH:mm:ss.fffffff}";
public string BatchValueData3 => $"Address: {Address}";
}
}
|
using System;
using RegistryPluginBase.Interfaces;
namespace RegistryPlugin.BluetoothServicesBthPort
{
public class ValuesOut:IValueOut
{
public ValuesOut(string btname, string address, DateTimeOffset? lastSeenKey)
{
Name = btname;
Address = address;
LastSeen = lastSeenKey?.UtcDateTime;
}
public string Name { get; }
public string Address { get; }
public DateTime? LastSeen { get; }
public string BatchKeyPath { get; set; }
public string BatchValueName { get; set; }
public string BatchValueData1 => $"Name: {Name}";
public string BatchValueData2 => $"Last seen: {LastSeen?.ToUniversalTime():yyyy-MM-dd HH:mm:ss.fffffff})";
public string BatchValueData3 => $"Address: {Address}";
}
}
|
mit
|
C#
|
def2e56d849c821a47bfec9aaa05cd6ea35c8ca3
|
Fix for supporting Items without weights.
|
aliostad/RandomGen,aliostad/RandomGen
|
src/RandomGen/Fluent/IRandom.cs
|
src/RandomGen/Fluent/IRandom.cs
|
using System;
using System.Collections.Generic;
namespace RandomGen.Fluent
{
public interface IRandom : IFluentInterface
{
INumbers Numbers { get; }
INames Names { get; }
ITime Time { get; }
IText Text { get; }
IInternet Internet { get; }
IPhoneNumbers PhoneNumbers { get; }
/// <summary>
/// Returns a gen that chooses randomly from a list
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="items"></param>
/// <param name="weights">Optional weights affecting the likelihood of an item being chosen. Same length as items</param>
Func<T> Items<T>(IEnumerable<T> items, IEnumerable<double> weights = null);
/// <summary>
/// Returns a gen that chooses randomly with equal weight for each item.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="items"></param>
Func<T> Items<T>(params T[] items);
/// <summary>
/// Returns a gen that chooses randomly from an Enum values
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="weights">Optional weights affecting the likelihood of a value being chosen. Same length as Enum values</param>
Func<T> Enum<T>(IEnumerable<double> weights = null) where T : struct, IConvertible;
/// <summary>
/// Generates random country names
/// Based on System.Globalisation
/// </summary>
Func<string> Countries();
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RandomGen.Fluent
{
public interface IRandom : IFluentInterface
{
INumbers Numbers { get; }
INames Names { get; }
ITime Time { get; }
IText Text { get; }
IInternet Internet { get; }
IPhoneNumbers PhoneNumbers { get; }
/// <summary>
/// Returns a gen that chooses randomly from a list
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="items"></param>
/// <param name="weights">Optional weights affecting the likelihood of an item being chosen. Same length as items</param>
Func<T> Items<T>(IEnumerable<T> items, IEnumerable<double> weights);
/// <summary>
/// Returns a gen that chooses randomly with equal weight for each item.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="items"></param>
Func<T> Items<T>(params T[] items);
/// <summary>
/// Returns a gen that chooses randomly from an Enum values
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="weights">Optional weights affecting the likelihood of a value being chosen. Same length as Enum values</param>
Func<T> Enum<T>(IEnumerable<double> weights = null) where T : struct, IConvertible;
/// <summary>
/// Generates random country names
/// Based on System.Globalisation
/// </summary>
Func<string> Countries();
}
}
|
mit
|
C#
|
61de3c75402f55704c07da9128778f35b374a52f
|
Replace accidental tab with spaces
|
ppy/osu,UselessToucan/osu,peppy/osu,peppy/osu,UselessToucan/osu,NeoAdonis/osu,smoogipoo/osu,smoogipoo/osu,peppy/osu,peppy/osu-new,smoogipooo/osu,NeoAdonis/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu
|
osu.Game.Rulesets.Osu/Skinning/OsuSkinConfiguration.cs
|
osu.Game.Rulesets.Osu/Skinning/OsuSkinConfiguration.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Rulesets.Osu.Skinning
{
public enum OsuSkinConfiguration
{
HitCirclePrefix,
HitCircleOverlap,
SliderBorderSize,
SliderPathRadius,
AllowSliderBallTint,
CursorExpand,
CursorRotate,
HitCircleOverlayAboveNumber,
HitCircleOverlayAboveNumer, // Some old skins will have this typo
SpinnerFrequencyModulate
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Rulesets.Osu.Skinning
{
public enum OsuSkinConfiguration
{
HitCirclePrefix,
HitCircleOverlap,
SliderBorderSize,
SliderPathRadius,
AllowSliderBallTint,
CursorExpand,
CursorRotate,
HitCircleOverlayAboveNumber,
HitCircleOverlayAboveNumer, // Some old skins will have this typo
SpinnerFrequencyModulate
}
}
|
mit
|
C#
|
efbdf7a4f0544f168d321959fc6745a27ef07381
|
Update BinanceCrossCollateralWallet.cs
|
JKorf/Binance.Net
|
Binance.Net/Objects/Spot/Futures/BinanceCrossCollateralWallet.cs
|
Binance.Net/Objects/Spot/Futures/BinanceCrossCollateralWallet.cs
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Binance.Net.Objects.Spot.Futures
{
/// <summary>
/// Cross colateral wallet info
/// </summary>
public class BinanceCrossCollateralWallet
{
/// <summary>
/// Total cross collateral
/// </summary>
public decimal TotalCrossCollateral { get; set; }
/// <summary>
/// Total borrowed
/// </summary>
public decimal TotalBorrowed { get; set; }
/// <summary>
/// Total interest
/// </summary>
public decimal TotalInterest { get; set; }
/// <summary>
/// Interest free limit
/// </summary>
public decimal InterestFreeLimit { get; set; }
/// <summary>
/// The asset
/// </summary>
public string Asset { get; set; } = "";
/// <summary>
/// Cross collaterals
/// </summary>
public IEnumerable<BinanceCrossCollateralWalletEntry> CrossCollaterals { get; set; } = new List<BinanceCrossCollateralWalletEntry>();
}
/// <summary>
/// Cross collateral data
/// </summary>
public class BinanceCrossCollateralWalletEntry
{
/// <summary>
/// Collateral coin
/// </summary>
public string CollateralCoin { get; set; } = "";
/// <summary>
/// Amount locked
/// </summary>
public decimal Locked { get; set; }
/// <summary>
/// Loan amount
/// </summary>
public decimal LoanAmount { get; set; }
/// <summary>
/// Current collateral rate
/// </summary>
public decimal CurrentCollateralRate { get; set; }
/// <summary>
/// Used interest free limit
/// </summary>
public decimal InterestFreeLimitUsed { get; set; }
/// <summary>
/// Principal interest
/// </summary>
public decimal PrincipalForInterest { get; set; }
/// <summary>
/// Interest
/// </summary>
public decimal Interest { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Binance.Net.Objects.Spot.Futures
{
/// <summary>
/// Cross colateral wallet info
/// </summary>
public class BinanceCrossCollateralWallet
{
/// <summary>
/// Total cross collateral
/// </summary>
public decimal TotalCrossCollateral { get; set; }
/// <summary>
/// Total borrowed
/// </summary>
public decimal TotalBorrowed { get; set; }
/// <summary>
/// The asset
/// </summary>
public string Asset { get; set; } = "";
/// <summary>
/// Cross collaterals
/// </summary>
public IEnumerable<BinanceCrossCollateralWalletEntry> CrossCollaterals { get; set; } = new List<BinanceCrossCollateralWalletEntry>();
}
/// <summary>
/// Cross collateral data
/// </summary>
public class BinanceCrossCollateralWalletEntry
{
/// <summary>
/// Collateral coin
/// </summary>
public string CollateralCoin { get; set; } = "";
/// <summary>
/// Amount locked
/// </summary>
public decimal Locked { get; set; }
/// <summary>
/// Loan amount
/// </summary>
public decimal LoanAmount { get; set; }
/// <summary>
/// Current collateral rate
/// </summary>
public decimal CurrentCollateralRate { get; set; }
}
}
|
mit
|
C#
|
c1d185063424bd77f5b7897141c2a3e394c8add8
|
remove debug messages
|
MrLeebo/unitystation,Necromunger/unitystation,Necromunger/unitystation,MrLeebo/unitystation,fomalsd/unitystation,fomalsd/unitystation,Lancemaker/unitystation,Necromunger/unitystation,MrLeebo/unitystation,Necromunger/unitystation,Necromunger/unitystation,Necromunger/unitystation,Lancemaker/unitystation,fomalsd/unitystation,fomalsd/unitystation,krille90/unitystation,krille90/unitystation,MrLeebo/unitystation,MrLeebo/unitystation,fomalsd/unitystation,MrLeebo/unitystation,fomalsd/unitystation,fomalsd/unitystation,krille90/unitystation
|
UnityProject/Assets/Scripts/Messages/Client/PostToChatMessage.cs
|
UnityProject/Assets/Scripts/Messages/Client/PostToChatMessage.cs
|
using System.Collections;
using InputControl;
using UnityEngine;
using UnityEngine.Networking;
using System;
using PlayGroup;
/// <summary>
/// Attempts to send a chat message to the server
/// </summary>
public class PostToChatMessage : ClientMessage<PostToChatMessage>
{
public ChatChannel Channels;
public string ChatMessageText;
public override IEnumerator Process()
{
yield return WaitFor(SentBy);
GameObject player = NetworkObject;
if(ValidRequest(player)) {
ChatModifier modifiers = player.GetComponent<PlayerScript>().GetCurrentChatModifiers();
ChatEvent chatEvent = new ChatEvent(ChatMessageText, player.name, Channels, modifiers);
ChatRelay.Instance.AddToChatLogServer(chatEvent);
}
}
//We want ChatEvent to be created on the server, so we're only passing the individual variables
public static PostToChatMessage Send(string message, ChatChannel channels)
{
var msg = new PostToChatMessage
{
Channels = channels,
ChatMessageText = message
};
msg.Send();
return msg;
}
public bool ValidRequest(GameObject player)
{
PlayerScript playerScript = player.GetComponent<PlayerScript>();
//Need to add system channel here so player can transmit system level events but not select it in the UI
ChatChannel availableChannels = playerScript.GetAvailableChannels() | ChatChannel.System;
if((playerScript.GetAvailableChannels() & Channels) == Channels){
return true;
}
return false;
}
public override string ToString()
{
return string.Format("[PostToChatMessage SentBy={0} ChatMessageText={1} Channels={2}]",
SentBy, ChatMessageText, Channels);
}
public override void Deserialize(NetworkReader reader)
{
base.Deserialize(reader);
Channels = (ChatChannel)reader.ReadUInt32();
ChatMessageText = reader.ReadString();
}
public override void Serialize(NetworkWriter writer)
{
base.Serialize(writer);
writer.Write((Int32)Channels);
writer.Write(ChatMessageText);
}
}
|
using System.Collections;
using InputControl;
using UnityEngine;
using UnityEngine.Networking;
using System;
using PlayGroup;
/// <summary>
/// Attempts to send a chat message to the server
/// </summary>
public class PostToChatMessage : ClientMessage<PostToChatMessage>
{
public ChatChannel Channels;
public string ChatMessageText;
public override IEnumerator Process()
{
yield return WaitFor(SentBy);
GameObject player = NetworkObject;
if(ValidRequest(player)) {
ChatModifier modifiers = player.GetComponent<PlayerScript>().GetCurrentChatModifiers();
ChatEvent chatEvent = new ChatEvent(ChatMessageText, player.name, Channels, modifiers);
ChatRelay.Instance.AddToChatLogServer(chatEvent);
}
}
//We want ChatEvent to be created on the server, so we're only passing the individual variables
public static PostToChatMessage Send(string message, ChatChannel channels)
{
var msg = new PostToChatMessage
{
Channels = channels,
ChatMessageText = message
};
msg.Send();
return msg;
}
public bool ValidRequest(GameObject player)
{
PlayerScript playerScript = player.GetComponent<PlayerScript>();
//Need to add system channel here so player can transmit system level events but not select it in the UI
ChatChannel availableChannels = playerScript.GetAvailableChannels() | ChatChannel.System;
if((playerScript.GetAvailableChannels() & Channels) == Channels){
return true;
}
Debug.Log("Player " + player.name);
Debug.Log("Available Channels " + availableChannels);
Debug.Log("Required Channels" + Channels);
return false;
}
public override string ToString()
{
return string.Format("[PostToChatMessage SentBy={0} ChatMessageText={1} Channels={2}]",
SentBy, ChatMessageText, Channels);
}
public override void Deserialize(NetworkReader reader)
{
base.Deserialize(reader);
Channels = (ChatChannel)reader.ReadUInt32();
ChatMessageText = reader.ReadString();
}
public override void Serialize(NetworkWriter writer)
{
base.Serialize(writer);
writer.Write((Int32)Channels);
writer.Write(ChatMessageText);
}
}
|
agpl-3.0
|
C#
|
b2247ea59c9972f95098d13b43699640fe70da45
|
Update integrity hash for moment.min.js
|
martincostello/api,martincostello/api,martincostello/api
|
src/API/Pages/Shared/_Scripts.cshtml
|
src/API/Pages/Shared/_Scripts.cshtml
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.0/js/bootstrap.bundle.min.js" integrity="sha512-9GacT4119eY3AcosfWtHMsT5JyZudrexyEVzTBWV3viP/YfB9e2pEy3N7WXL3SV6ASXpTU0vzzSxsbfsuUH4sQ==" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js" integrity="sha512-aVKKRRi/Q/YV+4mjoKBsE4x3H+BkegoM/em46NNlCqNTmUYADjBbeNefNxYV7giUp0VxICtqdrbqU7iVaeZNXA==" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js" integrity="sha512-jNDtFf7qgU0eH/+Z42FG4fw3w7DM/9zbgNPe3wfJlCylVDTT3IgKW5r92Vy9IHa6U50vyMz5gRByIu4YIXFtaQ==" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js" integrity="sha512-+H4iLjY3JsKiF2V6N366in5IQHj2uEsGV7Pp/GRcm0fn76aPAk5V8xB6n8fQhhSonTqTXs/klFz4D0GIn6Br9g==" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
@{
var analyticsId = Options.Value.Analytics?.Google;
}
@if (!string.IsNullOrWhiteSpace(analyticsId))
{
<script src="https://www.googletagmanager.com/gtag/js?id=@(analyticsId)" async></script>
}
<environment names="Development">
<script src="~/assets/js/site.js" asp-append-version="true" defer></script>
</environment>
<environment names="Staging,Production">
<script src="~/assets/js/site.min.js" asp-append-version="true" defer></script>
</environment>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.0/js/bootstrap.bundle.min.js" integrity="sha512-9GacT4119eY3AcosfWtHMsT5JyZudrexyEVzTBWV3viP/YfB9e2pEy3N7WXL3SV6ASXpTU0vzzSxsbfsuUH4sQ==" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js" integrity="sha512-aVKKRRi/Q/YV+4mjoKBsE4x3H+BkegoM/em46NNlCqNTmUYADjBbeNefNxYV7giUp0VxICtqdrbqU7iVaeZNXA==" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js" integrity="sha512-jNDtFf7qgU0eH/+Z42FG4fw3w7DM/9zbgNPe3wfJlCylVDTT3IgKW5r92Vy9IHa6U50vyMz5gRByIu4YIXFtaQ==" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js" integrity="sha512-CryKbMe7sjSCDPl18jtJI5DR5jtkUWxPXWaLCst6QjH8wxDexfRJic2WRmRXmstr2Y8SxDDWuBO6CQC6IE4KTA==" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
@{
var analyticsId = Options.Value.Analytics?.Google;
}
@if (!string.IsNullOrWhiteSpace(analyticsId))
{
<script src="https://www.googletagmanager.com/gtag/js?id=@(analyticsId)" async></script>
}
<environment names="Development">
<script src="~/assets/js/site.js" asp-append-version="true" defer></script>
</environment>
<environment names="Staging,Production">
<script src="~/assets/js/site.min.js" asp-append-version="true" defer></script>
</environment>
|
mit
|
C#
|
f06445f0d412ea41d2f1d82b518907289bc1a4ed
|
Load next level after 0.33 seconds to prvent button from being stuck and animation to finish
|
antila/castle-game-jam-2016
|
Assets/Demo/Scripts/UI/GameScreen.cs
|
Assets/Demo/Scripts/UI/GameScreen.cs
|
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class GameScreen : MonoBehaviour {
bool allowLevelLoad = true;
string nextLevel;
void OnEnable() {
allowLevelLoad = true;
}
public void LoadScene(string sceneName)
{
if (allowLevelLoad) {
allowLevelLoad = false;
nextLevel = sceneName;
Invoke("LoadNextLevel", 0.33f);
}
}
private void LoadNextLevel()
{
SceneManager.LoadScene(nextLevel);
}
}
|
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class GameScreen : MonoBehaviour {
bool allowLevelLoad = true;
void OnEnable() {
allowLevelLoad = true;
}
public void LoadScene(string sceneName)
{
if (allowLevelLoad) {
allowLevelLoad = false;
SceneManager.LoadScene(sceneName);
}
}
// Update is called once per frame
void Update () {
}
}
|
mit
|
C#
|
866cfefd809975e106e791872ef8cdd099413bda
|
remove unused using
|
bitwarden/core,bitwarden/core,bitwarden/core,bitwarden/core
|
src/Core/Models/TwoFactorProvider.cs
|
src/Core/Models/TwoFactorProvider.cs
|
using Bit.Core.Enums;
using Newtonsoft.Json;
using System.Collections.Generic;
using U2F.Core.Utils;
namespace Bit.Core.Models
{
public class TwoFactorProvider
{
public bool Enabled { get; set; }
public Dictionary<string, object> MetaData { get; set; } = new Dictionary<string, object>();
public class U2fMetaData
{
public U2fMetaData() { }
public U2fMetaData(dynamic o)
{
Name = o.Name;
KeyHandle = o.KeyHandle;
PublicKey = o.PublicKey;
Certificate = o.Certificate;
Counter = o.Counter;
Compromised = o.Compromised;
}
public string Name { get; set; }
public string KeyHandle { get; set; }
[JsonIgnore]
public byte[] KeyHandleBytes =>
string.IsNullOrWhiteSpace(KeyHandle) ? null : Utils.Base64StringToByteArray(KeyHandle);
public string PublicKey { get; set; }
[JsonIgnore]
public byte[] PublicKeyBytes =>
string.IsNullOrWhiteSpace(PublicKey) ? null : Utils.Base64StringToByteArray(PublicKey);
public string Certificate { get; set; }
[JsonIgnore]
public byte[] CertificateBytes =>
string.IsNullOrWhiteSpace(Certificate) ? null : Utils.Base64StringToByteArray(Certificate);
public uint Counter { get; set; }
public bool Compromised { get; set; }
}
public static bool RequiresPremium(TwoFactorProviderType type)
{
switch(type)
{
case TwoFactorProviderType.Duo:
case TwoFactorProviderType.YubiKey:
case TwoFactorProviderType.U2f:
return true;
default:
return false;
}
}
}
}
|
using Bit.Core.Enums;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using U2F.Core.Utils;
namespace Bit.Core.Models
{
public class TwoFactorProvider
{
public bool Enabled { get; set; }
public Dictionary<string, object> MetaData { get; set; } = new Dictionary<string, object>();
public class U2fMetaData
{
public U2fMetaData() { }
public U2fMetaData(dynamic o)
{
Name = o.Name;
KeyHandle = o.KeyHandle;
PublicKey = o.PublicKey;
Certificate = o.Certificate;
Counter = o.Counter;
Compromised = o.Compromised;
}
public string Name { get; set; }
public string KeyHandle { get; set; }
[JsonIgnore]
public byte[] KeyHandleBytes =>
string.IsNullOrWhiteSpace(KeyHandle) ? null : Utils.Base64StringToByteArray(KeyHandle);
public string PublicKey { get; set; }
[JsonIgnore]
public byte[] PublicKeyBytes =>
string.IsNullOrWhiteSpace(PublicKey) ? null : Utils.Base64StringToByteArray(PublicKey);
public string Certificate { get; set; }
[JsonIgnore]
public byte[] CertificateBytes =>
string.IsNullOrWhiteSpace(Certificate) ? null : Utils.Base64StringToByteArray(Certificate);
public uint Counter { get; set; }
public bool Compromised { get; set; }
}
public static bool RequiresPremium(TwoFactorProviderType type)
{
switch(type)
{
case TwoFactorProviderType.Duo:
case TwoFactorProviderType.YubiKey:
case TwoFactorProviderType.U2f:
return true;
default:
return false;
}
}
}
}
|
agpl-3.0
|
C#
|
664c824f8bfa49beb72300ec869a8004d23243c7
|
Use Dictionary and removes setter
|
lunet-io/markdig
|
src/Markdig/MarkdownParserContext.cs
|
src/Markdig/MarkdownParserContext.cs
|
using System.Collections.Generic;
namespace Markdig
{
/// <summary>
/// Provides a context that can be used as part of parsing Markdown documents.
/// </summary>
public sealed class MarkdownParserContext
{
/// <summary>
/// Gets or sets the context property collection.
/// </summary>
public Dictionary<object, object> Properties { get; }
/// <summary>
/// Initializes a new instance of the <see cref="MarkdownParserContext" /> class.
/// </summary>
public MarkdownParserContext()
{
Properties = new Dictionary<object, object>();
}
}
}
|
using System.Collections.Generic;
namespace Markdig
{
/// <summary>
/// Provides a context that can be used as part of parsing Markdown documents.
/// </summary>
public sealed class MarkdownParserContext
{
/// <summary>
/// Gets or sets the context property collection.
/// </summary>
public IDictionary<object, object> Properties { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="MarkdownParserContext" /> class.
/// </summary>
public MarkdownParserContext()
{
Properties = new Dictionary<object, object>();
}
}
}
|
bsd-2-clause
|
C#
|
25be7265f20d4a4651cd607cabe4cd6797c77169
|
Add DebuggerHidden attribute so VS doesn't break when `Break on User-Unhandled Exceptions` is checked
|
illfang/CefSharp,twxstar/CefSharp,windygu/CefSharp,haozhouxu/CefSharp,yoder/CefSharp,wangzheng888520/CefSharp,AJDev77/CefSharp,gregmartinhtc/CefSharp,battewr/CefSharp,rlmcneary2/CefSharp,windygu/CefSharp,wangzheng888520/CefSharp,battewr/CefSharp,jamespearce2006/CefSharp,zhangjingpu/CefSharp,gregmartinhtc/CefSharp,Haraguroicha/CefSharp,NumbersInternational/CefSharp,haozhouxu/CefSharp,NumbersInternational/CefSharp,rlmcneary2/CefSharp,AJDev77/CefSharp,battewr/CefSharp,ITGlobal/CefSharp,rlmcneary2/CefSharp,jamespearce2006/CefSharp,twxstar/CefSharp,ITGlobal/CefSharp,haozhouxu/CefSharp,VioletLife/CefSharp,windygu/CefSharp,VioletLife/CefSharp,dga711/CefSharp,yoder/CefSharp,VioletLife/CefSharp,zhangjingpu/CefSharp,AJDev77/CefSharp,AJDev77/CefSharp,Livit/CefSharp,battewr/CefSharp,dga711/CefSharp,Haraguroicha/CefSharp,zhangjingpu/CefSharp,Haraguroicha/CefSharp,yoder/CefSharp,joshvera/CefSharp,NumbersInternational/CefSharp,dga711/CefSharp,joshvera/CefSharp,twxstar/CefSharp,ITGlobal/CefSharp,jamespearce2006/CefSharp,wangzheng888520/CefSharp,windygu/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,joshvera/CefSharp,zhangjingpu/CefSharp,twxstar/CefSharp,Livit/CefSharp,Haraguroicha/CefSharp,Haraguroicha/CefSharp,illfang/CefSharp,NumbersInternational/CefSharp,illfang/CefSharp,rlmcneary2/CefSharp,gregmartinhtc/CefSharp,joshvera/CefSharp,yoder/CefSharp,dga711/CefSharp,illfang/CefSharp,haozhouxu/CefSharp,jamespearce2006/CefSharp,jamespearce2006/CefSharp,ITGlobal/CefSharp,wangzheng888520/CefSharp,VioletLife/CefSharp,Livit/CefSharp
|
CefSharp.Example/AsyncBoundObject.cs
|
CefSharp.Example/AsyncBoundObject.cs
|
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Diagnostics;
using System.Threading;
namespace CefSharp.Example
{
public class AsyncBoundObject
{
//We expect an exception here, so tell VS to ignore
[DebuggerHidden]
public void Error()
{
throw new Exception("This is an exception coming from C#");
}
//We expect an exception here, so tell VS to ignore
[DebuggerHidden]
public int Div(int divident, int divisor)
{
return divident / divisor;
}
public string Hello(string name)
{
return "Hello " + name;
}
public void DoSomething()
{
Thread.Sleep(1000);
}
}
}
|
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Threading;
namespace CefSharp.Example
{
public class AsyncBoundObject
{
public void Error()
{
throw new Exception("This is an exception coming from C#");
}
public int Div(int divident, int divisor)
{
return divident / divisor;
}
public string Hello(string name)
{
return "Hello " + name;
}
public void DoSomething()
{
Thread.Sleep(1000);
}
}
}
|
bsd-3-clause
|
C#
|
19c2f56cd3a386dce970c7191dff463282d981c6
|
Fix #15 - When an error occurs in Channel initialization, do not terminate the Channels observable
|
pragmatrix/NEventSocket,danbarua/NEventSocket,danbarua/NEventSocket,pragmatrix/NEventSocket
|
src/NEventSocket/OutboundListener.cs
|
src/NEventSocket/OutboundListener.cs
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="OutboundListener.cs" company="Dan Barua">
// (C) Dan Barua and contributors. Licensed under the Mozilla Public License.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace NEventSocket
{
using System;
using System.Reactive.Linq;
using NEventSocket.Channels;
using NEventSocket.Logging;
using NEventSocket.Sockets;
/// <summary>
/// Listens for Outbound connections from FreeSwitch, providing notifications via the Connections observable.
/// </summary>
public class OutboundListener : ObservableListener<OutboundSocket>
{
private static readonly ILog Log = LogProvider.GetCurrentClassLogger();
private IObservable<Channel> channels;
/// <summary>
/// Initializes a new OutboundListener on the given port.
/// Pass 0 as the port to auto-assign a dynamic port. Usually used for testing.
/// </summary>
/// <param name="port">The Tcp port to listen on.</param>
public OutboundListener(int port) : base(port, tcpClient => new OutboundSocket(tcpClient))
{
channels = Connections.SelectMany(
async socket =>
{
await socket.Connect().ConfigureAwait(false);
return new Channel(socket);
});
}
/// <summary>
/// Gets an observable sequence of incoming calls wrapped as <seealso cref="Channel"/> abstractions.
/// </summary>
public IObservable<Channel> Channels
{
get
{
//if there is an error connecting the channel, eg. FS hangs up and goes away
//before we can do the connect/channel_data handshake
//then carry on allowing new connections
return channels
.Do(_ => { }, ex => Log.ErrorException("Unable to connect Channel", ex))
.OnErrorResumeNext(channels);
}
}
}
}
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="OutboundListener.cs" company="Dan Barua">
// (C) Dan Barua and contributors. Licensed under the Mozilla Public License.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace NEventSocket
{
using System;
using System.Reactive.Linq;
using NEventSocket.Channels;
using NEventSocket.Sockets;
/// <summary>
/// Listens for Outbound connections from FreeSwitch, providing notifications via the Connections observable.
/// </summary>
public class OutboundListener : ObservableListener<OutboundSocket>
{
/// <summary>
/// Initializes a new OutboundListener on the given port.
/// Pass 0 as the port to auto-assign a dynamic port. Usually used for testing.
/// </summary>
/// <param name="port">The Tcp port to listen on.</param>
public OutboundListener(int port) : base(port, tcpClient => new OutboundSocket(tcpClient))
{
}
/// <summary>
/// Gets an observable sequence of incoming calls wrapped as <seealso cref="Channel"/> abstractions.
/// </summary>
public IObservable<Channel> Channels
{
get
{
return Connections.Select(c => c.GetChannel().Result).AsObservable();
}
}
}
}
|
mpl-2.0
|
C#
|
caba78cb5d0ebd67053537e634d613fae733933c
|
Copy score during submission process to ensure it isn't modified
|
peppy/osu,ppy/osu,smoogipoo/osu,ppy/osu,peppy/osu,ppy/osu,peppy/osu-new,smoogipoo/osu,UselessToucan/osu,UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,UselessToucan/osu,smoogipooo/osu
|
osu.Game/Screens/Play/SoloPlayer.cs
|
osu.Game/Screens/Play/SoloPlayer.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Diagnostics;
using osu.Game.Online.API;
using osu.Game.Online.Rooms;
using osu.Game.Online.Solo;
using osu.Game.Rulesets;
using osu.Game.Scoring;
namespace osu.Game.Screens.Play
{
public class SoloPlayer : SubmittingPlayer
{
public SoloPlayer()
: this(null)
{
}
protected SoloPlayer(PlayerConfiguration configuration = null)
: base(configuration)
{
}
protected override APIRequest<APIScoreToken> CreateTokenRequest()
{
if (!(Beatmap.Value.BeatmapInfo.OnlineBeatmapID is int beatmapId))
return null;
if (!(Ruleset.Value.ID is int rulesetId) || Ruleset.Value.ID > ILegacyRuleset.MAX_LEGACY_RULESET_ID)
return null;
return new CreateSoloScoreRequest(beatmapId, rulesetId, Game.VersionHash);
}
protected override bool HandleTokenRetrievalFailure(Exception exception) => false;
protected override APIRequest<MultiplayerScore> CreateSubmissionRequest(Score score, long token)
{
var scoreCopy = score.DeepClone();
var beatmap = scoreCopy.ScoreInfo.Beatmap;
Debug.Assert(beatmap.OnlineBeatmapID != null);
int beatmapId = beatmap.OnlineBeatmapID.Value;
return new SubmitSoloScoreRequest(beatmapId, token, scoreCopy.ScoreInfo);
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Diagnostics;
using osu.Game.Online.API;
using osu.Game.Online.Rooms;
using osu.Game.Online.Solo;
using osu.Game.Rulesets;
using osu.Game.Scoring;
namespace osu.Game.Screens.Play
{
public class SoloPlayer : SubmittingPlayer
{
public SoloPlayer()
: this(null)
{
}
protected SoloPlayer(PlayerConfiguration configuration = null)
: base(configuration)
{
}
protected override APIRequest<APIScoreToken> CreateTokenRequest()
{
if (!(Beatmap.Value.BeatmapInfo.OnlineBeatmapID is int beatmapId))
return null;
if (!(Ruleset.Value.ID is int rulesetId) || Ruleset.Value.ID > ILegacyRuleset.MAX_LEGACY_RULESET_ID)
return null;
return new CreateSoloScoreRequest(beatmapId, rulesetId, Game.VersionHash);
}
protected override bool HandleTokenRetrievalFailure(Exception exception) => false;
protected override APIRequest<MultiplayerScore> CreateSubmissionRequest(Score score, long token)
{
var beatmap = score.ScoreInfo.Beatmap;
Debug.Assert(beatmap.OnlineBeatmapID != null);
int beatmapId = beatmap.OnlineBeatmapID.Value;
return new SubmitSoloScoreRequest(beatmapId, token, score.ScoreInfo);
}
}
}
|
mit
|
C#
|
f6d1b5803ff263c67b4ee8d52b5ab174653b6d85
|
Fix potential NRE
|
SnowflakePowered/snowflake,RonnChyran/snowflake,RonnChyran/snowflake,RonnChyran/snowflake,SnowflakePowered/snowflake,SnowflakePowered/snowflake
|
src/Snowflake.Support.Scraping.Primitives/ResultCuller.cs
|
src/Snowflake.Support.Scraping.Primitives/ResultCuller.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Snowflake.Extensibility;
using Snowflake.Scraping;
using Snowflake.Scraping.Extensibility;
using Snowflake.Support.Scraping.Primitives.Utility;
using F23.StringSimilarity;
namespace Snowflake.Support.Scraping.Primitives
{
[Plugin("ScrapingPrimitives-Culler")]
public class ResultCuller : Culler
{
public ResultCuller()
: base(typeof(ResultCuller), "result")
{
this.Comparator = new Jaccard(3);
}
public Jaccard Comparator { get; }
public override IEnumerable<ISeed> Filter(IEnumerable<ISeed> seedsToTrim, ISeedRootContext context)
{
var clientResult = seedsToTrim.FirstOrDefault(s => s.Source == GameScrapeContext.ClientSeedSource);
if (clientResult != null)
{
yield return clientResult;
yield break;
}
var crc32Results = seedsToTrim.Where(s => context[s.Parent]?.Content.Type == "search_crc32");
var mostDetailedCrc32 =
crc32Results.OrderByDescending(s => context.GetChildren(s).Count()).FirstOrDefault();
var mostDetailedTitle = (from seed in seedsToTrim
let parent = context[seed.Parent]
where parent?.Content.Type == "search_title"
let title = context.GetChildren(seed).FirstOrDefault(s => s.Content.Type == "title")
where title != null
let r = title.Content.Value
let distance = this.Comparator.Distance(r.NormalizeTitle(), parent?.Content.Value.NormalizeTitle())
orderby distance ascending, context.GetChildren(seed).Count() descending
select seed).FirstOrDefault();
yield return (from seed in new[] {mostDetailedCrc32, mostDetailedTitle}
orderby context.GetChildren(seed).Count() descending
select seed).FirstOrDefault();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Snowflake.Extensibility;
using Snowflake.Scraping;
using Snowflake.Scraping.Extensibility;
using Snowflake.Support.Scraping.Primitives.Utility;
using F23.StringSimilarity;
namespace Snowflake.Support.Scraping.Primitives
{
[Plugin("ScrapingPrimitives-Culler")]
public class ResultCuller : Culler
{
public ResultCuller()
: base(typeof(ResultCuller), "result")
{
this.Comparator = new Jaccard(3);
}
public Jaccard Comparator { get; }
public override IEnumerable<ISeed> Filter(IEnumerable<ISeed> seedsToTrim, ISeedRootContext context)
{
var clientResult = seedsToTrim.FirstOrDefault(s => s.Source == GameScrapeContext.ClientSeedSource);
if (clientResult != null)
{
yield return clientResult;
yield break;
}
var crc32Results = seedsToTrim.Where(s => context[s.Parent]?.Content.Type == "search_crc32");
var mostDetailedCrc32 =
crc32Results.OrderByDescending(s => context.GetChildren(s).Count()).FirstOrDefault();
var mostDetailedTitle = (from seed in seedsToTrim
let parent = context[seed.Parent]
where parent?.Content.Type == "search_title"
let title = context.GetChildren(seed).FirstOrDefault(s => s.Content.Type == "title")
where title != null
let r = title.Content.Value
let distance = this.Comparator.Distance(r.NormalizeTitle(), parent.Content.Value.NormalizeTitle())
orderby distance ascending, context.GetChildren(seed).Count() descending
select seed).FirstOrDefault();
yield return (from seed in new[] {mostDetailedCrc32, mostDetailedTitle}
orderby context.GetChildren(seed).Count() descending
select seed).FirstOrDefault();
}
}
}
|
mpl-2.0
|
C#
|
c6fe8587e3c6c023db6fe81f77a75ee4de33a612
|
Read build from VersionCode
|
ppy/osu,ppy/osu,UselessToucan/osu,johnneijzen/osu,EVAST9919/osu,UselessToucan/osu,ZLima12/osu,UselessToucan/osu,smoogipooo/osu,NeoAdonis/osu,NeoAdonis/osu,smoogipoo/osu,peppy/osu,ZLima12/osu,ppy/osu,smoogipoo/osu,peppy/osu,smoogipoo/osu,johnneijzen/osu,peppy/osu,EVAST9919/osu,2yangk23/osu,2yangk23/osu,NeoAdonis/osu,peppy/osu-new
|
osu.Android/OsuGameAndroid.cs
|
osu.Android/OsuGameAndroid.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 Android.App;
using osu.Game;
namespace osu.Android
{
public class OsuGameAndroid : OsuGame
{
public override Version AssemblyVersion
{
get
{
string versionName = Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0).VersionCode.ToString();
try
{
// undo play store version garbling
return new Version(int.Parse(versionName.Substring(0, 4)), int.Parse(versionName.Substring(4, 4)), int.Parse(versionName.Substring(8, 1)));
}
catch
{
}
return new Version(versionName);
}
}
}
}
|
// 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 Android.App;
using osu.Game;
namespace osu.Android
{
public class OsuGameAndroid : OsuGame
{
public override Version AssemblyVersion => new Version(Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0).VersionName);
}
}
|
mit
|
C#
|
6cae42be6f80004c92acb2b299da24d8379b471a
|
Update UnicodeTypeMaps.cs
|
SixLabors/Fonts
|
tests/SixLabors.Fonts.Tests/Unicode/UnicodeTypeMaps.cs
|
tests/SixLabors.Fonts.Tests/Unicode/UnicodeTypeMaps.cs
|
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Collections.Generic;
using SixLabors.Fonts.Unicode;
namespace SixLabors.Fonts.Tests.Unicode
{
internal static class UnicodeTypeMaps
{
public static readonly Dictionary<string, BidiCharacterType> BidiCharacterTypeMap
= new Dictionary<string, BidiCharacterType>(StringComparer.OrdinalIgnoreCase)
{
{ "L", BidiCharacterType.LeftToRight },
{ "R", BidiCharacterType.RightToLeft },
{ "AL", BidiCharacterType.ArabicLetter },
{ "EN", BidiCharacterType.EuropeanNumber },
{ "ES", BidiCharacterType.EuropeanSeparator },
{ "ET", BidiCharacterType.EuropeanTerminator },
{ "AN", BidiCharacterType.ArabicNumber },
{ "CS", BidiCharacterType.CommonSeparator },
{ "NSM", BidiCharacterType.NonspacingMark },
{ "BN", BidiCharacterType.BoundaryNeutral },
{ "B", BidiCharacterType.ParagraphSeparator },
{ "S", BidiCharacterType.SegmentSeparator },
{ "WS", BidiCharacterType.Whitespace },
{ "ON", BidiCharacterType.OtherNeutral },
{ "LRE", BidiCharacterType.LeftToRightEmbedding },
{ "LRO", BidiCharacterType.LeftToRightOverride },
{ "RLE", BidiCharacterType.RightToLeftEmbedding },
{ "RLO", BidiCharacterType.RightToLeftOverride },
{ "PDF", BidiCharacterType.PopDirectinoalFormat },
{ "LRI", BidiCharacterType.LeftToRightIsolate },
{ "RLI", BidiCharacterType.RightToLeftIsolate },
{ "FSI", BidiCharacterType.FirstStrongIsolate },
{ "PDI", BidiCharacterType.PopDirectionalIsolate },
};
}
}
|
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Collections.Generic;
using SixLabors.Fonts.Unicode;
namespace SixLabors.Fonts.Tests.Unicode
{
public static class UnicodeTypeMaps
{
public static readonly Dictionary<string, BidiCharacterType> BidiCharacterTypeMap
= new Dictionary<string, BidiCharacterType>(StringComparer.OrdinalIgnoreCase)
{
{ "L", BidiCharacterType.LeftToRight },
{ "R", BidiCharacterType.RightToLeft },
{ "AL", BidiCharacterType.ArabicLetter },
{ "EN", BidiCharacterType.EuropeanNumber },
{ "ES", BidiCharacterType.EuropeanSeparator },
{ "ET", BidiCharacterType.EuropeanTerminator },
{ "AN", BidiCharacterType.ArabicNumber },
{ "CS", BidiCharacterType.CommonSeparator },
{ "NSM", BidiCharacterType.NonspacingMark },
{ "BN", BidiCharacterType.BoundaryNeutral },
{ "B", BidiCharacterType.ParagraphSeparator },
{ "S", BidiCharacterType.SegmentSeparator },
{ "WS", BidiCharacterType.Whitespace },
{ "ON", BidiCharacterType.OtherNeutral },
{ "LRE", BidiCharacterType.LeftToRightEmbedding },
{ "LRO", BidiCharacterType.LeftToRightOverride },
{ "RLE", BidiCharacterType.RightToLeftEmbedding },
{ "RLO", BidiCharacterType.RightToLeftOverride },
{ "PDF", BidiCharacterType.PopDirectinoalFormat },
{ "LRI", BidiCharacterType.LeftToRightIsolate },
{ "RLI", BidiCharacterType.RightToLeftIsolate },
{ "FSI", BidiCharacterType.FirstStrongIsolate },
{ "PDI", BidiCharacterType.PopDirectionalIsolate },
};
}
}
|
apache-2.0
|
C#
|
3aad578ae24d9f7bc35af44fa0e40c7d496a7deb
|
Update index.cshtml
|
reactiveui/website,reactiveui/website,reactiveui/website,reactiveui/website
|
input/docs/handbook/index.cshtml
|
input/docs/handbook/index.cshtml
|
Order: 15
---
..
|
Order: 15
---
|
mit
|
C#
|
950d94455153ed462add1c0a3b9200abb25ff4a5
|
Fix Connection_Player handler
|
ethanmoffat/EndlessClient
|
EOLib/Net/Handlers/ConnectionPlayerHandler.cs
|
EOLib/Net/Handlers/ConnectionPlayerHandler.cs
|
// Original Work Copyright (c) Ethan Moffat 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file
using System.Threading.Tasks;
using EOLib.Net.Communication;
using EOLib.Net.PacketProcessing;
namespace EOLib.Net.Handlers
{
/// <summary>
/// Handles incoming CONNECTION_PLAYER packets which are used for updating sequence numbers in the EO protocol
/// </summary>
public class ConnectionPlayerHandler : IPacketHandler
{
private readonly IPacketProcessorActions _packetProcessorActions;
private readonly IPacketSendService _packetSendService;
public PacketFamily Family { get { return PacketFamily.Connection; } }
public PacketAction Action { get { return PacketAction.Player; } }
public bool CanHandle { get { return true; } }
public ConnectionPlayerHandler(IPacketProcessorActions packetProcessorActions,
IPacketSendService packetSendService)
{
_packetProcessorActions = packetProcessorActions;
_packetSendService = packetSendService;
}
public async Task<bool> HandlePacket(IPacket packet)
{
var seq1 = packet.ReadShort();
var seq2 = packet.ReadChar();
_packetProcessorActions.SetUpdatedBaseSequenceNumber(seq1, seq2);
var response = new PacketBuilder(PacketFamily.Connection, PacketAction.Ping).Build();
try
{
await _packetSendService.SendPacketAsync(response);
}
catch (NoDataSentException)
{
return false;
}
return true;
}
}
}
|
// Original Work Copyright (c) Ethan Moffat 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file
using System.Threading.Tasks;
using EOLib.Net.Communication;
using EOLib.Net.PacketProcessing;
namespace EOLib.Net.Handlers
{
/// <summary>
/// Handles incoming CONNECTION_PLAYER packets which are used for updating sequence numbers in the EO protocol
/// </summary>
public class ConnectionPlayerHandler : IPacketHandler
{
private readonly IPacketProcessorActions _packetProcessorActions;
private readonly IPacketSendService _packetSendService;
public PacketFamily Family { get { return PacketFamily.Connection; } }
public PacketAction Action { get { return PacketAction.Player; } }
public bool CanHandle { get { return true; } }
public ConnectionPlayerHandler(IPacketProcessorActions packetProcessorActions,
IPacketSendService packetSendService)
{
_packetProcessorActions = packetProcessorActions;
_packetSendService = packetSendService;
}
public async Task<bool> HandlePacket(IPacket packet)
{
var seq1 = packet.ReadShort();
var seq2 = packet.ReadByte();
_packetProcessorActions.SetUpdatedBaseSequenceNumber(seq1, seq2);
var response = new PacketBuilder(PacketFamily.Connection, PacketAction.Ping).Build();
try
{
await _packetSendService.SendPacketAsync(response);
}
catch (NoDataSentException)
{
return false;
}
return true;
}
}
}
|
mit
|
C#
|
dc3aaf40562da13babb0a88716bf91caceff48b0
|
fix spelling error
|
loresoft/ShellTools
|
Source/ShellTools/Commands/CopyPathCommand.cs
|
Source/ShellTools/Commands/CopyPathCommand.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
using ShellTools.Utility;
namespace ShellTools.Commands
{
public class CopyPathCommand : ShellCommandBase
{
public override bool TryCommand(ShellToolsArguments arguments, out int errorCode)
{
errorCode = 0;
if (!arguments.Command.Equals(this.CommandName, StringComparison.OrdinalIgnoreCase))
return false;
string fullPath = Path.GetFullPath(arguments.Path);
Clipboard.SetText(fullPath);
return true;
}
public override string DisplayName
{
get { return "Copy Path to Clipboard"; }
}
protected override string GetSendToPath()
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.SendTo);
path = Path.Combine(path, "Clipboard (as Full Path).lnk");
return path;
}
public override int IconIndex
{
get { return 134; }
}
public override string CommandName
{
get { return "CopyPath"; }
}
public override string Description
{
get { return "Copy the full path to the clipboard."; }
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
using ShellTools.Utility;
namespace ShellTools.Commands
{
public class CopyPathCommand : ShellCommandBase
{
public override bool TryCommand(ShellToolsArguments arguments, out int errorCode)
{
errorCode = 0;
if (!arguments.Command.Equals(this.CommandName, StringComparison.OrdinalIgnoreCase))
return false;
string fullPath = Path.GetFullPath(arguments.Path);
Clipboard.SetText(fullPath);
return true;
}
public override string DisplayName
{
get { return "Copy Path to Clipbard"; }
}
protected override string GetSendToPath()
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.SendTo);
path = Path.Combine(path, "Clipboard (as Full Path).lnk");
return path;
}
public override int IconIndex
{
get { return 134; }
}
public override string CommandName
{
get { return "CopyPath"; }
}
public override string Description
{
get { return "Copy the full path to the clipboard."; }
}
}
}
|
apache-2.0
|
C#
|
e6d3f54cf7e992b7320a4e5796d3ee56f31def95
|
Change the way version is displayed
|
omniSpectrum/omniBill
|
appCS/omniBill/Pages/AboutPage.xaml.cs
|
appCS/omniBill/Pages/AboutPage.xaml.cs
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using omniBill.InnerComponents.Localization;
namespace omniBill.pages
{
/// <summary>
/// Interaction logic for AboutPage.xaml
/// </summary>
public partial class AboutPage : Page
{
public AboutPage()
{
InitializeComponent();
Version v = Assembly.GetEntryAssembly().GetName().Version;
String patch = (v.Build != 0) ? "." + v.Build.ToString() : String.Empty;
lbVersion.Text = String.Format("v{0}.{1}{2}", v.Major, v.Minor, patch);
}
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using omniBill.InnerComponents.Localization;
namespace omniBill.pages
{
/// <summary>
/// Interaction logic for AboutPage.xaml
/// </summary>
public partial class AboutPage : Page
{
public AboutPage()
{
InitializeComponent();
Version v = Assembly.GetEntryAssembly().GetName().Version;
lbVersion.Text = String.Format("v{0}.{1}.{2}", v.Major, v.Minor, v.Build);
}
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
}
}
|
epl-1.0
|
C#
|
bb4ae4b6eb07402ced04a046e0bbd53e8283ebc9
|
Update AssemblyInfo.cs
|
faniereynders/WebApiProxy,lust4life/WebApiProxy
|
WebApiProxy.Server/Properties/AssemblyInfo.cs
|
WebApiProxy.Server/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("WebApi Proxy Provider")]
[assembly: AssemblyDescription("Provides an endpoint for ASP.NET Web Api services to serve a JavaScript proxy and metadata")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("WebApiProxy")]
[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("bc78cf80-1cf9-46e7-abdd-88e9c49d656c")]
// 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: AssemblyInformationalVersion("1.*")]
[assembly: AssemblyVersion("1.*")]
|
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("WebApi Proxy Provider")]
[assembly: AssemblyDescription("Provides an endpoint for ASP.NET Web Api services to serve a JavaScript proxy and metadata")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("WebApiProxy")]
[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("bc78cf80-1cf9-46e7-abdd-88e9c49d656c")]
// 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: AssemblyInformationalVersion("1.2.2.*")]
[assembly: AssemblyVersion("1.2.2.*")]
|
mit
|
C#
|
aad25cd839aa42c0a4bc6baa76f56e05cd0ae5a6
|
Correct comment on Math.Clamp
|
mattbenic/Numeric
|
Numeric/Math.cs
|
Numeric/Math.cs
|
/*
Copyright(c) 2014 Matt Benic
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.
*/
namespace Numeric
{
/// <summary>
/// Implements generic versions of common math operations
/// </summary>
/// <typeparam name="T">The underlying numeric type to perform calculations with.</typeparam>
public static class Math<T>
{
/// <summary>
/// Returns the absolute value of a numeric type.
/// </summary>
/// <param name="t">A positive or negative value of the numeric type</param>
/// <returns>A value, x, such that 0 ≤ x.</returns>
public static T Abs(T t)
{
if (Numeric<T>.GreaterThanOrEqual(t, Numeric<T>.Zero()))
return t;
else
return Numeric<T>.UnaryNegation(t);
}
/// <summary>
/// Returns a value clamped to a specified minimum and macimum
/// </summary>
/// <param name="t">The value to clamp</param>
/// <param name="min">The inclusive minimum value to clamp to</param>
/// <param name="max">The inclusive maximum value to clamp to</param>
/// <returns>A value x, such that min <= x <= max</returns>
public static T Clamp(T t, T min, T max)
{
if (Numeric<T>.LessThan(t, min))
return min;
if (Numeric<T>.GreaterThan(t, max))
return max;
else
return t;
}
}
}
|
/*
Copyright(c) 2014 Matt Benic
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.
*/
namespace Numeric
{
/// <summary>
/// Implements generic versions of common math operations
/// </summary>
/// <typeparam name="T">The underlying numeric type to perform calculations with.</typeparam>
public static class Math<T>
{
/// <summary>
/// Returns the absolute value of a numeric type.
/// </summary>
/// <param name="t">A positive or negative value of the numeric type</param>
/// <returns>A value, x, such that 0 ≤ x.</returns>
public static T Abs(T t)
{
if (Numeric<T>.GreaterThanOrEqual(t, Numeric<T>.Zero()))
return t;
else
return Numeric<T>.UnaryNegation(t);
}
/// <summary>
/// Returns a value clamped to a specified minimum and macimum
/// </summary>
/// <param name="t">The value to clamp</param>
/// <param name="min">The inclusive minimum value to clamp to</param>
/// <param name="max">The exclusive maximum value to clamp to</param>
/// <returns>A value x, such that min <= x <= max</returns>
public static T Clamp(T t, T min, T max)
{
if (Numeric<T>.LessThan(t, min))
return min;
if (Numeric<T>.GreaterThan(t, max))
return max;
else
return t;
}
}
}
|
mit
|
C#
|
bbd9c56e5d021a4cdec09bb0af76503b328de547
|
Fix for docking delay
|
gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer,DaggerES/LunaMultiPlayer
|
Client/Systems/VesselDockSys/VesselDockMessageSender.cs
|
Client/Systems/VesselDockSys/VesselDockMessageSender.cs
|
using LunaClient.Base;
using LunaClient.Base.Interface;
using LunaClient.Network;
using LunaClient.VesselUtilities;
using LunaCommon.Message.Client;
using LunaCommon.Message.Data.Vessel;
using LunaCommon.Message.Interface;
using System.Threading;
namespace LunaClient.Systems.VesselDockSys
{
public class VesselDockMessageSender : SubSystem<VesselDockSystem>, IMessageSender
{
public void SendMessage(IMessageData msg)
{
TaskFactory.StartNew(() => NetworkSender.QueueOutgoingMessage(MessageFactory.CreateNew<VesselCliMsg>(msg)));
}
public void SendDockInformation(VesselDockStructure dock, int subspaceId, int delaySeconds = 0)
{
var vesselBytes = VesselSerializer.SerializeVessel(dock.DominantVessel.BackupVessel());
if (vesselBytes.Length > 0)
{
var msgData = NetworkMain.CliMsgFactory.CreateNewMessageData<VesselDockMsgData>();
msgData.WeakVesselId = dock.WeakVesselId;
msgData.DominantVesselId = dock.DominantVesselId;
msgData.FinalVesselData = vesselBytes;
msgData.SubspaceId = subspaceId;
TaskFactory.StartNew(() =>
{
Thread.Sleep(delaySeconds);
NetworkSender.QueueOutgoingMessage(MessageFactory.CreateNew<VesselCliMsg>(msgData));
});
}
}
}
}
|
using LunaClient.Base;
using LunaClient.Base.Interface;
using LunaClient.Network;
using LunaClient.VesselUtilities;
using LunaCommon.Message.Client;
using LunaCommon.Message.Data.Vessel;
using LunaCommon.Message.Interface;
using System.Threading;
namespace LunaClient.Systems.VesselDockSys
{
public class VesselDockMessageSender : SubSystem<VesselDockSystem>, IMessageSender
{
private int _delaySeconds;
public void SendMessage(IMessageData msg)
{
TaskFactory.StartNew(() =>
{
if (_delaySeconds > 0)
Thread.Sleep(_delaySeconds);
NetworkSender.QueueOutgoingMessage(MessageFactory.CreateNew<VesselCliMsg>(msg));
});
}
public void SendDockInformation(VesselDockStructure dock, int subspaceId, int delaySeconds = 0)
{
_delaySeconds = delaySeconds;
var vesselBytes = VesselSerializer.SerializeVessel(dock.DominantVessel.BackupVessel());
if (vesselBytes.Length > 0)
{
var msgData = NetworkMain.CliMsgFactory.CreateNewMessageData<VesselDockMsgData>();
msgData.WeakVesselId = dock.WeakVesselId;
msgData.DominantVesselId = dock.DominantVesselId;
msgData.FinalVesselData = vesselBytes;
msgData.SubspaceId = subspaceId;
SendMessage(msgData);
}
}
}
}
|
mit
|
C#
|
cdaf9c270104d4863d182f6a33da5e1fc8489506
|
Update LimitNumberOfPagesGenerated.cs
|
aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET
|
Examples/CSharp/Articles/LimitNumberOfPagesGenerated.cs
|
Examples/CSharp/Articles/LimitNumberOfPagesGenerated.cs
|
using System.IO;
using Aspose.Cells;
namespace Aspose.Cells.Examples.Articles
{
public class LimitNumberOfPagesGenerated
{
public static void Main()
{
//ExStart:1
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//Open an Excel file
Workbook wb = new Workbook(dataDir+ "TestBook.xlsx");
//Instantiate the PdfSaveOption
PdfSaveOptions options = new PdfSaveOptions();
//Print only Page 3 and Page 4 in the output PDF
//Starting page index (0-based index)
options.PageIndex = 3;
//Number of pages to be printed
options.PageCount = 2;
//Save the PDF file
wb.Save(dataDir+ "outPDF1.out.pdf", options);
//ExEnd:1
}
}
}
|
using System.IO;
using Aspose.Cells;
namespace Aspose.Cells.Examples.Articles
{
public class LimitNumberOfPagesGenerated
{
public static void Main()
{
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//Open an Excel file
Workbook wb = new Workbook(dataDir+ "TestBook.xlsx");
//Instantiate the PdfSaveOption
PdfSaveOptions options = new PdfSaveOptions();
//Print only Page 3 and Page 4 in the output PDF
//Starting page index (0-based index)
options.PageIndex = 3;
//Number of pages to be printed
options.PageCount = 2;
//Save the PDF file
wb.Save(dataDir+ "outPDF1.out.pdf", options);
}
}
}
|
mit
|
C#
|
01a0d41de694fb0c4c7dcbfebb53dd3d21b7681c
|
update version
|
prodot/ReCommended-Extension
|
Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
|
Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
|
using System.Reflection;
using ReCommendedExtension;
// 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(ZoneMarker.ExtensionName)]
[assembly: AssemblyDescription(ZoneMarker.ExtensionDescription)]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("prodot GmbH")]
[assembly: AssemblyProduct(ZoneMarker.ExtensionId)]
[assembly: AssemblyCopyright("© 2012-2021 prodot GmbH")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("5.5.2.0")]
[assembly: AssemblyFileVersion("5.5.2")]
|
using System.Reflection;
using ReCommendedExtension;
// 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(ZoneMarker.ExtensionName)]
[assembly: AssemblyDescription(ZoneMarker.ExtensionDescription)]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("prodot GmbH")]
[assembly: AssemblyProduct(ZoneMarker.ExtensionId)]
[assembly: AssemblyCopyright("© 2012-2021 prodot GmbH")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("5.5.1.0")]
[assembly: AssemblyFileVersion("5.5.1")]
|
apache-2.0
|
C#
|
4d30761ce3131eccaab114285018f5ab0cc54a79
|
Fix 1M score being possible with only GREATs in mania
|
UselessToucan/osu,smoogipoo/osu,smoogipoo/osu,peppy/osu-new,peppy/osu,UselessToucan/osu,peppy/osu,UselessToucan/osu,ppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,smoogipooo/osu,smoogipoo/osu
|
osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs
|
osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Judgements
{
public class ManiaJudgement : Judgement
{
protected override int NumericResultFor(HitResult result)
{
switch (result)
{
default:
return 0;
case HitResult.Meh:
return 50;
case HitResult.Ok:
return 100;
case HitResult.Good:
return 200;
case HitResult.Great:
return 300;
case HitResult.Perfect:
return 320;
}
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Judgements
{
public class ManiaJudgement : Judgement
{
protected override int NumericResultFor(HitResult result)
{
switch (result)
{
default:
return 0;
case HitResult.Meh:
return 50;
case HitResult.Ok:
return 100;
case HitResult.Good:
return 200;
case HitResult.Great:
case HitResult.Perfect:
return 300;
}
}
}
}
|
mit
|
C#
|
20eee3f4125748411b344fb1737294cc7317d6c9
|
Update NormalBullet.cs
|
lizardmamba/TowerDefense
|
Assets/Scripts/Bullet/NormalBullet.cs
|
Assets/Scripts/Bullet/NormalBullet.cs
|
using UnityEngine;
/*
** Inherit from bullet class.
** Controls the normal bullet behaviour.
*/
public class NormalBullet : Bullet {
#region FIELDS
public float speed = 5.0f; // Bullet speed.
private float distance; // Distance between the bullet and the target.
private float startTime; // Time transcurred from the beginning of the call.
#endregion
#region UNITY_METHODS
/// <summary>
/// Used for initialization.
/// </summary>
protected override void Start ()
{
// Save the time passed from the beginning of the frame.
startTime = Time.time;
// Calculate distance between the startPosition of the bullet and the targetPosition.
distance = Vector3.Distance (startPosition, targetPosition);
}
/// <summary>
/// Update is called once per frame.
/// </summary>
protected override void Update ()
{
// Check if the game is over to stop the bullet behaviour.
if (!GameManager.SINGLETON.gameOver) {
// Calculate time passed in relation to speed.
float timeInterval = (Time.time - startTime) * speed;
// Update the bullet position, translating his transform to the targetPosition.
gameObject.transform.position = Vector3.Lerp(startPosition, targetPosition, timeInterval / distance);
// If the bullet reaches the targetPosition
if (gameObject.transform.position.Equals(targetPosition)) {
// And the target is not null
if (target != null) {
// Update the health of the target.
Transform healthBarTransform = target.transform.FindChild("HealthBar");
HealthBar healthBar = healthBarTransform.gameObject.GetComponent<HealthBar>();
healthBar.currentHealth -= Mathf.Max(damage, 0);
// If the target health is less than 0
if (healthBar.currentHealth <= 0) {
// Destroy target.
Destroy(target);
}
Destroy(gameObject, 1);
}
// Destroy the bullet reaches his target.
Destroy(gameObject);
}
}
}
#endregion
}
|
using UnityEngine;
/*
** Inherit from bullet class.
** Controls the normal bullet behaviour.
*/
public class NormalBullet : Bullet {
#region FIELDS
public float speed = 5.0f; // Bullet speed.
private float distance; // Distance between the bullet and the target.
private float startTime; // Time transcurred from the beginning of the call.
#endregion
#region UNITY_METHODS
/// <summary>
/// Used for initialization.
/// </summary>
protected override void Start ()
{
// Save the time passed from the beginning of the frame.
startTime = Time.time;
// Calculate distance between the startPosition of the bullet and the targetPosition.
distance = Vector3.Distance (startPosition, targetPosition);
}
/// <summary>
/// Update is called once per frame.
/// </summary>
protected override void Update ()
{
// Check if the game is over to stop the bullet behaviour.
if (!GameManager.SINGLETON.gameOver) {
// Calculate time passed in relation to speed.
float timeInterval = (Time.time - startTime) * speed;
// Update the bullet position, translating his transform to the targetPosition.
gameObject.transform.position = Vector3.Lerp(startPosition, targetPosition, timeInterval / distance);
// If the bullet reaches the targetPosition
if (gameObject.transform.position.Equals(targetPosition)) {
// And the target is not null
if (target != null) {
// Update the health of the target.
Transform healthBarTransform = target.transform.FindChild("HealthBar");
HealthBar healthBar = healthBarTransform.gameObject.GetComponent<HealthBar>();
healthBar.currentHealth -= Mathf.Max(damage, 0);
// If the target health is less than 0
if (healthBar.currentHealth <= 0) {
// Destroy target.
Destroy(target);
}
}
// Destroy the bullet reaches his target.
Destroy(gameObject);
}
}
}
#endregion
}
|
mit
|
C#
|
8230a3bcde10c0e61dfec09d0704305325ecfa24
|
Remove excessive logging
|
sportingsolutions/SS.Integration.UnifiedDataAPIClient.DotNet,sportingsolutions/SS.Integration.UnifiedDataAPIClient.DotNet
|
SportingSolutions.Udapi.Sdk/Actors/FaultControllerActor.cs
|
SportingSolutions.Udapi.Sdk/Actors/FaultControllerActor.cs
|
using System;
using System.Collections.Generic;
using Akka.Actor;
using log4net;
using SportingSolutions.Udapi.Sdk.Events;
using SportingSolutions.Udapi.Sdk.Model.Message;
using SdkErrorMessage = SportingSolutions.Udapi.Sdk.Events.SdkErrorMessage;
namespace SportingSolutions.Udapi.Sdk.Actors
{
public class FaultControllerActor : ReceiveActor
{
private IActorRef subscriber;
private readonly ILog _logger = LogManager.GetLogger(typeof(FaultControllerActor));
public const string ActorName = "FaultControllerActor";
public FaultControllerActor()
{
Receive<CriticalActorRestartedMessage>(message => OnActorRestarted(message, true));
Receive<PathMessage>
(message =>
{
_logger.Info($"Registering subscriber {subscriber}");
subscriber = Sender;
subscriber.Tell(new PathMessage());
});
}
//public
public void OnActorRestarted(CriticalActorRestartedMessage message, bool isCritical)
{
subscriber.Tell(new SdkErrorMessage($"Actor restarted {message.ActorName}", isCritical) );
}
}
}
|
using System;
using System.Collections.Generic;
using Akka.Actor;
using log4net;
using SportingSolutions.Udapi.Sdk.Events;
using SportingSolutions.Udapi.Sdk.Model.Message;
using SdkErrorMessage = SportingSolutions.Udapi.Sdk.Events.SdkErrorMessage;
namespace SportingSolutions.Udapi.Sdk.Actors
{
public class FaultControllerActor : ReceiveActor
{
private IActorRef subscriber;
private readonly ILog _logger = LogManager.GetLogger(typeof(FaultControllerActor));
public const string ActorName = "FaultControllerActor";
public FaultControllerActor()
{
Receive<CriticalActorRestartedMessage>(message => OnActorRestarted(message, true));
Receive<PathMessage>
(message =>
{
_logger.Info($"Registering subscriber path={Sender}");
subscriber = Sender;
subscriber.Tell(new PathMessage());
});
}
//public
public void OnActorRestarted(CriticalActorRestartedMessage message, bool isCritical)
{
subscriber.Tell(new SdkErrorMessage($"Actor restarted {message.ActorName}", isCritical) );
}
}
}
|
apache-2.0
|
C#
|
34d5167ec370c2fe60dd9d5c7a9d9cbeb9b432ba
|
Remove old render process code that showed a message box for purpose of attaching the debugger - was commented out Preferred method is to use the --renderer-startup-dialog command line flag https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Example/CefExample.cs#L35
|
Livit/CefSharp,haozhouxu/CefSharp,dga711/CefSharp,Haraguroicha/CefSharp,joshvera/CefSharp,ruisebastiao/CefSharp,ITGlobal/CefSharp,jamespearce2006/CefSharp,battewr/CefSharp,twxstar/CefSharp,joshvera/CefSharp,Haraguroicha/CefSharp,yoder/CefSharp,windygu/CefSharp,AJDev77/CefSharp,ITGlobal/CefSharp,Livit/CefSharp,rlmcneary2/CefSharp,rlmcneary2/CefSharp,yoder/CefSharp,wangzheng888520/CefSharp,illfang/CefSharp,gregmartinhtc/CefSharp,NumbersInternational/CefSharp,jamespearce2006/CefSharp,ruisebastiao/CefSharp,haozhouxu/CefSharp,jamespearce2006/CefSharp,twxstar/CefSharp,ITGlobal/CefSharp,illfang/CefSharp,dga711/CefSharp,dga711/CefSharp,twxstar/CefSharp,Haraguroicha/CefSharp,VioletLife/CefSharp,gregmartinhtc/CefSharp,wangzheng888520/CefSharp,NumbersInternational/CefSharp,rlmcneary2/CefSharp,joshvera/CefSharp,AJDev77/CefSharp,NumbersInternational/CefSharp,illfang/CefSharp,VioletLife/CefSharp,windygu/CefSharp,jamespearce2006/CefSharp,VioletLife/CefSharp,ruisebastiao/CefSharp,zhangjingpu/CefSharp,ruisebastiao/CefSharp,Haraguroicha/CefSharp,jamespearce2006/CefSharp,NumbersInternational/CefSharp,ITGlobal/CefSharp,haozhouxu/CefSharp,illfang/CefSharp,joshvera/CefSharp,Haraguroicha/CefSharp,dga711/CefSharp,rlmcneary2/CefSharp,battewr/CefSharp,zhangjingpu/CefSharp,windygu/CefSharp,Livit/CefSharp,yoder/CefSharp,wangzheng888520/CefSharp,battewr/CefSharp,gregmartinhtc/CefSharp,yoder/CefSharp,zhangjingpu/CefSharp,Livit/CefSharp,windygu/CefSharp,twxstar/CefSharp,AJDev77/CefSharp,zhangjingpu/CefSharp,wangzheng888520/CefSharp,VioletLife/CefSharp,battewr/CefSharp,AJDev77/CefSharp,gregmartinhtc/CefSharp,haozhouxu/CefSharp
|
CefSharp.BrowserSubprocess/Program.cs
|
CefSharp.BrowserSubprocess/Program.cs
|
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Collections.Generic;
using System.Linq;
using CefSharp.Internals;
namespace CefSharp.BrowserSubprocess
{
public class Program
{
public static int Main(string[] args)
{
Kernel32.OutputDebugString("BrowserSubprocess starting up with command line: " + String.Join("\n", args));
int result;
using (var subprocess = Create(args))
{
result = subprocess.Run();
}
Kernel32.OutputDebugString("BrowserSubprocess shutting down.");
return result;
}
public static CefSubProcess Create(IEnumerable<string> args)
{
const string typePrefix = "--type=";
var typeArgument = args.SingleOrDefault(arg => arg.StartsWith(typePrefix));
var type = typeArgument.Substring(typePrefix.Length);
switch (type)
{
case "renderer":
return new CefRenderProcess(args);
case "gpu-process":
return new CefGpuProcess(args);
default:
return new CefSubProcess(args);
}
}
}
}
|
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using CefSharp.Internals;
namespace CefSharp.BrowserSubprocess
{
public class Program
{
public static int Main(string[] args)
{
Kernel32.OutputDebugString("BrowserSubprocess starting up with command line: " + String.Join("\n", args));
int result;
using (var subprocess = Create(args))
{
//if (subprocess is CefRenderProcess)
//{
// MessageBox.Show("Please attach debugger now", null, MessageBoxButtons.OK, MessageBoxIcon.Information);
//}
result = subprocess.Run();
}
Kernel32.OutputDebugString("BrowserSubprocess shutting down.");
return result;
}
public static CefSubProcess Create(IEnumerable<string> args)
{
const string typePrefix = "--type=";
var typeArgument = args.SingleOrDefault(arg => arg.StartsWith(typePrefix));
var type = typeArgument.Substring(typePrefix.Length);
switch (type)
{
case "renderer":
return new CefRenderProcess(args);
case "gpu-process":
return new CefGpuProcess(args);
default:
return new CefSubProcess(args);
}
}
}
}
|
bsd-3-clause
|
C#
|
a75836d2d9e73e0469abaa99770c873aed50acb7
|
Update demo
|
sunkaixuan/SqlSugar
|
Src/Asp.Net/SqlServerTest/Program.cs
|
Src/Asp.Net/SqlServerTest/Program.cs
|
using OrmTest.PerformanceTesting;
using OrmTest.UnitTest;
using System;
namespace OrmTest
{
class Program
{
/// <summary>
/// Set up config.cs file and start directly F5
/// 设置Config.cs文件直接F5启动例子
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
//Demo
Demo0_SqlSugarClient.Init();
Demo1_Queryable.Init();
Demo2_Updateable.Init();
Democ_GobalFilter.Init();
DemoD_DbFirst.Init();
DemoE_CodeFirst.Init();
Demo5_SqlQueryable.Init();
Demo6_Queue.Init();
//Unit test
NewUnitTest.Init();
Console.WriteLine("all successfully.");
Console.ReadKey();
}
}
}
|
using OrmTest.PerformanceTesting;
using OrmTest.UnitTest;
using System;
namespace OrmTest
{
class Program
{
static void Main(string[] args)
{
//OldTestMain.Init();
//Demo
Demo0_SqlSugarClient.Init();
Demo1_Queryable.Init();
Demo2_Updateable.Init();
Democ_GobalFilter.Init();
DemoD_DbFirst.Init();
DemoE_CodeFirst.Init();
Demo5_SqlQueryable.Init();
Demo6_Queue.Init();
//Unit test
NewUnitTest.Init();
Console.WriteLine("all successfully.");
Console.ReadKey();
}
}
}
|
apache-2.0
|
C#
|
60ec619d684cf503dd434446ff9f7b69652b41c9
|
Add URL to stuff info
|
pjf/StuffManager
|
StuffManager/Commands/InfoCommand.cs
|
StuffManager/Commands/InfoCommand.cs
|
using System;
using System.Linq;
namespace StuffManager.Commands
{
public static class InfoCommand
{
private static string Truncate(string s, int l)
{
if (s.Length < l)
return s;
s = s.Substring(0, l - 3);
return s + "...";
}
public static int HandleCommandLine(string[] args, string[] options)
{
var terms = string.Join(" ", args);
var search = KerbalStuff.Search(terms);
var results = search.Where(r => r.Name.ToUpper() == terms.ToUpper()
|| r.Author.ToUpper() + "/" + r.Name.ToUpper() == terms.ToUpper());
if (!results.Any())
results = search;
if (results.Count() > 1)
{
Console.WriteLine("Error: \"{0}\" is ambiguous between:");
foreach (var m in results)
Console.WriteLine("{0}/{1} [{2}]", m.Author, m.Name, m.Downloads);
return 1;
}
var mod = results.Single();
Console.WriteLine("{0}/{1}", mod.Author, mod.Name);
Console.WriteLine("Name: {0}", mod.Name);
Console.WriteLine("Author: {0}", mod.Author);
Console.WriteLine("URL: http://beta.kerbalstuff.com/mod/{0}", mod.Id);
Console.WriteLine("Version: {0}", mod.Versions[0].FriendlyVersion);
Console.WriteLine("Downloads: {0}", mod.Downloads);
Console.WriteLine("Followers: {0}", mod.Followers);
Console.WriteLine("Short Description: \n\t{0}", mod.ShortDescription);
return 0;
}
}
}
|
using System;
using System.Linq;
namespace StuffManager.Commands
{
public static class InfoCommand
{
private static string Truncate(string s, int l)
{
if (s.Length < l)
return s;
s = s.Substring(0, l - 3);
return s + "...";
}
public static int HandleCommandLine(string[] args, string[] options)
{
var terms = string.Join(" ", args);
var search = KerbalStuff.Search(terms);
var results = search.Where(r => r.Name.ToUpper() == terms.ToUpper()
|| r.Author.ToUpper() + "/" + r.Name.ToUpper() == terms.ToUpper());
if (!results.Any())
results = search;
if (results.Count() > 1)
{
Console.WriteLine("Error: \"{0}\" is ambiguous between:");
foreach (var m in results)
Console.WriteLine("{0}/{1} [{2}]", m.Author, m.Name, m.Downloads);
return 1;
}
var mod = results.Single();
Console.WriteLine("{0}/{1}", mod.Author, mod.Name);
Console.WriteLine("Name: {0}", mod.Name);
Console.WriteLine("Author: {0}", mod.Author);
Console.WriteLine("Version: {0}", mod.Versions[0].FriendlyVersion);
Console.WriteLine("Downloads: {0}", mod.Downloads);
Console.WriteLine("Followers: {0}", mod.Followers);
Console.WriteLine("Short Description: \n\t{0}", mod.ShortDescription);
return 0;
}
}
}
|
mit
|
C#
|
de99ff8eef28b6ccd98f0080e9699ed7232c9363
|
update assemblyInfo
|
ceee/ReadSharp,alexeib/ReadSharp
|
ReadSharp/Properties/AssemblyInfo.cs
|
ReadSharp/Properties/AssemblyInfo.cs
|
using System.Reflection;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ReadSharp")]
[assembly: AssemblyDescription("Extract meaningful website contents using a port of NReadability")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("cee")]
[assembly: AssemblyProduct("ReadSharp")]
[assembly: AssemblyCopyright("Copyright © cee 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 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")]
[assembly: AssemblyFileVersion("1.0.0")]
|
using System.Resources;
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("ReadSharp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ReadSharp")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
mit
|
C#
|
ffedc905f02e516eb755138b59969dbfb343bb62
|
Change Json Serializer in VfsStatEntry to use lower case. This makes it inline with the format C9 uses (https://github.com/c9/vfs-http-adapter)
|
oliver-feng/kudu,oliver-feng/kudu,EricSten-MSFT/kudu,badescuga/kudu,MavenRain/kudu,kali786516/kudu,juvchan/kudu,barnyp/kudu,YOTOV-LIMITED/kudu,sitereactor/kudu,WeAreMammoth/kudu-obsolete,kenegozi/kudu,EricSten-MSFT/kudu,MavenRain/kudu,dev-enthusiast/kudu,duncansmart/kudu,sitereactor/kudu,shibayan/kudu,kenegozi/kudu,chrisrpatterson/kudu,juvchan/kudu,dev-enthusiast/kudu,shrimpy/kudu,WeAreMammoth/kudu-obsolete,juoni/kudu,barnyp/kudu,badescuga/kudu,sitereactor/kudu,duncansmart/kudu,chrisrpatterson/kudu,uQr/kudu,projectkudu/kudu,bbauya/kudu,badescuga/kudu,chrisrpatterson/kudu,projectkudu/kudu,shanselman/kudu,puneet-gupta/kudu,juoni/kudu,kenegozi/kudu,YOTOV-LIMITED/kudu,kenegozi/kudu,EricSten-MSFT/kudu,shanselman/kudu,kali786516/kudu,MavenRain/kudu,sitereactor/kudu,EricSten-MSFT/kudu,sitereactor/kudu,puneet-gupta/kudu,kali786516/kudu,kali786516/kudu,juvchan/kudu,shibayan/kudu,projectkudu/kudu,duncansmart/kudu,shrimpy/kudu,badescuga/kudu,badescuga/kudu,juoni/kudu,puneet-gupta/kudu,shrimpy/kudu,oliver-feng/kudu,shanselman/kudu,duncansmart/kudu,puneet-gupta/kudu,bbauya/kudu,bbauya/kudu,uQr/kudu,dev-enthusiast/kudu,mauricionr/kudu,shibayan/kudu,juoni/kudu,YOTOV-LIMITED/kudu,shibayan/kudu,WeAreMammoth/kudu-obsolete,uQr/kudu,projectkudu/kudu,shrimpy/kudu,barnyp/kudu,MavenRain/kudu,bbauya/kudu,mauricionr/kudu,juvchan/kudu,puneet-gupta/kudu,mauricionr/kudu,projectkudu/kudu,uQr/kudu,barnyp/kudu,dev-enthusiast/kudu,shibayan/kudu,YOTOV-LIMITED/kudu,mauricionr/kudu,EricSten-MSFT/kudu,juvchan/kudu,oliver-feng/kudu,chrisrpatterson/kudu
|
Kudu.Contracts/Editor/VfsStatEntry.cs
|
Kudu.Contracts/Editor/VfsStatEntry.cs
|
using System;
using System.Runtime.Serialization;
namespace Kudu.Contracts.Editor
{
/// <summary>
/// Represents a directory structure. Used by <see cref="VfsControllerBase"/> to browse
/// a Kudu file system or the git repository.
/// </summary>
[DataContract]
public class VfsStatEntry
{
[DataMember(Name = "name")]
public string Name { get; set; }
[DataMember(Name = "size")]
public long Size { get; set; }
[DataMember(Name = "mtime")]
public DateTimeOffset MTime { get; set; }
[DataMember(Name = "mime")]
public string Mime { get; set; }
[DataMember(Name = "href")]
public string Href { get; set; }
}
}
|
using System;
namespace Kudu.Contracts.Editor
{
/// <summary>
/// Represents a directory structure. Used by <see cref="VfsControllerBase"/> to browse
/// a Kudu file system or the git repository.
/// </summary>
public class VfsStatEntry
{
public string Name { get; set; }
public long Size { get; set; }
public DateTimeOffset MTime { get; set; }
public string Mime { get; set; }
public string Href { get; set; }
}
}
|
apache-2.0
|
C#
|
a061707849d715621bf158b10879fe98e7561f2f
|
Combine all image layers for flavor objects
|
k-t/SharpHaven
|
MonoHaven.Client/Resources/Tileset.cs
|
MonoHaven.Client/Resources/Tileset.cs
|
using System.Collections.Generic;
using MonoHaven.Graphics;
using MonoHaven.Resources.Layers;
using MonoHaven.Utils;
namespace MonoHaven.Resources
{
public class Tileset
{
private static TextureAtlas atlas;
private readonly WeightList<TextureRegion> groundTiles;
private readonly WeightList<TextureRegion> flavorObjects;
private readonly WeightList<TextureRegion>[] borderTransitions;
private readonly WeightList<TextureRegion>[] crossTransitions;
private readonly int flavorDensity;
public Tileset(TilesetData data, IEnumerable<TileData> tiles)
{
if (atlas == null)
atlas = new TextureAtlas(2048, 2048);
flavorDensity = data.FlavorDensity;
groundTiles = new WeightList<TextureRegion>();
flavorObjects = new WeightList<TextureRegion>();
if (data.HasTransitions)
{
crossTransitions = new WeightList<TextureRegion>[15];
borderTransitions = new WeightList<TextureRegion>[15];
for (int i = 0; i < 15; i++)
{
crossTransitions[i] = new WeightList<TextureRegion>();
borderTransitions[i] = new WeightList<TextureRegion>();
}
}
foreach (var tile in tiles)
{
WeightList<TextureRegion> targetList;
if (tile.Type == 'g')
targetList = groundTiles;
else if (tile.Type == 'c' && data.HasTransitions)
targetList = crossTransitions[tile.Id - 1];
else if (tile.Type == 'b' && data.HasTransitions)
targetList = borderTransitions[tile.Id - 1];
else
continue;
targetList.Add(atlas.Add(tile.ImageData), tile.Weight);
}
foreach (var flavor in data.FlavorObjects)
{
var images = App.Instance.Resources.Get(flavor.ResName).GetLayers<ImageData>();
using (var image = ImageUtils.Combine(images))
flavorObjects.Add(atlas.Add(image), flavor.Weight);
// TODO: else log warning
}
}
public int FlavorDensity
{
get { return flavorDensity; }
}
public WeightList<TextureRegion>[] BorderTransitions
{
get { return borderTransitions; }
}
public WeightList<TextureRegion>[] CrossTransitions
{
get { return crossTransitions; }
}
public WeightList<TextureRegion> GroundTiles
{
get { return groundTiles; }
}
public WeightList<TextureRegion> FlavorObjects
{
get { return flavorObjects; }
}
}
}
|
using System.Collections.Generic;
using MonoHaven.Graphics;
using MonoHaven.Resources.Layers;
namespace MonoHaven.Resources
{
public class Tileset
{
private static TextureAtlas atlas;
private readonly WeightList<TextureRegion> groundTiles;
private readonly WeightList<TextureRegion> flavorObjects;
private readonly WeightList<TextureRegion>[] borderTransitions;
private readonly WeightList<TextureRegion>[] crossTransitions;
private readonly int flavorDensity;
public Tileset(TilesetData data, IEnumerable<TileData> tiles)
{
if (atlas == null)
atlas = new TextureAtlas(2048, 2048);
flavorDensity = data.FlavorDensity;
groundTiles = new WeightList<TextureRegion>();
flavorObjects = new WeightList<TextureRegion>();
if (data.HasTransitions)
{
crossTransitions = new WeightList<TextureRegion>[15];
borderTransitions = new WeightList<TextureRegion>[15];
for (int i = 0; i < 15; i++)
{
crossTransitions[i] = new WeightList<TextureRegion>();
borderTransitions[i] = new WeightList<TextureRegion>();
}
}
foreach (var tile in tiles)
{
WeightList<TextureRegion> targetList;
if (tile.Type == 'g')
targetList = groundTiles;
else if (tile.Type == 'c' && data.HasTransitions)
targetList = crossTransitions[tile.Id - 1];
else if (tile.Type == 'b' && data.HasTransitions)
targetList = borderTransitions[tile.Id - 1];
else
continue;
targetList.Add(atlas.Add(tile.ImageData), tile.Weight);
}
foreach (var flavor in data.FlavorObjects)
{
var image = App.Instance.Resources.Get(flavor.ResName).GetLayer<ImageData>();
if (image != null)
{
flavorObjects.Add(atlas.Add(image.Data), flavor.Weight);
}
// TODO: else log warning
}
}
public int FlavorDensity
{
get { return flavorDensity; }
}
public WeightList<TextureRegion>[] BorderTransitions
{
get { return borderTransitions; }
}
public WeightList<TextureRegion>[] CrossTransitions
{
get { return crossTransitions; }
}
public WeightList<TextureRegion> GroundTiles
{
get { return groundTiles; }
}
public WeightList<TextureRegion> FlavorObjects
{
get { return flavorObjects; }
}
}
}
|
mit
|
C#
|
7ca8911f32b969054867acd0405a7b96f0ce6f2a
|
Make the about window have a space in the application name
|
amweiss/vigilant-cupcake
|
VigilantCupcake/SubForms/AboutBox.cs
|
VigilantCupcake/SubForms/AboutBox.cs
|
using System;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
namespace VigilantCupcake.SubForms {
partial class AboutBox : Form {
public AboutBox() {
InitializeComponent();
this.Text = String.Format("About {0}", AssemblyTitle);
this.labelProductName.Text = AssemblyTitle;
this.labelVersion.Text = AssemblyVersion;
this.lastUpdatedBox.Text = LastUpdatedDate.ToString();
this.linkLabel1.Text = Properties.Settings.Default.WebsiteUrl;
}
public string LatestVersionText {
set { latestBox.Text = value; }
}
#region Assembly Attribute Accessors
public static string AssemblyTitle {
get {
return "Vigilant Cupcake";
}
}
public static string AssemblyVersion {
get {
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
public static DateTime LastUpdatedDate {
get {
return new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
}
}
#endregion Assembly Attribute Accessors
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
this.linkLabel1.LinkVisited = true;
System.Diagnostics.Process.Start(Properties.Settings.Default.WebsiteUrl);
}
}
}
|
using System;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
namespace VigilantCupcake.SubForms {
partial class AboutBox : Form {
public AboutBox() {
InitializeComponent();
this.Text = String.Format("About {0}", AssemblyTitle);
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = AssemblyVersion;
this.lastUpdatedBox.Text = LastUpdatedDate.ToString();
this.linkLabel1.Text = Properties.Settings.Default.WebsiteUrl;
}
public string LatestVersionText {
set { latestBox.Text = value; }
}
#region Assembly Attribute Accessors
public static string AssemblyProduct {
get {
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0) {
return "";
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}
public static string AssemblyTitle {
get {
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0) {
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (!string.IsNullOrEmpty(titleAttribute.Title)) {
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
public static string AssemblyVersion {
get {
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
public static DateTime LastUpdatedDate {
get {
return new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
}
}
#endregion Assembly Attribute Accessors
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
this.linkLabel1.LinkVisited = true;
System.Diagnostics.Process.Start(Properties.Settings.Default.WebsiteUrl);
}
}
}
|
mit
|
C#
|
168d7c6229873b0c56b6606e01fa79e5e19f2c32
|
Use fixed AssemblyVersion within minor and patch releases (#270)
|
maxwellb/csharp-driver,trurl123/csharp-driver,datastax/csharp-driver,maxwellb/csharp-driver,datastax/csharp-driver,mintsoft/csharp-driver
|
src/Cassandra/Properties/AssemblyInfo.cs
|
src/Cassandra/Properties/AssemblyInfo.cs
|
//
// Copyright (C) 2012-2016 DataStax Inc.
//
// 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.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("DataStax")]
[assembly: AssemblyProduct("DataStax C# Driver for Apache Cassandra")]
[assembly: ComVisible(false)]
//Assembly Version should remain constant within minor and patch releses
[assembly: AssemblyVersion("3.99.0.0")]
// Make internals visible to the Tests project(s)
[assembly: InternalsVisibleTo("Cassandra.IntegrationTests, PublicKey=00240000048000009400000006020000002400005253413100040000010001002367a0d2a0b22d308ce0139f644baa0e17ea09bd0d951b5c85f9e6440302d3e0e45f59676a4f31c970ff534c65ff7746184a95d538933d10115bfaf2eaa89332f0ab72bb9d5d1828501c580a3ade6c91d258159701b7317ee5d57f914e8cd28df32f83ad190169c4427c62da85d173aa7ab5d1870e19140bb1275d7620bebab4")]
[assembly: InternalsVisibleTo("Cassandra.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001002367a0d2a0b22d308ce0139f644baa0e17ea09bd0d951b5c85f9e6440302d3e0e45f59676a4f31c970ff534c65ff7746184a95d538933d10115bfaf2eaa89332f0ab72bb9d5d1828501c580a3ade6c91d258159701b7317ee5d57f914e8cd28df32f83ad190169c4427c62da85d173aa7ab5d1870e19140bb1275d7620bebab4")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
|
//
// Copyright (C) 2012-2016 DataStax Inc.
//
// 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.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// See the SharedAssemblyInfo.cs file for information shared by all assemblies
[assembly: AssemblyCompany("DataStax")]
[assembly: AssemblyProduct("DataStax C# Driver for Apache Cassandra")]
[assembly: ComVisible(false)]
// Make internals visible to the Tests project(s)
[assembly: InternalsVisibleTo("Cassandra.IntegrationTests, PublicKey=00240000048000009400000006020000002400005253413100040000010001002367a0d2a0b22d308ce0139f644baa0e17ea09bd0d951b5c85f9e6440302d3e0e45f59676a4f31c970ff534c65ff7746184a95d538933d10115bfaf2eaa89332f0ab72bb9d5d1828501c580a3ade6c91d258159701b7317ee5d57f914e8cd28df32f83ad190169c4427c62da85d173aa7ab5d1870e19140bb1275d7620bebab4")]
[assembly: InternalsVisibleTo("Cassandra.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001002367a0d2a0b22d308ce0139f644baa0e17ea09bd0d951b5c85f9e6440302d3e0e45f59676a4f31c970ff534c65ff7746184a95d538933d10115bfaf2eaa89332f0ab72bb9d5d1828501c580a3ade6c91d258159701b7317ee5d57f914e8cd28df32f83ad190169c4427c62da85d173aa7ab5d1870e19140bb1275d7620bebab4")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
|
apache-2.0
|
C#
|
7e96bd9cfba325b3cbbafffbbfcabc3f9b37cd0e
|
add userAgent with current version included
|
Yubico/yubico-dotnet-client
|
YubicoDotNetClient/YubicoValidate.cs
|
YubicoDotNetClient/YubicoValidate.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.IO;
namespace YubicoDotNetClient
{
class YubicoValidate
{
public static YubicoResponse validate(String[] urls)
{
Task<YubicoResponse>[] tasks = new Task<YubicoResponse>[urls.Length];
for (int i = 0; i < urls.Length; i++)
{
tasks[i] = Task<YubicoResponse>.Factory.StartNew(() =>
{
return DoVerify(urls[i]);
});
}
int completed = Task.WaitAny(tasks);
foreach (Task task in tasks)
{
task.ContinueWith(t => t.Exception, TaskContinuationOptions.OnlyOnFaulted);
}
return tasks[completed].Result;
}
private static YubicoResponse DoVerify(String url)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.UserAgent = "YubicoDotNetClient version:" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
HttpWebResponse rawResponse = (HttpWebResponse)request.GetResponse();
Stream dataStream = rawResponse.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
YubicoResponse response = new YubicoResponseImpl(reader.ReadToEnd());
if (response.getStatus() == YubicoResponseStatus.REPLAYED_REQUEST)
{
throw new YubicoValidationException("Replayed request, this otp & nonce combination has been seen before.");
}
return response;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.IO;
namespace YubicoDotNetClient
{
class YubicoValidate
{
public static YubicoResponse validate(String[] urls)
{
Task<YubicoResponse>[] tasks = new Task<YubicoResponse>[urls.Length];
for (int i = 0; i < urls.Length; i++)
{
tasks[i] = Task<YubicoResponse>.Factory.StartNew(() =>
{
return DoVerify(urls[i]);
});
}
int completed = Task.WaitAny(tasks);
foreach (Task task in tasks)
{
task.ContinueWith(t => t.Exception, TaskContinuationOptions.OnlyOnFaulted);
}
return tasks[completed].Result;
}
private static YubicoResponse DoVerify(String url)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse rawResponse = (HttpWebResponse)request.GetResponse();
Stream dataStream = rawResponse.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
YubicoResponse response = new YubicoResponseImpl(reader.ReadToEnd());
if (response.getStatus() == YubicoResponseStatus.REPLAYED_REQUEST)
{
throw new YubicoValidationException("Replayed request, this otp & nonce combination has been seen before.");
}
return response;
}
}
}
|
bsd-2-clause
|
C#
|
c5636f4ab818d1445f11d53cb0bd09a8a367876e
|
tidy botwinmodule
|
jchannon/Botwin
|
src/BotwinModule.cs
|
src/BotwinModule.cs
|
namespace Botwin
{
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
public class BotwinModule
{
public List<Tuple<string, string, Func<HttpRequest, HttpResponse, RouteData, Task>>> Routes { get; } = new List<Tuple<string, string, Func<HttpRequest, HttpResponse, RouteData, Task>>>();
public Func<HttpRequest, HttpResponse, RouteData, Task<HttpResponse>> Before { get; set; }
public Func<HttpRequest, HttpResponse, RouteData, Task> After { get; set; }
public void Get(string path, Func<HttpRequest, HttpResponse, RouteData, Task> handler)
{
path = path.StartsWith("/") ? path.Substring(1) : path;
this.Routes.Add(Tuple.Create("GET", path, handler));
}
public void Post(string path, Func<HttpRequest, HttpResponse, RouteData, Task> handler)
{
path = path.StartsWith("/") ? path.Substring(1) : path;
this.Routes.Add(Tuple.Create("POST", path, handler));
}
public void Delete(string path, Func<HttpRequest, HttpResponse, RouteData, Task> handler)
{
path = path.StartsWith("/") ? path.Substring(1) : path;
this.Routes.Add(Tuple.Create("DELETE", path, handler));
}
public void Put(string path, Func<HttpRequest, HttpResponse, RouteData, Task> handler)
{
path = path.StartsWith("/") ? path.Substring(1) : path;
this.Routes.Add(Tuple.Create("PUT", path, handler));
}
}
}
|
namespace Botwin
{
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
public class BotwinModule
{
public List<Tuple<string, string, Func<HttpRequest, HttpResponse, RouteData, Task>>> Routes { get; } = new List<Tuple<string, string, Func<HttpRequest, HttpResponse, RouteData, Task>>>();
public void Get(string path, Func<HttpRequest, HttpResponse, RouteData, Task> handler)
{
path = path.StartsWith("/") ? path.Substring(1) : path;
this.Routes.Add(Tuple.Create("GET", path, handler));
}
public void Post(string path, Func<HttpRequest, HttpResponse, RouteData, Task> handler)
{
path = path.StartsWith("/") ? path.Substring(1) : path;
this.Routes.Add(Tuple.Create("POST", path, handler));
}
public void Delete(string path, Func<HttpRequest, HttpResponse, RouteData, Task> handler)
{
path = path.StartsWith("/") ? path.Substring(1) : path;
this.Routes.Add(Tuple.Create("DELETE", path, handler));
}
public void Put(string path, Func<HttpRequest, HttpResponse, RouteData, Task> handler)
{
path = path.StartsWith("/") ? path.Substring(1) : path;
this.Routes.Add(Tuple.Create("PUT", path, handler));
}
public Func<HttpRequest, HttpResponse, RouteData, Task<HttpResponse>> Before { get; set; }
public Func<HttpRequest, HttpResponse, RouteData, Task> After { get; set; }
}
}
|
mit
|
C#
|
cdce2a118024dad2eede94474957bf825068c057
|
Bump version
|
gkonings/Umbraco-CMS,Phosworks/Umbraco-CMS,rasmusfjord/Umbraco-CMS,base33/Umbraco-CMS,lars-erik/Umbraco-CMS,KevinJump/Umbraco-CMS,WebCentrum/Umbraco-CMS,NikRimington/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,neilgaietto/Umbraco-CMS,marcemarc/Umbraco-CMS,dawoe/Umbraco-CMS,TimoPerplex/Umbraco-CMS,dawoe/Umbraco-CMS,jchurchley/Umbraco-CMS,tompipe/Umbraco-CMS,kasperhhk/Umbraco-CMS,marcemarc/Umbraco-CMS,rasmusfjord/Umbraco-CMS,TimoPerplex/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,aadfPT/Umbraco-CMS,romanlytvyn/Umbraco-CMS,abjerner/Umbraco-CMS,mattbrailsford/Umbraco-CMS,Phosworks/Umbraco-CMS,romanlytvyn/Umbraco-CMS,marcemarc/Umbraco-CMS,dawoe/Umbraco-CMS,bjarnef/Umbraco-CMS,mittonp/Umbraco-CMS,KevinJump/Umbraco-CMS,sargin48/Umbraco-CMS,kasperhhk/Umbraco-CMS,gkonings/Umbraco-CMS,base33/Umbraco-CMS,arknu/Umbraco-CMS,kasperhhk/Umbraco-CMS,romanlytvyn/Umbraco-CMS,neilgaietto/Umbraco-CMS,rustyswayne/Umbraco-CMS,abjerner/Umbraco-CMS,robertjf/Umbraco-CMS,abjerner/Umbraco-CMS,gavinfaux/Umbraco-CMS,gavinfaux/Umbraco-CMS,abryukhov/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,robertjf/Umbraco-CMS,umbraco/Umbraco-CMS,rustyswayne/Umbraco-CMS,arknu/Umbraco-CMS,leekelleher/Umbraco-CMS,Phosworks/Umbraco-CMS,mattbrailsford/Umbraco-CMS,robertjf/Umbraco-CMS,sargin48/Umbraco-CMS,Phosworks/Umbraco-CMS,TimoPerplex/Umbraco-CMS,bjarnef/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,neilgaietto/Umbraco-CMS,mittonp/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,KevinJump/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,gkonings/Umbraco-CMS,aaronpowell/Umbraco-CMS,jchurchley/Umbraco-CMS,leekelleher/Umbraco-CMS,hfloyd/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,TimoPerplex/Umbraco-CMS,kgiszewski/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,leekelleher/Umbraco-CMS,neilgaietto/Umbraco-CMS,kgiszewski/Umbraco-CMS,mattbrailsford/Umbraco-CMS,sargin48/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,madsoulswe/Umbraco-CMS,sargin48/Umbraco-CMS,romanlytvyn/Umbraco-CMS,lars-erik/Umbraco-CMS,kasperhhk/Umbraco-CMS,Phosworks/Umbraco-CMS,hfloyd/Umbraco-CMS,leekelleher/Umbraco-CMS,umbraco/Umbraco-CMS,lars-erik/Umbraco-CMS,rasmusfjord/Umbraco-CMS,bjarnef/Umbraco-CMS,KevinJump/Umbraco-CMS,abryukhov/Umbraco-CMS,aadfPT/Umbraco-CMS,tcmorris/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,kasperhhk/Umbraco-CMS,gavinfaux/Umbraco-CMS,tcmorris/Umbraco-CMS,bjarnef/Umbraco-CMS,arknu/Umbraco-CMS,mattbrailsford/Umbraco-CMS,NikRimington/Umbraco-CMS,rasmuseeg/Umbraco-CMS,umbraco/Umbraco-CMS,tcmorris/Umbraco-CMS,rustyswayne/Umbraco-CMS,tompipe/Umbraco-CMS,rasmusfjord/Umbraco-CMS,mittonp/Umbraco-CMS,hfloyd/Umbraco-CMS,aadfPT/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,rasmuseeg/Umbraco-CMS,lars-erik/Umbraco-CMS,tcmorris/Umbraco-CMS,rustyswayne/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,mittonp/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,madsoulswe/Umbraco-CMS,tompipe/Umbraco-CMS,jchurchley/Umbraco-CMS,madsoulswe/Umbraco-CMS,TimoPerplex/Umbraco-CMS,rustyswayne/Umbraco-CMS,rasmuseeg/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,aaronpowell/Umbraco-CMS,hfloyd/Umbraco-CMS,gavinfaux/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,gkonings/Umbraco-CMS,mittonp/Umbraco-CMS,kgiszewski/Umbraco-CMS,gavinfaux/Umbraco-CMS,gkonings/Umbraco-CMS,romanlytvyn/Umbraco-CMS,WebCentrum/Umbraco-CMS,rasmusfjord/Umbraco-CMS,leekelleher/Umbraco-CMS,tcmorris/Umbraco-CMS,WebCentrum/Umbraco-CMS,abryukhov/Umbraco-CMS,NikRimington/Umbraco-CMS,base33/Umbraco-CMS,aaronpowell/Umbraco-CMS,umbraco/Umbraco-CMS,neilgaietto/Umbraco-CMS,tcmorris/Umbraco-CMS,sargin48/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,lars-erik/Umbraco-CMS
|
src/SolutionInfo.cs
|
src/SolutionInfo.cs
|
using System.Reflection;
using System.Resources;
[assembly: AssemblyCompany("Umbraco")]
[assembly: AssemblyCopyright("Copyright © Umbraco 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("7.4.0")]
[assembly: AssemblyInformationalVersion("7.4.0-beta")]
|
using System.Reflection;
using System.Resources;
[assembly: AssemblyCompany("Umbraco")]
[assembly: AssemblyCopyright("Copyright © Umbraco 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("7.4.0")]
[assembly: AssemblyInformationalVersion("7.4.0")]
|
mit
|
C#
|
7ab45c1b22fdf5877383b3ba7ba97e15b95dda37
|
Fix water level
|
Feriority/oculus_hackathon,Feriority/oculus_hackathon,Feriority/oculus_hackathon
|
Assets/Scripts/Underwater.cs
|
Assets/Scripts/Underwater.cs
|
using UnityEngine;
using System.Collections;
public class Underwater : MonoBehaviour {
//This script enables underwater effects. Attach to main camera.
//Define variable
public int underwaterLevel = 25;
//The scene's default fog settings
private bool defaultFog;
private Color defaultFogColor;
private float defaultFogDensity;
private float defaultFogStart;
private float defaultFogEnd;
private Material defaultSkybox;
private Material noSkybox;
void Start () {
//Set the background color
camera.backgroundColor = new Color(0.08f, 0.4f, 0.53f, 1);
//The scene's default fog settings
defaultFog = RenderSettings.fog;
defaultFogColor = RenderSettings.fogColor;
defaultFogDensity = RenderSettings.fogDensity;
defaultFogStart = RenderSettings.fogStartDistance;
defaultFogEnd = RenderSettings.fogEndDistance;
defaultSkybox = RenderSettings.skybox;
}
void Update () {
if (transform.position.y < underwaterLevel)
{
RenderSettings.fog = true;
RenderSettings.fogColor = new Color(0.08f, 0.4f, 0.53f, 0.6f);
RenderSettings.fogMode = FogMode.Linear;
RenderSettings.fogStartDistance = -200;
RenderSettings.fogEndDistance = 100;
RenderSettings.skybox = noSkybox;
}
else
{
RenderSettings.fog = defaultFog;
RenderSettings.fogColor = defaultFogColor;
RenderSettings.fogStartDistance = defaultFogStart;
RenderSettings.fogEndDistance = defaultFogEnd;
RenderSettings.skybox = defaultSkybox;
}
}
}
|
using UnityEngine;
using System.Collections;
public class Underwater : MonoBehaviour {
//This script enables underwater effects. Attach to main camera.
//Define variable
public int underwaterLevel = 20;
//The scene's default fog settings
private bool defaultFog;
private Color defaultFogColor;
private float defaultFogDensity;
private float defaultFogStart;
private float defaultFogEnd;
private Material defaultSkybox;
private Material noSkybox;
void Start () {
//Set the background color
camera.backgroundColor = new Color(0, 0.4f, 0.7f, 1);
//The scene's default fog settings
defaultFog = RenderSettings.fog;
defaultFogColor = RenderSettings.fogColor;
defaultFogDensity = RenderSettings.fogDensity;
defaultFogStart = RenderSettings.fogStartDistance;
defaultFogEnd = RenderSettings.fogEndDistance;
defaultSkybox = RenderSettings.skybox;
}
void Update () {
if (transform.position.y < underwaterLevel)
{
RenderSettings.fog = true;
RenderSettings.fogColor = new Color(0, 0.4f, 0.7f, 0.6f);
RenderSettings.fogMode = FogMode.Linear;
RenderSettings.fogStartDistance = -200;
RenderSettings.fogEndDistance = 100;
RenderSettings.skybox = noSkybox;
}
else
{
RenderSettings.fog = defaultFog;
RenderSettings.fogColor = defaultFogColor;
RenderSettings.fogStartDistance = defaultFogStart;
RenderSettings.fogEndDistance = defaultFogEnd;
RenderSettings.skybox = defaultSkybox;
}
}
}
|
mit
|
C#
|
06ff942b7cf9e19931d0e6256895fa0ff3ee915c
|
Fix nullable for EdmDate
|
ginach/msgraph-sdk-dotnet,garethj-msft/msgraph-sdk-dotnet
|
src/Microsoft.Graph/Models/Generated/RecurrenceRange.cs
|
src/Microsoft.Graph/Models/Generated/RecurrenceRange.cs
|
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
namespace Microsoft.Graph
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization;
using Newtonsoft.Json;
/// <summary>
/// The type RecurrenceRange.
/// </summary>
[DataContract]
[JsonConverter(typeof(DerivedTypeConverter))]
public partial class RecurrenceRange
{
/// <summary>
/// Gets or sets type.
/// </summary>
[DataMember(Name = "type", EmitDefaultValue = false, IsRequired = false)]
public RecurrenceRangeType? Type { get; set; }
/// <summary>
/// Gets or sets startDate.
/// </summary>
[DataMember(Name = "startDate", EmitDefaultValue = false, IsRequired = false)]
public EdmDate StartDate { get; set; }
/// <summary>
/// Gets or sets endDate.
/// </summary>
[DataMember(Name = "endDate", EmitDefaultValue = false, IsRequired = false)]
public EdmDate EndDate { get; set; }
/// <summary>
/// Gets or sets recurrenceTimeZone.
/// </summary>
[DataMember(Name = "recurrenceTimeZone", EmitDefaultValue = false, IsRequired = false)]
public string RecurrenceTimeZone { get; set; }
/// <summary>
/// Gets or sets numberOfOccurrences.
/// </summary>
[DataMember(Name = "numberOfOccurrences", EmitDefaultValue = false, IsRequired = false)]
public Int32? NumberOfOccurrences { get; set; }
/// <summary>
/// Gets or sets additional data.
/// </summary>
[JsonExtensionData(ReadData = true)]
public IDictionary<string, object> AdditionalData { get; set; }
}
}
|
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
namespace Microsoft.Graph
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization;
using Newtonsoft.Json;
/// <summary>
/// The type RecurrenceRange.
/// </summary>
[DataContract]
[JsonConverter(typeof(DerivedTypeConverter))]
public partial class RecurrenceRange
{
/// <summary>
/// Gets or sets type.
/// </summary>
[DataMember(Name = "type", EmitDefaultValue = false, IsRequired = false)]
public RecurrenceRangeType? Type { get; set; }
/// <summary>
/// Gets or sets startDate.
/// </summary>
[DataMember(Name = "startDate", EmitDefaultValue = false, IsRequired = false)]
public EdmDate? StartDate { get; set; }
/// <summary>
/// Gets or sets endDate.
/// </summary>
[DataMember(Name = "endDate", EmitDefaultValue = false, IsRequired = false)]
public EdmDate? EndDate { get; set; }
/// <summary>
/// Gets or sets recurrenceTimeZone.
/// </summary>
[DataMember(Name = "recurrenceTimeZone", EmitDefaultValue = false, IsRequired = false)]
public string RecurrenceTimeZone { get; set; }
/// <summary>
/// Gets or sets numberOfOccurrences.
/// </summary>
[DataMember(Name = "numberOfOccurrences", EmitDefaultValue = false, IsRequired = false)]
public Int32? NumberOfOccurrences { get; set; }
/// <summary>
/// Gets or sets additional data.
/// </summary>
[JsonExtensionData(ReadData = true)]
public IDictionary<string, object> AdditionalData { get; set; }
}
}
|
mit
|
C#
|
1390453ec9ff58eaef0eceb2ee84a1b45b6f6bda
|
Fix msearch NRE
|
KodrAus/elasticsearch-net,azubanov/elasticsearch-net,jonyadamit/elasticsearch-net,elastic/elasticsearch-net,adam-mccoy/elasticsearch-net,KodrAus/elasticsearch-net,elastic/elasticsearch-net,RossLieberman/NEST,azubanov/elasticsearch-net,cstlaurent/elasticsearch-net,CSGOpenSource/elasticsearch-net,TheFireCookie/elasticsearch-net,jonyadamit/elasticsearch-net,RossLieberman/NEST,azubanov/elasticsearch-net,adam-mccoy/elasticsearch-net,UdiBen/elasticsearch-net,UdiBen/elasticsearch-net,cstlaurent/elasticsearch-net,jonyadamit/elasticsearch-net,adam-mccoy/elasticsearch-net,UdiBen/elasticsearch-net,TheFireCookie/elasticsearch-net,CSGOpenSource/elasticsearch-net,TheFireCookie/elasticsearch-net,cstlaurent/elasticsearch-net,RossLieberman/NEST,CSGOpenSource/elasticsearch-net,KodrAus/elasticsearch-net
|
src/Nest/Search/MultiSearch/MultiSearchJsonConverter.cs
|
src/Nest/Search/MultiSearch/MultiSearchJsonConverter.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Reflection;
using Elasticsearch.Net.Serialization;
using Nest.Resolvers;
using Elasticsearch.Net;
namespace Nest
{
internal class MultiSearchJsonConverter : JsonConverter
{
public override bool CanConvert(Type objectType) => true;
public override bool CanRead => false;
public override bool CanWrite => true;
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
var request = value as IMultiSearchRequest;
if (request == null) return;
var contract = serializer.ContractResolver as SettingsContractResolver;
var elasticsearchSerializer = contract?.ConnectionSettings.Serializer;
if (elasticsearchSerializer == null) return;
if (request.Operations == null) return;
foreach (var operation in request.Operations.Values)
{
var index = (request.Index != null && !request.Index.Equals(operation.Index))
? operation.Index
: null;
var type = (request.Type != null && !request.Type.Equals(operation.Type))
? operation.Type
: null;
var searchType = operation.RequestParameters.GetQueryStringValue<SearchType>("search_type").GetStringValue();
if (searchType == "query_then_fetch")
searchType = null;
var header = new
{
index = index,
type = type,
search_type = searchType,
preference = operation.Preference,
routing = operation.Routing,
ignore_unavailable = operation.IgnoreUnavalable
};
var headerBytes = elasticsearchSerializer.SerializeToBytes(header, SerializationFormatting.None);
writer.WriteRaw(headerBytes.Utf8String() + "\n");
var bodyBytes = elasticsearchSerializer.SerializeToBytes(operation, SerializationFormatting.None);
writer.WriteRaw(bodyBytes.Utf8String() + "\n");
}
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
throw new NotSupportedException();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Reflection;
using Elasticsearch.Net.Serialization;
using Nest.Resolvers;
using Elasticsearch.Net;
namespace Nest
{
internal class MultiSearchJsonConverter : JsonConverter
{
public override bool CanConvert(Type objectType) => true;
public override bool CanRead => false;
public override bool CanWrite => true;
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
var request = value as IMultiSearchRequest;
if (request == null) return;
var contract = serializer.ContractResolver as SettingsContractResolver;
var elasticsearchSerializer = contract?.ConnectionSettings.Serializer;
if (elasticsearchSerializer == null) return;
foreach (var operation in request.Operations.Values)
{
var index = (request.Index != null && !request.Index.Equals(operation.Index))
? operation.Index
: null;
var type = (request.Type != null && !request.Type.Equals(operation.Type))
? operation.Type
: null;
var searchType = operation.RequestParameters.GetQueryStringValue<SearchType>("search_type").GetStringValue();
if (searchType == "query_then_fetch")
searchType = null;
var header = new
{
index = index,
type = type,
search_type = searchType,
preference = operation.Preference,
routing = operation.Routing,
ignore_unavailable = operation.IgnoreUnavalable
};
var headerBytes = elasticsearchSerializer.SerializeToBytes(header, SerializationFormatting.None);
writer.WriteRaw(headerBytes.Utf8String() + "\n");
var bodyBytes = elasticsearchSerializer.SerializeToBytes(operation, SerializationFormatting.None);
writer.WriteRaw(bodyBytes.Utf8String() + "\n");
}
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
throw new NotSupportedException();
}
}
}
|
apache-2.0
|
C#
|
145a90434aa447e01e435445d373b890846330f4
|
set default timeout wait time for analysis to 30s
|
OmniSharp/omnisharp-roslyn,OmniSharp/omnisharp-roslyn
|
src/OmniSharp.Shared/Options/RoslynExtensionsOptions.cs
|
src/OmniSharp.Shared/Options/RoslynExtensionsOptions.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OmniSharp.Options
{
public class RoslynExtensionsOptions : OmniSharpExtensionsOptions
{
public bool EnableDecompilationSupport { get; set; }
public bool EnableAnalyzersSupport { get; set; }
public bool EnableImportCompletion { get; set; }
public bool EnableAsyncCompletion { get; set; }
public int DocumentAnalysisTimeoutMs { get; set; } = 30 * 1000;
public int DiagnosticWorkersThreadCount { get; set; } = Math.Max(1, Environment.ProcessorCount / 2);
}
public class OmniSharpExtensionsOptions
{
public string[] LocationPaths { get; set; }
public IEnumerable<string> GetNormalizedLocationPaths(IOmniSharpEnvironment env)
{
if (LocationPaths == null || LocationPaths.Length == 0) return Enumerable.Empty<string>();
var normalizePaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (var locationPath in LocationPaths)
{
if (Path.IsPathRooted(locationPath))
{
normalizePaths.Add(locationPath);
}
else
{
normalizePaths.Add(Path.Combine(env.TargetDirectory, locationPath));
}
}
return normalizePaths;
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OmniSharp.Options
{
public class RoslynExtensionsOptions : OmniSharpExtensionsOptions
{
public bool EnableDecompilationSupport { get; set; }
public bool EnableAnalyzersSupport { get; set; }
public bool EnableImportCompletion { get; set; }
public bool EnableAsyncCompletion { get; set; }
public int DocumentAnalysisTimeoutMs { get; set; } = 10 * 1000;
public int DiagnosticWorkersThreadCount { get; set; } = Math.Max(1, Environment.ProcessorCount / 2);
}
public class OmniSharpExtensionsOptions
{
public string[] LocationPaths { get; set; }
public IEnumerable<string> GetNormalizedLocationPaths(IOmniSharpEnvironment env)
{
if (LocationPaths == null || LocationPaths.Length == 0) return Enumerable.Empty<string>();
var normalizePaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (var locationPath in LocationPaths)
{
if (Path.IsPathRooted(locationPath))
{
normalizePaths.Add(locationPath);
}
else
{
normalizePaths.Add(Path.Combine(env.TargetDirectory, locationPath));
}
}
return normalizePaths;
}
}
}
|
mit
|
C#
|
5c8423bcf79dbf3edde373025039dcf6e853ffe4
|
Reset VM to be Service based
|
darrelmiller/HypermediaClients,darrelmiller/HypermediaClients
|
SwitchApp/WpfSwitchClient/App.xaml.cs
|
SwitchApp/WpfSwitchClient/App.xaml.cs
|
using System;
using System.Net.Http;
using System.Windows;
using SwitchClient.Classic;
using SwitchClient.Hyper;
namespace WpfSwitchClient
{
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
var client = new HttpClient()
{
BaseAddress = new Uri(String.Format("http://{0}:9090/", Environment.MachineName))
};
var window = new MainWindow(new SwitchViewModel(new SwitchService(client)));
//var window = new MainWindow(new SwitchHyperViewModel(client));
window.Show();
}
}
}
|
using System;
using System.Net.Http;
using System.Windows;
using SwitchClient.Classic;
using SwitchClient.Hyper;
namespace WpfSwitchClient
{
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
var client = new HttpClient()
{
BaseAddress = new Uri(String.Format("http://{0}:9090/", Environment.MachineName))
};
//var window = new MainWindow(new SwitchViewModel(new SwitchService(client)));
var window = new MainWindow(new SwitchHyperViewModel(client));
window.Show();
}
}
}
|
apache-2.0
|
C#
|
e3479b049a079729b8be4d26e4efeb7f5aa20a40
|
Rename variable
|
appharbor/appharbor-cli
|
src/AppHarbor/CommandDispatcher.cs
|
src/AppHarbor/CommandDispatcher.cs
|
using System;
using System.IO;
using System.Linq;
using Castle.MicroKernel;
namespace AppHarbor
{
public class CommandDispatcher
{
private readonly IAliasMatcher _aliasMatcher;
private readonly ITypeNameMatcher _typeNameMatcher;
private readonly IKernel _kernel;
public CommandDispatcher(IAliasMatcher aliasMatcher, ITypeNameMatcher typeNameMatcher, IKernel kernel)
{
_aliasMatcher = aliasMatcher;
_typeNameMatcher = typeNameMatcher;
_kernel = kernel;
}
public void Dispatch(string[] args)
{
var commandArguments = args.TakeWhile(x => !x.StartsWith("-"));
var commandTypeNameCandidate = commandArguments.Any() ? string.Concat(commandArguments.Skip(1).FirstOrDefault(), args[0]) : "help";
Type matchingType = null;
int argsToSkip = 0;
if (_typeNameMatcher.IsSatisfiedBy(commandTypeNameCandidate))
{
matchingType = _typeNameMatcher.GetMatchedType(commandTypeNameCandidate);
argsToSkip = 2;
}
else if (_aliasMatcher.IsSatisfiedBy(args[0]))
{
matchingType = _aliasMatcher.GetMatchedType(args[0]);
argsToSkip = 1;
}
else
{
throw new DispatchException(string.Format("The command \"{0}\" doesn't match a command name or alias", string.Join(" ", args)));
}
var command = (Command)_kernel.Resolve(matchingType);
try
{
command.Execute(args.Skip(argsToSkip).ToArray());
}
catch (ApiException exception)
{
throw new DispatchException(string.Format("An error occured while connecting to the API. {0}", exception.Message));
}
catch (CommandException exception)
{
command.WriteUsage(invokedWith: string.Join(" ", commandArguments),
writer: _kernel.Resolve<TextWriter>());
if (!(exception is HelpException))
{
throw new DispatchException(exception.Message);
}
}
}
}
}
|
using System;
using System.IO;
using System.Linq;
using Castle.MicroKernel;
namespace AppHarbor
{
public class CommandDispatcher
{
private readonly IAliasMatcher _aliasMatcher;
private readonly ITypeNameMatcher _typeNameMatcher;
private readonly IKernel _kernel;
public CommandDispatcher(IAliasMatcher aliasMatcher, ITypeNameMatcher typeNameMatcher, IKernel kernel)
{
_aliasMatcher = aliasMatcher;
_typeNameMatcher = typeNameMatcher;
_kernel = kernel;
}
public void Dispatch(string[] args)
{
var commandArguments = args.TakeWhile(x => !x.StartsWith("-"));
var commandString = commandArguments.Any() ? string.Concat(commandArguments.Skip(1).FirstOrDefault(), args[0]) : "help";
Type matchingType = null;
int argsToSkip = 0;
if (_typeNameMatcher.IsSatisfiedBy(commandString))
{
matchingType = _typeNameMatcher.GetMatchedType(commandString);
argsToSkip = 2;
}
else if (_aliasMatcher.IsSatisfiedBy(args[0]))
{
matchingType = _aliasMatcher.GetMatchedType(args[0]);
argsToSkip = 1;
}
else
{
throw new DispatchException(string.Format("The command \"{0}\" doesn't match a command name or alias", string.Join(" ", args)));
}
var command = (Command)_kernel.Resolve(matchingType);
try
{
command.Execute(args.Skip(argsToSkip).ToArray());
}
catch (ApiException exception)
{
throw new DispatchException(string.Format("An error occured while connecting to the API. {0}", exception.Message));
}
catch (CommandException exception)
{
command.WriteUsage(invokedWith: string.Join(" ", commandArguments),
writer: _kernel.Resolve<TextWriter>());
if (!(exception is HelpException))
{
throw new DispatchException(exception.Message);
}
}
}
}
}
|
mit
|
C#
|
e42193649406e4ba72aaf9bb00cd0cec9ba9d91a
|
add warning about name server synchronisation to manual dns plugin
|
Lone-Coder/letsencrypt-win-simple
|
src/main/Plugins/ValidationPlugins/Dns/Manual/Manual.cs
|
src/main/Plugins/ValidationPlugins/Dns/Manual/Manual.cs
|
using PKISharp.WACS.Services;
namespace PKISharp.WACS.Plugins.ValidationPlugins.Dns
{
class Manual : DnsValidation<ManualOptions, Manual>
{
private IInputService _input;
public Manual(ILogService log, IInputService input, ManualOptions options, string identifier) : base(log, options, identifier)
{
// Usually it's a big no-no to rely on user input in validation plugin
// because this should be able to run unattended. This plugin is for testing
// only and therefor we will allow it. Future versions might be more advanced,
// e.g. shoot an email to an admin and complete the order later.
_input = input;
}
public override void CreateRecord(string recordName, string token)
{
_input.Show("Domain", _identifier, true);
_input.Show("Record", recordName);
_input.Show("Type", "TXT");
_input.Show("Content", $"\"{token}\"");
_input.Show("Note 1", "Some DNS control panels add quotes automatically. Only one set is required.");
_input.Show("Note 2", "Make sure your name servers are synchronised, this may take several minutes!");
_input.Wait("Please press enter after you've created and verified the record");
}
public override void DeleteRecord(string recordName, string token)
{
_input.Show("Domain", _identifier, true);
_input.Show("Record", recordName);
_input.Show("Type", "TXT");
_input.Show("Content", $"\"{token}\"");
_input.Wait("Please press enter after you've deleted the record");
}
}
}
|
using PKISharp.WACS.Services;
namespace PKISharp.WACS.Plugins.ValidationPlugins.Dns
{
class Manual : DnsValidation<ManualOptions, Manual>
{
private IInputService _input;
public Manual(ILogService log, IInputService input, ManualOptions options, string identifier) : base(log, options, identifier)
{
// Usually it's a big no-no to rely on user input in validation plugin
// because this should be able to run unattended. This plugin is for testing
// only and therefor we will allow it. Future versions might be more advanced,
// e.g. shoot an email to an admin and complete the order later.
_input = input;
}
public override void CreateRecord(string recordName, string token)
{
_input.Show("Domain", _identifier, true);
_input.Show("Record", recordName);
_input.Show("Type", "TXT");
_input.Show("Content", $"\"{token}\"");
_input.Show("Note", "Some DNS control panels add quotes automatically. Only one set is required.");
_input.Wait("Please press enter after you've created and verified the record");
}
public override void DeleteRecord(string recordName, string token)
{
_input.Show("Domain", _identifier, true);
_input.Show("Record", recordName);
_input.Show("Type", "TXT");
_input.Show("Content", $"\"{token}\"");
_input.Wait("Please press enter after you've deleted the record");
}
}
}
|
apache-2.0
|
C#
|
996dfe03f839ad273afb8552f1d4d11d6f357de4
|
implement method tryGet to get existing instances out of a lifetime scope
|
pragmatrix/Konstruktor2
|
Konstruktor2/ILifetimeScope.cs
|
Konstruktor2/ILifetimeScope.cs
|
using System;
namespace Konstruktor2
{
public interface ILifetimeScope : IDisposable
{
// Resolve roots and all pined instances that refer to it.
object resolveRoot(Type t);
// Resolve in this scope or parent scopes,
// create a new instance in this scope if it is not existing yet.
object resolve(Type t);
void store<TypeT>(TypeT instance);
void own(object instance_);
ILifetimeScope beginNestedScope();
// internal
bool tryResolveExisting(Type t, out object o);
uint Level { get; }
}
public static class LifetimeScopeExtensions
{
public static T resolve<T>(this ILifetimeScope lifetimeScope)
{
return (T) lifetimeScope.resolve(typeof (T));
}
/// Try get an instance that already exists in the lifetime scope.
public static bool tryGet<T>(this ILifetimeScope lifetimeScope, out T value)
{
object r;
if (lifetimeScope.tryResolveExisting(typeof (T), out r))
{
value = (T) r;
return true;
}
value = default(T);
return false;
}
public static TypeT resolveRoot<TypeT>(this ILifetimeScope scope)
{
return (TypeT)scope.resolveRoot(typeof(TypeT));
}
}
}
|
using System;
namespace Konstruktor2
{
public interface ILifetimeScope : IDisposable
{
// Resolve roots and all pined instances that refer to it.
object resolveRoot(Type t);
// Resolve in this scope or parent scopes,
// create a new instance in this scope if it is not existing yet.
object resolve(Type t);
void store<TypeT>(TypeT instance);
void own(object instance_);
ILifetimeScope beginNestedScope();
// internal
bool tryResolveExisting(Type t, out object o);
uint Level { get; }
}
public static class LifetimeScopeExtensions
{
public static T resolve<T>(this ILifetimeScope lifetimeScope)
{
return (T) lifetimeScope.resolve(typeof (T));
}
public static TypeT resolveRoot<TypeT>(this ILifetimeScope scope)
{
return (TypeT)scope.resolveRoot(typeof(TypeT));
}
}
}
|
bsd-3-clause
|
C#
|
fdf4206b99de14bacb19bc4d857d2dfae5ea56bf
|
normalize IBU
|
BeerMath/BeerMath.Net,BeerMath/BeerMath.Net
|
src/BeerMathLib/Bitterness/Ibu.cs
|
src/BeerMathLib/Bitterness/Ibu.cs
|
namespace BeerMath
{
public class Ibu : BeerValue
{
public Ibu(decimal raw)
{
Value = raw;
}
}
}
|
namespace BeerMath
{
public class Ibu : BeerValue
{
// private constructor so consumers cannot create
private Ibu() { }
public Ibu(decimal raw)
{
Value = raw;
}
}
}
|
mit
|
C#
|
155cfd22311b84d526be5791c687b6b425cd04f2
|
Remove server header form http responses
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
src/SFA.DAS.EAS.Web/Global.asax.cs
|
src/SFA.DAS.EAS.Web/Global.asax.cs
|
using System;
using System.Security.Claims;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using FluentValidation.Mvc;
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.Azure;
using NLog;
using NLog.Targets;
using SFA.DAS.EAS.Infrastructure.Logging;
namespace SFA.DAS.EAS.Web
{
public class MvcApplication : System.Web.HttpApplication
{
private readonly Logger _logger = LogManager.GetCurrentClassLogger();
private static RedisTarget _redisTarget; // Required to ensure assembly is copied to output.
protected void Application_Start()
{
LoggingConfig.ConfigureLogging();
TelemetryConfiguration.Active.InstrumentationKey = CloudConfigurationManager.GetSetting("InstrumentationKey");
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier;
FluentValidationModelValidatorProvider.Configure();
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
var application = sender as HttpApplication;
application?.Context?.Response.Headers.Remove("Server");
}
protected void Application_Error(object sender, EventArgs e)
{
var exception = Server.GetLastError();
_logger.Error(exception);
var tc = new TelemetryClient();
tc.TrackTrace($"{exception.Message} - {exception.InnerException}");
}
}
}
|
using System;
using System.Security.Claims;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using FluentValidation.Mvc;
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.Azure;
using NLog;
using NLog.Targets;
using SFA.DAS.EAS.Infrastructure.Logging;
namespace SFA.DAS.EAS.Web
{
public class MvcApplication : System.Web.HttpApplication
{
private readonly Logger _logger = LogManager.GetCurrentClassLogger();
private static RedisTarget _redisTarget; // Required to ensure assembly is copied to output.
protected void Application_Start()
{
LoggingConfig.ConfigureLogging();
TelemetryConfiguration.Active.InstrumentationKey = CloudConfigurationManager.GetSetting("InstrumentationKey");
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier;
FluentValidationModelValidatorProvider.Configure();
}
protected void Application_Error(object sender, EventArgs e)
{
var exception = Server.GetLastError();
_logger.Error(exception);
var tc = new TelemetryClient();
tc.TrackTrace($"{exception.Message} - {exception.InnerException}");
}
}
}
|
mit
|
C#
|
622233519d752d1bf2f80d4a09bfcf302859fc02
|
make test more tollerant
|
maximn/google-maps,maximn/google-maps
|
GoogleMapsApi.Test/IntegrationTests/ElevationTests.cs
|
GoogleMapsApi.Test/IntegrationTests/ElevationTests.cs
|
using System.Linq;
using GoogleMapsApi.Entities.Common;
using GoogleMapsApi.Entities.Elevation.Request;
using NUnit.Framework;
namespace GoogleMapsApi.Test.IntegrationTests
{
[TestFixture]
public class ElevationTests : BaseTestIntegration
{
[Test]
public void Elevation_ReturnsCorrectElevation()
{
var request = new ElevationRequest { Locations = new[] { new Location(40.7141289, -73.9614074) } };
var result = GoogleMaps.Elevation.Query(request);
if (result.Status == Entities.Elevation.Response.Status.OVER_QUERY_LIMIT)
Assert.Inconclusive("Cannot run test since you have exceeded your Google API query limit.");
Assert.AreEqual(Entities.Elevation.Response.Status.OK, result.Status);
Assert.AreEqual(14.78, result.Results.First().Elevation, 1.0);
}
[Test]
public void ElevationAsync_ReturnsCorrectElevation()
{
var request = new ElevationRequest { Locations = new[] { new Location(40.7141289, -73.9614074) } };
var result = GoogleMaps.Elevation.QueryAsync(request).Result;
if (result.Status == Entities.Elevation.Response.Status.OVER_QUERY_LIMIT)
Assert.Inconclusive("Cannot run test since you have exceeded your Google API query limit.");
Assert.AreEqual(Entities.Elevation.Response.Status.OK, result.Status);
Assert.AreEqual(14.78, result.Results.First().Elevation, 1.0);
}
}
}
|
using System.Linq;
using GoogleMapsApi.Entities.Common;
using GoogleMapsApi.Entities.Elevation.Request;
using NUnit.Framework;
namespace GoogleMapsApi.Test.IntegrationTests
{
[TestFixture]
public class ElevationTests : BaseTestIntegration
{
[Test]
public void Elevation_ReturnsCorrectElevation()
{
var request = new ElevationRequest { Locations = new[] { new Location(40.7141289, -73.9614074) } };
var result = GoogleMaps.Elevation.Query(request);
if (result.Status == Entities.Elevation.Response.Status.OVER_QUERY_LIMIT)
Assert.Inconclusive("Cannot run test since you have exceeded your Google API query limit.");
Assert.AreEqual(Entities.Elevation.Response.Status.OK, result.Status);
Assert.AreEqual(14.782454490661619, result.Results.First().Elevation);
}
[Test]
public void ElevationAsync_ReturnsCorrectElevation()
{
var request = new ElevationRequest { Locations = new[] { new Location(40.7141289, -73.9614074) } };
var result = GoogleMaps.Elevation.QueryAsync(request).Result;
if (result.Status == Entities.Elevation.Response.Status.OVER_QUERY_LIMIT)
Assert.Inconclusive("Cannot run test since you have exceeded your Google API query limit.");
Assert.AreEqual(Entities.Elevation.Response.Status.OK, result.Status);
Assert.AreEqual(14.782454490661619, result.Results.First().Elevation);
}
}
}
|
bsd-2-clause
|
C#
|
2ebc7300e9c5588dc8e3ff76810e867398306471
|
Fix typo
|
jsgoupil/quickbooks-sync,jsgoupil/quickbooks-sync
|
src/QbXml/QbXmlResponseOptions.cs
|
src/QbXml/QbXmlResponseOptions.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QbSync.QbXml.Objects;
namespace QbSync.QbXml
{
public class QbXmlResponseOptions
{
/// <summary>
/// Used to interpret the UTC offset of <see cref="DATETIMETYPE"/> values returned in QuickBooks responses.
/// When [accurately] set, <see cref="DATETIMETYPE.Offset"/> will be populated for <see cref="DATETIMETYPE"/>
/// values returned from QuickBooks, and <see cref="DATETIMETYPE.GetDateTimeOffset"/> can be used.
///
/// If a <see cref="TimeZoneInfo"/> is not set, or the <see cref="TimeZoneInfo.BaseUtcOffset"/> does not match the
/// values returned from QuickBooks, the UTC <see cref="DATETIMETYPE.Offset"/> will be null, and the date
/// cannot be converted to UTC or a UTC based value.
/// </summary>
/// <remarks>
/// The reason this option exists is because of the issue that QuickBooks has with regards to handling DST.
/// The Date & time components of returned dates follow DST rules, but the offset always represents standard time.
/// This means during daylight saving time, the offset will be an hour off (for most DST enabled time zones at least).
/// Because different time zones have different DST deltas, and change to/from DST at different times, the
/// actual offset for a date cannot be determined unless the time zone of the host computer is known.
///
/// However, because offsets are optional in QuickBooks date range queries, we can use the values as returned from QuickBooks
/// with the offset component removed, and subsequent requests to QuickBooks with this value will work as expected
/// because QuickBooks will interpret the date & time as being in the local zone of its host computer.
/// </remarks>
public TimeZoneInfo QuickBooksDesktopTimeZone { get; set; }
/// <summary>
/// While the QuickBooks bug is still an issue, how it is handled has slightly changed so
/// implementing this fix can be optional now. In turn, this method has been renamed
/// to better match the updated implementation.
/// </summary>
[Obsolete("This has been renamed to QuickBooksDesktopTimeZone")]
public TimeZoneInfo TimeZoneBugFix
{
get => QuickBooksDesktopTimeZone;
set => QuickBooksDesktopTimeZone = value;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QbSync.QbXml.Objects;
namespace QbSync.QbXml
{
public class QbXmlResponseOptions
{
/// <summary>
/// Used to interpret the UTC offset of <see cref="DATETIMETYPE"/> values returned in QuickBooks responses.
/// When [accurately] set, <see cref="DATETIMETYPE.Offset"/> will be populated for <see cref="DATETIMETYPE"/>
/// values returned from QuickBooks, and <see cref="DATETIMETYPE.GetDateTimeOffset"/> can be used.
///
/// If a <see cref="TimeZoneInfo"/> is not set, or the <see cref="TimeZoneInfo.BaseUtcOffset"/> does not match the
/// values returned from QuickBooks, the UTC <see cref="DATETIMETYPE.Offset"/> will be null, and the date
/// cannot be converted to UTC or a UTC based value.
/// </summary>
/// <remarks>
/// The reason this option exists is because of the issue that QuickBooks has with regards to handling DST.
/// The Date & time components of returned dates follow DST rules, but the offset always represents standard time.
/// This means during daylight saving time, the offset will be an hour off (for most DST enabled time zones at least).
/// Because different time zones have different DST deltas, and change to/from DST at different times, the
/// actual offset for a date cannot be determined unless the time zone of the host computer is known.
///
/// However, because offsets are optional in QuickBooks date range queries, we can use the values as returned from QuickBooks
/// with the offset component removed, and subsequent requests to QuickBooks with this value will work as expected
/// because QuickBooks will interpret the date & time as in the local time it's host computer.
/// </remarks>
public TimeZoneInfo QuickBooksDesktopTimeZone { get; set; }
/// <summary>
/// While the QuickBooks bug is still an issue, how it is handled has slightly changed so
/// implementing this fix can be optional now. In turn, this method has been renamed
/// to better match the updated implementation.
/// </summary>
[Obsolete("This has been renamed to QuickBooksDesktopTimeZone")]
public TimeZoneInfo TimeZoneBugFix
{
get => QuickBooksDesktopTimeZone;
set => QuickBooksDesktopTimeZone = value;
}
}
}
|
mit
|
C#
|
14178900af44bb58f31a8d5c4649c3b6a9c936f4
|
Make sure stopwatch is started at initialisation (see #18).
|
RobThree/IdGen
|
IdGen/StopwatchTimeSource.cs
|
IdGen/StopwatchTimeSource.cs
|
using System;
using System.Diagnostics;
namespace IdGen
{
/// <summary>
/// Provides time data to an <see cref="IdGenerator"/>. This timesource uses a <see cref="Stopwatch"/> for timekeeping.
/// </summary>
public abstract class StopwatchTimeSource : ITimeSource
{
private static readonly Stopwatch _sw = new Stopwatch();
/// <summary>
/// Gets the epoch of the <see cref="ITimeSource"/>.
/// </summary>
public DateTimeOffset Epoch { get; private set; }
/// <summary>
/// Gets the elapsed time since this <see cref="ITimeSource"/> was initialized.
/// </summary>
protected static TimeSpan Elapsed => _sw.Elapsed;
/// <summary>
/// Gets the offset for this <see cref="ITimeSource"/> which is defined as the difference of it's creationdate
/// and it's epoch which is specified in the object's constructor.
/// </summary>
protected TimeSpan Offset { get; private set; }
/// <summary>
/// Initializes a new <see cref="StopwatchTimeSource"/> object.
/// </summary>
/// <param name="epoch">The epoch to use as an offset from now,</param>
/// <param name="tickDuration">The duration of a single tick for this timesource.</param>
public StopwatchTimeSource(DateTimeOffset epoch, TimeSpan tickDuration)
{
Epoch = epoch;
Offset = (DateTimeOffset.UtcNow - Epoch);
TickDuration = tickDuration;
// Start (or resume) stopwatch
_sw.Start();
}
/// <summary>
/// Returns the duration of a single tick.
/// </summary>
public TimeSpan TickDuration { get; private set; }
/// <summary>
/// Returns the current number of ticks for the <see cref="DefaultTimeSource"/>.
/// </summary>
/// <returns>The current number of ticks to be used by an <see cref="IdGenerator"/> when creating an Id.</returns>
public abstract long GetTicks();
}
}
|
using System;
using System.Diagnostics;
namespace IdGen
{
/// <summary>
/// Provides time data to an <see cref="IdGenerator"/>. This timesource uses a <see cref="Stopwatch"/> for timekeeping.
/// </summary>
public abstract class StopwatchTimeSource : ITimeSource
{
private static readonly Stopwatch _sw = Stopwatch.StartNew();
/// <summary>
/// Gets the epoch of the <see cref="ITimeSource"/>.
/// </summary>
public DateTimeOffset Epoch { get; private set; }
/// <summary>
/// Gets the elapsed time since this <see cref="ITimeSource"/> was initialized.
/// </summary>
protected static TimeSpan Elapsed => _sw.Elapsed;
/// <summary>
/// Gets the offset for this <see cref="ITimeSource"/> which is defined as the difference of it's creationdate
/// and it's epoch which is specified in the object's constructor.
/// </summary>
protected TimeSpan Offset { get; private set; }
/// <summary>
/// Initializes a new <see cref="StopwatchTimeSource"/> object.
/// </summary>
/// <param name="epoch">The epoch to use as an offset from now,</param>
/// <param name="tickDuration">The duration of a single tick for this timesource.</param>
public StopwatchTimeSource(DateTimeOffset epoch, TimeSpan tickDuration)
{
Epoch = epoch;
Offset = (DateTimeOffset.UtcNow - Epoch);
TickDuration = tickDuration;
}
/// <summary>
/// Returns the duration of a single tick.
/// </summary>
public TimeSpan TickDuration { get; private set; }
/// <summary>
/// Returns the current number of ticks for the <see cref="DefaultTimeSource"/>.
/// </summary>
/// <returns>The current number of ticks to be used by an <see cref="IdGenerator"/> when creating an Id.</returns>
public abstract long GetTicks();
}
}
|
mit
|
C#
|
1a16484badde5d5c91a89def51c6c89933a5680b
|
update assembly-info version
|
polylingo/l20n.cs
|
src/L20n/Properties/AssemblyInfo.cs
|
src/L20n/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("L20n")]
[assembly: AssemblyDescription("L20n C# Implementation")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("polylingo")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Glen De Cauwsemaecker")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.0")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("L20n")]
[assembly: AssemblyDescription("L20n C# Implementation")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("polylingo")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Glen De Cauwsemaecker")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
|
mit
|
C#
|
7f44be63e84c8734ef35d6b74935739546adfdad
|
Fix typo in StoreStats for SizeInBytes
|
KodrAus/elasticsearch-net,SeanKilleen/elasticsearch-net,amyzheng424/elasticsearch-net,faisal00813/elasticsearch-net,NickCraver/NEST,joehmchan/elasticsearch-net,gayancc/elasticsearch-net,elastic/elasticsearch-net,CSGOpenSource/elasticsearch-net,abibell/elasticsearch-net,TheFireCookie/elasticsearch-net,cstlaurent/elasticsearch-net,geofeedia/elasticsearch-net,LeoYao/elasticsearch-net,robrich/elasticsearch-net,junlapong/elasticsearch-net,LeoYao/elasticsearch-net,alanprot/elasticsearch-net,DavidSSL/elasticsearch-net,azubanov/elasticsearch-net,TheFireCookie/elasticsearch-net,RossLieberman/NEST,tkirill/elasticsearch-net,geofeedia/elasticsearch-net,gayancc/elasticsearch-net,alanprot/elasticsearch-net,cstlaurent/elasticsearch-net,RossLieberman/NEST,DavidSSL/elasticsearch-net,TheFireCookie/elasticsearch-net,mac2000/elasticsearch-net,UdiBen/elasticsearch-net,robertlyson/elasticsearch-net,azubanov/elasticsearch-net,mac2000/elasticsearch-net,junlapong/elasticsearch-net,amyzheng424/elasticsearch-net,UdiBen/elasticsearch-net,geofeedia/elasticsearch-net,abibell/elasticsearch-net,ststeiger/elasticsearch-net,robrich/elasticsearch-net,starckgates/elasticsearch-net,gayancc/elasticsearch-net,junlapong/elasticsearch-net,RossLieberman/NEST,abibell/elasticsearch-net,elastic/elasticsearch-net,joehmchan/elasticsearch-net,robertlyson/elasticsearch-net,wawrzyn/elasticsearch-net,jonyadamit/elasticsearch-net,robertlyson/elasticsearch-net,starckgates/elasticsearch-net,amyzheng424/elasticsearch-net,adam-mccoy/elasticsearch-net,NickCraver/NEST,NickCraver/NEST,Grastveit/NEST,SeanKilleen/elasticsearch-net,adam-mccoy/elasticsearch-net,UdiBen/elasticsearch-net,jonyadamit/elasticsearch-net,mac2000/elasticsearch-net,SeanKilleen/elasticsearch-net,joehmchan/elasticsearch-net,KodrAus/elasticsearch-net,azubanov/elasticsearch-net,faisal00813/elasticsearch-net,LeoYao/elasticsearch-net,ststeiger/elasticsearch-net,tkirill/elasticsearch-net,wawrzyn/elasticsearch-net,CSGOpenSource/elasticsearch-net,adam-mccoy/elasticsearch-net,cstlaurent/elasticsearch-net,tkirill/elasticsearch-net,jonyadamit/elasticsearch-net,KodrAus/elasticsearch-net,starckgates/elasticsearch-net,alanprot/elasticsearch-net,Grastveit/NEST,robrich/elasticsearch-net,CSGOpenSource/elasticsearch-net,alanprot/elasticsearch-net,ststeiger/elasticsearch-net,faisal00813/elasticsearch-net,Grastveit/NEST,wawrzyn/elasticsearch-net,DavidSSL/elasticsearch-net
|
src/Nest/Domain/Stats/StoreStats.cs
|
src/Nest/Domain/Stats/StoreStats.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace Nest
{
[JsonObject]
public class StoreStats
{
[JsonProperty(PropertyName = "size")]
public string Size { get; set; }
[JsonProperty(PropertyName = "size_in_bytes")]
public double SizeInBytes { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace Nest
{
[JsonObject]
public class StoreStats
{
[JsonProperty(PropertyName = "size")]
public string Size { get; set; }
[JsonProperty(PropertyName = "size_in_byes")]
public double SizeInBytes { get; set; }
}
}
|
apache-2.0
|
C#
|
f11049d597e2884faae723002f64a223e9f25b74
|
Add some test coverage
|
Xeeynamo/KingdomHearts
|
OpenKh.Tests/kh2/IdxTests.cs
|
OpenKh.Tests/kh2/IdxTests.cs
|
using OpenKh.Common;
using OpenKh.Kh2;
using System.IO;
using System.Linq;
using Xunit;
namespace OpenKh.Tests.kh2
{
public class IdxTests
{
[Theory]
[InlineData("test", 0x338BCFAC)]
[InlineData("hello world!", 0xFD8495B7)]
[InlineData("00battle.bin", 0x2029C445)]
public void CalculateHash32(string text, uint hash)
{
Assert.Equal(hash, Idx.GetHash32(text));
}
[Theory]
[InlineData("test", 0xB82F)]
[InlineData("hello world!", 0x0907)]
public void CalculateHash16(string text, ushort hash)
{
Assert.Equal(hash, Idx.GetHash16(text));
}
[Fact]
public void ReadIdxEntry()
{
var entry = MockIdxEntry(1, 2, 3, 4, 5);
Assert.Equal(1U, entry.Hash32);
Assert.Equal(2, entry.Hash16);
Assert.Equal(3U, entry.BlockLength);
Assert.Equal(4U, entry.Offset);
Assert.Equal(5U, entry.Length);
}
[Theory]
[InlineData(0x3fff, false, false)]
[InlineData(0x4000, true, false)]
[InlineData(0x8000, false, true)]
[InlineData(0xc000, true, true)]
public void ReadBlockDescriptionFlags(ushort blockDescriptor, bool expectedIsCompressed, bool expectedIsStreamed)
{
var entry = MockIdxEntry(0, 0, blockDescriptor, 0, 0);
Assert.Equal(expectedIsCompressed, entry.IsCompressed);
Assert.Equal(expectedIsStreamed, entry.IsStreamed);
}
[Theory]
[InlineData(0x2029C445, 0x176F, "00battle.bin")]
[InlineData(0x10303F6F, 0xF325, "obj/B_LK120_RAW.mset")]
[InlineData(0x01234567, 0xcdef, null)]
public void GiveRealNames(uint hash32, ushort hash16, string name)
{
var entry = MockIdx(hash32, hash16, 0, 0, 0).GetNameEntries().First();
Assert.Equal(name, entry.Name);
}
private static Idx MockIdx(uint hash32, ushort hash16, ushort blockDescriptor, int offset, int length)
{
const int IdxFileCount = 1;
using var stream = new MemoryStream(0x14);
stream.Write(IdxFileCount);
stream.Write(hash32);
stream.Write(hash16);
stream.Write(blockDescriptor);
stream.Write(offset);
stream.Write(length);
return Idx.Read(stream.SetPosition(0));
}
private static Idx.Entry MockIdxEntry(uint hash32, ushort hash16, ushort blockDescriptor, int offset, int length) =>
MockIdx(hash32, hash16, blockDescriptor, offset, length).Items.First();
}
}
|
using OpenKh.Kh2;
using Xunit;
namespace OpenKh.Tests.kh2
{
public class IdxTests
{
[Theory]
[InlineData("test", 0x338BCFAC)]
[InlineData("hello world!", 0xFD8495B7)]
[InlineData("00battle.bin", 0x2029C445)]
public void CalculateHash32(string text, uint hash)
{
Assert.Equal(hash, Idx.GetHash32(text));
}
[Theory]
[InlineData("test", 0xB82F)]
[InlineData("hello world!", 0x0907)]
public void CalculateHash16(string text, ushort hash)
{
Assert.Equal(hash, Idx.GetHash16(text));
}
}
}
|
mit
|
C#
|
1330c7315d04b988854ff7425825ff225cf15d07
|
Make QueryExtensions class internal.
|
mdavid/nuget,mdavid/nuget
|
src/VisualStudio/QueryExtensions.cs
|
src/VisualStudio/QueryExtensions.cs
|
using System.Collections.Generic;
using System.Linq;
namespace NuGet.VisualStudio {
/// <summary>
/// This method attempts to retrieve all elements from the specified IQueryable, taking into account
/// the fact that the IQueryable may come from OData service feed, which imposes a server-side paging
/// limits in its query responses.
///
/// It works around the limitation by repeatedly querying the source until the latter runs out of items.
/// </summary>
internal static class QueryExtensions {
public static IEnumerable<T> GetAll<T>(this IQueryable<T> source, int skip, int? first) {
bool useFirst = first.HasValue;
int totalItemCount = 0;
while (!useFirst || totalItemCount < first.Value) {
var query = source.Skip(skip + totalItemCount);
if (useFirst) {
// only take what we need
query = query.Take(first.Value - totalItemCount);
}
int queryItemCount = 0;
foreach (T item in query) {
yield return item;
queryItemCount++;
}
totalItemCount += queryItemCount;
if (queryItemCount == 0) {
// stop if no item is returned
yield break;
}
}
}
public static IEnumerable<T> SkipAndTake<T>(this IEnumerable<T> source, int skip, int? take) {
var queryableSource = source as IQueryable<T>;
if (queryableSource != null) {
return GetAll(queryableSource, skip, take);
}
else {
var query = source.Skip(skip);
if (take.HasValue) {
query = query.Take(take.Value);
}
return query;
}
}
}
}
|
using System.Collections.Generic;
using System.Linq;
namespace NuGet.VisualStudio {
/// <summary>
/// This method attempts to retrieve all elements from the specified IQueryable, taking into account
/// the fact that the IQueryable may come from OData service feed, which imposes a server-side paging
/// limits in its query responses.
///
/// It works around the limitation by repeatedly querying the source until the latter runs out of items.
/// </summary>
public static class QueryExtensions {
public static IEnumerable<T> GetAll<T>(this IQueryable<T> source, int skip, int? first) {
bool useFirst = first.HasValue;
int totalItemCount = 0;
while (!useFirst || totalItemCount < first.Value) {
var query = source.Skip(skip + totalItemCount);
if (useFirst) {
// only take what we need
query = query.Take(first.Value - totalItemCount);
}
int queryItemCount = 0;
foreach (T item in query) {
yield return item;
queryItemCount++;
}
totalItemCount += queryItemCount;
if (queryItemCount == 0) {
// stop if no item is returned
yield break;
}
}
}
public static IEnumerable<T> SkipAndTake<T>(this IEnumerable<T> source, int skip, int? take) {
var queryableSource = source as IQueryable<T>;
if (queryableSource != null) {
return GetAll(queryableSource, skip, take);
}
else {
var query = source.Skip(skip);
if (take.HasValue) {
query = query.Take(take.Value);
}
return query;
}
}
}
}
|
apache-2.0
|
C#
|
4ffa4369f0720c97aea467286544ad1c71b7891e
|
Change service name to LogSearchShipper - closes #41
|
modulexcite/LogSearchShipper,cityindex/LogSearchShipper
|
src/LogSearchShipper/Program.cs
|
src/LogSearchShipper/Program.cs
|
using System;
using System.Threading;
using log4net;
using log4net.Config;
using LogSearchShipper.Core;
using Topshelf;
namespace LogSearchShipper
{
internal class MainClass
{
private static readonly ILog _log = LogManager.GetLogger(typeof (MainClass));
public static void Main(string[] args)
{
XmlConfigurator.Configure();
HostFactory.Run(x =>
{
x.Service<LogSearchShipperService>();
x.RunAsNetworkService();
x.StartAutomatically();
x.SetDescription("LogSearchShipper - forwards (Windows) log files to Logsearch cluster");
x.SetDisplayName("LogSearchShipper");
x.SetServiceName("LogSearchShipper");
x.EnableServiceRecovery(rc => { rc.RestartService(1); // restart the service after 1 minute
});
x.UseLog4Net();
x.UseLinuxIfAvailable();
});
}
}
public class LogSearchShipperService : ServiceControl
{
private static readonly ILog _log = LogManager.GetLogger(typeof (LogSearchShipperService));
private LogSearchShipperProcessManager _LogSearchShipperProcessManager;
private volatile bool _terminate;
public bool Start(HostControl hostControl)
{
var thread = new Thread(args => WatchForExitKey(hostControl));
thread.Start();
_LogSearchShipperProcessManager = new LogSearchShipperProcessManager();
_LogSearchShipperProcessManager.Start();
return true;
}
public bool Stop(HostControl hostControl)
{
_terminate = true;
_log.Debug("Stop: Calling LogSearchShipperProcessManager.Stop()");
_LogSearchShipperProcessManager.Stop();
_log.Debug("Stop: LogSearchShipperProcessManager.Stop() completed");
return true;
}
void WatchForExitKey(HostControl hostControl)
{
while (!_terminate)
{
Thread.Yield();
char ch;
try
{
if (!Console.KeyAvailable)
continue;
var tmp = Console.ReadKey();
ch = tmp.KeyChar;
}
catch (InvalidOperationException)
{
// console input is redirected
var tmp = Console.In.Read();
if (tmp == -1)
continue;
ch = (char)tmp;
}
if (ch == 'q')
{
Stop(hostControl);
Environment.Exit(0);
}
}
}
}
}
|
using System;
using System.Threading;
using log4net;
using log4net.Config;
using LogSearchShipper.Core;
using Topshelf;
namespace LogSearchShipper
{
internal class MainClass
{
private static readonly ILog _log = LogManager.GetLogger(typeof (MainClass));
public static void Main(string[] args)
{
XmlConfigurator.Configure();
HostFactory.Run(x =>
{
x.Service<LogSearchShipperService>();
x.RunAsNetworkService();
x.StartAutomatically();
x.SetDescription("Logsearch Shipper.NET - forwards (Windows) log files to Logsearch cluster");
x.SetDisplayName("Logsearch Shipper.NET");
x.SetServiceName("logsearch_shipper_net");
x.EnableServiceRecovery(rc => { rc.RestartService(1); // restart the service after 1 minute
});
x.UseLog4Net();
x.UseLinuxIfAvailable();
});
}
}
public class LogSearchShipperService : ServiceControl
{
private static readonly ILog _log = LogManager.GetLogger(typeof (LogSearchShipperService));
private LogSearchShipperProcessManager _LogSearchShipperProcessManager;
private volatile bool _terminate;
public bool Start(HostControl hostControl)
{
var thread = new Thread(args => WatchForExitKey(hostControl));
thread.Start();
_LogSearchShipperProcessManager = new LogSearchShipperProcessManager();
_LogSearchShipperProcessManager.Start();
return true;
}
public bool Stop(HostControl hostControl)
{
_terminate = true;
_log.Debug("Stop: Calling LogSearchShipperProcessManager.Stop()");
_LogSearchShipperProcessManager.Stop();
_log.Debug("Stop: LogSearchShipperProcessManager.Stop() completed");
return true;
}
void WatchForExitKey(HostControl hostControl)
{
while (!_terminate)
{
Thread.Yield();
char ch;
try
{
if (!Console.KeyAvailable)
continue;
var tmp = Console.ReadKey();
ch = tmp.KeyChar;
}
catch (InvalidOperationException)
{
// console input is redirected
var tmp = Console.In.Read();
if (tmp == -1)
continue;
ch = (char)tmp;
}
if (ch == 'q')
{
Stop(hostControl);
Environment.Exit(0);
}
}
}
}
}
|
apache-2.0
|
C#
|
6a3a2d2359aeed366367fa12a8c163cc87a16e33
|
include HttpResponseMessage.ReasonPhrase in JwtTokenRefresher unauthorized exception from connector/state service
|
msft-shahins/BotBuilder,stevengum97/BotBuilder,stevengum97/BotBuilder,msft-shahins/BotBuilder,msft-shahins/BotBuilder,stevengum97/BotBuilder,yakumo/BotBuilder,stevengum97/BotBuilder,yakumo/BotBuilder,yakumo/BotBuilder,msft-shahins/BotBuilder,yakumo/BotBuilder
|
CSharp/Library/Microsoft.Bot.Connector.Shared/JwtTokenRefresher.cs
|
CSharp/Library/Microsoft.Bot.Connector.Shared/JwtTokenRefresher.cs
|
using System;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Bot.Connector
{
public class JwtTokenRefresher : DelegatingHandler
{
private readonly MicrosoftAppCredentials credentials;
public JwtTokenRefresher(MicrosoftAppCredentials credentials)
: base()
{
if (credentials == null)
{
throw new ArgumentNullException(nameof(credentials));
}
this.credentials = credentials;
}
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
HttpResponseMessage response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
if (response.StatusCode == HttpStatusCode.Unauthorized)
{
response.Dispose();
var token = await credentials.GetTokenAsync(true).ConfigureAwait(false);
await credentials.ProcessHttpRequestAsync(request, cancellationToken).ConfigureAwait(false);
response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
}
if (this.Unauthorized(response.StatusCode))
{
using (response)
{
try
{
response.EnsureSuccessStatusCode();
}
catch (Exception error)
{
var statusCode = response.StatusCode;
var reasonPhrase = response.ReasonPhrase;
throw new UnauthorizedAccessException($"Authorization for Microsoft App ID {credentials.MicrosoftAppId} failed with status code {statusCode} and reason phrase '{reasonPhrase}'", error);
}
}
}
return response;
}
private bool Unauthorized(System.Net.HttpStatusCode code)
{
return code == HttpStatusCode.Forbidden || code == HttpStatusCode.Unauthorized;
}
}
}
|
using System;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Bot.Connector
{
public class JwtTokenRefresher : DelegatingHandler
{
private readonly MicrosoftAppCredentials credentials;
public JwtTokenRefresher(MicrosoftAppCredentials credentials)
: base()
{
if (credentials == null)
{
throw new ArgumentNullException(nameof(credentials));
}
this.credentials = credentials;
}
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
HttpResponseMessage response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
if (response.StatusCode == HttpStatusCode.Unauthorized)
{
response.Dispose();
var token = await credentials.GetTokenAsync(true).ConfigureAwait(false);
await credentials.ProcessHttpRequestAsync(request, cancellationToken).ConfigureAwait(false);
response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
}
if (this.Unauthorized(response.StatusCode))
{
var statusCode = response.StatusCode;
response.Dispose();
throw new UnauthorizedAccessException($"Authorization for Microsoft App ID {credentials.MicrosoftAppId} failed with status code {statusCode}");
}
return response;
}
private bool Unauthorized(System.Net.HttpStatusCode code)
{
return code == HttpStatusCode.Forbidden || code == HttpStatusCode.Unauthorized;
}
}
}
|
mit
|
C#
|
ea557800cd2930197d1231a5ee7ae3ddeaa503dd
|
Fix error when accessing HttpContext.Request
|
serilog-web/classic
|
src/SerilogWeb.Classic/Classic/Enrichers/HttpRequestUserAgentEnricher.cs
|
src/SerilogWeb.Classic/Classic/Enrichers/HttpRequestUserAgentEnricher.cs
|
// Copyright 2015 Serilog Contributors
//
// 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 System.Web;
using Serilog.Core;
using Serilog.Events;
namespace SerilogWeb.Classic.Enrichers
{
/// <summary>
/// Enrich log events with the Client User Agent.
/// </summary>
public class HttpRequestUserAgentEnricher : ILogEventEnricher
{
/// <summary>
/// The property name added to enriched log events.
/// </summary>
public const string HttpRequestUserAgentPropertyName = "HttpRequestUserAgent";
#region Implementation of ILogEventEnricher
/// <summary>
/// Enrich the log event.
/// </summary>
/// <param name="logEvent">The log event to enrich.</param>
/// <param name="propertyFactory">Factory for creating new properties to add to the event.</param>
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
{
if (logEvent == null) throw new ArgumentNullException("logEvent");
if (HttpContextCurrent.Request == null)
return;
if (string.IsNullOrWhiteSpace(HttpContextCurrent.Request.UserAgent))
return;
var userAgent = HttpContextCurrent.Request.UserAgent;
var httpRequestUserAgentProperty = new LogEventProperty(HttpRequestUserAgentPropertyName, new ScalarValue(userAgent));
logEvent.AddPropertyIfAbsent(httpRequestUserAgentProperty);
}
#endregion
}
}
|
// Copyright 2015 Serilog Contributors
//
// 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 System.Web;
using Serilog.Core;
using Serilog.Events;
namespace SerilogWeb.Classic.Enrichers
{
/// <summary>
/// Enrich log events with the Client User Agent.
/// </summary>
public class HttpRequestUserAgentEnricher : ILogEventEnricher
{
/// <summary>
/// The property name added to enriched log events.
/// </summary>
public const string HttpRequestUserAgentPropertyName = "HttpRequestUserAgent";
#region Implementation of ILogEventEnricher
/// <summary>
/// Enrich the log event.
/// </summary>
/// <param name="logEvent">The log event to enrich.</param>
/// <param name="propertyFactory">Factory for creating new properties to add to the event.</param>
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
{
if (logEvent == null) throw new ArgumentNullException("logEvent");
if (HttpContext.Current?.Request == null)
return;
if (string.IsNullOrWhiteSpace(HttpContext.Current.Request.UserAgent))
return;
var userAgent = HttpContext.Current.Request.UserAgent;
var httpRequestUserAgentProperty = new LogEventProperty(HttpRequestUserAgentPropertyName, new ScalarValue(userAgent));
logEvent.AddPropertyIfAbsent(httpRequestUserAgentProperty);
}
#endregion
}
}
|
apache-2.0
|
C#
|
b675162716c4478467cb1ff3d939a224e1f44785
|
add talkserviceextension extension
|
takenet/messaginghub-client-csharp
|
src/Takenet.MessagingHub.Client/Extensions/ServiceContainerExtensions.cs
|
src/Takenet.MessagingHub.Client/Extensions/ServiceContainerExtensions.cs
|
using System;
using Takenet.MessagingHub.Client.Extensions.ArtificialIntelligence;
using Takenet.MessagingHub.Client.Extensions.AttendanceForwarding;
using Takenet.MessagingHub.Client.Extensions.Broadcast;
using Takenet.MessagingHub.Client.Extensions.Bucket;
using Takenet.MessagingHub.Client.Extensions.Contacts;
using Takenet.MessagingHub.Client.Extensions.Delegation;
using Takenet.MessagingHub.Client.Extensions.Directory;
using Takenet.MessagingHub.Client.Extensions.EventTracker;
using Takenet.MessagingHub.Client.Extensions.Profile;
using Takenet.MessagingHub.Client.Extensions.Scheduler;
using Takenet.MessagingHub.Client.Extensions.Session;
using Takenet.MessagingHub.Client.Extensions.Threads;
using Takenet.MessagingHub.Client.Host;
using Takenet.MessagingHub.Client.Sender;
namespace Takenet.MessagingHub.Client.Extensions
{
public static class ServiceContainerExtensions
{
internal static IServiceContainer RegisterExtensions(this IServiceContainer serviceContainer)
{
Lime.Messaging.Registrator.RegisterDocuments();
Iris.Messaging.Registrator.RegisterDocuments();
Registrator.RegisterDocuments();
Func<IMessagingHubSender> senderFactory = () => serviceContainer.GetService<IMessagingHubSender>();
serviceContainer.RegisterService(typeof(IBroadcastExtension), () => new BroadcastExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IDelegationExtension), () => new DelegationExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IDirectoryExtension), () => new DirectoryExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IContactExtension), () => new ContactExtension(senderFactory()));
Func<IBucketExtension> bucketExtensionFactory = () => new BucketExtension(senderFactory());
serviceContainer.RegisterService(typeof(ISchedulerExtension), () => new SchedulerExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IEventTrackExtension), () => new EventTrackExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IProfileExtension), () => new ProfileExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IBucketExtension), bucketExtensionFactory);
serviceContainer.RegisterService(typeof(ISessionManager), () => new SessionManager(bucketExtensionFactory()));
serviceContainer.RegisterService(typeof(IAttendanceExtension), () => new AttendanceExtension(senderFactory()));
serviceContainer.RegisterService(typeof(ITalkServiceExtension), () => new TalkServiceExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IThreadExtension), () => new ThreadExtension(senderFactory()));
return serviceContainer;
}
}
}
|
using System;
using Takenet.MessagingHub.Client.Extensions.AttendanceForwarding;
using Takenet.MessagingHub.Client.Extensions.Broadcast;
using Takenet.MessagingHub.Client.Extensions.Bucket;
using Takenet.MessagingHub.Client.Extensions.Contacts;
using Takenet.MessagingHub.Client.Extensions.Delegation;
using Takenet.MessagingHub.Client.Extensions.Directory;
using Takenet.MessagingHub.Client.Extensions.EventTracker;
using Takenet.MessagingHub.Client.Extensions.Profile;
using Takenet.MessagingHub.Client.Extensions.Scheduler;
using Takenet.MessagingHub.Client.Extensions.Session;
using Takenet.MessagingHub.Client.Extensions.Threads;
using Takenet.MessagingHub.Client.Host;
using Takenet.MessagingHub.Client.Sender;
namespace Takenet.MessagingHub.Client.Extensions
{
public static class ServiceContainerExtensions
{
internal static IServiceContainer RegisterExtensions(this IServiceContainer serviceContainer)
{
Lime.Messaging.Registrator.RegisterDocuments();
Iris.Messaging.Registrator.RegisterDocuments();
Registrator.RegisterDocuments();
Func<IMessagingHubSender> senderFactory = () => serviceContainer.GetService<IMessagingHubSender>();
serviceContainer.RegisterService(typeof(IBroadcastExtension), () => new BroadcastExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IDelegationExtension), () => new DelegationExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IDirectoryExtension), () => new DirectoryExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IContactExtension), () => new ContactExtension(senderFactory()));
Func<IBucketExtension> bucketExtensionFactory = () => new BucketExtension(senderFactory());
serviceContainer.RegisterService(typeof(ISchedulerExtension), () => new SchedulerExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IEventTrackExtension), () => new EventTrackExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IProfileExtension), () => new ProfileExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IBucketExtension), bucketExtensionFactory);
serviceContainer.RegisterService(typeof(ISessionManager), () => new SessionManager(bucketExtensionFactory()));
serviceContainer.RegisterService(typeof(IAttendanceExtension), () => new AttendanceExtension(senderFactory()));
serviceContainer.RegisterService(typeof(IThreadExtension), () => new ThreadExtension(senderFactory()));
return serviceContainer;
}
}
}
|
apache-2.0
|
C#
|
6a09ae8b80240e75363aeb56c8fd2505833b62b6
|
Fix failing test
|
peppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,ppy/osu-framework,ZLima12/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,peppy/osu-framework
|
osu.Framework.Tests/Visual/Audio/TestSceneLoopingSample.cs
|
osu.Framework.Tests/Visual/Audio/TestSceneLoopingSample.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio.Sample;
using osu.Framework.Audio.Track;
namespace osu.Framework.Tests.Visual.Audio
{
public class TestSceneLoopingSample : FrameworkTestScene
{
private SampleChannel sampleChannel;
private ISampleStore samples;
[BackgroundDependencyLoader]
private void load(ISampleStore samples)
{
this.samples = samples;
}
[Test]
public void TestLoopingToggle()
{
AddStep("create sample", createSample);
AddAssert("not looping", () => !sampleChannel.Looping);
AddStep("enable looping", () => sampleChannel.Looping = true);
AddStep("play sample", () => sampleChannel.Play());
AddAssert("is playing", () => sampleChannel.Playing);
AddWaitStep("wait", 1);
AddAssert("is still playing", () => sampleChannel.Playing);
AddStep("disable looping", () => sampleChannel.Looping = false);
AddUntilStep("ensure stops", () => !sampleChannel.Playing);
}
[Test]
public void TestStopWhileLooping()
{
AddStep("create sample", createSample);
AddStep("enable looping", () => sampleChannel.Looping = true);
AddStep("play sample", () => sampleChannel.Play());
AddWaitStep("wait", 1);
AddAssert("is playing", () => sampleChannel.Playing);
AddStep("stop playing", () => sampleChannel.Stop());
AddAssert("not playing", () => !sampleChannel.Playing);
}
private void createSample()
{
sampleChannel?.Dispose();
sampleChannel = samples.Get("tone.wav");
// reduce volume of the tone due to how loud it normally is.
if (sampleChannel != null)
sampleChannel.Volume.Value = 0.05;
}
protected override void Dispose(bool isDisposing)
{
sampleChannel?.Dispose();
base.Dispose(isDisposing);
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio.Sample;
using osu.Framework.Audio.Track;
namespace osu.Framework.Tests.Visual.Audio
{
public class TestSceneLoopingSample : FrameworkTestScene
{
private SampleChannel sampleChannel;
private ISampleStore samples;
[BackgroundDependencyLoader]
private void load(ISampleStore samples)
{
this.samples = samples;
}
[Test]
public void TestLoopingToggle()
{
AddStep("create sample", createSample);
AddAssert("not looping", () => !sampleChannel.Looping);
AddStep("enable looping", () => sampleChannel.Looping = true);
AddStep("play sample", () => sampleChannel.Play());
AddAssert("is playing", () => sampleChannel.Playing);
AddWaitStep("wait", 1);
AddAssert("is still playing", () => sampleChannel.Playing);
AddStep("disable looping", () => sampleChannel.Looping = false);
AddAssert("not playing", () => !sampleChannel.Playing);
}
[Test]
public void TestStopWhileLooping()
{
AddStep("create sample", createSample);
AddStep("enable looping", () => sampleChannel.Looping = true);
AddStep("play sample", () => sampleChannel.Play());
AddWaitStep("wait", 1);
AddAssert("is playing", () => sampleChannel.Playing);
AddStep("stop playing", () => sampleChannel.Stop());
AddAssert("not playing", () => !sampleChannel.Playing);
}
private void createSample()
{
sampleChannel?.Dispose();
sampleChannel = samples.Get("tone.wav");
// reduce volume of the tone due to how loud it normally is.
if (sampleChannel != null)
sampleChannel.Volume.Value = 0.05;
}
protected override void Dispose(bool isDisposing)
{
sampleChannel?.Dispose();
base.Dispose(isDisposing);
}
}
}
|
mit
|
C#
|
6c43a986fb5c17dff4080fa653af983278514e4d
|
fix issue with trailing null symbol
|
Alexx999/SwfSharp
|
SwfSharp/Tags/MetadataTag.cs
|
SwfSharp/Tags/MetadataTag.cs
|
using System.Text;
using SwfSharp.Utils;
namespace SwfSharp.Tags
{
public class MetadataTag : SwfTag
{
public string Metadata { get; set; }
public MetadataTag() : this(0)
{
}
public MetadataTag(int size)
: base(TagType.Metadata, size)
{
}
internal override void FromStream(BitReader reader, byte swfVersion)
{
Metadata = reader.ReadString(Size - 1);
reader.ReadUI8();
}
internal override void ToStream(BitWriter writer, byte swfVersion)
{
writer.WriteStringBytes(Metadata, swfVersion);
writer.WriteUI8(0);
}
}
}
|
using System.Text;
using SwfSharp.Utils;
namespace SwfSharp.Tags
{
public class MetadataTag : SwfTag
{
public string Metadata { get; set; }
public MetadataTag() : this(0)
{
}
public MetadataTag(int size)
: base(TagType.Metadata, size)
{
}
internal override void FromStream(BitReader reader, byte swfVersion)
{
Metadata = reader.ReadString(Size - 1);
}
internal override void ToStream(BitWriter writer, byte swfVersion)
{
writer.WriteStringBytes(Metadata, swfVersion);
}
}
}
|
mit
|
C#
|
7adf8aa8bb50fe9175417e4c89bc0c39962e6437
|
Rewrite using expression-bodied function member.
|
AIWolfSharp/AIWolf_NET
|
AIWolfLib/ShuffleExtensions.cs
|
AIWolfLib/ShuffleExtensions.cs
|
//
// ShuffleExtensions.cs
//
// Copyright (c) 2017 Takashi OTSUKI
//
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
//
using System;
using System.Collections.Generic;
using System.Linq;
namespace AIWolf.Lib
{
#if JHELP
/// <summary>
/// IEnumerableインターフェースを実装したクラスに対するShuffle拡張メソッド定義
/// </summary>
#else
/// <summary>
/// Defines extension method to shuffle what implements IEnumerable interface.
/// </summary>
#endif
public static class ShuffleExtensions
{
#if JHELP
/// <summary>
/// IEnumerableをシャッフルしたものを返す
/// </summary>
/// <typeparam name="T">IEnumerableの要素の型</typeparam>
/// <param name="s">TのIEnumerable</param>
/// <returns>シャッフルされたIEnumerable</returns>
#else
/// <summary>
/// Returns shuffled IEnumerable of T.
/// </summary>
/// <typeparam name="T">Type of element of IEnumerable.</typeparam>
/// <param name="s">IEnumerable of T.</param>
/// <returns>Shuffled IEnumerable of T.</returns>
#endif
public static IOrderedEnumerable<T> Shuffle<T>(this IEnumerable<T> s) => s.OrderBy(x => Guid.NewGuid());
}
}
|
//
// ShuffleExtensions.cs
//
// Copyright (c) 2017 Takashi OTSUKI
//
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
//
using System;
using System.Collections.Generic;
using System.Linq;
namespace AIWolf.Lib
{
#if JHELP
/// <summary>
/// IEnumerableインターフェースを実装したクラスに対するShuffle拡張メソッド定義
/// </summary>
#else
/// <summary>
/// Defines extension method to shuffle what implements IEnumerable interface.
/// </summary>
#endif
public static class ShuffleExtensions
{
#if JHELP
/// <summary>
/// IEnumerableをシャッフルしたものを返す
/// </summary>
/// <typeparam name="T">IEnumerableの要素の型</typeparam>
/// <param name="s">TのIEnumerable</param>
/// <returns>シャッフルされたIEnumerable</returns>
#else
/// <summary>
/// Returns shuffled IEnumerable of T.
/// </summary>
/// <typeparam name="T">Type of element of IEnumerable.</typeparam>
/// <param name="s">IEnumerable of T.</param>
/// <returns>Shuffled IEnumerable of T.</returns>
#endif
public static IOrderedEnumerable<T> Shuffle<T>(this IEnumerable<T> s)
{
return s.OrderBy(x => Guid.NewGuid());
}
}
}
|
mit
|
C#
|
72407ff49686624c725f7e2d5e1e43871c4b3dd5
|
Update version.
|
Grabacr07/KanColleViewer
|
source/Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
|
source/Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("提督業も忙しい!")]
[assembly: AssemblyDescription("提督業も忙しい!")]
[assembly: AssemblyCompany("grabacr.net")]
[assembly: AssemblyProduct("KanColleViewer")]
[assembly: AssemblyCopyright("Copyright © 2013 Grabacr07")]
[assembly: ComVisible(false)]
[assembly: Guid("101B49A6-7E7B-422D-95FF-500F9EF483A8")]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("4.2.12.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("提督業も忙しい!")]
[assembly: AssemblyDescription("提督業も忙しい!")]
[assembly: AssemblyCompany("grabacr.net")]
[assembly: AssemblyProduct("KanColleViewer")]
[assembly: AssemblyCopyright("Copyright © 2013 Grabacr07")]
[assembly: ComVisible(false)]
[assembly: Guid("101B49A6-7E7B-422D-95FF-500F9EF483A8")]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("4.2.11.0")]
|
mit
|
C#
|
86508fb39abd6e3c722d4473d2b3e470c284e3b3
|
Update to default Razor snippet we use to help with Block List editor
|
robertjf/Umbraco-CMS,umbraco/Umbraco-CMS,umbraco/Umbraco-CMS,arknu/Umbraco-CMS,arknu/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,umbraco/Umbraco-CMS,bjarnef/Umbraco-CMS,mattbrailsford/Umbraco-CMS,dawoe/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,marcemarc/Umbraco-CMS,abjerner/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,tcmorris/Umbraco-CMS,tcmorris/Umbraco-CMS,umbraco/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,KevinJump/Umbraco-CMS,leekelleher/Umbraco-CMS,hfloyd/Umbraco-CMS,madsoulswe/Umbraco-CMS,dawoe/Umbraco-CMS,abryukhov/Umbraco-CMS,hfloyd/Umbraco-CMS,leekelleher/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,bjarnef/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,tcmorris/Umbraco-CMS,tcmorris/Umbraco-CMS,leekelleher/Umbraco-CMS,hfloyd/Umbraco-CMS,abryukhov/Umbraco-CMS,abjerner/Umbraco-CMS,tcmorris/Umbraco-CMS,marcemarc/Umbraco-CMS,mattbrailsford/Umbraco-CMS,leekelleher/Umbraco-CMS,KevinJump/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,madsoulswe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,arknu/Umbraco-CMS,bjarnef/Umbraco-CMS,hfloyd/Umbraco-CMS,madsoulswe/Umbraco-CMS,bjarnef/Umbraco-CMS,leekelleher/Umbraco-CMS,mattbrailsford/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,robertjf/Umbraco-CMS
|
src/Umbraco.Web.UI/Views/Partials/BlockList/Default.cshtml
|
src/Umbraco.Web.UI/Views/Partials/BlockList/Default.cshtml
|
@inherits UmbracoViewPage<BlockListModel>
@using Umbraco.Core.Models.Blocks
@{
if (!Model.Any()) { return; }
}
<div class="umb-block-list">
@foreach (var block in Model)
{
if (block?.ContentUdi == null) { continue; }
var data = block.Content;
@Html.Partial("BlockList/Components/" + data.ContentType.Alias, block)
}
</div>
|
@inherits UmbracoViewPage<BlockListModel>
@using Umbraco.Core.Models.Blocks
@{
if (Model?.Layout == null || !Model.Layout.Any()) { return; }
}
<div class="umb-block-list">
@foreach (var layout in Model.Layout)
{
if (layout?.Udi == null) { continue; }
var data = layout.Data;
@Html.Partial("BlockList/Components/" + data.ContentType.Alias, layout)
}
</div>
|
mit
|
C#
|
fe0a77148c32d110099e626591dae22a1ee9b408
|
Fix line-endings.
|
alastairs/cgowebsite,alastairs/cgowebsite
|
src/CGO.Web/Controllers/ConcertsController.cs
|
src/CGO.Web/Controllers/ConcertsController.cs
|
using System;
using System.Linq;
using System.Web.Mvc;
using CGO.Domain;
namespace CGO.Web.Controllers
{
public class ConcertsController : Controller
{
private readonly IConcertDetailsService concertDetailsService;
private readonly IConcertsSeasonService concertsSeasonService;
public ConcertsController(IConcertDetailsService concertDetailsService, IConcertsSeasonService concertsSeasonService)
{
if (concertDetailsService == null)
{
throw new ArgumentNullException("concertDetailsService");
}
if (concertsSeasonService == null)
{
throw new ArgumentNullException("concertsSeasonService");
}
this.concertDetailsService = concertDetailsService;
this.concertsSeasonService = concertsSeasonService;
}
//
// GET: /Concerts/
public ActionResult Index()
{
var concerts = concertDetailsService.GetFutureConcerts();
if (concerts.Any())
{
return View("Index", concerts);
}
return RedirectToAction("Index", "Home");
}
//
// GET: /Concerts/Details/5
public ActionResult Details(int id)
{
var concert = concertDetailsService.GetConcert(id);
if (concert == null)
{
return new HttpNotFoundResult();
}
return View("Details", concert);
}
//
// GET: /Concerts/Archive/2009
public ActionResult Archive(int year)
{
var concerts = concertsSeasonService.GetConcertsInSeason(year);
ViewBag.ConcertSeason = string.Format("{0}-{1}", year, year + 1);
return View("Archive", concerts);
}
//
// GET: /Concerts/Archived/
public ActionResult Archived()
{
return View("ArchiveIndex");
}
}
}
|
using System;
using System.Linq;
using System.Web.Mvc;
using CGO.Domain;
namespace CGO.Web.Controllers
{
public class ConcertsController : Controller
{
private readonly IConcertDetailsService concertDetailsService;
private readonly IConcertsSeasonService concertsSeasonService;
public ConcertsController(IConcertDetailsService concertDetailsService, IConcertsSeasonService concertsSeasonService)
{
if (concertDetailsService == null)
{
throw new ArgumentNullException("concertDetailsService");
}
if (concertsSeasonService == null)
{
throw new ArgumentNullException("concertsSeasonService");
}
this.concertDetailsService = concertDetailsService;
this.concertsSeasonService = concertsSeasonService;
}
//
// GET: /Concerts/
public ActionResult Index()
{
var concerts = concertDetailsService.GetFutureConcerts();
if (concerts.Any())
{
return View("Index", concerts);
}
return RedirectToAction("Index", "Home");
}
//
// GET: /Concerts/Details/5
public ActionResult Details(int id)
{
var concert = concertDetailsService.GetConcert(id);
if (concert == null)
{
return new HttpNotFoundResult();
}
return View("Details", concert);
}
//
// GET: /Concerts/Archive/2009
public ActionResult Archive(int year)
{
var concerts = concertsSeasonService.GetConcertsInSeason(year);
ViewBag.ConcertSeason = string.Format("{0}-{1}", year, year + 1);
return View("Archive", concerts);
}
//
// GET: /Concerts/Archived/
public ActionResult Archived()
{
return View("ArchiveIndex");
}
}
}
|
mit
|
C#
|
04b8aa4bacae7036a71274f76cfbc499efe8bd62
|
Add a dev oauth app config similar to how desktop does it (https://github.com/desktop/desktop/blob/master/docs/technical/oauth.md)
|
github-for-unity/Unity,github-for-unity/Unity,github-for-unity/Unity
|
src/GitHub.Api/Application/ApplicationInfo.cs
|
src/GitHub.Api/Application/ApplicationInfo.cs
|
#pragma warning disable 436
namespace GitHub.Unity
{
static partial class ApplicationInfo
{
#if DEBUG
public const string ApplicationName = "GitHub for Unity Debug";
public const string ApplicationProvider = "GitHub";
public const string ApplicationSafeName = "GitHubUnity-dev";
#else
public const string ApplicationName = "GitHubUnity";
public const string ApplicationProvider = "GitHub";
public const string ApplicationSafeName = "GitHubUnity";
#endif
public const string ApplicationDescription = "GitHub for Unity";
#if DEBUG
/*
For external contributors, we have bundled a developer OAuth application
called `GitHub for Unity (dev)` so that you can complete the sign in flow
locally without needing to configure your own application.
This is for testing only and it is (obviously) public, proceed with caution.
For a release build, you should create a new oauth application on github.com,
copy the `common/ApplicationInfo_Local.cs-example`
template to `common/ApplicationInfo_Local.cs` and fill out the `myClientId` and
`myClientSecret` fields for your oauth app.
*/
internal static string ClientId { get; private set; } = "924a97f36926f535e72c";
internal static string ClientSecret { get; private set; } = "b4fa550b7f8e38034c6b1339084fa125eebb6155";
#else
internal static string ClientId { get; private set; } = "";
internal static string ClientSecret { get; private set; } = "";
#endif
public static string Version { get { return System.AssemblyVersionInformation.Version; } }
static partial void SetClientData();
static ApplicationInfo()
{
SetClientData();
}
}
}
|
#pragma warning disable 436
namespace GitHub.Unity
{
static partial class ApplicationInfo
{
#if DEBUG
public const string ApplicationName = "GitHub for Unity Debug";
public const string ApplicationProvider = "GitHub";
public const string ApplicationSafeName = "GitHubUnity-dev";
#else
public const string ApplicationName = "GitHubUnity";
public const string ApplicationProvider = "GitHub";
public const string ApplicationSafeName = "GitHubUnity";
#endif
public const string ApplicationDescription = "GitHub for Unity";
internal static string ClientId { get; private set; } = "";
internal static string ClientSecret { get; private set; } = "";
public static string Version { get { return System.AssemblyVersionInformation.Version; } }
static partial void SetClientData();
static ApplicationInfo()
{
SetClientData();
}
}
}
|
mit
|
C#
|
f3fec77e7d9a9447b57d755eb1b2f11203d81c70
|
Add missing PublicAPI attributes to IHeadset
|
WolfspiritM/Colore,CoraleStudios/Colore
|
Corale.Colore/Core/IHeadset.cs
|
Corale.Colore/Core/IHeadset.cs
|
// ---------------------------------------------------------------------------------------
// <copyright file="IHeadset.cs" company="Corale">
// Copyright © 2015 by Adam Hellberg and Brandon Scott.
//
// 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.
//
// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any
// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott
// do not take responsibility for any harm caused, direct or indirect, to any
// Razer peripherals via the use of Colore.
//
// "Razer" is a trademark of Razer USA Ltd.
// </copyright>
// ---------------------------------------------------------------------------------------
namespace Corale.Colore.Core
{
using Corale.Colore.Annotations;
using Corale.Colore.Razer.Headset.Effects;
/// <summary>
/// Interface for headset functionality.
/// </summary>
public partial interface IHeadset : IDevice
{
/// <summary>
/// Sets an effect on the headset that doesn't
/// take any parameters, currently only valid
/// for the <see cref="Effect.SpectrumCycling" /> effect.
/// </summary>
/// <param name="effect">The type of effect to set.</param>
[PublicAPI]
void SetEffect(Effect effect);
/// <summary>
/// Sets a new static effect on the headset.
/// </summary>
/// <param name="effect">
/// An instance of the <see cref="Static" /> struct
/// describing the effect.
/// </param>
[PublicAPI]
void SetStatic(Static effect);
/// <summary>
/// Sets a new breathing effect on the headset.
/// </summary>
/// <param name="effect">
/// An instance of the <see cref="Breathing" /> struct
/// describing the effect.
/// </param>
[PublicAPI]
void SetBreathing(Breathing effect);
}
}
|
// ---------------------------------------------------------------------------------------
// <copyright file="IHeadset.cs" company="Corale">
// Copyright © 2015 by Adam Hellberg and Brandon Scott.
//
// 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.
//
// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any
// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott
// do not take responsibility for any harm caused, direct or indirect, to any
// Razer peripherals via the use of Colore.
//
// "Razer" is a trademark of Razer USA Ltd.
// </copyright>
// ---------------------------------------------------------------------------------------
namespace Corale.Colore.Core
{
using Corale.Colore.Razer.Headset.Effects;
/// <summary>
/// Interface for headset functionality.
/// </summary>
public partial interface IHeadset : IDevice
{
/// <summary>
/// Sets an effect on the headset that doesn't
/// take any parameters, currently only valid
/// for the <see cref="Effect.SpectrumCycling" /> effect.
/// </summary>
/// <param name="effect">The type of effect to set.</param>
void SetEffect(Effect effect);
/// <summary>
/// Sets a new static effect on the headset.
/// </summary>
/// <param name="effect">
/// An instance of the <see cref="Static" /> struct
/// describing the effect.
/// </param>
void SetStatic(Static effect);
/// <summary>
/// Sets a new breathing effect on the headset.
/// </summary>
/// <param name="effect">
/// An instance of the <see cref="Breathing" /> struct
/// describing the effect.
/// </param>
void SetBreathing(Breathing effect);
}
}
|
mit
|
C#
|
0f7fbbe8ddcb413e4eeeadc79cef776d6b52d402
|
Add Goerli to Chain
|
Nethereum/Nethereum,Nethereum/Nethereum,Nethereum/Nethereum,Nethereum/Nethereum,Nethereum/Nethereum
|
src/Nethereum.Signer/Chain.cs
|
src/Nethereum.Signer/Chain.cs
|
namespace Nethereum.Signer
{
public enum Chain
{
MainNet = 1,
Morden = 2,
Ropsten = 3,
Rinkeby = 4,
Goerli = 5,
RootstockMainNet = 30,
RootstockTestNet = 31,
Kovan = 42,
ClassicMainNet = 61,
ClassicTestNet = 62,
Private = 1337
}
}
|
namespace Nethereum.Signer
{
public enum Chain
{
MainNet = 1,
Morden = 2,
Ropsten = 3,
Rinkeby = 4,
RootstockMainNet = 30,
RootstockTestNet = 31,
Kovan = 42,
ClassicMainNet = 61,
ClassicTestNet = 62,
Private = 1337
}
}
|
mit
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.