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 |
---|---|---|---|---|---|---|---|---|
9b03fe59f4bf87e46416d7e05c7f5ed670753503
|
Add a wrong password status
|
flagbug/Espera.Network
|
Espera.Network/ResponseStatus.cs
|
Espera.Network/ResponseStatus.cs
|
namespace Espera.Network
{
public enum ResponseStatus
{
Success,
PlaylistEntryNotFound,
Unauthorized,
MalformedRequest,
NotFound,
NotSupported,
Rejected,
Fatal,
WrongPassword
}
}
|
namespace Espera.Network
{
public enum ResponseStatus
{
Success,
PlaylistEntryNotFound,
Unauthorized,
MalformedRequest,
NotFound,
NotSupported,
Rejected,
Fatal
}
}
|
mit
|
C#
|
d393ae633357bfeefba9a83ba9bd9d453ba7df3c
|
Make ArchiveData implement IComparable Should allow you to sort lists of ArchiveData objects (and anything that extends from it, such as ArchiveFile) by name, alphabetically.
|
Radfordhound/HedgeLib,Radfordhound/HedgeLib
|
HedgeLib/Archives/ArchiveData.cs
|
HedgeLib/Archives/ArchiveData.cs
|
using System;
namespace HedgeLib.Archives
{
public class ArchiveData : IComparable
{
// Variables/Constants
public string Name;
// Methods
public virtual void Extract(string filePath)
{
throw new NotImplementedException();
}
public virtual int CompareTo(object obj)
{
if (obj == null)
return 1;
if (obj is ArchiveData data)
return Name.CompareTo(data.Name);
throw new NotImplementedException(
$"Cannot compare {GetType()} to {obj.GetType()}!");
}
}
}
|
using System;
namespace HedgeLib.Archives
{
public class ArchiveData
{
// Variables/Constants
public string Name;
// Methods
public virtual void Extract(string filePath)
{
throw new NotImplementedException();
}
}
}
|
mit
|
C#
|
685f3a15cdbe964499a1d5475c8e642559985c97
|
put defaults inside classes to lookup section names
|
HeliosInteractive/Phoenix,sepehr-laal/Phoenix,HeliosInteractive/Phoenix,HeliosInteractive/Phoenix,HeliosInteractive/Phoenix,sepehr-laal/Phoenix,sepehr-laal/Phoenix,sepehr-laal/Phoenix
|
phoenix/Defaults.cs
|
phoenix/Defaults.cs
|
namespace phoenix
{
class Defaults
{
public class Local
{
public static string ApplicationToWtach = "";
public static string CommandLineArguments = "";
public static string ScriptToExecuteOnCrash = "";
public static int TimeDelayBeforeLaunch = 10;
public static bool ForceAlwaysOnTop = false;
public static bool ForceMaximize = false;
public static bool EnableMetrics = true;
public static bool AssumeCrashIfNotResponsive = true;
public static bool StartWithWindows = true;
public static bool EnableVerboseLogging = true;
public static bool EnableScreenshotOnCrash = true;
}
public class Remote
{
public static string UpdateServerAddress = "";
public static string UpdateChannel = "#app";
public static bool ReceiveAnonymousUpdates = false;
public static string UpdateHash = "-- no hash --";
public static string Username = "";
}
}
}
|
namespace phoenix
{
class Defaults
{
#region Local
public static string ApplicationToWtach = "";
public static string CommandLineArguments = "";
public static string ScriptToExecuteOnCrash = "";
public static int TimeDelayBeforeLaunch = 10;
public static bool ForceAlwaysOnTop = false;
public static bool ForceMaximize = false;
public static bool EnableMetrics = true;
public static bool AssumeCrashIfNotResponsive = true;
public static bool StartWithWindows = true;
public static bool EnableVerboseLogging = true;
public static bool EnableScreenshotOnCrash = true;
#endregion
#region Remote
public static string UpdateServerAddress = "";
public static string UpdateChannel = "#app";
public static bool ReceiveAnonymousUpdates = false;
public static string UpdateHash = "-- no hash --";
public static string Username = "";
#endregion
}
}
|
mit
|
C#
|
bb5650a859259a2e42e772eca84d2e43167aa131
|
Make encoding table char[]
|
ssg/SimpleBase,ssg/SimpleBase32,ssg/SimpleBase
|
src/Base32Alphabet.cs
|
src/Base32Alphabet.cs
|
/*
Copyright 2014 Sedat Kapanoglu
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.Collections.Generic;
using System.Linq;
namespace SimpleBase32
{
internal class Base32Alphabet
{
public const int Length = 32;
const char highestAsciiCharSupported = 'z';
public static Base32Alphabet Crockford = new CrockfordBase32Alphabet();
public static Base32Alphabet Rfc4648 = new Base32Alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567");
public static Base32Alphabet ExtendedHex = new Base32Alphabet("0123456789ABCDEFGHIJKLMNOPQRSTUV");
public char[] EncodingTable { get; private set; }
public byte[] DecodingTable { get; protected set; }
public Base32Alphabet(string chars)
{
this.EncodingTable = chars.ToCharArray();
createDecodingTable(chars);
}
private void createDecodingTable(string chars)
{
var bytes = new byte[highestAsciiCharSupported + 1];
int len = chars.Length;
for (int n = 0; n < len; n++)
{
char c = chars[n];
byte b = (byte)(n + 1);
bytes[c] = b;
bytes[Char.ToLowerInvariant(c)] = b;
}
this.DecodingTable = bytes;
}
}
}
|
/*
Copyright 2014 Sedat Kapanoglu
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.Collections.Generic;
using System.Linq;
namespace SimpleBase32
{
internal class Base32Alphabet
{
public const int Length = 32;
const char highestAsciiCharSupported = 'z';
public static Base32Alphabet Crockford = new CrockfordBase32Alphabet();
public static Base32Alphabet Rfc4648 = new Base32Alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567");
public static Base32Alphabet ExtendedHex = new Base32Alphabet("0123456789ABCDEFGHIJKLMNOPQRSTUV");
public string EncodingTable { get; private set; }
public byte[] DecodingTable { get; protected set; }
public Base32Alphabet(string chars)
{
this.EncodingTable = chars;
createDecodingTable(chars);
}
private void createDecodingTable(string chars)
{
var bytes = new byte[highestAsciiCharSupported + 1];
int len = chars.Length;
for (int n = 0; n < len; n++)
{
char c = chars[n];
byte b = (byte)(n + 1);
bytes[c] = b;
bytes[Char.ToLowerInvariant(c)] = b;
}
this.DecodingTable = bytes;
}
}
}
|
apache-2.0
|
C#
|
ed94764420cb88aa2f3251d052c33fd0b6e0463a
|
Update Program.cs
|
geffzhang/Ocelot,geffzhang/Ocelot,TomPallister/Ocelot,TomPallister/Ocelot
|
test/Ocelot.ManualTest/Program.cs
|
test/Ocelot.ManualTest/Program.cs
|
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace Ocelot.ManualTest
{
public class Program
{
public static void Main(string[] args)
{
IWebHostBuilder builder = new WebHostBuilder();
builder.ConfigureServices(s => {
s.AddSingleton(builder);
});
builder.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>();
var host = builder.Build();
host.Run();
}
}
}
|
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace Ocelot.ManualTest
{
public class Program
{
public static void Main(string[] args)
{
IWebHostBuilder builder = new WebHostBuilder();
builder.ConfigureServices(s => {
s.AddSingleton(builder);
});
builder.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>();
var host = builder.Build();
host.Run();
}
}
}
|
mit
|
C#
|
bf466b660073d262c11ca480a3db66352ba37152
|
copy from base
|
geek0r/octokit.net,TattsGroup/octokit.net,cH40z-Lord/octokit.net,daukantas/octokit.net,shana/octokit.net,dampir/octokit.net,shiftkey-tester/octokit.net,bslliw/octokit.net,kolbasov/octokit.net,M-Zuber/octokit.net,nsnnnnrn/octokit.net,thedillonb/octokit.net,devkhan/octokit.net,gdziadkiewicz/octokit.net,naveensrinivasan/octokit.net,dlsteuer/octokit.net,alfhenrik/octokit.net,SamTheDev/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,gabrielweyer/octokit.net,mminns/octokit.net,M-Zuber/octokit.net,darrelmiller/octokit.net,shiftkey-tester/octokit.net,devkhan/octokit.net,gabrielweyer/octokit.net,yonglehou/octokit.net,TattsGroup/octokit.net,ivandrofly/octokit.net,ChrisMissal/octokit.net,mminns/octokit.net,editor-tools/octokit.net,gdziadkiewicz/octokit.net,nsrnnnnn/octokit.net,shiftkey/octokit.net,octokit-net-test-org/octokit.net,fffej/octokit.net,dampir/octokit.net,SamTheDev/octokit.net,chunkychode/octokit.net,eriawan/octokit.net,shana/octokit.net,Sarmad93/octokit.net,hitesh97/octokit.net,SmithAndr/octokit.net,magoswiat/octokit.net,SLdragon1989/octokit.net,alfhenrik/octokit.net,eriawan/octokit.net,octokit-net-test/octokit.net,hahmed/octokit.net,Red-Folder/octokit.net,khellang/octokit.net,hahmed/octokit.net,yonglehou/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,SmithAndr/octokit.net,ivandrofly/octokit.net,khellang/octokit.net,octokit-net-test-org/octokit.net,rlugojr/octokit.net,shiftkey/octokit.net,kdolan/octokit.net,forki/octokit.net,brramos/octokit.net,thedillonb/octokit.net,editor-tools/octokit.net,adamralph/octokit.net,rlugojr/octokit.net,octokit/octokit.net,fake-organization/octokit.net,octokit/octokit.net,takumikub/octokit.net,chunkychode/octokit.net,michaKFromParis/octokit.net,Sarmad93/octokit.net
|
Octokit/Clients/CommitsClient.cs
|
Octokit/Clients/CommitsClient.cs
|
using System.Threading.Tasks;
namespace Octokit
{
public class CommitsClient : ApiClient, ICommitsClient
{
public CommitsClient(IApiConnection apiConnection) :
base(apiConnection)
{
}
/// <summary>
/// Gets a commit for a given repository by sha reference
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/git/commits/#get-a-commit
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">Tha sha reference of the commit</param>
/// <returns></returns>
public Task<Commit> Get(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return ApiConnection.Get<Commit>(ApiUrls.Commit(owner, name, reference));
}
/// <summary>
/// Create a commit for a given repository
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/git/commits/#create-a-commit
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="commit">The commit to create</param>
/// <returns></returns>
public Task<Commit> Create(string owner, string name, NewCommit commit)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(commit, "commit");
return ApiConnection.Post<Commit>(ApiUrls.CreateCommit(owner, name), commit);
}
}
}
|
using System.Threading.Tasks;
namespace Octokit
{
public class CommitsClient : ApiClient, ICommitsClient
{
public CommitsClient(IApiConnection apiConnection) :
base(apiConnection)
{
}
public Task<Commit> Get(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return ApiConnection.Get<Commit>(ApiUrls.Commit(owner, name, reference));
}
public Task<Commit> Create(string owner, string name, NewCommit commit)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(commit, "commit");
return ApiConnection.Post<Commit>(ApiUrls.CreateCommit(owner, name), commit);
}
}
}
|
mit
|
C#
|
e8f5f43500d34ec3b1ba2c9bc4d92d2a741b0cc9
|
Update AssemblyInfo
|
dmayhak/HyperSlackers.Localization,dmayhak/HyperSlackers.Localization
|
Localization/Properties/AssemblyInfo.cs
|
Localization/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("HyperSlackers.Localization")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HyperSlackers")]
[assembly: AssemblyProduct("HyperSlackers.Localization")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("00a12953-a521-4bf4-a938-f7519aa39f5e")]
// 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("2016.1.21.2221")]
[assembly: AssemblyFileVersion("2016.1.21.2221")]
|
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("Localization")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HyperSlackers")]
[assembly: AssemblyProduct("Localization")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("00a12953-a521-4bf4-a938-f7519aa39f5e")]
// 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("2016.1.21.2214")]
[assembly: AssemblyFileVersion("2016.1.21.2214")]
|
mit
|
C#
|
54f8c991990b05a89c165489f7e6b0ca0d0d8840
|
fix bug in parameter descriptor
|
youknowjack0/mathexpressionparser
|
MathExpressionParser/ParamDescriptor.cs
|
MathExpressionParser/ParamDescriptor.cs
|
using System;
using System.Linq.Expressions;
namespace Langman.MathExpressionParser
{
public class ParamDescriptor<TIn, TOut> : ParamDescriptor<TIn>
{
private readonly Func<string, Expression<Func<TIn, TOut>>> _resolver;
public ParamDescriptor(string token, Func<string, Expression<Func<TIn, TOut>>> resolver, StringComparison comparison = StringComparison.OrdinalIgnoreCase) : base(token, comparison)
{
if(resolver==null)
throw new ArgumentException("resolver");
_resolver = resolver;
}
public override Expression Resolve(string token, ParameterExpression param)
{
Expression<Func<TIn, TOut>> func = _resolver(token);
return Expression.Invoke(func, param);
}
}
public abstract class ParamDescriptor<TIn> : ParamDescriptor
{
public ParamDescriptor(string token, StringComparison comparison = StringComparison.OrdinalIgnoreCase) : base(token, comparison)
{
}
public override Type Type
{
get { return typeof (TIn); }
}
}
public abstract class ParamDescriptor
{
private readonly StringComparison _comparison;
private readonly string _token;
protected ParamDescriptor(string token, StringComparison comparison = StringComparison.OrdinalIgnoreCase)
{
if (token == null)
throw new ArgumentException("token");
_comparison = comparison;
_token = token;
}
public string Token { get { return _token; } }
public StringComparison Comparison { get { return _comparison; } }
public abstract Type Type { get; }
public abstract Expression Resolve(string token, ParameterExpression param);
}
}
|
using System;
using System.Linq.Expressions;
namespace Langman.MathExpressionParser
{
public class ParamDescriptor<TIn, TOut> : ParamDescriptor<TIn>
{
private readonly Expression<Func<TIn, string, TOut>> _resolver;
public ParamDescriptor(string token, Expression<Func<TIn, string, TOut>> resolver, StringComparison comparison = StringComparison.OrdinalIgnoreCase) : base(token, comparison)
{
if(resolver==null)
throw new ArgumentException("resolver");
_resolver = resolver;
}
public override Expression Resolve(string token, ParameterExpression param)
{
return Expression.Invoke(_resolver, param , Expression.Constant(token));
}
}
public abstract class ParamDescriptor<TIn> : ParamDescriptor
{
public ParamDescriptor(string token, StringComparison comparison = StringComparison.OrdinalIgnoreCase) : base(token, comparison)
{
}
public override Type Type
{
get { return typeof (TIn); }
}
}
public abstract class ParamDescriptor
{
private readonly StringComparison _comparison;
private readonly string _token;
protected ParamDescriptor(string token, StringComparison comparison = StringComparison.OrdinalIgnoreCase)
{
if (token == null)
throw new ArgumentException("token");
_comparison = comparison;
_token = token;
}
public string Token { get { return _token; } }
public StringComparison Comparison { get { return _comparison; } }
public abstract Type Type { get; }
public abstract Expression Resolve(string token, ParameterExpression param);
}
}
|
bsd-2-clause
|
C#
|
d7282980de54748392f694b4d0951032d94b13b5
|
Fix Otimização desabilitada para teste
|
Arionildo/Quiz-CWI,Arionildo/Quiz-CWI,Arionildo/Quiz-CWI
|
Quiz/Quiz.Web/App_Start/BundleConfig.cs
|
Quiz/Quiz.Web/App_Start/BundleConfig.cs
|
using System.Web;
using System.Web.Optimization;
namespace Quiz.Web
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
bundles.Add(new ScriptBundle("~/bundles/jquery.pietimer").Include(
"~/Scripts/jquery.pietimer.js"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/style").Include(
"~/Scripts/style.css"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
BundleTable.EnableOptimizations = false;
}
}
}
|
using System.Web;
using System.Web.Optimization;
namespace Quiz.Web
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
bundles.Add(new ScriptBundle("~/bundles/jquery.pietimer").Include(
"~/Scripts/jquery.pietimer.js"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/style").Include(
"~/Scripts/style.css"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
}
|
mit
|
C#
|
a1081c2841648aacc6f775cacbb85289ec82a18f
|
Fix docs
|
laurence79/saule,bjornharrtell/saule,joukevandermaas/saule,sergey-litvinov-work/saule
|
Saule/TypeExtensions.cs
|
Saule/TypeExtensions.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using Saule.Queries;
namespace Saule
{
internal static class TypeExtensions
{
public static object CreateInstance(this Type type)
{
return Activator.CreateInstance(type);
}
public static T CreateInstance<T>(this Type type)
where T : class
{
return Activator.CreateInstance(type) as T;
}
public static IEnumerable<Type> GetInheritanceChain(this Type type)
{
if (type.BaseType == null)
{
return type.ToEnumerable()
.Concat(type.GetInterfaces());
}
return type.ToEnumerable()
.Concat(type.GetInterfaces())
.Concat(type.BaseType.ToEnumerable())
.Concat(type.GetInterfaces().SelectMany(GetInheritanceChain))
.Concat(type.BaseType.GetInheritanceChain())
.Distinct();
}
public static bool IsEnumerable(this Type type)
{
return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>);
}
/// <summary>
/// Get the type of the items if the type is an <see cref="IEnumerable{T}"/> (if not it will return the input type).
/// </summary>
/// <param name="type">The type to apply this extension method to.</param>
/// <returns>The type of the items if the type is an <see cref="IEnumerable{T}"/> (if not it will return the input type).</returns>
public static Type TryGetCollectionType(this Type type)
{
var collectionType = type.GetInterfaces().FirstOrDefault(i => i.IsEnumerable());
return collectionType?.GenericTypeArguments[0] ?? type;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using Saule.Queries;
namespace Saule
{
internal static class TypeExtensions
{
public static object CreateInstance(this Type type)
{
return Activator.CreateInstance(type);
}
public static T CreateInstance<T>(this Type type)
where T : class
{
return Activator.CreateInstance(type) as T;
}
public static IEnumerable<Type> GetInheritanceChain(this Type type)
{
if (type.BaseType == null)
{
return type.ToEnumerable()
.Concat(type.GetInterfaces());
}
return type.ToEnumerable()
.Concat(type.GetInterfaces())
.Concat(type.BaseType.ToEnumerable())
.Concat(type.GetInterfaces().SelectMany(GetInheritanceChain))
.Concat(type.BaseType.GetInheritanceChain())
.Distinct();
}
public static bool IsEnumerable(this Type type)
{
return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>);
}
/// <summary>
/// Get the type of the items if the type is an <see cref="IEnumerable"/> (if not it will return the input type).
/// </summary>
/// <param name="type">The type to apply this extension method to.</param>
/// <returns>The type of the items if the type is an <see cref="IEnumerable"/> (if not it will return the input type).</returns>
public static Type TryGetCollectionType(this Type type)
{
var collectionType = type.GetInterfaces().FirstOrDefault(i => i.IsEnumerable());
return collectionType?.GenericTypeArguments[0] ?? type;
}
}
}
|
mit
|
C#
|
2c2c83ee7fdfaf7ef072bb3eca0a016b7073971f
|
Allow to not define grid on axis
|
ITGlobal/MatplotlibCS,ITGlobal/MatplotlibCS
|
MatplotlibCS/Axes.cs
|
MatplotlibCS/Axes.cs
|
using System.Collections.Generic;
using MatplotlibCS.PlotItems;
using Newtonsoft.Json;
namespace MatplotlibCS
{
/// <summary></summary>
[JsonObject(Title = "axes")]
public class Axes
{
#region .ctor
/// <summary>
/// Конструктор
/// </summary>
/// <param name="index"></param>
/// <param name="xtitle">Заголовок оси x</param>
/// <param name="ytitle">Заголовок оси y</param>
public Axes(int index = 1, string xtitle = "", string ytitle = "")
{
this.Index = index;
this.XTitle = xtitle;
this.YTitle = ytitle;
PlotItems = new List<PlotItem>();
Grid = new Grid();
}
#endregion
#region Properties
/// <summary>
/// Заголовок осей
/// </summary>
[JsonProperty(PropertyName = "title", DefaultValueHandling = DefaultValueHandling.Include)]
public string Title { get; set; }
/// <summary>
/// Подпись к оси X
/// </summary>
[JsonProperty(PropertyName = "xtitle")]
public string XTitle { get; set; }
/// <summary>
/// Подпись к оси Y
/// </summary>
[JsonProperty(PropertyName = "ytitle")]
public string YTitle { get; set; }
/// <summary>
/// Индекс subplot-а на figure
/// </summary>
[JsonProperty(PropertyName = "index")]
public int Index { get; set; } = 1;
/// <summary>
/// Plot grid settings
/// </summary>
[JsonProperty(PropertyName = "grid")]
public Grid Grid { get; set; }
/// <summary>
/// Lines and other plot items
/// </summary>
[JsonProperty(PropertyName = "__items__")]
public List<PlotItem> PlotItems { get; set; }
#endregion
}
}
|
using System.Collections.Generic;
using MatplotlibCS.PlotItems;
using Newtonsoft.Json;
namespace MatplotlibCS
{
/// <summary></summary>
[JsonObject(Title = "axes")]
public class Axes
{
#region .ctor
/// <summary>
/// Конструктор
/// </summary>
/// <param name="index"></param>
/// <param name="xtitle">Заголовок оси x</param>
/// <param name="ytitle">Заголовок оси y</param>
public Axes(int index = 1, string xtitle = "", string ytitle = "")
{
this.Index = index;
this.XTitle = xtitle;
this.YTitle = ytitle;
PlotItems = new List<PlotItem>();
}
#endregion
#region Properties
/// <summary>
/// Заголовок осей
/// </summary>
[JsonProperty(PropertyName = "title", DefaultValueHandling = DefaultValueHandling.Include)]
public string Title { get; set; }
/// <summary>
/// Подпись к оси X
/// </summary>
[JsonProperty(PropertyName = "xtitle")]
public string XTitle { get; set; }
/// <summary>
/// Подпись к оси Y
/// </summary>
[JsonProperty(PropertyName = "ytitle")]
public string YTitle { get; set; }
/// <summary>
/// Индекс subplot-а на figure
/// </summary>
[JsonProperty(PropertyName = "index")]
public int Index { get; set; } = 1;
/// <summary>
/// Plot grid settings
/// </summary>
[JsonProperty(PropertyName = "grid")]
public Grid Grid { get; set; }
/// <summary>
/// Lines and other plot items
/// </summary>
[JsonProperty(PropertyName = "__items__")]
public List<PlotItem> PlotItems { get; set; }
#endregion
}
}
|
mit
|
C#
|
cc20291e8700610d4a78534428d87df8a9479602
|
Update build.cake
|
predictive-technology-laboratory/Xamarin.Plugins,jamesmontemagno/Xamarin.Plugins
|
Battery/build.cake
|
Battery/build.cake
|
#addin "Cake.FileHelpers"
var TARGET = Argument ("target", Argument ("t", "NuGetPack"));
var version = EnvironmentVariable ("APPVEYOR_BUILD_VERSION") ?? Argument("version", "0.0.9999");
Task ("Build").Does (() =>
{
const string sln = "./Battery.sln";
const string cfg = "Release";
NuGetRestore (sln);
if (!IsRunningOnWindows ())
DotNetBuild (sln, c => c.Configuration = cfg);
else
MSBuild (sln, c => {
c.Configuration = cfg;
c.MSBuildPlatform = MSBuildPlatform.x86;
});
});
Task ("NuGetPack")
.IsDependentOn ("Build")
.Does (() =>
{
NuGetPack ("./Battery.Plugin.nuspec", new NuGetPackSettings {
Version = version,
Verbosity = NuGetVerbosity.Detailed,
OutputDirectory = "./",
BasePath = "./",
});
});
RunTarget (TARGET);
|
#addin "Cake.FileHelpers"
var TARGET = Argument ("target", Argument ("t", "Build"));
var version = EnvironmentVariable ("APPVEYOR_BUILD_VERSION") ?? Argument("version", "0.0.9999");
Task ("Build").Does (() =>
{
const string sln = "./Battery.sln";
const string cfg = "Release";
NuGetRestore (sln);
if (!IsRunningOnWindows ())
DotNetBuild (sln, c => c.Configuration = cfg);
else
MSBuild (sln, c => {
c.Configuration = cfg;
c.MSBuildPlatform = MSBuildPlatform.x86;
});
});
Task ("NuGetPack")
.IsDependentOn ("Build")
.Does (() =>
{
NuGetPack ("./Battery.Plugin.nuspec", new NuGetPackSettings {
Version = version,
Verbosity = NuGetVerbosity.Detailed,
OutputDirectory = "./",
BasePath = "./",
});
});
RunTarget (TARGET);
|
mit
|
C#
|
3c936dc0b867c63bba159e07174beb53ce77ba84
|
Set AppVeyor build version to package version
|
Krusen/ErgastApi.Net
|
build.cake
|
build.cake
|
#addin "Cake.FileHelpers"
var target = Argument("target", "Default");
Task("Set-Build-Version")
.Does(() =>
{
var projectFile = "./src/ErgastApi/ErgastApi.csproj";
var versionPeekXpath = "/Project/PropertyGroup/Version/text()";
var versionPokeXpath = "/Project/PropertyGroup/Version";
var version = XmlPeek(projectFile, versionPeekXpath);
var parts = version.Split('.');
var buildNumber = 0;
if (BuildSystem.IsRunningOnAppVeyor)
{
buildNumber = AppVeyor.Environment.Build.Number;
}
version = string.Join(".", parts[0], parts[1], buildNumber);
XmlPoke(projectFile, versionPokeXpath, version);
if (BuildSystem.IsRunningOnAppVeyor)
{
AppVeyor.UpdateBuildVersion(version);
}
Information("Set project version to " + version);
});
Task("Default")
.IsDependentOn("Set-Build-Version");
RunTarget(target);
|
#addin "Cake.FileHelpers"
var target = Argument("target", "Default");
Task("Set-Build-Version")
.Does(() =>
{
var projectFile = "./src/ErgastApi/ErgastApi.csproj";
var versionPeekXpath = "/Project/PropertyGroup/Version/text()";
var versionPokeXpath = "/Project/PropertyGroup/Version";
var version = XmlPeek(projectFile, versionPeekXpath);
var parts = version.Split('.');
var buildNumber = 0;
if (BuildSystem.IsRunningOnAppVeyor)
{
buildNumber = AppVeyor.Environment.Build.Number;
}
version = string.Join(".", parts[0], parts[1], buildNumber);
XmlPoke(projectFile, versionPokeXpath, version);
Information("Set project version to " + version);
});
Task("Default")
.IsDependentOn("Set-Build-Version");
RunTarget(target);
|
unlicense
|
C#
|
152cc289c5fe254bd5a3221ebccbb19d0ccd352c
|
Remove GitHub publish task
|
spectresystems/commandline
|
build.cake
|
build.cake
|
#load nuget:?package=Spectre.Build&version=0.6.1
///////////////////////////////////////////////////////////////////////////////
// TASKS
///////////////////////////////////////////////////////////////////////////////
Task("Pack-NuGet")
.PartOf(Spectre.Tasks.Pack)
.Does<SpectreData>(data =>
{
DotNetCorePack("./src/Spectre.Cli/Spectre.Cli.csproj", new DotNetCorePackSettings {
Configuration = data.Configuration,
OutputDirectory = data.Paths.NuGetPackages,
NoRestore = true,
NoBuild = true,
MSBuildSettings = new DotNetCoreMSBuildSettings()
.WithProperty("Version", data.Version.SemanticVersion)
.WithProperty("AssemblyVersion", data.Version.MajorMinorPatchRevision)
.WithProperty("FileVersion", data.Version.MajorMinorPatchRevision)
.WithProperty("PackageVersion", data.Version.SemanticVersion)
});
});
///////////////////////////////////////////////////////////////////////////////
// EXECUTION
///////////////////////////////////////////////////////////////////////////////
Spectre.Build();
|
#load nuget:?package=Spectre.Build&version=0.6.1
#tool "nuget:https://api.nuget.org/v3/index.json?package=gitreleasemanager&version=0.7.1"
///////////////////////////////////////////////////////////////////////////////
// TASKS
///////////////////////////////////////////////////////////////////////////////
Task("Pack-NuGet")
.PartOf(Spectre.Tasks.Pack)
.Does<SpectreData>(data =>
{
DotNetCorePack("./src/Spectre.Cli/Spectre.Cli.csproj", new DotNetCorePackSettings {
Configuration = data.Configuration,
OutputDirectory = data.Paths.NuGetPackages,
NoRestore = true,
NoBuild = true,
MSBuildSettings = new DotNetCoreMSBuildSettings()
.WithProperty("Version", data.Version.SemanticVersion)
.WithProperty("AssemblyVersion", data.Version.MajorMinorPatchRevision)
.WithProperty("FileVersion", data.Version.MajorMinorPatchRevision)
.WithProperty("PackageVersion", data.Version.SemanticVersion)
});
});
///////////////////////////////////////////////////////////////////////////////
// UTILITIES
///////////////////////////////////////////////////////////////////////////////
Task("Create-Release")
.WithCriteria<SpectreData>((context, data) => data.CI.IsLocal, "Not running locally")
.Does<SpectreData>((context, data) =>
{
var username = context.Argument<string>("github-username", null);
var password = context.Argument<string>("github-password", null);
if (string.IsNullOrWhiteSpace(username) ||
string.IsNullOrWhiteSpace(password))
{
throw new InvalidOperationException("No GitHub credentials has been provided.");
}
context.GitReleaseManagerCreate(
username,
password,
"spectresystems", "spectre.cli",
new GitReleaseManagerCreateSettings {
Milestone = $"v{data.Version.MajorMinorPatch}",
Name = $"v{data.Version.MajorMinorPatch}",
TargetCommitish = "master"
});
});
///////////////////////////////////////////////////////////////////////////////
// EXECUTION
///////////////////////////////////////////////////////////////////////////////
Spectre.Build();
|
mit
|
C#
|
4ed080e822168a87a0140fb8f0f28132bc0b6d96
|
Revert "Added "final door count" comment at return value."
|
pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations
|
100_Doors_Problem/C#/Davipb/HundredDoors.cs
|
100_Doors_Problem/C#/Davipb/HundredDoors.cs
|
using System.Linq;
namespace HundredDoors
{
public static class HundredDoors
{
/// <summary>
/// Solves the 100 Doors problem
/// </summary>
/// <returns>An array with 101 values, each representing a door (except 0). True = open</returns>
public static bool[] Solve()
{
// Create our array with 101 values, all of them false. We'll only use 1~100 to simplify it
bool[] doors = Enumerable.Repeat(false, 101).ToArray();
// We'll pass 100 times, each pass we'll start at door #pass and increment by pass, toggling the current door
for (int pass = 1; pass <= 100; pass++)
for (int i = pass; i < doors.Length; i += pass)
doors[i] = !doors[i];
return doors;
}
}
}
|
using System.Linq;
namespace HundredDoors
{
public static class HundredDoors
{
/// <summary>
/// Solves the 100 Doors problem
/// </summary>
/// <returns>An array with 101 values, each representing a door (except 0). True = open</returns>
public static bool[] Solve()
{
// Create our array with 101 values, all of them false. We'll only use 1~100 to simplify it
bool[] doors = Enumerable.Repeat(false, 101).ToArray();
// We'll pass 100 times, each pass we'll start at door #pass and increment by pass, toggling the current door
for (int pass = 1; pass <= 100; pass++)
for (int i = pass; i < doors.Length; i += pass)
doors[i] = !doors[i];
return doors; //final door count
}
}
}
|
mit
|
C#
|
5e60d6be222266b254026b61994e450bde61b4c5
|
Rename that to avoid confusion
|
flagbug/Espera.Network
|
Espera.Network/NetworkSongSource.cs
|
Espera.Network/NetworkSongSource.cs
|
namespace Espera.Network
{
public enum NetworkSongSource
{
Local = 0,
Youtube = 1,
Mobile = 2
}
}
|
namespace Espera.Network
{
public enum NetworkSongSource
{
Local = 0,
Youtube = 1,
Remote = 2
}
}
|
mit
|
C#
|
d50ff2f6becf74767bb577a8c40d5f928a42ed2f
|
Remove using
|
orodriguez/FTF,orodriguez/FTF,orodriguez/FTF
|
FTF.Tests.XUnit/Notes/DeleteTest.cs
|
FTF.Tests.XUnit/Notes/DeleteTest.cs
|
using System.Linq;
using FTF.Api.Exceptions;
using Xunit;
namespace FTF.Tests.XUnit.Notes
{
public class DeleteTest : ApplicationTest
{
[Fact]
public void Simple()
{
var noteId = App.Notes.Create("I was born");
App.Notes.Delete(noteId);
var exception = Assert.Throws<RecordNotFoundException>(() => App.Notes.Retrieve(noteId));
Assert.Equal($"Note with id #{noteId} does not exist", exception.Message);
}
[Fact]
public void WithTag()
{
var noteId = App.Notes.Create("#Buy cheese");
App.Notes.Delete(noteId);
var tags = App.Tags.All();
var firstTag = tags.First();
Assert.Equal("Buy", firstTag.Name);
Assert.Equal(0, firstTag.NotesCount);
}
}
}
|
using System.Linq;
using FTF.Api.Exceptions;
using FTF.Api.Responses;
using Xunit;
namespace FTF.Tests.XUnit.Notes
{
public class DeleteTest : ApplicationTest
{
[Fact]
public void Simple()
{
var noteId = App.Notes.Create("I was born");
App.Notes.Delete(noteId);
var exception = Assert.Throws<RecordNotFoundException>(() => App.Notes.Retrieve(noteId));
Assert.Equal($"Note with id #{noteId} does not exist", exception.Message);
}
[Fact]
public void WithTag()
{
var noteId = App.Notes.Create("#Buy cheese");
App.Notes.Delete(noteId);
var tags = App.Tags.All();
var firstTag = tags.First();
Assert.Equal("Buy", firstTag.Name);
Assert.Equal(0, firstTag.NotesCount);
}
}
}
|
mit
|
C#
|
653606ba133247459df348a37ff31f0a70df6a90
|
fix json
|
BTCTrader/broker-api-csharp
|
APIClient/Models/AccountBalance.cs
|
APIClient/Models/AccountBalance.cs
|
using Newtonsoft.Json;
namespace BTCTrader.APIClient.Models
{
public class AccountBalance
{
[JsonProperty("try_balance")]
public decimal TRYBalance { get; set; }
[JsonProperty("btc_balance")]
public decimal BTCBalance { get; set; }
[JsonProperty("eth_balance")]
public decimal ETHBalance { get; set; }
[JsonProperty("try_reserved")]
public decimal TRYReserved { get; set; }
[JsonProperty("btc_reserved")]
public decimal BTCReserved { get; set; }
[JsonProperty("eth_reserved")]
public decimal ETHReserved { get; set; }
[JsonProperty("try_available")]
public decimal TRYAvailable { get; set; }
[JsonProperty("btc_available")]
public decimal BTCAvailable { get; set; }
[JsonProperty("eth_available")]
public decimal ETHAvailable { get; set; }
[JsonProperty("btctry_taker_fee_percentage")]
public decimal BTCTRYTakerFeePercentage { get; set; }
[JsonProperty("btctry_maker_fee_percentage")]
public decimal BTCTRYMakerFeePercentage { get; set; }
[JsonProperty("ethtry_taker_fee_percentage")]
public decimal ETHTRYTakerFeePercentage { get; set; }
[JsonProperty("ethtry_maker_fee_percentage")]
public decimal ETHTRYMakerFeePercentage { get; set; }
[JsonProperty("ethbtc_taker_fee_percentage")]
public decimal ETHBTCTakerFeePercentage { get; set; }
[JsonProperty("ethbtc_maker_fee_percentage")]
public decimal ETHBTCMakerFeePercentage { get; set; }
}
}
|
using Newtonsoft.Json;
namespace BTCTrader.APIClient.Models
{
public class AccountBalance
{
[JsonProperty("try_balance")]
public decimal TRYBalance { get; set; }
[JsonProperty("btc_balance")]
public decimal BTCBalance { get; set; }
[JsonProperty("eth_balance")]
public decimal ETHBalance { get; set; }
[JsonProperty("try_reserved")]
public decimal TRYReserved { get; set; }
[JsonProperty("btc_reserved")]
public decimal BTCReserved { get; set; }
[JsonProperty("eth_reserved")]
public decimal ETHReserved { get; set; }
[JsonProperty("try_available")]
public decimal TRYAvailable { get; set; }
[JsonProperty("btc_available")]
public decimal BTCAvailable { get; set; }
[JsonProperty("eth_available")]
public decimal ETHAvailable { get; set; }
[JsonProperty("btctry_fee_percentage")]
public decimal BTCTRYFeePercentage { get; set; }
[JsonProperty("btctry_maker_fee_percentage")]
public decimal BTCTRYMakerFeePercentage { get; set; }
[JsonProperty("ethtry_fee_percentage")]
public decimal ETHTRYFeePercentage { get; set; }
[JsonProperty("ethtry_maker_fee_percentage")]
public decimal ETHTRYMakerFeePercentage { get; set; }
[JsonProperty("ethbtc_fee_percentage")]
public decimal ETHBTCFeePercentage { get; set; }
[JsonProperty("ethbtc_maker_fee_percentage")]
public decimal ETHBTCMakerFeePercentage { get; set; }
public override string ToString()
{
return "TRY Balance: " + TRYBalance + "\n" + "BTC Balance: " + BTCBalance + "\n" + "ETH Balance: "
+ ETHBalance + "\n" + "TRY Reserved: " + TRYReserved + "\n" + "BTC Reserved: " + BTCReserved + "\n"
+ "ETH Reserved: " + ETHReserved + "\n";
}
}
}
|
mit
|
C#
|
a8a9dab5800c3c61178448cbadb02faf857abc09
|
Fix bug in Export-State
|
LordMike/B2Lib
|
B2Powershell/ExportStateCommand.cs
|
B2Powershell/ExportStateCommand.cs
|
using System.Management.Automation;
namespace B2Powershell
{
[Cmdlet("Export", "B2State")]
public class ExportStateCommand : B2CommandWithSaveState
{
[Parameter(Mandatory = true, Position = 0)]
public string File { get; set; }
protected override void ProcessRecordInternal()
{
Client.SaveState(File);
}
}
}
|
using System.Management.Automation;
namespace B2Powershell
{
[Cmdlet("Export", "B2State")]
public class ExportStateCommand : B2CommandWithSaveState
{
[Parameter(Mandatory = true)]
public string File { get; set; }
protected override void ProcessRecordInternal()
{
Client.SaveState(File);
}
}
}
|
mit
|
C#
|
cc1d516cde0536a2d0b08551a347c2db663bad45
|
remove path from test diagnostic information
|
collinsauve/redlock-cs
|
tests/TestHelper.cs
|
tests/TestHelper.cs
|
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace Redlock.CSharp.Tests
{
public static class TestHelper
{
public static Process StartRedisServer(long port)
{
var assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var fileName = Path.Combine(assemblyDir, "redis-server.exe");
// Launch Server
var process = new Process
{
StartInfo =
{
FileName = fileName,
Arguments = "--port " + port,
WindowStyle = ProcessWindowStyle.Hidden
}
};
try
{
process.Start();
}
catch (System.ComponentModel.Win32Exception)
{
Console.WriteLine($"Attempt to launch {fileName} failed.");
Console.WriteLine("Directory listing:");
foreach (var file in Directory.GetFiles(assemblyDir))
{
Console.WriteLine($"\t{Path.GetFileName(file)}");
}
throw;
}
return process;
}
}
}
|
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace Redlock.CSharp.Tests
{
public static class TestHelper
{
public static Process StartRedisServer(long port)
{
var assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var fileName = Path.Combine(assemblyDir, "redis-server.exe");
// Launch Server
var process = new Process
{
StartInfo =
{
FileName = fileName,
Arguments = "--port " + port,
WindowStyle = ProcessWindowStyle.Hidden
}
};
try
{
process.Start();
}
catch (System.ComponentModel.Win32Exception)
{
Console.WriteLine($"Attempt to launch {fileName} failed.");
Console.WriteLine("Directory listing:");
foreach (var file in Directory.GetFiles(assemblyDir))
{
Console.WriteLine($"\t{file}");
}
throw;
}
return process;
}
}
}
|
apache-2.0
|
C#
|
ad4c9602129646a0e607ea4bad87c73c4748f514
|
increment minor version
|
reinterpretcat/utymap,reinterpretcat/utymap,reinterpretcat/utymap
|
unity/library/UtyMap.Unity/Properties/AssemblyInfo.cs
|
unity/library/UtyMap.Unity/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("UtyMap.Unity")]
[assembly: AssemblyDescription("UtyMap for Unity3D")]
[assembly: AssemblyProduct("UtyMap.Unity")]
[assembly: AssemblyCopyright("Copyright © Ilya Builuk, 2014-2017")]
[assembly: AssemblyVersion("2.2.*")]
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("97791a51-a81b-45d4-a6fc-5dfa9ebcc603")]
[assembly: InternalsVisibleTo("UtyMap.Unity.Tests")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("UtyMap.Unity")]
[assembly: AssemblyDescription("UtyMap for Unity3D")]
[assembly: AssemblyProduct("UtyMap.Unity")]
[assembly: AssemblyCopyright("Copyright © Ilya Builuk, 2014-2016")]
[assembly: AssemblyVersion("2.1.*")]
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("97791a51-a81b-45d4-a6fc-5dfa9ebcc603")]
[assembly: InternalsVisibleTo("UtyMap.Unity.Tests")]
|
apache-2.0
|
C#
|
3102993c05a6ee733bfa800a15277153f29160c3
|
Update SIL.Core.Desktop with Acknowledgements
|
ermshiperete/libpalaso,sillsdev/libpalaso,gtryus/libpalaso,gtryus/libpalaso,ermshiperete/libpalaso,ermshiperete/libpalaso,gtryus/libpalaso,gtryus/libpalaso,glasseyes/libpalaso,glasseyes/libpalaso,sillsdev/libpalaso,sillsdev/libpalaso,ermshiperete/libpalaso,gmartin7/libpalaso,andrew-polk/libpalaso,glasseyes/libpalaso,andrew-polk/libpalaso,sillsdev/libpalaso,andrew-polk/libpalaso,glasseyes/libpalaso,andrew-polk/libpalaso,gmartin7/libpalaso,gmartin7/libpalaso,gmartin7/libpalaso
|
SIL.Core.Desktop/Properties/AssemblyInfo.cs
|
SIL.Core.Desktop/Properties/AssemblyInfo.cs
|
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SIL.Acknowledgements;
// 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("SIL.Core.Desktop")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
// 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("c48de000-2086-4ceb-a5a1-3171c272725e")]
[assembly: CLSCompliant(true)]
[assembly: InternalsVisibleTo("SIL.Core.Desktop.Tests")]
[assembly: Acknowledgement("NDesk.DBus", Name = "NDesk.DBus", Url = "https://www.nuget.org/packages/NDesk.DBus/",
LicenseUrl = "https://opensource.org/licenses/MIT", Copyright = "Copyright © 2006 Alp Toker", Location = "./NDesk.DBus.dll")]
|
using System;
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("SIL.Core.Desktop")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
// 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("c48de000-2086-4ceb-a5a1-3171c272725e")]
[assembly: CLSCompliant(true)]
[assembly: InternalsVisibleTo("SIL.Core.Desktop.Tests")]
|
mit
|
C#
|
bbddea7cc014973eb26cdc3237401acf4c1c3347
|
Mark InternalsVisibleTo the tests project, to allow whitebox testing.
|
jthelin/ServerHost,jthelin/ServerHost
|
ServerHost.xunit/Properties/AssemblyInfo.cs
|
ServerHost.xunit/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("ServerHost.xunit")]
[assembly: AssemblyDescription("ServerHost - A .NET Server Hosting utility library, including in-process server host testing.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jorgen Thelin")]
[assembly: AssemblyProduct("ServerHost")]
[assembly: AssemblyCopyright("Copyright © Jorgen Thelin 2015-2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f40db01e-3eba-42c2-a9f6-5072aaeff341")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly:InternalsVisibleTo("ServerHost.Tests")]
|
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("ServerHost.xunit")]
[assembly: AssemblyDescription("ServerHost - A .NET Server Hosting utility library, including in-process server host testing.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jorgen Thelin")]
[assembly: AssemblyProduct("ServerHost")]
[assembly: AssemblyCopyright("Copyright © Jorgen Thelin 2015-2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f40db01e-3eba-42c2-a9f6-5072aaeff341")]
// 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")]
|
apache-2.0
|
C#
|
c8acc112750c7d7181224f2e5132e94eccaeddc2
|
Remove invalid cast
|
mmoening/MatterControl,jlewin/MatterControl,larsbrubaker/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl,mmoening/MatterControl,jlewin/MatterControl,larsbrubaker/MatterControl,jlewin/MatterControl,larsbrubaker/MatterControl,unlimitedbacon/MatterControl,jlewin/MatterControl,mmoening/MatterControl,larsbrubaker/MatterControl,unlimitedbacon/MatterControl
|
SlicerConfiguration/UIFields/DoubleField.cs
|
SlicerConfiguration/UIFields/DoubleField.cs
|
/*
Copyright (c) 2017, Lars Brubaker, John Lewin
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using System;
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
namespace MatterHackers.MatterControl.SlicerConfiguration
{
public class DoubleField : NumberField
{
private double doubleValue;
protected override string ConvertValue(string newValue)
{
double.TryParse(newValue, out double currentValue);
doubleValue = currentValue;
return doubleValue.ToString();
}
protected override void OnValueChanged(FieldChangedEventArgs fieldChangedEventArgs)
{
numberEdit.ActuallNumberEdit.Value = doubleValue;
base.OnValueChanged(fieldChangedEventArgs);
}
}
}
|
/*
Copyright (c) 2017, Lars Brubaker, John Lewin
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using System;
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
namespace MatterHackers.MatterControl.SlicerConfiguration
{
public class DoubleField : NumberField
{
private double doubleValue;
protected override string ConvertValue(string newValue)
{
double.TryParse(newValue, out double currentValue);
doubleValue = (int)currentValue;
return doubleValue.ToString();
}
protected override void OnValueChanged(FieldChangedEventArgs fieldChangedEventArgs)
{
numberEdit.ActuallNumberEdit.Value = doubleValue;
base.OnValueChanged(fieldChangedEventArgs);
}
}
}
|
bsd-2-clause
|
C#
|
280dc7eefde1464ef4de5a3d204a05201fbbd09e
|
Fix Intellisense warning.
|
Lirusaito/RollGen,DnDGen/RollGen,DnDGen/RollGen,Lirusaito/RollGen
|
RollGen/Properties/AssemblyInfo.cs
|
RollGen/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("D20Dice")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("D20Dice")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f965b9cd-3ad2-4692-ae45-45e87d7e3277")]
// 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.*")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("D20Dice")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("D20Dice")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f965b9cd-3ad2-4692-ae45-45e87d7e3277")]
// 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.*")]
[assembly: AssemblyFileVersion("1.0.*")]
|
mit
|
C#
|
874ce9b61c898e1e8bf519f25d05deb7dd94c852
|
fix #251 (probably)
|
WreckedAvent/slimCat,AerysBat/slimCat
|
slimCat/Commands/Channel/ClearCommand.cs
|
slimCat/Commands/Channel/ClearCommand.cs
|
#region Copyright
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ClearCommand.cs">
// Copyright (c) 2013, Justin Kadrovach, All rights reserved.
//
// This source is subject to the Simplified BSD License.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
#endregion
namespace slimCat.Services
{
#region Usings
using System;
using System.Collections.Generic;
using System.Linq;
using Models;
using Utilities;
#endregion
public partial class UserCommandService
{
private static void ClearChannel(ChannelModel channel)
{
channel.Messages.Clear();
channel.Ads.Clear();
}
private void OnClearAllRequested(IDictionary<string, object> command)
{
model.CurrentChannels
.Cast<ChannelModel>()
.Union(model.CurrentPms)
.Each(ClearChannel);
}
private void OnClearRequested(IDictionary<string, object> command)
{
var targetName = command.Get(Constants.Arguments.Channel);
var target = model.CurrentChannels
.Cast<ChannelModel>()
.Union(model.CurrentPms)
.FirstOrDefault(x => x.Id.Equals(targetName, StringComparison.OrdinalIgnoreCase));
ClearChannel(target);
}
}
}
|
#region Copyright
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ClearCommand.cs">
// Copyright (c) 2013, Justin Kadrovach, All rights reserved.
//
// This source is subject to the Simplified BSD License.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
#endregion
namespace slimCat.Services
{
#region Usings
using System;
using System.Collections.Generic;
using System.Linq;
using Models;
using Utilities;
#endregion
public partial class UserCommandService
{
private static void ClearChannel(ChannelModel channel)
{
foreach (var item in channel.Messages)
item.Dispose();
foreach (var item in channel.Ads)
item.Dispose();
channel.Messages.Clear();
channel.Ads.Clear();
}
private void OnClearAllRequested(IDictionary<string, object> command)
{
model.CurrentChannels
.Cast<ChannelModel>()
.Union(model.CurrentPms)
.Each(ClearChannel);
}
private void OnClearRequested(IDictionary<string, object> command)
{
var targetName = command.Get(Constants.Arguments.Channel);
var target = model.CurrentChannels
.Cast<ChannelModel>()
.Union(model.CurrentPms)
.FirstOrDefault(x => x.Id.Equals(targetName, StringComparison.OrdinalIgnoreCase));
ClearChannel(target);
}
}
}
|
bsd-2-clause
|
C#
|
b4c8a580f158ad0b9d62c236aec58b8dea340935
|
fix type
|
Eskat0n/Wotstat,Eskat0n/Wotstat,Eskat0n/Wotstat
|
sources/Domain.Model/Entities/Account.cs
|
sources/Domain.Model/Entities/Account.cs
|
namespace Domain.Model.Entities
{
using ByndyuSoft.Infrastructure.Domain;
using JetBrains.Annotations;
public class Account: IEntity
{
private string _token;
[UsedImplicitly]
public Account()
{
}
[UsedImplicitly]
public Account(string token)
{
_token = token;
}
public virtual int Id { get; set; }
public virtual string Name { get; protected set; }
public virtual int PlayerId { get; protected set; }
[CanBeNull]
public virtual string GetToken()
{
return _token;
}
public virtual void SetToken(string token)
{
_token = token;
}
}
}
|
namespace Domain.Model.Entities
{
using ByndyuSoft.Infrastructure.Domain;
using JetBrains.Annotations;
public class Account: IEntity
{
private string _token;
[UsedImplicitly]
public Account()
{
}
[UsedImplicitly]
public Account(string token)
{
_token = token;
}
public virtual int Id { get; set; }
public virtual string Name { get; protected set; }
public virtual long PlayerId { get; protected set; }
[CanBeNull]
public virtual string GetToken()
{
return _token;
}
public virtual void SetToken(string token)
{
_token = token;
}
}
}
|
mit
|
C#
|
47df03920e7dc7fc888377702701ff58e9315bdd
|
Update version to 2.0.1
|
synel/syndll2
|
Syndll2/Properties/AssemblyInfo.cs
|
Syndll2/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Syndll2")]
[assembly: AssemblyDescription("Synel Communications Protocol Client Library")]
[assembly: AssemblyCompany("Synel Industries Ltd.")]
[assembly: AssemblyProduct("Syndll2")]
[assembly: AssemblyCopyright("Copyright © 2014, Synel Industries Ltd.")]
[assembly: ComVisible(false)]
[assembly: Guid("a7fe65a7-0b61-4ea1-81c0-adc5a037ea17")]
[assembly: AssemblyVersion("2.0.1.*")]
[assembly: AssemblyInformationalVersion("2.0.1")]
[assembly: InternalsVisibleTo("Syndll2.Tests, PublicKey=" +
"00240000048000009400000006020000002400005253413100040000010001000f0f0c410cd366" +
"72c6264d60b03c1099ab0c910081744c6199219f003d9ae1baca1f0e4b6cb637901a10a9eabbad" +
"a806bfa1645acdddd52b1749d8135b96987bfae82d25d746a25e02a83dec271c5bba92ba243dab" +
"180786452edc1045cd2004744804247b2d1dd9f724a6224f29adfe9bc10155136f6be404457629" +
"4722ffaa")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Syndll2")]
[assembly: AssemblyDescription("Synel Communications Protocol Client Library")]
[assembly: AssemblyCompany("Synel Industries Ltd.")]
[assembly: AssemblyProduct("Syndll2")]
[assembly: AssemblyCopyright("Copyright © 2014, Synel Industries Ltd.")]
[assembly: ComVisible(false)]
[assembly: Guid("a7fe65a7-0b61-4ea1-81c0-adc5a037ea17")]
[assembly: AssemblyVersion("2.0.0.*")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: InternalsVisibleTo("Syndll2.Tests, PublicKey=" +
"00240000048000009400000006020000002400005253413100040000010001000f0f0c410cd366" +
"72c6264d60b03c1099ab0c910081744c6199219f003d9ae1baca1f0e4b6cb637901a10a9eabbad" +
"a806bfa1645acdddd52b1749d8135b96987bfae82d25d746a25e02a83dec271c5bba92ba243dab" +
"180786452edc1045cd2004744804247b2d1dd9f724a6224f29adfe9bc10155136f6be404457629" +
"4722ffaa")]
|
mit
|
C#
|
0b55465cbcd35967fc8c2d38bd3f56568392483c
|
Remove unused const
|
rmterra/NesZord
|
src/NesZord.Core/Memory/BoundedMemory.cs
|
src/NesZord.Core/Memory/BoundedMemory.cs
|
using System;
using System.Collections.Generic;
namespace NesZord.Core.Memory
{
internal class BoundedMemory : IBoundedMemory
{
private Dictionary<int, byte> data;
public BoundedMemory(MemoryAddress firstAddress, MemoryAddress lastAddress)
{
this.FirstAddress = firstAddress ?? throw new ArgumentNullException(nameof(firstAddress));
this.LastAddress = lastAddress ?? throw new ArgumentNullException(nameof(lastAddress));
this.data = new Dictionary<int, byte>();
}
public MemoryAddress FirstAddress { get; }
public MemoryAddress LastAddress { get; }
public void Write(MemoryAddress address, byte value)
{
if (address == null) { throw new ArgumentNullException(nameof(address)); }
if (address.In(this.FirstAddress, this.LastAddress) == false)
{
throw new ArgumentOutOfRangeException(nameof(address));
}
this.data[address.FullAddress] = value;
}
public byte Read(MemoryAddress address)
{
if (address == null) { throw new ArgumentNullException(nameof(address)); }
if (address.In(this.FirstAddress, this.LastAddress) == false)
{
throw new ArgumentOutOfRangeException(nameof(address));
}
return this.data.ContainsKey(address.FullAddress)
? this.data[address.FullAddress]
: default(byte);
}
}
}
|
using System;
using System.Collections.Generic;
namespace NesZord.Core.Memory
{
internal class BoundedMemory : IBoundedMemory
{
private const int LENGTH = 0x0800;
private Dictionary<int, byte> data;
public BoundedMemory(MemoryAddress firstAddress, MemoryAddress lastAddress)
{
this.FirstAddress = firstAddress ?? throw new ArgumentNullException(nameof(firstAddress));
this.LastAddress = lastAddress ?? throw new ArgumentNullException(nameof(lastAddress));
this.data = new Dictionary<int, byte>();
}
public MemoryAddress FirstAddress { get; }
public MemoryAddress LastAddress { get; }
public void Write(MemoryAddress address, byte value)
{
if (address == null) { throw new ArgumentNullException(nameof(address)); }
if (address.In(this.FirstAddress, this.LastAddress) == false)
{
throw new ArgumentOutOfRangeException(nameof(address));
}
this.data[address.FullAddress] = value;
}
public byte Read(MemoryAddress address)
{
if (address == null) { throw new ArgumentNullException(nameof(address)); }
if (address.In(this.FirstAddress, this.LastAddress) == false)
{
throw new ArgumentOutOfRangeException(nameof(address));
}
return this.data.ContainsKey(address.FullAddress)
? this.data[address.FullAddress]
: default(byte);
}
}
}
|
apache-2.0
|
C#
|
4bec10949da1a4f72953d56459d20650369bb83a
|
update basecontroller
|
ashrafeme/Karasoft.Mvc
|
BaseController.cs
|
BaseController.cs
|
using Karasoft.Mvc.Html;
using System.Collections.Generic;
using System.Web.Mvc;
namespace Karasoft.Mvc
{
public class BaseController : Controller
{
public void Success(string message, bool dismissable = false)
{
AddAlert(AlertStyles.Success, message, dismissable);
}
public void Success(IEnumerable<string> messages, bool dismissable = false)
{
foreach (var item in messages)
{
Success(string.Format("<li>{0}</li>", item), dismissable);
}
}
public void Information(string message, bool dismissable = false)
{
AddAlert(AlertStyles.Information, message, dismissable);
}
public void Information(IEnumerable<string> messages, bool dismissable = false)
{
foreach (var item in messages)
{
Information(string.Format("<li>{0}</li>", item), dismissable);
}
}
public void Warning(string message, bool dismissable = false)
{
AddAlert(AlertStyles.Warning, message, dismissable);
}
public void Warning(IEnumerable<string> messages, bool dismissable = false)
{
foreach (var item in messages)
{
Warning(string.Format("<li>{0}</li>", item), dismissable);
}
}
public void Danger(string message, bool dismissable = false)
{
AddAlert(AlertStyles.Danger, message, dismissable);
}
public void Danger(IEnumerable<string> messages, bool dismissable = false)
{
foreach (var item in messages)
{
Danger(string.Format("<li>{0}</li>", item), dismissable);
}
}
private void AddAlert(string alertStyle, string message, bool dismissable)
{
var alerts = TempData.ContainsKey(Alert.TempDataKey)
? (List<Alert>)TempData[Alert.TempDataKey]
: new List<Alert>();
alerts.Add(new Alert
{
AlertStyle = alertStyle,
Message = message,
Dismissable = dismissable
});
TempData[Alert.TempDataKey] = alerts;
}
}
}
|
using Karasoft.Mvc.Html;
using System.Collections.Generic;
using System.Web.Mvc;
namespace Karasoft.Mvc
{
public class BaseController : Controller
{
public void Success(string message, bool dismissable = false)
{
AddAlert(AlertStyles.Success, message, dismissable);
}
public void Information(string message, bool dismissable = false)
{
AddAlert(AlertStyles.Information, message, dismissable);
}
public void Warning(string message, bool dismissable = false)
{
AddAlert(AlertStyles.Warning, message, dismissable);
}
public void Danger(string message, bool dismissable = false)
{
AddAlert(AlertStyles.Danger, message, dismissable);
}
private void AddAlert(string alertStyle, string message, bool dismissable)
{
var alerts = TempData.ContainsKey(Alert.TempDataKey)
? (List<Alert>)TempData[Alert.TempDataKey]
: new List<Alert>();
alerts.Add(new Alert
{
AlertStyle = alertStyle,
Message = message,
Dismissable = dismissable
});
TempData[Alert.TempDataKey] = alerts;
}
}
}
|
mit
|
C#
|
44a8aa43efdeaabc8187eb81409a0c8338fe7167
|
work on facets list
|
GiveCampUK/GiveCRM,GiveCampUK/GiveCRM
|
src/GiveCRM.Web/Controllers/SetupController.cs
|
src/GiveCRM.Web/Controllers/SetupController.cs
|
using System.Web.Mvc;
using GiveCRM.DataAccess;
using GiveCRM.Models;
using GiveCRM.Web.Models.Facets;
namespace GiveCRM.Web.Controllers
{
public class SetupController : Controller
{
private Facets _facetsDb = new Facets();
public ActionResult Index()
{
return View();
}
public ActionResult AddFacet()
{
return View();
}
public ActionResult EditFacet(int id)
{
return View();
}
public ActionResult SaveFacet(Facet facet)
{
return View();
}
public ActionResult AddFacetOption(FacetValue facetValue)
{
return View();
}
public ActionResult ShowFacets()
{
var viewModel = new FacetListViewModel
{
Facets = _facetsDb.All()
};
return View(viewModel);
}
}
}
|
using System.Web.Mvc;
using GiveCRM.DataAccess;
using GiveCRM.Models;
namespace GiveCRM.Web.Controllers
{
using System.Collections.Generic;
public class SetupController : Controller
{
private Facets _facetsDb = new Facets();
public ActionResult Index()
{
return View();
}
public ActionResult AddFacet()
{
return View();
}
public ActionResult EditFacet(int id)
{
return View();
}
public ActionResult SaveFacet(Facet facet)
{
return View();
}
public ActionResult AddFacetOption(FacetValue facetValue)
{
return View();
}
public ActionResult ShowFacets()
{
IEnumerable<Facet> facets = _facetsDb.All();
return View(facets);
}
}
}
|
mit
|
C#
|
755b84826a6e6d828c800c4070668873b3de74e9
|
Remove page styling from Ajax search results.
|
GiveCampUK/GiveCRM,GiveCampUK/GiveCRM
|
src/GiveCRM.Web/Views/Member/AjaxSearch.cshtml
|
src/GiveCRM.Web/Views/Member/AjaxSearch.cshtml
|
@model IEnumerable<GiveCRM.Models.Member>
@{
Layout = null;
}
@foreach (var member in Model)
{
<p style="margin:0; padding:0;"><a href="javascript:AddDonation(@member.Id);">@member.FirstName @member.LastName @member.PostalCode</a></p>
}
|
@model IEnumerable<GiveCRM.Models.Member>
@foreach (var member in Model)
{
<a href="javascript:AddDonation(@member.Id);">@member.FirstName @member.LastName @member.PostalCode</a><br />
}
|
mit
|
C#
|
b372669679f9dbfff6e14cec10bd57a640f66dfa
|
Clean output of exception.
|
danielwertheim/mycouch,danielwertheim/mycouch
|
src/Projects/MyCouch.Net45/MyCouchException.cs
|
src/Projects/MyCouch.Net45/MyCouchException.cs
|
using System;
using System.Net;
using System.Net.Http;
using System.Runtime.Serialization;
namespace MyCouch
{
#if !NETFX_CORE
[Serializable]
#endif
public class MyCouchException : Exception
{
public HttpStatusCode HttpStatus { get; private set; }
public string Error { get; private set; }
public string Reason { get; private set; }
public MyCouchException(HttpMethod httpMethod, HttpStatusCode httpStatus, Uri uri, string error, string reason)
: base(string.Format(
"MyCouch failed.{0}HttpMethod: {1}{0}HttpStatus: {2}{0}Uri:{3}{0}Error: {4}{0}Reason: {5}{0}",
Environment.NewLine,
httpMethod,
httpStatus,
uri,
error,
reason))
{ }
#if !NETFX_CORE
protected MyCouchException(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
#endif
}
}
|
using System;
using System.Net;
using System.Net.Http;
using System.Runtime.Serialization;
namespace MyCouch
{
#if !NETFX_CORE
[Serializable]
#endif
public class MyCouchException : Exception
{
public HttpStatusCode HttpStatus { get; private set; }
public string Error { get; private set; }
public string Reason { get; private set; }
public MyCouchException(HttpMethod httpMethod, HttpStatusCode httpStatus, Uri uri, string error, string reason)
: base(string.Format(
"MyCouch failed.{0}HttpMethod: {1}.{0}HttpStatus: {2}.{0}Uri:{3}.{0}Error: {4}.{0}Reason: {5}.{0}",
Environment.NewLine,
httpMethod,
httpStatus,
uri,
error,
reason))
{ }
#if !NETFX_CORE
protected MyCouchException(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
#endif
}
}
|
mit
|
C#
|
8b69f5aa86a0aa44dc2fa323c9718ec073731a7b
|
apply review change
|
smoogipooo/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,ppy/osu-framework,ZLima12/osu-framework,DrabWeb/osu-framework,Tom94/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework,DrabWeb/osu-framework
|
osu.Framework/Configuration/BindableSize.cs
|
osu.Framework/Configuration/BindableSize.cs
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
using System.Drawing;
namespace osu.Framework.Configuration
{
public class BindableSize : Bindable<Size>
{
public BindableSize(Size value = default(Size))
: base(value)
{
}
public override string ToString() => $"{Value.Width}x{Value.Height}";
public override void Parse(object input)
{
switch (input)
{
case string str:
if (!str.Contains("x"))
throw new ArgumentException($"Input string was in wrong format! (expected: '<width>x<height>', actual: '{str}')");
var split = str.Split('x');
Value = new Size(int.Parse(split[0]), int.Parse(split[1]));
break;
default:
base.Parse(input);
break;
}
}
}
}
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
using System.Drawing;
namespace osu.Framework.Configuration
{
public class BindableSize : Bindable<Size>
{
public BindableSize(Size value = default(Size))
: base(value)
{
}
public override string ToString() => $"{Value.Width}x{Value.Height}";
public override void Parse(object input)
{
switch (input)
{
case Size s:
Value = s;
break;
case string str:
if (!str.Contains("x"))
throw new ArgumentException($"Input string was in wrong format! (expected: '<width>x<height>', actual: '{str}')");
var split = str.Split('x');
Value = new Size(int.Parse(split[0]), int.Parse(split[1]));
break;
default:
throw new ArgumentException($"Could not parse provided {input.GetType()} ({input}) to {typeof(Size)}.");
}
}
}
}
|
mit
|
C#
|
8579f63ea68c82fc6e3d7af4855f33b4e805fa52
|
Bump version number
|
McNeight/SharpZipLib
|
src/AssemblyInfo.cs
|
src/AssemblyInfo.cs
|
// AssemblyInfo.cs
//
// Copyright (C) 2001 Mike Krueger
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: CLSCompliant(true)]
[assembly: AssemblyTitle("ICSharpCode.SharpZipLibrary")]
[assembly: AssemblyDescription("A free C# compression library")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("#ZipLibrary")]
[assembly: AssemblyCopyright("Copyright Mike Krueger 2001-2005")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("0.83.2.0")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("../ICSharpCode.SharpZipLib.key")]
|
// AssemblyInfo.cs
//
// Copyright (C) 2001 Mike Krueger
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: CLSCompliant(true)]
[assembly: AssemblyTitle("ICSharpCode.SharpZipLibrary")]
[assembly: AssemblyDescription("A free C# compression library")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("#ZipLibrary")]
[assembly: AssemblyCopyright("Copyright Mike Krueger 2001-2005")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("0.83.1.0")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("../ICSharpCode.SharpZipLib.key")]
|
mit
|
C#
|
ae623336a9c2cf2ec4fad5df4bf64b12025fde23
|
Resolve #37
|
manio143/ShadowsOfShadows
|
src/Entities/NPC.cs
|
src/Entities/NPC.cs
|
using System;
using ShadowsOfShadows.Helpers;
using ShadowsOfShadows.Physics;
namespace ShadowsOfShadows.Entities
{
public class NPC : Character
{
public NPC () : base("NPC", 'N', 0, 1)
{
Immortal = true;
}
public override void Shoot<T>(Direction direction)
{
}
}
}
|
using System;
using ShadowsOfShadows.Helpers;
using ShadowsOfShadows.Physics;
namespace ShadowsOfShadows.Entities
{
public class NPC : Character
{
private Fraction Fraction;
public NPC() : this(Fraction.Warrior, 0) { }
public NPC (Fraction fraction, int speed) : base("NPC", 'N', speed, 1)
{
this.Fraction = fraction;
Immortal = true;
}
public override void Shoot<T>(Direction direction)
{
T projectile = (T)new Projectile(SkillFactory.GetNewSkillSet(Fraction)[Skill.ShootingPower],
direction);
}
}
}
|
mit
|
C#
|
a124bdf21894d6b7e5a9e5702214d2b685b425c6
|
Use using(){} where possible instead of creating our own delegating methods.
|
threedaymonk/iplayer-dl.net
|
src/IPDL/Request.cs
|
src/IPDL/Request.cs
|
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
namespace IPDL {
abstract class AbstractRequest {
private string userAgent;
private string url;
private CookieContainer cookies;
public delegate void ResponseHandler(WebResponse response);
public delegate void ResponseStreamHandler(Stream stream);
public AbstractRequest(string url, CookieContainer cookies, string userAgent) {
this.url = url;
this.cookies = cookies;
this.userAgent = userAgent;
}
protected HttpWebRequest Request() {
HttpWebRequest r = (HttpWebRequest)WebRequest.Create(url);
if (userAgent != null) r.UserAgent = userAgent;
if (cookies != null) r.CookieContainer = cookies;
return r;
}
protected void WithResponseStream(HttpWebRequest request, ResponseStreamHandler streamHandler) {
using (var response = request.GetResponse()) {
using (var stream = response.GetResponseStream()) {
streamHandler(stream);
}
}
}
}
class GeneralRequest : AbstractRequest {
public GeneralRequest(string url)
: base(url, null, null) {}
public void GetResponseStream(ResponseStreamHandler streamHandler) {
WithResponseStream(Request(), streamHandler);
}
}
class IphoneRequest : AbstractRequest {
private static string UserAgent =
"Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_2 like Mac OS X; en-us) "+
"AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7D11 Safari/528.16";
public IphoneRequest(string url, CookieContainer cookies)
: base(url, cookies, IphoneRequest.UserAgent) {}
public void GetResponseStream(ResponseStreamHandler streamHandler) {
WithResponseStream(Request(), streamHandler);
}
}
class CoreMediaRequest : AbstractRequest {
private static string UserAgent =
"Apple iPhone v1.1.4 CoreMedia v1.0.0.4A102";
private int contentLength = -1;
public CoreMediaRequest(string url, CookieContainer cookies)
: base(url, cookies, CoreMediaRequest.UserAgent) {}
public int ContentLength {
get {
MakeInitialRangeRequestIfNecessary();
return contentLength;
}
}
private void MakeInitialRangeRequestIfNecessary() {
if (contentLength >= 0)
return;
var request = Request();
request.AddRange(0, 1);
using (var response = request.GetResponse()) {
this.contentLength = int.Parse(Regex.Match(response.Headers["Content-Range"], @"\d+$").Value);
}
}
public void GetResponseStreamFromOffset(int offset, ResponseStreamHandler streamHandler) {
var contentLength = ContentLength;
var request = Request();
request.AddRange(offset, contentLength);
WithResponseStream(request, streamHandler);
}
}
}
|
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
namespace IPDL {
abstract class AbstractRequest {
private string userAgent;
private string url;
private CookieContainer cookies;
public delegate void ResponseHandler(WebResponse response);
public delegate void ResponseStreamHandler(Stream stream);
public AbstractRequest(string url, CookieContainer cookies, string userAgent) {
this.url = url;
this.cookies = cookies;
this.userAgent = userAgent;
}
protected HttpWebRequest Request() {
HttpWebRequest r = (HttpWebRequest)WebRequest.Create(url);
if (userAgent != null) r.UserAgent = userAgent;
if (cookies != null) r.CookieContainer = cookies;
return r;
}
protected void WithResponse(HttpWebRequest request, ResponseHandler responseHandler) {
var response = request.GetResponse();
responseHandler(response);
response.Close();
}
protected void WithResponseStream(HttpWebRequest request, ResponseStreamHandler streamHandler) {
WithResponse(request, response => {
var stream = response.GetResponseStream();
streamHandler(stream);
stream.Close();
});
}
}
class GeneralRequest : AbstractRequest {
public GeneralRequest(string url)
: base(url, null, null) {}
public void GetResponseStream(ResponseStreamHandler streamHandler) {
WithResponseStream(Request(), streamHandler);
}
}
class IphoneRequest : AbstractRequest {
private static string UserAgent =
"Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_2 like Mac OS X; en-us) "+
"AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7D11 Safari/528.16";
public IphoneRequest(string url, CookieContainer cookies)
: base(url, cookies, IphoneRequest.UserAgent) {}
public void GetResponseStream(ResponseStreamHandler streamHandler) {
WithResponseStream(Request(), streamHandler);
}
}
class CoreMediaRequest : AbstractRequest {
private static string UserAgent =
"Apple iPhone v1.1.4 CoreMedia v1.0.0.4A102";
private int contentLength = -1;
public CoreMediaRequest(string url, CookieContainer cookies)
: base(url, cookies, CoreMediaRequest.UserAgent) {}
public int ContentLength {
get {
MakeInitialRangeRequestIfNecessary();
return contentLength;
}
}
private void MakeInitialRangeRequestIfNecessary() {
if (contentLength >= 0)
return;
var request = Request();
request.AddRange(0, 1);
WithResponse(request, response => {
this.contentLength = int.Parse(Regex.Match(response.Headers["Content-Range"], @"\d+$").Value);
});
}
public void GetResponseStreamFromOffset(int offset, ResponseStreamHandler streamHandler) {
var contentLength = ContentLength;
var request = Request();
request.AddRange(offset, contentLength);
WithResponseStream(request, streamHandler);
}
}
}
|
mit
|
C#
|
19874ca8658d3e1bfa45afe75f552e8785a4549f
|
Update unit
|
sunkaixuan/SqlSugar
|
Src/Asp.Net/PgSqlTest/UnitTest/UJson.cs
|
Src/Asp.Net/PgSqlTest/UnitTest/UJson.cs
|
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
public partial class NewUnitTest
{
public static void Json()
{
Db.CodeFirst.InitTables<UnitJsonTest>();
Db.DbMaintenance.TruncateTable<UnitJsonTest>();
Db.Insertable(new UnitJsonTest() { Order = new Order { Id = 1, Name = "order1" } }).ExecuteCommand();
var list = Db.Queryable<UnitJsonTest>().ToList();
UValidate.Check("order1", list.First().Order.Name, "Json");
Db.Updateable(new UnitJsonTest() { Id = Db.Queryable<UnitJsonTest>().First().Id, Order = new Order { Id = 2, Name = "order2" } }).ExecuteCommand();
list= Db.Queryable<UnitJsonTest>().ToList();
UValidate.Check("order2", list.First().Order.Name, "Json");
var list2 = Db.Queryable<UnitJsonTest>().ToList();
Db.CodeFirst.InitTables<UnitArray2>();
Db.Insertable(new UnitArray2() { MenuIds = new float[] { 1, 2 } }).ExecuteCommand();
var x=Db.Queryable<UnitArray2>().ToList();
}
}
public class UnitArray2
{
[SugarColumn(ColumnDataType = "real []", IsArray = true)]
public float[] MenuIds { get; set; }
}
public class UnitJsonTest
{
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
[SqlSugar.SugarColumn(ColumnDataType = "varchar(4000)", IsJson = true)]
public Order Order { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
public partial class NewUnitTest
{
public static void Json()
{
Db.CodeFirst.InitTables<UnitJsonTest>();
Db.DbMaintenance.TruncateTable<UnitJsonTest>();
Db.Insertable(new UnitJsonTest() { Order = new Order { Id = 1, Name = "order1" } }).ExecuteCommand();
var list = Db.Queryable<UnitJsonTest>().ToList();
UValidate.Check("order1", list.First().Order.Name, "Json");
Db.Updateable(new UnitJsonTest() { Id = Db.Queryable<UnitJsonTest>().First().Id, Order = new Order { Id = 2, Name = "order2" } }).ExecuteCommand();
list= Db.Queryable<UnitJsonTest>().ToList();
UValidate.Check("order2", list.First().Order.Name, "Json");
var list2 = Db.Queryable<UnitJsonTest>().ToList();
}
}
public class UnitJsonTest
{
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
[SqlSugar.SugarColumn(ColumnDataType = "varchar(4000)", IsJson = true)]
public Order Order { get; set; }
}
}
|
apache-2.0
|
C#
|
524b6497065a89d802d9cdc876cde19a5e4b6501
|
Allow empty header value
|
justcoding121/Titanium-Web-Proxy,titanium007/Titanium-Web-Proxy,titanium007/Titanium
|
Titanium.Web.Proxy/Models/HttpHeader.cs
|
Titanium.Web.Proxy/Models/HttpHeader.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Titanium.Web.Proxy.Models
{
public class HttpHeader
{
public string Name { get; set; }
public string Value { get; set; }
public HttpHeader(string name, string value)
{
if (string.IsNullOrEmpty(name)) throw new Exception("Name cannot be null");
this.Name = name.Trim();
this.Value = value.Trim();
}
public override string ToString()
{
return String.Format("{0}: {1}", this.Name, this.Value);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Titanium.Web.Proxy.Models
{
public class HttpHeader
{
public string Name { get; set; }
public string Value { get; set; }
public HttpHeader(string name, string value)
{
if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(value)) throw new Exception("Name or value cannot be null");
this.Name = name.Trim();
this.Value = value.Trim();
}
public override string ToString()
{
return String.Format("{0}: {1}", this.Name, this.Value);
}
}
}
|
mit
|
C#
|
d8c68b61f034ed7531c9609b3c3e46b2b6a56c43
|
Add missing namespace to the sample.
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
samples/KWebStartup/Startup.cs
|
samples/KWebStartup/Startup.cs
|
using Microsoft.AspNet;
using Microsoft.AspNet.Abstractions;
namespace KWebStartup
{
public class Startup
{
public void Configuration(IBuilder app)
{
app.Run(async context =>
{
context.Response.ContentType = "text/plain";
await context.Response.WriteAsync("Hello world");
});
}
}
}
|
using Microsoft.AspNet.Abstractions;
namespace KWebStartup
{
public class Startup
{
public void Configuration(IBuilder app)
{
app.Run(async context =>
{
context.Response.ContentType = "text/plain";
await context.Response.WriteAsync("Hello world");
});
}
}
}
|
apache-2.0
|
C#
|
c168d0332c818157828a6d7d21687eaaae0e1fbb
|
Handle multiple=true on publisher confirm ack.
|
Pliner/EasyNetQ.Management.Client,alexwiese/EasyNetQ.Management.Client,micdenny/EasyNetQ.Management.Client,Pliner/EasyNetQ.Management.Client,EasyNetQ/EasyNetQ.Management.Client,LawrenceWard/EasyNetQ.Management.Client,chinaboard/EasyNetQ.Management.Client,EasyNetQ/EasyNetQ.Management.Client,micdenny/EasyNetQ.Management.Client
|
Source/Version.cs
|
Source/Version.cs
|
using System.Reflection;
// EasyNetQ version number: <major>.<minor>.<non-breaking-feature>.<build>
[assembly: AssemblyVersion("0.15.3.0")]
// Note: until version 1.0 expect breaking changes on 0.X versions.
// 0.15.3.0 Handle multiple=true on publisher confirm ack.
// 0.15.2.0 Internal event bus
// 0.15.1.0 PublishExchangeDeclareStrategy. Only one declare now rather than once per publish.
// 0.15.0.0 Removed IPublishChannel and IAdvancedPublishChannel API. Publish now back on IBus.
// 0.14.5.0 Upgrade to RabbitMQ.Client 3.1.5
// 0.14.4.0 Consumer dispatcher queue cleared after connection lost.
// 0.14.3.0 IConsumerErrorStrategy not being disposed fix
// 0.14.2.0 MessageProperties serialization fix
// 0.14.1.0 Fixed missing properties in error message
// 0.14.0.0 Big internal consumer rewrite
// 0.13.0.0 AutoSubscriber moved to EasyNetQ.AutoSubscribe namespace.
// 0.12.4.0 Factored ConsumerDispatcher out of QueueingConsumerFactory.
// 0.12.3.0 Upgrade to RabbitMQ.Client 3.1.1
// 0.12.2.0 Requested Heartbeat on by default
// 0.12.1.0 Factored declares out of AdvancedBus publish and consume.
// 0.11.1.0 New plugable validation strategy (IMessageValidationStrategy)
// 0.11.0.0 Exchange durability can be configured
// 0.10.1.0 EasyNetQ.Trace
// 0.10.0.0 John-Mark Newton's RequestAsync API change
// 0.9.2.0 C# style property names on Management.Client
// 0.9.1.0 Upgrade to RabbitMQ.Client 3.0.0.0
// 0.9.0.0 Management
// 0.8.4.0 Better client information sent to RabbitMQ
// 0.8.3.0 ConsumerErrorStrategy ack strategy
// 0.8.2.0 Publisher confirms
// 0.8.1.0 Prefetch count can be configured with the prefetchcount connection string value.
// 0.8.0.0 Fluent publisher & subscriber configuration. Breaking change to IBus and IPublishChannel.
// 0.7.2.0 Cluster support
// 0.7.1.0 Daniel Wertheim's AutoSubscriber
// 0.7.0.0 Added IServiceProvider to make it easy to plug in your own dependencies. Some breaking changes to RabbitHutch
// 0.6.3.0 Consumer Queue now uses BCL BlockingCollection.
// 0.6.2.0 New model cleanup strategy based on consumer tracking
// 0.6.1.0 Removed InMemoryBus, Removed concrete class dependencies from FuturePublish.
// 0.6 Introduced IAdvancedBus, refactored IBus
// 0.5 Added IPublishChannel and moved Publish and Request to it from IBus
// 0.4 Topic based routing
// 0.3 Upgrade to RabbitMQ.Client 2.8.1.0
// 0.2 Upgrade to RabbitMQ.Client 2.7.0.0
// 0.1 Initial
|
using System.Reflection;
// EasyNetQ version number: <major>.<minor>.<non-breaking-feature>.<build>
[assembly: AssemblyVersion("0.15.2.0")]
// Note: until version 1.0 expect breaking changes on 0.X versions.
// 0.15.2.0 Internal event bus
// 0.15.1.0 PublishExchangeDeclareStrategy. Only one declare now rather than once per publish.
// 0.15.0.0 Removed IPublishChannel and IAdvancedPublishChannel API. Publish now back on IBus.
// 0.14.5.0 Upgrade to RabbitMQ.Client 3.1.5
// 0.14.4.0 Consumer dispatcher queue cleared after connection lost.
// 0.14.3.0 IConsumerErrorStrategy not being disposed fix
// 0.14.2.0 MessageProperties serialization fix
// 0.14.1.0 Fixed missing properties in error message
// 0.14.0.0 Big internal consumer rewrite
// 0.13.0.0 AutoSubscriber moved to EasyNetQ.AutoSubscribe namespace.
// 0.12.4.0 Factored ConsumerDispatcher out of QueueingConsumerFactory.
// 0.12.3.0 Upgrade to RabbitMQ.Client 3.1.1
// 0.12.2.0 Requested Heartbeat on by default
// 0.12.1.0 Factored declares out of AdvancedBus publish and consume.
// 0.11.1.0 New plugable validation strategy (IMessageValidationStrategy)
// 0.11.0.0 Exchange durability can be configured
// 0.10.1.0 EasyNetQ.Trace
// 0.10.0.0 John-Mark Newton's RequestAsync API change
// 0.9.2.0 C# style property names on Management.Client
// 0.9.1.0 Upgrade to RabbitMQ.Client 3.0.0.0
// 0.9.0.0 Management
// 0.8.4.0 Better client information sent to RabbitMQ
// 0.8.3.0 ConsumerErrorStrategy ack strategy
// 0.8.2.0 Publisher confirms
// 0.8.1.0 Prefetch count can be configured with the prefetchcount connection string value.
// 0.8.0.0 Fluent publisher & subscriber configuration. Breaking change to IBus and IPublishChannel.
// 0.7.2.0 Cluster support
// 0.7.1.0 Daniel Wertheim's AutoSubscriber
// 0.7.0.0 Added IServiceProvider to make it easy to plug in your own dependencies. Some breaking changes to RabbitHutch
// 0.6.3.0 Consumer Queue now uses BCL BlockingCollection.
// 0.6.2.0 New model cleanup strategy based on consumer tracking
// 0.6.1.0 Removed InMemoryBus, Removed concrete class dependencies from FuturePublish.
// 0.6 Introduced IAdvancedBus, refactored IBus
// 0.5 Added IPublishChannel and moved Publish and Request to it from IBus
// 0.4 Topic based routing
// 0.3 Upgrade to RabbitMQ.Client 2.8.1.0
// 0.2 Upgrade to RabbitMQ.Client 2.7.0.0
// 0.1 Initial
|
mit
|
C#
|
1863e86603696607f5843641b021d24c9d70890f
|
Bump version to 0.13.5
|
ar3cka/Journalist
|
src/SolutionInfo.cs
|
src/SolutionInfo.cs
|
// <auto-generated/>
using System.Reflection;
[assembly: AssemblyProductAttribute("Journalist")]
[assembly: AssemblyVersionAttribute("0.13.5")]
[assembly: AssemblyInformationalVersionAttribute("0.13.5")]
[assembly: AssemblyFileVersionAttribute("0.13.5")]
[assembly: AssemblyCompanyAttribute("Anton Mednonogov")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "0.13.5";
}
}
|
// <auto-generated/>
using System.Reflection;
[assembly: AssemblyProductAttribute("Journalist")]
[assembly: AssemblyVersionAttribute("0.13.4")]
[assembly: AssemblyInformationalVersionAttribute("0.13.4")]
[assembly: AssemblyFileVersionAttribute("0.13.4")]
[assembly: AssemblyCompanyAttribute("Anton Mednonogov")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "0.13.4";
}
}
|
apache-2.0
|
C#
|
fe1073e4a8602ab4327964f1487de1a15625e501
|
Update IndexModule.cs
|
LeedsSharp/AppVeyorDemo
|
src/AppVeyorDemo/AppVeyorDemo/Modules/IndexModule.cs
|
src/AppVeyorDemo/AppVeyorDemo/Modules/IndexModule.cs
|
namespace AppVeyorDemo.Modules
{
using System.Configuration;
using AppVeyorDemo.Models;
using Nancy;
public class IndexModule : NancyModule
{
public IndexModule()
{
Get["/"] = parameters =>
{
var model = new IndexViewModel
{
HelloName = "Leeds#",
ServerName = ConfigurationManager.AppSettings["Server_Name"]
};
return View["index", model];
};
}
}
}
|
namespace AppVeyorDemo.Modules
{
using System.Configuration;
using AppVeyorDemo.Models;
using Nancy;
public class IndexModule : NancyModule
{
public IndexModule()
{
Get["/"] = parameters =>
{
var model = new IndexViewModel
{
HelloName = "AppVeyor",
ServerName = ConfigurationManager.AppSettings["Server_Name"]
};
return View["index", model];
};
}
}
}
|
apache-2.0
|
C#
|
0d167de3c64f7eb993663f6a10541b28f1fb5f08
|
Hide the new, unwanted "Show regional dialects" control
|
JohnThomson/BloomDesktop,StephenMcConnel/BloomDesktop,BloomBooks/BloomDesktop,StephenMcConnel/BloomDesktop,BloomBooks/BloomDesktop,gmartin7/myBloomFork,BloomBooks/BloomDesktop,BloomBooks/BloomDesktop,gmartin7/myBloomFork,JohnThomson/BloomDesktop,StephenMcConnel/BloomDesktop,andrew-polk/BloomDesktop,JohnThomson/BloomDesktop,gmartin7/myBloomFork,gmartin7/myBloomFork,JohnThomson/BloomDesktop,andrew-polk/BloomDesktop,gmartin7/myBloomFork,andrew-polk/BloomDesktop,andrew-polk/BloomDesktop,StephenMcConnel/BloomDesktop,BloomBooks/BloomDesktop,StephenMcConnel/BloomDesktop,andrew-polk/BloomDesktop,StephenMcConnel/BloomDesktop,BloomBooks/BloomDesktop,JohnThomson/BloomDesktop,gmartin7/myBloomFork,andrew-polk/BloomDesktop
|
src/BloomExe/CollectionCreating/LanguageIdControl.cs
|
src/BloomExe/CollectionCreating/LanguageIdControl.cs
|
using System;
using System.Linq;
using System.Windows.Forms;
using Bloom.Collection;
using Bloom.ToPalaso;
namespace Bloom.CollectionCreating
{
public partial class LanguageIdControl : UserControl, IPageControl
{
public CollectionSettings _collectionInfo;
private Action<UserControl, bool> _setNextButtonState;
public LanguageIdControl()
{
InitializeComponent();
_lookupISOControl.SelectedLanguage = null;
_lookupISOControl.IsShowRegionalDialectsCheckBoxVisible = false;
}
private void OnLookupISOControlReadinessChanged(object sender, EventArgs e)
{
if (_collectionInfo == null)
return;
if (_lookupISOControl.SelectedLanguage != null)
{
_collectionInfo.Language1Iso639Code = _lookupISOControl.SelectedLanguage.LanguageTag;
_collectionInfo.Language1Name = _lookupISOControl.SelectedLanguage.DesiredName;
_collectionInfo.Country = _lookupISOControl.SelectedLanguage.Countries.FirstOrDefault() ?? string.Empty;
//If there are multiple countries, just leave it blank so they can type something in
if (_collectionInfo.Country.Contains(","))
{
_collectionInfo.Country = "";
}
}
_setNextButtonState(this, _lookupISOControl.SelectedLanguage != null);
}
public void Init(Action<UserControl, bool> setNextButtonState, CollectionSettings collectionInfo)
{
_setNextButtonState = setNextButtonState;
_collectionInfo = collectionInfo;
_lookupISOControl.ReadinessChanged += OnLookupISOControlReadinessChanged;
}
public void NowVisible()
{
_setNextButtonState(this, _lookupISOControl.SelectedLanguage != null);
}
private void _lookupISOControl_Leave(object sender, EventArgs e)
{
_setNextButtonState(this, _lookupISOControl.SelectedLanguage != null);
}
}
}
|
using System;
using System.Linq;
using System.Windows.Forms;
using Bloom.Collection;
using Bloom.ToPalaso;
namespace Bloom.CollectionCreating
{
public partial class LanguageIdControl : UserControl, IPageControl
{
public CollectionSettings _collectionInfo;
private Action<UserControl, bool> _setNextButtonState;
public LanguageIdControl()
{
InitializeComponent();
_lookupISOControl.SelectedLanguage = null;
}
private void OnLookupISOControlReadinessChanged(object sender, EventArgs e)
{
if (_collectionInfo == null)
return;
if (_lookupISOControl.SelectedLanguage != null)
{
_collectionInfo.Language1Iso639Code = _lookupISOControl.SelectedLanguage.LanguageTag;
_collectionInfo.Language1Name = _lookupISOControl.SelectedLanguage.DesiredName;
_collectionInfo.Country = _lookupISOControl.SelectedLanguage.Countries.FirstOrDefault() ?? string.Empty;
//If there are multiple countries, just leave it blank so they can type something in
if (_collectionInfo.Country.Contains(","))
{
_collectionInfo.Country = "";
}
}
_setNextButtonState(this, _lookupISOControl.SelectedLanguage != null);
}
public void Init(Action<UserControl, bool> setNextButtonState, CollectionSettings collectionInfo)
{
_setNextButtonState = setNextButtonState;
_collectionInfo = collectionInfo;
_lookupISOControl.ReadinessChanged += OnLookupISOControlReadinessChanged;
}
public void NowVisible()
{
_setNextButtonState(this, _lookupISOControl.SelectedLanguage != null);
}
private void _lookupISOControl_Leave(object sender, EventArgs e)
{
_setNextButtonState(this, _lookupISOControl.SelectedLanguage != null);
}
}
}
|
mit
|
C#
|
15a77eee846f32d21163275c33a62be231305b85
|
Update formWrangler.cshtml
|
mcmullengreg/formWrangler
|
formWrangler.cshtml
|
formWrangler.cshtml
|
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
if ( String.IsNullOrEmpty(@Parameter.mediaFolder) ) {
<div><p>A folder has not been selected</p></div>
}
var folder = Parameter.mediaFolder;
var media = Model.MediaById(folder);
}
@helper traverse(dynamic node) {
var cc = node.Children;
if (cc.Count()>0) {
<ul>
@foreach (var c in cc) {
<li>
@structure(c)
@traverse(c)
</li>
}
</ul>
}
}
@helper structure( dynamic node ){
if ( node.NodeTypeAlias == "Folder" ) {
<span class="folder" id="@node.Name.ToLower().Replace(" ", "_")">@node.Name</span>
} else {
<a href="@node.Url">@node.Name</a>
}
}
<div class="formWrangler">
@traverse(media)
</div>
|
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
if ( String.IsNullOrEmpty(@Parameter.mediaFolder) ) {
<div><p>A folder has not been selected</p></div>
}
var folder = Parameter.mediaFolder;
var media = Model.MediaById(folder);
}
@helper traverse(dynamic node) {
var cc = node.Children;
if (cc.Count()>0) {
<ul>
@foreach (var c in cc) {
<li>
@structure(c)
@traverse(c)
</li>
}
</ul>
}
}
@helper structure( dynamic node ){
if ( node.NodeTypeAlias == "Folder" ) {
<span class="folder">@node.Name</span>
} else {
<a href="@node.Url">@node.Name</a>
}
}
<div class="formWrangler">
@traverse(media)
</div>
|
mit
|
C#
|
451079a30e581def76ca927b4b2d8459c87dffe9
|
Update application version.
|
RadishSystems/choiceview-webapitester-csharp
|
ApiTester/Properties/AssemblyInfo.cs
|
ApiTester/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ApiTester")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Radish Systems, LLC")]
[assembly: AssemblyProduct("ChoiceViewIVR")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("11c518e8-6b26-4116-ab41-42f18f80a49a")]
// 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")]
[assembly: AssemblyFileVersion("1.0.0.3")]
[assembly: AssemblyInformationalVersion("1.0 Development")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ApiTester")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Radish Systems, LLC")]
[assembly: AssemblyProduct("ChoiceViewIVR")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("11c518e8-6b26-4116-ab41-42f18f80a49a")]
// 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")]
[assembly: AssemblyFileVersion("1.0.0.2")]
[assembly: AssemblyInformationalVersion("1.0 Development")]
|
mit
|
C#
|
218532e77fe14e4808f2e107f3cd0e3d8089401d
|
add spinner judgement and score
|
39M/LMix
|
Assets/Scenes/InGame/Scripts/Spin.cs
|
Assets/Scenes/InGame/Scripts/Spin.cs
|
using UnityEngine;
using System.Collections;
using Leap;
public class Spin : MonoBehaviour {
public GameObject judgement;
public float TotalTime = 3.0f;
Color c300, c100, c50, c0;
GamePlayer status;
float rotate = 0.0f;
float rotatespeed = 20.0f;
float remaintime = 3.0f;
CircleGesture circlegesture;
Vector3 fingeroldposition ;
protected Controller leap;
// Use this for initialization
void Start () {
circlegesture = new CircleGesture();
leap = new Controller();
leap.EnableGesture(Gesture.GestureType.TYPE_CIRCLE);
Frame fream = leap.Frame ();
Hand hand = fream.Hands [0];
Vector3 FingerPos = new Vector3(0,0,0);
foreach (var finger in hand.Fingers) {
FingerPos=FingerPos + new Vector3(finger.TipPosition.x,finger.TipPosition.y,finger.TipPosition.z);
}
fingeroldposition = FingerPos;
status = GameObject.Find ("GamePlayer").GetComponent ("GamePlayer") as GamePlayer;
c300 = new Color (58 / 255f, 183 / 255f, 239 / 255f, 0);
c100 = new Color(191 / 255f, 255 / 255f, 160 / 255f, 0);
c50 = new Color(251 / 255f, 208 / 255f, 114 / 255f, 0);
c0 = new Color(249 / 255f, 90 / 255f, 101 / 255f, 0);
}
// Update is called once per frame
void Update () {
// to rotate the spin
rot ();
// recalculate the rotate speed
Frame fream = leap.Frame ();
Hand hand = fream.Hands [0];
Vector3 FingerPos = new Vector3(0,0,0);
foreach (var finger in hand.Fingers) {
FingerPos =FingerPos + new Vector3(finger.TipPosition.x,finger.TipPosition.y,finger.TipPosition.z);
}
rotatespeed =Time.deltaTime *(FingerPos - fingeroldposition).sqrMagnitude;
fingeroldposition = FingerPos;
remaintime-=Time.deltaTime;
if(remaintime <= 0.0f){
// add score
// this.rotate is a float that remark the total angle that the spinner has been rotated before it ends;
Debug.Log(rotate);
TextMesh tmp = ((GameObject)Instantiate (judgement, transform.position, Quaternion.identity)).GetComponent<TextMesh> ();
int ScoreGet;
if (rotate >= TotalTime / 2f * 360) {
tmp.text = "Perfect";
tmp.color = c300;
ScoreGet = 300 + 300 / 25 * status.ComboCounter;
status.ComboCounter++;
status.PerfectCount++;
}
else if (rotate >= TotalTime / 4f * 360) {
tmp.text = "Good";
tmp.color = c100;
ScoreGet = 100 + 100 / 25 * status.ComboCounter;
status.ComboCounter++;
status.GoodCount++;
}
else if (rotate >= TotalTime / 8f * 360) {
tmp.text = "Bad";
tmp.color = c50;
ScoreGet = 50 + 50 / 25 * status.ComboCounter;
status.ComboCounter = 0;
status.BadCount++;
}
else {
tmp.text = "Miss";
tmp.color = c0;
status.MissCount++;
ScoreGet = 0;
}
status.ScoreCounter += ScoreGet;
if (status.ComboCounter > status.MaxCombo)
status.MaxCombo = status.ComboCounter;
//status.ScoreText.text = "Score: " + status.ScoreNow.ToString ();
status.ComboText.text = "Combo: " + status.ComboCounter.ToString ();
// distory this spinner
Destroy(gameObject);
//GetComponent<Renderer>().enabled = false;
}
}
void rot(){
rotate += rotatespeed * Time.deltaTime;
Debug.Log(rotate);
Vector3 rot = new Vector3();
rot = transform.localEulerAngles;
Debug.Log(rot.ToString());
rot.x =rotate;
rot.y = 90f;
rot.z = 90f;
Debug.Log(rot.ToString());
transform.localEulerAngles = rot;
}
}
|
using UnityEngine;
using System.Collections;
using Leap;
public class Spin : MonoBehaviour {
float rotate = 0.0f;
float rotatespeed = 20.0f;
float remaintime = 3.0f;
CircleGesture circlegesture;
Vector3 fingeroldposition ;
protected Controller leap;
// Use this for initialization
void Start () {
circlegesture = new CircleGesture();
leap = new Controller();
leap.EnableGesture(Gesture.GestureType.TYPE_CIRCLE);
Frame fream = leap.Frame ();
Hand hand = fream.Hands [0];
Vector3 FingerPos = new Vector3(0,0,0);
foreach (var finger in hand.Fingers) {
FingerPos=FingerPos + new Vector3(finger.TipPosition.x,finger.TipPosition.y,finger.TipPosition.z);
}
fingeroldposition = FingerPos;
}
// Update is called once per frame
void Update () {
// to rotate the spin
rot ();
// recalculate the rotate speed
Frame fream = leap.Frame ();
Hand hand = fream.Hands [0];
Vector3 FingerPos = new Vector3(0,0,0);
foreach (var finger in hand.Fingers) {
FingerPos =FingerPos + new Vector3(finger.TipPosition.x,finger.TipPosition.y,finger.TipPosition.z);
}
rotatespeed =Time.deltaTime *(FingerPos - fingeroldposition).sqrMagnitude;
fingeroldposition = FingerPos;
remaintime-=Time.deltaTime;
if(remaintime <= 0.0f){
// add score
// this.rotate is a float that remark the total angle that the spinner has been rotated before it ends;
// distory this spinner
GetComponent<Renderer>().enabled = false;
}
}
void rot(){
rotate += rotatespeed * Time.deltaTime;
Debug.Log(rotate);
Vector3 rot = new Vector3();
rot = transform.localEulerAngles;
Debug.Log(rot.ToString());
rot.x =rotate;
rot.y = 90f;
rot.z = 90f;
Debug.Log(rot.ToString());
transform.localEulerAngles = rot;
}
}
|
mit
|
C#
|
8e3918a47cda051211a7914bb327ba18220ef1f5
|
Fix for issue #491 (2 commits squashed)
|
couchbase/couchbase-lite-net,JiboStore/couchbase-lite-net,brettharrisonzya/couchbase-lite-net,couchbase/couchbase-lite-net,brettharrisonzya/couchbase-lite-net,JiboStore/couchbase-lite-net,couchbase/couchbase-lite-net,z000z/couchbase-lite-net,z000z/couchbase-lite-net
|
src/Couchbase.Lite.Shared/View/UpdateJob.cs
|
src/Couchbase.Lite.Shared/View/UpdateJob.cs
|
//
// UpdateJob.cs
//
// Author:
// Jim Borden <jim.borden@couchbase.com>
//
// Copyright (c) 2015 Couchbase, Inc All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using System;
using System.Threading;
using System.Collections.Generic;
using Couchbase.Lite.Store;
using System.Threading.Tasks;
using System.Linq;
namespace Couchbase.Lite.Internal
{
internal sealed class UpdateJob
{
private readonly Func<IList<IViewStore>, Status> _logic;
private readonly IEnumerable<IViewStore> _args;
private Task<Status> _task;
public readonly long[] LastSequences;
public Status Result
{
get {
return _task.IsCompleted ? _task.Result : new Status(StatusCode.Unknown);
}
}
public event EventHandler Finished;
public UpdateJob(Func<IList<IViewStore>, Status> logic, IEnumerable<IViewStore> args, IEnumerable<long> lastSequences)
{
_logic = logic;
_args = args;
LastSequences = lastSequences.ToArray();
_task = new Task<Status>(() => _logic(_args.ToList()));
}
public void Run()
{
if (_task.Status <= TaskStatus.Running) {
_task.Start(TaskScheduler.Default);
_task.ContinueWith(t =>
{
if(Finished != null) {
Finished(this, null);
}
});
}
}
public void Wait()
{
_task.Wait();
}
}
}
|
//
// UpdateJob.cs
//
// Author:
// Jim Borden <jim.borden@couchbase.com>
//
// Copyright (c) 2015 Couchbase, Inc All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using System;
using System.Threading;
using System.Collections.Generic;
using Couchbase.Lite.Store;
using System.Threading.Tasks;
using System.Linq;
namespace Couchbase.Lite.Internal
{
internal sealed class UpdateJob
{
private readonly Func<IList<IViewStore>, Status> _logic;
private readonly IEnumerable<IViewStore> _args;
private Task<Status> _task;
public readonly long[] LastSequences;
public Status Result
{
get {
return _task.IsCompleted ? _task.Result : new Status(StatusCode.Unknown);
}
}
public event EventHandler Finished;
public UpdateJob(Func<IList<IViewStore>, Status> logic, IEnumerable<IViewStore> args, IEnumerable<long> lastSequences)
{
_logic = logic;
_args = args;
LastSequences = lastSequences.ToArray();
}
public void Run()
{
if (_task == null) {
_task = Task.Factory.StartNew<Status>(() => _logic(_args.ToList()));
_task.ContinueWith(t =>
{
if(Finished != null) {
Finished(this, null);
}
});
}
}
public void Wait()
{
_task.Wait();
}
}
}
|
apache-2.0
|
C#
|
45dc82eb821b45020d8a3397011185477e28a333
|
Remove some dead code
|
svick/cli,naamunds/cli,weshaggard/cli,borgdylan/dotnet-cli,johnbeisner/cli,mlorbetske/cli,jonsequitur/cli,svick/cli,MichaelSimons/cli,weshaggard/cli,ravimeda/cli,jonsequitur/cli,naamunds/cli,EdwardBlair/cli,harshjain2/cli,AbhitejJohn/cli,MichaelSimons/cli,jonsequitur/cli,JohnChen0/cli,jonsequitur/cli,weshaggard/cli,JohnChen0/cli,borgdylan/dotnet-cli,mylibero/cli,MichaelSimons/cli,johnbeisner/cli,naamunds/cli,harshjain2/cli,livarcocc/cli-1,blackdwarf/cli,dasMulli/cli,JohnChen0/cli,mlorbetske/cli,nguerrera/cli,MichaelSimons/cli,weshaggard/cli,blackdwarf/cli,nguerrera/cli,blackdwarf/cli,livarcocc/cli-1,AbhitejJohn/cli,weshaggard/cli,mylibero/cli,mylibero/cli,svick/cli,borgdylan/dotnet-cli,mylibero/cli,AbhitejJohn/cli,Faizan2304/cli,ravimeda/cli,MichaelSimons/cli,AbhitejJohn/cli,mlorbetske/cli,blackdwarf/cli,borgdylan/dotnet-cli,Faizan2304/cli,harshjain2/cli,nguerrera/cli,EdwardBlair/cli,naamunds/cli,nguerrera/cli,EdwardBlair/cli,mlorbetske/cli,Faizan2304/cli,borgdylan/dotnet-cli,mylibero/cli,ravimeda/cli,JohnChen0/cli,livarcocc/cli-1,naamunds/cli,dasMulli/cli,johnbeisner/cli,dasMulli/cli
|
src/Microsoft.DotNet.Cli.Utils/Constants.cs
|
src/Microsoft.DotNet.Cli.Utils/Constants.cs
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.InternalAbstractions;
namespace Microsoft.DotNet.Cli.Utils
{
public static class Constants
{
private static Platform CurrentPlatform => RuntimeEnvironment.OperatingSystemPlatform;
public const string DefaultConfiguration = "Debug";
public static readonly string ProjectFileName = "project.json";
public static readonly string ExeSuffix = CurrentPlatform == Platform.Windows ? ".exe" : string.Empty;
public static readonly string ConfigSuffix = ".config";
// Priority order of runnable suffixes to look for and run
public static readonly string[] RunnableSuffixes = CurrentPlatform == Platform.Windows
? new string[] { ".exe", ".cmd", ".bat" }
: new string[] { string.Empty };
public static readonly string BinDirectoryName = "bin";
public static readonly string ObjDirectoryName = "obj";
public static readonly string DynamicLibSuffix = CurrentPlatform == Platform.Windows ? ".dll" :
CurrentPlatform == Platform.Darwin ? ".dylib" : ".so";
public static readonly string LibCoreClrFileName = (CurrentPlatform == Platform.Windows ? "coreclr" : "libcoreclr");
public static readonly string LibCoreClrName = LibCoreClrFileName + DynamicLibSuffix;
public static readonly string StaticLibSuffix = CurrentPlatform == Platform.Windows ? ".lib" : ".a";
public static readonly string ResponseFileSuffix = ".rsp";
public static readonly string PublishedHostExecutableName = "dotnet";
public static readonly string HostExecutableName = "corehost" + ExeSuffix;
public static readonly string[] HostBinaryNames = new string[] {
HostExecutableName,
(CurrentPlatform == Platform.Windows ? "hostpolicy" : "libhostpolicy") + DynamicLibSuffix,
(CurrentPlatform == Platform.Windows ? "hostfxr" : "libhostfxr") + DynamicLibSuffix
};
public static readonly string[] LibCoreClrBinaryNames = new string[]
{
"coreclr.dll",
"libcoreclr.so",
"libcoreclr.dylib"
};
}
}
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.InternalAbstractions;
namespace Microsoft.DotNet.Cli.Utils
{
public static class Constants
{
private static Platform CurrentPlatform => RuntimeEnvironment.OperatingSystemPlatform;
public const string DefaultConfiguration = "Debug";
public static readonly string ProjectFileName = "project.json";
public static readonly string ExeSuffix = CurrentPlatform == Platform.Windows ? ".exe" : string.Empty;
public static readonly string ConfigSuffix = ".config";
// Priority order of runnable suffixes to look for and run
public static readonly string[] RunnableSuffixes = CurrentPlatform == Platform.Windows
? new string[] { ".exe", ".cmd", ".bat" }
: new string[] { string.Empty };
public static readonly string BinDirectoryName = "bin";
public static readonly string ObjDirectoryName = "obj";
public static readonly string DynamicLibSuffix = CurrentPlatform == Platform.Windows ? ".dll" :
CurrentPlatform == Platform.Darwin ? ".dylib" : ".so";
public static readonly string LibCoreClrFileName = (CurrentPlatform == Platform.Windows ? "coreclr" : "libcoreclr");
public static readonly string LibCoreClrName = LibCoreClrFileName + DynamicLibSuffix;
public static readonly string RuntimeIdentifier = CurrentPlatform == Platform.Windows ? "win7-x64" :
CurrentPlatform == Platform.Darwin ? "osx.10.10-x64" : "ubuntu.{RuntimeEnvironment.OperatingSystemVersion}-x64";
public static readonly string StaticLibSuffix = CurrentPlatform == Platform.Windows ? ".lib" : ".a";
public static readonly string ResponseFileSuffix = ".rsp";
public static readonly string PublishedHostExecutableName = "dotnet";
public static readonly string HostExecutableName = "corehost" + ExeSuffix;
public static readonly string[] HostBinaryNames = new string[] {
HostExecutableName,
(CurrentPlatform == Platform.Windows ? "hostpolicy" : "libhostpolicy") + DynamicLibSuffix,
(CurrentPlatform == Platform.Windows ? "hostfxr" : "libhostfxr") + DynamicLibSuffix
};
public static readonly string[] LibCoreClrBinaryNames = new string[]
{
"coreclr.dll",
"libcoreclr.so",
"libcoreclr.dylib"
};
}
}
|
mit
|
C#
|
8debb2d45e53de4273ad19339f98448b933cd035
|
Fix issue with ms asp.net getting httproute paths with a wildcard
|
cwensley/Pablo.Gallery,cwensley/Pablo.Gallery,sixteencolors/Pablo.Gallery,cwensley/Pablo.Gallery,sixteencolors/Pablo.Gallery,sixteencolors/Pablo.Gallery,sixteencolors/Pablo.Gallery
|
src/Pablo.Gallery/App_Start/WebApiConfig.cs
|
src/Pablo.Gallery/App_Start/WebApiConfig.cs
|
using System.Net.Http.Formatting;
using System.Web.Http;
using System.Web.Http.Dispatcher;
using Pablo.Gallery.Logic;
using Pablo.Gallery.Logic.Filters;
using System.Web.Http.Controllers;
using Pablo.Gallery.Logic.Selectors;
namespace Pablo.Gallery
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Filters.Add(new LoggingApiExceptionFilter());
config.Routes.MapHttpRoute(
name: "api",
routeTemplate: "api/{version}/{controller}/{id}",
defaults: new { version = "v0", id = RouteParameter.Optional }
);
// need this separate as Url.RouteUrl does not work with a wildcard in the route
// this is used to allow files in subfolders of a pack to be retrieved.
config.Routes.MapHttpRoute(
name: "apipath",
routeTemplate: "api/{version}/{controller}/{id}/{*path}",
defaults: new { version = "v0", id = RouteParameter.Optional, path = RouteParameter.Optional }
);
config.Services.Replace(typeof(IHttpControllerSelector), new NamespaceHttpControllerSelector(config, 1));
config.Formatters.JsonFormatter.AddQueryStringMapping("type", "json", "application/json");
config.Formatters.XmlFormatter.AddQueryStringMapping("type", "xml", "application/xml");
//config.MessageHandlers.Add(new CorsHandler());
config.Services.Replace(typeof(IHttpActionSelector), new CorsPreflightActionSelector());
}
}
}
|
using System.Net.Http.Formatting;
using System.Web.Http;
using System.Web.Http.Dispatcher;
using Pablo.Gallery.Logic;
using Pablo.Gallery.Logic.Filters;
using System.Web.Http.Controllers;
using Pablo.Gallery.Logic.Selectors;
namespace Pablo.Gallery
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Filters.Add(new LoggingApiExceptionFilter());
config.Routes.MapHttpRoute(
name: "api",
routeTemplate: "api/{version}/{controller}/{id}/{*path}",
defaults: new { version = "v0", id = RouteParameter.Optional, path = RouteParameter.Optional }
);
config.Services.Replace(typeof(IHttpControllerSelector), new NamespaceHttpControllerSelector(config, 1));
config.Formatters.JsonFormatter.AddQueryStringMapping("type", "json", "application/json");
config.Formatters.XmlFormatter.AddQueryStringMapping("type", "xml", "application/xml");
//config.MessageHandlers.Add(new CorsHandler());
config.Services.Replace(typeof(IHttpActionSelector), new CorsPreflightActionSelector());
}
}
}
|
mit
|
C#
|
abfbeac76cf5188dc1a2bd92f7e48c936d15f2ac
|
add startSegment to FtpFolderNameRule
|
robinrodricks/FluentFTP,robinrodricks/FluentFTP,robinrodricks/FluentFTP
|
FluentFTP/Rules/FtpFolderNameRule.cs
|
FluentFTP/Rules/FtpFolderNameRule.cs
|
using System;
using System.Collections.Generic;
using System.Text;
using FluentFTP.Helpers;
namespace FluentFTP.Rules {
/// <summary>
/// Only accept folders that have the given name, or exclude folders of a given name.
/// </summary>
public class FtpFolderNameRule : FtpRule {
public static List<string> CommonBlacklistedFolders = new List<string> {
".git",
".svn",
".DS_Store",
"node_modules",
};
/// <summary>
/// If true, only folders of the given name are uploaded or downloaded.
/// If false, folders of the given name are excluded.
/// </summary>
public bool Whitelist;
/// <summary>
/// The folder names to match
/// </summary>
public IList<string> Names;
/// <summary>
/// Which path segment to start checking from
/// </summary>
public int StartSegment;
/// <summary>
/// Only accept folders that have the given name, or exclude folders of a given name.
/// </summary>
/// <param name="whitelist">If true, only folders of the given name are downloaded. If false, folders of the given name are excluded.</param>
/// <param name="names">The folder names to match</param>
/// <param name="startSegment">Which path segment to start checking from. 0 checks root folder onwards. 1 skips root folder.</param>
public FtpFolderNameRule(bool whitelist, IList<string> names, int startSegment = 0) {
this.Whitelist = whitelist;
this.Names = names;
this.StartSegment = startSegment;
}
/// <summary>
/// Checks if the folders has the given name, or exclude folders of the given name.
/// </summary>
public override bool IsAllowed(FtpListItem item) {
// get the folder name of this item
string[] dirNameParts = null;
if (item.Type == FtpFileSystemObjectType.File) {
dirNameParts = item.FullName.GetFtpDirectoryName().GetPathSegments();
}
else if (item.Type == FtpFileSystemObjectType.Directory) {
dirNameParts = item.FullName.GetPathSegments();
}
else {
return true;
}
// check against whitelist or blacklist
if (Whitelist) {
// loop thru path segments starting at given index
for (int d = StartSegment; d < dirNameParts.Length; d++) {
var dirName = dirNameParts[d];
// whitelist
if (Names.Contains(dirName.Trim())) {
return true;
}
}
return false;
}
else {
// loop thru path segments starting at given index
for (int d = StartSegment; d < dirNameParts.Length; d++) {
var dirName = dirNameParts[d];
// blacklist
if (Names.Contains(dirName.Trim())) {
return false;
}
}
return true;
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
using FluentFTP.Helpers;
namespace FluentFTP.Rules {
/// <summary>
/// Only accept folders that have the given name, or exclude folders of a given name.
/// </summary>
public class FtpFolderNameRule : FtpRule {
public static List<string> CommonBlacklistedFolders = new List<string> {
".git",
".svn",
".DS_Store",
"node_modules",
};
/// <summary>
/// If true, only folders of the given name are uploaded or downloaded.
/// If false, folders of the given name are excluded.
/// </summary>
public bool Whitelist;
/// <summary>
/// The folder names to match
/// </summary>
public IList<string> Names;
/// <summary>
/// Only accept folders that have the given name, or exclude folders of a given name.
/// </summary>
/// <param name="whitelist">If true, only folders of the given name are downloaded. If false, folders of the given name are excluded.</param>
/// <param name="names">The folder names to match</param>
public FtpFolderNameRule(bool whitelist, IList<string> names) {
this.Whitelist = whitelist;
this.Names = names;
}
/// <summary>
/// Checks if the folders has the given name, or exclude folders of the given name.
/// </summary>
public override bool IsAllowed(FtpListItem item) {
// get the folder name of this item
string[] dirNameParts = null;
if (item.Type == FtpFileSystemObjectType.File) {
dirNameParts = item.FullName.GetFtpDirectoryName().GetPathSegments();
}
else if (item.Type == FtpFileSystemObjectType.Directory) {
dirNameParts = item.FullName.GetPathSegments();
}
else {
return true;
}
// check against whitelist or blacklist
if (Whitelist) {
// whitelist
foreach (var dirName in dirNameParts) {
if (Names.Contains(dirName.Trim())) {
return true;
}
}
return false;
}
else {
// blacklist
foreach (var dirName in dirNameParts) {
if (Names.Contains(dirName.Trim())) {
return false;
}
}
return true;
}
}
}
}
|
mit
|
C#
|
36e23310281905f5b8624bf09bfe85088e4a3dd8
|
Update Payments/Terms
|
lucasdavid/Gamedalf,lucasdavid/Gamedalf
|
Gamedalf/Views/Payments/Terms.cshtml
|
Gamedalf/Views/Payments/Terms.cshtml
|
@using System.IdentityModel
@model AcceptTermsViewModel
@{
ViewBag.Title = "Subscribe to Gamedalf!";
}
@section scripts {
@Scripts.Render("~/Scripts/app/elements/BtnSubmitter.js")
}
<div id="terms-container">
<h1>Terms and Conditions</h1>
<h2 id="terms-title">
@Model.Terms.Title
</h2>
<p id="terms-dateCreated">
@Model.Terms.DateCreated
</p>
<samp id="terms-content" style="white-space: pre-line">
@Model.Terms.Content
</samp>
</div>
@using (Html.BeginForm("Make", "Payments", FormMethod.Post, new { id = "terms-form" }))
{
@Html.AntiForgeryToken()
<div class="checkbox">
<label>
@Html.CheckBoxFor(m => m.AcceptTerms, new { @class = "btn btn-default" })
@Html.DisplayNameFor(m => m.AcceptTerms)
</label>
</div>
@Html.ValidationMessageFor(m => m.AcceptTerms, "", new { @class = "text-danger" })
@Html.Partial("_Confirm", "Accept")
}
|
@using System.IdentityModel
@model AcceptTermsViewModel
@{
ViewBag.Title = "Gibe moni plox";
}
@section scripts {
@Scripts.Render("~/Scripts/app/ajax/terms.js")
}
<div id="terms-error" class="hidden">
@Html.Partial("_Error", new HandleErrorInfo(new RequestFailedException("api/terms seems to be unavaiable."), "Payment", "Terms"))
</div>
<div id="terms-container">
<h1>Terms and Conditions</h1>
<div id="terms-loading">
<h2>Loading…</h2>
</div>
<h2 id="terms-title"></h2>
<p id="terms-dateCreated"></p>
<samp id="terms-content" style="white-space: pre-line"></samp>
</div>
@Html.ValidationMessageFor(m => m.AcceptTerms, "", new { @class = "text-danger" })
|
mit
|
C#
|
63ebc31bf4fd73852cf594543ba01709ae1a9fb4
|
Allow coin flip to be heads.
|
mikaelssen/FruitBowlBot
|
JefBot/Commands/CoinPluginCommand.cs
|
JefBot/Commands/CoinPluginCommand.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using TwitchLib;
using TwitchLib.TwitchClientClasses;
using System.Net;
namespace JefBot.Commands
{
internal class CoinPluginCommand : IPluginCommand
{
public string PluginName => "Coin";
public string Command => "coin";
public IEnumerable<string> Aliases => new[] { "c", "flip" };
public bool Loaded { get; set; } = true;
public bool OffWhileLive { get; set; } = true;
Random rng = new Random();
public void Execute(ChatCommand command, TwitchClient client)
{
if (rng.Next(1000) > 1)
{
var result = rng.Next(0, 2) == 1 ? "heads" : "tails";
client.SendMessage(command.ChatMessage.Channel,
$"{command.ChatMessage.Username} flipped a coin, it was {result}");
}
else
{
client.SendMessage(command.ChatMessage.Channel,
$"{command.ChatMessage.Username} flipped a coin, it landed on it's side...");
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using TwitchLib;
using TwitchLib.TwitchClientClasses;
using System.Net;
namespace JefBot.Commands
{
internal class CoinPluginCommand : IPluginCommand
{
public string PluginName => "Coin";
public string Command => "coin";
public IEnumerable<string> Aliases => new[] { "c", "flip" };
public bool Loaded { get; set; } = true;
public bool OffWhileLive { get; set; } = true;
Random rng = new Random();
public void Execute(ChatCommand command, TwitchClient client)
{
if (rng.Next(1000) > 1)
{
var result = rng.Next(0, 1) == 1 ? "heads" : "tails";
client.SendMessage(command.ChatMessage.Channel,
$"{command.ChatMessage.Username} flipped a coin, it was {result}");
}
else
{
client.SendMessage(command.ChatMessage.Channel,
$"{command.ChatMessage.Username} flipped a coin, it landed on it's side...");
}
}
}
}
|
mit
|
C#
|
240fc5e1d77a717dba9da54e29ae4c66917793a6
|
Return exit code 1 if any acceptance tests fail
|
mattherman/MbDotNet,mattherman/MbDotNet
|
MbDotNet.Acceptance.Tests/Program.cs
|
MbDotNet.Acceptance.Tests/Program.cs
|
using System;
using MbDotNet;
using System.Collections.Generic;
namespace MbDotNet.Acceptance.Tests
{
public class Program
{
private static int _passed = 0;
private static int _failed = 0;
private static int _skipped = 0;
public static void Main()
{
var tests = new List<Type>
{
typeof(AcceptanceTests.CanNotGetImposterThatDoesNotExist),
typeof(AcceptanceTests.CanCreateAndGetHttpImposter),
typeof(AcceptanceTests.CanCreateAndGetHttpsImposter),
typeof(AcceptanceTests.CanCreateAndGetTcpImposter),
typeof(AcceptanceTests.CanDeleteImposter),
typeof(AcceptanceTests.CanVerifyCallsOnImposter),
typeof(AcceptanceTests.CanCreateAndGetHttpImposterWithNoPort)
};
var runner = new AcceptanceTestRunner(tests, OnTestPassing, OnTestFailing, OnTestSkipped);
runner.Execute();
Console.WriteLine("\nFINISHED {0} passed, {1} failed, {2} skipped", _passed, _failed, _skipped);
if (_failed > 0)
{
Environment.Exit(1);
}
}
public static void OnTestPassing(string testName, long elapsed)
{
Console.WriteLine("PASS {0} ({1}ms)", testName, elapsed);
_passed++;
}
public static void OnTestFailing(string testName, long elapsed, Exception ex)
{
Console.WriteLine("FAIL {0} ({1}ms)\n\t=> {2}", testName, elapsed, ex.Message);
_failed++;
}
public static void OnTestSkipped(string testName, string reason)
{
Console.WriteLine("SKIP {0} [{1}]", testName, reason);
_skipped++;
}
}
}
|
using System;
using MbDotNet;
using System.Collections.Generic;
namespace MbDotNet.Acceptance.Tests
{
public class Program
{
private static int _passed = 0;
private static int _failed = 0;
private static int _skipped = 0;
public static void Main()
{
var tests = new List<Type>
{
typeof(AcceptanceTests.CanNotGetImposterThatDoesNotExist),
typeof(AcceptanceTests.CanCreateAndGetHttpImposter),
typeof(AcceptanceTests.CanCreateAndGetHttpsImposter),
typeof(AcceptanceTests.CanCreateAndGetTcpImposter),
typeof(AcceptanceTests.CanDeleteImposter),
typeof(AcceptanceTests.CanVerifyCallsOnImposter),
typeof(AcceptanceTests.CanCreateAndGetHttpImposterWithNoPort)
};
var runner = new AcceptanceTestRunner(tests, OnTestPassing, OnTestFailing, OnTestSkipped);
runner.Execute();
Console.WriteLine("\nFINISHED {0} passed, {1} failed, {2} skipped", _passed, _failed, _skipped);
}
public static void OnTestPassing(string testName, long elapsed)
{
Console.WriteLine("PASS {0} ({1}ms)", testName, elapsed);
_passed++;
}
public static void OnTestFailing(string testName, long elapsed, Exception ex)
{
Console.WriteLine("FAIL {0} ({1}ms)\n\t=> {2}", testName, elapsed, ex.Message);
_failed++;
}
public static void OnTestSkipped(string testName, string reason)
{
Console.WriteLine("SKIP {0} [{1}]", testName, reason);
_skipped++;
}
}
}
|
mit
|
C#
|
0db035acb27534bd7478a8aed3c4318d844d3acc
|
Bump version
|
kamil-mrzyglod/Oxygenize
|
Oxygenize/Properties/AssemblyInfo.cs
|
Oxygenize/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("Oxygenize")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Oxygenize")]
[assembly: AssemblyCopyright("Copyright © Microsoft 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("78a5cd71-2e0f-47a3-b553-d7109704dfe5")]
// 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.5.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
[assembly: InternalsVisibleTo("Oxygenize.Test")]
|
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("Oxygenize")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Oxygenize")]
[assembly: AssemblyCopyright("Copyright © Microsoft 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("78a5cd71-2e0f-47a3-b553-d7109704dfe5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.4.0")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: InternalsVisibleTo("Oxygenize.Test")]
|
mit
|
C#
|
7ad2b13cbdf870ebc8a0b21502225d2506f8f2e5
|
fix execute sequence cancel code
|
rustamserg/mogate
|
mogate.Shared/Behaviors/Execute.cs
|
mogate.Shared/Behaviors/Execute.cs
|
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
namespace mogate
{
public interface IAction
{
bool Execute(GameTime gameTime);
};
public class Execute : IBehavior
{
public Type Behavior { get { return typeof(Execute); } }
private Dictionary<string, Queue<IAction>> m_actions = new Dictionary<string, Queue<IAction>>();
public void AddNew(IAction action, string tag = "")
{
Cancel (tag);
Add (action, tag);
}
public void Add(IAction action, string tag = "")
{
if (!m_actions.ContainsKey (tag))
m_actions [tag] = new Queue<IAction> ();
m_actions[tag].Enqueue(action);
}
public void Update(GameTime gameTime)
{
var tags = new List<string>(m_actions.Keys);
foreach (var tag in tags) {
Queue<IAction> q;
if (!m_actions.TryGetValue (tag, out q))
continue;
if (q.Count == 0)
continue;
if (q.Peek ().Execute (gameTime))
q.Dequeue ();
}
}
public void Cancel(string tag = "")
{
m_actions.Remove (tag);
}
}
}
|
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
namespace mogate
{
public interface IAction
{
bool Execute(GameTime gameTime);
};
public class Execute : IBehavior
{
public Type Behavior { get { return typeof(Execute); } }
private Dictionary<string, Queue<IAction>> m_actions = new Dictionary<string, Queue<IAction>>();
public void AddNew(IAction action, string tag = "")
{
Cancel (tag);
Add (action, tag);
}
public void Add(IAction action, string tag = "")
{
if (!m_actions.ContainsKey (tag))
m_actions [tag] = new Queue<IAction> ();
m_actions[tag].Enqueue(action);
}
public void Update(GameTime gameTime)
{
var tags = new List<string>(m_actions.Keys);
foreach (var tag in tags) {
var q = m_actions [tag];
if (q.Count == 0)
continue;
if (q.Peek ().Execute (gameTime))
q.Dequeue ();
}
}
public void Cancel(string tag = "")
{
m_actions.Remove (tag);
}
}
}
|
mit
|
C#
|
824d37b8d41993b12183793127f6c0a836ea698e
|
Fix XML docs typo
|
malikdiarra/Nancy,EliotJones/NancyTest,khellang/Nancy,sadiqhirani/Nancy,lijunle/Nancy,jonathanfoster/Nancy,daniellor/Nancy,jeff-pang/Nancy,AIexandr/Nancy,jeff-pang/Nancy,jonathanfoster/Nancy,grumpydev/Nancy,anton-gogolev/Nancy,Worthaboutapig/Nancy,sadiqhirani/Nancy,jonathanfoster/Nancy,NancyFx/Nancy,tareq-s/Nancy,damianh/Nancy,khellang/Nancy,albertjan/Nancy,horsdal/Nancy,rudygt/Nancy,charleypeng/Nancy,nicklv/Nancy,AcklenAvenue/Nancy,fly19890211/Nancy,ayoung/Nancy,xt0rted/Nancy,VQComms/Nancy,danbarua/Nancy,nicklv/Nancy,jeff-pang/Nancy,felipeleusin/Nancy,AcklenAvenue/Nancy,tareq-s/Nancy,grumpydev/Nancy,jmptrader/Nancy,charleypeng/Nancy,tparnell8/Nancy,jongleur1983/Nancy,tparnell8/Nancy,MetSystem/Nancy,EliotJones/NancyTest,jchannon/Nancy,davidallyoung/Nancy,tparnell8/Nancy,charleypeng/Nancy,charleypeng/Nancy,blairconrad/Nancy,nicklv/Nancy,asbjornu/Nancy,malikdiarra/Nancy,SaveTrees/Nancy,khellang/Nancy,davidallyoung/Nancy,AcklenAvenue/Nancy,phillip-haydon/Nancy,dbabox/Nancy,felipeleusin/Nancy,duszekmestre/Nancy,davidallyoung/Nancy,ccellar/Nancy,EliotJones/NancyTest,anton-gogolev/Nancy,rudygt/Nancy,SaveTrees/Nancy,Crisfole/Nancy,joebuschmann/Nancy,Worthaboutapig/Nancy,jongleur1983/Nancy,JoeStead/Nancy,VQComms/Nancy,EIrwin/Nancy,jchannon/Nancy,sloncho/Nancy,rudygt/Nancy,AlexPuiu/Nancy,xt0rted/Nancy,albertjan/Nancy,horsdal/Nancy,rudygt/Nancy,hitesh97/Nancy,sroylance/Nancy,AlexPuiu/Nancy,asbjornu/Nancy,thecodejunkie/Nancy,jchannon/Nancy,fly19890211/Nancy,tareq-s/Nancy,danbarua/Nancy,Worthaboutapig/Nancy,ccellar/Nancy,AlexPuiu/Nancy,tsdl2013/Nancy,cgourlay/Nancy,AIexandr/Nancy,anton-gogolev/Nancy,blairconrad/Nancy,phillip-haydon/Nancy,sroylance/Nancy,jmptrader/Nancy,VQComms/Nancy,murador/Nancy,ayoung/Nancy,dbabox/Nancy,vladlopes/Nancy,ccellar/Nancy,felipeleusin/Nancy,duszekmestre/Nancy,albertjan/Nancy,jmptrader/Nancy,Novakov/Nancy,VQComms/Nancy,sroylance/Nancy,guodf/Nancy,dbolkensteyn/Nancy,MetSystem/Nancy,asbjornu/Nancy,NancyFx/Nancy,daniellor/Nancy,NancyFx/Nancy,wtilton/Nancy,hitesh97/Nancy,blairconrad/Nancy,dbabox/Nancy,tparnell8/Nancy,thecodejunkie/Nancy,jchannon/Nancy,dbabox/Nancy,EIrwin/Nancy,jongleur1983/Nancy,murador/Nancy,jonathanfoster/Nancy,guodf/Nancy,tareq-s/Nancy,Novakov/Nancy,danbarua/Nancy,NancyFx/Nancy,jongleur1983/Nancy,sadiqhirani/Nancy,EIrwin/Nancy,sadiqhirani/Nancy,xt0rted/Nancy,malikdiarra/Nancy,AIexandr/Nancy,sloncho/Nancy,albertjan/Nancy,adamhathcock/Nancy,AcklenAvenue/Nancy,adamhathcock/Nancy,davidallyoung/Nancy,felipeleusin/Nancy,thecodejunkie/Nancy,murador/Nancy,adamhathcock/Nancy,SaveTrees/Nancy,tsdl2013/Nancy,sloncho/Nancy,danbarua/Nancy,ayoung/Nancy,phillip-haydon/Nancy,duszekmestre/Nancy,lijunle/Nancy,JoeStead/Nancy,lijunle/Nancy,phillip-haydon/Nancy,ccellar/Nancy,thecodejunkie/Nancy,SaveTrees/Nancy,malikdiarra/Nancy,murador/Nancy,cgourlay/Nancy,tsdl2013/Nancy,guodf/Nancy,daniellor/Nancy,EIrwin/Nancy,asbjornu/Nancy,davidallyoung/Nancy,duszekmestre/Nancy,lijunle/Nancy,VQComms/Nancy,cgourlay/Nancy,Worthaboutapig/Nancy,Novakov/Nancy,horsdal/Nancy,joebuschmann/Nancy,joebuschmann/Nancy,xt0rted/Nancy,tsdl2013/Nancy,dbolkensteyn/Nancy,fly19890211/Nancy,daniellor/Nancy,hitesh97/Nancy,guodf/Nancy,blairconrad/Nancy,JoeStead/Nancy,vladlopes/Nancy,AIexandr/Nancy,AlexPuiu/Nancy,AIexandr/Nancy,adamhathcock/Nancy,horsdal/Nancy,grumpydev/Nancy,cgourlay/Nancy,damianh/Nancy,wtilton/Nancy,sloncho/Nancy,grumpydev/Nancy,vladlopes/Nancy,MetSystem/Nancy,anton-gogolev/Nancy,wtilton/Nancy,fly19890211/Nancy,Novakov/Nancy,Crisfole/Nancy,MetSystem/Nancy,jchannon/Nancy,damianh/Nancy,jmptrader/Nancy,charleypeng/Nancy,asbjornu/Nancy,hitesh97/Nancy,wtilton/Nancy,ayoung/Nancy,khellang/Nancy,EliotJones/NancyTest,dbolkensteyn/Nancy,joebuschmann/Nancy,jeff-pang/Nancy,nicklv/Nancy,vladlopes/Nancy,Crisfole/Nancy,sroylance/Nancy,JoeStead/Nancy,dbolkensteyn/Nancy
|
src/Nancy/Json/JsonSettings.cs
|
src/Nancy/Json/JsonSettings.cs
|
namespace Nancy.Json
{
using System.Collections.Generic;
using Converters;
/// <summary>
/// Json serializer settings
/// </summary>
public static class JsonSettings
{
/// <summary>
/// Max length of json output
/// </summary>
public static int MaxJsonLength { get; set; }
/// <summary>
/// Maximum number of recursions
/// </summary>
public static int MaxRecursions { get; set; }
/// <summary>
/// Default charset for json responses.
/// </summary>
public static string DefaultCharset { get; set; }
public static IList<JavaScriptConverter> Converters { get; set; }
/// <summary>
/// Set to true to retain the casing used in the C# code in produced JSON.
/// Set to false to use camelCasing in the produced JSON.
/// False by default.
/// </summary>
public static bool RetainCasing { get; set; }
/// <summary>
/// Serialized date format
/// </summary>
public static bool ISO8601DateFormat { get; set; }
static JsonSettings()
{
ISO8601DateFormat = true;
MaxJsonLength = 102400;
MaxRecursions = 100;
DefaultCharset = "utf-8";
Converters = new List<JavaScriptConverter>
{
new TimeSpanConverter(),
};
RetainCasing = false;
}
}
}
|
namespace Nancy.Json
{
using System.Collections.Generic;
using Converters;
/// <summary>
/// Json serializer settings
/// </summary>
public static class JsonSettings
{
/// <summary>
/// Max length of json output
/// </summary>
public static int MaxJsonLength { get; set; }
/// <summary>
/// Maximum number of recursions
/// </summary>
public static int MaxRecursions { get; set; }
/// <summary>
/// Default charset for json responses.
/// </summary>
public static string DefaultCharset { get; set; }
public static IList<JavaScriptConverter> Converters { get; set; }
/// <summary>
/// Set to true to retain the casing used in the C# code in produced JSON.
/// Set to false to use camelCasig in the produced JSON.
/// False by default.
/// </summary>
public static bool RetainCasing { get; set; }
/// <summary>
/// Serialized date format
/// </summary>
public static bool ISO8601DateFormat { get; set; }
static JsonSettings()
{
ISO8601DateFormat = true;
MaxJsonLength = 102400;
MaxRecursions = 100;
DefaultCharset = "utf-8";
Converters = new List<JavaScriptConverter>
{
new TimeSpanConverter(),
};
RetainCasing = false;
}
}
}
|
mit
|
C#
|
848c6bb8fe2ad37279af3b013e9d9a96114a3f0e
|
fix an issue where crawl-delay parsin was depending on system culture's number styles
|
cosmaioan/robotstxt,jadiagaurang/robotstxt
|
RobotsTxt/Entities/CrawlDelayRule.cs
|
RobotsTxt/Entities/CrawlDelayRule.cs
|
using System;
using System.Globalization;
namespace RobotsTxt
{
internal class CrawlDelayRule : Rule
{
public long Delay { get; private set; } // milliseconds
public CrawlDelayRule(String userAgent, Line line, int order)
: base(userAgent, order)
{
double delay = 0;
Double.TryParse(line.Value, NumberStyles.Float, CultureInfo.InvariantCulture, out delay);
Delay = (long)(delay * 1000);
}
}
}
|
using System;
namespace RobotsTxt
{
internal class CrawlDelayRule : Rule
{
public long Delay { get; private set; } // milliseconds
public CrawlDelayRule(String userAgent, Line line, int order)
: base(userAgent, order)
{
double delay = 0;
Double.TryParse(line.Value, out delay);
Delay = (long)(delay * 1000);
}
}
}
|
mit
|
C#
|
59507589b54fa59cac2d43ac03f4916e385cf625
|
Fix Url formaating in JenkinsResource
|
projectkudu/SimpleWAWS,projectkudu/SimpleWAWS,projectkudu/TryAppService,projectkudu/TryAppService,projectkudu/SimpleWAWS,projectkudu/TryAppService,projectkudu/SimpleWAWS,projectkudu/TryAppService
|
SimpleWAWS/Models/JenkinsResource.cs
|
SimpleWAWS/Models/JenkinsResource.cs
|
using SimpleWAWS.Code;
using System;
using System.Collections.Generic;
using System.Globalization;
namespace SimpleWAWS.Models
{
public class JenkinsResource : BaseResource
{
private const string _csmIdTemplate = "/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Network/publicIPAddresses/TrialJenkinsVMPublicIP";
private string _ipAddress = String.Empty;
private string _hostName = String.Empty;
public JenkinsResource(string subscriptionId, string resourceGroupName, string ipAddress, Dictionary<string, string> dnsSettings)
: base(subscriptionId, resourceGroupName)
{
this._ipAddress = ipAddress;
this._hostName = dnsSettings?["fqdn"];
}
public override string CsmId
{
get
{
return string.Format(CultureInfo.InvariantCulture, _csmIdTemplate, SubscriptionId, ResourceGroupName);
}
}
public string JenkinsResourceUrl
{
get { return string.IsNullOrEmpty(_ipAddress)? string.Empty: string.Format($"http://{_ipAddress}:8080"); }
}
public string JenkinsDnsUrl
{
get { return string.IsNullOrEmpty(_hostName) ? string.Empty : string.Format($"http://{_hostName}:8080"); }
}
public string Location { get; set; }
public string IbizaUrl
{
get
{
return string.Concat("https://portal.azure.com/", SimpleSettings.TryTenantName, "#resource", CsmId);
}
}
}
}
|
using SimpleWAWS.Code;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
namespace SimpleWAWS.Models
{
public class JenkinsResource : BaseResource
{
private const string _csmIdTemplate = "/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Network/publicIPAddresses/TrialJenkinsVMPublicIP";
private string _ipAddress = String.Empty;
private string _hostName = String.Empty;
public JenkinsResource(string subscriptionId, string resourceGroupName, string ipAddress, Dictionary<string, string> dnsSettings)
: base(subscriptionId, resourceGroupName)
{
this._ipAddress = ipAddress;
this._hostName = dnsSettings?["fqdn"];
}
public override string CsmId
{
get
{
return string.Format(CultureInfo.InvariantCulture, _csmIdTemplate, SubscriptionId, ResourceGroupName);
}
}
public string JenkinsResourceUrl
{
get { return string.IsNullOrEmpty(_ipAddress)? string.Empty: string.Format($"http://{_ipAddress}:8080"); }
set { }
}
public string JenkinsDnsUrl
{
get { return string.IsNullOrEmpty(_hostName) ? string.Empty : string.Format($"{_hostName}:8080"); }
set { }
}
public string Location { get; set; }
public string IbizaUrl
{
get
{
return string.Concat("https://portal.azure.com/", SimpleSettings.TryTenantName, "#resource", CsmId);
}
}
}
}
|
apache-2.0
|
C#
|
4a1e8bbf06b0440ff88488ce4a1db2ab6222e735
|
Remove unused using statement
|
ppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,peppy/osu-framework,ppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework
|
osu.Framework/Graphics/Batches/QuadBatch.cs
|
osu.Framework/Graphics/Batches/QuadBatch.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics.OpenGL.Buffers;
using osu.Framework.Graphics.OpenGL.Vertices;
using osuTK.Graphics.ES30;
namespace osu.Framework.Graphics.Batches
{
public class QuadBatch<T> : VertexBatch<T>
where T : struct, IEquatable<T>, IVertex
{
public QuadBatch(int size, int maxBuffers)
: base(size, maxBuffers)
{
if (size > QuadVertexBuffer<T>.MAX_QUADS)
throw new OverflowException($"Attempted to initialise a {nameof(QuadVertexBuffer<T>)} with more than {nameof(QuadVertexBuffer<T>)}.{nameof(QuadVertexBuffer<T>.MAX_QUADS)} quads ({QuadVertexBuffer<T>.MAX_QUADS}).");
}
protected override VertexBuffer<T> CreateVertexBuffer() => new QuadVertexBuffer<T>(Size, BufferUsageHint.DynamicDraw);
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics.OpenGL.Buffers;
using osuTK.Graphics.ES30;
using osu.Framework.Graphics.OpenGL.Vertices;
using osu.Framework.Graphics.Primitives;
namespace osu.Framework.Graphics.Batches
{
public class QuadBatch<T> : VertexBatch<T>
where T : struct, IEquatable<T>, IVertex
{
public QuadBatch(int size, int maxBuffers)
: base(size, maxBuffers)
{
if (size > QuadVertexBuffer<T>.MAX_QUADS)
throw new OverflowException($"Attempted to initialise a {nameof(QuadVertexBuffer<T>)} with more than {nameof(QuadVertexBuffer<T>)}.{nameof(QuadVertexBuffer<T>.MAX_QUADS)} quads ({QuadVertexBuffer<T>.MAX_QUADS}).");
}
protected override VertexBuffer<T> CreateVertexBuffer() => new QuadVertexBuffer<T>(Size, BufferUsageHint.DynamicDraw);
}
}
|
mit
|
C#
|
70581f34bb1bf0a27dbf15512e34f5c76c36f2b2
|
build 7.1.16.0
|
agileharbor/channelAdvisorAccess
|
src/Global/GlobalAssemblyInfo.cs
|
src/Global/GlobalAssemblyInfo.cs
|
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[ assembly : ComVisible( false ) ]
[ assembly : AssemblyProduct( "ChannelAdvisorAccess" ) ]
[ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ]
[ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ]
[ assembly : AssemblyDescription( "ChannelAdvisor webservices API wrapper." ) ]
[ assembly : AssemblyTrademark( "" ) ]
[ assembly : AssemblyCulture( "" ) ]
[ assembly : CLSCompliant( false ) ]
// 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.*")]
// Keep in track with CA API version
[ assembly : AssemblyVersion( "7.1.17.0" ) ]
|
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[ assembly : ComVisible( false ) ]
[ assembly : AssemblyProduct( "ChannelAdvisorAccess" ) ]
[ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ]
[ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ]
[ assembly : AssemblyDescription( "ChannelAdvisor webservices API wrapper." ) ]
[ assembly : AssemblyTrademark( "" ) ]
[ assembly : AssemblyCulture( "" ) ]
[ assembly : CLSCompliant( false ) ]
// 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.*")]
// Keep in track with CA API version
[ assembly : AssemblyVersion( "7.1.16.0" ) ]
|
bsd-3-clause
|
C#
|
9f44e634a4995c611ab8d10e5aece9158b67d258
|
Allow visualtests to share config etc. with osu!.
|
nyaamara/osu,UselessToucan/osu,Damnae/osu,NeoAdonis/osu,NeoAdonis/osu,theguii/osu,Frontear/osuKyzer,smoogipoo/osu,RedNesto/osu,peppy/osu,peppy/osu-new,ppy/osu,UselessToucan/osu,peppy/osu,DrabWeb/osu,naoey/osu,smoogipoo/osu,osu-RP/osu-RP,NeoAdonis/osu,EVAST9919/osu,default0/osu,DrabWeb/osu,johnneijzen/osu,naoey/osu,ppy/osu,ZLima12/osu,smoogipooo/osu,peppy/osu,NotKyon/lolisu,naoey/osu,UselessToucan/osu,2yangk23/osu,2yangk23/osu,smoogipoo/osu,EVAST9919/osu,johnneijzen/osu,ppy/osu,tacchinotacchi/osu,Nabile-Rahmani/osu,ZLima12/osu,DrabWeb/osu,Drezi126/osu
|
osu.Desktop.VisualTests/Program.cs
|
osu.Desktop.VisualTests/Program.cs
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Desktop;
using osu.Framework.Desktop.Platform;
using osu.Framework.Platform;
using osu.Game.Modes;
using osu.Game.Modes.Catch;
using osu.Game.Modes.Mania;
using osu.Game.Modes.Osu;
using osu.Game.Modes.Taiko;
namespace osu.Desktop.VisualTests
{
public static class Program
{
[STAThread]
public static void Main(string[] args)
{
using (BasicGameHost host = Host.GetSuitableHost(@"osu"))
{
Ruleset.Register(new OsuRuleset());
Ruleset.Register(new TaikoRuleset());
Ruleset.Register(new ManiaRuleset());
Ruleset.Register(new CatchRuleset());
host.Add(new VisualTestGame());
host.Run();
}
}
}
}
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Desktop;
using osu.Framework.Desktop.Platform;
using osu.Framework.Platform;
using osu.Game.Modes;
using osu.Game.Modes.Catch;
using osu.Game.Modes.Mania;
using osu.Game.Modes.Osu;
using osu.Game.Modes.Taiko;
namespace osu.Desktop.VisualTests
{
public static class Program
{
[STAThread]
public static void Main(string[] args)
{
using (BasicGameHost host = Host.GetSuitableHost(@"osu-visual-tests"))
{
Ruleset.Register(new OsuRuleset());
Ruleset.Register(new TaikoRuleset());
Ruleset.Register(new ManiaRuleset());
Ruleset.Register(new CatchRuleset());
host.Add(new VisualTestGame());
host.Run();
}
}
}
}
|
mit
|
C#
|
3c552bfde81b4a0b4a5e8da8c2d5db17ceea472a
|
remove superfluous test content
|
icarus-consulting/Yaapii.Atoms
|
tests/Yaapii.Atoms.Tests/Text/SyncedTest.cs
|
tests/Yaapii.Atoms.Tests/Text/SyncedTest.cs
|
// MIT License
//
// Copyright(c) 2020 ICARUS Consulting GmbH
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
using System.Threading.Tasks;
using Xunit;
namespace Yaapii.Atoms.Text.Tests
{
public sealed class SyncedTest
{
[Fact]
public void WorksInMultipleThreads()
{
var check = 0;
var text = new Synced(
new LiveText(
() => new TextOf(check++).AsString()
)
);
var max = Environment.ProcessorCount << 8;
Parallel.For(0, max, (nr) => text.AsString());
Assert.Equal(
max, check
);
}
}
}
|
// MIT License
//
// Copyright(c) 2020 ICARUS Consulting GmbH
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
using System.Threading.Tasks;
using Xunit;
namespace Yaapii.Atoms.Text.Tests
{
public sealed class SyncedTest
{
[Fact]
public void WorksInMultipleThreads()
{
var check = 0;
var text = new Synced(
new LiveText(
() => new TextOf(check++).AsString()
)
);
var max = Environment.ProcessorCount << 8;
Parallel.For(0, max, (nr) => text.AsString());
Assert.Equal(
max, check
);
Assert.True(
new Lower(
new LiveText("HelLo!")
).AsString() == "hello!"
);
}
}
}
|
mit
|
C#
|
094bb7058c754b885fe2348108cc7a61bfc2b3cb
|
Add rich text to system field types
|
contentful/contentful.net
|
Contentful.Core/Models/Management/SystemFieldTypes.cs
|
Contentful.Core/Models/Management/SystemFieldTypes.cs
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Contentful.Core.Models.Management
{
/// <summary>
/// Represents the different types available for a <see cref="Field"/>.
/// </summary>
public class SystemFieldTypes
{
/// <summary>
/// Short text.
/// </summary>
public const string Symbol = "Symbol";
/// <summary>
/// Long text.
/// </summary>
public const string Text = "Text";
/// <summary>
/// An integer.
/// </summary>
public const string Integer = "Integer";
/// <summary>
/// A floating point number.
/// </summary>
public const string Number = "Number";
/// <summary>
/// A datetime.
/// </summary>
public const string Date = "Date";
/// <summary>
/// A boolean value.
/// </summary>
public const string Boolean = "Boolean";
/// <summary>
/// A location field.
/// </summary>
public const string Location = "Location";
/// <summary>
/// A link to another asset or entry.
/// </summary>
public const string Link = "Link";
/// <summary>
/// An array of objects.
/// </summary>
public const string Array = "Array";
/// <summary>
/// An arbitrary json object.
/// </summary>
public const string Object = "Object";
/// <summary>
/// An rich text document.
/// </summary>
public const string RichText = "RichText";
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Contentful.Core.Models.Management
{
/// <summary>
/// Represents the different types available for a <see cref="Field"/>.
/// </summary>
public class SystemFieldTypes
{
/// <summary>
/// Short text.
/// </summary>
public const string Symbol = "Symbol";
/// <summary>
/// Long text.
/// </summary>
public const string Text = "Text";
/// <summary>
/// An integer.
/// </summary>
public const string Integer = "Integer";
/// <summary>
/// A floating point number.
/// </summary>
public const string Number = "Number";
/// <summary>
/// A datetime.
/// </summary>
public const string Date = "Date";
/// <summary>
/// A boolean value.
/// </summary>
public const string Boolean = "Boolean";
/// <summary>
/// A location field.
/// </summary>
public const string Location = "Location";
/// <summary>
/// A link to another asset or entry.
/// </summary>
public const string Link = "Link";
/// <summary>
/// An array of objects.
/// </summary>
public const string Array = "Array";
/// <summary>
/// An arbitrary json object.
/// </summary>
public const string Object = "Object";
}
}
|
mit
|
C#
|
84cf738551bb3550962599204bcb46cc56a33b83
|
Update ISession.cs
|
jpdante/HTCSharp
|
Modules/HtcSharp.HttpModule/Http.Features/ISession.cs
|
Modules/HtcSharp.HttpModule/Http.Features/ISession.cs
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace HtcSharp.HttpModule.Http.Features {
// SourceTools-Start
// Remote-File C:\ASP\src\Http\Http.Features\src\ISession.cs
// Start-At-Remote-Line 9
// Ignore-Local-Line-Range 27-72
// SourceTools-End
public interface ISession {
/// <summary>
/// Indicate whether the current session has loaded.
/// </summary>
bool IsAvailable { get; }
/// <summary>
/// A unique identifier for the current session. This is not the same as the session cookie
/// since the cookie lifetime may not be the same as the session entry lifetime in the data store.
/// </summary>
string Id { get; }
/// <summary>
/// Load the session from the data store. This may throw if the data store is unavailable.
/// </summary>
/// <returns></returns>
Task LoadAsync(CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Store the session in the data store. This may throw if the data store is unavailable.
/// </summary>
/// <returns></returns>
Task CreateAsync(CancellationToken cancellationToken = default(CancellationToken));
}
}
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace HtcSharp.HttpModule.Http.Features {
// SourceTools-Start
// Remote-File C:\ASP\src\Http\Http.Features\src\ISession.cs
// Start-At-Remote-Line 9
// Ignore-Local-Line-Range 27-72
// SourceTools-End
public interface ISession {
/// <summary>
/// Indicate whether the current session has loaded.
/// </summary>
bool IsAvailable { get; }
/// <summary>
/// A unique identifier for the current session. This is not the same as the session cookie
/// since the cookie lifetime may not be the same as the session entry lifetime in the data store.
/// </summary>
string Id { get; }
/// <summary>
/// Load the session from the data store. This may throw if the data store is unavailable.
/// </summary>
/// <returns></returns>
Task LoadAsync(CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Store the session in the data store. This may throw if the data store is unavailable.
/// </summary>
/// <returns></returns>
Task CommitAsync(CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Retrieve the value of the given key, if present.
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
/// <returns></returns>
bool TryGetValue<T>(string key, out T value);
/// <summary>
/// Set the given key and value in the current session. This will throw if the session
/// was not established prior to sending the response.
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
void Set<T>(string key, T value);
/// <summary>
/// Set the given key and value in the current session. This will throw if the session
/// was not established prior to sending the response.
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
/// <param name="expireSpan"></param>
void Set<T>(string key, T value, TimeSpan expireSpan);
/// <summary>
/// Remove the given key from the session if present.
/// </summary>
/// <param name="key"></param>
void Remove(string key);
/// <summary>
/// Remove all entries from the current session, if any.
/// The session cookie is not removed.
/// </summary>
void Clear();
}
}
|
mit
|
C#
|
46e36eee65011caaf5feb338a7a080ca02d945e3
|
Update ConfigurationSource.cs
|
WojcikMike/docs.particular.net
|
Snippets/Snippets_5/Forwarding/ConfigurationSource.cs
|
Snippets/Snippets_5/Forwarding/ConfigurationSource.cs
|
namespace Snippets5.Forwarding
{
using System.Configuration;
using NServiceBus.Config;
using NServiceBus.Config.ConfigurationSource;
#region ConfigurationSourceForMessageForwarding
public class ConfigurationSource : IConfigurationSource
{
public T GetConfiguration<T>() where T : class, new()
{
//To Provide UnicastBusConfig
if (typeof(T) == typeof(UnicastBusConfig))
{
UnicastBusConfig forwardingConfig = new UnicastBusConfig
{
ForwardReceivedMessagesTo = "destinationQueue@machine"
};
return forwardingConfig as T;
}
// To in app.config for other sections not defined in this method, otherwise return null.
return ConfigurationManager.GetSection(typeof(T).Name) as T;
}
}
#endregion
}
|
namespace Snippets5.Forwarding
{
using System.Configuration;
using NServiceBus.Config;
using NServiceBus.Config.ConfigurationSource;
#region ConfigurationSourceForMessageForwarding
public class ConfigurationSource : IConfigurationSource
{
public T GetConfiguration<T>() where T : class, new()
{
//To Provide FLR Config
if (typeof(T) == typeof(UnicastBusConfig))
{
UnicastBusConfig forwardingConfig = new UnicastBusConfig
{
ForwardReceivedMessagesTo = "destinationQueue@machine"
};
return forwardingConfig as T;
}
// To in app.config for other sections not defined in this method, otherwise return null.
return ConfigurationManager.GetSection(typeof(T).Name) as T;
}
}
#endregion
}
|
apache-2.0
|
C#
|
d8728b2db4f874293c0375857cf613acaee574bf
|
Remove unused options.
|
mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,mono/Embeddinator-4000
|
binder/Options.cs
|
binder/Options.cs
|
using CppSharp.Generators;
namespace MonoEmbeddinator4000
{
public class Options
{
public Options()
{
Project = new Project();
GenerateSupportFiles = true;
}
public Project Project;
// Generator options
public string LibraryName;
public GeneratorKind Language;
public TargetPlatform Platform;
public string OutputNamespace;
public string OutputDir;
// If true, will force the generation of debug metadata for the native
// and managed code.
public bool DebugMode;
// If true, will use unmanaged->managed thunks to call managed methods.
// In this mode the JIT will generate specialized wrappers for marshaling
// which will be faster but also lead to higher memory consumption.
public bool UseUnmanagedThunks;
// If true, will generate support files alongside generated binding code.
public bool GenerateSupportFiles;
// If true, will try to compile the generated managed-to-native binding code.
public bool CompileCode;
// If true, will compile the generated as a shared library / DLL.
public bool CompileSharedLibrary;
}
}
|
using CppSharp.Generators;
namespace MonoEmbeddinator4000
{
public class Options
{
public Options()
{
Project = new Project();
GenerateSupportFiles = true;
}
public Project Project;
// General options
public bool ShowHelpText;
public bool OutputDebug;
// Parser options
public bool IgnoreParseErrors;
// Generator options
public string LibraryName;
public GeneratorKind Language;
public TargetPlatform Platform;
public string OutputNamespace;
public string OutputDir;
// If true, will force the generation of debug metadata for the native
// and managed code.
public bool DebugMode;
// If true, will use unmanaged->managed thunks to call managed methods.
// In this mode the JIT will generate specialized wrappers for marshaling
// which will be faster but also lead to higher memory consumption.
public bool UseUnmanagedThunks;
// If true, will generate support files alongside generated binding code.
public bool GenerateSupportFiles;
// If true, will try to compile the generated managed-to-native binding code.
public bool CompileCode;
// If true, will compile the generated as a shared library / DLL.
public bool CompileSharedLibrary;
}
}
|
mit
|
C#
|
c4ed91688e2ddb930acedd356637100af64a0c90
|
Add recursive insertion sort.
|
scott-fleischman/algorithms-csharp
|
src/Algorithms.Collections/InsertionSort.cs
|
src/Algorithms.Collections/InsertionSort.cs
|
using System.Collections.Generic;
namespace Algorithms.Collections
{
public sealed class InsertionSort : IListSortAlgorithm
{
// Ch 2.1, p.18
public void SortByAlgorithm<T>(IList<T> list, IComparer<T> comparer)
{
if (list.Count < 2)
return;
for (int currentIndex = 1; currentIndex < list.Count; currentIndex++)
{
T currentItem = list[currentIndex];
int insertIndex = currentIndex - 1;
while (insertIndex >= 0 && comparer.Compare(list[insertIndex], currentItem) > 0)
{
list[insertIndex + 1] = list[insertIndex];
insertIndex--;
}
list[insertIndex + 1] = currentItem;
}
}
// Ex 2.3-4
public static void SortRecursiveInPlace<T>(IList<T> list, IComparer<T> comparer)
{
SortRecursiveInPlace(list, list.Count - 1, comparer);
}
private static void SortRecursiveInPlace<T>(IList<T> list, int index, IComparer<T> comparer)
{
if (index <= 1)
return;
SortRecursiveInPlace(list, index - 1, comparer);
T value = list[index];
list.RemoveAt(index);
int insertionIndex = FindInsertionIndex(list, index, value, comparer);
list.Insert(insertionIndex, value);
}
private static int FindInsertionIndex<T>(IList<T> list, int startIndex, T value, IComparer<T> comparer)
{
for (int index = startIndex - 1; index > 0; index--)
{
if (comparer.Compare(list[index], value) <= 0)
return index;
}
return 0;
}
}
}
|
using System.Collections.Generic;
namespace Algorithms.Collections
{
public sealed class InsertionSort : IListSortAlgorithm
{
// Ch 2.1, p.18
public void SortByAlgorithm<T>(IList<T> list, IComparer<T> comparer)
{
if (list.Count < 2)
return;
for (int currentIndex = 1; currentIndex < list.Count; currentIndex++)
{
T currentItem = list[currentIndex];
int insertIndex = currentIndex - 1;
while (insertIndex >= 0 && comparer.Compare(list[insertIndex], currentItem) > 0)
{
list[insertIndex + 1] = list[insertIndex];
insertIndex--;
}
list[insertIndex + 1] = currentItem;
}
}
}
}
|
mit
|
C#
|
2c6af588d8645b0b5b35d0701972c6767b222066
|
Update author information: Evgeny Zborovsky. (#532)
|
planetxamarin/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin
|
src/Firehose.Web/Authors/EvgenyZborovsky.cs
|
src/Firehose.Web/Authors/EvgenyZborovsky.cs
|
using System;
using System.Collections.Generic;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class EvgenyZborovsky : IAmAMicrosoftMVP
{
public string FirstName => "Evgeny";
public string LastName => "Zborovsky";
public string StateOrRegion => "Estonia";
public string EmailAddress => "yuv4ik@gmail.com";
public string ShortBioOrTagLine => "blogs, speaks, helps others and is enthusiastic Xamarin developer.";
public Uri WebSite => new Uri("https://smellyc0de.wordpress.com/");
public IEnumerable<Uri> FeedUris
{
get
{
yield return new Uri("https://smellyc0de.wordpress.com/tag/xamarin-forms/feed/");
yield return new Uri("https://smellyc0de.wordpress.com/tag/xamarin/feed/");
}
}
public string TwitterHandle => "ezborovsky";
public string GravatarHash => "b8a0ab8445fafb38afdf26cb976df32f";
public string GitHubHandle => "yuv4ik";
public GeoPosition Position => new GeoPosition(58.3750372, 26.6625567);
public string FeedLanguageCode => "en";
}
}
|
using System;
using System.Collections.Generic;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class EvgenyZborovsky : IAmACommunityMember
{
public string FirstName => "Evgeny";
public string LastName => "Zborovsky";
public string StateOrRegion => "Estonia";
public string EmailAddress => "yuv4ik@gmail.com";
public string ShortBioOrTagLine => "Xamarin Enthusiast";
public Uri WebSite => new Uri("https://smellyc0de.wordpress.com/");
public IEnumerable<Uri> FeedUris
{
get
{
yield return new Uri("https://smellyc0de.wordpress.com/tag/xamarin-forms/feed/");
yield return new Uri("https://smellyc0de.wordpress.com/tag/xamarin/feed/");
}
}
public string TwitterHandle => "ezborovsky";
public string GravatarHash => "b8a0ab8445fafb38afdf26cb976df32f";
public string GitHubHandle => "yuv4ik";
public GeoPosition Position => new GeoPosition(58.3750372, 26.6625567);
public string FeedLanguageCode => "en";
}
}
|
mit
|
C#
|
09feb13c280c3aeb7ac4485ef4a3f66e7eaac3dd
|
Rename Map to FlatMap
|
beardgame/utilities
|
src/Core/Maybe.cs
|
src/Core/Maybe.cs
|
using System;
namespace Bearded.Utilities
{
public struct Maybe<T>
{
private bool hasValue;
private T value;
private Maybe(T value)
{
hasValue = true;
this.value = value;
}
public static Maybe<T> Nothing() => new Maybe<T>();
public static Maybe<T> Just(T value) => new Maybe<T>(value);
public T OrElse(T @default) => hasValue ? value : @default;
public T OrThrow(Func<Exception> exceptionProvider) => hasValue ? value : throw exceptionProvider();
public Maybe<TOut> Map<TOut>(Func<T, TOut> map) =>
hasValue ? new Maybe<TOut>(map(value)) : Maybe<TOut>.Nothing();
public Maybe<TOut> FlatMap<TOut>(Func<T, Maybe<TOut>> map) => hasValue ? map(value) : Maybe<TOut>.Nothing();
}
}
|
using System;
namespace Bearded.Utilities
{
public struct Maybe<T>
{
private bool hasValue;
private T value;
private Maybe(T value)
{
hasValue = true;
this.value = value;
}
public static Maybe<T> Nothing() => new Maybe<T>();
public static Maybe<T> Just(T value) => new Maybe<T>(value);
public T OrElse(T @default) => hasValue ? value : @default;
public T OrThrow(Func<Exception> exceptionProvider) => hasValue ? value : throw exceptionProvider();
public Maybe<TOut> Map<TOut>(Func<T, TOut> map) =>
hasValue ? new Maybe<TOut>(map(value)) : Maybe<TOut>.Nothing();
public Maybe<TOut> Map<TOut>(Func<T, Maybe<TOut>> map) => hasValue ? map(value) : Maybe<TOut>.Nothing();
}
}
|
mit
|
C#
|
fc07fc281b6b049dbdc5726327ae4fb94de364f9
|
test 4 resolving named dependencies in GetAll
|
JonasSamuelsson/Maestro
|
Maestro.Tests/resolve_enumerable.cs
|
Maestro.Tests/resolve_enumerable.cs
|
using FluentAssertions;
using System.Linq;
using Xunit;
namespace Maestro.Tests
{
public class resolve_enumerable
{
[Fact]
public void should_get_empty_enumerable_if_type_is_not_registered()
{
var enumerable = new Container().GetAll<object>();
enumerable.Should().BeEmpty();
}
[Fact]
public void should_try_to_get_dependencies_with_same_name_as_top_instance()
{
var @defaultDependency = "default";
var namedDependency = "named";
var name = "yada yada";
var container = new Container(x =>
{
x.Add<Foo>().As<Foo>();
x.Add<Foo>(name).As<Foo>();
x.Default<object>().Is(@defaultDependency);
x.Add<object>(name).As(namedDependency);
});
var foos = container.GetAll<Foo>().ToList();
foos.Should().Contain(x => x.Object == defaultDependency);
foos.Should().Contain(x => x.Object == namedDependency);
}
private class Foo
{
public Foo(object o)
{
Object = o;
}
public object Object { get; private set; }
}
}
}
|
using FluentAssertions;
using Xunit;
namespace Maestro.Tests
{
public class resolve_enumerable
{
[Fact]
public void should_get_empty_enumerable_if_type_is_not_registered()
{
var enumerable = new Container().GetAll<object>();
enumerable.Should().BeEmpty();
}
}
}
|
mit
|
C#
|
055ae262c3560216d99930d82bbcf0f92a6b61b5
|
fix error message
|
busterwood/Data
|
csv/Rename.cs
|
csv/Rename.cs
|
using BusterWood.Data;
using BusterWood.Data.Shared;
using System;
using System.Collections.Generic;
namespace BusterWood.Csv
{
class Rename
{
public static void Run(List<string> args)
{
try
{
if (args.Remove("--help")) Help();
var all = args.Remove("--all");
DataSequence input = Args.GetDataSequence(args);
if (args.Count % 2 != 0)
throw new Exception("You must supply at pairs of paremters: old new [old new...]");
var changes = Changes(args);
var result = all ? input.RenameAll(changes) : input.Rename(changes);
Console.WriteLine(result.Schema.ToCsv());
foreach (var row in result)
Console.WriteLine(row.ToCsv());
}
catch (Exception ex)
{
StdErr.Warning(ex.Message);
Help();
}
}
private static Dictionary<string, string> Changes(List<string> args)
{
var changes = new Dictionary<string, string>(Column.NameEquality);
for (int i = 0; i < args.Count; i += 2)
changes.Add(args[i], args[i + 1]);
return changes;
}
static void Help()
{
Console.Error.WriteLine($"csv rename [--in file] [old new...]");
Console.Error.WriteLine($"Outputs the input CSV chaning the name of one or more columns.");
Console.Error.WriteLine($"\t--all do NOT remove duplicates from the result");
Console.Error.WriteLine($"\t--in read the input from a file path (rather than standard input)");
Programs.Exit(1);
}
}
}
|
using BusterWood.Data;
using BusterWood.Data.Shared;
using System;
using System.Collections.Generic;
namespace BusterWood.Csv
{
class Rename
{
public static void Run(List<string> args)
{
try
{
if (args.Remove("--help")) Help();
var all = args.Remove("--all");
DataSequence input = Args.GetDataSequence(args);
if (args.Count % 2 != 0)
throw new Exception("You must supply at pairs of paremters: column value [column value...]");
var changes = Changes(args);
var result = all ? input.RenameAll(changes) : input.Rename(changes);
Console.WriteLine(result.Schema.ToCsv());
foreach (var row in result)
Console.WriteLine(row.ToCsv());
}
catch (Exception ex)
{
StdErr.Warning(ex.Message);
Help();
}
}
private static Dictionary<string, string> Changes(List<string> args)
{
var changes = new Dictionary<string, string>(Column.NameEquality);
for (int i = 0; i < args.Count; i += 2)
changes.Add(args[i], args[i + 1]);
return changes;
}
static void Help()
{
Console.Error.WriteLine($"csv rename [--in file] [old new...]");
Console.Error.WriteLine($"Outputs the input CSV chaning the name of one or more columns.");
Console.Error.WriteLine($"\t--all do NOT remove duplicates from the result");
Console.Error.WriteLine($"\t--in read the input from a file path (rather than standard input)");
Programs.Exit(1);
}
}
}
|
apache-2.0
|
C#
|
eff29b2e085e0999b7ce197dd556f548fde86ef0
|
Update AssemblyInfo.cs
|
ngocnicholas/airtable.net
|
AirtableApiClient/Properties/AssemblyInfo.cs
|
AirtableApiClient/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("AirtableApiClient")]
[assembly: AssemblyDescription("AirtableApiClient is the C-Sharp client of the public APIs of Airtable. It facilitates the usage of Airtable APIs without having to worry about interfacing with raw HTTP.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AirtableApiClient")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[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("be6d5110-124c-446d-be50-3fffd197f8dc")]
// 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.1.1")]
[assembly: AssemblyFileVersion("1.1.1")]
[assembly: InternalsVisibleTo("AirtableApiClient.Tests")]
|
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("AirtableApiClient")]
[assembly: AssemblyDescription("AirtableApiClient is the C-Sharp client of the public APIs of Airtable. It facilitates the usage of Airtable APIs without having to worry about interfacing with raw HTTP.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AirtableApiClient")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[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("be6d5110-124c-446d-be50-3fffd197f8dc")]
// 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.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]
[assembly: InternalsVisibleTo("AirtableApiClient.Tests")]
|
mit
|
C#
|
82d159fb5e5710f81bca107b7a9beeed275c79b0
|
Remove settings hiding
|
adjust/unity_sdk,adjust/unity_sdk,adjust/unity_sdk
|
Assets/Adjust/Editor/AdjustSettingsEditor.cs
|
Assets/Adjust/Editor/AdjustSettingsEditor.cs
|
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace com.adjust.sdk
{
[CustomEditor(typeof(AdjustSettings))]
public class AdjustSettingsEditor : Editor
{
SerializedProperty isPostProcessingEnabled;
SerializedProperty isiOS14ProcessingEnabled;
SerializedProperty iOSUserTrackingUsageDescription;
SerializedProperty iOSUrlSchemes;
SerializedProperty iOSUniversalLinksDomains;
SerializedProperty androidUriSchemes;
void OnEnable()
{
isPostProcessingEnabled = serializedObject.FindProperty("isPostProcessingEnabled");
isiOS14ProcessingEnabled = serializedObject.FindProperty("isiOS14ProcessingEnabled");
iOSUserTrackingUsageDescription = serializedObject.FindProperty("_iOSUserTrackingUsageDescription");
iOSUrlSchemes = serializedObject.FindProperty("_iOSUrlSchemes");
iOSUniversalLinksDomains = serializedObject.FindProperty("_iOSUniversalLinksDomains");
androidUriSchemes = serializedObject.FindProperty("androidUriSchemes");
}
public override void OnInspectorGUI()
{
EditorGUILayout.PropertyField(isPostProcessingEnabled);
if (isPostProcessingEnabled.boolValue)
{
EditorGUILayout.PropertyField(isiOS14ProcessingEnabled, new GUIContent("Is iOS 14 Processing Enabled"));
EditorGUILayout.PropertyField(iOSUserTrackingUsageDescription, new GUIContent("iOS User Tracking Usage Description"));
EditorGUILayout.Space();
EditorGUILayout.LabelField("DEEP LINKING:", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(iOSUrlSchemes, new GUIContent("iOS URL Schemes"), true);
EditorGUILayout.PropertyField(iOSUniversalLinksDomains, new GUIContent("iOS Universal Links Domains"), true);
EditorGUILayout.PropertyField(androidUriSchemes, new GUIContent("Android URI Schemes"), true);
EditorGUILayout.HelpBox(
"Please note that Adjust SDK doesn't remove existing URI Schemes, " +
"so if you need to clean previously added entries, " +
"you need to do it manually from \"Assets/Plugins/Android/AndroidManifest.xml\"", MessageType.Info, true);
}
serializedObject.ApplyModifiedProperties();
}
}
}
|
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace com.adjust.sdk
{
[CustomEditor(typeof(AdjustSettings))]
public class AdjustSettingsEditor : Editor
{
SerializedProperty isPostProcessingEnabled;
#if UNITY_IOS
SerializedProperty isiOS14ProcessingEnabled;
SerializedProperty iOSUserTrackingUsageDescription;
SerializedProperty iOSUrlSchemes;
SerializedProperty iOSUniversalLinksDomains;
#elif UNITY_ANDROID
SerializedProperty androidUriSchemes;
#endif
void OnEnable()
{
isPostProcessingEnabled = serializedObject.FindProperty("isPostProcessingEnabled");
#if UNITY_IOS
isiOS14ProcessingEnabled = serializedObject.FindProperty("isiOS14ProcessingEnabled");
iOSUserTrackingUsageDescription = serializedObject.FindProperty("_iOSUserTrackingUsageDescription");
iOSUrlSchemes = serializedObject.FindProperty("_iOSUrlSchemes");
iOSUniversalLinksDomains = serializedObject.FindProperty("_iOSUniversalLinksDomains");
#elif UNITY_ANDROID
androidUriSchemes = serializedObject.FindProperty("androidUriSchemes");
#endif
}
public override void OnInspectorGUI()
{
EditorGUILayout.PropertyField(isPostProcessingEnabled);
if (isPostProcessingEnabled.boolValue)
{
#if UNITY_IOS
EditorGUILayout.PropertyField(isiOS14ProcessingEnabled, new GUIContent("Is iOS 14 Processing Enabled"));
EditorGUILayout.PropertyField(iOSUserTrackingUsageDescription, new GUIContent("User Tracking Usage Description"));
#endif
EditorGUILayout.Space();
EditorGUILayout.LabelField("DEEP LINKING:", EditorStyles.boldLabel);
#if UNITY_IOS
EditorGUILayout.PropertyField(iOSUrlSchemes, new GUIContent("URL Schemes"), true);
EditorGUILayout.PropertyField(iOSUniversalLinksDomains, new GUIContent("Universal Links Domains"), true);
#elif UNITY_ANDROID
EditorGUILayout.PropertyField(androidUriSchemes, new GUIContent("URI Schemes"), true);
EditorGUILayout.HelpBox(
"Please note that Adjust SDK doesn't remove existing URI Schemes, " +
"so if you need to clean previously added entries, " +
"you need to do it manually from \"Assets/Plugins/Android/AndroidManifest.xml\"", MessageType.Info, true);
#endif
}
serializedObject.ApplyModifiedProperties();
}
}
}
|
mit
|
C#
|
5366e7dd5e6e780ed2096fd6f4944d38e90689ff
|
Add stub for APFT list
|
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
|
Battery-Commander.Web/Views/APFT/List.cshtml
|
Battery-Commander.Web/Views/APFT/List.cshtml
|
@model IEnumerable<APFT>
<h2>Units @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h2>
<table class="table table-striped">
<thead>
<tr>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var model in Model)
{
<tr>
<td>@Html.DisplayFor(_ => model.Soldier)</td>
<td>@Html.DisplayFor(_ => model.Date)</td>
<td>@Html.DisplayFor(_ => model.PushUps)</td>
<td>@Html.DisplayFor(_ => model.SitUps)</td>
<td>@Html.DisplayFor(_ => model.Run)</td>
<td>@Html.DisplayFor(_ => model.TotalScore)</td>
<td>@Html.DisplayFor(_ => model.IsPassing)</td>
</tr>
}
</tbody>
</table>
|
@model IEnumerable<APFT>
<h2>Units @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h2>
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var model in Model)
{
<tr>
<td></td>
</tr>
}
</tbody>
</table>
|
mit
|
C#
|
2f0ec764028a7791c42ec22a370a12a95017f830
|
Update CreatingListObject.cs
|
aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET
|
Examples/CSharp/Tables/CreatingListObject.cs
|
Examples/CSharp/Tables/CreatingListObject.cs
|
using System.IO;
using Aspose.Cells;
namespace Aspose.Cells.Examples.Tables
{
public class CreatingListObject
{
public static void Main(string[] args)
{
//ExStart:1
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//Create a Workbook object.
//Open a template excel file.
Workbook workbook = new Workbook(dataDir + "book1.xls");
//Get the List objects collection in the first worksheet.
Aspose.Cells.Tables.ListObjectCollection listObjects = workbook.Worksheets[0].ListObjects;
//Add a List based on the data source range with headers on.
listObjects.Add(1, 1, 7, 5, true);
//Show the total row for the List.
listObjects[0].ShowTotals = true;
//Calculate the total of the last (5th ) list column.
listObjects[0].ListColumns[4].TotalsCalculation = Aspose.Cells.Tables.TotalsCalculation.Sum;
//Save the excel file.
workbook.Save(dataDir + "ouput.out.xls");
//ExEnd:1
}
}
}
|
using System.IO;
using Aspose.Cells;
namespace Aspose.Cells.Examples.Tables
{
public class CreatingListObject
{
public static void Main(string[] args)
{
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//Create a Workbook object.
//Open a template excel file.
Workbook workbook = new Workbook(dataDir + "book1.xls");
//Get the List objects collection in the first worksheet.
Aspose.Cells.Tables.ListObjectCollection listObjects = workbook.Worksheets[0].ListObjects;
//Add a List based on the data source range with headers on.
listObjects.Add(1, 1, 7, 5, true);
//Show the total row for the List.
listObjects[0].ShowTotals = true;
//Calculate the total of the last (5th ) list column.
listObjects[0].ListColumns[4].TotalsCalculation = Aspose.Cells.Tables.TotalsCalculation.Sum;
//Save the excel file.
workbook.Save(dataDir + "ouput.out.xls");
}
}
}
|
mit
|
C#
|
93131b43953231617ac5ea50123e4a26a3437dd0
|
Fix incorrect profiler environment variable name for .NET framework support
|
MindscapeHQ/raygun4net,MindscapeHQ/raygun4net,MindscapeHQ/raygun4net
|
Mindscape.Raygun4Net/ProfilingSupport/APM.cs
|
Mindscape.Raygun4Net/ProfilingSupport/APM.cs
|
using System;
using System.Runtime.CompilerServices;
namespace Mindscape.Raygun4Net
{
public static class APM
{
[ThreadStatic]
private static bool _enabled = false;
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
public static void Enable()
{
_enabled = true;
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
public static void Disable()
{
_enabled = false;
}
public static bool IsEnabled
{
get { return _enabled; }
}
public static bool ProfilerAttached
{
get
{
#if NETSTANDARD1_6 || NETSTANDARD2_0
// Look for .NET CORE compatible Environment Variables
return
Environment.GetEnvironmentVariable("CORECLR_PROFILER") == "{e2338988-38cc-48cd-a6b6-b441c31f34f1}" &&
Environment.GetEnvironmentVariable("CORECLR_ENABLE_PROFILING") == "1";
#else
// Look for .NET FRAMEWORK compatible Environment Variables
return
Environment.GetEnvironmentVariable("COR_PROFILER") == "{e2338988-38cc-48cd-a6b6-b441c31f34f1}" &&
Environment.GetEnvironmentVariable("COR_ENABLE_PROFILING") == "1";
#endif
}
}
}
}
|
using System;
using System.Runtime.CompilerServices;
namespace Mindscape.Raygun4Net
{
public static class APM
{
[ThreadStatic]
private static bool _enabled = false;
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
public static void Enable()
{
_enabled = true;
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
public static void Disable()
{
_enabled = false;
}
public static bool IsEnabled
{
get { return _enabled; }
}
public static bool ProfilerAttached
{
get
{
#if NETSTANDARD1_6 || NETSTANDARD2_0
// Look for .NET CORE compatible Environment Variables
return
Environment.GetEnvironmentVariable("CORECLR_PROFILER") == "{e2338988-38cc-48cd-a6b6-b441c31f34f1}" &&
Environment.GetEnvironmentVariable("CORECLR_ENABLE_PROFILING") == "1";
#else
// Look for .NET FRAMEWORK compatible Environment Variables
return
Environment.GetEnvironmentVariable("COR_PROFILER") == "{e2338988-38cc-48cd-a6b6-b441c31f34f1}" &&
Environment.GetEnvironmentVariable("COR_PROFILER") == "1";
#endif
}
}
}
}
|
mit
|
C#
|
b7790de66fbc2d11126fb0c0dadf17090c647aa0
|
Fix incorrect sort param
|
UselessToucan/osu,peppy/osu-new,peppy/osu,NeoAdonis/osu,UselessToucan/osu,smoogipooo/osu,smoogipoo/osu,ppy/osu,ppy/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,smoogipoo/osu,peppy/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu
|
osu.Game/Online/Multiplayer/IndexPlaylistScoresRequest.cs
|
osu.Game/Online/Multiplayer/IndexPlaylistScoresRequest.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.IO.Network;
using osu.Game.Extensions;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
namespace osu.Game.Online.Multiplayer
{
/// <summary>
/// Returns a list of scores for the specified playlist item.
/// </summary>
public class IndexPlaylistScoresRequest : APIRequest<MultiplayerScores>
{
private readonly int roomId;
private readonly int playlistItemId;
private readonly Cursor cursor;
private readonly MultiplayerScoresSort? sort;
public IndexPlaylistScoresRequest(int roomId, int playlistItemId, Cursor cursor = null, MultiplayerScoresSort? sort = null)
{
this.roomId = roomId;
this.playlistItemId = playlistItemId;
this.cursor = cursor;
this.sort = sort;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.AddCursor(cursor);
switch (sort)
{
case MultiplayerScoresSort.Ascending:
req.AddParameter("sort", "score_asc");
break;
case MultiplayerScoresSort.Descending:
req.AddParameter("sort", "score_desc");
break;
}
return req;
}
protected override string Target => $@"rooms/{roomId}/playlist/{playlistItemId}/scores";
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.IO.Network;
using osu.Game.Extensions;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
namespace osu.Game.Online.Multiplayer
{
/// <summary>
/// Returns a list of scores for the specified playlist item.
/// </summary>
public class IndexPlaylistScoresRequest : APIRequest<MultiplayerScores>
{
private readonly int roomId;
private readonly int playlistItemId;
private readonly Cursor cursor;
private readonly MultiplayerScoresSort? sort;
public IndexPlaylistScoresRequest(int roomId, int playlistItemId, Cursor cursor = null, MultiplayerScoresSort? sort = null)
{
this.roomId = roomId;
this.playlistItemId = playlistItemId;
this.cursor = cursor;
this.sort = sort;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.AddCursor(cursor);
switch (sort)
{
case MultiplayerScoresSort.Ascending:
req.AddParameter("sort", "scores_asc");
break;
case MultiplayerScoresSort.Descending:
req.AddParameter("sort", "scores_desc");
break;
}
return req;
}
protected override string Target => $@"rooms/{roomId}/playlist/{playlistItemId}/scores";
}
}
|
mit
|
C#
|
cc90f3c246a07c16bbe09ead3ce94a6e4ecdd42c
|
fix GetTotalBytes
|
bijakatlykkex/NBitcoin.Indexer,MetacoSA/NBitcoin.Indexer,NicolasDorier/NBitcoin.Indexer
|
NBitcoin.Indexer/ProgressTracker.cs
|
NBitcoin.Indexer/ProgressTracker.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace NBitcoin.Indexer
{
public class ProgressTracker
{
private readonly AzureBlockImporter _Importer;
public AzureBlockImporter Importer
{
get
{
return _Importer;
}
}
public ImporterConfiguration Configuration
{
get
{
return _Importer.Configuration;
}
}
public ProgressTracker(AzureBlockImporter importer, DiskBlockPosRange range)
{
_Importer = importer;
TotalBytes = GetTotalBytes(range);
ProcessedBytes = 0;
LastPosition = range.Begin;
}
public DiskBlockPos LastPosition
{
get;
private set;
}
public long TotalBytes
{
get;
private set;
}
public long ProcessedBytes
{
get;
private set;
}
public double CurrentProgress
{
get
{
return ((double)ProcessedBytes / (double)TotalBytes) * 100.0;
}
}
private long GetTotalBytes(DiskBlockPosRange range = null)
{
if(range == null)
range = DiskBlockPosRange.All;
long sum = 0;
foreach(var file in new DirectoryInfo(Configuration.BlockDirectory).GetFiles().OrderBy(f => f.Name))
{
var fileIndex = GetFileIndex(file.Name);
if(fileIndex < 0)
continue;
if(fileIndex > range.End.File)
continue;
if(fileIndex == range.End.File && fileIndex == range.Begin.File)
{
var up = Math.Min(file.Length, range.End.Position);
sum += up - range.Begin.Position;
continue;
}
if(fileIndex == range.End.File)
{
sum += Math.Min(file.Length, range.End.Position);
continue;
}
if(fileIndex == range.Begin.File)
{
sum += file.Length - range.Begin.Position;
continue;
}
sum += file.Length;
}
return sum;
}
private int GetFileIndex(string fileName)
{
var match = new Regex("blk([0-9]{5,5}).dat").Match(fileName);
if(!match.Success)
return -1;
return int.Parse(match.Groups[1].Value);
}
internal void Processing(StoredBlock block)
{
if(block.BlockPosition.File == LastPosition.File)
{
ProcessedBytes += block.BlockPosition.Position - LastPosition.Position;
}
else
{
var blkFile = Path.Combine(Configuration.BlockDirectory, "blk" + LastPosition.File.ToString("00000") + ".dat");
ProcessedBytes += (new FileInfo(blkFile).Length - LastPosition.Position) + block.BlockPosition.Position;
}
LastPosition = block.BlockPosition;
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace NBitcoin.Indexer
{
public class ProgressTracker
{
private readonly AzureBlockImporter _Importer;
public AzureBlockImporter Importer
{
get
{
return _Importer;
}
}
public ImporterConfiguration Configuration
{
get
{
return _Importer.Configuration;
}
}
public ProgressTracker(AzureBlockImporter importer, DiskBlockPosRange range)
{
_Importer = importer;
TotalBytes = GetTotalBytes(range);
ProcessedBytes = 0;
LastPosition = range.Begin;
}
public DiskBlockPos LastPosition
{
get;
private set;
}
public long TotalBytes
{
get;
private set;
}
public long ProcessedBytes
{
get;
private set;
}
public double CurrentProgress
{
get
{
return ((double)ProcessedBytes / (double)TotalBytes) * 100.0;
}
}
private long GetTotalBytes(DiskBlockPosRange range = null)
{
if(range == null)
range = DiskBlockPosRange.All;
long sum = 0;
foreach(var file in new DirectoryInfo(Configuration.BlockDirectory).GetFiles().OrderBy(f => f.Name))
{
var fileIndex = GetFileIndex(file.Name);
if(fileIndex < 0)
continue;
if(fileIndex > range.End.File)
continue;
if(fileIndex == range.End.File)
{
sum += Math.Min(file.Length, range.End.Position);
break;
}
sum += file.Length;
}
return sum;
}
private int GetFileIndex(string fileName)
{
var match = new Regex("blk([0-9]{5,5}).dat").Match(fileName);
if(!match.Success)
return -1;
return int.Parse(match.Groups[1].Value);
}
internal void Processing(StoredBlock block)
{
if(block.BlockPosition.File == LastPosition.File)
{
ProcessedBytes += block.BlockPosition.Position - LastPosition.Position;
}
else
{
var blkFile = Path.Combine(Configuration.BlockDirectory, "blk" + LastPosition.File.ToString("00000") + ".dat");
ProcessedBytes += (new FileInfo(blkFile).Length - LastPosition.Position) + block.BlockPosition.Position;
}
LastPosition = block.BlockPosition;
}
}
}
|
mit
|
C#
|
8075e9407d4c2ecf6560f92de09498166e45a54e
|
Fix C# snippet to generate TaskRouter TaskQueue Capability Token
|
TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets
|
rest/taskrouter/jwts/taskqueue/example-1/example-1.5.x.cs
|
rest/taskrouter/jwts/taskqueue/example-1/example-1.5.x.cs
|
// Download the twilio-csharp library from
// https://www.twilio.com/docs/libraries/csharp#installation
using System;
using System.Collections.Generic;
using Twilio.Http;
using Twilio.Jwt.Taskrouter;
class Example
{
static void Main(string[] args)
{
// Find your Account Sid and Auth Token at twilio.com/console
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
const string authToken = "your_auth_token";
const string workspaceSid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
const string taskQueueSid = "WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
var urls = new PolicyUrlUtils(workspaceSid, taskQueueSid);
var allowFetchSubresources = new Policy($"{urls.TaskQueue}/**",
HttpMethod.Get);
var allowUpdates = new Policy(urls.TaskQueue, HttpMethod.Post);
var policies = new List<Policy>
{
allowFetchSubresources,
allowUpdates
};
// By default, tokens are good for one hour.
// Override this default timeout by specifiying a new value (in seconds).
// For example, to generate a token good for 8 hours:
var capability = new TaskRouterCapability(
accountSid,
authToken,
workspaceSid,
taskQueueSid,
policies: policies,
expiration: DateTime.UtcNow.AddSeconds(28800) // 60 * 60 * 8
);
Console.WriteLine(capability.ToJwt());
}
}
class PolicyUrlUtils
{
const string taskRouterBaseUrl = "https://taskrouter.twilio.com";
const string taskRouterVersion = "v1";
readonly string _workspaceSid;
readonly string _taskQueueSid;
public PolicyUrlUtils(string workspaceSid, string taskQueueSid)
{
_workspaceSid = workspaceSid;
_taskQueueSid = taskQueueSid;
}
public string TaskQueue => $"{Workspace}/TaskQueues/{_taskQueueSid}";
string Workspace =>
$"{taskRouterBaseUrl}/{taskRouterVersion}/Workspaces/{_workspaceSid}";
}
|
// Download the twilio-csharp library from
// https://www.twilio.com/docs/libraries/csharp#installation
using System;
using System.Collections.Generic;
using Twilio.Http;
using Twilio.Jwt.Taskrouter;
class Example
{
static void Main(string[] args)
{
// Find your Account Sid and Auth Token at twilio.com/console
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
const string authToken = "your_auth_token";
const string workspaceSid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
const string taskQueueSid = "WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
var urls = new PolicyUrlUtils(workspaceSid, taskQueueSid);
var allowFetchSubresources = new Policy($"{urls.TaskQueue}/**",
HttpMethod.Get);
var allowUpdates = new Policy(urls.TaskQueue, HttpMethod.Post);
var policies = new List<Policy>
{
allowFetchSubresources,
allowUpdates
};
// By default, tokens are good for one hour.
// Override this default timeout by specifiying a new value (in seconds).
// For example, to generate a token good for 8 hours:
var capability = new TaskRouterCapability(
accountSid,
authToken,
workspaceSid,
null,
policies: policies,
expiration: DateTime.UtcNow.AddSeconds(28800) // 60 * 60 * 8
);
Console.WriteLine(capability.ToJwt());
}
}
class PolicyUrlUtils
{
const string taskRouterBaseUrl = "https://taskrouter.twilio.com";
const string taskRouterVersion = "v1";
readonly string _workspaceSid;
readonly string _taskQueueSid;
public PolicyUrlUtils(string workspaceSid, string taskQueueSid)
{
_workspaceSid = workspaceSid;
_taskQueueSid = taskQueueSid;
}
public string TaskQueue => $"{Workspace}/TaskQueue/{_taskQueueSid}";
string Workspace =>
$"{taskRouterBaseUrl}/{taskRouterVersion}/Workspaces/{_workspaceSid}";
}
|
mit
|
C#
|
9fb26a8c4a7227036d813e57a90c958b68ca3c2b
|
fix error
|
zarlo/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,zarlo/Cosmos,zarlo/Cosmos,zarlo/Cosmos
|
source/Cosmos.System2/FileSystem/VFS/FileSystemManager.cs
|
source/Cosmos.System2/FileSystem/VFS/FileSystemManager.cs
|
using System;
using System.Collections.Generic;
namespace Cosmos.System.FileSystem.VFS
{
public static class FileSystemManager
{
private static List<FileSystemFactory> registeredFileSystems =
new List<FileSystemFactory>() {
new FAT.FatFileSystemFactory(),
new ISO9660.ISO9660FileSystemFactory()
};
public static List<FileSystemFactory> RegisteredFileSystems { get {
return registeredFileSystems;
}}
public static bool Register(FileSystemFactory factory)
{
foreach (var item in registeredFileSystems)
{
if(item.Name == factory.Name)
{
return false;
}
}
registeredFileSystems.Add(factory);
return true;
}
public static bool Remove(FileSystemFactory factory)
{
return Remove(factory.Name);
}
public static bool Remove(string factoryName)
{
foreach (var item in registeredFileSystems)
{
if(item.Name == factoryName)
{
registeredFileSystems.Remove(item);
return true;
}
}
return false;
}
}
}
|
using System;
using System.Collections.Generic;
namespace Cosmos.System.FileSystem.VFS
{
public static class FileSystemManager
{
private static List<FileSystemFactory> registeredFileSystems =
new List<FileSystemFactory>() {
new FAT.FatFileSystemFactory(),
new ISO9660.ISO9660FileSystemFactory()
};
public static List<FileSystemFactory> RegisteredFileSystems { get {
return registeredFileSystems;
}}
public static bool Register(FileSystemFactory factory)
{
foreach (var item in registeredFileSystems)
{
if(item.Name == factory.Name)
{
return false;
}
}
registeredFileSystems.Add(factory);
return true;
}
public static bool Remove(FileSystemFactory factory)
{
return Remove(factory.Name);
}
public static bool Remove(string factoryName)
{
foreach (var item in registeredFileSystems)
{
if(item.Name == factory.Name)
{
registeredFileSystems.Remove(item);
return true;
}
}
return false;
}
}
}
|
bsd-3-clause
|
C#
|
75caa3cfb2c691fee39d5651cba49b056009ca0e
|
Update AssemblyInfo.cs
|
wieslawsoltes/AvaloniaBehaviors,wieslawsoltes/AvaloniaBehaviors
|
src/Avalonia.Xaml.Interactions/Properties/AssemblyInfo.cs
|
src/Avalonia.Xaml.Interactions/Properties/AssemblyInfo.cs
|
using System.Runtime.CompilerServices;
using Avalonia.Metadata;
[assembly: InternalsVisibleTo("Avalonia.Xaml.Interactions.UnitTests, PublicKey=00240000048000009400000006020000002400005253413100040000010001002940ed211918fcf63c506fad1d3f7f958b21ff8f06fd2089398296173f9ca93a69b9b380a828bf13fa80d1745beeb917ec3692f4d10e44b4c941619fc7bbd5052b26880697e6fa3f0ce322c4fa902d20b67a48b4144371218f6d39ad39145ea1fe5484052dd51a2ee62af3acd0759bcf92aaefec03978ded3cfaa84798e92de8")]
[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Xaml.Interactions")]
[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Xaml.Interactions.Core")]
[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Xaml.Interactions.Custom")]
[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Xaml.Interactions.DragAndDrop")]
[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Xaml.Interactions.Draggable")]
|
using System.Runtime.CompilerServices;
using Avalonia.Metadata;
[assembly: InternalsVisibleTo("Avalonia.Xaml.Interactions.UnitTests, PublicKey=00240000048000009400000006020000002400005253413100040000010001002940ed211918fcf63c506fad1d3f7f958b21ff8f06fd2089398296173f9ca93a69b9b380a828bf13fa80d1745beeb917ec3692f4d10e44b4c941619fc7bbd5052b26880697e6fa3f0ce322c4fa902d20b67a48b4144371218f6d39ad39145ea1fe5484052dd51a2ee62af3acd0759bcf92aaefec03978ded3cfaa84798e92de8")]
[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Xaml.Interactions")]
[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Xaml.Interactions.Core")]
|
mit
|
C#
|
ad54479193ac1d05d3ff63a545330f3a02a3ec5b
|
Use lambda instead of delegate (#5)
|
ForNeVeR/TankDriver
|
TankDriver.App/Logic/BulletSpace.cs
|
TankDriver.App/Logic/BulletSpace.cs
|
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using TankDriver.Models;
namespace TankDriver.Logic
{
internal class BulletSpace
{
public List<Bullet> Bullets { get; }
private readonly Rectangle _bounds;
private TextureStorage _textureStorage;
public BulletSpace(Rectangle bounds)
{
Bullets = new List<Bullet>();
_bounds = bounds;
}
public void AddBullet(double x, double y, double heading)
{
var bullet = new Bullet(x, y, heading);
bullet.GetModel().LoadTextures(_textureStorage);
Bullets.Add(bullet);
}
public void LoadTexture(TextureStorage textureStorage)
{
_textureStorage = textureStorage;
}
public void Render(SpriteBatch spriteBatch)
{
foreach (var bullet in Bullets)
{
bullet.GetModel().Render(spriteBatch);
}
}
public void Update(TimeSpan timeDelta)
{
foreach (var bullet in Bullets)
{
bullet.UpdatePosition(timeDelta);
}
Bullets.RemoveAll(Bullet => !_bounds.Contains((Vector2)Bullet.Position));
}
}
}
|
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using TankDriver.Models;
namespace TankDriver.Logic
{
internal class BulletSpace
{
public List<Bullet> Bullets { get; }
private readonly Rectangle _bounds;
private TextureStorage _textureStorage;
public BulletSpace(Rectangle bounds)
{
Bullets = new List<Bullet>();
_bounds = bounds;
}
public void AddBullet(double x, double y, double heading)
{
var bullet = new Bullet(x, y, heading);
bullet.GetModel().LoadTextures(_textureStorage);
Bullets.Add(bullet);
}
public void LoadTexture(TextureStorage textureStorage)
{
_textureStorage = textureStorage;
}
public void Render(SpriteBatch spriteBatch)
{
foreach (var bullet in Bullets)
{
bullet.GetModel().Render(spriteBatch);
}
}
public void Update(TimeSpan timeDelta)
{
foreach (var bullet in Bullets)
{
bullet.UpdatePosition(timeDelta);
}
Bullets.RemoveAll(delegate(Bullet bullet)
{
return !_bounds.Contains((Vector2)bullet.Position);
});
}
}
}
|
mit
|
C#
|
3441bda155ee3557c1548c0b31b5dfb4de358d41
|
refactor and clarify endreplay
|
nerai/CMenu
|
src/ExampleMenu/MI_Replay.cs
|
src/ExampleMenu/MI_Replay.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using ConsoleMenu;
namespace ExampleMenu
{
public class MI_Replay : CMenuItem
{
private readonly CMenu _Menu;
private readonly IRecordStore _Store;
public string EndReplayCommand = "endreplay";
public MI_Replay (CMenu menu, IRecordStore store)
: base ("replay")
{
_Store = store;
HelpText = ""
+ "replay [name]\n"
+ "Replays all commands stored in the specified file name, or\n"
+ "Displays a list of all records.\n"
+ "\n"
+ "Replaying puts all stored commands in the same order on the stack as they were originally entered.\n"
+ "Replaying stops when the line \"" + EndReplayCommand + "\" is encountered.";
if (menu == null) {
throw new ArgumentNullException ("menu");
}
_Menu = menu;
}
public override MenuResult Execute (string arg)
{
if (string.IsNullOrWhiteSpace (arg)) {
Console.WriteLine ("Known records: " + string.Join (", ", _Store.GetRecordNames ()));
return MenuResult.Normal;
}
var lines = _Store
.GetRecord (arg)
.TakeWhile (line => !line.Equals (EndReplayCommand));
IO.AddInput (lines);
return MenuResult.Normal;
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using ConsoleMenu;
namespace ExampleMenu
{
public class MI_Replay : CMenuItem
{
private readonly CMenu _Menu;
private readonly IRecordStore _Store;
public MI_Replay (CMenu menu, IRecordStore store)
: base ("replay")
{
_Store = store;
HelpText = ""
+ "replay [name]\n"
+ "Replays all commands stored in the specified file name, or\n"
+ "Displays a list of all records.\n"
+ "\n"
+ "Replaying puts all stored commands in the same order on the stack as they were originally entered.\n"
+ "Nested replaying is supported.";
if (menu == null) {
throw new ArgumentNullException ("menu");
}
_Menu = menu;
}
public string EndReplayCommand = "endreplay";
public override MenuResult Execute (string arg)
{
if (string.IsNullOrWhiteSpace (arg)) {
Console.WriteLine ("Known records: " + string.Join (", ", _Store.GetRecordNames ()));
return MenuResult.Normal;
}
// todo: normale comparison verwenden
// todo: dynamisch (zB als body von if)
var lines = _Store
.GetRecord (arg)
.TakeWhile (line => !line.Equals (EndReplayCommand));
IO.AddInput (lines);
return MenuResult.Normal;
}
}
}
|
mit
|
C#
|
abaa5ff90b70dbf117ada41bbdfb205e4b91ebeb
|
remove useless property to fix json deserization issue
|
lianzhao/WikiaWP,lianzhao/WikiaWP,lianzhao/WikiaWP
|
src/WikiaSdk/Mercury/Data.cs
|
src/WikiaSdk/Mercury/Data.cs
|
namespace Wikia.Mercury
{
public class Data
{
public Details details { get; set; }
public Topcontributor[] topContributors { get; set; }
public Article article { get; set; }
public Relatedpage[] relatedPages { get; set; }
//public Adscontext adsContext { get; set; }
}
}
|
namespace Wikia.Mercury
{
public class Data
{
public Details details { get; set; }
public Topcontributor[] topContributors { get; set; }
public Article article { get; set; }
public Relatedpage[] relatedPages { get; set; }
public Adscontext adsContext { get; set; }
}
}
|
mit
|
C#
|
bbbe777c07494d6acfe9dbbf67cede9182320744
|
add deleting configs backend, fix json content too long
|
lheneks/sniper,lheneks/sniper
|
sniper/sniper/Controllers/SearchConfigApiController.cs
|
sniper/sniper/Controllers/SearchConfigApiController.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using System.Web.Script.Serialization;
using Raven.Client;
using sniper.Common.Mapping;
using sniper.Models;
namespace sniper.Controllers
{
public class SearchConfigApiController : RavenController
{
public JsonResult GetConfig(int id)
{
var current = RavenSession.Load<SearchConfig>(id);
current.LatestRun = RavenSession.Query<SearchData>()
.Where(sd => sd.SearchConfigId == id)
.OrderByDescending(sd => sd.SearchTime)
.FirstOrDefault();
if (current.LatestRun != null)
{
current.LatestRun.Results.ForEach(i=>i.IsFoil = i.Title.ToLower().Contains("foil"));
}
return Json(current);
}
public JsonResult AddOrUpdateSearchConfig(SearchConfig config)
{
SearchConfig current = config;
if (config.Id > 0)
{
current = RavenSession.Load<SearchConfig>(config.Id);
Update.Model(config, current);
}
RavenSession.Store(current);
return Json(new {Message = "Success"});
}
public ContentResult List()
{
var searchConfigs = RavenSession.Query<SearchConfig>().ToList();
var serializer = new JavaScriptSerializer {MaxJsonLength = Int32.MaxValue};
var result = new ContentResult
{
Content = serializer.Serialize(searchConfigs),
ContentType = "application/json"
};
return result;
}
public void SaveRunData(SearchData data)
{
RavenSession.Store(data);
}
public void DeleteConfig(int configId)
{
var datas = RavenSession.Query<SearchData>().Where(sd => sd.SearchConfigId == configId).ToList();
foreach (var searchData in datas)
{
RavenSession.Delete(searchData);
}
var config = RavenSession.Load<SearchConfig>(configId);
RavenSession.Delete(config);
}
}
}
|
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Raven.Client;
using sniper.Common.Mapping;
using sniper.Models;
namespace sniper.Controllers
{
public class SearchConfigApiController : RavenController
{
public JsonResult GetConfig(int id)
{
var current = RavenSession.Load<SearchConfig>(id);
current.LatestRun = RavenSession.Query<SearchData>()
.Where(sd => sd.SearchConfigId == id)
.OrderByDescending(sd => sd.SearchTime)
.FirstOrDefault();
if (current.LatestRun != null)
{
current.LatestRun.Results.ForEach(i=>i.IsFoil = i.Title.ToLower().Contains("foil"));
}
return Json(current);
}
public JsonResult AddOrUpdateSearchConfig(SearchConfig config)
{
SearchConfig current = config;
if (config.Id > 0)
{
current = RavenSession.Load<SearchConfig>(config.Id);
Update.Model(config, current);
}
RavenSession.Store(current);
return Json(new {Message = "Success"});
}
public JsonResult List()
{
var searchConfigs = RavenSession.Query<SearchConfig>().ToList();
return Json(searchConfigs);
}
public void SaveRunData(SearchData data)
{
RavenSession.Store(data);
}
}
}
|
mit
|
C#
|
c309d98914aaaf3c8647eb12e7d54fb43abbaef3
|
Fix ConfigurationsRights.List not being a power of 2
|
tgstation/tgstation-server-tools,Cyberboss/tgstation-server,tgstation/tgstation-server,tgstation/tgstation-server,Cyberboss/tgstation-server
|
src/Tgstation.Server.Api/Rights/ConfigurationRights.cs
|
src/Tgstation.Server.Api/Rights/ConfigurationRights.cs
|
using System;
namespace Tgstation.Server.Api.Rights
{
/// <summary>
/// Rights for <see cref="Models.ConfigurationFile"/>
/// </summary>
[Flags]
public enum ConfigurationRights : ulong
{
/// <summary>
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User may read files
/// </summary>
Read = 1,
/// <summary>
/// User may write files
/// </summary>
Write = 2,
/// <summary>
/// User may list files
/// </summary>
List = 4
}
}
|
using System;
namespace Tgstation.Server.Api.Rights
{
/// <summary>
/// Rights for <see cref="Models.ConfigurationFile"/>
/// </summary>
[Flags]
public enum ConfigurationRights : ulong
{
/// <summary>
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User may read files
/// </summary>
Read = 1,
/// <summary>
/// User may write files
/// </summary>
Write = 2,
/// <summary>
/// User may list files
/// </summary>
List = 3
}
}
|
agpl-3.0
|
C#
|
cf1be566cc3de5ca9904764714db952baaa1022f
|
Remove namespace
|
DataGenSoftware/DataGen.Extensions
|
DataGen.Extensions/DataGen.Extensions/GenericExtensions.cs
|
DataGen.Extensions/DataGen.Extensions/GenericExtensions.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DataGen.Extensions
{
public static class GenericExtensions
{
public static bool IsNull<T>(this Nullable<T> objectInstance)
where T :struct
{
return objectInstance == null;
}
public static bool IsNull<T>(this T objectInstance)
where T : class
{
return objectInstance == null;
}
public static bool IsNotNull<T>(this Nullable<T> objectInstance)
where T : struct
{
return !objectInstance.IsNull();
}
public static bool IsNotNull<T>(this T objectInstance)
where T : class
{
return !objectInstance.IsNull();
}
public static T DefaultIfNull<T>(this Nullable<T> value, T defaultValue)
where T : struct
{
return value ?? defaultValue;
}
public static T DefaultIfNull<T>(this T value, T defaultValue)
where T : class
{
return value ?? defaultValue;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataGen.Extensions
{
public static class GenericExtensions
{
public static bool IsNull<T>(this Nullable<T> objectInstance)
where T :struct
{
return objectInstance == null;
}
public static bool IsNull<T>(this T objectInstance)
where T : class
{
return objectInstance == null;
}
public static bool IsNotNull<T>(this Nullable<T> objectInstance)
where T : struct
{
return !objectInstance.IsNull();
}
public static bool IsNotNull<T>(this T objectInstance)
where T : class
{
return !objectInstance.IsNull();
}
public static T DefaultIfNull<T>(this Nullable<T> value, T defaultValue)
where T : struct
{
return value ?? defaultValue;
}
public static T DefaultIfNull<T>(this T value, T defaultValue)
where T : class
{
return value ?? defaultValue;
}
}
}
|
mit
|
C#
|
18016ba0ed73269e46190f2347d76eae9f3f0291
|
update version to 1.0.4.1
|
bitzhuwei/CSharpGL,bitzhuwei/CSharpGL,bitzhuwei/CSharpGL
|
CSharpGL/Properties/AssemblyInfo.cs
|
CSharpGL/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("CSharpGL")]
[assembly: AssemblyDescription(
@"CSharpGL allows you to use OpenGL functions in the Object-Oriented way.
It wraps OpenGL’s functions and use enum type as parameters instead of ‘uint’for some functions.
It abstracts objects inside OpenGL and describes them as classes.
It provides maths class for matrix and vectors.
It provide useful utilities.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("bitzhuwei")]
[assembly: AssemblyProduct("CSharpGL")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("bbae5fc4-9f20-4b2d-b59c-95639c58d089")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.4.1")]
[assembly: AssemblyFileVersion("1.0.4.1")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("CSharpGL")]
[assembly: AssemblyDescription(@"CSharpGL is a pure C# project that allows for modern OpenGL rendering in a Object-Oriented way.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("bitzhuwei")]
[assembly: AssemblyProduct("CSharpGL")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("bbae5fc4-9f20-4b2d-b59c-95639c58d089")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.4.0")]
[assembly: AssemblyFileVersion("1.0.4.0")]
|
mit
|
C#
|
2b37315dd01383d7e87166b7bfa5bcb17c427978
|
Include the actual package described by bower.json for searching.
|
OSSIndex/winaudit,OSSIndex/DevAudit,OSSIndex/DevAudit
|
DevAudit.AuditLibrary/PackageSources/BowerPackageSource.cs
|
DevAudit.AuditLibrary/PackageSources/BowerPackageSource.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Versatile;
namespace DevAudit.AuditLibrary
{
public class BowerPackageSource : PackageSource
{
#region Constructors
public BowerPackageSource(Dictionary<string, object> package_source_options, EventHandler<EnvironmentEventArgs> message_handler = null) : base(package_source_options, message_handler)
{
}
#endregion
#region Overriden properties
public override string PackageManagerId { get { return "bower"; } }
public override string PackageManagerLabel { get { return "Bower"; } }
public override string DefaultPackageManagerConfigurationFile { get { return "bower.json"; } }
#endregion
#region Overriden methods
//Get bower packages from reading bower.json
public override IEnumerable<Package> GetPackages(params string[] o)
{
var packages = new List<Package>();
AuditFileInfo config_file = this.AuditEnvironment.ConstructFile(this.PackageManagerConfigurationFile);
JObject json = (JObject)JToken.Parse(config_file.ReadAsText());
packages.Add(
new Package("bower",
json.Properties().First(j => j.Name == "name").Value.ToString(),
json.Properties().First(j => j.Name == "version").Value.ToString(),
"")
);
JObject dependencies = (JObject)json["dependencies"];
JObject dev_dependencies = (JObject)json["devDependencies"];
if (dev_dependencies != null)
{
packages.Concat(dev_dependencies.Properties().Select(d => new Package("bower", d.Name, d.Value.ToString(), "")));
}
if (dependencies != null)
{
packages.Concat(dependencies.Properties().Select(d => new Package("bower", d.Name, d.Value.ToString(), "")));
}
return packages;
}
public override bool IsVulnerabilityVersionInPackageVersionRange(string vulnerability_version, string package_version)
{
string message = "";
bool r = SemanticVersion.RangeIntersect(vulnerability_version, package_version, out message);
if (!r && !string.IsNullOrEmpty(message))
{
throw new Exception(message);
}
else return r;
}
#endregion
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Versatile;
namespace DevAudit.AuditLibrary
{
public class BowerPackageSource : PackageSource
{
#region Constructors
public BowerPackageSource(Dictionary<string, object> package_source_options, EventHandler<EnvironmentEventArgs> message_handler = null) : base(package_source_options, message_handler)
{
}
#endregion
#region Overriden properties
public override string PackageManagerId { get { return "bower"; } }
public override string PackageManagerLabel { get { return "Bower"; } }
public override string DefaultPackageManagerConfigurationFile { get { return "bower.json"; } }
#endregion
#region Overriden methods
//Get bower packages from reading bower.json
public override IEnumerable<Package> GetPackages(params string[] o)
{
AuditFileInfo config_file = this.AuditEnvironment.ConstructFile(this.PackageManagerConfigurationFile);
JObject json = (JObject)JToken.Parse(config_file.ReadAsText());
JObject dependencies = (JObject)json["dependencies"];
JObject dev_dependencies = (JObject)json["devDependencies"];
if (dev_dependencies != null)
{
return dependencies.Properties().Select(d => new Package("bower", d.Name, d.Value.ToString(), ""))
.Concat(dev_dependencies.Properties().Select(d => new Package("bower", d.Name, d.Value.ToString(), "")));
}
else
{
return dependencies.Properties().Select(d => new Package("bower", d.Name, d.Value.ToString(), ""));
}
}
public override bool IsVulnerabilityVersionInPackageVersionRange(string vulnerability_version, string package_version)
{
string message = "";
bool r = SemanticVersion.RangeIntersect(vulnerability_version, package_version, out message);
if (!r && !string.IsNullOrEmpty(message))
{
throw new Exception(message);
}
else return r;
}
#endregion
}
}
|
bsd-3-clause
|
C#
|
84f94261cb48293a14ef5d2e3e5d8b3b5c96e64b
|
Add (Back) Update
|
NoShurim/Buddys
|
Kayn_BETA_Fixed/Kayn_BETA_Fixed/Properties/AssemblyInfo.cs
|
Kayn_BETA_Fixed/Kayn_BETA_Fixed/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("Kayn_BETA_Fixed")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Kayn_BETA_Fixed")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e0c1da1a-707d-4e5e-8adc-e77c3fa5b0d6")]
// 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.2.1.6")]
[assembly: AssemblyFileVersion("1.2.1.6")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Kayn_BETA_Fixed")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Kayn_BETA_Fixed")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e0c1da1a-707d-4e5e-8adc-e77c3fa5b0d6")]
// 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")]
|
epl-1.0
|
C#
|
a4ed83b7445b07083d0ac6aac72850b7e9c29a26
|
Update ReflectorDefaults.cs
|
NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework
|
Legacy/Legacy.Reflector/Configuration/ReflectorDefaults.cs
|
Legacy/Legacy.Reflector/Configuration/ReflectorDefaults.cs
|
// // Copyright Naked Objects Group Ltd, 45 Station Road, Henley on Thames, UK, RG9 1AT
// // 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 Legacy.Types;
namespace Legacy.Reflector.Configuration {
public static class ReflectorDefaults {
public static readonly Type[] DefaultLegacyTypes = {
typeof(TextString),
typeof(InternalCollection),
typeof(InternalCollection<>),
typeof(Date),
typeof(TimeStamp),
typeof(TitledObject),
typeof(ActionAbout),
typeof(FieldAbout),
typeof(Title),
typeof(WholeNumber)
};
}
}
|
// // Copyright Naked Objects Group Ltd, 45 Station Road, Henley on Thames, UK, RG9 1AT
// // 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 Legacy.Types;
namespace Legacy.Reflector.Configuration {
public static class ReflectorDefaults {
public static readonly Type[] DefaultLegacyTypes = {
typeof(TextString),
typeof(InternalCollection),
typeof(InternalCollection<>),
typeof(Date),
typeof(TimeStamp),
typeof(TitledObject),
typeof(ActionAbout),
typeof(FieldAbout),
typeof(Title),
};
}
}
|
apache-2.0
|
C#
|
b516d832257bc250def63534f9a80f658d9c0b6a
|
Update version to 2.0.3
|
bungeemonkee/Configgy
|
Configgy/Properties/AssemblyInfo.cs
|
Configgy/Properties/AssemblyInfo.cs
|
using System.Resources;
using System.Reflection;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Configgy")]
[assembly: AssemblyDescription("Configgy: Configuration library for .NET")]
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif
[assembly: AssemblyCompany("David Love")]
[assembly: AssemblyProduct("Configgy")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values.
// We will increase these values in the following way:
// Major Version : Increased when there is a release that breaks a public api
// Minor Version : Increased for each non-api-breaking release
// Build Number : 0 for alpha versions, 1 for beta versions, 2 for release candidates, 3 for releases
// Revision : Always 0 for release versions, always 1+ for alpha, beta, rc versions to indicate the alpha/beta/rc number
[assembly: AssemblyVersion("2.0.3.0")]
[assembly: AssemblyFileVersion("2.0.3.0")]
// This version number will roughly follow semantic versioning : http://semver.org
// The first three numbers will always match the first the numbers of the version above.
[assembly: AssemblyInformationalVersion("2.0.3.0")]
|
using System.Resources;
using System.Reflection;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Configgy")]
[assembly: AssemblyDescription("Configgy: Configuration library for .NET")]
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif
[assembly: AssemblyCompany("David Love")]
[assembly: AssemblyProduct("Configgy")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values.
// We will increase these values in the following way:
// Major Version : Increased when there is a release that breaks a public api
// Minor Version : Increased for each non-api-breaking release
// Build Number : 0 for alpha versions, 1 for beta versions, 2 for release candidates, 3 for releases
// Revision : Always 0 for release versions, always 1+ for alpha, beta, rc versions to indicate the alpha/beta/rc number
[assembly: AssemblyVersion("2.0.2.1")]
[assembly: AssemblyFileVersion("2.0.2.1")]
// This version number will roughly follow semantic versioning : http://semver.org
// The first three numbers will always match the first the numbers of the version above.
[assembly: AssemblyInformationalVersion("2.0.2-rc1")]
|
mit
|
C#
|
251f7799a2decc0e507fe0f5a1c21c282e408bdf
|
Fix reset counter not applying change
|
id144/dx11-vvvv,id144/dx11-vvvv,id144/dx11-vvvv
|
Nodes/VVVV.DX11.Nodes/Nodes/Layers/DX11ResetCounterNode.cs
|
Nodes/VVVV.DX11.Nodes/Nodes/Layers/DX11ResetCounterNode.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using VVVV.PluginInterfaces.V2;
using VVVV.PluginInterfaces.V1;
using FeralTic.DX11;
namespace VVVV.DX11.Nodes
{
[PluginInfo(Name = "ResetCounter", Category = "DX11.Layer", Version = "", Author = "vux")]
public class DX11ResetCounterNode : IPluginEvaluate, IDX11LayerProvider
{
[Input("Layer In")]
protected Pin<DX11Resource<DX11Layer>> FLayerIn;
[Input("Reset Counter", IsSingle = true, DefaultValue = 1)]
protected Pin<bool> FInReset;
[Output("Layer Out")]
protected ISpread<DX11Resource<DX11Layer>> FOutLayer;
public void Evaluate(int SpreadMax)
{
if (this.FOutLayer[0] == null) { this.FOutLayer[0] = new DX11Resource<DX11Layer>(); }
}
#region IDX11ResourceProvider Members
public void Update(IPluginIO pin, DX11RenderContext context)
{
if (!this.FOutLayer[0].Contains(context))
{
this.FOutLayer[0][context] = new DX11Layer();
this.FOutLayer[0][context].Render = this.Render;
}
}
public void Destroy(IPluginIO pin, DX11RenderContext context, bool force)
{
this.FOutLayer[0].Dispose(context);
}
public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
{
if (this.FLayerIn.PluginIO.IsConnected)
{
bool current = settings.ResetCounter;
settings.ResetCounter = this.FInReset[0];
this.FLayerIn[0][context].Render(this.FLayerIn.PluginIO, context, settings);
settings.ResetCounter = current;
}
}
#endregion
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using VVVV.PluginInterfaces.V2;
using VVVV.PluginInterfaces.V1;
using FeralTic.DX11;
namespace VVVV.DX11.Nodes
{
[PluginInfo(Name = "ResetCounter", Category = "DX11.Layer", Version = "", Author = "vux")]
public class DX11ResetCounterNode : IPluginEvaluate, IDX11LayerProvider
{
[Input("Layer In", AutoValidate = false)]
protected Pin<DX11Resource<DX11Layer>> FLayerIn;
[Input("Reset Counter", IsSingle = true, DefaultValue = 1)]
protected Pin<bool> FInReset;
[Output("Layer Out")]
protected ISpread<DX11Resource<DX11Layer>> FOutLayer;
public void Evaluate(int SpreadMax)
{
if (this.FOutLayer[0] == null) { this.FOutLayer[0] = new DX11Resource<DX11Layer>(); }
}
#region IDX11ResourceProvider Members
public void Update(IPluginIO pin, DX11RenderContext context)
{
if (!this.FOutLayer[0].Contains(context))
{
this.FOutLayer[0][context] = new DX11Layer();
this.FOutLayer[0][context].Render = this.Render;
}
}
public void Destroy(IPluginIO pin, DX11RenderContext context, bool force)
{
this.FOutLayer[0].Dispose(context);
}
public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
{
if (this.FLayerIn.PluginIO.IsConnected)
{
bool current = settings.ResetCounter;
this.FLayerIn[0][context].Render(this.FLayerIn.PluginIO, context, settings);
settings.ResetCounter = current;
}
}
#endregion
}
}
|
bsd-3-clause
|
C#
|
857df6a38400ec6fd284a236fb8244165e93a35f
|
remove unused variable
|
harshjain2/cli,livarcocc/cli-1,livarcocc/cli-1,dasMulli/cli,Faizan2304/cli,johnbeisner/cli,ravimeda/cli,svick/cli,EdwardBlair/cli,ravimeda/cli,johnbeisner/cli,Faizan2304/cli,harshjain2/cli,johnbeisner/cli,blackdwarf/cli,blackdwarf/cli,harshjain2/cli,blackdwarf/cli,svick/cli,EdwardBlair/cli,EdwardBlair/cli,livarcocc/cli-1,svick/cli,dasMulli/cli,ravimeda/cli,Faizan2304/cli,dasMulli/cli,blackdwarf/cli
|
src/dotnet/commands/dotnet-complete/CompleteCommand.cs
|
src/dotnet/commands/dotnet-complete/CompleteCommand.cs
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Linq;
using Microsoft.DotNet.Cli.CommandLine;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Cli
{
public class CompleteCommand
{
public static int Run(string[] args)
{
try
{
DebugHelper.HandleDebugSwitch(ref args);
// get the parser for the current subcommand
var parser = Parser.Instance;
// parse the arguments
var result = parser.ParseFrom("dotnet complete", args);
var complete = result["dotnet"]["complete"];
var suggestions = Suggestions(complete);
foreach (var suggestion in suggestions)
{
Console.WriteLine(suggestion);
}
}
catch (Exception)
{
return 1;
}
return 0;
}
private static string[] Suggestions(AppliedOption complete)
{
var input = complete.Arguments.SingleOrDefault() ?? "";
var positionOption = complete.AppliedOptions.SingleOrDefault(a => a.Name == "position");
if (positionOption != null)
{
var position = positionOption.Value<int>();
if (position > input.Length)
{
input += " ";
}
}
var result = Parser.Instance.Parse(input);
return result.Suggestions()
.ToArray();
}
}
}
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Linq;
using Microsoft.DotNet.Cli.CommandLine;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Cli
{
public class CompleteCommand
{
public static int Run(string[] args)
{
try
{
DebugHelper.HandleDebugSwitch(ref args);
// get the parser for the current subcommand
var parser = Parser.Instance;
// parse the arguments
var result = parser.ParseFrom("dotnet complete", args);
var complete = result["dotnet"]["complete"];
var suggestions = Suggestions(complete);
foreach (var suggestion in suggestions)
{
Console.WriteLine(suggestion);
}
}
catch (Exception e)
{
return 1;
}
return 0;
}
private static string[] Suggestions(AppliedOption complete)
{
var input = complete.Arguments.SingleOrDefault() ?? "";
var positionOption = complete.AppliedOptions.SingleOrDefault(a => a.Name == "position");
if (positionOption != null)
{
var position = positionOption.Value<int>();
if (position > input.Length)
{
input += " ";
}
}
var result = Parser.Instance.Parse(input);
return result.Suggestions()
.ToArray();
}
}
}
|
mit
|
C#
|
553cacf21d45d13afbb55204153b92dbb91c9f9b
|
Add [Serializable] attribute
|
dnm240/NSubstitute,dnm240/NSubstitute,dnm240/NSubstitute,dnm240/NSubstitute,dnm240/NSubstitute
|
Source/NSubstitute/Exceptions/NotRunningAQueryException.cs
|
Source/NSubstitute/Exceptions/NotRunningAQueryException.cs
|
using System.Runtime.Serialization;
namespace NSubstitute.Exceptions
{
[Serializable]
public class NotRunningAQueryException : SubstituteException
{
public NotRunningAQueryException() { }
protected NotRunningAQueryException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
|
using System.Runtime.Serialization;
namespace NSubstitute.Exceptions
{
public class NotRunningAQueryException : SubstituteException
{
public NotRunningAQueryException() { }
protected NotRunningAQueryException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
|
bsd-3-clause
|
C#
|
b202eb49132201a34a11d28080ef91813f1080d8
|
Add a check for argument existence to the Compiler
|
riganti/dotvvm,riganti/dotvvm,riganti/dotvvm,riganti/dotvvm
|
src/DotVVM.Compiler/Program.cs
|
src/DotVVM.Compiler/Program.cs
|
using System;
using System.IO;
using System.Linq;
namespace DotVVM.Compiler
{
public static class Program
{
private static readonly string[] HelpOptions = new string[] {
"--help", "-h", "-?", "/help", "/h", "/?"
};
public static bool TryRun(FileInfo assembly, DirectoryInfo? projectDir)
{
var executor = ProjectLoader.GetExecutor(assembly.FullName);
return executor.ExecuteCompile(assembly, projectDir, null);
}
public static int Main(string[] args)
{
// To minimize dependencies, this tool deliberately reinvents the wheel instead of using System.CommandLine.
if (args.Length != 2 || (args.Length == 1 && HelpOptions.Contains(args[0])))
{
Console.Error.Write(
@"Usage: DotVVM.Compiler <ASSEMBLY> <PROJECT_DIR>
Arguments:
<ASSEMBLY> Path to a DotVVM project assembly.
<PROJECT_DIR> Path to a DotVVM project directory.");
return 1;
}
var assemblyFile = new FileInfo(args[0]);
if (!assemblyFile.Exists)
{
Console.Error.Write($"Assembly '{assemblyFile}' does not exist.");
return 1;
}
var projectDir = new DirectoryInfo(args[1]);
if (!projectDir.Exists)
{
Console.Error.Write($"Project directory '{projectDir}' does not exist.");
return 1;
}
var success = TryRun(assemblyFile, projectDir);
return success ? 0 : 1;
}
}
}
|
using System;
using System.IO;
using System.Linq;
namespace DotVVM.Compiler
{
public static class Program
{
private static readonly string[] HelpOptions = new string[] {
"--help", "-h", "-?", "/help", "/h", "/?"
};
public static bool TryRun(FileInfo assembly, DirectoryInfo? projectDir)
{
var executor = ProjectLoader.GetExecutor(assembly.FullName);
return executor.ExecuteCompile(assembly, projectDir, null);
}
public static int Main(string[] args)
{
if (args.Length != 2 || (args.Length == 1 && HelpOptions.Contains(args[0])))
{
Console.Error.Write(
@"Usage: DotVVM.Compiler <ASSEMBLY> <PROJECT_DIR>
Arguments:
<ASSEMBLY> Path to a DotVVM project assembly.
<PROJECT_DIR> Path to a DotVVM project directory.");
return 1;
}
var success = TryRun(new FileInfo(args[0]), new DirectoryInfo(args[1]));
return success ? 0 : 1;
}
}
}
|
apache-2.0
|
C#
|
1c98bded59cc3314df86a79e33092ef5e44df2b8
|
change version to v1.0.1
|
xyting/NPOI.Extension
|
src/Properties/AssemblyInfo.cs
|
src/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("NPOI.Extension")]
[assembly: AssemblyDescription("Extension of NPOI, that use attributes to control enumerable objects export to excel behaviors.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("RigoFunc (xuyingting)")]
[assembly: AssemblyProduct("NPOI.Extension")]
[assembly: AssemblyCopyright("Copyright © RigoFunc (xuyingting). All rights reserved.")]
[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("5addd29d-b3af-4966-b730-5e5192d0e9df")]
// 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.1.0.1")]
[assembly: AssemblyFileVersion("1.1.0.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("NPOI.Extension")]
[assembly: AssemblyDescription("Extension of NPOI, that use attributes to control enumerable objects export to excel behaviors.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("RigoFunc (xuyingting)")]
[assembly: AssemblyProduct("NPOI.Extension")]
[assembly: AssemblyCopyright("Copyright © RigoFunc (xuyingting). All rights reserved.")]
[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("5addd29d-b3af-4966-b730-5e5192d0e9df")]
// 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.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
|
apache-2.0
|
C#
|
66cfaf5ce16f14f0c7c2af914c083a08b0dc34c0
|
Update StorageContext.cs (#1728)
|
AntShares/AntShares
|
src/neo/SmartContract/StorageContext.cs
|
src/neo/SmartContract/StorageContext.cs
|
namespace Neo.SmartContract
{
public class StorageContext
{
public int Id;
public bool IsReadOnly;
}
}
|
namespace Neo.SmartContract
{
internal class StorageContext
{
public int Id;
public bool IsReadOnly;
}
}
|
mit
|
C#
|
49b977386375dc9ea78c35b104da1bb644e5f5e6
|
Rename SetChildClients() to SetChildsClients() in GitDatabaseClientTests
|
shana/octokit.net,Sarmad93/octokit.net,ivandrofly/octokit.net,SamTheDev/octokit.net,gdziadkiewicz/octokit.net,michaKFromParis/octokit.net,magoswiat/octokit.net,Sarmad93/octokit.net,ivandrofly/octokit.net,bslliw/octokit.net,devkhan/octokit.net,geek0r/octokit.net,khellang/octokit.net,ChrisMissal/octokit.net,editor-tools/octokit.net,brramos/octokit.net,shiftkey-tester/octokit.net,hahmed/octokit.net,alfhenrik/octokit.net,rlugojr/octokit.net,shiftkey/octokit.net,eriawan/octokit.net,devkhan/octokit.net,kolbasov/octokit.net,octokit-net-test-org/octokit.net,fake-organization/octokit.net,dampir/octokit.net,chunkychode/octokit.net,gabrielweyer/octokit.net,octokit/octokit.net,mminns/octokit.net,M-Zuber/octokit.net,M-Zuber/octokit.net,alfhenrik/octokit.net,nsrnnnnn/octokit.net,darrelmiller/octokit.net,Red-Folder/octokit.net,thedillonb/octokit.net,TattsGroup/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,gdziadkiewicz/octokit.net,rlugojr/octokit.net,SmithAndr/octokit.net,kdolan/octokit.net,editor-tools/octokit.net,shiftkey-tester/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,khellang/octokit.net,octokit/octokit.net,octokit-net-test-org/octokit.net,forki/octokit.net,dlsteuer/octokit.net,thedillonb/octokit.net,SLdragon1989/octokit.net,cH40z-Lord/octokit.net,TattsGroup/octokit.net,hahmed/octokit.net,dampir/octokit.net,SamTheDev/octokit.net,eriawan/octokit.net,shiftkey/octokit.net,adamralph/octokit.net,naveensrinivasan/octokit.net,takumikub/octokit.net,yonglehou/octokit.net,octokit-net-test/octokit.net,yonglehou/octokit.net,daukantas/octokit.net,chunkychode/octokit.net,SmithAndr/octokit.net,gabrielweyer/octokit.net,hitesh97/octokit.net,nsnnnnrn/octokit.net,shana/octokit.net,fffej/octokit.net,mminns/octokit.net
|
Octokit.Tests/Clients/GitDatabaseClientTests.cs
|
Octokit.Tests/Clients/GitDatabaseClientTests.cs
|
using System;
using NSubstitute;
using Octokit;
using Xunit;
public class GitDatabaseClientTests
{
public class TheCtor
{
[Fact]
public void EnsuresArgument()
{
Assert.Throws<ArgumentNullException>(() => new GitDatabaseClient(null));
}
[Fact]
public void SetChildsClients()
{
var apiConnection = Substitute.For<IApiConnection>();
var gitDatabaseClient = new GitDatabaseClient(apiConnection);
Assert.NotNull(gitDatabaseClient.Tag);
}
}
}
|
using System;
using NSubstitute;
using Octokit;
using Xunit;
public class GitDatabaseClientTests
{
public class TheCtor
{
[Fact]
public void EnsuresArgument()
{
Assert.Throws<ArgumentNullException>(() => new GitDatabaseClient(null));
}
[Fact]
public void SetChildClients()
{
var apiConnection = Substitute.For<IApiConnection>();
var gitDatabaseClient = new GitDatabaseClient(apiConnection);
Assert.NotNull(gitDatabaseClient.Tag);
}
}
}
|
mit
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.