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 |
|---|---|---|---|---|---|---|---|---|
5eb77a26a7e5a0bd5826f474fb63085da5de2dbb
|
Change namespace
|
wadewegner/uber-sdk-for-net
|
src/UberSDKForNet.UnitTests/Tests.cs
|
src/UberSDKForNet.UnitTests/Tests.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using Uber;
namespace Uber.UnitTests
{
[TestFixture]
public class Tests
{
[Test]
public void UserActivity_Fail_ServerToken()
{
var client = new UberClient("");
Assert.That(async () => await client.UserActivityAsync(), Throws.InstanceOf<ArgumentException>());
}
[Test]
public void WebServer_Fail_Arguments()
{
var auth = new AuthenticationClient();
Assert.That(async () => await auth.WebServerAsync("", "", "", ""), Throws.InstanceOf<ArgumentNullException>());
Assert.That(async () => await auth.WebServerAsync("clientid", "", "", ""), Throws.InstanceOf<ArgumentNullException>());
Assert.That(async () => await auth.WebServerAsync("clientid", "clientSecret", "", ""), Throws.InstanceOf<ArgumentNullException>());
Assert.That(async () => await auth.WebServerAsync("clientid", "clientSecret", "redirectUri", ""), Throws.InstanceOf<ArgumentNullException>());
Assert.That(async () => await auth.WebServerAsync("clientid", "clientSecret", "redirectUri", "code"), Throws.InstanceOf<ArgumentException>());
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using Uber;
namespace UberSDKForNet.UnitTests
{
[TestFixture]
public class Tests
{
[Test]
public void UserActivity_Fail_ServerToken()
{
var client = new UberClient("");
Assert.That(async () => await client.UserActivityAsync(), Throws.InstanceOf<ArgumentException>());
}
[Test]
public void WebServer_Fail_Arguments()
{
var auth = new AuthenticationClient();
Assert.That(async () => await auth.WebServerAsync("", "", "", ""), Throws.InstanceOf<ArgumentNullException>());
Assert.That(async () => await auth.WebServerAsync("clientid", "", "", ""), Throws.InstanceOf<ArgumentNullException>());
Assert.That(async () => await auth.WebServerAsync("clientid", "clientSecret", "", ""), Throws.InstanceOf<ArgumentNullException>());
Assert.That(async () => await auth.WebServerAsync("clientid", "clientSecret", "redirectUri", ""), Throws.InstanceOf<ArgumentNullException>());
Assert.That(async () => await auth.WebServerAsync("clientid", "clientSecret", "redirectUri", "code"), Throws.InstanceOf<ArgumentException>());
}
}
}
|
mit
|
C#
|
28cef8c622092b9dfd47959a225d0876ba64a1a2
|
fix broken build by adding f to 0.2 for a float
|
knexer/Chinese-Rooms-what-do-they-know-do-they-know-things-lets-find-out
|
Assets/Scripts/DraggableCellMachine.cs
|
Assets/Scripts/DraggableCellMachine.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DraggableCellMachine : MonoBehaviour
{
public float distanceThreshold = 0.2f;
private MachineGrid grid;
private bool dragging;
// Use this for initialization
void Start()
{
grid = FindObjectOfType<MachineGrid>();
}
private void OnMouseDown()
{
dragging = true;
// remove from whatever it's attached to
GridCell closestCell = grid.getClosestCell(transform.position);
if (closestCell != null
&& closestCell.CellMachine != null
&& Vector2.Distance(closestCell.transform.position, transform.position) < 0.01f)
{
if (closestCell.CellMachine == GetComponent<VertexMachine>())
{
closestCell.CellMachine = null;
}
}
}
private void OnMouseDrag()
{
transform.position = Camera.main.ScreenToWorldPoint(Input.mousePosition);
transform.position = new Vector3(transform.position.x, transform.position.y, 0);
Vector3 closestCellPosition = grid.getClosestCell(transform.position).transform.position;
if (Vector2.Distance(transform.position, closestCellPosition) < distanceThreshold)
{
transform.position = closestCellPosition;
}
}
private void OnMouseUp()
{
if (dragging)
{
dragging = false;
// place yoself
GridCell closestCell = grid.getClosestCell(transform.position);
if (closestCell != null
&& closestCell.CellMachine == null
&& Vector2.Distance(closestCell.transform.position, transform.position) < 0.01f)
{
closestCell.CellMachine = GetComponent<CellMachine>();
}
else
{
// TODO put it back on the shelf
}
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DraggableCellMachine : MonoBehaviour
{
public float distanceThreshold = 0.2;
private MachineGrid grid;
private bool dragging;
// Use this for initialization
void Start()
{
grid = FindObjectOfType<MachineGrid>();
}
private void OnMouseDown()
{
dragging = true;
// remove from whatever it's attached to
GridCell closestCell = grid.getClosestCell(transform.position);
if (closestCell != null
&& closestCell.CellMachine != null
&& Vector2.Distance(closestCell.transform.position, transform.position) < 0.01f)
{
if (closestCell.CellMachine == GetComponent<VertexMachine>())
{
closestCell.CellMachine = null;
}
}
}
private void OnMouseDrag()
{
transform.position = Camera.main.ScreenToWorldPoint(Input.mousePosition);
transform.position = new Vector3(transform.position.x, transform.position.y, 0);
Vector3 closestCellPosition = grid.getClosestCell(transform.position).transform.position;
if (Vector2.Distance(transform.position, closestCellPosition) < distanceThreshold)
{
transform.position = closestCellPosition;
}
}
private void OnMouseUp()
{
if (dragging)
{
dragging = false;
// place yoself
GridCell closestCell = grid.getClosestCell(transform.position);
if (closestCell != null
&& closestCell.CellMachine == null
&& Vector2.Distance(closestCell.transform.position, transform.position) < 0.01f)
{
closestCell.CellMachine = GetComponent<CellMachine>();
}
else
{
// TODO put it back on the shelf
}
}
}
}
|
mit
|
C#
|
24a561bb1ad38b89af179a61d19f9d13b5721ae4
|
Add new test for NotNull with provided message.
|
devtyr/gullap
|
DevTyr.Gullap.Tests/With_Guard/For_NotNull/When_argument_is_null.cs
|
DevTyr.Gullap.Tests/With_Guard/For_NotNull/When_argument_is_null.cs
|
using System;
using NUnit.Framework;
using DevTyr.Gullap;
namespace DevTyr.Gullap.Tests.With_Guard.For_NotNull
{
[TestFixture]
public class When_argument_is_null
{
[Test]
public void Should_throw_argumentnullexception ()
{
Assert.Throws<ArgumentNullException> (() => Guard.NotNull (null, null));
}
[Test]
public void Should_include_argument_name_in_exception_message ()
{
object what = null;
Assert.Throws<ArgumentNullException> (() => Guard.NotNull (what, "what"), "what");
}
[Test]
public void Should_include_message_if_provided ()
{
object what = null;
Assert.IsTrue (
Assert.Throws<ArgumentNullException> (() => Guard.NotNull (what, "what", "the real deal"))
.Message.Contains("the real deal")
);
}
}
}
|
using System;
using NUnit.Framework;
using DevTyr.Gullap;
namespace DevTyr.Gullap.Tests.With_Guard.For_NotNull
{
[TestFixture]
public class When_argument_is_null
{
[Test]
public void Should_throw_argumentnullexception ()
{
Assert.Throws<ArgumentNullException> (() => Guard.NotNull (null, null));
}
[Test]
public void Should_include_argument_name_in_exception_message ()
{
object what = null;
Assert.Throws<ArgumentNullException> (() => Guard.NotNull (what, "what"), "what");
}
}
}
|
mit
|
C#
|
807b63aafe06ae283b5d9bd49c5f9dcfdf633b2f
|
Update SelectCommandExtensions.cs
|
Flepper/flepper,Flepper/flepper
|
Flepper.QueryBuilder/Commands/Extensions/SelectCommandExtensions.cs
|
Flepper.QueryBuilder/Commands/Extensions/SelectCommandExtensions.cs
|
namespace Flepper.QueryBuilder
{
/// <summary>
/// Select Command Extensions
/// </summary>
public static class SelectCommandExtensions
{
/// <summary>
/// Add From to query
/// </summary>
/// <param name="selectCommand">Select Command Extension</param>
/// <param name="schema">Schema name</param>
/// <param name="table">Table name</param>
/// <returns></returns>
public static IFromCommand From(this ISelectCommand selectCommand, string schema, string table)
=> selectCommand.To((s, p) => new FromCommand(s, p, schema, table));
/// <summary>
/// Add From to query
/// </summary>
/// <param name="selectCommand">Select Command Instance</param>
/// <param name="table">Table name</param>
/// <returns></returns>
public static IFromCommand From(this ISelectCommand selectCommand, string table)
=> selectCommand.To((s, p) => new FromCommand(s, p, table));
/// <summary>
/// Add Top Command
/// </summary>
/// <param name="selectCommand">Select Command instance</param>
/// <param name="size">Size of records</param>
/// <returns></returns>
public static ITopCommand Top(this ISelectCommand selectCommand, int size = 1)
=> selectCommand.To((s, p) => new TopCommand(s, p, size));
}
}
|
namespace Flepper.QueryBuilder
{
/// <summary>
/// Select Command Extensions
/// </summary>
public static class SelectCommandExtensions
{
/// <summary>
/// Add From to query
/// </summary>
/// <param name="selectCommand">Select Command Extension</param>
/// <param name="schema">Schema name</param>
/// <param name="table">Table name</param>
/// <returns></returns>
public static IFromCommand From(this ISelectCommand selectCommand, string schema, string table)
=> selectCommand.To((s, p) => new FromCommand(s, p, schema, table));
/// <summary>
/// Add From to query
/// </summary>
/// <param name="selectCommand">Select Command Instance</param>
/// <param name="table">Table name</param>
/// <returns></returns>
public static IFromCommand From(this ISelectCommand selectCommand, string table)
=> selectCommand.To((s, p) => new FromCommand(s, p, table));
/// <summary>
/// Add Top Command
/// </summary>
/// <param name="selectCommand">Select Command instance</param>
/// <param name="size">Quantity of columns</param>
/// <returns></returns>
public static ITopCommand Top(this ISelectCommand selectCommand, int size = 1)
=> selectCommand.To((s, p) => new TopCommand(s, p, size));
}
}
|
mit
|
C#
|
aa84ecd9d0598d324bb320696a68bb175b39480c
|
fix brewer filter scripts
|
Kentico/Deliver-Dancing-Goat-.NET-MVC,Kentico/cloud-sample-app-net,Kentico/cloud-sample-app-net,Kentico/cloud-sample-app-net,Kentico/Deliver-Dancing-Goat-.NET-MVC
|
DancingGoat/Views/Brewers/Index.cshtml
|
DancingGoat/Views/Brewers/Index.cshtml
|
@model DancingGoat.Models.BrewersViewModel
@{
Layout = "~/Views/Shared/_StoreLayout.cshtml";
ViewBag.Title = Localizer["Brewers"];
}
<div class="product-page row">
<div class="flex">
<aside class="col-md-4 col-lg-3 product-filter">
@using (Html.BeginForm("Filter", "Brewers"))
{
@await Html.PartialAsync("BrewersFilter", Model.Filter)
}
</aside>
<div id="product-list" class="col-md-8 col-lg-9 product-list">
@await Html.PartialAsync("ProductListing", Model.Items)
</div>
</div>
</div>
@section Scripts{
<script src="~/js/formAutoPost.js"></script>
<script>
$(".js-postback input:checkbox").formAutoPost({ targetContainerSelector: "#product-list" });
</script>
}
|
@model DancingGoat.Models.BrewersViewModel
@{
Layout = "~/Views/Shared/_StoreLayout.cshtml";
ViewBag.Title = Localizer["Brewers"];
}
<div class="product-page row">
<div class="flex">
<aside class="col-md-4 col-lg-3 product-filter">
@using (Html.BeginForm("Filter", "Brewers"))
{
@await Html.PartialAsync("BrewersFilter", Model.Filter)
}
</aside>
<div id="product-list" class="col-md-8 col-lg-9 product-list">
@await Html.PartialAsync("ProductListing", Model.Items)
</div>
</div>
</div>
<script src="~/js/formAutoPost.js"></script>
<script>
$(".js-postback input:checkbox").formAutoPost({ targetContainerSelector: "#product-list" });
</script>
|
mit
|
C#
|
b534c771802c2eb462701928f05cc01171718c90
|
Fix variable name typo
|
juvchan/kudu,badescuga/kudu,shanselman/kudu,mauricionr/kudu,dev-enthusiast/kudu,duncansmart/kudu,mauricionr/kudu,dev-enthusiast/kudu,uQr/kudu,EricSten-MSFT/kudu,shanselman/kudu,MavenRain/kudu,dev-enthusiast/kudu,shibayan/kudu,EricSten-MSFT/kudu,kali786516/kudu,juoni/kudu,sitereactor/kudu,kali786516/kudu,bbauya/kudu,dev-enthusiast/kudu,barnyp/kudu,juoni/kudu,oliver-feng/kudu,sitereactor/kudu,duncansmart/kudu,uQr/kudu,WeAreMammoth/kudu-obsolete,sitereactor/kudu,oliver-feng/kudu,shrimpy/kudu,juvchan/kudu,juvchan/kudu,uQr/kudu,duncansmart/kudu,kenegozi/kudu,juvchan/kudu,YOTOV-LIMITED/kudu,shrimpy/kudu,YOTOV-LIMITED/kudu,badescuga/kudu,shanselman/kudu,chrisrpatterson/kudu,MavenRain/kudu,EricSten-MSFT/kudu,mauricionr/kudu,puneet-gupta/kudu,projectkudu/kudu,projectkudu/kudu,kenegozi/kudu,sitereactor/kudu,WeAreMammoth/kudu-obsolete,oliver-feng/kudu,bbauya/kudu,sitereactor/kudu,juoni/kudu,chrisrpatterson/kudu,barnyp/kudu,juoni/kudu,puneet-gupta/kudu,puneet-gupta/kudu,barnyp/kudu,shibayan/kudu,kali786516/kudu,shrimpy/kudu,barnyp/kudu,uQr/kudu,shrimpy/kudu,badescuga/kudu,puneet-gupta/kudu,kali786516/kudu,projectkudu/kudu,shibayan/kudu,badescuga/kudu,MavenRain/kudu,shibayan/kudu,badescuga/kudu,shibayan/kudu,duncansmart/kudu,EricSten-MSFT/kudu,chrisrpatterson/kudu,puneet-gupta/kudu,bbauya/kudu,YOTOV-LIMITED/kudu,YOTOV-LIMITED/kudu,mauricionr/kudu,EricSten-MSFT/kudu,kenegozi/kudu,projectkudu/kudu,oliver-feng/kudu,WeAreMammoth/kudu-obsolete,kenegozi/kudu,MavenRain/kudu,juvchan/kudu,projectkudu/kudu,bbauya/kudu,chrisrpatterson/kudu
|
Kudu.Client/Ninject/DefaultBindings.cs
|
Kudu.Client/Ninject/DefaultBindings.cs
|
using Kudu.Client.Infrastructure;
using Kudu.Core.Deployment;
using Kudu.Core.Editor;
using Kudu.Core.SourceControl;
using Ninject;
using Ninject.Activation;
using Ninject.Modules;
namespace Kudu.Client {
public class DefaultBindings : NinjectModule {
public override void Load() {
Bind<ISiteConfiguration>().To<SiteConfiguration>();
Bind<IFileSystem>().ToMethod(context => GetFileSystem(context));
Bind<IRepository>().ToMethod(context => GetRepository(context));
Bind<IRepositoryManager>().ToMethod(context => GetRepositoryManager(context));
Bind<IDeploymentManager>().ToMethod(context => GetDeploymentManager(context));
}
private static IRepository GetRepository(IContext context) {
var siteConfiguration = context.Kernel.Get<ISiteConfiguration>();
return siteConfiguration.Repository;
}
private static IFileSystem GetFileSystem(IContext context) {
var siteConfiguration = context.Kernel.Get<ISiteConfiguration>();
return siteConfiguration.FileSystem;
}
private static IDeploymentManager GetDeploymentManager(IContext context) {
var siteConfiguration = context.Kernel.Get<ISiteConfiguration>();
return siteConfiguration.DeploymentManager;
}
private static IRepositoryManager GetRepositoryManager(IContext context) {
var siteConfiguration = context.Kernel.Get<ISiteConfiguration>();
return siteConfiguration.RepositoryManager;
}
}
}
|
using Kudu.Client.Infrastructure;
using Kudu.Core.Deployment;
using Kudu.Core.Editor;
using Kudu.Core.SourceControl;
using Ninject;
using Ninject.Activation;
using Ninject.Modules;
namespace Kudu.Client {
public class DefaultBindings : NinjectModule {
public override void Load() {
Bind<ISiteConfiguration>().To<SiteConfiguration>();
Bind<IFileSystem>().ToMethod(context => GetFileSystem(context));
Bind<IRepository>().ToMethod(context => GetRepository(context));
Bind<IRepositoryManager>().ToMethod(context => GetRepositoryManager(context));
Bind<IDeploymentManager>().ToMethod(context => GetDeploymentManager(context));
}
private static IRepository GetRepository(IContext context) {
var siteConfiguraiton = context.Kernel.Get<ISiteConfiguration>();
return siteConfiguraiton.Repository;
}
private static IFileSystem GetFileSystem(IContext context) {
var siteConfiguraiton = context.Kernel.Get<ISiteConfiguration>();
return siteConfiguraiton.FileSystem;
}
private static IDeploymentManager GetDeploymentManager(IContext context) {
var siteConfiguraiton = context.Kernel.Get<ISiteConfiguration>();
return siteConfiguraiton.DeploymentManager;
}
private static IRepositoryManager GetRepositoryManager(IContext context) {
var siteConfiguraiton = context.Kernel.Get<ISiteConfiguration>();
return siteConfiguraiton.RepositoryManager;
}
}
}
|
apache-2.0
|
C#
|
864f27d6fe1d720e3e8023eb8c628c752721348d
|
Update version to 0.4.0
|
mwijnands/PluploadMvc,mwijnands/PluploadMvc
|
PluploadMvc/Properties/AssemblyInfo.cs
|
PluploadMvc/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("XperiCode.PluploadMvc")]
[assembly: AssemblyDescription("Integrating Plupload with ASP.NET MVC.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("XperiCode")]
[assembly: AssemblyProduct("PluploadMvc")]
[assembly: AssemblyCopyright("Copyright © Marcel Wijnands 2014")]
[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("91218c84-b8e5-448a-a1fb-3691764fe5c2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.4.0.0")]
[assembly: AssemblyFileVersion("0.4.0.0")]
[assembly: AssemblyInformationalVersion("0.4.0")]
[assembly: InternalsVisibleTo("XperiCode.PluploadMvc.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("XperiCode.PluploadMvc")]
[assembly: AssemblyDescription("Integrating Plupload with ASP.NET MVC.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("XperiCode")]
[assembly: AssemblyProduct("PluploadMvc")]
[assembly: AssemblyCopyright("Copyright © Marcel Wijnands 2014")]
[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("91218c84-b8e5-448a-a1fb-3691764fe5c2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.3.0.0")]
[assembly: AssemblyFileVersion("0.3.0.0")]
[assembly: AssemblyInformationalVersion("0.3.0")]
[assembly: InternalsVisibleTo("XperiCode.PluploadMvc.Tests")]
|
mit
|
C#
|
548244f0495898492616f520fec7b08c267574d9
|
Add Union TMemoryBuffer support Client: csharp Patch: carl
|
jeking3/thrift,bitemyapp/thrift,collinmsn/thrift,i/thrift,dcelasun/thrift,koofr/thrift,x1957/thrift,bforbis/thrift,reTXT/thrift,jackscott/thrift,akshaydeo/thrift,bgould/thrift,jackscott/thrift,ochinchina/thrift,dtmuller/thrift,weweadsl/thrift,prashantv/thrift,strava/thrift,alfredtofu/thrift,siemens/thrift,strava/thrift,yongju-hong/thrift,springheeledjak/thrift,SirWellington/thrift,jackscott/thrift,bforbis/thrift,RobberPhex/thrift,jfarrell/thrift,EasonYi/thrift,apache/thrift,timse/thrift,eamosov/thrift,cjmay/thrift,SentientTechnologies/thrift,hcorg/thrift,x1957/thrift,dcelasun/thrift,dcelasun/thrift,edvakf/thrift,eonezhang/thrift,NOMORECOFFEE/thrift,Pertino/thrift,SuperAwesomeLTD/thrift,dsturnbull/thrift,haruwo/thrift-with-java-annotation-support,roshan/thrift,collinmsn/thrift,jeking3/thrift,Sean-Der/thrift,3013216027/thrift,nsuke/thrift,flandr/thrift,mway08/thrift,zhaorui1/thrift,zzmp/thrift,dtmuller/thrift,bufferoverflow/thrift,bmiklautz/thrift,strava/thrift,cjmay/thrift,ahnqirage/thrift,i/thrift,jfarrell/thrift,weweadsl/thrift,vashstorm/thrift,wfxiang08/thrift,adamvduke/thrift-adamd,bmiklautz/thrift,Fitbit/thrift,mway08/thrift,chentao/thrift,chenbaihu/thrift,mway08/thrift,reTXT/thrift,crisish/thrift,huahang/thrift,dongjiaqiang/thrift,Pertino/thrift,dongjiaqiang/thrift,NOMORECOFFEE/thrift,flandr/thrift,koofr/thrift,windofthesky/thrift,collinmsn/thrift,bmiklautz/thrift,ahnqirage/thrift,jeking3/thrift,creker/thrift,Jens-G/thrift,collinmsn/thrift,nsuke/thrift,Sean-Der/thrift,lion117/lib-thrift,dongjiaqiang/thrift,Jens-G/thrift,springheeledjak/thrift,lion117/lib-thrift,SuperAwesomeLTD/thrift,dcelasun/thrift,rmhartog/thrift,BluechipSystems/thrift,NOMORECOFFEE/thrift,joshuabezaleel/thrift,msonnabaum/thrift,dongjiaqiang/thrift,SuperAwesomeLTD/thrift,vashstorm/thrift,ochinchina/thrift,Sean-Der/thrift,tylertreat/thrift,theopolis/thrift,roshan/thrift,prathik/thrift,x1957/thrift,jpgneves/thrift,SentientTechnologies/thrift,windofthesky/thrift,cjmay/thrift,reTXT/thrift,rmhartog/thrift,SirWellington/thrift,dcelasun/thrift,Jimdo/thrift,elloray/thrift,dcelasun/thrift,eamosov/thrift,wfxiang08/thrift,reTXT/thrift,chenbaihu/thrift,guodongxiaren/thrift,gadLinux/thrift,SentientTechnologies/thrift,apache/thrift,Sean-Der/thrift,mway08/thrift,dwnld/thrift,Fitbit/thrift,lion117/lib-thrift,project-zerus/thrift,cjmay/thrift,siemens/thrift,spicavigo/thrift,apache/thrift,apache/thrift,tanmaykm/thrift,dwnld/thrift,flandr/thrift,x1957/thrift,msonnabaum/thrift,elloray/thrift,zzmp/thrift,Sean-Der/thrift,dtmuller/thrift,Jens-G/thrift,zhaorui1/thrift,eonezhang/thrift,msonnabaum/thrift,ykwd/thrift,markerickson-wf/thrift,JoeEnnever/thrift,dtmuller/thrift,koofr/thrift,wfxiang08/thrift,EasonYi/thrift,jeking3/thrift,prashantv/thrift,3013216027/thrift,jackscott/thrift,pinterest/thrift,jfarrell/thrift,prashantv/thrift,Jimdo/thrift,msonnabaum/thrift,ahnqirage/thrift,ykwd/thrift,vashstorm/thrift,elloray/thrift,dsturnbull/thrift,SirWellington/thrift,prathik/thrift,mindcandy/thrift,chenbaihu/thrift,collinmsn/thrift,ochinchina/thrift,ijuma/thrift,bitemyapp/thrift,Jimdo/thrift,guodongxiaren/thrift,creker/thrift,akshaydeo/thrift,prathik/thrift,alfredtofu/thrift,eamosov/thrift,BluechipSystems/thrift,EasonYi/thrift,apache/thrift,chentao/thrift,koofr/thrift,BluechipSystems/thrift,chentao/thrift,authbox-lib/thrift,markerickson-wf/thrift,mindcandy/thrift,BluechipSystems/thrift,jeking3/thrift,fernandobt8/thrift,chenbaihu/thrift,afds/thrift,Pertino/thrift,JoeEnnever/thrift,reTXT/thrift,afds/thrift,jfarrell/thrift,hcorg/thrift,RobberPhex/thrift,edvakf/thrift,ahnqirage/thrift,edvakf/thrift,gadLinux/thrift,dongjiaqiang/thrift,selaselah/thrift,theopolis/thrift,windofthesky/thrift,crisish/thrift,crisish/thrift,afds/thrift,EasonYi/thrift,chenbaihu/thrift,chentao/thrift,dsturnbull/thrift,strava/thrift,siemens/thrift,terminalcloud/thrift,lion117/lib-thrift,yongju-hong/thrift,chenbaihu/thrift,jfarrell/thrift,selaselah/thrift,weweadsl/thrift,evanweible-wf/thrift,wingedkiwi/thrift,eamosov/thrift,spicavigo/thrift,jackscott/thrift,dsturnbull/thrift,roshan/thrift,chenbaihu/thrift,gadLinux/thrift,Fitbit/thrift,collinmsn/thrift,flandr/thrift,dtmuller/thrift,ykwd/thrift,prashantv/thrift,project-zerus/thrift,afds/thrift,terminalcloud/thrift,zhaorui1/thrift,ykwd/thrift,SuperAwesomeLTD/thrift,mindcandy/thrift,SuperAwesomeLTD/thrift,nsuke/thrift,huahang/thrift,siemens/thrift,afds/thrift,theopolis/thrift,zzmp/thrift,dtmuller/thrift,bufferoverflow/thrift,terminalcloud/thrift,bholbrook73/thrift,wfxiang08/thrift,alfredtofu/thrift,edvakf/thrift,bitemyapp/thrift,guodongxiaren/thrift,windofthesky/thrift,dcelasun/thrift,bforbis/thrift,lion117/lib-thrift,dcelasun/thrift,nsuke/thrift,Jens-G/thrift,dtmuller/thrift,BluechipSystems/thrift,bmiklautz/thrift,gadLinux/thrift,markerickson-wf/thrift,msonnabaum/thrift,edvakf/thrift,bforbis/thrift,mindcandy/thrift,SentientTechnologies/thrift,Jens-G/thrift,wingedkiwi/thrift,Jimdo/thrift,hcorg/thrift,markerickson-wf/thrift,zzmp/thrift,eamosov/thrift,chenbaihu/thrift,eamosov/thrift,dcelasun/thrift,tanmaykm/thrift,bforbis/thrift,eamosov/thrift,NOMORECOFFEE/thrift,guodongxiaren/thrift,zhaorui1/thrift,terminalcloud/thrift,msonnabaum/thrift,zhaorui1/thrift,Fitbit/thrift,selaselah/thrift,chentao/thrift,theopolis/thrift,pinterest/thrift,rewardStyle/apache.thrift,alfredtofu/thrift,adamvduke/thrift-adamd,Jimdo/thrift,mindcandy/thrift,terminalcloud/thrift,lion117/lib-thrift,timse/thrift,spicavigo/thrift,selaselah/thrift,project-zerus/thrift,bitfinder/thrift,eonezhang/thrift,bholbrook73/thrift,terminalcloud/thrift,cjmay/thrift,upfluence/thrift,windofthesky/thrift,RobberPhex/thrift,pinterest/thrift,bholbrook73/thrift,theopolis/thrift,prathik/thrift,JoeEnnever/thrift,markerickson-wf/thrift,strava/thrift,elloray/thrift,akshaydeo/thrift,tanmaykm/thrift,ahnqirage/thrift,mindcandy/thrift,springheeledjak/thrift,ahnqirage/thrift,jpgneves/thrift,theopolis/thrift,koofr/thrift,bufferoverflow/thrift,bholbrook73/thrift,collinmsn/thrift,bforbis/thrift,tanmaykm/thrift,jpgneves/thrift,dsturnbull/thrift,crisish/thrift,ochinchina/thrift,Jimdo/thrift,mway08/thrift,joshuabezaleel/thrift,jackscott/thrift,bitemyapp/thrift,flandr/thrift,cjmay/thrift,vashstorm/thrift,upfluence/thrift,timse/thrift,pinterest/thrift,roshan/thrift,jeking3/thrift,springheeledjak/thrift,bgould/thrift,dwnld/thrift,RobberPhex/thrift,creker/thrift,gadLinux/thrift,weweadsl/thrift,roshan/thrift,i/thrift,apache/thrift,x1957/thrift,dtmuller/thrift,bgould/thrift,hcorg/thrift,crisish/thrift,pinterest/thrift,timse/thrift,JoeEnnever/thrift,timse/thrift,Fitbit/thrift,cjmay/thrift,chentao/thrift,edvakf/thrift,theopolis/thrift,joshuabezaleel/thrift,spicavigo/thrift,EasonYi/thrift,JoeEnnever/thrift,tanmaykm/thrift,reTXT/thrift,bitemyapp/thrift,tylertreat/thrift,RobberPhex/thrift,reTXT/thrift,project-zerus/thrift,selaselah/thrift,x1957/thrift,nsuke/thrift,afds/thrift,chenbaihu/thrift,wfxiang08/thrift,authbox-lib/thrift,dwnld/thrift,bmiklautz/thrift,theopolis/thrift,joshuabezaleel/thrift,edvakf/thrift,prathik/thrift,akshaydeo/thrift,afds/thrift,bforbis/thrift,nsuke/thrift,upfluence/thrift,eamosov/thrift,alfredtofu/thrift,BluechipSystems/thrift,i/thrift,apache/thrift,Fitbit/thrift,ochinchina/thrift,dcelasun/thrift,bforbis/thrift,prathik/thrift,JoeEnnever/thrift,koofr/thrift,cjmay/thrift,evanweible-wf/thrift,EasonYi/thrift,roshan/thrift,msonnabaum/thrift,Pertino/thrift,jeking3/thrift,tanmaykm/thrift,vashstorm/thrift,elloray/thrift,NOMORECOFFEE/thrift,timse/thrift,dsturnbull/thrift,chentao/thrift,yongju-hong/thrift,3013216027/thrift,zhaorui1/thrift,edvakf/thrift,i/thrift,evanweible-wf/thrift,3013216027/thrift,markerickson-wf/thrift,ochinchina/thrift,SentientTechnologies/thrift,markerickson-wf/thrift,wingedkiwi/thrift,koofr/thrift,fernandobt8/thrift,jfarrell/thrift,ahnqirage/thrift,upfluence/thrift,huahang/thrift,windofthesky/thrift,zzmp/thrift,flandr/thrift,timse/thrift,Jens-G/thrift,rmhartog/thrift,vashstorm/thrift,ochinchina/thrift,creker/thrift,timse/thrift,haruwo/thrift-with-java-annotation-support,tylertreat/thrift,wingedkiwi/thrift,siemens/thrift,vashstorm/thrift,EasonYi/thrift,bufferoverflow/thrift,bmiklautz/thrift,msonnabaum/thrift,alfredtofu/thrift,adamvduke/thrift-adamd,bgould/thrift,zhaorui1/thrift,msonnabaum/thrift,evanweible-wf/thrift,3013216027/thrift,jfarrell/thrift,Jens-G/thrift,huahang/thrift,dsturnbull/thrift,authbox-lib/thrift,dtmuller/thrift,prathik/thrift,mway08/thrift,prashantv/thrift,bitemyapp/thrift,guodongxiaren/thrift,BluechipSystems/thrift,adamvduke/thrift-adamd,jackscott/thrift,ijuma/thrift,bitemyapp/thrift,prashantv/thrift,jfarrell/thrift,RobberPhex/thrift,markerickson-wf/thrift,SirWellington/thrift,joshuabezaleel/thrift,Jimdo/thrift,dongjiaqiang/thrift,3013216027/thrift,markerickson-wf/thrift,timse/thrift,spicavigo/thrift,BluechipSystems/thrift,bitfinder/thrift,yongju-hong/thrift,RobberPhex/thrift,ochinchina/thrift,lion117/lib-thrift,Jimdo/thrift,gadLinux/thrift,SirWellington/thrift,markerickson-wf/thrift,3013216027/thrift,windofthesky/thrift,SirWellington/thrift,Jimdo/thrift,yongju-hong/thrift,ijuma/thrift,bufferoverflow/thrift,tylertreat/thrift,crisish/thrift,gadLinux/thrift,msonnabaum/thrift,bitemyapp/thrift,siemens/thrift,tylertreat/thrift,ijuma/thrift,huahang/thrift,rmhartog/thrift,elloray/thrift,bgould/thrift,ykwd/thrift,eamosov/thrift,authbox-lib/thrift,strava/thrift,dcelasun/thrift,evanweible-wf/thrift,project-zerus/thrift,eonezhang/thrift,dtmuller/thrift,flandr/thrift,authbox-lib/thrift,weweadsl/thrift,zzmp/thrift,prashantv/thrift,mindcandy/thrift,yongju-hong/thrift,SuperAwesomeLTD/thrift,pinterest/thrift,markerickson-wf/thrift,Jens-G/thrift,Jens-G/thrift,apache/thrift,alfredtofu/thrift,hcorg/thrift,i/thrift,JoeEnnever/thrift,dwnld/thrift,fernandobt8/thrift,hcorg/thrift,jackscott/thrift,gadLinux/thrift,chentao/thrift,Jens-G/thrift,lion117/lib-thrift,collinmsn/thrift,authbox-lib/thrift,dwnld/thrift,rmhartog/thrift,bforbis/thrift,eamosov/thrift,jfarrell/thrift,upfluence/thrift,cjmay/thrift,terminalcloud/thrift,fernandobt8/thrift,huahang/thrift,afds/thrift,ykwd/thrift,ykwd/thrift,dwnld/thrift,zhaorui1/thrift,gadLinux/thrift,jfarrell/thrift,guodongxiaren/thrift,NOMORECOFFEE/thrift,wfxiang08/thrift,ahnqirage/thrift,bholbrook73/thrift,pinterest/thrift,flandr/thrift,joshuabezaleel/thrift,eonezhang/thrift,eonezhang/thrift,siemens/thrift,wingedkiwi/thrift,ochinchina/thrift,siemens/thrift,project-zerus/thrift,RobberPhex/thrift,SentientTechnologies/thrift,bitfinder/thrift,dsturnbull/thrift,dwnld/thrift,creker/thrift,hcorg/thrift,vashstorm/thrift,apache/thrift,chentao/thrift,nsuke/thrift,lion117/lib-thrift,creker/thrift,pinterest/thrift,BluechipSystems/thrift,haruwo/thrift-with-java-annotation-support,mindcandy/thrift,springheeledjak/thrift,joshuabezaleel/thrift,terminalcloud/thrift,eonezhang/thrift,gadLinux/thrift,dsturnbull/thrift,bforbis/thrift,bmiklautz/thrift,yongju-hong/thrift,BluechipSystems/thrift,bufferoverflow/thrift,jeking3/thrift,flandr/thrift,bitemyapp/thrift,Fitbit/thrift,upfluence/thrift,tylertreat/thrift,prathik/thrift,yongju-hong/thrift,fernandobt8/thrift,theopolis/thrift,wfxiang08/thrift,upfluence/thrift,BluechipSystems/thrift,NOMORECOFFEE/thrift,Jens-G/thrift,Jimdo/thrift,akshaydeo/thrift,wfxiang08/thrift,ykwd/thrift,jpgneves/thrift,vashstorm/thrift,rewardStyle/apache.thrift,eonezhang/thrift,RobberPhex/thrift,jfarrell/thrift,guodongxiaren/thrift,apache/thrift,authbox-lib/thrift,bitfinder/thrift,hcorg/thrift,reTXT/thrift,edvakf/thrift,afds/thrift,SuperAwesomeLTD/thrift,collinmsn/thrift,edvakf/thrift,strava/thrift,SuperAwesomeLTD/thrift,jpgneves/thrift,rewardStyle/apache.thrift,hcorg/thrift,alfredtofu/thrift,ahnqirage/thrift,zhaorui1/thrift,elloray/thrift,prashantv/thrift,project-zerus/thrift,ykwd/thrift,msonnabaum/thrift,bitfinder/thrift,evanweible-wf/thrift,siemens/thrift,evanweible-wf/thrift,afds/thrift,bufferoverflow/thrift,EasonYi/thrift,chentao/thrift,tanmaykm/thrift,msonnabaum/thrift,vashstorm/thrift,bforbis/thrift,selaselah/thrift,koofr/thrift,wfxiang08/thrift,wingedkiwi/thrift,selaselah/thrift,Sean-Der/thrift,bitfinder/thrift,wfxiang08/thrift,reTXT/thrift,nsuke/thrift,zzmp/thrift,dwnld/thrift,dtmuller/thrift,creker/thrift,x1957/thrift,jeking3/thrift,3013216027/thrift,bforbis/thrift,rewardStyle/apache.thrift,vashstorm/thrift,gadLinux/thrift,fernandobt8/thrift,jfarrell/thrift,springheeledjak/thrift,theopolis/thrift,bgould/thrift,alfredtofu/thrift,dwnld/thrift,springheeledjak/thrift,eonezhang/thrift,edvakf/thrift,prashantv/thrift,Jens-G/thrift,bholbrook73/thrift,project-zerus/thrift,huahang/thrift,jpgneves/thrift,rewardStyle/apache.thrift,springheeledjak/thrift,guodongxiaren/thrift,weweadsl/thrift,zhaorui1/thrift,apache/thrift,wfxiang08/thrift,eamosov/thrift,Sean-Der/thrift,jpgneves/thrift,EasonYi/thrift,haruwo/thrift-with-java-annotation-support,markerickson-wf/thrift,bmiklautz/thrift,3013216027/thrift,flandr/thrift,dongjiaqiang/thrift,chenbaihu/thrift,SentientTechnologies/thrift,ijuma/thrift,Jens-G/thrift,spicavigo/thrift,eamosov/thrift,mway08/thrift,bforbis/thrift,dtmuller/thrift,reTXT/thrift,Pertino/thrift,i/thrift,evanweible-wf/thrift,tylertreat/thrift,jfarrell/thrift,gadLinux/thrift,ahnqirage/thrift,RobberPhex/thrift,guodongxiaren/thrift,RobberPhex/thrift,dongjiaqiang/thrift,jackscott/thrift,roshan/thrift,Jens-G/thrift,spicavigo/thrift,akshaydeo/thrift,collinmsn/thrift,SentientTechnologies/thrift,mway08/thrift,NOMORECOFFEE/thrift,Jens-G/thrift,SuperAwesomeLTD/thrift,SirWellington/thrift,rmhartog/thrift,nsuke/thrift,terminalcloud/thrift,SentientTechnologies/thrift,nsuke/thrift,weweadsl/thrift,authbox-lib/thrift,adamvduke/thrift-adamd,bufferoverflow/thrift,yongju-hong/thrift,nsuke/thrift,ochinchina/thrift,zhaorui1/thrift,rewardStyle/apache.thrift,huahang/thrift,RobberPhex/thrift,selaselah/thrift,yongju-hong/thrift,rewardStyle/apache.thrift,Sean-Der/thrift,eonezhang/thrift,terminalcloud/thrift,adamvduke/thrift-adamd,project-zerus/thrift,project-zerus/thrift,lion117/lib-thrift,ijuma/thrift,creker/thrift,yongju-hong/thrift,ijuma/thrift,haruwo/thrift-with-java-annotation-support,SirWellington/thrift,zzmp/thrift,bitfinder/thrift,bforbis/thrift,strava/thrift,SirWellington/thrift,bufferoverflow/thrift,mindcandy/thrift,jpgneves/thrift,weweadsl/thrift,SentientTechnologies/thrift,markerickson-wf/thrift,creker/thrift,adamvduke/thrift-adamd,prathik/thrift,EasonYi/thrift,strava/thrift,timse/thrift,bmiklautz/thrift,RobberPhex/thrift,ijuma/thrift,yongju-hong/thrift,weweadsl/thrift,koofr/thrift,apache/thrift,Fitbit/thrift,weweadsl/thrift,collinmsn/thrift,dsturnbull/thrift,rmhartog/thrift,prashantv/thrift,bmiklautz/thrift,bmiklautz/thrift,apache/thrift,gadLinux/thrift,hcorg/thrift,roshan/thrift,huahang/thrift,prathik/thrift,prathik/thrift,zzmp/thrift,roshan/thrift,pinterest/thrift,bitemyapp/thrift,3013216027/thrift,JoeEnnever/thrift,ochinchina/thrift,strava/thrift,nsuke/thrift,reTXT/thrift,3013216027/thrift,creker/thrift,elloray/thrift,jeking3/thrift,windofthesky/thrift,koofr/thrift,apache/thrift,bholbrook73/thrift,fernandobt8/thrift,creker/thrift,cjmay/thrift,pinterest/thrift,upfluence/thrift,RobberPhex/thrift,alfredtofu/thrift,crisish/thrift,bholbrook73/thrift,mway08/thrift,wfxiang08/thrift,Pertino/thrift,dongjiaqiang/thrift,timse/thrift,wingedkiwi/thrift,apache/thrift,Jens-G/thrift,gadLinux/thrift,SentientTechnologies/thrift,bitfinder/thrift,pinterest/thrift,SuperAwesomeLTD/thrift,Sean-Der/thrift,theopolis/thrift,jeking3/thrift,bgould/thrift,prashantv/thrift,authbox-lib/thrift,theopolis/thrift,dsturnbull/thrift,SentientTechnologies/thrift,dongjiaqiang/thrift,ijuma/thrift,springheeledjak/thrift,rmhartog/thrift,mway08/thrift,bgould/thrift,jfarrell/thrift,dcelasun/thrift,3013216027/thrift,bholbrook73/thrift,SirWellington/thrift,afds/thrift,bmiklautz/thrift,spicavigo/thrift,roshan/thrift,strava/thrift,yongju-hong/thrift,upfluence/thrift,BluechipSystems/thrift,akshaydeo/thrift,afds/thrift,Sean-Der/thrift,rmhartog/thrift,jeking3/thrift,lion117/lib-thrift,mway08/thrift,edvakf/thrift,upfluence/thrift,EasonYi/thrift,afds/thrift,jpgneves/thrift,authbox-lib/thrift,BluechipSystems/thrift,NOMORECOFFEE/thrift,NOMORECOFFEE/thrift,prathik/thrift,i/thrift,i/thrift,jpgneves/thrift,alfredtofu/thrift,bholbrook73/thrift,creker/thrift,siemens/thrift,crisish/thrift,Jimdo/thrift,Fitbit/thrift,x1957/thrift,zzmp/thrift,crisish/thrift,bitfinder/thrift,roshan/thrift,RobberPhex/thrift,ykwd/thrift,spicavigo/thrift,cjmay/thrift,jeking3/thrift,adamvduke/thrift-adamd,bgould/thrift,mindcandy/thrift,haruwo/thrift-with-java-annotation-support,creker/thrift,jfarrell/thrift,bitemyapp/thrift,wfxiang08/thrift,bgould/thrift,JoeEnnever/thrift,bholbrook73/thrift,theopolis/thrift,windofthesky/thrift,dcelasun/thrift,jpgneves/thrift,yongju-hong/thrift,RobberPhex/thrift,ahnqirage/thrift,Jens-G/thrift,JoeEnnever/thrift,jackscott/thrift,x1957/thrift,JoeEnnever/thrift,reTXT/thrift,x1957/thrift,windofthesky/thrift,afds/thrift,terminalcloud/thrift,springheeledjak/thrift,theopolis/thrift,nsuke/thrift,bforbis/thrift,wingedkiwi/thrift,evanweible-wf/thrift,rewardStyle/apache.thrift,springheeledjak/thrift,jpgneves/thrift,joshuabezaleel/thrift,bgould/thrift,bmiklautz/thrift,strava/thrift,zhaorui1/thrift,SuperAwesomeLTD/thrift,joshuabezaleel/thrift,koofr/thrift,selaselah/thrift,spicavigo/thrift,dwnld/thrift,rmhartog/thrift,jeking3/thrift,dwnld/thrift,nsuke/thrift,SentientTechnologies/thrift,Pertino/thrift,selaselah/thrift,Fitbit/thrift,cjmay/thrift,Fitbit/thrift,tylertreat/thrift,haruwo/thrift-with-java-annotation-support,eamosov/thrift,windofthesky/thrift,koofr/thrift,markerickson-wf/thrift,reTXT/thrift,crisish/thrift,elloray/thrift,terminalcloud/thrift,fernandobt8/thrift,jfarrell/thrift,haruwo/thrift-with-java-annotation-support,Jens-G/thrift,bitemyapp/thrift,bufferoverflow/thrift,ahnqirage/thrift,springheeledjak/thrift,fernandobt8/thrift,Sean-Der/thrift,joshuabezaleel/thrift,collinmsn/thrift,Sean-Der/thrift,Sean-Der/thrift,dongjiaqiang/thrift,elloray/thrift,Jimdo/thrift,weweadsl/thrift,fernandobt8/thrift,i/thrift,ochinchina/thrift,adamvduke/thrift-adamd,EasonYi/thrift,evanweible-wf/thrift,tanmaykm/thrift,elloray/thrift,hcorg/thrift,project-zerus/thrift,3013216027/thrift,chentao/thrift,crisish/thrift,hcorg/thrift,pinterest/thrift,dtmuller/thrift,x1957/thrift,Fitbit/thrift,bitfinder/thrift,rewardStyle/apache.thrift,bitfinder/thrift,Pertino/thrift,vashstorm/thrift,gadLinux/thrift,dcelasun/thrift,SentientTechnologies/thrift,apache/thrift,Pertino/thrift,Jimdo/thrift,chenbaihu/thrift,haruwo/thrift-with-java-annotation-support,ahnqirage/thrift,ijuma/thrift,bmiklautz/thrift,Sean-Der/thrift,authbox-lib/thrift,chenbaihu/thrift,akshaydeo/thrift,joshuabezaleel/thrift,Pertino/thrift,creker/thrift,strava/thrift,NOMORECOFFEE/thrift,bgould/thrift,akshaydeo/thrift,wfxiang08/thrift,strava/thrift,SirWellington/thrift,project-zerus/thrift,collinmsn/thrift,tanmaykm/thrift,siemens/thrift,gadLinux/thrift,Fitbit/thrift,wingedkiwi/thrift,elloray/thrift,selaselah/thrift,tylertreat/thrift,rmhartog/thrift,mindcandy/thrift,bgould/thrift,tylertreat/thrift,guodongxiaren/thrift,rewardStyle/apache.thrift,3013216027/thrift,bufferoverflow/thrift,haruwo/thrift-with-java-annotation-support,adamvduke/thrift-adamd,fernandobt8/thrift,bforbis/thrift,adamvduke/thrift-adamd,rewardStyle/apache.thrift,afds/thrift,lion117/lib-thrift,bforbis/thrift,dcelasun/thrift,bufferoverflow/thrift,flandr/thrift,tanmaykm/thrift,siemens/thrift,roshan/thrift,wingedkiwi/thrift,bitfinder/thrift,siemens/thrift,akshaydeo/thrift,jackscott/thrift,ochinchina/thrift,fernandobt8/thrift,eonezhang/thrift,chentao/thrift,Pertino/thrift,windofthesky/thrift,nsuke/thrift,SirWellington/thrift,wingedkiwi/thrift,weweadsl/thrift,Pertino/thrift,nsuke/thrift,Fitbit/thrift,yongju-hong/thrift,bholbrook73/thrift,strava/thrift,timse/thrift,ijuma/thrift,Fitbit/thrift,cjmay/thrift,3013216027/thrift,jeking3/thrift,ykwd/thrift,dtmuller/thrift,hcorg/thrift,tylertreat/thrift,mway08/thrift,spicavigo/thrift,JoeEnnever/thrift,pinterest/thrift,ijuma/thrift,dwnld/thrift,tanmaykm/thrift,eamosov/thrift,evanweible-wf/thrift,yongju-hong/thrift,zzmp/thrift,i/thrift,BluechipSystems/thrift,apache/thrift,prashantv/thrift,tanmaykm/thrift,guodongxiaren/thrift,project-zerus/thrift,Fitbit/thrift,hcorg/thrift,upfluence/thrift,joshuabezaleel/thrift,strava/thrift,chentao/thrift,strava/thrift,haruwo/thrift-with-java-annotation-support,NOMORECOFFEE/thrift,ykwd/thrift,i/thrift,roshan/thrift,mindcandy/thrift,lion117/lib-thrift,msonnabaum/thrift,flandr/thrift,huahang/thrift,gadLinux/thrift,dcelasun/thrift,zzmp/thrift,huahang/thrift,msonnabaum/thrift,evanweible-wf/thrift,roshan/thrift,alfredtofu/thrift,apache/thrift,eamosov/thrift,haruwo/thrift-with-java-annotation-support,guodongxiaren/thrift,bgould/thrift,Jimdo/thrift,ahnqirage/thrift,dcelasun/thrift,wfxiang08/thrift,akshaydeo/thrift,jackscott/thrift,reTXT/thrift,jeking3/thrift,dongjiaqiang/thrift,huahang/thrift,chentao/thrift,upfluence/thrift,nsuke/thrift,authbox-lib/thrift,authbox-lib/thrift,prathik/thrift,bufferoverflow/thrift,tylertreat/thrift,siemens/thrift,crisish/thrift,eamosov/thrift,bgould/thrift,yongju-hong/thrift,x1957/thrift,SuperAwesomeLTD/thrift,bufferoverflow/thrift,eonezhang/thrift,selaselah/thrift,collinmsn/thrift,RobberPhex/thrift,cjmay/thrift,terminalcloud/thrift,jackscott/thrift,pinterest/thrift,i/thrift
|
lib/csharp/src/Transport/TMemoryBuffer.cs
|
lib/csharp/src/Transport/TMemoryBuffer.cs
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.IO;
using System.Reflection;
using Thrift.Protocol;
namespace Thrift.Transport {
public class TMemoryBuffer : TTransport {
private readonly MemoryStream byteStream;
public TMemoryBuffer() {
byteStream = new MemoryStream();
}
public TMemoryBuffer(byte[] buf) {
byteStream = new MemoryStream(buf);
}
public override void Open() {
/** do nothing **/
}
public override void Close() {
/** do nothing **/
}
public override int Read(byte[] buf, int off, int len) {
return byteStream.Read(buf, off, len);
}
public override void Write(byte[] buf, int off, int len) {
byteStream.Write(buf, off, len);
}
public byte[] GetBuffer() {
return byteStream.ToArray();
}
public override bool IsOpen {
get { return true; }
}
public static byte[] Serialize(TAbstractBase s) {
var t = new TMemoryBuffer();
var p = new TBinaryProtocol(t);
s.Write(p);
return t.GetBuffer();
}
public static T DeSerialize<T>(byte[] buf) where T : TAbstractBase {
var trans = new TMemoryBuffer(buf);
var p = new TBinaryProtocol(trans);
if (typeof (TBase).IsAssignableFrom(typeof (T))) {
var method = typeof (T).GetMethod("Read", BindingFlags.Instance | BindingFlags.Public);
var t = Activator.CreateInstance<T>();
method.Invoke(t, new object[] {p});
return t;
} else {
var method = typeof (T).GetMethod("Read", BindingFlags.Static | BindingFlags.Public);
return (T) method.Invoke(null, new object[] {p});
}
}
private bool _IsDisposed;
// IDisposable
protected override void Dispose(bool disposing) {
if (!_IsDisposed) {
if (disposing) {
if (byteStream != null)
byteStream.Dispose();
}
}
_IsDisposed = true;
}
}
}
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.IO;
using System.Reflection;
using Thrift.Protocol;
namespace Thrift.Transport {
public class TMemoryBuffer : TTransport {
private readonly MemoryStream byteStream;
public TMemoryBuffer() {
byteStream = new MemoryStream();
}
public TMemoryBuffer(byte[] buf) {
byteStream = new MemoryStream(buf);
}
public override void Open() {
/** do nothing **/
}
public override void Close() {
/** do nothing **/
}
public override int Read(byte[] buf, int off, int len) {
return byteStream.Read(buf, off, len);
}
public override void Write(byte[] buf, int off, int len) {
byteStream.Write(buf, off, len);
}
public byte[] GetBuffer() {
return byteStream.ToArray();
}
public override bool IsOpen {
get { return true; }
}
public static byte[] Serialize(TBase s) {
var t = new TMemoryBuffer();
var p = new TBinaryProtocol(t);
s.Write(p);
return t.GetBuffer();
}
public static T DeSerialize<T>(byte[] buf) where T : TBase, new() {
var t = new T();
var trans = new TMemoryBuffer(buf);
var p = new TBinaryProtocol(trans);
t.Read(p);
return t;
}
private bool _IsDisposed;
// IDisposable
protected override void Dispose(bool disposing) {
if (!_IsDisposed) {
if (disposing) {
if (byteStream != null)
byteStream.Dispose();
}
}
_IsDisposed = true;
}
}
}
|
apache-2.0
|
C#
|
13162c7073470beb7d86d40d6c90dd897beec353
|
change dependency registration to use 'local' marker interfaces.
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
src/SFA.DAS.EmployerFinance/DependencyResolution/HashingRegistry.cs
|
src/SFA.DAS.EmployerFinance/DependencyResolution/HashingRegistry.cs
|
using System;
using SFA.DAS.EmployerFinance.Configuration;
using SFA.DAS.HashingService;
using StructureMap;
using IPublicHashingService = SFA.DAS.EmployerFinance.MarkerInterfaces.IPublicHashingService;
namespace SFA.DAS.EmployerFinance.DependencyResolution
{
public class HashingRegistry : Registry
{
public HashingRegistry()
{
For<IHashingService>()
.Use(
c =>
new HashingService.HashingService(
c.GetInstance<EmployerFinanceConfiguration>()
.AllowedHashstringCharacters,
c.GetInstance<EmployerFinanceConfiguration>()
.Hashstring));
For<IPublicHashingService>()
.Use<MarkerInterfaceWrapper>()
.Ctor<IHashingService>()
.Is(
c =>
new HashingService.HashingService(
c.GetInstance<EmployerFinanceConfiguration>()
.PublicAllowedHashstringCharacters,
c.GetInstance<EmployerFinanceConfiguration>()
.PublicHashstring)
);
}
}
class MarkerInterfaceWrapper
:IPublicHashingService
{
private readonly IHashingService _hashingServiceWithCorrectValuesForMarkerInterface;
public MarkerInterfaceWrapper(IHashingService hashingServiceWithCorrectValuesForMarkerInterface)
{
_hashingServiceWithCorrectValuesForMarkerInterface = hashingServiceWithCorrectValuesForMarkerInterface;
}
public string HashValue(long id)
{
return _hashingServiceWithCorrectValuesForMarkerInterface.HashValue(id);
}
public string HashValue(Guid id)
{
return _hashingServiceWithCorrectValuesForMarkerInterface.HashValue(id);
}
public string HashValue(string id)
{
return _hashingServiceWithCorrectValuesForMarkerInterface.HashValue(id);
}
public long DecodeValue(string id)
{
return _hashingServiceWithCorrectValuesForMarkerInterface.DecodeValue(id);
}
public Guid DecodeValueToGuid(string id)
{
return _hashingServiceWithCorrectValuesForMarkerInterface.DecodeValueToGuid(id);
}
public string DecodeValueToString(string id)
{
return _hashingServiceWithCorrectValuesForMarkerInterface.DecodeValueToString(id);
}
public bool TryDecodeValue(string input, out long output)
{
return _hashingServiceWithCorrectValuesForMarkerInterface.TryDecodeValue(
input,
out output);
}
}
}
|
using SFA.DAS.EmployerFinance.Configuration;
using SFA.DAS.HashingService;
using SFA.DAS.ObsoleteHashing;
using StructureMap;
namespace SFA.DAS.EmployerFinance.DependencyResolution
{
public class HashingRegistry : Registry
{
public HashingRegistry()
{
For<IHashingService>().Use(c => GetHashingService(c));
For<IPublicHashingService>().Use(c => GetPublicHashingservice(c));
}
private IHashingService GetHashingService(IContext context)
{
var config = context.GetInstance<EmployerFinanceConfiguration>();
var hashingService = new HashingService.HashingService(config.AllowedHashstringCharacters, config.Hashstring);
return hashingService;
}
private IPublicHashingService GetPublicHashingservice(IContext context)
{
var config = context.GetInstance<EmployerFinanceConfiguration>();
var publicHashingService = new PublicHashingService(config.PublicAllowedHashstringCharacters, config.PublicHashstring);
return publicHashingService;
}
}
}
|
mit
|
C#
|
260bf4dfd7bac5de37eba004ac43dc9bfe04c9f6
|
Update WalletController.cs
|
kristjank/ark-net,sharkdev-j/ark-net
|
ark-net/Controller/WalletController.cs
|
ark-net/Controller/WalletController.cs
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="WalletController.cs" company="Ark">
// MIT License
// //
// // Copyright (c) 2017 Kristjan Košič
// //
// // 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.
// </copyright>
// <summary>
// Defines the Wallet Controller type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ArkNet.Controller
{
using System;
/// <summary>
/// The wallet controller (Not implemented yet)
/// </summary>
public class WalletController
{
/// <summary>
/// Initializes a new instance of the <see cref="WalletController"/> class.
/// Throws a <see cref="NotImplementedException"/> error.
/// </summary>
public WalletController()
{
throw new NotImplementedException();
}
}
}
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="WalletController.cs" company="Ark Labs">
// MIT License
// //
// // Copyright (c) 2017 Kristjan Košič
// //
// // 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.
// </copyright>
// <summary>
// Defines the Wallet Controller type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ArkNet.Controller
{
using System;
/// <summary>
/// The wallet controller (Not implemented yet)
/// </summary>
public class WalletController
{
/// <summary>
/// Initializes a new instance of the <see cref="WalletController"/> class.
/// Throws a <see cref="NotImplementedException"/> error.
/// </summary>
public WalletController()
{
throw new NotImplementedException();
}
}
}
|
mit
|
C#
|
9b55648e41f044de583d6d682f3b964e398af034
|
Fix build
|
btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver
|
BTCPayServer/Views/Server/_Nav.cshtml
|
BTCPayServer/Views/Server/_Nav.cshtml
|
<div class="nav flex-column nav-pills">
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Users)" asp-action="Users">Users</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Emails)" asp-action="Emails">Email server</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Policies)" asp-action="Policies">Policies</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Services)" asp-action="Services">Services</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Theme)" asp-action="Theme">Theme</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Maintenance)" asp-action="Maintenance">Maintenance</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Logs)" asp-action="Logs">Logs</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Files)" asp-action="Files">Files</a>
</div>
|
<div class="nav flex-column nav-pills">
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Users)" asp-action="Users">Users</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Rates)" asp-action="Rates">Rates</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Emails)" asp-action="Emails">Email server</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Policies)" asp-action="Policies">Policies</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Services)" asp-action="Services">Services</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Theme)" asp-action="Theme">Theme</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Maintenance)" asp-action="Maintenance">Maintenance</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Logs)" asp-action="Logs">Logs</a>
<a class="nav-link @ViewData.IsActivePage(ServerNavPages.Files)" asp-action="Files">Files</a>
</div>
|
mit
|
C#
|
47d2c8f644239120afc69731d977d67727f0fb10
|
Add test for invalid range
|
farity/farity
|
CSharp.Functional.Tests/RangeTests.cs
|
CSharp.Functional.Tests/RangeTests.cs
|
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Xunit;
namespace CSharp.Functional.Tests
{
public class RangeTests
{
[Theory]
[InlineData(0, 1)]
public void RangeProvidesAnIEnumerable(int start, int end)
{
var result = F.Range(start, end);
Assert.IsAssignableFrom<IEnumerable>(result);
}
[Theory]
[InlineData(0, 1)]
public void RangeProvidesAnIEnumerableOfIntegers(int start, int end)
{
var result = F.Range(start, end);
Assert.IsAssignableFrom<IEnumerable<int>>(result);
}
[Theory]
[InlineData(0, 1)]
[InlineData(0, 0)]
public void RangeBeginssAtStartValue(int start, int end)
{
var result = F.Range(start, end).First();
Assert.Equal(start, result);
}
[Theory]
[InlineData(0, 1)]
[InlineData(0, 0)]
public void RangeTerminatesAtEndValue(int start, int end)
{
var result = F.Range(start, end).Last();
Assert.Equal(end, result);
}
[Theory]
[InlineData(0, -3)]
[InlineData(5, 2)]
public void RangeReturnsEmptyEnumerableOnInvalidRanges(int start, int end)
{
var result = F.Range(start, end).ToList();
Assert.Equal(0, result.Count);
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Xunit;
namespace CSharp.Functional.Tests
{
public class RangeTests
{
[Theory]
[InlineData(0, 1)]
public void RangeProvidesAnIEnumerable(int start, int end)
{
var result = F.Range(start, end);
Assert.IsAssignableFrom<IEnumerable>(result);
}
[Theory]
[InlineData(0, 1)]
public void RangeProvidesAnIEnumerableOfIntegers(int start, int end)
{
var result = F.Range(start, end);
Assert.IsAssignableFrom<IEnumerable<int>>(result);
}
[Theory]
[InlineData(0, 1)]
[InlineData(0, 0)]
public void RangeBeginssAtStartValue(int start, int end)
{
var result = F.Range(start, end).First();
Assert.Equal(start, result);
}
[Theory]
[InlineData(0, 1)]
[InlineData(0, 0)]
public void RangeTerminatesAtEndValue(int start, int end)
{
var result = F.Range(start, end).Last();
Assert.Equal(end, result);
}
}
}
|
mit
|
C#
|
0c8c094c8199db38cea0818d12521e624bfa93b9
|
Fix several bugs in Program
|
wjk/ChocolateyInstaller,wjk/ChocolateyInstaller,wjk/ChocolateyInstaller
|
ChocolateyInstaller.Wizard/Program.cs
|
ChocolateyInstaller.Wizard/Program.cs
|
using System;
using System.IO.Pipes;
using System.Windows.Forms;
namespace ChocolateyInstaller.Wizard
{
static class Program
{
[STAThread]
static void Main(string[] args)
{
if (args.Length > 0 && args[0] == "/install")
{
AnonymousPipeClientStream pipe = (args.Length > 1) ? new AnonymousPipeClientStream(args[1]) : null;
BatchInstaller installer = new BatchInstaller(pipe);
installer.Run();
byte[] doneMsg = System.Text.Encoding.UTF8.GetBytes("DONE\n");
if (pipe != null) pipe.Write(doneMsg, 0, doneMsg.Length);
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}
|
using System;
using System.IO.Pipes;
using System.Windows.Forms;
namespace ChocolateyInstaller.Wizard
{
static class Program
{
[STAThread]
static void Main(string[] args)
{
if (args[0] == "/install")
{
AnonymousPipeClientStream pipe = (args.Length > 1) ? new AnonymousPipeClientStream(args[1]) : null;
BatchInstaller installer = new BatchInstaller(pipe);
installer.Run();
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}
|
mit
|
C#
|
747fa191779ce69545788e76eba3231c78ddc260
|
add ET support for custom variables
|
maul-esel/CobaltAHK,maul-esel/CobaltAHK
|
CobaltAHK/ExpressionTree/Generator.cs
|
CobaltAHK/ExpressionTree/Generator.cs
|
using System;
using System.Collections.Generic;
using DLR = System.Linq.Expressions;
using CobaltAHK.Expressions;
namespace CobaltAHK.ExpressionTree
{
public static class Generator
{
public static DLR.Expression Generate(Expression expr, Scope scope, ScriptSettings settings)
{
if (expr is FunctionCallExpression) {
return GenerateFunctionCall((FunctionCallExpression)expr, scope, settings);
} else if (expr is FunctionDefinitionExpression) {
return GenerateFunctionDefinition((FunctionDefinitionExpression)expr, scope, settings);
} else if (expr is CustomVariableExpression) {
return scope.ResolveVariable(((CustomVariableExpression)expr).Name);
} else if (expr is StringLiteralExpression) {
return DLR.Expression.Constant(((StringLiteralExpression)expr).String);
} else if (expr is NumberLiteralExpression) {
return DLR.Expression.Constant(((NumberLiteralExpression)expr).GetValue());
}
throw new NotImplementedException();
}
private static DLR.Expression GenerateFunctionCall(FunctionCallExpression func, Scope scope, ScriptSettings settings)
{
var lambda = scope.ResolveFunction(func.Name);
var prms = new List<DLR.Expression>();
foreach (var p in func.Parameters) {
prms.Add(Generate(p, scope, settings));
}
return DLR.Expression.Invoke(lambda, prms);
}
private static DLR.Expression GenerateFunctionDefinition(FunctionDefinitionExpression func, Scope scope, ScriptSettings settings)
{
var funcScope = new Scope();
var prms = new List<DLR.ParameterExpression>();
var types = new List<Type>(prms.Count + 1);
foreach (var p in func.Parameters) {
// todo: default values
var param = DLR.Expression.Parameter(typeof(object), p.Name);
prms.Add(param);
funcScope.AddVariable(p.Name, param);
var type = typeof(object);
if (p.Modifier.HasFlag(Syntax.ParameterModifier.ByRef)) {
type = type.MakeByRefType();
}
types.Add(type);
}
types.Add(typeof(void)); // return value
var funcBody = new List<DLR.Expression>();
foreach (var e in func.Body) {
funcBody.Add(Generate(e, funcScope, settings));
}
var funcType = DLR.Expression.GetFuncType(types.ToArray());
var function = DLR.Expression.Lambda(funcType, DLR.Expression.Block(funcBody), func.Name, prms); // todo: use Label instead of Block? (see dlr-overview p. 35)
scope.AddFunction(func.Name, function); // todo: can't call itself, because body is generated before function is complete
return function;
}
}
}
|
using System;
using System.Collections.Generic;
using DLR = System.Linq.Expressions;
using CobaltAHK.Expressions;
namespace CobaltAHK.ExpressionTree
{
public static class Generator
{
public static DLR.Expression Generate(Expression expr, Scope scope, ScriptSettings settings)
{
if (expr is FunctionCallExpression) {
return GenerateFunctionCall((FunctionCallExpression)expr, scope, settings);
} else if (expr is FunctionDefinitionExpression) {
return GenerateFunctionDefinition((FunctionDefinitionExpression)expr, scope, settings);
} else if (expr is StringLiteralExpression) {
return DLR.Expression.Constant(((StringLiteralExpression)expr).String);
} else if (expr is NumberLiteralExpression) {
return DLR.Expression.Constant(((NumberLiteralExpression)expr).GetValue());
}
throw new NotImplementedException();
}
private static DLR.Expression GenerateFunctionCall(FunctionCallExpression func, Scope scope, ScriptSettings settings)
{
var lambda = scope.ResolveFunction(func.Name);
var prms = new List<DLR.Expression>();
foreach (var p in func.Parameters) {
prms.Add(Generate(p, scope, settings));
}
return DLR.Expression.Invoke(lambda, prms);
}
private static DLR.Expression GenerateFunctionDefinition(FunctionDefinitionExpression func, Scope scope, ScriptSettings settings)
{
var funcScope = new Scope();
var prms = new List<DLR.ParameterExpression>();
var types = new List<Type>(prms.Count + 1);
foreach (var p in func.Parameters) {
// todo: default values
var param = DLR.Expression.Parameter(typeof(object), p.Name);
prms.Add(param);
funcScope.AddVariable(p.Name, param);
var type = typeof(object);
if (p.Modifier.HasFlag(Syntax.ParameterModifier.ByRef)) {
type = type.MakeByRefType();
}
types.Add(type);
}
types.Add(typeof(void)); // return value
var funcBody = new List<DLR.Expression>();
foreach (var e in func.Body) {
funcBody.Add(Generate(e, funcScope, settings));
}
var funcType = DLR.Expression.GetFuncType(types.ToArray());
var function = DLR.Expression.Lambda(funcType, DLR.Expression.Block(funcBody), func.Name, prms); // todo: use Label instead of Block? (see dlr-overview p. 35)
scope.AddFunction(func.Name, function); // todo: can't call itself, because body is generated before function is complete
return function;
}
}
}
|
mit
|
C#
|
1d37217c3227eaf5421bef43cb3654b48faaad12
|
Update TreeScript
|
jojona/AGI17_perkunas,jojona/AGI17_perkunas
|
Perkunas/Assets/Scripts/TreeScript.cs
|
Perkunas/Assets/Scripts/TreeScript.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TreeScript : MonoBehaviour {
public float offset = 0;
private GameObject terrainObject;
private GrabableTerrain grabTerrain;
private Terrain terrain;
private float heightmapPosX;
private float heightmapPosZ;
// Use this for initialization
void Start () {
terrainObject = GameObject.Find ("Terrain");
terrain = terrainObject.GetComponent<Terrain> ();
grabTerrain = terrain.GetComponent ("GrabableTerrain") as GrabableTerrain;
heightmapPosX = transform.position.x / grabTerrain.terrainWidth * terrain.terrainData.heightmapWidth;
heightmapPosZ = transform.position.z / grabTerrain.terrainWidth * terrain.terrainData.heightmapWidth;
float y = terrain.terrainData.GetHeight ((int)heightmapPosX, (int)heightmapPosZ);
transform.Translate (new Vector3(transform.position.x, y, transform.position.z)- transform.position);
}
// Update is called once per frame
void Update () {
// Update y - position based on terrain
float y = terrain.terrainData.GetHeight ((int)heightmapPosX, (int)heightmapPosZ) + offset;
transform.Translate ( new Vector3(transform.position.x, y, transform.position.z) -transform.position);
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TreeScript : MonoBehaviour {
private GameObject terrainObject;
private GrabableTerrain grabTerrain;
private Terrain terrain;
private float heightmapPosX;
private float heightmapPosZ;
// Use this for initialization
void Start () {
terrainObject = GameObject.Find ("Terrain");
terrain = terrainObject.GetComponent<Terrain> ();
grabTerrain = terrain.GetComponent ("GrabableTerrain") as GrabableTerrain;
heightmapPosX = transform.position.x / grabTerrain.terrainWidth * terrain.terrainData.heightmapWidth;
heightmapPosZ = transform.position.z / grabTerrain.terrainWidth * terrain.terrainData.heightmapWidth;
float y = terrain.terrainData.GetHeight ((int)heightmapPosX, (int)heightmapPosZ);
transform.Translate (new Vector3(transform.position.x, y, transform.position.z)- transform.position);
}
// Update is called once per frame
void Update () {
// Update y - position based on terrain
float y = terrain.terrainData.GetHeight ((int)heightmapPosX, (int)heightmapPosZ);
transform.Translate ( new Vector3(transform.position.x, y, transform.position.z) -transform.position);
}
}
|
mit
|
C#
|
7a8837b4b8843b7b40503afe91e29c5be0e8e18a
|
Update mines.cs
|
GTANetworkDev/ExampleResources,GTANetworkDev/ExampleResources,GTANetworkDev/ExampleResources,GTANetworkDev/ExampleResources
|
mines/mines.cs
|
mines/mines.cs
|
using GTANetworkAPI;
public class MinesScript : Script
{
[ServerEvent(Event.ResourceStart)]
public void MyResourceStart()
{
NAPI.Util.ConsoleOutput("Mines resource started!");
}
[Command("mine")]
public void PlaceMine(Client sender, float mineRange = 10f)
{
var playerPos = NAPI.Entity.GetEntityPosition(sender);
var playerDimension = NAPI.Entity.GetEntityDimension(sender);
var minePropHash = NAPI.Util.GetHashKey("prop_bomb_01");
var mineProp = NAPI.Object.CreateObject(minePropHash, playerPos - new Vector3(0, 0, 1f), new Vector3(), dimension: playerDimension);
var colShape = NAPI.ColShape.CreateSphereColShape(playerPos, mineRange, playerDimension);
var isMineArmed = false;
colShape.OnEntityEnterColShape += (s, ent) =>
{
if (!isMineArmed) return;
NAPI.Explosion.CreateOwnedExplosion(sender, ExplosionType.HiOctane, playerPos, 1f, playerDimension);
NAPI.Entity.DeleteEntity(mineProp);
NAPI.ColShape.DeleteColShape(colShape);
};
colShape.OnEntityExitColShape += (s, ent) =>
{
if (isMineArmed) return;
isMineArmed = true;
NAPI.Notification.SendNotificationToPlayer(sender, "Mine has been ~r~armed~w~!", true);
};
}
}
|
namespace WipRagempResource.mines
{
using GTANetworkAPI;
public class MinesTest : Script
{
public MinesTest()
{
}
[ServerEvent(Event.ResourceStart)]
public void MyResourceStart()
{
NAPI.Util.ConsoleOutput("Starting mines!");
}
[Command("mine")]
public void PlaceMine(Client sender, float MineRange = 10f)
{
var pos = NAPI.Entity.GetEntityPosition(sender);
var playerDimension = NAPI.Entity.GetEntityDimension(sender);
var prop = NAPI.Object.CreateObject((int) NAPI.Util.GetHashKey("prop_bomb_01"), pos - new Vector3(0, 0, 1f), (Quaternion) new Vector3(), playerDimension);
var shape = NAPI.ColShape.CreateSphereColShape(pos, MineRange);
shape.Dimension = playerDimension;
bool mineArmed = false;
shape.OnEntityEnterColShape += (s, ent) =>
{
if (!mineArmed) return;
NAPI.Explosion.CreateOwnedExplosion(sender, ExplosionType.HiOctane, pos, 1f, playerDimension);
NAPI.Entity.DeleteEntity(prop);
NAPI.ColShape.DeleteColShape(shape);
};
shape.OnEntityExitColShape += (s, ent) =>
{
if (ent == sender.Handle && !mineArmed)
{
mineArmed = true;
NAPI.Notification.SendNotificationToPlayer(sender, "Mine has been ~r~armed~w~!", true);
}
};
}
}
}
|
mit
|
C#
|
0eeca8faf9d548fa3a3cdb600eb42338ab3113d5
|
Fix dash being minus sign in PTS Formatter
|
LiveSplit/LiveSplit,Glurmo/LiveSplit,kugelrund/LiveSplit,ROMaster2/LiveSplit,Glurmo/LiveSplit,kugelrund/LiveSplit,Glurmo/LiveSplit,kugelrund/LiveSplit,ROMaster2/LiveSplit,ROMaster2/LiveSplit
|
LiveSplit/LiveSplit.Core/TimeFormatters/PossibleTimeSaveFormatter.cs
|
LiveSplit/LiveSplit.Core/TimeFormatters/PossibleTimeSaveFormatter.cs
|
using System;
namespace LiveSplit.TimeFormatters
{
public class PossibleTimeSaveFormatter : ITimeFormatter
{
public TimeAccuracy Accuracy { get; set; }
public string Format(TimeSpan? time)
{
var formatter = new ShortTimeFormatter();
if (time == null)
return "-";
else
{
var timeString = formatter.Format(time);
if (Accuracy == TimeAccuracy.Hundredths)
return timeString;
else if (Accuracy == TimeAccuracy.Tenths)
return timeString.Substring(0, timeString.Length - 1);
else
return timeString.Substring(0, timeString.Length - 3);
}
}
}
}
|
using System;
namespace LiveSplit.TimeFormatters
{
public class PossibleTimeSaveFormatter : ITimeFormatter
{
public TimeAccuracy Accuracy { get; set; }
public string Format(TimeSpan? time)
{
var formatter = new ShortTimeFormatter();
if (time == null)
return "−";
else
{
var timeString = formatter.Format(time);
if (Accuracy == TimeAccuracy.Hundredths)
return timeString;
else if (Accuracy == TimeAccuracy.Tenths)
return timeString.Substring(0, timeString.Length - 1);
else
return timeString.Substring(0, timeString.Length - 3);
}
}
}
}
|
mit
|
C#
|
396847d363b6b324e21712f1ed0c09494d08e3a9
|
Implement Equals and GetHashCode in NullableValue
|
ermshiperete/libpalaso,gmartin7/libpalaso,tombogle/libpalaso,tombogle/libpalaso,glasseyes/libpalaso,glasseyes/libpalaso,ermshiperete/libpalaso,ddaspit/libpalaso,gtryus/libpalaso,gmartin7/libpalaso,andrew-polk/libpalaso,mccarthyrb/libpalaso,mccarthyrb/libpalaso,sillsdev/libpalaso,ermshiperete/libpalaso,ddaspit/libpalaso,tombogle/libpalaso,andrew-polk/libpalaso,gtryus/libpalaso,glasseyes/libpalaso,gmartin7/libpalaso,glasseyes/libpalaso,gtryus/libpalaso,andrew-polk/libpalaso,gtryus/libpalaso,gmartin7/libpalaso,sillsdev/libpalaso,mccarthyrb/libpalaso,sillsdev/libpalaso,ddaspit/libpalaso,ermshiperete/libpalaso,tombogle/libpalaso,andrew-polk/libpalaso,sillsdev/libpalaso,mccarthyrb/libpalaso,ddaspit/libpalaso
|
SIL.Core/ObjectModel/NullableValue.cs
|
SIL.Core/ObjectModel/NullableValue.cs
|
using System.Collections;
using System.Collections.Generic;
namespace SIL.ObjectModel
{
public struct NullableValue<T> : IStructuralEquatable
{
private T _value;
private bool _hasValue;
public NullableValue(T value)
{
_value = value;
_hasValue = true;
}
public bool HasValue
{
get { return _hasValue; }
set
{
_hasValue = value;
if (!_hasValue)
_value = default(T);
}
}
public T Value
{
get { return _value; }
set
{
_value = value;
_hasValue = true;
}
}
public override string ToString()
{
if (_hasValue)
return _value.ToString();
return "null";
}
public override bool Equals(object obj)
{
return ((IStructuralEquatable) this).Equals(obj, EqualityComparer<object>.Default);
}
public override int GetHashCode()
{
return ((IStructuralEquatable) this).GetHashCode(EqualityComparer<object>.Default);
}
bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
{
if (!(other is NullableValue<T>))
return false;
var otherVal = (NullableValue<T>) other;
if (!_hasValue && !otherVal._hasValue)
return true;
return _hasValue && otherVal._hasValue && comparer.Equals(_value, otherVal._value);
}
int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
{
if (_hasValue)
return comparer.GetHashCode(_value);
return 0;
}
}
}
|
using System.Collections;
namespace SIL.ObjectModel
{
public struct NullableValue<T> : IStructuralEquatable
{
private T _value;
private bool _hasValue;
public NullableValue(T value)
{
_value = value;
_hasValue = true;
}
public bool HasValue
{
get { return _hasValue; }
set
{
_hasValue = value;
if (!_hasValue)
_value = default(T);
}
}
public T Value
{
get { return _value; }
set
{
_value = value;
_hasValue = true;
}
}
public override string ToString()
{
if (_hasValue)
return _value.ToString();
return "null";
}
bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
{
if (!(other is NullableValue<T>))
return false;
var otherVal = (NullableValue<T>) other;
if (!_hasValue && !otherVal._hasValue)
return true;
return _hasValue && otherVal._hasValue && comparer.Equals(_value, otherVal._value);
}
int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
{
if (_hasValue)
return comparer.GetHashCode(_value);
return 0;
}
}
}
|
mit
|
C#
|
0487178c3d9105407e3394dac169595bcdfa653f
|
Simplify login docs region & only show action
|
GoogleCloudPlatform/getting-started-dotnet,GoogleCloudPlatform/getting-started-dotnet,GoogleCloudPlatform/getting-started-dotnet
|
aspnet/4-auth/Controllers/SessionController.cs
|
aspnet/4-auth/Controllers/SessionController.cs
|
// Copyright(c) 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
using System.Web;
using System.Web.Mvc;
using Microsoft.Owin.Security;
namespace GoogleCloudSamples.Controllers
{
public class SessionController : Controller
{
// [START login]
public void Login()
{
// Redirect to the Google OAuth 2.0 user consent screen
HttpContext.GetOwinContext().Authentication.Challenge(
new AuthenticationProperties { RedirectUri = "/" },
"Google"
);
}
// [END login]
// [START logout]
public ActionResult Logout()
{
Request.GetOwinContext().Authentication.SignOut();
return Redirect("/");
}
// [END logout]
}
}
|
// Copyright(c) 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
using System.Web;
using System.Web.Mvc;
using Microsoft.Owin.Security;
namespace GoogleCloudSamples.Controllers
{
// [START login]
public class SessionController : Controller
{
public void Login()
{
// Redirect to the Google OAuth 2.0 user consent screen
HttpContext.GetOwinContext().Authentication.Challenge(
new AuthenticationProperties { RedirectUri = "/" },
"Google"
);
}
// ...
// [END login]
// [START logout]
public ActionResult Logout()
{
Request.GetOwinContext().Authentication.SignOut();
return Redirect("/");
}
// [END logout]
}
}
|
apache-2.0
|
C#
|
4f0a1d0ed8dad56c09732924b857e641f838c035
|
Fix bad SourceCodeUrl.
|
ejball/ArgsReading
|
tools/Build/Build.cs
|
tools/Build/Build.cs
|
using System;
using Faithlife.Build;
internal static class Build
{
public static int Main(string[] args) => BuildRunner.Execute(args, build =>
{
build.AddDotNetTargets(
new DotNetBuildSettings
{
DocsSettings = new DotNetDocsSettings
{
GitLogin = new GitLoginInfo("ejball", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""),
GitAuthor = new GitAuthorInfo("ejball", "ejball@gmail.com"),
SourceCodeUrl = "https://github.com/ejball/ArgsReading/tree/master/src",
},
});
build.Target("default")
.DependsOn("build");
});
}
|
using System;
using Faithlife.Build;
internal static class Build
{
public static int Main(string[] args) => BuildRunner.Execute(args, build =>
{
build.AddDotNetTargets(
new DotNetBuildSettings
{
DocsSettings = new DotNetDocsSettings
{
GitLogin = new GitLoginInfo("ejball", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""),
GitAuthor = new GitAuthorInfo("ejball", "ejball@gmail.com"),
SourceCodeUrl = "https://github.com/ejball/RepoName/tree/master/src",
},
});
build.Target("default")
.DependsOn("build");
});
}
|
mit
|
C#
|
717fd4381de1c35866e0a9f7ecaeb981b7031003
|
Use minimal build verbosity.
|
FacilityApi/FacilityCSharp,FacilityApi/FacilityJavaScript,FacilityApi/FacilityJavaScript,FacilityApi/FacilityJavaScript,FacilityApi/Facility
|
tools/Build/Build.cs
|
tools/Build/Build.cs
|
using System;
using System.Linq;
using Faithlife.Build;
using static Faithlife.Build.BuildUtility;
using static Faithlife.Build.DotNetRunner;
internal static class Build
{
public static int Main(string[] args) => BuildRunner.Execute(args, build =>
{
var codegen = "fsdgen___";
var dotNetBuildSettings = new DotNetBuildSettings
{
NuGetApiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY"),
DocsSettings = new DotNetDocsSettings
{
GitLogin = new GitLoginInfo("FacilityApiBot", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""),
GitAuthor = new GitAuthorInfo("FacilityApiBot", "facilityapi@gmail.com"),
GitBranchName = Environment.GetEnvironmentVariable("APPVEYOR_REPO_BRANCH"),
SourceCodeUrl = "https://github.com/FacilityApi/RepoTemplate/tree/master/src",
ProjectHasDocs = name => !name.StartsWith("fsdgen", StringComparison.Ordinal),
},
Verbosity = DotNetBuildVerbosity.Minimal,
};
build.AddDotNetTargets(dotNetBuildSettings);
build.Target("codegen")
.DependsOn("build")
.Describe("Generates code from the FSD")
.Does(() => codeGen(verify: false));
build.Target("verify-codegen")
.DependsOn("build")
.Describe("Ensures the generated code is up-to-date")
.Does(() => codeGen(verify: true));
build.Target("test")
.DependsOn("verify-codegen");
void codeGen(bool verify)
{
var configuration = dotNetBuildSettings!.BuildOptions!.ConfigurationOption!.Value;
var toolPath = FindFiles($"src/{codegen}/bin/{configuration}/netcoreapp*/{codegen}.dll").FirstOrDefault();
var verifyOption = verify ? "--verify" : null;
RunDotNet(toolPath, "___", "___", "--newline", "lf", verifyOption);
}
});
}
|
using System;
using System.Linq;
using Faithlife.Build;
using static Faithlife.Build.BuildUtility;
using static Faithlife.Build.DotNetRunner;
internal static class Build
{
public static int Main(string[] args) => BuildRunner.Execute(args, build =>
{
var codegen = "fsdgen___";
var dotNetBuildSettings = new DotNetBuildSettings
{
NuGetApiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY"),
DocsSettings = new DotNetDocsSettings
{
GitLogin = new GitLoginInfo("FacilityApiBot", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""),
GitAuthor = new GitAuthorInfo("FacilityApiBot", "facilityapi@gmail.com"),
GitBranchName = Environment.GetEnvironmentVariable("APPVEYOR_REPO_BRANCH"),
SourceCodeUrl = "https://github.com/FacilityApi/RepoTemplate/tree/master/src",
ProjectHasDocs = name => !name.StartsWith("fsdgen", StringComparison.Ordinal),
},
};
build.AddDotNetTargets(dotNetBuildSettings);
build.Target("codegen")
.DependsOn("build")
.Describe("Generates code from the FSD")
.Does(() => codeGen(verify: false));
build.Target("verify-codegen")
.DependsOn("build")
.Describe("Ensures the generated code is up-to-date")
.Does(() => codeGen(verify: true));
build.Target("test")
.DependsOn("verify-codegen");
void codeGen(bool verify)
{
var configuration = dotNetBuildSettings!.BuildOptions!.ConfigurationOption!.Value;
var toolPath = FindFiles($"src/{codegen}/bin/{configuration}/netcoreapp*/{codegen}.dll").FirstOrDefault();
var verifyOption = verify ? "--verify" : null;
RunDotNet(toolPath, "___", "___", "--newline", "lf", verifyOption);
}
});
}
|
mit
|
C#
|
f341863cab1d6492c0651eabcc63ba3fe86365cf
|
disable test for informix due to client bug (#813)
|
lvaleriu/linq2db,MaceWindu/linq2db,genusP/linq2db,genusP/linq2db,linq2db/linq2db,MaceWindu/linq2db,LinqToDB4iSeries/linq2db,lvaleriu/linq2db,LinqToDB4iSeries/linq2db,linq2db/linq2db,ronnyek/linq2db
|
Tests/Linq/UserTests/Issue513Tests.cs
|
Tests/Linq/UserTests/Issue513Tests.cs
|
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using NUnit.Framework;
namespace Tests.UserTests
{
using LinqToDB;
using Model;
[TestFixture]
public class Issue513Tests : TestBase
{
[Test, DataContextSource, Category("WindowsOnly")]
public void Simple(string context)
{
using (var db = GetDataContext(context))
{
Assert.AreEqual(typeof(InheritanceParentBase), InheritanceParent[0].GetType());
Assert.AreEqual(typeof(InheritanceParent1), InheritanceParent[1].GetType());
Assert.AreEqual(typeof(InheritanceParent2), InheritanceParent[2].GetType());
AreEqual(InheritanceParent, db.InheritanceParent);
AreEqual(InheritanceChild, db.InheritanceChild);
}
}
// Informix disabled due to issue, described here (but it reproduced with client 4.1):
// https://www-01.ibm.com/support/docview.wss?uid=swg1IC66046
[Test, DataContextSource(TestProvName.SQLiteMs, ProviderName.Informix), Category("WindowsOnly")]
public void Test(string context)
{
using (var semaphore = new Semaphore(0, 10))
{
var tasks = new Task[10];
for (var i = 0; i < 10; i++)
tasks[i] = new Task(() => TestInternal(context, semaphore));
for (var i = 0; i < 10; i++)
tasks[i].Start();
Thread .Sleep(100);
semaphore.Release(10);
Task.WaitAll(tasks);
}
}
void TestInternal(string context, Semaphore semaphore)
{
try
{
using (var db = GetDataContext(context))
{
semaphore.WaitOne();
AreEqual(
InheritanceChild.Select(_ => _.Parent).Distinct(),
db.InheritanceChild.Select(_ => _.Parent).Distinct());
}
}
finally
{
semaphore.Release();
}
}
}
}
|
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using NUnit.Framework;
namespace Tests.UserTests
{
using Model;
[TestFixture]
public class Issue513Tests : TestBase
{
[Test, DataContextSource, Category("WindowsOnly")]
public void Simple(string context)
{
using (var db = GetDataContext(context))
{
Assert.AreEqual(typeof(InheritanceParentBase), InheritanceParent[0].GetType());
Assert.AreEqual(typeof(InheritanceParent1), InheritanceParent[1].GetType());
Assert.AreEqual(typeof(InheritanceParent2), InheritanceParent[2].GetType());
AreEqual(InheritanceParent, db.InheritanceParent);
AreEqual(InheritanceChild, db.InheritanceChild);
}
}
[Test, DataContextSource(TestProvName.SQLiteMs), Category("WindowsOnly")]
public void Test(string context)
{
using (var semaphore = new Semaphore(0, 10))
{
var tasks = new Task[10];
for (var i = 0; i < 10; i++)
tasks[i] = new Task(() => TestInternal(context, semaphore));
for (var i = 0; i < 10; i++)
tasks[i].Start();
Thread .Sleep(100);
semaphore.Release(10);
Task.WaitAll(tasks);
}
}
void TestInternal(string context, Semaphore semaphore)
{
try
{
using (var db = GetDataContext(context))
{
semaphore.WaitOne();
AreEqual(
InheritanceChild.Select(_ => _.Parent).Distinct(),
db.InheritanceChild.Select(_ => _.Parent).Distinct());
}
}
finally
{
semaphore.Release();
}
}
}
}
|
mit
|
C#
|
0ee3dacd3c2184452140a6fc8c43f951db06e816
|
Update ApplicationInsightsMetricTelemeter.cs
|
tiksn/TIKSN-Framework
|
TIKSN.Core/Analytics/Telemetry/ApplicationInsightsMetricTelemeter.cs
|
TIKSN.Core/Analytics/Telemetry/ApplicationInsightsMetricTelemeter.cs
|
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.ApplicationInsights.DataContracts;
namespace TIKSN.Analytics.Telemetry
{
public class ApplicationInsightsMetricTelemeter : IMetricTelemeter
{
[Obsolete]
public Task TrackMetricAsync(string metricName, decimal metricValue)
{
try
{
var telemetry = new MetricTelemetry(metricName, (double)metricValue);
ApplicationInsightsHelper.TrackMetric(telemetry);
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
return Task.FromResult<object>(null);
}
}
}
|
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.ApplicationInsights.DataContracts;
namespace TIKSN.Analytics.Telemetry
{
public class ApplicationInsightsMetricTelemeter : IMetricTelemeter
{
public Task TrackMetric(string metricName, decimal metricValue)
{
try
{
var telemetry = new MetricTelemetry(metricName, (double)metricValue);
ApplicationInsightsHelper.TrackMetric(telemetry);
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
return Task.FromResult<object>(null);
}
}
}
|
mit
|
C#
|
36bb2086420e20a1eae477b958d9e58915ec8047
|
Use type inference in type definition
|
eggapauli/MyDocs,eggapauli/MyDocs
|
WindowsStore/Service/CameraService.cs
|
WindowsStore/Service/CameraService.cs
|
using MyDocs.Common.Contract.Service;
using MyDocs.Common.Contract.Storage;
using MyDocs.Common.Model;
using MyDocs.WindowsStore.Storage;
using System;
using System.Threading.Tasks;
using Windows.Media.Capture;
namespace MyDocs.WindowsStore.Service
{
public class CameraService : ICameraService
{
public async Task<Photo> CapturePhotoAsync()
{
var camera = new CameraCaptureUI();
var file = await camera.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (file == null) {
return null;
}
return new Photo(DateTime.Now.ToString("G"), new WindowsStoreFile(file));
}
}
}
|
using MyDocs.Common.Contract.Service;
using MyDocs.Common.Contract.Storage;
using MyDocs.Common.Model;
using MyDocs.WindowsStore.Storage;
using System;
using System.Threading.Tasks;
using Windows.Media.Capture;
namespace MyDocs.WindowsStore.Service
{
public class CameraService : ICameraService
{
public async Task<Photo> CapturePhotoAsync()
{
CameraCaptureUI camera = new CameraCaptureUI();
var file = await camera.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (file == null) {
return null;
}
return new Photo(DateTime.Now.ToString("G"), new WindowsStoreFile(file));
}
}
}
|
mit
|
C#
|
8708555b2726a804d57c78e351533980b4da98dd
|
Update server.cs
|
TDXDigital/TPS,TDXDigital/TPS,TDXDigital/TPS,TDXDigital/TPS,TDXDigital/TPS
|
comserver/server.cs
|
comserver/server.cs
|
//http://tech.pro/tutorial/704/csharp-tutorial-simple-threaded-tcp-server
/* This server is designed to continuosly listen to a TCP destination for data to be broadcasted
* alternative design is to have system listen for TCP and have access to com port
* that will essentially interupt the transmission to upload to serveer and then continue with
* broadcast of com information to TCP
*
*/
using System;
using System.Text;
using System.Net.Sockets;
using System.Threading;
using System.Net;
namespace TCPServerTutorial
{
class Server
{
private TcpListener tcpListener;
private Thread listenThread;
public Server()
{
this.tcpListener = new TcpListener(IPAddress.Any, 3000);
this.listenThread = new Thread(new ThreadStart(ListenForClients));
this.listenThread.Start();
}
}
}
|
using System;
using System.Text;
using System.Net.Sockets;
using System.Threading;
using System.Net;
namespace TCPServerTutorial
{
class Server
{
private TcpListener tcpListener;
private Thread listenThread;
public Server()
{
this.tcpListener = new TcpListener(IPAddress.Any, 3000);
this.listenThread = new Thread(new ThreadStart(ListenForClients));
this.listenThread.Start();
}
}
}
|
mit
|
C#
|
2398d677105b558d2220249a051059206bcc96ba
|
Refactor test to use AutoCommandData
|
appharbor/appharbor-cli
|
src/AppHarbor.Tests/Commands/CreateCommandTest.cs
|
src/AppHarbor.Tests/Commands/CreateCommandTest.cs
|
using AppHarbor.Commands;
using Moq;
using Ploeh.AutoFixture;
using Ploeh.AutoFixture.AutoMoq;
using Ploeh.AutoFixture.Xunit;
using Xunit.Extensions;
namespace AppHarbor.Tests.Commands
{
public class CreateCommandTest
{
private readonly IFixture _fixture;
public CreateCommandTest()
{
_fixture = new Fixture().Customize(new AutoMoqCustomization());
}
[Theory, AutoCommandData]
public void ShouldCreateApplication([Frozen]Mock<IAppHarborClient> client, CreateCommand command)
{
command.Execute(new string[] { "foo", "bar" });
client.Verify(x => x.CreateApplication("foo", "bar"), Times.Once());
}
}
}
|
using AppHarbor.Commands;
using Moq;
using Ploeh.AutoFixture;
using Ploeh.AutoFixture.AutoMoq;
using Xunit;
namespace AppHarbor.Tests.Commands
{
public class CreateCommandTest
{
private readonly IFixture _fixture;
public CreateCommandTest()
{
_fixture = new Fixture().Customize(new AutoMoqCustomization());
}
[Fact]
public void ShouldCreateApplication()
{
var client = _fixture.Freeze<Mock<IAppHarborClient>>();
var command = _fixture.CreateAnonymous<CreateCommand>();
command.Execute(new string[] { "foo", "var" });
client.Verify(x => x.CreateApplication("bar", "baz"), Times.Once());
}
}
}
|
mit
|
C#
|
fcffdaebe3499638fab6ff8377a2f577cefe1366
|
Add EnvironmentVariableConfiguration#Set
|
appharbor/appharbor-cli
|
src/AppHarbor/EnvironmentVariableConfiguration.cs
|
src/AppHarbor/EnvironmentVariableConfiguration.cs
|
using System;
namespace AppHarbor
{
public class EnvironmentVariableConfiguration
{
public void Set(string variable, string value, EnvironmentVariableTarget environmentVariableTarget)
{
Environment.SetEnvironmentVariable(variable, value, environmentVariableTarget);
}
}
}
|
namespace AppHarbor
{
public class EnvironmentVariableConfiguration
{
}
}
|
mit
|
C#
|
fce462f0b258dcca01341d9babf3658993f3cb62
|
Clean Up UsageReport a bit
|
markaschell/SoftwareThresher
|
code/SoftwareThresher/SoftwareThresher/Configurations/UsageReport.cs
|
code/SoftwareThresher/SoftwareThresher/Configurations/UsageReport.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using SoftwareThresher.Utilities;
using Console = SoftwareThresher.Utilities.Console;
namespace SoftwareThresher.Configurations {
public class UsageReport {
readonly IConsole console;
readonly IClassFinder classFinder;
public UsageReport() : this(new ClassFinder(), new Console()) { }
public UsageReport(IClassFinder classFinder, IConsole console)
{
this.console = console;
this.classFinder = classFinder;
}
// TODO - Add settings
public void Write() {
console.WriteLine("Usage: SoftwareThresher.exe config.xml [config.xml]");
foreach (var task in classFinder.TaskTypes) {
console.WriteLine($"\tTask:\t{task.Name}({GetParameterText(task)})");
foreach (var property in GetProperties(task)) {
WriteProperty(property);
}
}
}
static string GetParameterText(Type task)
{
var parameters = task.GetConstructors().Single().GetParameters();
return string.Join(", ", parameters.Select(p => p.ParameterType.Name));
}
static IEnumerable<PropertyInfo> GetProperties(Type task) {
return task.GetProperties().Where(a => a.CanWrite);
}
void WriteProperty(PropertyInfo property) {
var noteAttribute = (UsageNoteAttribute) Attribute.GetCustomAttributes(property).FirstOrDefault(a => a.GetType() == typeof(UsageNoteAttribute));
var noteText = noteAttribute != null ? " - " + noteAttribute.Note : string.Empty;
console.WriteLine($"\t\tAttribute:\t{property.Name} ({property.PropertyType.Name}){noteText}");
}
}
}
|
using System;
using System.Linq;
using SoftwareThresher.Utilities;
using Console = SoftwareThresher.Utilities.Console;
namespace SoftwareThresher.Configurations {
public class UsageReport {
readonly IConsole console;
readonly IClassFinder classFinder;
public UsageReport() : this(new ClassFinder(), new Console()) { }
public UsageReport(IClassFinder classFinder, IConsole console)
{
this.console = console;
this.classFinder = classFinder;
}
// TODO - Add settings
public void Write() {
console.WriteLine("Usage: SoftwareThresher.exe config.xml [config.xml]");
foreach (var task in classFinder.TaskTypes) {
var parameters = task.GetConstructors().Single().GetParameters();
var parameterText = string.Join(", ", parameters.Select(p => p.ParameterType.Name));
console.WriteLine($"\tTask:\t{task.Name}({parameterText})");
var properties = task.GetProperties().Where(a => a.CanWrite);
foreach (var property in properties) {
var noteAttribute = (UsageNoteAttribute)Attribute.GetCustomAttributes(property).FirstOrDefault(a => a.GetType() == typeof(UsageNoteAttribute));
var noteText = noteAttribute != null ? " - " + noteAttribute.Note : string.Empty;
console.WriteLine($"\t\tAttribute:\t{property.Name} ({property.PropertyType.Name}){noteText}");
}
}
}
}
}
|
mit
|
C#
|
76cae17fd71a9513a817979d4185bdfb2ba0ed43
|
Change DestinationFilenamePrefix to be a required field
|
drdk/ffmpeg-farm,ongobongo/ffmpeg-farm
|
ffmpeg-farm-server/API.WindowsService/Models/AudioJobRequestModel.cs
|
ffmpeg-farm-server/API.WindowsService/Models/AudioJobRequestModel.cs
|
using System.ComponentModel.DataAnnotations;
using API.WindowsService.Validators;
using Contract;
using FluentValidation.Attributes;
namespace API.WindowsService.Models
{
[Validator(typeof(AudioRequestValidator))]
public class AudioJobRequestModel : JobRequestModel
{
[Required]
public AudioDestinationFormat[] Targets { get; set; }
[Required]
public string DestinationFilenamePrefix { get; set; }
[Required]
public string SourceFilename { get; set; }
}
}
|
using System.ComponentModel.DataAnnotations;
using API.WindowsService.Validators;
using Contract;
using FluentValidation.Attributes;
namespace API.WindowsService.Models
{
[Validator(typeof(AudioRequestValidator))]
public class AudioJobRequestModel : JobRequestModel
{
[Required]
public AudioDestinationFormat[] Targets { get; set; }
public string DestinationFilenamePrefix { get; set; }
[Required]
public string SourceFilename { get; set; }
}
}
|
bsd-3-clause
|
C#
|
a7edc8446a31be544a978a4d0571fc6d6c344bf9
|
Remove old comment
|
rasmus/EventFlow,AntoineGa/EventFlow
|
Source/EventFlow.EventStores.EventStore.Tests/IntegrationTests/EventStoreEventStoreTests.cs
|
Source/EventFlow.EventStores.EventStore.Tests/IntegrationTests/EventStoreEventStoreTests.cs
|
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 Rasmus Mikkelsen
// Copyright (c) 2015-2016 eBay Software Foundation
// https://github.com/rasmus/EventFlow
//
// 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 EventFlow.Configuration;
using EventFlow.EventStores.EventStore.Extensions;
using EventFlow.Extensions;
using EventFlow.MetadataProviders;
using EventFlow.TestHelpers;
using EventFlow.TestHelpers.Suites;
using EventStore.ClientAPI;
using EventStore.ClientAPI.SystemData;
using NUnit.Framework;
namespace EventFlow.EventStores.EventStore.Tests.IntegrationTests
{
[TestFixture]
[Timeout(30000)]
[Category(Categories.Integration)]
public class EventStoreEventStoreTests : TestSuiteForEventStore
{
private EventStoreRunner.EventStoreInstance _eventStoreInstance;
[TestFixtureSetUp]
public void SetUp()
{
_eventStoreInstance = EventStoreRunner.StartAsync().Result;
}
[TestFixtureTearDown]
public void TearDown()
{
_eventStoreInstance.DisposeSafe("EventStore shutdown");
}
protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
{
var connectionSettings = ConnectionSettings.Create()
.EnableVerboseLogging()
.KeepReconnecting()
.KeepRetrying()
.SetDefaultUserCredentials(new UserCredentials("admin", "changeit"))
.Build();
var resolver = eventFlowOptions
.AddMetadataProvider<AddGuidMetadataProvider>()
.UseEventStoreEventStore(_eventStoreInstance.ConnectionStringUri, connectionSettings)
.CreateResolver();
return resolver;
}
}
}
|
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 Rasmus Mikkelsen
// Copyright (c) 2015-2016 eBay Software Foundation
// https://github.com/rasmus/EventFlow
//
// 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 EventFlow.Configuration;
using EventFlow.EventStores.EventStore.Extensions;
using EventFlow.Extensions;
using EventFlow.MetadataProviders;
using EventFlow.TestHelpers;
using EventFlow.TestHelpers.Suites;
using EventStore.ClientAPI;
using EventStore.ClientAPI.SystemData;
using NUnit.Framework;
namespace EventFlow.EventStores.EventStore.Tests.IntegrationTests
{
[TestFixture]
[Timeout(30000)]
[Category(Categories.Integration)]
public class EventStoreEventStoreTests : TestSuiteForEventStore
{
private EventStoreRunner.EventStoreInstance _eventStoreInstance;
[TestFixtureSetUp]
public void SetUp()
{
_eventStoreInstance = EventStoreRunner.StartAsync().Result; // TODO: Argh, remove .Result
}
[TestFixtureTearDown]
public void TearDown()
{
_eventStoreInstance.DisposeSafe("EventStore shutdown");
}
protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
{
var connectionSettings = ConnectionSettings.Create()
.EnableVerboseLogging()
.KeepReconnecting()
.KeepRetrying()
.SetDefaultUserCredentials(new UserCredentials("admin", "changeit"))
.Build();
var resolver = eventFlowOptions
.AddMetadataProvider<AddGuidMetadataProvider>()
.UseEventStoreEventStore(_eventStoreInstance.ConnectionStringUri, connectionSettings)
.CreateResolver();
return resolver;
}
}
}
|
mit
|
C#
|
566a20a623a5d82f73d4e11f6c2ea9836ce14566
|
Add keyword "delay" to hold-to-confirm activation time setting
|
NeoAdonis/osu,peppy/osu,NeoAdonis/osu,NeoAdonis/osu,ppy/osu,peppy/osu,ppy/osu,ppy/osu,peppy/osu
|
osu.Game/Overlays/Settings/Sections/UserInterface/GeneralSettings.cs
|
osu.Game/Overlays/Settings/Sections/UserInterface/GeneralSettings.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.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
namespace osu.Game.Overlays.Settings.Sections.UserInterface
{
public class GeneralSettings : SettingsSubsection
{
protected override LocalisableString Header => UserInterfaceStrings.GeneralHeader;
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
Children = new Drawable[]
{
new SettingsCheckbox
{
LabelText = UserInterfaceStrings.CursorRotation,
Current = config.GetBindable<bool>(OsuSetting.CursorRotation)
},
new SettingsSlider<float, SizeSlider>
{
LabelText = UserInterfaceStrings.MenuCursorSize,
Current = config.GetBindable<float>(OsuSetting.MenuCursorSize),
KeyboardStep = 0.01f
},
new SettingsCheckbox
{
LabelText = UserInterfaceStrings.Parallax,
Current = config.GetBindable<bool>(OsuSetting.MenuParallax)
},
new SettingsSlider<double, TimeSlider>
{
LabelText = UserInterfaceStrings.HoldToConfirmActivationTime,
Current = config.GetBindable<double>(OsuSetting.UIHoldActivationDelay),
Keywords = new[] { @"delay" },
KeyboardStep = 50
},
};
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
namespace osu.Game.Overlays.Settings.Sections.UserInterface
{
public class GeneralSettings : SettingsSubsection
{
protected override LocalisableString Header => UserInterfaceStrings.GeneralHeader;
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
Children = new Drawable[]
{
new SettingsCheckbox
{
LabelText = UserInterfaceStrings.CursorRotation,
Current = config.GetBindable<bool>(OsuSetting.CursorRotation)
},
new SettingsSlider<float, SizeSlider>
{
LabelText = UserInterfaceStrings.MenuCursorSize,
Current = config.GetBindable<float>(OsuSetting.MenuCursorSize),
KeyboardStep = 0.01f
},
new SettingsCheckbox
{
LabelText = UserInterfaceStrings.Parallax,
Current = config.GetBindable<bool>(OsuSetting.MenuParallax)
},
new SettingsSlider<double, TimeSlider>
{
LabelText = UserInterfaceStrings.HoldToConfirmActivationTime,
Current = config.GetBindable<double>(OsuSetting.UIHoldActivationDelay),
KeyboardStep = 50
},
};
}
}
}
|
mit
|
C#
|
852445b35ad721cdc294ff5b7b8d38c109aafcf3
|
Use in process (#649)
|
ThomasBarnekow/Open-XML-SDK,OfficeDev/Open-XML-SDK,tomjebo/Open-XML-SDK
|
test/DocumentFormat.OpenXml.Benchmarks/Program.cs
|
test/DocumentFormat.OpenXml.Benchmarks/Program.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Diagnostics.Windows;
using BenchmarkDotNet.Exporters;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Loggers;
using BenchmarkDotNet.Running;
using System.Linq;
namespace DocumentFormat.OpenXml.Benchmarks
{
public static class Program
{
public static void Main(string[] input)
{
if (input is null)
{
throw new System.ArgumentNullException(nameof(input));
}
var switcher = new BenchmarkSwitcher(typeof(Program).Assembly);
var config = GetConfig(input);
switcher.Run(new[] { "--filter", "*" }, config);
}
private static IConfig GetConfig(string[] args)
{
var config = new CustomConfig();
if (args.Length > 0)
{
return config.WithArtifactsPath(args[0]);
}
else
{
return config;
}
}
private class CustomConfig : ManualConfig
{
public CustomConfig()
{
// Diagnosers
Add(MemoryDiagnoser.Default);
// Columns
Add(DefaultConfig.Instance.GetColumnProviders().ToArray());
// Loggers
Add(ConsoleLogger.Default);
// Exporters
Add(AsciiDocExporter.Default);
Add(HtmlExporter.Default);
Add(Job.InProcess);
}
}
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Diagnostics.Windows;
using BenchmarkDotNet.Exporters;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Loggers;
using BenchmarkDotNet.Running;
using System.Linq;
namespace DocumentFormat.OpenXml.Benchmarks
{
public static class Program
{
public static void Main(string[] input)
{
if (input is null)
{
throw new System.ArgumentNullException(nameof(input));
}
var switcher = new BenchmarkSwitcher(typeof(Program).Assembly);
var config = GetConfig(input);
switcher.Run(new[] { "--filter", "*" }, config);
}
private static IConfig GetConfig(string[] args)
{
var config = new CustomConfig();
if (args.Length > 0)
{
return config.WithArtifactsPath(args[0]);
}
else
{
return config;
}
}
private class CustomConfig : ManualConfig
{
public CustomConfig()
{
// Diagnosers
Add(MemoryDiagnoser.Default);
Add(new EtwProfiler());
// Columns
Add(DefaultConfig.Instance.GetColumnProviders().ToArray());
// Loggers
Add(ConsoleLogger.Default);
// Exporters
Add(AsciiDocExporter.Default);
Add(HtmlExporter.Default);
}
}
}
}
|
mit
|
C#
|
5425c69df6eae203c58a5f00c9a65baa97e4765f
|
Use path.combine instead
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/CleanProjectIntegrationTest.cs
|
test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/CleanProjectIntegrationTest.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.IO;
using System.Threading.Tasks;
using Xunit;
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
{
public class CleanProjectIntegrationTest : MSBuildIntegrationTestBase
{
[Fact]
[InitializeTestProject("SimpleMvc")]
public async Task CleanProject_RunBuild()
{
var result = await DotnetMSBuild("Restore;Build", "/p:RazorCompileOnBuild=true");
Assert.BuildPassed(result);
Assert.FileExists(result, Path.Combine("bin", "Debug", "netcoreapp2.0", "SimpleMvc.dll"));
Assert.FileExists(result, Path.Combine("bin", "Debug", "netcoreapp2.0", "SimpleMvc.PrecompiledViews.dll"));
}
}
}
|
// 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.Threading.Tasks;
using Xunit;
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
{
public class CleanProjectIntegrationTest : MSBuildIntegrationTestBase
{
[Fact]
[InitializeTestProject("SimpleMvc")]
public async Task CleanProject_RunBuild()
{
var result = await DotnetMSBuild("Restore;Build", "/p:RazorCompileOnBuild=true");
Assert.BuildPassed(result);
Assert.FileExists(result, @"bin/Debug/netcoreapp2.0/SimpleMvc.dll");
Assert.FileExists(result, @"bin/Debug/netcoreapp2.0/SimpleMvc.PrecompiledViews.dll");
}
}
}
|
apache-2.0
|
C#
|
d8fad92710f72d7069e64195abf7482a2cc473e4
|
Change SnapshotShardFailure shard_id to int (#4543)
|
elastic/elasticsearch-net,elastic/elasticsearch-net
|
src/Nest/Modules/SnapshotAndRestore/Snapshot/SnapshotShardFailure.cs
|
src/Nest/Modules/SnapshotAndRestore/Snapshot/SnapshotShardFailure.cs
|
using System.Runtime.Serialization;
namespace Nest
{
[DataContract]
public class SnapshotShardFailure
{
[DataMember(Name ="index")]
public string Index { get; set; }
[DataMember(Name ="node_id")]
public string NodeId { get; set; }
[DataMember(Name ="reason")]
public string Reason { get; set; }
[DataMember(Name ="shard_id")]
public int ShardId { get; set; }
[DataMember(Name ="status")]
public string Status { get; set; }
}
}
|
using System.Runtime.Serialization;
namespace Nest
{
[DataContract]
public class SnapshotShardFailure
{
[DataMember(Name ="index")]
public string Index { get; set; }
[DataMember(Name ="node_id")]
public string NodeId { get; set; }
[DataMember(Name ="reason")]
public string Reason { get; set; }
[DataMember(Name ="shard_id")]
public string ShardId { get; set; }
[DataMember(Name ="status")]
public string Status { get; set; }
}
}
|
apache-2.0
|
C#
|
2daf6b7483e13db8873d3ea3ff334ebf0fe7e5d2
|
allow create link on inner item in share
|
yar229/WebDavMailRuCloud
|
MailRuCloud/MailRuCloudApi/SpecialCommands/SharedFolderLinkCommand.cs
|
MailRuCloud/MailRuCloudApi/SpecialCommands/SharedFolderLinkCommand.cs
|
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using YaR.MailRuCloud.Api.Base.Requests;
using YaR.MailRuCloud.Api.Extensions;
namespace YaR.MailRuCloud.Api.SpecialCommands
{
public class SharedFolderLinkCommand : SpecialCommand
{
public SharedFolderLinkCommand(MailRuCloud cloud, string path, IList<string> parames): base(cloud, path, parames)
{
}
protected override MinMax<int> MinMaxParamsCount { get; } = new MinMax<int>(1, 2);
public override async Task<SpecialCommandResult> Execute()
{
var m = Regex.Match(Parames[0], @"(?snx-)\s* (https://?cloud.mail.ru/public)?(?<url>.*)/? \s*");
if (!m.Success) return SpecialCommandResult.Fail;
//TODO: make method in MailRuCloud to get entry by url
var item = await new ItemInfoRequest(Cloud.CloudApi, m.Groups["url"].Value, true).MakeRequestAsync();
var entry = item.ToEntry();
if (null == entry)
return SpecialCommandResult.Fail;
string name = Parames.Count > 1 && !string.IsNullOrWhiteSpace(Parames[1])
? Parames[1]
: entry.Name;
Cloud.LinkItem(m.Groups["url"].Value, Path, name, entry.IsFile, entry.Size, entry.CreationTimeUtc);
return SpecialCommandResult.Success;
}
}
}
|
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using YaR.MailRuCloud.Api.Base.Requests;
using YaR.MailRuCloud.Api.Extensions;
namespace YaR.MailRuCloud.Api.SpecialCommands
{
public class SharedFolderLinkCommand : SpecialCommand
{
public SharedFolderLinkCommand(MailRuCloud cloud, string path, IList<string> parames): base(cloud, path, parames)
{
}
protected override MinMax<int> MinMaxParamsCount { get; } = new MinMax<int>(1, 2);
public override async Task<SpecialCommandResult> Execute()
{
var m = Regex.Match(Parames[0], @"(?snx-)\s* (https://?cloud.mail.ru/public)?(?<url>/\w*/\w*)/? \s*");
if (!m.Success) return SpecialCommandResult.Fail;
//TODO: make method in MailRuCloud to get entry by url
var item = await new ItemInfoRequest(Cloud.CloudApi, m.Groups["url"].Value, true).MakeRequestAsync();
var entry = item.ToEntry();
if (null == entry)
return SpecialCommandResult.Fail;
string name = Parames.Count > 1 && !string.IsNullOrWhiteSpace(Parames[1])
? Parames[1]
: entry.Name;
Cloud.LinkItem(m.Groups["url"].Value, Path, name, entry.IsFile, entry.Size, entry.CreationTimeUtc);
return SpecialCommandResult.Success;
}
}
}
|
mit
|
C#
|
0d4bb7e355a97bee291c9225c6072d02edc79d97
|
Fix fullscreen.
|
JohanLarsson/Gu.Wpf.Media
|
Gu.Wpf.Media.Demo/MainWindow.xaml.cs
|
Gu.Wpf.Media.Demo/MainWindow.xaml.cs
|
namespace Gu.Wpf.Media.Demo
{
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using Microsoft.Win32;
public partial class MainWindow : Window
{
private Stretch stretch;
public MainWindow()
{
this.InitializeComponent();
}
private void OpenExecuted(object sender, ExecutedRoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog
{
Filter = $"Media files|{this.MediaElement.VideoFormats}|All files (*.*)|*.*"
};
if (openFileDialog.ShowDialog() == true)
{
this.MediaElement.Source = new Uri(openFileDialog.FileName);
}
}
private void OnToggleFullScreenExecuted(object sender, ExecutedRoutedEventArgs e)
{
if (this.WindowStyle == WindowStyle.SingleBorderWindow)
{
this.stretch = this.MediaElement.Stretch;
this.MediaElement.Stretch = Stretch.Uniform;
this.WindowStyle = WindowStyle.None;
this.SizeToContent = SizeToContent.Manual;
this.WindowState = WindowState.Maximized;
}
else
{
this.MediaElement.Stretch = this.stretch;
this.WindowStyle = WindowStyle.SingleBorderWindow;
this.SizeToContent = SizeToContent.WidthAndHeight;
this.WindowState = WindowState.Normal;
}
}
}
}
|
namespace Gu.Wpf.Media.Demo
{
using System;
using System.Windows;
using System.Windows.Input;
using Microsoft.Win32;
public partial class MainWindow : Window
{
public MainWindow()
{
this.InitializeComponent();
}
private void OpenExecuted(object sender, ExecutedRoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog
{
Filter = $"Media files|{this.MediaElement.VideoFormats}|All files (*.*)|*.*"
};
if (openFileDialog.ShowDialog() == true)
{
this.MediaElement.Source = new Uri(openFileDialog.FileName);
}
}
private void OnToggleFullScreenExecuted(object sender, ExecutedRoutedEventArgs e)
{
if (this.WindowStyle == WindowStyle.SingleBorderWindow)
{
this.WindowStyle = WindowStyle.None;
this.WindowState = WindowState.Maximized;
}
else
{
this.WindowStyle = WindowStyle.SingleBorderWindow;
this.WindowState = WindowState.Normal;
}
}
}
}
|
mit
|
C#
|
aafbebf549f3ca0b0ad174f5716293025b7da88e
|
Add frictions
|
EasyPeasyLemonSqueezy/MadCat
|
MadCat/NutEngine/Physics/Material.cs
|
MadCat/NutEngine/Physics/Material.cs
|
namespace NutEngine.Physics
{
public class Material
{
public float Density { get; set; }
public float Restitution { get; set; }
public float StaticFriction { get; set; }
public float DynamicFriction { get; set; }
}
}
|
namespace NutEngine.Physics
{
public class Material
{
public float Density { get; set; }
public float Restitution { get; set; }
}
}
|
mit
|
C#
|
dac91ab0cea89723f4c76d097da9576056663708
|
Fix WS-14919 WS-14966 Email in XUbuntu
|
gtryus/libpalaso,chrisvire/libpalaso,darcywong00/libpalaso,sillsdev/libpalaso,hatton/libpalaso,tombogle/libpalaso,darcywong00/libpalaso,andrew-polk/libpalaso,chrisvire/libpalaso,ermshiperete/libpalaso,hatton/libpalaso,marksvc/libpalaso,ermshiperete/libpalaso,tombogle/libpalaso,mccarthyrb/libpalaso,gtryus/libpalaso,marksvc/libpalaso,sillsdev/libpalaso,JohnThomson/libpalaso,mccarthyrb/libpalaso,mccarthyrb/libpalaso,gmartin7/libpalaso,ddaspit/libpalaso,tombogle/libpalaso,sillsdev/libpalaso,ermshiperete/libpalaso,JohnThomson/libpalaso,tombogle/libpalaso,sillsdev/libpalaso,chrisvire/libpalaso,gtryus/libpalaso,andrew-polk/libpalaso,glasseyes/libpalaso,gmartin7/libpalaso,darcywong00/libpalaso,JohnThomson/libpalaso,chrisvire/libpalaso,hatton/libpalaso,glasseyes/libpalaso,andrew-polk/libpalaso,glasseyes/libpalaso,gmartin7/libpalaso,gtryus/libpalaso,JohnThomson/libpalaso,gmartin7/libpalaso,andrew-polk/libpalaso,glasseyes/libpalaso,ddaspit/libpalaso,ddaspit/libpalaso,ermshiperete/libpalaso,marksvc/libpalaso,ddaspit/libpalaso,mccarthyrb/libpalaso,hatton/libpalaso
|
Palaso/Email/EmailProviderFactory.cs
|
Palaso/Email/EmailProviderFactory.cs
|
using System;
using System.IO;
using System.Xml;
using System.Xml.XPath;
namespace Palaso.Email
{
public class EmailProviderFactory
{
public static IEmailProvider PreferredEmailProvider()
{
if (Environment.OSVersion.Platform == PlatformID.Unix)
{
if (ThunderbirdIsDefault())
{
return new ThunderbirdEmailProvider();
}
return new MailToEmailProvider();
}
return new MapiEmailProvider();
}
public static IEmailProvider AlternateEmailProvider()
{
if (Environment.OSVersion.Platform == PlatformID.Unix)
{
return null;
}
return new MailToEmailProvider();
}
public static bool ThunderbirdIsDefault() {
bool result = false;
if (!result)
result |= ThunderbirdIsDefaultOnX();
if (!result)
result |= ThunderbirdIsDefaultOnGnome();
return result;
}
public static bool ThunderbirdIsDefaultOnGnome()
{
bool result = false;
string home = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
string preferredAppFile = String.Format(
"{0}/.gconf/desktop/gnome/url-handlers/mailto/%gconf.xml",
home
);
if (File.Exists(preferredAppFile))
{
XPathDocument doc = new XPathDocument(new XmlTextReader(preferredAppFile));
XPathNavigator nav = doc.CreateNavigator();
XPathNodeIterator it = nav.Select("/gconf/entry/stringvalue");
if (it.MoveNext())
{
result = it.Current.Value.Contains("thunderbird");
}
}
Console.WriteLine("Thunderbird on Gnome? Result {0}", result);
return result;
}
public static bool ThunderbirdIsDefaultOnX()
{
bool result = false;
string home = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
string preferredAppFile = String.Format(
"{0}/.config/xfce4/helpers.rc",
home
);
if (File.Exists(preferredAppFile))
{
using (var reader = File.OpenText(preferredAppFile))
{
while (!reader.EndOfStream)
{
var line = reader.ReadLine().Trim();
string[] keyValue = line.Split('=');
if (keyValue.Length == 2) {
result = (keyValue[0] == "MailReader" && keyValue[1] == "thunderbird");
break;
}
}
}
}
Console.WriteLine("Thunderbird on X? Result {0}", result);
return result;
}
}
}
|
using System;
using System.Xml;
using System.Xml.XPath;
namespace Palaso.Email
{
public class EmailProviderFactory
{
public static IEmailProvider PreferredEmailProvider()
{
if (Environment.OSVersion.Platform == PlatformID.Unix)
{
if (ThunderbirdIsDefault())
{
return new ThunderbirdEmailProvider();
}
return new MailToEmailProvider();
}
return new MapiEmailProvider();
}
public static IEmailProvider AlternateEmailProvider()
{
if (Environment.OSVersion.Platform == PlatformID.Unix)
{
return null;
}
return new MailToEmailProvider();
}
public static bool ThunderbirdIsDefault()
{
bool result = false;
string home = Environment.GetEnvironmentVariable("HOME");
string preferredAppFile = String.Format(
"{0}/.gconf/desktop/gnome/url-handlers/mailto/%gconf.xml",
home
);
XPathDocument doc = new XPathDocument(new XmlTextReader(preferredAppFile));
XPathNavigator nav = doc.CreateNavigator();
XPathNodeIterator it = nav.Select("/gconf/entry/stringvalue");
if (it.MoveNext())
{
result = it.Current.Value.Contains("thunderbird");
}
Console.WriteLine("Result {0}", result);
return result;
}
}
}
|
mit
|
C#
|
8b88e2f3526fa41153b9fcfd000222c5ad5f9b11
|
Add keep-alive log printing.
|
projectkudu/KuduSync.NET,projectkudu/KuduSync.NET,kostrse/KuduSync.NET,uQr/KuduSync.NET,uQr/KuduSync.NET,kostrse/KuduSync.NET
|
KuduSync.NET/Logger.cs
|
KuduSync.NET/Logger.cs
|
using System;
using System.IO;
using System.Text;
namespace KuduSync.NET
{
public class Logger : IDisposable
{
private const int KeepAliveLogTimeInSeconds = 20;
private int _logCounter = 0;
private StreamWriter _writer;
private int _maxLogLines;
private DateTime _nextLogTime;
/// <summary>
/// Logger class
/// </summary>
/// <param name="maxLogLines">sets the verbosity, 0 is verbose, less is quiet, more is the number of maximum log lines to write.</param>
public Logger(int maxLogLines)
{
var stream = Console.OpenStandardOutput();
_writer = new StreamWriter(stream);
_maxLogLines = maxLogLines;
}
public void Log(string format, params object[] args)
{
if (_maxLogLines == 0 || _logCounter < _maxLogLines)
{
_writer.WriteLine(format, args);
}
else if (_logCounter == _maxLogLines)
{
_writer.WriteLine("Omitting next output lines...");
}
else
{
// Make sure some output is still logged every 20 seconds
if (DateTime.Now >= _nextLogTime)
{
_writer.WriteLine("Working...");
_nextLogTime = DateTime.Now.Add(TimeSpan.FromSeconds(KeepAliveLogTimeInSeconds));
}
}
_logCounter++;
}
public void Dispose()
{
if (_writer != null)
{
_writer.Dispose();
_writer = null;
}
}
}
}
|
using System;
using System.IO;
using System.Text;
namespace KuduSync.NET
{
public class Logger : IDisposable
{
private int _logCounter = 0;
private StreamWriter _writer;
private int _maxLogLines;
/// <summary>
/// Logger class
/// </summary>
/// <param name="maxLogLines">sets the verbosity, 0 is verbose, less is quiet, more is the number of maximum log lines to write.</param>
public Logger(int maxLogLines)
{
var stream = Console.OpenStandardOutput();
_writer = new StreamWriter(stream);
_maxLogLines = maxLogLines;
}
public void Log(string format, params object[] args)
{
if (_maxLogLines == 0 || _logCounter < _maxLogLines)
{
_writer.WriteLine(format, args);
}
else if (_logCounter == _maxLogLines)
{
_writer.WriteLine("Omitting next output lines...");
}
_logCounter++;
}
public void Dispose()
{
if (_writer != null)
{
_writer.Dispose();
_writer = null;
}
}
}
}
|
apache-2.0
|
C#
|
beb1c45d51c1291814977f5e3ec791e6aa186217
|
fix removal of custom attributes
|
icnocop/RemoveReference.Fody
|
RemoveReference.Fody/ModuleWeaver.cs
|
RemoveReference.Fody/ModuleWeaver.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using Mono.Cecil;
namespace RemoveReference.Fody
{
public class ModuleWeaver
{
// Will log an informational message to MSBuild
public Action<string> LogInfo { get; set; }
// An instance of Mono.Cecil.ModuleDefinition for processing
public ModuleDefinition ModuleDefinition { get; set; }
// Init logging delegates to make testing easier
public ModuleWeaver()
{
LogInfo = m => { };
}
public void Execute()
{
var namesToRemove = new List<string>();
var attributesToRemove = new List<CustomAttribute>();
foreach (var customAttribute in ModuleDefinition.Assembly.CustomAttributes)
{
if (customAttribute.AttributeType.Name == "RemoveReferenceAttribute")
{
namesToRemove.Add((string)customAttribute.ConstructorArguments[0].Value);
attributesToRemove.Add(customAttribute);
}
}
foreach (var customAttribute in attributesToRemove)
{
ModuleDefinition.Assembly.CustomAttributes.Remove(customAttribute);
}
var referencesToRemove = ModuleDefinition.AssemblyReferences
.Where(x => namesToRemove.Contains(x.FullName))
.Distinct()
.ToList();
foreach (var assemblyNameReference in referencesToRemove)
{
LogInfo(assemblyNameReference.ToString());
ModuleDefinition.AssemblyReferences.Remove(assemblyNameReference);
}
RemoveReference();
}
private void RemoveReference()
{
AssemblyNameReference referenceToRemove = ModuleDefinition.AssemblyReferences.FirstOrDefault(x => x.Name == "RemoveReference");
if (referenceToRemove == null)
{
LogInfo("\tNo reference to 'RemoveReference' found. References not modified.");
return;
}
ModuleDefinition.AssemblyReferences.Remove(referenceToRemove);
LogInfo("\tRemoved reference to 'RemoveReference'.");
}
}
}
|
using System;
using System.Linq;
using Mono.Cecil;
namespace RemoveReference.Fody
{
public class ModuleWeaver
{
// Will log an informational message to MSBuild
public Action<string> LogInfo { get; set; }
// An instance of Mono.Cecil.ModuleDefinition for processing
public ModuleDefinition ModuleDefinition { get; set; }
// Init logging delegates to make testing easier
public ModuleWeaver()
{
LogInfo = m => { };
}
public void Execute()
{
foreach (CustomAttribute customAttribute in ModuleDefinition.Assembly.CustomAttributes)
{
if (customAttribute.AttributeType.Name == "RemoveReferenceAttribute")
{
for (int i = ModuleDefinition.AssemblyReferences.Count - 1; i >= 0; i--)
{
AssemblyNameReference assemblyNameReference = ModuleDefinition.AssemblyReferences[i];
if (assemblyNameReference.FullName == (string)customAttribute.ConstructorArguments[0].Value)
{
LogInfo(assemblyNameReference.ToString());
ModuleDefinition.AssemblyReferences.Remove(assemblyNameReference);
}
}
}
}
RemoveReference();
}
private void RemoveReference()
{
AssemblyNameReference referenceToRemove = ModuleDefinition.AssemblyReferences.FirstOrDefault(x => x.Name == "RemoveReference");
if (referenceToRemove == null)
{
LogInfo("\tNo reference to 'RemoveReference' found. References not modified.");
return;
}
ModuleDefinition.AssemblyReferences.Remove(referenceToRemove);
LogInfo("\tRemoved reference to 'RemoveReference'.");
}
}
}
|
mit
|
C#
|
8fd701bdd485e191469d621cba4ecc435ef808b1
|
add summmary doc comment
|
killerantz/HoloToolkit-Unity,DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity
|
Assets/MixedRealityToolkit/Definitions/CameraSystem/MixedRealityCameraSettingsConfiguration.cs
|
Assets/MixedRealityToolkit/Definitions/CameraSystem/MixedRealityCameraSettingsConfiguration.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.CameraSystem
{
/// <summary>
/// Defines the configuration for a camera settings provider.
/// </summary>
[Serializable]
public struct MixedRealityCameraSettingsConfiguration : IMixedRealityServiceConfiguration
{
[SerializeField]
[Tooltip("The concrete type of the camera settings provider.")]
[Implements(typeof(IMixedRealityCameraSettingsProvider), TypeGrouping.ByNamespaceFlat)]
private SystemType componentType;
/// <inheritdoc />
public SystemType ComponentType => componentType;
[SerializeField]
[Tooltip("The name of the camera settings provider.")]
private string componentName;
/// <inheritdoc />
public string ComponentName => componentName;
[SerializeField]
[Tooltip("The camera settings provider priority.")]
private uint priority;
/// <inheritdoc />
public uint Priority => priority;
[SerializeField]
[Tooltip("The platform(s) on which the camera settings provider is supported.")]
[EnumFlags]
private SupportedPlatforms runtimePlatform;
/// <inheritdoc />
public SupportedPlatforms RuntimePlatform => runtimePlatform;
[SerializeField]
private BaseCameraSettingsProfile settingsProfile;
/// <summary>
/// Camera settings specific configuration profile.
/// </summary>
public BaseCameraSettingsProfile SettingsProfile => settingsProfile;
/// <summary>
/// Constructor.
/// </summary>
/// <param name="componentType">The <see cref="Microsoft.MixedReality.Toolkit.Utilities.SystemType"/> of the provider.</param>
/// <param name="componentName">The friendly name of the provider.</param>
/// <param name="priority">The load priority of the provider.</param>
/// <param name="runtimePlatform">The runtime platform(s) supported by the provider.</param>
/// <param name="settingsProfile">The configuration profile for the provider.</param>
public MixedRealityCameraSettingsConfiguration(
SystemType componentType,
string componentName,
uint priority,
SupportedPlatforms runtimePlatform,
BaseCameraSettingsProfile configurationProfile)
{
this.componentType = componentType;
this.componentName = componentName;
this.priority = priority;
this.runtimePlatform = runtimePlatform;
this.settingsProfile = configurationProfile;
}
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.CameraSystem
{
[Serializable]
public struct MixedRealityCameraSettingsConfiguration : IMixedRealityServiceConfiguration
{
[SerializeField]
[Tooltip("The concrete type of the camera settings provider.")]
[Implements(typeof(IMixedRealityCameraSettingsProvider), TypeGrouping.ByNamespaceFlat)]
private SystemType componentType;
/// <inheritdoc />
public SystemType ComponentType => componentType;
[SerializeField]
[Tooltip("The name of the camera settings provider.")]
private string componentName;
/// <inheritdoc />
public string ComponentName => componentName;
[SerializeField]
[Tooltip("The camera settings provider priority.")]
private uint priority;
/// <inheritdoc />
public uint Priority => priority;
[SerializeField]
[Tooltip("The platform(s) on which the camera settings provider is supported.")]
[EnumFlags]
private SupportedPlatforms runtimePlatform;
/// <inheritdoc />
public SupportedPlatforms RuntimePlatform => runtimePlatform;
[SerializeField]
private BaseCameraSettingsProfile settingsProfile;
/// <summary>
/// Camera settings specific configuration profile.
/// </summary>
public BaseCameraSettingsProfile SettingsProfile => settingsProfile;
/// <summary>
/// Constructor.
/// </summary>
/// <param name="componentType">The <see cref="Microsoft.MixedReality.Toolkit.Utilities.SystemType"/> of the provider.</param>
/// <param name="componentName">The friendly name of the provider.</param>
/// <param name="priority">The load priority of the provider.</param>
/// <param name="runtimePlatform">The runtime platform(s) supported by the provider.</param>
/// <param name="settingsProfile">The configuration profile for the provider.</param>
public MixedRealityCameraSettingsConfiguration(
SystemType componentType,
string componentName,
uint priority,
SupportedPlatforms runtimePlatform,
BaseCameraSettingsProfile configurationProfile)
{
this.componentType = componentType;
this.componentName = componentName;
this.priority = priority;
this.runtimePlatform = runtimePlatform;
this.settingsProfile = configurationProfile;
}
}
}
|
mit
|
C#
|
32f03d8b39570775f767c0ff42838930278dd517
|
Bump version numbers
|
will-hart/AnvilEditor,will-hart/AnvilEditor
|
AnvilEditor/Properties/AssemblyInfo.cs
|
AnvilEditor/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Anvil Editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("William Hart")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("MIT Licensed by William Hart 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.5.2.0")]
[assembly: AssemblyFileVersion("6.5.2.0")]
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Anvil Editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("William Hart")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("MIT Licensed by William Hart 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.5.1.0")]
[assembly: AssemblyFileVersion("6.5.1.0")]
|
mit
|
C#
|
9ada62e600c59e2af6201212705428f1a7f33478
|
Remove the 'readnone' attribute from 'GC.Allocate'
|
jonathanvdc/flame-llvm,jonathanvdc/flame-llvm,jonathanvdc/flame-llvm
|
runtime/GC.cs
|
runtime/GC.cs
|
namespace __compiler_rt
{
/// <summary>
/// Garbage collection functionality that can be used by the compiler.
/// </summary>
public static unsafe class GC
{
[#builtin_attribute(NoAliasAttribute)]
[#builtin_attribute(NoThrowAttribute)]
private static extern void* GC_malloc(ulong size);
/// <summary>
/// Allocates a region of storage that is a number of bytes in size.
/// The storage is zero-initialized and a pointer to it is returned.
/// </summary>
/// <param name="size">The number of bytes to allocate.</param>
/// <returns>A pointer to a region of storage.</returns>
[#builtin_attribute(NoAliasAttribute)]
[#builtin_attribute(NoThrowAttribute)]
public static void* Allocate(ulong size)
{
return GC_malloc(size);
}
}
}
|
namespace __compiler_rt
{
/// <summary>
/// Garbage collection functionality that can be used by the compiler.
/// </summary>
public static unsafe class GC
{
[#builtin_attribute(NoAliasAttribute)]
[#builtin_attribute(NoThrowAttribute)]
[#builtin_attribute(ReadNoneAttribute)]
private static extern void* GC_malloc(ulong size);
/// <summary>
/// Allocates a region of storage that is a number of bytes in size.
/// The storage is zero-initialized and a pointer to it is returned.
/// </summary>
/// <param name="size">The number of bytes to allocate.</param>
/// <returns>A pointer to a region of storage.</returns>
[#builtin_attribute(NoAliasAttribute)]
[#builtin_attribute(NoThrowAttribute)]
[#builtin_attribute(ReadNoneAttribute)]
public static void* Allocate(ulong size)
{
return GC_malloc(size);
}
}
}
|
mit
|
C#
|
11af25b9b7e136f23e64543daa7d6058a003564f
|
Fix travis build break.
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Internal/ViewComponentTagHelperChunkVisitorTest.cs
|
test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Internal/ViewComponentTagHelperChunkVisitorTest.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.Reflection;
using Microsoft.AspNetCore.Mvc.Razor.Host.Internal;
using Microsoft.AspNetCore.Razor.Chunks;
using Microsoft.AspNetCore.Razor.CodeGenerators;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.Razor.Host.Test.Internal
{
public class ViewComponentTagHelperChunkVisitorTest
{
public static TheoryData CodeGenerationData
{
get
{
var oneInstanceChunks = ChunkVisitorTestFactory.GetTestChunks(visitedTagHelperChunks: true);
var twoInstanceChunks = ChunkVisitorTestFactory.GetTestChunks(visitedTagHelperChunks: true);
twoInstanceChunks.Add(twoInstanceChunks[twoInstanceChunks.Count - 1]);
return new TheoryData<IList<Chunk>>
{
oneInstanceChunks,
twoInstanceChunks
};
}
}
[Theory]
[MemberData(nameof(CodeGenerationData))]
public void Accept_CorrectlyGeneratesCode(IList<Chunk> chunks)
{
// Arrange
var writer = new CSharpCodeWriter();
var context = ChunkVisitorTestFactory.CreateCodeGeneratorContext();
var chunkVisitor = new ViewComponentTagHelperChunkVisitor(writer, context);
var assembly = typeof(ViewComponentTagHelperChunkVisitorTest).GetTypeInfo().Assembly;
var path = "TestFiles/Output/Runtime/GeneratedViewComponentTagHelperClasses.cs";
var expectedOutput = ResourceFile.ReadResource(assembly, path, sourceFile: true);
// Act
chunkVisitor.Accept(chunks);
var resultOutput = writer.GenerateCode();
#if GENERATE_BASELINES
if (!string.Equals(expectedOutput, resultOutput, StringComparison.Ordinal))
{
ResourceFile.UpdateFile(assembly, path, expectedOutput, resultOutput);
expectedOutput = ResourceFile.ReadResource(assembly, path, sourceFile: true);
}
#endif
// Assert
Assert.Equal(expectedOutput, resultOutput, StringComparer.Ordinal, ignoreLineEndingDifferences: true);
}
}
}
|
// 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.Reflection;
using Microsoft.AspNetCore.Mvc.Razor.Host.Internal;
using Microsoft.AspNetCore.Razor.Chunks;
using Microsoft.AspNetCore.Razor.CodeGenerators;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.Razor.Host.Test.Internal
{
public class ViewComponentTagHelperChunkVisitorTest
{
public static TheoryData CodeGenerationData
{
get
{
var oneInstanceChunks = ChunkVisitorTestFactory.GetTestChunks(visitedTagHelperChunks: true);
var twoInstanceChunks = ChunkVisitorTestFactory.GetTestChunks(visitedTagHelperChunks: true);
twoInstanceChunks.Add(twoInstanceChunks[twoInstanceChunks.Count - 1]);
return new TheoryData<IList<Chunk>>
{
oneInstanceChunks,
twoInstanceChunks
};
}
}
[Theory]
[MemberData(nameof(CodeGenerationData))]
public void Accept_CorrectlyGeneratesCode(IList<Chunk> chunks)
{
// Arrange
var writer = new CSharpCodeWriter();
var context = ChunkVisitorTestFactory.CreateCodeGeneratorContext();
var chunkVisitor = new ViewComponentTagHelperChunkVisitor(writer, context);
var assembly = typeof(ViewComponentTagHelperChunkVisitorTest).GetTypeInfo().Assembly;
var path = "TestFiles/Output/Runtime/GeneratedViewComponentTagHelperClasses.cs";
var expectedOutput = ResourceFile.ReadResource(assembly, path, sourceFile: true);
// Act
chunkVisitor.Accept(chunks);
var resultOutput = writer.GenerateCode();
#if GENERATE_BASELINES
if (!string.Equals(expectedOutput, resultOutput, StringComparison.Ordinal))
{
ResourceFile.UpdateFile(assembly, path, expectedOutput, resultOutput);
expectedOutput = ResourceFile.ReadResource(assembly, path, sourceFile: true);
}
#endif
// Assert
Assert.Equal(expectedOutput, resultOutput, StringComparer.Ordinal);
}
}
}
|
apache-2.0
|
C#
|
d9fda4b63d1d748aade640bad87fc916e0048e06
|
Refactor to build on Visual Studio 2013
|
makmu/outlook-matters,maxlmo/outlook-matters,makmu/outlook-matters,maxlmo/outlook-matters
|
OutlookMatters/Settings/SaveCommand.cs
|
OutlookMatters/Settings/SaveCommand.cs
|
using System;
using System.Windows.Input;
namespace OutlookMatters.Settings
{
public class SaveCommand : ICommand
{
private readonly ISettingsSaveService _saveService;
private readonly IClosableWindow _window;
public SaveCommand(ISettingsSaveService saveService, IClosableWindow window)
{
_saveService = saveService;
_window = window;
}
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object parameter)
{
var viewModel = parameter as SettingsViewModel;
if (viewModel == null)
{
throw new ArgumentException(@"Invalid ViewModel ", "parameter");
}
var settings = new Settings(
viewModel.MattermostUrl,
viewModel.TeamId,
viewModel.ChannelId,
viewModel.Username,
Properties.Settings.Default.ChannelsMap
);
_saveService.Save(settings);
_window.Close();
}
public event EventHandler CanExecuteChanged;
}
}
|
using System;
using System.Windows.Input;
namespace OutlookMatters.Settings
{
public class SaveCommand : ICommand
{
private readonly ISettingsSaveService _saveService;
private readonly IClosableWindow _window;
public SaveCommand(ISettingsSaveService saveService, IClosableWindow window)
{
_saveService = saveService;
_window = window;
}
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object parameter)
{
var viewModel = parameter as SettingsViewModel;
if (viewModel == null)
{
throw new ArgumentException(@"Invalid ViewModel", nameof(parameter));
}
var settings = new Settings(
viewModel.MattermostUrl,
viewModel.TeamId,
viewModel.ChannelId,
viewModel.Username,
Properties.Settings.Default.ChannelsMap
);
_saveService.Save(settings);
_window.Close();
}
public event EventHandler CanExecuteChanged;
}
}
|
mit
|
C#
|
164d4066c3326aebbb0bf8aef8972d2e9e29959e
|
add exception handling
|
Zocdoc/schemazen,sethreno/schemazen,keith-hall/schemazen,ruediger-stevens/schemazen,sethreno/schemazen
|
console/Program.cs
|
console/Program.cs
|
using System;
using System.Collections.Generic;
namespace console {
internal class Program {
private static int Main(string[] args) {
ICommand cmd = new Default();
if (args.Length > 0) {
var commands = new Dictionary<string, ICommand>();
commands.Add("script", new Script());
commands.Add("create", new Create());
commands.Add("compare", new Compare());
if (commands.ContainsKey(args[0].ToLower())) {
cmd = commands[args[0].ToLower()];
}
}
if (!cmd.Parse(args)) {
Console.WriteLine("schemazen");
Console.WriteLine("Copyright (c) Seth Reno. All rights reserved.");
Console.WriteLine();
Console.Write("usage: schemazen " + cmd.GetUsageText());
return -1;
}
try {
if (!cmd.Run()) {
return -1;
}
} catch (Exception ex) {
Console.WriteLine(ex.Message);
return -1;
}
return 0;
}
}
}
|
using System;
using System.Collections.Generic;
namespace console {
internal class Program {
private static int Main(string[] args) {
ICommand cmd = new Default();
if (args.Length > 0) {
var commands = new Dictionary<string, ICommand>();
commands.Add("script", new Script());
commands.Add("create", new Create());
commands.Add("compare", new Compare());
if (commands.ContainsKey(args[0].ToLower())) {
cmd = commands[args[0].ToLower()];
}
}
if (!cmd.Parse(args)) {
Console.WriteLine("schemazen");
Console.WriteLine("Copyright (c) Seth Reno. All rights reserved.");
Console.WriteLine();
Console.Write("usage: schemazen " + cmd.GetUsageText());
return -1;
}
if (!cmd.Run()) {
return -1;
}
return 0;
}
}
}
|
mit
|
C#
|
e6292c92daf6ee0ea8a34d82d358a4913390dbf7
|
Update sample
|
mattleibow/square-bindings,Redth/square-bindings,Redth/square-bindings
|
sample/ValetSample/ViewController.cs
|
sample/ValetSample/ViewController.cs
|
using System;
using Foundation;
using UIKit;
using Square.Valet;
namespace ValetSample
{
public partial class ViewController : UIViewController
{
private SecureEnclaveValet valet;
private string username;
public ViewController (IntPtr handle)
: base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
valet = new SecureEnclaveValet ("Enclave-Id", AccessControl.UserPresence);
username = "CustomerPresentProof";
}
partial void OnSetItem (UIButton sender)
{
var str = string.Format ("I am here! {0}", new NSUuid ().AsString ());
var success = valet.SetString (str, username);
textView.Text += (success ? "Set successful." : "Set failed.") + Environment.NewLine;
}
partial void OnGetItem (UIButton sender)
{
var password = valet.GetString (username, "Use TouchID to retreive password");
textView.Text += string.Format ("Retrieved '{0}'.", password) + Environment.NewLine;
}
partial void OnRemoveItem (UIButton sender)
{
var success = valet.RemoveObject (username);
textView.Text += (success ? "Removed item." : "Failure to remove item.") + Environment.NewLine;
}
}
}
|
using System;
using Foundation;
using UIKit;
using Square.Valet;
namespace ValetSample
{
public partial class ViewController : UIViewController
{
private SecureEnclaveValet valet;
private string username;
public ViewController (IntPtr handle)
: base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
valet = new SecureEnclaveValet ("UserPresence");
username = "CustomerPresentProof";
}
partial void OnSetItem (UIButton sender)
{
var str = string.Format ("I am here! {0}", new NSUuid ().AsString ());
var success = valet.SetString (str, username);
textView.Text += (success ? "Set successful." : "Set failed.") + Environment.NewLine;
}
partial void OnGetItem (UIButton sender)
{
var password = valet.GetString (username, "Use TouchID to retreive password");
textView.Text += string.Format ("Retrieved '{0}'.", password) + Environment.NewLine;
}
partial void OnRemoveItem (UIButton sender)
{
var success = valet.RemoveObject (username);
textView.Text += (success ? "Removed item." : "Failure to remove item.") + Environment.NewLine;
}
}
}
|
apache-2.0
|
C#
|
b1037d276af6cad3726a572b7bfab0d3f546de02
|
Create ThemeRoot if not exists
|
faint32/snowflake-1,RonnChyran/snowflake,faint32/snowflake-1,faint32/snowflake-1,RonnChyran/snowflake,SnowflakePowered/snowflake,SnowflakePowered/snowflake,RonnChyran/snowflake,SnowflakePowered/snowflake
|
Snowflake.Shell.Windows/ThemeServer.cs
|
Snowflake.Shell.Windows/ThemeServer.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Net;
using System.Threading;
using Snowflake.Extensions;
using Snowflake.Service.HttpServer;
using Newtonsoft.Json;
using Unosquare.Labs.EmbedIO;
using Unosquare.Labs.EmbedIO.Log;
using Unosquare.Labs.EmbedIO.Modules;
namespace Snowflake.Shell.Windows
{
public class ThemeServer : IBaseHttpServer
{
public string ThemeRoot { get; set; }
private WebServer themeWebServer;
public ThemeServer(string themeRoot)
{
this.ThemeRoot = themeRoot;
if (!Directory.Exists(this.ThemeRoot))
{
Directory.CreateDirectory(this.ThemeRoot);
}
var url = "http://localhost:30000/";
this.themeWebServer = new WebServer(url);
}
public void StartServer()
{
this.themeWebServer.RegisterModule(new StaticFilesModule(this.ThemeRoot));
this.themeWebServer.Module<StaticFilesModule>().UseRamCache = true;
this.themeWebServer.Module<StaticFilesModule>().DefaultExtension = ".html";
this.themeWebServer.Module<StaticFilesModule>().DefaultDocument = "index.html";
this.themeWebServer.Module<StaticFilesModule>().AddHandler(ModuleMap.AnyPath, HttpVerbs.Post, (server, context) => EchoThemes(context, server));
this.themeWebServer.RunAsync();
}
private bool EchoThemes(HttpListenerContext context, WebServer server, bool sendBuffer = true)
{
HashSet<object> themesDirectory = new HashSet<object>();
foreach (string directory in Directory.GetDirectories(this.ThemeRoot))
{
if (File.Exists(Path.Combine(directory, "theme.json"))) {
string themeInfo = File.ReadAllText(Path.Combine(directory, "theme.json"));
themesDirectory.Add(JsonConvert.DeserializeObject(themeInfo));
}
}
byte[]output = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(themesDirectory));
context.Response.OutputStream.Write(output, 0, output.Length);
context.Response.OutputStream.Close();
return true;
}
public void StopServer()
{
this.themeWebServer.Dispose();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Net;
using System.Threading;
using Snowflake.Extensions;
using Snowflake.Service.HttpServer;
using Newtonsoft.Json;
using Unosquare.Labs.EmbedIO;
using Unosquare.Labs.EmbedIO.Log;
using Unosquare.Labs.EmbedIO.Modules;
namespace Snowflake.Shell.Windows
{
public class ThemeServer : IBaseHttpServer
{
public string ThemeRoot { get; set; }
private WebServer themeWebServer;
public ThemeServer(string themeRoot)
{
this.ThemeRoot = themeRoot;
var url = "http://localhost:30000/";
this.themeWebServer = new WebServer(url);
}
public void StartServer()
{
this.themeWebServer.RegisterModule(new StaticFilesModule(this.ThemeRoot));
this.themeWebServer.Module<StaticFilesModule>().UseRamCache = true;
this.themeWebServer.Module<StaticFilesModule>().DefaultExtension = ".html";
this.themeWebServer.Module<StaticFilesModule>().DefaultDocument = "index.html";
this.themeWebServer.Module<StaticFilesModule>().AddHandler(ModuleMap.AnyPath, HttpVerbs.Post, (server, context) => EchoThemes(context, server));
this.themeWebServer.RunAsync();
}
private bool EchoThemes(HttpListenerContext context, WebServer server, bool sendBuffer = true)
{
HashSet<object> themesDirectory = new HashSet<object>();
foreach (string directory in Directory.GetDirectories(this.ThemeRoot))
{
if (File.Exists(Path.Combine(directory, "theme.json"))) {
string themeInfo = File.ReadAllText(Path.Combine(directory, "theme.json"));
themesDirectory.Add(JsonConvert.DeserializeObject(themeInfo));
}
}
byte[]output = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(themesDirectory));
context.Response.OutputStream.Write(output, 0, output.Length);
context.Response.OutputStream.Close();
return true;
}
public void StopServer()
{
this.themeWebServer.Dispose();
}
}
}
|
mpl-2.0
|
C#
|
71b281c8f20e4e1c19e9c94458896c6beb3fdad3
|
Make well defined top level names
|
brettfo/roslyn,reaction1989/roslyn,heejaechang/roslyn,jmarolf/roslyn,brettfo/roslyn,CyrusNajmabadi/roslyn,dotnet/roslyn,weltkante/roslyn,dotnet/roslyn,eriawan/roslyn,heejaechang/roslyn,agocke/roslyn,AlekseyTs/roslyn,tmat/roslyn,jasonmalinowski/roslyn,weltkante/roslyn,aelij/roslyn,agocke/roslyn,tannergooding/roslyn,shyamnamboodiripad/roslyn,KirillOsenkov/roslyn,davkean/roslyn,weltkante/roslyn,mavasani/roslyn,gafter/roslyn,jmarolf/roslyn,stephentoub/roslyn,sharwell/roslyn,KirillOsenkov/roslyn,panopticoncentral/roslyn,brettfo/roslyn,KevinRansom/roslyn,shyamnamboodiripad/roslyn,diryboy/roslyn,KevinRansom/roslyn,mavasani/roslyn,agocke/roslyn,genlu/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,eriawan/roslyn,physhi/roslyn,aelij/roslyn,genlu/roslyn,ErikSchierboom/roslyn,mavasani/roslyn,shyamnamboodiripad/roslyn,AmadeusW/roslyn,AlekseyTs/roslyn,mgoertz-msft/roslyn,diryboy/roslyn,wvdd007/roslyn,davkean/roslyn,wvdd007/roslyn,jasonmalinowski/roslyn,sharwell/roslyn,abock/roslyn,aelij/roslyn,abock/roslyn,panopticoncentral/roslyn,diryboy/roslyn,tmat/roslyn,dotnet/roslyn,AmadeusW/roslyn,mgoertz-msft/roslyn,wvdd007/roslyn,CyrusNajmabadi/roslyn,mgoertz-msft/roslyn,eriawan/roslyn,reaction1989/roslyn,bartdesmet/roslyn,bartdesmet/roslyn,physhi/roslyn,gafter/roslyn,stephentoub/roslyn,ErikSchierboom/roslyn,physhi/roslyn,reaction1989/roslyn,panopticoncentral/roslyn,genlu/roslyn,abock/roslyn,AmadeusW/roslyn,jasonmalinowski/roslyn,ErikSchierboom/roslyn,davkean/roslyn,tmat/roslyn,jmarolf/roslyn,gafter/roslyn,tannergooding/roslyn,KirillOsenkov/roslyn,tannergooding/roslyn,heejaechang/roslyn,sharwell/roslyn,CyrusNajmabadi/roslyn,stephentoub/roslyn,AlekseyTs/roslyn
|
src/Workspaces/Core/Portable/Workspace/Host/PersistentStorage/IPersistentStorageLocationService.cs
|
src/Workspaces/Core/Portable/Workspace/Host/PersistentStorage/IPersistentStorageLocationService.cs
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Composition;
using System.IO;
using System.Linq;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Serialization;
namespace Microsoft.CodeAnalysis.Host
{
interface IPersistentStorageLocationService : IWorkspaceService
{
string TryGetStorageLocation(Solution solution);
}
[ExportWorkspaceService(typeof(IPersistentStorageLocationService)), Shared]
internal class DefaultPersistentStorageLocationService : IPersistentStorageLocationService
{
[ImportingConstructor]
public DefaultPersistentStorageLocationService()
{
}
public string TryGetStorageLocation(Solution solution)
{
if (string.IsNullOrWhiteSpace(solution.FilePath))
return null;
// Ensure that each unique workspace kind for any given solution has a unique
// folder to store their data in.
// Store in the LocalApplicationData/Roslyn/hash folder (%appdatalocal%/... on Windows,
// ~/.local/share/... on unix). This will place the folder in a location we can trust
// to be able to get back to consistently as long as we're working with the same
// solution and the same workspace kind.
var appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.Create);
var kind = StripInvalidPathChars(solution.Workspace.Kind ?? "");
var hash = StripInvalidPathChars(Checksum.Create(solution.FilePath).ToString());
return Path.Combine(appDataFolder, "Roslyn", kind, hash);
static string StripInvalidPathChars(string val)
{
var invalidPathChars = Path.GetInvalidPathChars();
val = new string(val.Where(c => !invalidPathChars.Contains(c)).ToArray());
return string.IsNullOrWhiteSpace(val) ? "None" : val;
}
}
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Composition;
using System.IO;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Serialization;
namespace Microsoft.CodeAnalysis.Host
{
interface IPersistentStorageLocationService : IWorkspaceService
{
string TryGetStorageLocation(Solution solution);
}
[ExportWorkspaceService(typeof(IPersistentStorageLocationService)), Shared]
internal class DefaultPersistentStorageLocationService : IPersistentStorageLocationService
{
[ImportingConstructor]
public DefaultPersistentStorageLocationService()
{
}
public string TryGetStorageLocation(Solution solution)
{
if (string.IsNullOrWhiteSpace(solution.FilePath))
return null;
// Ensure that each unique workspace kind for any given solution has a unique
// folder to store their data in.
var checksums = new[] { Checksum.Create(solution.FilePath), Checksum.Create(solution.Workspace.Kind) };
var hashedName = Checksum.Create(WellKnownSynchronizationKind.Null, checksums).ToString();
var appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.Create);
var workingFolder = Path.Combine(appDataFolder, "Roslyn", hashedName);
return workingFolder;
}
}
}
|
mit
|
C#
|
532311cd257a537175faa28a3aa1a23d7da280b4
|
Update SemanticClassificationBufferTaggerProvider.cs
|
xasx/roslyn,antonssonj/roslyn,xasx/roslyn,pdelvo/roslyn,mgoertz-msft/roslyn,MatthieuMEZIL/roslyn,jhendrixMSFT/roslyn,leppie/roslyn,diryboy/roslyn,amcasey/roslyn,tannergooding/roslyn,xoofx/roslyn,nguerrera/roslyn,lorcanmooney/roslyn,stephentoub/roslyn,amcasey/roslyn,Maxwe11/roslyn,davkean/roslyn,Pvlerick/roslyn,jamesqo/roslyn,mattwar/roslyn,OmarTawfik/roslyn,agocke/roslyn,tvand7093/roslyn,swaroop-sridhar/roslyn,paulvanbrenk/roslyn,kelltrick/roslyn,ericfe-ms/roslyn,AArnott/roslyn,TyOverby/roslyn,stephentoub/roslyn,TyOverby/roslyn,kelltrick/roslyn,lorcanmooney/roslyn,sharadagrawal/Roslyn,Pvlerick/roslyn,brettfo/roslyn,vcsjones/roslyn,AlekseyTs/roslyn,oocx/roslyn,mattscheffer/roslyn,paulvanbrenk/roslyn,ValentinRueda/roslyn,panopticoncentral/roslyn,wvdd007/roslyn,VPashkov/roslyn,dpoeschl/roslyn,Hosch250/roslyn,DustinCampbell/roslyn,jeffanders/roslyn,balajikris/roslyn,jcouv/roslyn,rgani/roslyn,natidea/roslyn,eriawan/roslyn,a-ctor/roslyn,reaction1989/roslyn,Shiney/roslyn,davkean/roslyn,zooba/roslyn,akrisiun/roslyn,amcasey/roslyn,TyOverby/roslyn,aelij/roslyn,jbhensley/roslyn,jhendrixMSFT/roslyn,khyperia/roslyn,sharwell/roslyn,panopticoncentral/roslyn,vslsnap/roslyn,abock/roslyn,KirillOsenkov/roslyn,MichalStrehovsky/roslyn,jaredpar/roslyn,mgoertz-msft/roslyn,swaroop-sridhar/roslyn,vcsjones/roslyn,drognanar/roslyn,ljw1004/roslyn,oocx/roslyn,ValentinRueda/roslyn,tannergooding/roslyn,Shiney/roslyn,jaredpar/roslyn,Shiney/roslyn,drognanar/roslyn,brettfo/roslyn,ErikSchierboom/roslyn,sharwell/roslyn,MichalStrehovsky/roslyn,VPashkov/roslyn,weltkante/roslyn,SeriaWei/roslyn,vcsjones/roslyn,MatthieuMEZIL/roslyn,managed-commons/roslyn,DustinCampbell/roslyn,eriawan/roslyn,OmarTawfik/roslyn,Hosch250/roslyn,aanshibudhiraja/Roslyn,AmadeusW/roslyn,AArnott/roslyn,jeffanders/roslyn,KevinH-MS/roslyn,agocke/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,KiloBravoLima/roslyn,Giftednewt/roslyn,KevinRansom/roslyn,xasx/roslyn,ErikSchierboom/roslyn,khyperia/roslyn,orthoxerox/roslyn,dotnet/roslyn,MattWindsor91/roslyn,mattwar/roslyn,jcouv/roslyn,wvdd007/roslyn,vslsnap/roslyn,aelij/roslyn,khyperia/roslyn,genlu/roslyn,orthoxerox/roslyn,natidea/roslyn,weltkante/roslyn,cston/roslyn,tmat/roslyn,michalhosala/roslyn,MattWindsor91/roslyn,mmitche/roslyn,genlu/roslyn,tmeschter/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,tannergooding/roslyn,AlekseyTs/roslyn,CyrusNajmabadi/roslyn,dotnet/roslyn,mgoertz-msft/roslyn,heejaechang/roslyn,paulvanbrenk/roslyn,ljw1004/roslyn,KevinH-MS/roslyn,shyamnamboodiripad/roslyn,a-ctor/roslyn,jmarolf/roslyn,khellang/roslyn,heejaechang/roslyn,srivatsn/roslyn,reaction1989/roslyn,mattscheffer/roslyn,bartdesmet/roslyn,gafter/roslyn,swaroop-sridhar/roslyn,khellang/roslyn,jeffanders/roslyn,natidea/roslyn,robinsedlaczek/roslyn,mavasani/roslyn,AnthonyDGreen/roslyn,stephentoub/roslyn,gafter/roslyn,KiloBravoLima/roslyn,antonssonj/roslyn,akrisiun/roslyn,KirillOsenkov/roslyn,mmitche/roslyn,heejaechang/roslyn,ljw1004/roslyn,yeaicc/roslyn,moozzyk/roslyn,srivatsn/roslyn,sharwell/roslyn,sharadagrawal/Roslyn,jhendrixMSFT/roslyn,Giftednewt/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,CaptainHayashi/roslyn,rgani/roslyn,basoundr/roslyn,MichalStrehovsky/roslyn,antonssonj/roslyn,abock/roslyn,robinsedlaczek/roslyn,kelltrick/roslyn,mattwar/roslyn,jkotas/roslyn,eriawan/roslyn,AlekseyTs/roslyn,leppie/roslyn,shyamnamboodiripad/roslyn,mseamari/Stuff,CyrusNajmabadi/roslyn,moozzyk/roslyn,jamesqo/roslyn,wvdd007/roslyn,akrisiun/roslyn,nguerrera/roslyn,jcouv/roslyn,thomaslevesque/roslyn,yeaicc/roslyn,physhi/roslyn,khellang/roslyn,jasonmalinowski/roslyn,jmarolf/roslyn,tvand7093/roslyn,Hosch250/roslyn,AnthonyDGreen/roslyn,Pvlerick/roslyn,davkean/roslyn,Giftednewt/roslyn,abock/roslyn,thomaslevesque/roslyn,panopticoncentral/roslyn,gafter/roslyn,AmadeusW/roslyn,xoofx/roslyn,jasonmalinowski/roslyn,ericfe-ms/roslyn,genlu/roslyn,KirillOsenkov/roslyn,a-ctor/roslyn,vslsnap/roslyn,HellBrick/roslyn,Maxwe11/roslyn,balajikris/roslyn,bbarry/roslyn,basoundr/roslyn,reaction1989/roslyn,natgla/roslyn,CaptainHayashi/roslyn,jasonmalinowski/roslyn,physhi/roslyn,jkotas/roslyn,rgani/roslyn,michalhosala/roslyn,bartdesmet/roslyn,cston/roslyn,HellBrick/roslyn,VSadov/roslyn,pdelvo/roslyn,tmeschter/roslyn,jbhensley/roslyn,weltkante/roslyn,KiloBravoLima/roslyn,OmarTawfik/roslyn,ErikSchierboom/roslyn,aanshibudhiraja/Roslyn,bkoelman/roslyn,xoofx/roslyn,basoundr/roslyn,CyrusNajmabadi/roslyn,bkoelman/roslyn,budcribar/roslyn,HellBrick/roslyn,yeaicc/roslyn,MattWindsor91/roslyn,diryboy/roslyn,thomaslevesque/roslyn,mmitche/roslyn,bbarry/roslyn,jmarolf/roslyn,mseamari/Stuff,SeriaWei/roslyn,oocx/roslyn,robinsedlaczek/roslyn,Maxwe11/roslyn,managed-commons/roslyn,zooba/roslyn,dpoeschl/roslyn,ericfe-ms/roslyn,dpoeschl/roslyn,jaredpar/roslyn,KevinRansom/roslyn,SeriaWei/roslyn,cston/roslyn,DustinCampbell/roslyn,physhi/roslyn,shyamnamboodiripad/roslyn,aelij/roslyn,michalhosala/roslyn,tvand7093/roslyn,bkoelman/roslyn,zooba/roslyn,lorcanmooney/roslyn,jamesqo/roslyn,mseamari/Stuff,CaptainHayashi/roslyn,dotnet/roslyn,aanshibudhiraja/Roslyn,srivatsn/roslyn,balajikris/roslyn,orthoxerox/roslyn,mattscheffer/roslyn,AmadeusW/roslyn,VPashkov/roslyn,mavasani/roslyn,mavasani/roslyn,bbarry/roslyn,AArnott/roslyn,agocke/roslyn,tmeschter/roslyn,budcribar/roslyn,KevinRansom/roslyn,tmat/roslyn,VSadov/roslyn,drognanar/roslyn,leppie/roslyn,MattWindsor91/roslyn,budcribar/roslyn,nguerrera/roslyn,AnthonyDGreen/roslyn,KevinH-MS/roslyn,bartdesmet/roslyn,moozzyk/roslyn,sharadagrawal/Roslyn,natgla/roslyn,ValentinRueda/roslyn,VSadov/roslyn,diryboy/roslyn,tmat/roslyn,brettfo/roslyn,jbhensley/roslyn,pdelvo/roslyn,jkotas/roslyn,natgla/roslyn,managed-commons/roslyn,MatthieuMEZIL/roslyn
|
src/EditorFeatures/Core/Implementation/Classification/SemanticClassificationBufferTaggerProvider.cs
|
src/EditorFeatures/Core/Implementation/Classification/SemanticClassificationBufferTaggerProvider.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Notification;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Tagging;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.CodeAnalysis.Editor.Implementation.Classification
{
/// <summary>
/// This is the tagger we use for buffer classification scenarios. It is only used for
/// IAccurateTagger scenarios. Namely: Copy/Paste and Printing. We use an 'Accurate' buffer
/// tagger since these features need to get classification tags for the entire file.
///
/// i.e. if you're printing, you want semantic classification even for code that's not in view.
/// The same applies to copy/pasting.
/// </summary>
[Export(typeof(ITaggerProvider))]
[TagType(typeof(IClassificationTag))]
[ContentType(ContentTypeNames.CSharpContentType)]
[ContentType(ContentTypeNames.VisualBasicContentType)]
internal partial class SemanticClassificationBufferTaggerProvider : ForegroundThreadAffinitizedObject, ITaggerProvider
{
private readonly IAsynchronousOperationListener _asyncListener;
private readonly IForegroundNotificationService _notificationService;
private readonly ISemanticChangeNotificationService _semanticChangeNotificationService;
private readonly ClassificationTypeMap _typeMap;
[ImportingConstructor]
public SemanticClassificationBufferTaggerProvider(
IForegroundNotificationService notificationService,
ISemanticChangeNotificationService semanticChangeNotificationService,
ClassificationTypeMap typeMap,
[ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners)
{
_notificationService = notificationService;
_semanticChangeNotificationService = semanticChangeNotificationService;
_typeMap = typeMap;
_asyncListener = new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.Classification);
}
public IAccurateTagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag
{
this.AssertIsForeground();
return new Tagger(this, buffer) as IAccurateTagger<T>;
}
ITagger<T> ITaggerProvider.CreateTagger<T>(ITextBuffer buffer)
{
return CreateTagger<T>(buffer);
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Notification;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Tagging;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.CodeAnalysis.Editor.Implementation.Classification
{
/// <summary>
/// This is the tagger we use for buffer classification scenarios. It is only used for
/// IAccurateTagger scenarios. Namely: Copy/Paste and Printing. We use an 'Accurate' buffer
/// tagger since these features need to get classification tags for the entire file.
///
/// i.e. if you're printing, you want semantic classification, even for code that's not in view.
/// The same applies to copy/pasting.
/// </summary>
[Export(typeof(ITaggerProvider))]
[TagType(typeof(IClassificationTag))]
[ContentType(ContentTypeNames.CSharpContentType)]
[ContentType(ContentTypeNames.VisualBasicContentType)]
internal partial class SemanticClassificationBufferTaggerProvider : ForegroundThreadAffinitizedObject, ITaggerProvider
{
private readonly IAsynchronousOperationListener _asyncListener;
private readonly IForegroundNotificationService _notificationService;
private readonly ISemanticChangeNotificationService _semanticChangeNotificationService;
private readonly ClassificationTypeMap _typeMap;
[ImportingConstructor]
public SemanticClassificationBufferTaggerProvider(
IForegroundNotificationService notificationService,
ISemanticChangeNotificationService semanticChangeNotificationService,
ClassificationTypeMap typeMap,
[ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners)
{
_notificationService = notificationService;
_semanticChangeNotificationService = semanticChangeNotificationService;
_typeMap = typeMap;
_asyncListener = new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.Classification);
}
public IAccurateTagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag
{
this.AssertIsForeground();
return new Tagger(this, buffer) as IAccurateTagger<T>;
}
ITagger<T> ITaggerProvider.CreateTagger<T>(ITextBuffer buffer)
{
return CreateTagger<T>(buffer);
}
}
}
|
apache-2.0
|
C#
|
62df7f869031c6b772e1b32a0b34832786e5b841
|
Add filter
|
planetxamarin/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin
|
src/Firehose.Web/Authors/JoeMeyer.cs
|
src/Firehose.Web/Authors/JoeMeyer.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class JoeMeyer : IAmACommunityMember, IFilterMyBlogPosts
{
public string FirstName => "Joe";
public string LastName => "Meyer";
public string StateOrRegion => "Chicago, IL";
public string TwitterHandle => "iwritecodesmtms";
public string EmailAddress => "joseph.w.meyer@live.com";
public string ShortBioOrTagLine => "I write code sometimes";
public string GravatarHash => "1431dd2c4749b0a178c7a3130e71831e";
public Uri WebSite => new Uri("https://iwritecodesometimes.net");
public string GitHubHandle => "JoeM-RP";
public GeoPosition Position => new GeoPosition(41.92, -87.65);
public IEnumerable<Uri> FeedUris
{
get { yield return new Uri("https://iwritecodesometimes.net/feed/"); }
}
public string FeedLanguageCode => "en";
public bool Filter(SyndicationItem item)
=> item.Categories?.Any(c => c.Name.ToLowerInvariant().Equals("xamarin")) ?? false;
}
}
|
using System;
using System.Collections.Generic;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class JoeMeyer : IAmACommunityMember
{
public string FirstName => "Joe";
public string LastName => "Meyer";
public string StateOrRegion => "Chicago, IL";
public string TwitterHandle => "iwritecodesmtms";
public string EmailAddress => "joseph.w.meyer@live.com";
public string ShortBioOrTagLine => "I write code sometimes";
public string GravatarHash => "1431dd2c4749b0a178c7a3130e71831e";
public Uri WebSite => new Uri("https://iwritecodesometimes.net");
public string GitHubHandle => "JoeM-RP";
public GeoPosition Position => new GeoPosition(41.92, -87.65);
public IEnumerable<Uri> FeedUris
{
get { yield return new Uri("https://iwritecodesometimes.net/feed/"); }
}
public string FeedLanguageCode => "en";
}
}
|
mit
|
C#
|
b7c216e686754e92b24b81f608e96be80629e169
|
Support for creating customer object with shipping info
|
bhushan-firake/NStripe
|
src/NStripe/Models/StripeCustomer.cs
|
src/NStripe/Models/StripeCustomer.cs
|
using System;
using System.Collections.Generic;
namespace NStripe
{
[Route("/customers", "POST")]
public class CreateStripeCustomer : StripeRequestBase, IResponse<StripeCustomer>
{
public int? AccountBalance { get; set; }
public string Coupon { get; set; }
public string Description { get; set; }
public string Email { get; set; }
public Dictionary<string, string> Metadata { get; set; }
public int? Quantity { get; set; }
public StripeShippingInfo Shipping { get; set; }
public decimal? TaxPercent { get; set; }
public DateTime? TrialEnd { get; set; }
//TODO:Source can also be a dictionary
public string Source { get; set; }
}
[Route("/customers/{id}", "GET")]
public class GetStripeCustomer : StripeRequestBase, IResponse<StripeCustomer>
{
public string Id { get; set; }
}
public class StripeCustomer : StripeId
{
public int AccountBalance { get; set; }
public DateTime? Created { get; set; }
public string Currency { get; set; }
public string DefaultSource { get; set; }
public bool? Delinquent { get; set; }
public string Description { get; set; }
public StripeDiscount Discount { get; set; }
public string Email { get; set; }
public bool? Livemode { get; set; }
public Dictionary<string, string> Metadata { get; set; }
public StripeShippingInfo Shipping { get; set; }
//TODO:Add Payment Sources bitcoin receivers/cards
public StripeCollection<StripeSubscription> Subscriptions { get; set; }
public string Source { get; set; }
public bool? Deleted { get; set; }
}
public class StripeShippingInfo
{
public StripeShippingAddress Address { get; set; }
public string Name { get; set; }
public string Phone { get; set; }
}
public class StripeShippingAddress
{
public string City { get; set; }
public string Country { get; set; }
public string Line1 { get; set; }
public string Line2 { get; set; }
public string PostalCode { get; set; }
public string State { get; set; }
}
}
|
using System;
using System.Collections.Generic;
namespace NStripe
{
[Route("/customers", "POST")]
public class CreateStripeCustomer : StripeRequestBase, IResponse<StripeCustomer>
{
public int? AccountBalance { get; set; }
public string Coupon { get; set; }
public string Description { get; set; }
public string Email { get; set; }
public Dictionary<string, string> Metadata { get; set; }
public int? Quantity { get; set; }
public StripeShippingInformation Shipping { get; set; }
public decimal? TaxPercent { get; set; }
public DateTime? TrialEnd { get; set; }
//TODO:Source can also be a dictionary
public string Source { get; set; }
}
[Route("/customers/{id}", "GET")]
public class GetStripeCustomer : StripeRequestBase, IResponse<StripeCustomer>
{
public string Id { get; set; }
}
public class StripeCustomer : StripeId
{
public int AccountBalance { get; set; }
public DateTime? Created { get; set; }
public string Currency { get; set; }
public string DefaultSource { get; set; }
public bool? Delinquent { get; set; }
public string Description { get; set; }
public StripeDiscount Discount { get; set; }
public string Email { get; set; }
public bool? Livemode { get; set; }
public Dictionary<string, string> Metadata { get; set; }
public StripeShippingInformation Shipping { get; set; }
//TODO:Add Payment Sources bitcoin receivers/cards
public StripeCollection<StripeSubscription> Subscriptions { get; set; }
public string Source { get; set; }
public bool? Deleted { get; set; }
}
public class StripeShippingInformation
{
public StripeShippingAddress Address { get; set; }
}
public class StripeShippingAddress
{
public string City { get; set; }
public string Country { get; set; }
public string Line1 { get; set; }
public string Line2 { get; set; }
public string PostalCode { get; set; }
public string State { get; set; }
public string Name { get; set; }
public string Phone { get; set; }
}
}
|
mit
|
C#
|
2f37a37f8ea695e53f0ad67ba510bba9dee428e2
|
Add BookLoan Class to LibraryContext.
|
Programazing/Open-School-Library,Programazing/Open-School-Library
|
src/Open-School-Library/Data/LibraryContext.cs
|
src/Open-School-Library/Data/LibraryContext.cs
|
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Open_School_Library.Models.DatabaseModels;
namespace Open_School_Library.Data
{
public class LibraryContext : DbContext
{
public LibraryContext(DbContextOptions<LibraryContext> options) : base(options)
{
}
public DbSet<Student> Students { get; set; }
public DbSet<Teacher> Teachers { get; set; }
public DbSet<Book> Books { get; set; }
public DbSet<Genre> Genres { get; set; }
public DbSet<Dewey> Deweys { get; set; }
public DbSet<BookLoan> BookLoans { get; set; }
public DbSet<Setting> Settings { get; set; }
}
}
|
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Open_School_Library.Models.DatabaseModels;
namespace Open_School_Library.Data
{
public class LibraryContext : DbContext
{
public LibraryContext(DbContextOptions<LibraryContext> options) : base(options)
{
}
public DbSet<Student> Students { get; set; }
public DbSet<Teacher> Teachers { get; set; }
public DbSet<Book> Books { get; set; }
public DbSet<Genre> Genres { get; set; }
public DbSet<Dewey> Deweys { get; set; }
public DbSet<Setting> Settings { get; set; }
}
}
|
mit
|
C#
|
2946a35b0e8099ed8ec39da51a7ba17487950b32
|
use delegate instead of Expression
|
adamhathcock/sharpcompress,adamhathcock/sharpcompress,adamhathcock/sharpcompress
|
src/SharpCompress/Writers/IWriterExtensions.cs
|
src/SharpCompress/Writers/IWriterExtensions.cs
|
using System;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
namespace SharpCompress.Writers
{
public static class IWriterExtensions
{
public static void Write(this IWriter writer, string entryPath, Stream source)
{
writer.Write(entryPath, source, null);
}
public static void Write(this IWriter writer, string entryPath, FileInfo source)
{
if (!source.Exists)
{
throw new ArgumentException("Source does not exist: " + source.FullName);
}
using (var stream = source.OpenRead())
{
writer.Write(entryPath, stream, source.LastWriteTime);
}
}
public static void Write(this IWriter writer, string entryPath, string source)
{
writer.Write(entryPath, new FileInfo(source));
}
public static void WriteAll(this IWriter writer, string directory, string searchPattern = "*", SearchOption option = SearchOption.TopDirectoryOnly)
{
writer.WriteAll(directory, searchPattern, null, option);
}
public static void WriteAll(this IWriter writer,
string directory,
string searchPattern = "*",
Func<string, bool>? fileSearchFunc = null,
SearchOption option = SearchOption.TopDirectoryOnly)
{
if (!Directory.Exists(directory))
{
throw new ArgumentException("Directory does not exist: " + directory);
}
if (fileSearchFunc is null)
{
fileSearchFunc = n => true;
}
foreach (var file in Directory.EnumerateFiles(directory, searchPattern, option).Where(fileSearchFunc))
{
writer.Write(file.Substring(directory.Length), file);
}
}
}
}
|
using System;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
namespace SharpCompress.Writers
{
public static class IWriterExtensions
{
public static void Write(this IWriter writer, string entryPath, Stream source)
{
writer.Write(entryPath, source, null);
}
public static void Write(this IWriter writer, string entryPath, FileInfo source)
{
if (!source.Exists)
{
throw new ArgumentException("Source does not exist: " + source.FullName);
}
using (var stream = source.OpenRead())
{
writer.Write(entryPath, stream, source.LastWriteTime);
}
}
public static void Write(this IWriter writer, string entryPath, string source)
{
writer.Write(entryPath, new FileInfo(source));
}
public static void WriteAll(this IWriter writer, string directory, string searchPattern = "*", SearchOption option = SearchOption.TopDirectoryOnly)
{
writer.WriteAll(directory, searchPattern, null, option);
}
public static void WriteAll(this IWriter writer,
string directory,
string searchPattern = "*",
Expression<Func<string, bool>>? fileSearchFunc = null,
SearchOption option = SearchOption.TopDirectoryOnly)
{
if (!Directory.Exists(directory))
{
throw new ArgumentException("Directory does not exist: " + directory);
}
if (fileSearchFunc is null)
{
fileSearchFunc = n => true;
}
foreach (var file in Directory.EnumerateFiles(directory, searchPattern, option).Where(fileSearchFunc.Compile()))
{
writer.Write(file.Substring(directory.Length), file);
}
}
}
}
|
mit
|
C#
|
f5f35be31dcd49027e55169c24939bc6fe1bc4e9
|
Remove duplicate attribute
|
onovotny/SignService,onovotny/SignService,onovotny/SignService
|
src/SignService/Controllers/AdminController.cs
|
src/SignService/Controllers/AdminController.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using SignService.Services;
namespace SignService.Controllers
{
[Authorize(Roles = "admin_signservice")]
[RequireHttps]
public class AdminController : Controller
{
readonly IAdminService adminService;
public AdminController(IAdminService adminService)
{
this.adminService = adminService;
}
public IActionResult Index()
{
return View();
}
public async Task<IActionResult> RegisterExtensionAttributes()
{
await adminService.RegisterExtensionPropertiesAsync();
return RedirectToAction(nameof(Index));
}
public async Task<IActionResult> UnRegisterExtensionAttributes()
{
await adminService.UnRegisterExtensionPropertiesAsync();
return RedirectToAction(nameof(Index));
}
public async Task<IActionResult> Users()
{
var users = await adminService.GetConfiguredUsersAsync();
// var users = await adminService.GetUsersAsync();
return View(users);
}
public async Task<IActionResult> Search(string displayName)
{
var users = await adminService.GetUsersAsync(displayName);
return View(users);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using SignService.Services;
namespace SignService.Controllers
{
[Authorize(Roles = "admin_signservice")]
[Authorize]
[RequireHttps]
public class AdminController : Controller
{
readonly IAdminService adminService;
public AdminController(IAdminService adminService)
{
this.adminService = adminService;
}
public IActionResult Index()
{
return View();
}
public async Task<IActionResult> RegisterExtensionAttributes()
{
await adminService.RegisterExtensionPropertiesAsync();
return RedirectToAction(nameof(Index));
}
public async Task<IActionResult> UnRegisterExtensionAttributes()
{
await adminService.UnRegisterExtensionPropertiesAsync();
return RedirectToAction(nameof(Index));
}
public async Task<IActionResult> Users()
{
var users = await adminService.GetConfiguredUsersAsync();
// var users = await adminService.GetUsersAsync();
return View(users);
}
public async Task<IActionResult> Search(string displayName)
{
var users = await adminService.GetUsersAsync(displayName);
return View(users);
}
}
}
|
mit
|
C#
|
82a2f9b0a9b6f2f60fecdf41d1233ff3eb0d77e6
|
Fix the issue that .JSON file is 404 when running docfx serve
|
LordZoltan/docfx,928PJY/docfx,hellosnow/docfx,sergey-vershinin/docfx,DuncanmaMSFT/docfx,superyyrrzz/docfx,superyyrrzz/docfx,928PJY/docfx,DuncanmaMSFT/docfx,hellosnow/docfx,pascalberger/docfx,hellosnow/docfx,superyyrrzz/docfx,LordZoltan/docfx,sergey-vershinin/docfx,LordZoltan/docfx,dotnet/docfx,LordZoltan/docfx,dotnet/docfx,sergey-vershinin/docfx,dotnet/docfx,928PJY/docfx,pascalberger/docfx,pascalberger/docfx
|
src/docfx/SubCommands/ServeCommand.cs
|
src/docfx/SubCommands/ServeCommand.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.DocAsCode.SubCommands
{
using System;
using System.IO;
using Microsoft.DocAsCode;
using Microsoft.DocAsCode.Common;
using Microsoft.DocAsCode.Plugins;
using Owin.StaticFiles;
using Owin.FileSystems;
using Owin.Hosting;
using global::Owin;
internal sealed class ServeCommand : ISubCommand
{
private readonly ServeCommandOptions _options;
public bool AllowReplay => false;
public ServeCommand(ServeCommandOptions options)
{
_options = options;
}
public void Exec(SubCommandRunningContext context)
{
Serve(_options.Folder, _options.Port.HasValue ? _options.Port.Value.ToString() : null);
}
public static void Serve(string folder, string port)
{
if (string.IsNullOrEmpty(folder)) folder = Environment.CurrentDirectory;
folder = Path.GetFullPath(folder);
port = string.IsNullOrWhiteSpace(port) ? "8080" : port;
var url = $"http://localhost:{port}";
var fileServerOptions = new FileServerOptions
{
EnableDirectoryBrowsing = true,
FileSystem = new PhysicalFileSystem(folder),
};
// Fix the issue that .JSON file is 404 when running docfx serve
fileServerOptions.StaticFileOptions.ServeUnknownFileTypes = true;
if (!File.Exists(Path.Combine(folder, "index.html")) && File.Exists(Path.Combine(folder, "toc.html")))
{
File.Copy(Path.Combine(folder, "toc.html"), Path.Combine(folder, "index.html"));
}
try
{
WebApp.Start(url, builder => builder.UseFileServer(fileServerOptions));
Console.WriteLine($"Serving \"{folder}\" on {url}");
Console.ReadLine();
}
catch (System.Reflection.TargetInvocationException)
{
Logger.LogError($"Error serving \"{folder}\" on {url}, check if the port is already being in use.");
}
}
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.DocAsCode.SubCommands
{
using System;
using System.IO;
using Microsoft.DocAsCode;
using Microsoft.DocAsCode.Common;
using Microsoft.DocAsCode.Plugins;
using Owin.StaticFiles;
using Owin.FileSystems;
using Owin.Hosting;
using global::Owin;
internal sealed class ServeCommand : ISubCommand
{
private readonly ServeCommandOptions _options;
public bool AllowReplay => false;
public ServeCommand(ServeCommandOptions options)
{
_options = options;
}
public void Exec(SubCommandRunningContext context)
{
Serve(_options.Folder, _options.Port.HasValue ? _options.Port.Value.ToString() : null);
}
public static void Serve(string folder, string port)
{
if (string.IsNullOrEmpty(folder)) folder = Environment.CurrentDirectory;
folder = Path.GetFullPath(folder);
port = string.IsNullOrWhiteSpace(port) ? "8080" : port;
var url = $"http://localhost:{port}";
var fileServerOptions = new FileServerOptions
{
EnableDirectoryBrowsing = true,
FileSystem = new PhysicalFileSystem(folder),
};
if (!File.Exists(Path.Combine(folder, "index.html")) && File.Exists(Path.Combine(folder, "toc.html")))
{
File.Copy(Path.Combine(folder, "toc.html"), Path.Combine(folder, "index.html"));
}
try
{
WebApp.Start(url, builder => builder.UseFileServer(fileServerOptions));
Console.WriteLine($"Serving \"{folder}\" on {url}");
Console.ReadLine();
}
catch (System.Reflection.TargetInvocationException)
{
Logger.LogError($"Error serving \"{folder}\" on {url}, check if the port is already being in use.");
}
}
}
}
|
mit
|
C#
|
0417f9a76170b499f637ea769171c0fa792d8cd7
|
Update Promise.cs
|
drew-r/Maverick
|
Promise.cs
|
Promise.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Maverick
{
public class Promise
{
public Promise(Func<object> asyncOp)
{
Scheduler.Request();
task = new Task(() =>
{
result = asyncOp();
});
try
{
task.Start();
}
catch (Exception e)
{
raiseException(_taskException);
}
}
dynamic result = null;
readonly Task task;
public Promise success(Action<object> cb)
{
task.ContinueWith((t) => Scheduler.Enqueue((i) => cb(result)));
return this;
}
void raiseException(Exception e)
{
_taskException = e;
if (_exceptionCallback != null)
{
Scheduler.Enqueue(() => _exceptionCallback(_taskException));
}
}
Exception _taskException;
Action<object> _exceptionCallback;
public Promise error(Action<object> cb)
{
_exceptionCallback = cb;
if (_taskException != null) { raiseException(_taskException); }
return this;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Maverick
{
public class Promise
{
public Promise(Func<object> asyncOp)
{
Scheduler.Request();
task = new Task(() =>
{
result = asyncOp();
});
try
{
task.Start();
}
catch (Exception e)
{
raiseException(_taskException);
}
}
dynamic result = null;
readonly Task task;
public Promise success(Action<object> cb)
{
task.ContinueWith((t) => Scheduler.Enqueue((i) => cb(result)));
return this;
}
void raiseException(Exception e)
{
_taskException = e;
Scheduler.Enqueue(() => _exceptionCallback(_taskException));
}
Exception _taskException;
Action<object> _exceptionCallback;
public Promise error(Action<object> cb)
{
_exceptionCallback = cb;
if (_taskException != null) { raiseException(_taskException); }
return this;
}
}
}
|
mit
|
C#
|
dbc7faaf247d36f6a056764b4560b06ec5a2bcb0
|
Update Bridge.cs
|
BaamStudios/SharpAngie,BaamStudios/SharpAngie,BaamStudios/SharpAngie
|
BaamStudios.SharpAngie/Bridge.cs
|
BaamStudios.SharpAngie/Bridge.cs
|
using System;
using ServiceStack.Text;
namespace BaamStudios.SharpAngie
{
public class Bridge
{
private string _changingPropertyFromJs;
private readonly ViewModelBase _viewModel;
private readonly IAngularInterface _angularInterface;
public Bridge(ViewModelBase viewModel, IAngularInterface angularInterface)
{
_viewModel = viewModel;
_angularInterface = angularInterface;
}
/// <summary>
/// The javascript object window.sharpAngieBridge should be set up so that any call to sharpAngieBridge.initialize() will be forwarded to this method.
/// </summary>
/// <param name="clientId">User defined identifier for the client. Will be forwarded to IAngularInterface. can be null if not needed.</param>
public void Initialize(string clientId)
{
var modelJson = JsonSerializer.SerializeToString(_viewModel);
_angularInterface.SetModel(clientId, modelJson);
_viewModel.DeepPropertyChanged += (s, propertyPath, value) =>
{
if (_changingPropertyFromJs == propertyPath) return;
var valueJson = value != null ? JsonSerializer.SerializeToString(value) : null;
_angularInterface.SetModelProperty(clientId, propertyPath, valueJson);
};
}
/// <summary>
/// The javascript object window.sharpAngieBridge should be set up so that any call to sharpAngieBridge.setProperty(propertyPath, value) will be forwarded to this method.
/// </summary>
public void SetViewModelProperty(string propertyPath, object value)
{
ReflectionsHelper.SetDeepProperty(_viewModel, propertyPath, value, () => _changingPropertyFromJs = propertyPath,
() => _changingPropertyFromJs = null);
}
/// <summary>
/// The javascript object window.sharpAngieBridge should be set up so that any call to sharpAngieBridge.invokeMethod(methodPath, args) will be forwarded to this method.
/// </summary>
public void InvokeViewModelMethod(string methodPath, object[] args)
{
ReflectionsHelper.InvokeDeepMethod(_viewModel, methodPath, args);
}
}
}
|
using System;
using ServiceStack.Text;
namespace BaamStudios.SharpAngie
{
public class Bridge
{
private string _changingPropertyFromJs;
private readonly ViewModelBase _viewModel;
private readonly IAngularInterface _angularInterface;
public Bridge(ViewModelBase viewModel, IAngularInterface angularInterface)
{
_viewModel = viewModel;
_angularInterface = angularInterface;
}
public void Initialize(string clientId)
{
var modelJson = JsonSerializer.SerializeToString(_viewModel);
_angularInterface.SetModel(clientId, modelJson);
_viewModel.DeepPropertyChanged += (s, propertyPath, value) =>
{
if (_changingPropertyFromJs == propertyPath) return;
var valueJson = value != null ? JsonSerializer.SerializeToString(value) : null;
_angularInterface.SetModelProperty(clientId, propertyPath, valueJson);
};
}
public void SetViewModelProperty(string propertyPath, object value)
{
ReflectionsHelper.SetDeepProperty(_viewModel, propertyPath, value, () => _changingPropertyFromJs = propertyPath,
() => _changingPropertyFromJs = null);
}
public void InvokeViewModelMethod(string methodPath, object[] args)
{
ReflectionsHelper.InvokeDeepMethod(_viewModel, methodPath, args);
}
}
}
|
mit
|
C#
|
d1d7ccee594bf0632e306d2019132051bfbfb18e
|
Fix exception when including this in a project without TriggerAction
|
ShaneOBrien/unity3d-console,Bonemind/unity3d-console,mikelovesrobots/unity3d-console,davidaayers/unity3d-console
|
Console/Scripts/ConsoleAction.cs
|
Console/Scripts/ConsoleAction.cs
|
using UnityEngine;
using System.Collections;
public abstract class ConsoleAction : MonoBehaviour {
public abstract void Activate();
}
|
using UnityEngine;
using System.Collections;
public abstract class ConsoleAction : ActionBase {
public abstract void Activate();
}
|
bsd-3-clause
|
C#
|
8aee8525047f99319d9caa48b6d0f27dbbd700db
|
Load game for presentation
|
thinktecture/BreTTspielabend,thinktecture/BreTTspielabend,thinktecture/BreTTspielabend
|
src/api/Thinktecture.Brettspielabend/Thinktecture.Brettspielabend.Api/Controllers/ContestController.cs
|
src/api/Thinktecture.Brettspielabend/Thinktecture.Brettspielabend.Api/Controllers/ContestController.cs
|
using System;
using System.Linq;
using System.Net.Http;
using System.Web.Http;
using Thinktecture.Brettspielabend.Api.Data;
using Thinktecture.Brettspielabend.Api.Helpers;
namespace Thinktecture.Brettspielabend.Api.Controllers
{
public class ContestController : ApiController
{
private readonly DataStore _store;
private readonly DistanceCalculator _distanceCalculator;
public ContestController(DataStore store, DistanceCalculator distanceCalculator)
{
_store = store;
_distanceCalculator = distanceCalculator;
}
[HttpPut]
public IHttpActionResult Create(Contest contest)
{
// Sanity checks
if (!_store.Users.ContainsKey(contest.HostId))
{
throw new Exception("Unknown Host.");
}
if (!_store.Games.ContainsKey(contest.GameId))
{
throw new Exception("Unknown Game.");
}
contest.Id = Guid.NewGuid();
_store.Contests.Add(contest.Id, contest);
return Created("Get?id=" + contest.Id, contest);
}
[HttpGet]
public IHttpActionResult List()
{
return Ok(_store.Contests.Values.Select(v => new Contest
{
GameId = v.GameId,
HostId = v.HostId,
Game = _store.Games.Single(g => g.Key == v.GameId).Value,
Id = v.Id,
Location = v.Location
}).ToList());
}
[HttpGet]
public IHttpActionResult Get(Guid id)
{
if (!_store.Contests.ContainsKey(id))
{
return NotFound();
}
return Ok(_store.Contests[id]);
}
[HttpPost]
public IHttpActionResult Update(Contest contest)
{
if (!_store.Contests.ContainsKey(contest.Id))
{
return NotFound();
}
_store.Contests[contest.Id] = contest;
return Ok();
}
[HttpPost]
public IHttpActionResult Delete(Guid id)
{
if (!_store.Contests.ContainsKey(id))
{
return NotFound();
}
_store.Contests.Remove(id);
return Ok();
}
[HttpGet]
public IHttpActionResult FindNearby([FromUri] Coordinates origin, int radius)
{
var contestsNearby = _store.Contests
.Select(c => new
{
Details = LoadGame(c.Value),
Distance = _distanceCalculator.CalculateDistance(origin, c.Value.Location.Coordinates)
})
.Where(c => c.Distance < radius);
return Ok(contestsNearby);
}
internal Contest LoadGame(Contest contest)
{
var game = _store.Games.SingleOrDefault(g => g.Key == contest.GameId);
contest.Game = game.Value;
return contest;
}
}
}
|
using System;
using System.Linq;
using System.Net.Http;
using System.Web.Http;
using Thinktecture.Brettspielabend.Api.Data;
using Thinktecture.Brettspielabend.Api.Helpers;
namespace Thinktecture.Brettspielabend.Api.Controllers
{
public class ContestController : ApiController
{
private readonly DataStore _store;
private readonly DistanceCalculator _distanceCalculator;
public ContestController(DataStore store, DistanceCalculator distanceCalculator)
{
_store = store;
_distanceCalculator = distanceCalculator;
}
[HttpPut]
public IHttpActionResult Create(Contest contest)
{
// Sanity checks
if (!_store.Users.ContainsKey(contest.HostId))
{
throw new Exception("Unknown Host.");
}
if (!_store.Games.ContainsKey(contest.GameId))
{
throw new Exception("Unknown Game.");
}
contest.Id = Guid.NewGuid();
_store.Contests.Add(contest.Id, contest);
return Created("Get?id=" + contest.Id, contest);
}
[HttpGet]
public IHttpActionResult List()
{
return Ok(_store.Contests.Values);
}
[HttpGet]
public IHttpActionResult Get(Guid id)
{
if (!_store.Contests.ContainsKey(id))
{
return NotFound();
}
return Ok(_store.Contests[id]);
}
[HttpPost]
public IHttpActionResult Update(Contest contest)
{
if (!_store.Contests.ContainsKey(contest.Id))
{
return NotFound();
}
_store.Contests[contest.Id] = contest;
return Ok();
}
[HttpPost]
public IHttpActionResult Delete(Guid id)
{
if (!_store.Contests.ContainsKey(id))
{
return NotFound();
}
_store.Contests.Remove(id);
return Ok();
}
[HttpGet]
public IHttpActionResult FindNearby([FromUri] Coordinates origin, int radius)
{
var contestsNearby = _store.Contests
.Select(c => new
{
Details = LoadGame(c.Value),
Distance = _distanceCalculator.CalculateDistance(origin, c.Value.Location.Coordinates)
})
.Where(c => c.Distance < radius);
return Ok(contestsNearby);
}
internal Contest LoadGame(Contest contest)
{
var game = _store.Games.SingleOrDefault(g => g.Key == contest.GameId);
contest.Game = game.Value;
return contest;
}
}
}
|
mit
|
C#
|
8cbbcecf2b2ab52ecc2aa4f3029cfac48794f162
|
check if listened table exists in migration
|
B1naryStudio/Azimuth,B1naryStudio/Azimuth
|
Azimuth.Migrations/Migrations/Migration_201409101200_RemoveListenedTableAndAddCounterToPlaylistTable.cs
|
Azimuth.Migrations/Migrations/Migration_201409101200_RemoveListenedTableAndAddCounterToPlaylistTable.cs
|
using FluentMigrator;
namespace Azimuth.Migrations
{
[Migration(201409101200)]
public class Migration_201409101200_RemoveListenedTableAndAddCounterToPlaylistTable: Migration
{
public override void Up()
{
if (Schema.Table("Listened").Exists())
{
Delete.Table("Listened");
}
Alter.Table("Playlists").AddColumn("Listened").AsInt64().WithDefaultValue(0);
}
public override void Down()
{
Create.Table("Listened")
.WithColumn("Id").AsInt64().NotNullable().Identity().PrimaryKey()
.WithColumn("PlaylistId").AsInt64().NotNullable().ForeignKey("Playlists", "PlaylistsId")
.WithColumn("Amount").AsInt64().NotNullable();
Delete.Column("Listened").FromTable("Playlists");
}
}
}
|
using FluentMigrator;
namespace Azimuth.Migrations
{
[Migration(201409101200)]
public class Migration_201409101200_RemoveListenedTableAndAddCounterToPlaylistTable: Migration
{
public override void Up()
{
Delete.Table("Listened");
Alter.Table("Playlists").AddColumn("Listened").AsInt64().WithDefaultValue(0);
}
public override void Down()
{
Create.Table("Listened")
.WithColumn("Id").AsInt64().NotNullable().Identity().PrimaryKey()
.WithColumn("PlaylistId").AsInt64().NotNullable().ForeignKey("Playlists", "PlaylistsId")
.WithColumn("Amount").AsInt64().NotNullable();
Delete.Column("Listened").FromTable("Playlists");
}
}
}
|
mit
|
C#
|
c95743cebeb88a27e3b4c014efed58f25d2d88f7
|
Add test.'
|
CaptainHayashi/roslyn,MattWindsor91/roslyn,zooba/roslyn,MatthieuMEZIL/roslyn,vslsnap/roslyn,AnthonyDGreen/roslyn,orthoxerox/roslyn,panopticoncentral/roslyn,Giftednewt/roslyn,tvand7093/roslyn,mgoertz-msft/roslyn,mattwar/roslyn,jasonmalinowski/roslyn,Giftednewt/roslyn,bartdesmet/roslyn,MattWindsor91/roslyn,KevinH-MS/roslyn,jhendrixMSFT/roslyn,AnthonyDGreen/roslyn,robinsedlaczek/roslyn,MichalStrehovsky/roslyn,drognanar/roslyn,physhi/roslyn,AnthonyDGreen/roslyn,ericfe-ms/roslyn,Pvlerick/roslyn,OmarTawfik/roslyn,jhendrixMSFT/roslyn,khyperia/roslyn,Hosch250/roslyn,nguerrera/roslyn,weltkante/roslyn,srivatsn/roslyn,wvdd007/roslyn,robinsedlaczek/roslyn,davkean/roslyn,orthoxerox/roslyn,abock/roslyn,yeaicc/roslyn,a-ctor/roslyn,Pvlerick/roslyn,yeaicc/roslyn,Shiney/roslyn,pdelvo/roslyn,lorcanmooney/roslyn,CaptainHayashi/roslyn,Hosch250/roslyn,tmat/roslyn,bbarry/roslyn,gafter/roslyn,robinsedlaczek/roslyn,lorcanmooney/roslyn,gafter/roslyn,akrisiun/roslyn,MichalStrehovsky/roslyn,tmeschter/roslyn,paulvanbrenk/roslyn,tannergooding/roslyn,jmarolf/roslyn,Shiney/roslyn,cston/roslyn,tvand7093/roslyn,vslsnap/roslyn,mavasani/roslyn,amcasey/roslyn,zooba/roslyn,bkoelman/roslyn,leppie/roslyn,MattWindsor91/roslyn,davkean/roslyn,amcasey/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,khyperia/roslyn,xoofx/roslyn,brettfo/roslyn,tannergooding/roslyn,physhi/roslyn,jeffanders/roslyn,bbarry/roslyn,mmitche/roslyn,KirillOsenkov/roslyn,tannergooding/roslyn,davkean/roslyn,a-ctor/roslyn,ljw1004/roslyn,budcribar/roslyn,diryboy/roslyn,genlu/roslyn,AArnott/roslyn,stephentoub/roslyn,ericfe-ms/roslyn,Shiney/roslyn,xasx/roslyn,michalhosala/roslyn,wvdd007/roslyn,cston/roslyn,MatthieuMEZIL/roslyn,KiloBravoLima/roslyn,swaroop-sridhar/roslyn,KiloBravoLima/roslyn,diryboy/roslyn,CaptainHayashi/roslyn,yeaicc/roslyn,shyamnamboodiripad/roslyn,balajikris/roslyn,AmadeusW/roslyn,mattscheffer/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,pdelvo/roslyn,dotnet/roslyn,VSadov/roslyn,balajikris/roslyn,xasx/roslyn,jeffanders/roslyn,jkotas/roslyn,bartdesmet/roslyn,eriawan/roslyn,physhi/roslyn,balajikris/roslyn,ErikSchierboom/roslyn,budcribar/roslyn,tmeschter/roslyn,MichalStrehovsky/roslyn,mattscheffer/roslyn,KirillOsenkov/roslyn,MattWindsor91/roslyn,KirillOsenkov/roslyn,AmadeusW/roslyn,MatthieuMEZIL/roslyn,bbarry/roslyn,natidea/roslyn,aelij/roslyn,leppie/roslyn,leppie/roslyn,diryboy/roslyn,drognanar/roslyn,drognanar/roslyn,VSadov/roslyn,vslsnap/roslyn,kelltrick/roslyn,agocke/roslyn,Pvlerick/roslyn,jmarolf/roslyn,jasonmalinowski/roslyn,AlekseyTs/roslyn,xoofx/roslyn,aelij/roslyn,dpoeschl/roslyn,mmitche/roslyn,zooba/roslyn,jeffanders/roslyn,ErikSchierboom/roslyn,stephentoub/roslyn,bkoelman/roslyn,tmat/roslyn,jhendrixMSFT/roslyn,DustinCampbell/roslyn,VSadov/roslyn,dotnet/roslyn,KevinRansom/roslyn,sharwell/roslyn,nguerrera/roslyn,sharwell/roslyn,tmat/roslyn,dpoeschl/roslyn,jamesqo/roslyn,srivatsn/roslyn,reaction1989/roslyn,mgoertz-msft/roslyn,CyrusNajmabadi/roslyn,jaredpar/roslyn,a-ctor/roslyn,Giftednewt/roslyn,kelltrick/roslyn,reaction1989/roslyn,shyamnamboodiripad/roslyn,TyOverby/roslyn,xoofx/roslyn,jasonmalinowski/roslyn,mmitche/roslyn,ljw1004/roslyn,agocke/roslyn,swaroop-sridhar/roslyn,natidea/roslyn,eriawan/roslyn,DustinCampbell/roslyn,sharwell/roslyn,mattwar/roslyn,ericfe-ms/roslyn,TyOverby/roslyn,ljw1004/roslyn,brettfo/roslyn,KevinH-MS/roslyn,jamesqo/roslyn,AlekseyTs/roslyn,kelltrick/roslyn,panopticoncentral/roslyn,lorcanmooney/roslyn,orthoxerox/roslyn,gafter/roslyn,CyrusNajmabadi/roslyn,panopticoncentral/roslyn,tvand7093/roslyn,genlu/roslyn,jaredpar/roslyn,heejaechang/roslyn,dpoeschl/roslyn,pdelvo/roslyn,michalhosala/roslyn,akrisiun/roslyn,mgoertz-msft/roslyn,cston/roslyn,swaroop-sridhar/roslyn,jaredpar/roslyn,jcouv/roslyn,srivatsn/roslyn,Hosch250/roslyn,mattscheffer/roslyn,KiloBravoLima/roslyn,jcouv/roslyn,heejaechang/roslyn,jamesqo/roslyn,bkoelman/roslyn,genlu/roslyn,abock/roslyn,wvdd007/roslyn,khyperia/roslyn,KevinH-MS/roslyn,agocke/roslyn,heejaechang/roslyn,michalhosala/roslyn,aelij/roslyn,nguerrera/roslyn,bartdesmet/roslyn,stephentoub/roslyn,reaction1989/roslyn,mavasani/roslyn,ErikSchierboom/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,AlekseyTs/roslyn,brettfo/roslyn,jcouv/roslyn,weltkante/roslyn,KevinRansom/roslyn,amcasey/roslyn,KevinRansom/roslyn,weltkante/roslyn,natidea/roslyn,paulvanbrenk/roslyn,jkotas/roslyn,shyamnamboodiripad/roslyn,jmarolf/roslyn,eriawan/roslyn,AArnott/roslyn,CyrusNajmabadi/roslyn,paulvanbrenk/roslyn,akrisiun/roslyn,mattwar/roslyn,mavasani/roslyn,xasx/roslyn,DustinCampbell/roslyn,AArnott/roslyn,budcribar/roslyn,jkotas/roslyn,tmeschter/roslyn,TyOverby/roslyn,abock/roslyn,OmarTawfik/roslyn,AmadeusW/roslyn,dotnet/roslyn,OmarTawfik/roslyn
|
src/EditorFeatures/CSharpTest/CodeActions/ReplacePropertyWithMethods/ReplacePropertyWithMethodsTests.cs
|
src/EditorFeatures/CSharpTest/CodeActions/ReplacePropertyWithMethods/ReplacePropertyWithMethodsTests.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CodeRefactorings;
using Microsoft.CodeAnalysis.ReplacePropertyWithMethods;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CodeActions.ReplacePropertyWithMethods
{
public class ReplacePropertyWithMethodsTests : AbstractCSharpCodeActionTest
{
protected override object CreateCodeRefactoringProvider(Workspace workspace)
{
return new ReplacePropertyWithMethodsCodeRefactoringProvider();
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsReplacePropertyWithMethods)]
public async Task TestGetWithBody()
{
await TestAsync(
@"class C { int [||]Prop { get { return 0; } } }",
@"class C { private int GetProp() { return 0; } }");
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsReplacePropertyWithMethods)]
public async Task TestPublicProperty()
{
await TestAsync(
@"class C { public int [||]Prop { get { return 0; } } }",
@"class C { public int GetProp() { return 0; } }");
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CodeRefactorings;
using Microsoft.CodeAnalysis.ReplacePropertyWithMethods;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CodeActions.ReplacePropertyWithMethods
{
public class ReplacePropertyWithMethodsTests : AbstractCSharpCodeActionTest
{
protected override object CreateCodeRefactoringProvider(Workspace workspace)
{
return new ReplacePropertyWithMethodsCodeRefactoringProvider();
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsReplacePropertyWithMethods)]
public async Task TestGetWithBody()
{
await TestAsync(
@"class C { int [||]Prop { get { return 0; } } }",
@"class C { private int GetProp() { return 0; } }");
}
}
}
|
apache-2.0
|
C#
|
d1e9fc7e0999071ae4d921248e7ddce17290a49c
|
Align enum values
|
spe3d/unitytesttools,spe3d/unitytesttools
|
Assets/UnityTestTools/Assertions/CheckMethod.cs
|
Assets/UnityTestTools/Assertions/CheckMethod.cs
|
using System;
namespace UnityTest
{
[Flags]
public enum CheckMethod
{
AfterPeriodOfTime = 1 << 0,
Start = 1 << 1,
Update = 1 << 2,
FixedUpdate = 1 << 3,
LateUpdate = 1 << 4,
OnDestroy = 1 << 5,
OnEnable = 1 << 6,
OnDisable = 1 << 7,
OnControllerColliderHit = 1 << 8,
OnParticleCollision = 1 << 9,
OnJointBreak = 1 << 10,
OnBecameInvisible = 1 << 11,
OnBecameVisible = 1 << 12,
OnTriggerEnter = 1 << 13,
OnTriggerExit = 1 << 14,
OnTriggerStay = 1 << 15,
OnCollisionEnter = 1 << 16,
OnCollisionExit = 1 << 17,
OnCollisionStay = 1 << 18,
OnTriggerEnter2D = 1 << 19,
OnTriggerExit2D = 1 << 20,
OnTriggerStay2D = 1 << 21,
OnCollisionEnter2D = 1 << 22,
OnCollisionExit2D = 1 << 23,
OnCollisionStay2D = 1 << 24,
}
}
|
using System;
namespace UnityTest
{
[Flags]
public enum CheckMethod
{
AfterPeriodOfTime = 1 << 0,
Start = 1 << 1,
Update = 1 << 2,
FixedUpdate = 1 << 3,
LateUpdate = 1 << 4,
OnDestroy = 1 << 5,
OnEnable = 1 << 6,
OnDisable = 1 << 7,
OnControllerColliderHit = 1 << 8,
OnParticleCollision = 1 << 9,
OnJointBreak = 1 << 10,
OnBecameInvisible = 1 << 11,
OnBecameVisible = 1 << 12,
OnTriggerEnter = 1 << 13,
OnTriggerExit = 1 << 14,
OnTriggerStay = 1 << 15,
OnCollisionEnter = 1 << 16,
OnCollisionExit = 1 << 17,
OnCollisionStay = 1 << 18,
OnTriggerEnter2D = 1 << 19,
OnTriggerExit2D = 1 << 20,
OnTriggerStay2D = 1 << 21,
OnCollisionEnter2D = 1 << 22,
OnCollisionExit2D = 1 << 23,
OnCollisionStay2D = 1 << 24,
}
}
|
mit
|
C#
|
a48f43ea9cd27fbddf3268b0d2e109f8492abc0a
|
Use the correct strong name for dbus-sharp-glib friend assembly
|
Tragetaschen/dbus-sharp,arfbtwn/dbus-sharp,openmedicus/dbus-sharp,Tragetaschen/dbus-sharp,mono/dbus-sharp,mono/dbus-sharp,arfbtwn/dbus-sharp,openmedicus/dbus-sharp
|
src/AssemblyInfo.cs
|
src/AssemblyInfo.cs
|
// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System.Reflection;
using System.Runtime.CompilerServices;
//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bus IPC protocol library and CLR binding")]
[assembly: AssemblyCopyright ("Copyright (C) Alp Toker")]
[assembly: AssemblyCompany ("NDesk")]
[assembly: InternalsVisibleTo ("NDesk.DBus.GLib")]
[assembly: InternalsVisibleTo ("dbus-monitor")]
[assembly: InternalsVisibleTo ("dbus-daemon")]
|
// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System.Reflection;
using System.Runtime.CompilerServices;
//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bus IPC protocol library and CLR binding")]
[assembly: AssemblyCopyright ("Copyright (C) Alp Toker")]
[assembly: AssemblyCompany ("NDesk")]
[assembly: InternalsVisibleTo ("dbus-sharp-glib")]
[assembly: InternalsVisibleTo ("dbus-monitor")]
[assembly: InternalsVisibleTo ("dbus-daemon")]
|
mit
|
C#
|
55e8af66858aaf695f5d2ff5b56d9118fed4e4c6
|
update theme (#529)
|
reactiveui/website,reactiveui/website,reactiveui/website,reactiveui/website
|
input/_Head.cshtml
|
input/_Head.cshtml
|
<link rel="apple-touch-icon" sizes="180x180" href="@Context.GetLink("/assets/img/favicons/apple-touch-icon.png")">
<link rel="icon" type="image/png" sizes="32x32" href="@Context.GetLink("/assets/img/favicons/favicon-32x32.png")">
<link rel="icon" type="image/png" sizes="16x16" href="@Context.GetLink("/assets/img/favicons/favicon-16x16.png")">
<link rel="manifest" href="@Context.GetLink("/assets/img/favicons/manifest.json")"/>
<link rel="shortcut icon" type="image/x-icon" href="@Context.GetLink("/assets/img/favicons/favicon.ico")"/>
<link rel="mask-icon" href="@Context.GetLink("/assets/img/favicons/safari-pinned-tab.svg")" color="#319af3">
<meta name="msapplication-config" content="@Context.GetLink("/assets/img/favicons/browserconfig.xml")" />
<meta name="msapplication-TileColor" content="#319af3">
<meta name="theme-color" content="#319af3">
<link rel="alternate" type="application/atom+xml" title="ReactiveUI" href="/rss" />
<meta property="og:url" content="@Context.GetLink(Model, true)" />
<meta property="og:type" content="article" />
<meta property="og:title" content="@ViewData[Keys.Title]" />
<meta property="og:image" content="https://reactiveui.net/assets/img/facebook-card.png" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@@reactivexui" />
<meta name="twitter:creator" content="@@reactivexui" />
<meta name="twitter:title" content="@ViewData[Keys.Title]" />
<meta name="twitter:image" content="https://reactiveui.net/assets/img/twitter-card.png" />
<meta name="twitter:image:alt" content="An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms" />
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400|Dosis:700" rel="stylesheet" type="text/css" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
|
<link rel="apple-touch-icon" sizes="180x180" href="@Context.GetLink("/assets/img/favicons/apple-touch-icon.png")">
<link rel="icon" type="image/png" sizes="32x32" href="@Context.GetLink("/assets/img/favicons/favicon-32x32.png")">
<link rel="icon" type="image/png" sizes="16x16" href="@Context.GetLink("/assets/img/favicons/favicon-16x16.png")">
<link rel="manifest" href="@Context.GetLink("/assets/img/favicons/manifest.json")"/>
<link rel="shortcut icon" type="image/x-icon" href="@Context.GetLink("/assets/img/favicons/favicon.ico")"/>
<link rel="mask-icon" href="@Context.GetLink("/assets/img/favicons/safari-pinned-tab.svg")" color="#ffffff">
<meta name="msapplication-config" content="@Context.GetLink("/assets/img/favicons/browserconfig.xml")" />
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="theme-color" content="#ffffff">
<link rel="alternate" type="application/atom+xml" title="ReactiveUI" href="/rss" />
<meta property="og:url" content="@Context.GetLink(Model, true)" />
<meta property="og:type" content="article" />
<meta property="og:title" content="@ViewData[Keys.Title]" />
<meta property="og:image" content="https://reactiveui.net/assets/img/facebook-card.png" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@@reactivexui" />
<meta name="twitter:creator" content="@@reactivexui" />
<meta name="twitter:title" content="@ViewData[Keys.Title]" />
<meta name="twitter:image" content="https://reactiveui.net/assets/img/twitter-card.png" />
<meta name="twitter:image:alt" content="An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms" />
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400|Dosis:700" rel="stylesheet" type="text/css" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
|
mit
|
C#
|
5e7a574fcfb7796a78098f108cf0b4ea0fb8e13f
|
Bump version to 0.13.4
|
ar3cka/Journalist
|
src/SolutionInfo.cs
|
src/SolutionInfo.cs
|
// <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";
}
}
|
// <auto-generated/>
using System.Reflection;
[assembly: AssemblyProductAttribute("Journalist")]
[assembly: AssemblyVersionAttribute("0.13.3")]
[assembly: AssemblyInformationalVersionAttribute("0.13.3")]
[assembly: AssemblyFileVersionAttribute("0.13.3")]
[assembly: AssemblyCompanyAttribute("Anton Mednonogov")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "0.13.3";
}
}
|
apache-2.0
|
C#
|
760c3e8f0ba931f5a6c69f4d8627a31884d0e96c
|
adjust AssemblyTitle to real assembly name
|
mooware/mooftpserv
|
lib/AssemblyInfo.cs
|
lib/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("mooftpservlib")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("mooware")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("0.8.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("mooftpserv-lib")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("mooware")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("0.8.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
|
mit
|
C#
|
d3183c1e2388b239b499626affda9d285e08f744
|
Improve 'current submission' detection.
|
heejaechang/roslyn,KevinH-MS/roslyn,xasx/roslyn,mseamari/Stuff,VSadov/roslyn,HellBrick/roslyn,CyrusNajmabadi/roslyn,jhendrixMSFT/roslyn,KirillOsenkov/roslyn,jcouv/roslyn,genlu/roslyn,danielcweber/roslyn,oocx/roslyn,Pvlerick/roslyn,jhendrixMSFT/roslyn,jamesqo/roslyn,KevinRansom/roslyn,jaredpar/roslyn,MatthieuMEZIL/roslyn,panopticoncentral/roslyn,stephentoub/roslyn,brettfo/roslyn,abock/roslyn,Pvlerick/roslyn,Hosch250/roslyn,VPashkov/roslyn,diryboy/roslyn,leppie/roslyn,pdelvo/roslyn,dpoeschl/roslyn,nguerrera/roslyn,bkoelman/roslyn,VPashkov/roslyn,KevinH-MS/roslyn,mgoertz-msft/roslyn,MattWindsor91/roslyn,yeaicc/roslyn,lorcanmooney/roslyn,ValentinRueda/roslyn,aelij/roslyn,rgani/roslyn,tvand7093/roslyn,rgani/roslyn,khellang/roslyn,amcasey/roslyn,bartdesmet/roslyn,AnthonyDGreen/roslyn,AArnott/roslyn,KevinH-MS/roslyn,ValentinRueda/roslyn,jmarolf/roslyn,KiloBravoLima/roslyn,khyperia/roslyn,yeaicc/roslyn,bbarry/roslyn,Maxwe11/roslyn,nguerrera/roslyn,paulvanbrenk/roslyn,jmarolf/roslyn,orthoxerox/roslyn,HellBrick/roslyn,diryboy/roslyn,AArnott/roslyn,agocke/roslyn,VSadov/roslyn,jeffanders/roslyn,jeffanders/roslyn,AmadeusW/roslyn,jkotas/roslyn,moozzyk/roslyn,paulvanbrenk/roslyn,natgla/roslyn,thomaslevesque/roslyn,basoundr/roslyn,jbhensley/roslyn,jamesqo/roslyn,OmarTawfik/roslyn,Shiney/roslyn,heejaechang/roslyn,diryboy/roslyn,danielcweber/roslyn,cston/roslyn,KirillOsenkov/roslyn,MichalStrehovsky/roslyn,cston/roslyn,vslsnap/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,oocx/roslyn,amcasey/roslyn,physhi/roslyn,balajikris/roslyn,khellang/roslyn,gafter/roslyn,bkoelman/roslyn,tvand7093/roslyn,MichalStrehovsky/roslyn,OmarTawfik/roslyn,kelltrick/roslyn,weltkante/roslyn,Giftednewt/roslyn,eriawan/roslyn,vcsjones/roslyn,orthoxerox/roslyn,xoofx/roslyn,Hosch250/roslyn,dpoeschl/roslyn,KirillOsenkov/roslyn,dotnet/roslyn,Shiney/roslyn,basoundr/roslyn,budcribar/roslyn,MattWindsor91/roslyn,aanshibudhiraja/Roslyn,a-ctor/roslyn,Pvlerick/roslyn,MichalStrehovsky/roslyn,bkoelman/roslyn,genlu/roslyn,Inverness/roslyn,jasonmalinowski/roslyn,pdelvo/roslyn,CaptainHayashi/roslyn,tannergooding/roslyn,jeffanders/roslyn,tmeschter/roslyn,cston/roslyn,vslsnap/roslyn,thomaslevesque/roslyn,ljw1004/roslyn,nguerrera/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,davkean/roslyn,srivatsn/roslyn,jkotas/roslyn,mattscheffer/roslyn,aelij/roslyn,abock/roslyn,OmarTawfik/roslyn,basoundr/roslyn,stephentoub/roslyn,jbhensley/roslyn,AnthonyDGreen/roslyn,physhi/roslyn,CaptainHayashi/roslyn,sharwell/roslyn,rgani/roslyn,SeriaWei/roslyn,xasx/roslyn,lorcanmooney/roslyn,akrisiun/roslyn,ljw1004/roslyn,tmat/roslyn,jasonmalinowski/roslyn,DustinCampbell/roslyn,brettfo/roslyn,DustinCampbell/roslyn,AnthonyDGreen/roslyn,panopticoncentral/roslyn,TyOverby/roslyn,AlekseyTs/roslyn,yeaicc/roslyn,agocke/roslyn,eriawan/roslyn,swaroop-sridhar/roslyn,HellBrick/roslyn,weltkante/roslyn,AmadeusW/roslyn,Maxwe11/roslyn,ericfe-ms/roslyn,TyOverby/roslyn,Giftednewt/roslyn,Giftednewt/roslyn,mgoertz-msft/roslyn,ValentinRueda/roslyn,davkean/roslyn,KiloBravoLima/roslyn,tvand7093/roslyn,swaroop-sridhar/roslyn,paulvanbrenk/roslyn,VPashkov/roslyn,reaction1989/roslyn,CyrusNajmabadi/roslyn,srivatsn/roslyn,AlekseyTs/roslyn,vcsjones/roslyn,khellang/roslyn,jamesqo/roslyn,jcouv/roslyn,sharwell/roslyn,davkean/roslyn,wvdd007/roslyn,gafter/roslyn,mseamari/Stuff,dotnet/roslyn,managed-commons/roslyn,srivatsn/roslyn,akrisiun/roslyn,SeriaWei/roslyn,mattwar/roslyn,lorcanmooney/roslyn,xoofx/roslyn,robinsedlaczek/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,jkotas/roslyn,Inverness/roslyn,aanshibudhiraja/Roslyn,MattWindsor91/roslyn,antonssonj/roslyn,antonssonj/roslyn,MattWindsor91/roslyn,Hosch250/roslyn,Shiney/roslyn,a-ctor/roslyn,orthoxerox/roslyn,CaptainHayashi/roslyn,tmeschter/roslyn,jaredpar/roslyn,wvdd007/roslyn,abock/roslyn,budcribar/roslyn,managed-commons/roslyn,tmeschter/roslyn,xoofx/roslyn,mgoertz-msft/roslyn,khyperia/roslyn,aelij/roslyn,kelltrick/roslyn,gafter/roslyn,mseamari/Stuff,mmitche/roslyn,moozzyk/roslyn,panopticoncentral/roslyn,sharadagrawal/Roslyn,mmitche/roslyn,stephentoub/roslyn,leppie/roslyn,KiloBravoLima/roslyn,brettfo/roslyn,shyamnamboodiripad/roslyn,jbhensley/roslyn,drognanar/roslyn,jasonmalinowski/roslyn,bbarry/roslyn,jmarolf/roslyn,dotnet/roslyn,mattwar/roslyn,vcsjones/roslyn,mattscheffer/roslyn,MatthieuMEZIL/roslyn,reaction1989/roslyn,zooba/roslyn,ericfe-ms/roslyn,ErikSchierboom/roslyn,mattwar/roslyn,leppie/roslyn,drognanar/roslyn,mattscheffer/roslyn,robinsedlaczek/roslyn,KevinRansom/roslyn,antonssonj/roslyn,tmat/roslyn,kelltrick/roslyn,genlu/roslyn,thomaslevesque/roslyn,dpoeschl/roslyn,shyamnamboodiripad/roslyn,physhi/roslyn,drognanar/roslyn,swaroop-sridhar/roslyn,natgla/roslyn,natgla/roslyn,bartdesmet/roslyn,jcouv/roslyn,SeriaWei/roslyn,bartdesmet/roslyn,michalhosala/roslyn,zooba/roslyn,DustinCampbell/roslyn,xasx/roslyn,ljw1004/roslyn,mavasani/roslyn,aanshibudhiraja/Roslyn,tmat/roslyn,shyamnamboodiripad/roslyn,mavasani/roslyn,Inverness/roslyn,natidea/roslyn,natidea/roslyn,oocx/roslyn,jhendrixMSFT/roslyn,mavasani/roslyn,Maxwe11/roslyn,zooba/roslyn,heejaechang/roslyn,agocke/roslyn,reaction1989/roslyn,pdelvo/roslyn,AArnott/roslyn,ErikSchierboom/roslyn,VSadov/roslyn,AlekseyTs/roslyn,natidea/roslyn,budcribar/roslyn,wvdd007/roslyn,sharadagrawal/Roslyn,akrisiun/roslyn,amcasey/roslyn,balajikris/roslyn,eriawan/roslyn,tannergooding/roslyn,michalhosala/roslyn,ericfe-ms/roslyn,managed-commons/roslyn,danielcweber/roslyn,balajikris/roslyn,khyperia/roslyn,sharwell/roslyn,moozzyk/roslyn,MatthieuMEZIL/roslyn,jaredpar/roslyn,weltkante/roslyn,vslsnap/roslyn,bbarry/roslyn,a-ctor/roslyn,sharadagrawal/Roslyn,mmitche/roslyn,robinsedlaczek/roslyn,ErikSchierboom/roslyn,CyrusNajmabadi/roslyn,AmadeusW/roslyn,tannergooding/roslyn,michalhosala/roslyn,TyOverby/roslyn,KevinRansom/roslyn
|
src/Interactive/EditorFeatures/Core/Implementation/Interactive/InteractiveDocumentSupportsSuggestionService.cs
|
src/Interactive/EditorFeatures/Core/Implementation/Interactive/InteractiveDocumentSupportsSuggestionService.cs
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Composition;
using Microsoft.CodeAnalysis.Editor.Shared.SuggestionSupport;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.InteractiveWindow;
namespace Microsoft.CodeAnalysis.Editor.Implementation.Interactive
{
[ExportWorkspaceService(typeof(IDocumentSupportsSuggestionService), WorkspaceKind.Interactive), Shared]
internal sealed class InteractiveDocumentSupportsCodeFixService : IDocumentSupportsSuggestionService
{
public bool SupportsCodeFixes(Document document)
{
SourceText sourceText;
if (document.TryGetText(out sourceText))
{
ITextBuffer buffer = sourceText.Container.TryGetTextBuffer();
if (buffer != null)
{
IInteractiveEvaluator evaluator = (IInteractiveEvaluator)buffer.Properties[typeof(IInteractiveEvaluator)];
IInteractiveWindow window = evaluator?.CurrentWindow;
if (window?.CurrentLanguageBuffer == buffer)
{
// These are only correct if we're on the UI thread.
// Otherwise, they're guesses and they might change immediately even if they're correct.
return !window.IsResetting && !window.IsRunning;
}
}
}
return false;
}
public bool SupportsRefactorings(Document document)
{
return false;
}
public bool SupportsRename(Document document)
{
return false;
}
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Composition;
using Microsoft.CodeAnalysis.Editor.Shared.SuggestionSupport;
using Microsoft.CodeAnalysis.Host.Mef;
namespace Microsoft.CodeAnalysis.Editor.Implementation.Interactive
{
[ExportWorkspaceService(typeof(IDocumentSupportsSuggestionService), WorkspaceKind.Interactive), Shared]
internal sealed class InteractiveDocumentSupportsCodeFixService : IDocumentSupportsSuggestionService
{
public bool SupportsCodeFixes(Document document)
{
// TODO (acasey): confirm with IDE team
var project = document.Project;
var projectIds = project.Solution.ProjectIds;
return project.DocumentIds[0] == document.Id && projectIds[projectIds.Count - 1] == project.Id;
}
public bool SupportsRefactorings(Document document)
{
return false;
}
public bool SupportsRename(Document document)
{
return false;
}
}
}
|
mit
|
C#
|
605c11431136cccf6c9fab7009e99e7208e62314
|
Add IpAddress for IpPermission
|
muhammedikinci/FuzzyCore
|
FuzzyCore/Data/JsonCommand.cs
|
FuzzyCore/Data/JsonCommand.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Sockets;
namespace FuzzyCore.Data
{
public class JsonCommand
{
public String CommandType { get; set; }
public String Premission { get; set; }
public float AfterTime { get; set; }
public float OverTime { get; set; }
public bool Repeat { get; set; }
public int RepeatStep { get; set; }
public String FormCaption { get; set; }
public float FontSize { get; set; }
public String Text { get; set; }
public String FilePath { get; set; }
public String PrevDirectory { get; set; }
public Socket Client_Socket { get; set; }
public string MacAddress { get; set; }
public string IpAddress { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Sockets;
namespace FuzzyCore.Data
{
public class JsonCommand
{
public String CommandType { get; set; }
public String Premission { get; set; }
public float AfterTime { get; set; }
public float OverTime { get; set; }
public bool Repeat { get; set; }
public int RepeatStep { get; set; }
public String FormCaption { get; set; }
public float FontSize { get; set; }
public String Text { get; set; }
public String FilePath { get; set; }
public String PrevDirectory { get; set; }
public Socket Client_Socket { get; set; }
public string MacAddress { get; set; }
}
}
|
mit
|
C#
|
d533048f135b5262843d45555c5f4c276ad0775e
|
set console title
|
jbijlsma/IdentityServer4,MienDev/IdentityServer4,IdentityServer/IdentityServer4,MienDev/IdentityServer4,siyo-wang/IdentityServer4,jbijlsma/IdentityServer4,jbijlsma/IdentityServer4,siyo-wang/IdentityServer4,IdentityServer/IdentityServer4,chrisowhite/IdentityServer4,siyo-wang/IdentityServer4,MienDev/IdentityServer4,jbijlsma/IdentityServer4,chrisowhite/IdentityServer4,chrisowhite/IdentityServer4,MienDev/IdentityServer4,IdentityServer/IdentityServer4,IdentityServer/IdentityServer4
|
src/Host/Program.cs
|
src/Host/Program.cs
|
using System.IO;
using Microsoft.AspNetCore.Hosting;
using System;
namespace Host
{
public class Program
{
public static void Main(string[] args)
{
Console.Title = "IdentityServer4";
var host = new WebHostBuilder()
.UseKestrel()
.UseUrls("http://localhost:1941")
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
}
}
}
|
using System.IO;
using Microsoft.AspNetCore.Hosting;
namespace Host
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseUrls("http://localhost:1941")
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
}
}
}
|
apache-2.0
|
C#
|
dc8e2a49b6f4bb9e60e3f6b2d945279b6ed458b6
|
Add a builder for the base environ, so it's easier to work with
|
horia141/nvalidate,horia141/nvalidate
|
src/BaseEnviron.cs
|
src/BaseEnviron.cs
|
using System;
using System.Collections.Generic;
namespace NValidate
{
public class BaseEnviron : Environ
{
readonly Dictionary<Type, Func<Environ, object>> _modelExtractors;
readonly Dictionary<Type, object> _models;
public BaseEnviron(Dictionary<Type, Func<Environ, object>> modelExtractors, Dictionary<Type, object> models)
{
_modelExtractors = modelExtractors;
_models = models;
}
public override Environ Add(object model)
{
return new LinkedEnviron(model, this);
}
public override object GetByType(Type type, Environ topEnviron = null)
{
object result = null;
_models.TryGetValue(type, out result);
if (result != null)
{
return result;
}
else if (_modelExtractors != null)
{
Func<Environ, object> extractor = null;
if (!_modelExtractors.TryGetValue(type, out extractor))
return null;
return extractor(topEnviron ?? this);
}
else
{
return null;
}
}
}
public class BaseEnvironBuilder
{
readonly Dictionary<Type, Func<Environ, object>> _modelExtractors;
readonly Dictionary<Type, object> _models;
public BaseEnvironBuilder()
{
_modelExtractors = new Dictionary<Type, Func<Environ, object>>();
_models = new Dictionary<Type, object>();
}
public BaseEnvironBuilder AddModel(object model)
{
_models[model.GetType()] = model;
return this;
}
public BaseEnvironBuilder AddModelExtractor<T>(Func<Environ, object> modelExtractor)
{
_models[typeof(T)] = modelExtractor;
return this;
}
public BaseEnviron Build()
{
return new BaseEnviron(_modelExtractors, _models);
}
}
}
|
using System;
using System.Collections.Generic;
namespace NValidate
{
public class BaseEnviron : Environ
{
readonly Dictionary<Type, Func<Environ, object>> _modelExtractors;
readonly Dictionary<Type, object> _models;
public BaseEnviron(Dictionary<Type, Func<Environ, object>> modelExtractors, Dictionary<Type, object> models)
{
_modelExtractors = modelExtractors;
_models = models;
}
public override Environ Add(object model)
{
return new LinkedEnviron(model, this);
}
public override object GetByType(Type type, Environ topEnviron = null)
{
object result = null;
_models.TryGetValue(type, out result);
if (result != null)
{
return result;
}
else if (_modelExtractors != null)
{
Func<Environ, object> extractor = null;
if (!_modelExtractors.TryGetValue(type, out extractor))
return null;
return extractor(topEnviron ?? this);
}
else
{
return null;
}
}
}
}
|
mit
|
C#
|
ddc64fe25835a9fd6360e4b3fa66ffdba3edf348
|
Clean up: Contact
|
ramzzzay/GalleryMVC_With_Auth,ramzzzay/GalleryMVC_With_Auth,ramzzzay/GalleryMVC_With_Auth
|
GalleryMVC_With_Auth/Views/StartHome/Contact.cshtml
|
GalleryMVC_With_Auth/Views/StartHome/Contact.cshtml
|
@using System.Globalization
@using Jmelosegui.Mvc.Googlemap
@model string
@{
ViewBag.Title = "Контакты";
}
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<address>
Беларусь<br />
Брест, набярэжная Францыска Скарыны 2<br />
<abbr title="Phone">Тел:</abbr>
8 0162 20-45-95
@(Html.GoogleMap().Name("Brest")
.Width(600)
.Height(500)
.Center(c => c.Address("Беларусь, Брест, набярэжная Францыска Скарыны 2"))
.Markers(m => m.Add()).Zoom(15)
.Culture(CultureInfo.GetCultureInfoByIetfLanguageTag(Model ?? "ru")))
</address>
@using (Html.BeginForm())
{
@Html.DropDownList("lang", new SelectList(new[] {"ru", "en"}), "Выбрерите язык карты")
<button type="submit" class="btn btn-default">Применить</button>
}
@section scripts
{
@(Html.GoogleMap().ScriptRegistrar())
}
|
@using System.Globalization
@using Jmelosegui.Mvc.Googlemap
@model string
@{
ViewBag.Title = "Контакты";
}
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<address>
Беларусь<br />
Брест, набярэжная Францыска Скарыны 2<br />
<abbr title="Phone">Тел:</abbr>
8 0162 20-45-95
@(Html.GoogleMap().Name("Brest")
.Width(600)
.Height(500)
.Center(c => c.Address("Беларусь, Брест, набярэжная Францыска Скарыны 2"))
.Markers(m => m.Add()).Zoom(15)
.Culture(CultureInfo.GetCultureInfoByIetfLanguageTag(Model ?? "ru")))
</address>
@using (Html.BeginForm())
{
@*<input name="lang" type="text"/>*@
@*@Html.TextBox("lang")*@
@Html.DropDownList("lang", new SelectList(new[] {"ru", "en"}), "Выбрерите язык карты")
<button type="submit" class="btn btn-default">Применить</button>
}
@*<input type="text" value="@Model" />*@
@*<address>
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br />
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
</address>*@
@section scripts
{
@(Html.GoogleMap().ScriptRegistrar())
}
|
apache-2.0
|
C#
|
d33b7902dc211504ad2019bf8b343d9a829406f5
|
Test uses same date object for comparison
|
mrward/Pash,WimObiwan/Pash,Jaykul/Pash,mrward/Pash,ForNeVeR/Pash,sburnicki/Pash,Jaykul/Pash,sburnicki/Pash,mrward/Pash,sillvan/Pash,ForNeVeR/Pash,WimObiwan/Pash,Jaykul/Pash,WimObiwan/Pash,sillvan/Pash,sburnicki/Pash,sillvan/Pash,ForNeVeR/Pash,WimObiwan/Pash,sburnicki/Pash,Jaykul/Pash,mrward/Pash,ForNeVeR/Pash,sillvan/Pash
|
Source/TestHost/System.Management/ParameterTests.cs
|
Source/TestHost/System.Management/ParameterTests.cs
|
// Copyright (C) Pash Contributors. License: GPL/BSD. See https://github.com/Pash-Project/Pash/
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
namespace TestHost
{
[TestFixture]
public class ParameterTests
{
[Test]
public void ParametersByName1()
{
var results = TestHost.Execute("$a = 10; Get-Variable -Name a");
Assert.AreEqual("$a = 10" + Environment.NewLine, results);
}
[Test]
public void ParametersByName2()
{
var result2 = TestHost.Execute("$d = Get-Date; $d; Get-Date -Date $d");
var dates = result2.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
Assert.AreEqual(2, dates.Count());
Assert.AreEqual(dates[0], dates[1]);
}
[Test]
public void ParametersByPrefix()
{
var results = TestHost.Execute("$a = 10; Get-Variable -Nam a");
Assert.AreEqual("$a = 10" + Environment.NewLine, results);
}
[Test]
public void ParametersByAlias()
{
Assert.DoesNotThrow(delegate() {
TestHost.Execute("Get-Process -ProcessName mono");
});
}
[Test]
public void ParametersByAliasPrefix()
{
Assert.DoesNotThrow(delegate() {
TestHost.Execute("Get-Process -ProcessN mono");
});
}
[Test]
public void ParametersBySingleCharacterPrefix()
{
Assert.DoesNotThrow(delegate() {
TestHost.Execute("Start-Sleep -S 0");
});
}
[Test]
[ExpectedException]
public void ParametersInvalid()
{
TestHost.Execute("Get-Process -Procecc mono");
}
}
}
|
// Copyright (C) Pash Contributors. License: GPL/BSD. See https://github.com/Pash-Project/Pash/
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
namespace TestHost
{
[TestFixture]
public class ParameterTests
{
[Test]
public void ParametersByName1()
{
var results = TestHost.Execute("$a = 10; Get-Variable -Name a");
Assert.AreEqual("$a = 10" + Environment.NewLine, results);
}
[Test]
public void ParametersByName2()
{
var result1 = TestHost.Execute("Get-Date");
var result2 = TestHost.Execute("$d = Get-Date; Get-Date -Date $d");
Assert.AreEqual(result1, result2);
}
[Test]
public void ParametersByPrefix()
{
var results = TestHost.Execute("$a = 10; Get-Variable -Nam a");
Assert.AreEqual("$a = 10" + Environment.NewLine, results);
}
[Test]
public void ParametersByAlias()
{
Assert.DoesNotThrow(delegate() {
TestHost.Execute("Get-Process -ProcessName mono");
});
}
[Test]
public void ParametersByAliasPrefix()
{
Assert.DoesNotThrow(delegate() {
TestHost.Execute("Get-Process -ProcessN mono");
});
}
[Test]
public void ParametersBySingleCharacterPrefix()
{
Assert.DoesNotThrow(delegate() {
TestHost.Execute("Start-Sleep -S 0");
});
}
[Test]
[ExpectedException]
public void ParametersInvalid()
{
TestHost.Execute("Get-Process -Procecc mono");
}
}
}
|
bsd-3-clause
|
C#
|
7a810ae15e0c43dec52eb56136b0ecb29708c2b0
|
Fix problem with parsing server url.
|
stephenjannin/csnats,nats-io/csnats
|
NATS.Client/Srv.cs
|
NATS.Client/Srv.cs
|
// Copyright 2015 Apcera Inc. All rights reserved.
using System;
namespace NATS.Client
{
// Tracks individual backend servers.
internal class Srv
{
internal Uri url = null;
internal bool didConnect = false;
internal int reconnects = 0;
internal DateTime lastAttempt = DateTime.Now;
internal bool isImplicit = false;
// never create a srv object without a url.
private Srv() { }
internal Srv(string urlString)
{
// allow for host:port, without the prefix.
if (urlString.ToLower().StartsWith("nats://") == false)
urlString = "nats://" + urlString;
url = new Uri(urlString);
}
internal Srv(string urlString, bool isUrlImplicit) : this(urlString)
{
isImplicit = isUrlImplicit;
}
internal void updateLastAttempt()
{
lastAttempt = DateTime.Now;
}
internal TimeSpan TimeSinceLastAttempt
{
get
{
return (DateTime.Now - lastAttempt);
}
}
}
}
|
// Copyright 2015 Apcera Inc. All rights reserved.
using System;
namespace NATS.Client
{
// Tracks individual backend servers.
internal class Srv
{
internal Uri url = null;
internal bool didConnect = false;
internal int reconnects = 0;
internal DateTime lastAttempt = DateTime.Now;
internal bool isImplicit = false;
// never create a srv object without a url.
private Srv() { }
internal Srv(string urlString)
{
// allow for host:port, without the prefix.
if (urlString.ToLower().StartsWith("nats") == false)
urlString = "nats://" + urlString;
url = new Uri(urlString);
}
internal Srv(string urlString, bool isUrlImplicit) : this(urlString)
{
isImplicit = isUrlImplicit;
}
internal void updateLastAttempt()
{
lastAttempt = DateTime.Now;
}
internal TimeSpan TimeSinceLastAttempt
{
get
{
return (DateTime.Now - lastAttempt);
}
}
}
}
|
mit
|
C#
|
49b82a00e4a22e89ec537cb4ead26f7a5e517394
|
update AssemblyVersion
|
gigya/microdot
|
SolutionVersion.cs
|
SolutionVersion.cs
|
#region Copyright
// Copyright 2017 Gigya Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Gigya Inc.")]
[assembly: AssemblyCopyright("© 2018 Gigya Inc.")]
[assembly: AssemblyDescription("Microdot Framework")]
[assembly: AssemblyVersion("2.1.2.0")]
[assembly: AssemblyFileVersion("2.1.2.0")]
[assembly: AssemblyInformationalVersion("2.1.2.0")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
|
#region Copyright
// Copyright 2017 Gigya Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Gigya Inc.")]
[assembly: AssemblyCopyright("© 2018 Gigya Inc.")]
[assembly: AssemblyDescription("Microdot Framework")]
[assembly: AssemblyVersion("2.1.1.0")]
[assembly: AssemblyFileVersion("2.1.1.0")]
[assembly: AssemblyInformationalVersion("2.1.1.0")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
|
apache-2.0
|
C#
|
a5ac1e0ee01494a4f839677c991999ee0bb14cb1
|
Fix word comparer order
|
davghouse/wordament-solver
|
WordamentSolver/Models/WordComparer.cs
|
WordamentSolver/Models/WordComparer.cs
|
using System.Collections.Generic;
using WordamentSolver.Models.WordComparers;
namespace WordamentSolver.Models
{
public abstract class WordComparer : IComparer<Word>
{
public static readonly WordComparer Alphabet = new AlphabetComparer();
public static readonly WordComparer Points = new PointsComparer();
public static readonly WordComparer WordLength = new WordLengthComparer();
public static readonly WordComparer PathLength = new PathLengthComparer();
public static readonly WordComparer PointsOverWordLength = new PointsOverWordLengthComparer();
public static readonly WordComparer PointsOverPathLength = new PointsOverPathLengthComparer();
public static readonly WordComparer StartPositionByPoints = new StartPositionByPointsComparer();
public static readonly WordComparer StartPositionByWordLength = new StartPositionByWordLengthComparer();
public static readonly WordComparer StartPositionByPointsOverWordLength = new StartPositionByPointsOverWordLengthComparer();
public static readonly WordComparer StartPositionByPointsOverPathLength = new StartPositionByPointsOverPathLengthComparer();
public static readonly WordComparer StartLetterByPoints = new StartLetterByPointsComparer();
public static readonly WordComparer StartLetterByWordLength = new StartLetterByWordLengthComparer();
public static readonly WordComparer StartLetterByPointsOverWordLength = new StartLetterByPointsOverWordLengthComparer();
public static readonly WordComparer StartLetterByPointsOverPathLength = new StartLetterByPointsOverPathLengthComparer();
public static readonly WordComparer WordLengthAscending = new WordLengthAscendingComparer();
public static readonly WordComparer StartPositionByWordLengthAscending = new StartPositionByWordLengthAscendingComparer();
public static readonly IReadOnlyList<WordComparer> All = new[]
{
Alphabet, Points, WordLength, PathLength, PointsOverWordLength, PointsOverPathLength,
StartPositionByPoints, StartPositionByWordLength, StartPositionByPointsOverWordLength, StartPositionByPointsOverPathLength,
StartLetterByPoints, StartLetterByWordLength, StartLetterByPointsOverWordLength, StartLetterByPointsOverPathLength,
WordLengthAscending, StartPositionByWordLengthAscending
};
public abstract string Name { get; }
public abstract int Compare(Word x, Word y);
}
}
|
using System.Collections.Generic;
using WordamentSolver.Models.WordComparers;
namespace WordamentSolver.Models
{
public abstract class WordComparer : IComparer<Word>
{
public static readonly WordComparer Alphabet = new AlphabetComparer();
public static readonly WordComparer Points = new PointsComparer();
public static readonly WordComparer WordLength = new WordLengthComparer();
public static readonly WordComparer PathLength = new PathLengthComparer();
public static readonly WordComparer PointsOverWordLength = new PointsOverWordLengthComparer();
public static readonly WordComparer PointsOverPathLength = new PointsOverPathLengthComparer();
public static readonly WordComparer StartPositionByPoints = new StartPositionByPointsComparer();
public static readonly WordComparer StartPositionByWordLength = new StartPositionByWordLengthComparer();
public static readonly WordComparer StartPositionByPointsOverWordLength = new StartPositionByPointsOverWordLengthComparer();
public static readonly WordComparer StartPositionByPointsOverPathLength = new StartPositionByPointsOverPathLengthComparer();
public static readonly WordComparer StartLetterByPoints = new StartLetterByPointsComparer();
public static readonly WordComparer StartLetterByWordLength = new StartLetterByWordLengthComparer();
public static readonly WordComparer StartLetterByPointsOverWordLength = new StartLetterByPointsOverWordLengthComparer();
public static readonly WordComparer StartLetterByPointsOverPathLength = new StartLetterByPointsOverPathLengthComparer();
public static readonly WordComparer WordLengthAscending = new WordLengthAscendingComparer();
public static readonly WordComparer StartPositionByWordLengthAscending = new StartPositionByWordLengthAscendingComparer();
public static readonly IReadOnlyList<WordComparer> All = new[]
{
Alphabet, Points, WordLength, PathLength, PointsOverPathLength, PointsOverWordLength,
StartPositionByPoints, StartPositionByWordLength, StartPositionByPointsOverWordLength, StartPositionByPointsOverPathLength,
StartLetterByPoints, StartLetterByWordLength, StartLetterByPointsOverWordLength, StartLetterByPointsOverPathLength,
WordLengthAscending, StartPositionByWordLengthAscending
};
public abstract string Name { get; }
public abstract int Compare(Word x, Word y);
}
}
|
mit
|
C#
|
48db24b1e7b251c401b4e26b2a009647cab218f4
|
Update PackEnvironment.cs
|
ExceptionCustomiser/PackIt
|
PackIt/PackIt/Util/PackEnvironment.cs
|
PackIt/PackIt/Util/PackEnvironment.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PackIt.Util
{
internal class PackEnvironment
{
/// <summary>The private instance.</summary>
private static PackEnvironment _Instance;
/// <summary>The instance of the package environment.</summary>
public static PackEnvironment Instance
{
get
{
if (_Instance == null)
_Instance = new PackEnvironment();
return _Instance;
}
}
/// <summary>Private constructir</summary>
private PackEnvironment()
{
// Setting default XML file
PackEnvironment.Instance["XML"] = "pack.xml";
}
private Dictionary<string, string> parameter = new Dictionary<string, string>();
public string this[string key]
{
get
{
return parameter[key];
}
set
{
if (value == null)
parameter.Remove(key);
else if (value == string.Empty)
parameter[key] = true.ToString();
else
parameter[key] = value;
}
}
/// <summary>Initialises the argument strings.</summary>
/// <param name="args">The arguments</param>
public void InitArguments(string[] args)
{
// Exit on empty
if (args.Length == 0)
return;
int i = 0;
// When Arg 0 is no command, use it as xmlfile
if (args[i][i] != '/')
parameter["XML"] = args[i++];
// Read Arguments
for (; i < args.Length; i++)
{
string key = args[i];
string value = true.ToString();
if (i + 1 < args.Length && args[i][i] == '/')
value = args[++i];
parameter.Add(key, value);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PackIt.Util
{
internal class PackEnvironment
{
/// <summary>The private instance.</summary>
private static PackEnvironment _Instance;
/// <summary>The instance of the package environment.</summary>
public static PackEnvironment Instance
{
get
{
if (_Instance == null)
_Instance = new PackEnvironment();
return _Instance;
}
}
/// <summary>Private constructir</summary>
private PackEnvironment() { }
private Dictionary<string, string> parameter = new Dictionary<string, string>();
public string this[string key]
{
get
{
return parameter[key];
}
set
{
if (value == null)
parameter.Remove(key);
else if (value == string.Empty)
parameter[key] = true.ToString();
else
parameter[key] = value;
}
}
/// <summary>Initialises the argument strings.</summary>
/// <param name="args">The arguments</param>
public void InitArguments(string[] args)
{
// Setting default XML file
PackEnvironment.Instance["XML"] = "pack.xml";
}
}
}
|
mit
|
C#
|
1b92d231cb3847ff41743339375517571892479e
|
ロールバック時の掃除処理はRecordに移動。
|
SunriseDigital/sdxweb,SunriseDigital/sdxweb,SunriseDigital/cs-sdx-web,SunriseDigital/sdxweb,SunriseDigital/cs-sdx-web
|
_private/csharp/scaffold/edit.ascx.cs
|
_private/csharp/scaffold/edit.ascx.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Sdx.WebLib.Control.Scaffold
{
public partial class Edit : System.Web.UI.UserControl
{
protected Sdx.Scaffold.Manager scaffold;
protected Sdx.Html.Form form;
protected Sdx.Db.Record record;
protected Exception saveException;
protected void Page_Load(object sender, EventArgs ev)
{
this.scaffold = Sdx.Scaffold.Manager.CurrentInstance(this.Name);
if (OutlineRank != null)
{
scaffold.OutlineRank = (int)OutlineRank;
}
this.scaffold.EditPageUrl = new Web.Url(Request.Url.PathAndQuery);
if (this.scaffold.ListPageUrl == null)
{
this.scaffold.ListPageUrl = new Web.Url(Request.Url.PathAndQuery);
}
if (scaffold.Group != null)
{
scaffold.Group.Init();
}
using(var conn = scaffold.Db.CreateConnection())
{
conn.Open();
record = this.scaffold.LoadRecord(Request.Params, conn);
this.form = this.scaffold.BuildForm(record, conn);
if (Request.Form.Count > 0)
{
scaffold.BindToForm(form, Request.Form);
if (form.ExecValidators())
{
conn.BeginTransaction();
try
{
scaffold.Save(record, form.ToNameValueCollection(), conn);
conn.Commit();
}
catch (Exception e)
{
conn.Rollback();
record.DisposeOnRollback();
if (Sdx.Context.Current.IsDebugMode)
{
throw;
}
this.saveException = e;
}
if (!Sdx.Context.Current.IsDebugMode && this.saveException == null)
{
Response.Redirect(scaffold.ListPageUrl.Build());
}
}
}
}
}
public string Name { get; set; }
public int? OutlineRank { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Sdx.WebLib.Control.Scaffold
{
public partial class Edit : System.Web.UI.UserControl
{
protected Sdx.Scaffold.Manager scaffold;
protected Sdx.Html.Form form;
protected Sdx.Db.Record record;
protected Exception saveException;
protected void Page_Load(object sender, EventArgs ev)
{
this.scaffold = Sdx.Scaffold.Manager.CurrentInstance(this.Name);
if (OutlineRank != null)
{
scaffold.OutlineRank = (int)OutlineRank;
}
this.scaffold.EditPageUrl = new Web.Url(Request.Url.PathAndQuery);
if (this.scaffold.ListPageUrl == null)
{
this.scaffold.ListPageUrl = new Web.Url(Request.Url.PathAndQuery);
}
if (scaffold.Group != null)
{
scaffold.Group.Init();
}
using(var conn = scaffold.Db.CreateConnection())
{
conn.Open();
record = this.scaffold.LoadRecord(Request.Params, conn);
this.form = this.scaffold.BuildForm(record, conn);
if (Request.Form.Count > 0)
{
scaffold.BindToForm(form, Request.Form);
if (form.ExecValidators())
{
conn.BeginTransaction();
try
{
scaffold.Save(record, form.ToNameValueCollection(), conn);
conn.Commit();
}
catch (Exception e)
{
conn.Rollback();
scaffold.CallRollbackHook(record);
if (Sdx.Context.Current.IsDebugMode)
{
throw;
}
this.saveException = e;
}
if (!Sdx.Context.Current.IsDebugMode && this.saveException == null)
{
Response.Redirect(scaffold.ListPageUrl.Build());
}
}
}
}
}
public string Name { get; set; }
public int? OutlineRank { get; set; }
}
}
|
mit
|
C#
|
b6e89dc6e729f2545c336df303a2860c4a402b93
|
bump to 2.0.2
|
Sevitec/oneoffixx-connectclient
|
Windows/src/OneOffixx.ConnectClient.WinApp/Properties/AssemblyInfo.cs
|
Windows/src/OneOffixx.ConnectClient.WinApp/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OneOffixx Connect Client")]
[assembly: AssemblyDescription("Test Client for OneOffixx Connect")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sevitec Informatik AG")]
[assembly: AssemblyProduct("OneOffixx.ConnectClient.WinApp")]
[assembly: AssemblyCopyright("Copyright © Sevitec Informatik AG 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)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.2.0")]
[assembly: AssemblyFileVersion("2.0.2.0")]
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OneOffixx Connect Client")]
[assembly: AssemblyDescription("Test Client for OneOffixx Connect")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sevitec Informatik AG")]
[assembly: AssemblyProduct("OneOffixx.ConnectClient.WinApp")]
[assembly: AssemblyCopyright("Copyright © Sevitec Informatik AG 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)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]
|
mit
|
C#
|
c9da550ce4987e01c1bbce9d0a17b860e1d300b3
|
Remove API check in ActivityIndicatorRenderer's UpdateColor method (#261)
|
Hitcents/Xamarin.Forms,Hitcents/Xamarin.Forms,Hitcents/Xamarin.Forms
|
Xamarin.Forms.Platform.Android/Renderers/ActivityIndicatorRenderer.cs
|
Xamarin.Forms.Platform.Android/Renderers/ActivityIndicatorRenderer.cs
|
using System.ComponentModel;
using Android.Graphics;
using Android.OS;
using Android.Views;
using AProgressBar = Android.Widget.ProgressBar;
namespace Xamarin.Forms.Platform.Android
{
public class ActivityIndicatorRenderer : ViewRenderer<ActivityIndicator, AProgressBar>
{
public ActivityIndicatorRenderer()
{
AutoPackage = false;
}
protected override void OnElementChanged(ElementChangedEventArgs<ActivityIndicator> e)
{
base.OnElementChanged(e);
AProgressBar progressBar = Control;
if (progressBar == null)
{
progressBar = new AProgressBar(Context) { Indeterminate = true };
SetNativeControl(progressBar);
}
UpdateColor();
UpdateVisibility();
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if (e.PropertyName == ActivityIndicator.IsRunningProperty.PropertyName)
UpdateVisibility();
else if (e.PropertyName == ActivityIndicator.ColorProperty.PropertyName)
UpdateColor();
}
void UpdateColor()
{
Color color = Element.Color;
if (!color.IsDefault)
Control.IndeterminateDrawable.SetColorFilter(color.ToAndroid(), PorterDuff.Mode.SrcIn);
else
Control.IndeterminateDrawable.ClearColorFilter();
}
void UpdateVisibility()
{
Control.Visibility = Element.IsRunning ? ViewStates.Visible : ViewStates.Invisible;
}
}
}
|
using System.ComponentModel;
using Android.Graphics;
using Android.OS;
using Android.Views;
using AProgressBar = Android.Widget.ProgressBar;
namespace Xamarin.Forms.Platform.Android
{
public class ActivityIndicatorRenderer : ViewRenderer<ActivityIndicator, AProgressBar>
{
public ActivityIndicatorRenderer()
{
AutoPackage = false;
}
protected override void OnElementChanged(ElementChangedEventArgs<ActivityIndicator> e)
{
base.OnElementChanged(e);
AProgressBar progressBar = Control;
if (progressBar == null)
{
progressBar = new AProgressBar(Context) { Indeterminate = true };
SetNativeControl(progressBar);
}
UpdateColor();
UpdateVisibility();
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if (e.PropertyName == ActivityIndicator.IsRunningProperty.PropertyName)
UpdateVisibility();
else if (e.PropertyName == ActivityIndicator.ColorProperty.PropertyName)
UpdateColor();
}
void UpdateColor()
{
if (Build.VERSION.SdkInt < BuildVersionCodes.Lollipop)
return;
Color color = Element.Color;
if (!color.IsDefault)
Control.IndeterminateDrawable.SetColorFilter(color.ToAndroid(), PorterDuff.Mode.SrcIn);
else
Control.IndeterminateDrawable.ClearColorFilter();
}
void UpdateVisibility()
{
Control.Visibility = Element.IsRunning ? ViewStates.Visible : ViewStates.Invisible;
}
}
}
|
mit
|
C#
|
cf16ec791ea32c1ccc7e2bace84c9d79f1788f84
|
Fix missed version, https://github.com/antlr/antlr4/pull/2987#pullrequestreview-575417430
|
antlr/antlr4,antlr/antlr4,antlr/antlr4,ericvergnaud/antlr4,antlr/antlr4,antlr/antlr4,antlr/antlr4,antlr/antlr4,parrt/antlr4,ericvergnaud/antlr4,ericvergnaud/antlr4,ericvergnaud/antlr4,antlr/antlr4,parrt/antlr4,parrt/antlr4,ericvergnaud/antlr4,parrt/antlr4,parrt/antlr4,ericvergnaud/antlr4,parrt/antlr4,parrt/antlr4,antlr/antlr4,parrt/antlr4,ericvergnaud/antlr4,antlr/antlr4,ericvergnaud/antlr4,ericvergnaud/antlr4,parrt/antlr4,ericvergnaud/antlr4,parrt/antlr4
|
runtime/CSharp/Properties/AssemblyInfo.cs
|
runtime/CSharp/Properties/AssemblyInfo.cs
|
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
* Use of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/
using System;
using System.Reflection;
[assembly: CLSCompliant(true)]
[assembly: AssemblyVersion("4.9.1")]
|
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
* Use of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/
using System;
[assembly: CLSCompliant(true)]
|
bsd-3-clause
|
C#
|
cb550fc6f0d234bfe8cfe45b6dbaa7781a194035
|
use shared runspace in tests
|
mzboray/PSAutomation
|
src/PSAutomation.Test/PSTestBase.cs
|
src/PSAutomation.Test/PSTestBase.cs
|
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Management.Automation.Runspaces;
using System.Text;
using System.Threading.Tasks;
namespace PSAutomation.Test
{
[TestFixture]
public abstract class PSTestBase
{
private static readonly InitialSessionState State = CreateState();
private static readonly Runspace DefaultRunspace = CreateRunspace();
private static InitialSessionState CreateState()
{
var state = InitialSessionState.CreateDefault();
state.ImportPSModule(new[] { Path.Combine(Environment.CurrentDirectory, "PSAutomation.psd1") });
return state;
}
private static Runspace CreateRunspace()
{
var runspace = RunspaceFactory.CreateRunspace(State);
runspace.Open();
return runspace;
}
protected static T RunCommand<T>(string command)
{
using (var p = DefaultRunspace.CreatePipeline(command))
{
var results = p.Invoke();
Assert.AreEqual(1, results.Count);
return (T)results[0].BaseObject;
}
}
protected static T[] RunCommandCollection<T>(string command)
{
using (var p = DefaultRunspace.CreatePipeline(command))
{
var results = p.Invoke();
return results.Select(r => (T)r.BaseObject).ToArray();
}
}
}
}
|
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Management.Automation.Runspaces;
using System.Text;
using System.Threading.Tasks;
namespace PSAutomation.Test
{
[TestFixture]
public abstract class PSTestBase
{
protected static T RunCommand<T>(string command)
{
var state = InitialSessionState.CreateDefault();
state.ImportPSModule(new[] { Path.Combine(Environment.CurrentDirectory, "PSAutomation.psd1") });
using (var runspace = RunspaceFactory.CreateRunspace(state))
{
runspace.Open();
using (var p = runspace.CreatePipeline(command))
{
var results = p.Invoke();
Assert.AreEqual(1, results.Count);
return (T)results[0].BaseObject;
}
}
}
protected static T[] RunCommandCollection<T>(string command)
{
var state = InitialSessionState.CreateDefault();
state.ImportPSModule(new[] { Path.Combine(Environment.CurrentDirectory, "PSAutomation.dll") });
using (var runspace = RunspaceFactory.CreateRunspace(state))
{
runspace.Open();
using (var p = runspace.CreatePipeline(command))
{
var results = p.Invoke();
return results.Select(r => (T)r.BaseObject).ToArray();
}
}
}
}
}
|
mit
|
C#
|
f474358a3616e6160e22675a01c9219afc6e13d2
|
Fix AdvancingText getTotalVisibleChars
|
Barleytree/NitoriWare,Barleytree/NitoriWare,NitorInc/NitoriWare,NitorInc/NitoriWare
|
Assets/Scripts/UI/AdvancingText.cs
|
Assets/Scripts/UI/AdvancingText.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using TMPro;
public class AdvancingText : MonoBehaviour
{
[SerializeField]
private float advanceSpeed;
[SerializeField]
private UnityEvent onComplete;
private TMP_Text textMeshProComponent;
private float progress;
void Awake()
{
textMeshProComponent = GetComponent<TMP_Text>();
}
void Start ()
{
resetAdvance();
}
public void resetAdvance()
{
progress = 0f;
setVisibleChars(0);
}
void Update ()
{
if (progress < getTotalVisibleChars())
updateText();
}
void updateText()
{
progress = Mathf.MoveTowards(progress, getTotalVisibleChars(), Time.deltaTime * advanceSpeed);
setVisibleChars((int)Mathf.Floor(progress));
if (progress >= getTotalVisibleChars())
onComplete.Invoke();
}
public float getAdvanceSpeed()
{
return advanceSpeed;
}
public void setAdvanceSpeed(float speed)
{
advanceSpeed = speed;
}
void setVisibleChars(int amount)
{
textMeshProComponent.maxVisibleCharacters = amount;
}
public int getVisibleChars()
{
return textMeshProComponent.maxVisibleCharacters;
}
public int getTotalVisibleChars()
{
return textMeshProComponent.text.Length;
//var textInfo = textMeshProComponent.textInfo;
//return textInfo.characterCount;
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using TMPro;
public class AdvancingText : MonoBehaviour
{
[SerializeField]
private float advanceSpeed;
[SerializeField]
private UnityEvent onComplete;
private TMP_Text textMeshProComponent;
private float progress;
void Start ()
{
textMeshProComponent = GetComponent<TMP_Text>();;
resetAdvance();
}
public void resetAdvance()
{
progress = 0f;
setVisibleChars(0);
}
void Update ()
{
if (progress < getTotalVisibleChars())
updateText();
}
void updateText()
{
progress = Mathf.MoveTowards(progress, getTotalVisibleChars(), Time.deltaTime * advanceSpeed);
setVisibleChars((int)Mathf.Floor(progress));
if (progress >= getTotalVisibleChars())
onComplete.Invoke();
}
public float getAdvanceSpeed()
{
return advanceSpeed;
}
public void setAdvanceSpeed(float speed)
{
advanceSpeed = speed;
}
void setVisibleChars(int amount)
{
textMeshProComponent.maxVisibleCharacters = amount;
}
public int getVisibleChars()
{
return textMeshProComponent.maxVisibleCharacters;
}
public int getTotalVisibleChars()
{
var textInfo = textMeshProComponent.textInfo;
return textInfo.characterCount;
}
}
|
mit
|
C#
|
d4845ef7a529e16a891f2bae6944917bcc351b84
|
Remove deprecated application insights code
|
kapdap/DinkToPdf
|
DinkToPdf.TestWebServer/Startup.cs
|
DinkToPdf.TestWebServer/Startup.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using DinkToPdf.Contracts;
namespace DinkToPdf.TestWebServer
{
//************************************* IMPORTANT ***********************************
// Copy native library to root folder of your project. From there .NET Core loads native library when native method is called with P/Invoke. You can find latest version of native library https://github.com/rdvojmoc/DinkToPdf/tree/master/v0.12.4. Select appropriate library for your OS and platform (64 or 32 bit).
public class Startup
{
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
if (env.IsEnvironment("Development"))
{
// This will push telemetry data through Application Insights pipeline faster, allowing you to view results immediately.
builder.AddApplicationInsightsSettings(developerMode: true);
}
builder.AddEnvironmentVariables();
Configuration = builder.Build();
}
public IConfigurationRoot Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container
public void ConfigureServices(IServiceCollection services)
{
// Add converter to DI
services.AddSingleton(typeof(IConverter), new SynchronizedConverter(new PdfTools()));
// Add framework services.
services.AddApplicationInsightsTelemetry(Configuration);
services.AddMvc();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
app.UseMvc();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using DinkToPdf.Contracts;
namespace DinkToPdf.TestWebServer
{
//************************************* IMPORTANT ***********************************
// Copy native library to root folder of your project. From there .NET Core loads native library when native method is called with P/Invoke. You can find latest version of native library https://github.com/rdvojmoc/DinkToPdf/tree/master/v0.12.4. Select appropriate library for your OS and platform (64 or 32 bit).
public class Startup
{
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
if (env.IsEnvironment("Development"))
{
// This will push telemetry data through Application Insights pipeline faster, allowing you to view results immediately.
builder.AddApplicationInsightsSettings(developerMode: true);
}
builder.AddEnvironmentVariables();
Configuration = builder.Build();
}
public IConfigurationRoot Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container
public void ConfigureServices(IServiceCollection services)
{
// Add converter to DI
services.AddSingleton(typeof(IConverter), new SynchronizedConverter(new PdfTools()));
// Add framework services.
services.AddApplicationInsightsTelemetry(Configuration);
services.AddMvc();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
app.UseApplicationInsightsRequestTelemetry();
app.UseApplicationInsightsExceptionTelemetry();
app.UseMvc();
}
}
}
|
mit
|
C#
|
406990c5cbc5007e80faf03fd16c4d9a99ae2d7d
|
Make TemplarVirtualPathProvider easier to override.
|
mrydengren/templar,mrydengren/templar
|
src/Templar/TemplarVirtualPathProvider.cs
|
src/Templar/TemplarVirtualPathProvider.cs
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Web.Caching;
using System.Web.Hosting;
namespace Templar
{
public class TemplarVirtualPathProvider : VirtualPathProvider
{
protected readonly Dictionary<string, IContentSource> sources = new Dictionary<string, IContentSource>();
private readonly VirtualPathProvider provider;
public TemplarVirtualPathProvider(VirtualPathProvider provider)
{
this.provider = provider;
}
public virtual void AddSource(string virtualPath, IContentSource source)
{
sources.Add(virtualPath, source);
}
public override bool DirectoryExists(string virtualDir)
{
return provider.DirectoryExists(virtualDir);
}
public override bool FileExists(string virtualPath)
{
return sources.ContainsKey(virtualPath) || provider.FileExists(virtualPath);
}
public override CacheDependency GetCacheDependency(string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
{
return provider.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart);
}
public override VirtualDirectory GetDirectory(string virtualDir)
{
return provider.GetDirectory(virtualDir);
}
public override VirtualFile GetFile(string virtualPath)
{
if (sources.ContainsKey(virtualPath))
{
var source = sources[virtualPath];
return new TemplarVirtualFile(virtualPath, source);
}
return provider.GetFile(virtualPath);
}
public override string GetFileHash(string virtualPath, IEnumerable virtualPathDependencies)
{
return provider.GetFileHash(virtualPath, virtualPathDependencies);
}
}
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Web.Caching;
using System.Web.Hosting;
namespace Templar
{
public class TemplarVirtualPathProvider : VirtualPathProvider
{
private readonly Dictionary<string, IContentSource> sources = new Dictionary<string, IContentSource>();
private readonly VirtualPathProvider provider;
public TemplarVirtualPathProvider(VirtualPathProvider provider)
{
this.provider = provider;
}
public void AddSource(string virtualPath, IContentSource source)
{
sources.Add(virtualPath, source);
}
public override bool DirectoryExists(string virtualDir)
{
return provider.DirectoryExists(virtualDir);
}
public override bool FileExists(string virtualPath)
{
return sources.ContainsKey(virtualPath) || provider.FileExists(virtualPath);
}
public override CacheDependency GetCacheDependency(string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
{
return provider.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart);
}
public override VirtualDirectory GetDirectory(string virtualDir)
{
return provider.GetDirectory(virtualDir);
}
public override VirtualFile GetFile(string virtualPath)
{
if (sources.ContainsKey(virtualPath))
{
var source = sources[virtualPath];
return new TemplarVirtualFile(virtualPath, source);
}
return provider.GetFile(virtualPath);
}
public override string GetFileHash(string virtualPath, IEnumerable virtualPathDependencies)
{
return provider.GetFileHash(virtualPath, virtualPathDependencies);
}
}
}
|
mit
|
C#
|
fa6b0a873b8245689624a5383792b8333e5bb477
|
Improve the comments
|
RRode/TinyPools
|
src/TinyPools.Samples/MemoryPoolSample.cs
|
src/TinyPools.Samples/MemoryPoolSample.cs
|
using System;
using System.Threading.Tasks;
namespace TinyPools.Samples
{
public static class MemoryPoolSample
{
public static void Run()
{
Console.WriteLine("Starting memory pool sample");
var random = new Random();
//Define array sizes returned from memory pool segments
var smallSegment = new SegmentDefinition(700);
//Limit medium and largest array segment to store only 2 arrays at a time
var mediumSegment = new SegmentDefinition(1400, 2);
var largeSegment = new SegmentDefinition(2000, 2);
//Create a memory pool with defined segments
var memoryPool = new MemoryPool<int>(smallSegment, mediumSegment, largeSegment);
var task1 = Task.Run(() => UseMemoryPool(random, memoryPool));
var task2 = Task.Run(() => UseMemoryPool(random, memoryPool));
var task3 = Task.Run(() => UseMemoryPool(random, memoryPool));
Task.WaitAll(task1, task2, task3);
}
private static void UseMemoryPool(Random random, MemoryPool<int> memoryPool)
{
for (var i = 0; i < 5; i++)
{
var requestedSize = random.Next(1, 2000);
//Get an array wrapper from memory pool. Note that returned array size will
//be equal to nearest larger of equal segment size. Requesting an array larger
//than the largest defined segment will throw an exception.
using (var pooledArray = memoryPool.GetArray(requestedSize))
{
//Get and use the array from the pool
var array = pooledArray.Object;
//Use the array
for (var j = 0; j < requestedSize; j++)
{
array[j] = Task.CurrentId.HasValue ? Task.CurrentId.Value : -1;
}
Task.Delay(20).Wait();
Console.WriteLine($"Task with ID [{Task.CurrentId}] requested an array of size {requestedSize} and got an array of size {array.Length}.");
}
//Dispose of the wrapper to return the array into pool
}
}
}
}
|
using System;
using System.Threading.Tasks;
namespace TinyPools.Samples
{
public static class MemoryPoolSample
{
public static void Run()
{
Console.WriteLine("Starting memory pool sample");
var random = new Random();
//Define array sizes returned from memory pool segments
var smallSegment = new SegmentDefinition(700);
//Limit medium and largest array segment to store only 2 arrays at a time
var mediumSegment = new SegmentDefinition(1400, 2);
var largeSegment = new SegmentDefinition(2000, 2);
//Create a memory pool with defined segments
var memoryPool = new MemoryPool<int>(smallSegment, mediumSegment, largeSegment);
var task1 = Task.Run(() => UseMemoryPool(random, memoryPool));
var task2 = Task.Run(() => UseMemoryPool(random, memoryPool));
var task3 = Task.Run(() => UseMemoryPool(random, memoryPool));
Task.WaitAll(task1, task2, task3);
}
private static void UseMemoryPool(Random random, MemoryPool<int> memoryPool)
{
for (var i = 0; i < 5; i++)
{
var requestedSize = random.Next(1, 2000);
//Get an array wrapper from memory pool. Note that array size will be equal
//or larger than requested size, depending on your array segments definition.
using (var pooledArray = memoryPool.GetArray(requestedSize))
{
//Get and use the array from the pool
var array = pooledArray.Object;
//Use the array
for (var j = 0; j < requestedSize; j++)
{
array[j] = Task.CurrentId.HasValue ? Task.CurrentId.Value : -1;
}
Task.Delay(20).Wait();
Console.WriteLine($"Task with ID [{Task.CurrentId}] requested an array of size {requestedSize} and got an array of size {array.Length}.");
}
//Dispose of the wrapper to return the array into pool
}
}
}
}
|
mit
|
C#
|
2d87351d2a507d10c059d5f3036c0ede45ec51d4
|
Add tests back to AppVeyor
|
adamhathcock/sharpcompress,adamhathcock/sharpcompress,adamhathcock/sharpcompress
|
build.cake
|
build.cake
|
var target = Argument("target", "Default");
var tag = Argument("tag", "cake");
Task("Restore")
.Does(() =>
{
DotNetCoreRestore(".");
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
if (IsRunningOnWindows())
{
MSBuild("./sharpcompress.sln", c =>
{
c.SetConfiguration("Release")
.SetVerbosity(Verbosity.Minimal)
.UseToolVersion(MSBuildToolVersion.VS2017);
});
}
else
{
var settings = new DotNetCoreBuildSettings
{
Framework = "netstandard1.0",
Configuration = "Release",
NoRestore = true
};
DotNetCoreBuild("./src/SharpCompress/SharpCompress.csproj", settings);
settings.Framework = "netstandard1.3";
DotNetCoreBuild("./src/SharpCompress/SharpCompress.csproj", settings);
settings.Framework = "netstandard2.0";
DotNetCoreBuild("./src/SharpCompress/SharpCompress.csproj", settings);
}
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
var files = GetFiles("tests/**/*.csproj");
foreach(var file in files)
{
var settings = new DotNetCoreTestSettings
{
Configuration = "Release",
Framework = "netcoreapp2.1"
};
DotNetCoreTest(file.ToString(), settings);
}
});
Task("Pack")
.IsDependentOn("Build")
.Does(() =>
{
if (IsRunningOnWindows())
{
MSBuild("src/SharpCompress/SharpCompress.csproj", c => c
.SetConfiguration("Release")
.SetVerbosity(Verbosity.Minimal)
.UseToolVersion(MSBuildToolVersion.VS2017)
.WithProperty("NoBuild", "true")
.WithTarget("Pack"));
}
else
{
Information("Skipping Pack as this is not Windows");
}
});
Task("Default")
.IsDependentOn("Restore")
.IsDependentOn("Build")
.IsDependentOn("Test")
.IsDependentOn("Pack");
Task("RunTests")
.IsDependentOn("Restore")
.IsDependentOn("Build")
.IsDependentOn("Test");
RunTarget(target);
|
var target = Argument("target", "Default");
var tag = Argument("tag", "cake");
Task("Restore")
.Does(() =>
{
DotNetCoreRestore(".");
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
if (IsRunningOnWindows())
{
MSBuild("./sharpcompress.sln", c =>
{
c.SetConfiguration("Release")
.SetVerbosity(Verbosity.Minimal)
.UseToolVersion(MSBuildToolVersion.VS2017);
});
}
else
{
var settings = new DotNetCoreBuildSettings
{
Framework = "netstandard1.0",
Configuration = "Release",
NoRestore = true
};
DotNetCoreBuild("./src/SharpCompress/SharpCompress.csproj", settings);
settings.Framework = "netstandard1.3";
DotNetCoreBuild("./src/SharpCompress/SharpCompress.csproj", settings);
settings.Framework = "netstandard2.0";
DotNetCoreBuild("./src/SharpCompress/SharpCompress.csproj", settings);
}
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
var files = GetFiles("tests/**/*.csproj");
foreach(var file in files)
{
var settings = new DotNetCoreTestSettings
{
Configuration = "Release",
Framework = "netcoreapp2.1"
};
DotNetCoreTest(file.ToString(), settings);
}
});
Task("Pack")
.IsDependentOn("Build")
.Does(() =>
{
if (IsRunningOnWindows())
{
MSBuild("src/SharpCompress/SharpCompress.csproj", c => c
.SetConfiguration("Release")
.SetVerbosity(Verbosity.Minimal)
.UseToolVersion(MSBuildToolVersion.VS2017)
.WithProperty("NoBuild", "true")
.WithTarget("Pack"));
}
else
{
Information("Skipping Pack as this is not Windows");
}
});
Task("Default")
.IsDependentOn("Restore")
.IsDependentOn("Build")
//.IsDependentOn("Test")
.IsDependentOn("Pack");
Task("RunTests")
.IsDependentOn("Restore")
.IsDependentOn("Build")
.IsDependentOn("Test");
RunTarget(target);
|
mit
|
C#
|
f585416fdf27fe817492c0fb065127b96cc81170
|
build test projects
|
neekgreen/PaginableCollections,neekgreen/PaginableCollections
|
build.cake
|
build.cake
|
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var buildDirectory = Directory("./artifacts");
Task("Clean")
.Does(() =>
{
CleanDirectory(buildDirectory);
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
DotNetCoreRestore();
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
var projects = GetFiles("./**/*.csproj");
foreach(var project in projects)
{
DotNetCoreBuild(
project.FullPath,
new DotNetCoreBuildSettings()
{
Configuration = configuration
});
}
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
var projects = GetFiles("./tests/**/*.csproj");
foreach(var project in projects)
{
DotNetCoreTest(
project.FullPath,
new DotNetCoreTestSettings()
{
Configuration = configuration,
NoBuild = true
});
}
});
Task("Pack")
.IsDependentOn("Test")
.Does(() =>
{
var projects = GetFiles("./src/**/*.csproj");
foreach (var project in projects)
{
DotNetCorePack(
project.FullPath,
new DotNetCorePackSettings()
{
Configuration = configuration,
OutputDirectory = buildDirectory,
});
}
});
Task("Default")
.IsDependentOn("Pack");
RunTarget(target);
|
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var buildDirectory = Directory("./artifacts");
Task("Clean")
.Does(() =>
{
CleanDirectory(buildDirectory);
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
DotNetCoreRestore();
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
var projects = GetFiles("./src/**/*.csproj");
foreach(var project in projects)
{
DotNetCoreBuild(
project.FullPath,
new DotNetCoreBuildSettings()
{
Configuration = configuration
});
}
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
var projects = GetFiles("./tests/**/*.csproj");
foreach(var project in projects)
{
DotNetCoreTest(
project.FullPath,
new DotNetCoreTestSettings()
{
Configuration = configuration,
NoBuild = true
});
}
});
Task("Pack")
.IsDependentOn("Test")
.Does(() =>
{
var projects = GetFiles("./src/**/*.csproj");
foreach (var project in projects)
{
DotNetCorePack(
project.FullPath,
new DotNetCorePackSettings()
{
Configuration = configuration,
OutputDirectory = buildDirectory,
});
}
});
Task("Default")
.IsDependentOn("Pack");
RunTarget(target);
|
mit
|
C#
|
8b5766ae70cedf4aa13dee846707647d2a936f7b
|
Add test cloud to build script
|
Redth/ContinuousBrewskies,Redth/ContinuousBrewskies
|
build.cake
|
build.cake
|
#addin "Cake.FileHelpers"
#addin "Cake.Xamarin"
var TARGET = Argument ("target", Argument ("t", "Default"));
Task ("Default").Does (() =>
{
NuGetRestore ("./ContinuousBrewskies.sln");
DotNetBuild ("./ContinuousBrewskies.sln", c => c.Configuration = "Release");
});
Task ("InjectKeys").Does (() =>
{
// Get the API Key from the Environment variable
var breweryDbApiKey = EnvironmentVariable ("BREWERY_DB_API_KEY") ?? "";
// Replace the placeholder in our Configuration.cs files
ReplaceTextInFiles ("./**/Configuration.cs", "{BREWERY_DB_API_KEY}", breweryDbApiKey);
});
Task ("TestCloudAndroid")
.IsDependentOn ("Default")
.Does (() =>
{
// Try and find a test-cloud-exe from the installed nugets
var testCloudExePath = GetFiles ("./**/test-cloud.exe").FirstOrDefault ();
// Build the .apk to test
var apk = AndroidPackage ("./Droid/ContinuousBrewskies.Droid.csproj", true);
var xtcApiKey = EnvironmentVariable ("XTC_API_KEY") ?? "";
var xtcEmail = EnvironmentVariable ("XTC_EMAIL") ?? "";
var xtcDeviceSet = EnvironmentVariable ("XTC_DEVICES") ?? "";
// Run testcloud
TestCloud (apk, xtcApiKey, xtcDeviceSet, xtcEmail, "./UITests/bin/Release/", new TestCloudSettings { ToolPath = testCloudExePath });
});
Task ("TestCloud").IsDependentOn ("TestCloudAndroid");
RunTarget (TARGET);
|
#addin "Cake.FileHelpers"
var TARGET = Argument ("target", Argument ("t", "Default"));
Task ("Default").Does (() =>
{
});
Task ("InjectKeys").Does (() =>
{
// Get the API Key from the Environment variable
var breweryDbApiKey = EnvironmentVariable ("BREWERY_DB_API_KEY") ?? "";
// Replace the placeholder in our Configuration.cs files
ReplaceTextInFiles ("./**/Configuration.cs", "{BREWERY_DB_API_KEY}", breweryDbApiKey);
});
RunTarget (TARGET);
|
apache-2.0
|
C#
|
fce2be9dc7118db2caa6a32729f9fb709d4f68bd
|
Allow running inspect core with cakeclr.
|
ppy/osu,NeoAdonis/osu,ZLima12/osu,DrabWeb/osu,smoogipoo/osu,smoogipooo/osu,UselessToucan/osu,ZLima12/osu,ppy/osu,UselessToucan/osu,2yangk23/osu,johnneijzen/osu,DrabWeb/osu,peppy/osu,peppy/osu,DrabWeb/osu,ppy/osu,NeoAdonis/osu,peppy/osu-new,UselessToucan/osu,peppy/osu,smoogipoo/osu,NeoAdonis/osu,johnneijzen/osu,smoogipoo/osu,naoey/osu,EVAST9919/osu,naoey/osu,2yangk23/osu,naoey/osu,EVAST9919/osu
|
build.cake
|
build.cake
|
#addin "nuget:?package=CodeFileSanity"
#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools"
#tool "nuget:?package=NVika.MSBuild"
#tool "nuget:?package=NuGet.CommandLine"
///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////
var target = Argument("target", "Build");
var framework = Argument("framework", "netcoreapp2.1");
var configuration = Argument("configuration", "Release");
var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj");
var osuSolution = new FilePath("./osu.sln");
var testProjects = GetFiles("**/*.Tests.csproj");
///////////////////////////////////////////////////////////////////////////////
// TASKS
///////////////////////////////////////////////////////////////////////////////
Task("Compile")
.Does(() => {
DotNetCoreBuild(osuDesktop.FullPath, new DotNetCoreBuildSettings {
Framework = framework,
Configuration = configuration
});
});
Task("Test")
.ContinueOnError()
.DoesForEach(testProjects, testProject => {
DotNetCoreTest(testProject.FullPath, new DotNetCoreTestSettings {
Framework = framework,
Configuration = configuration,
Logger = $"trx;LogFileName={testProject.GetFilename()}.trx",
ResultsDirectory = "./TestResults/"
});
});
// windows only because both inspectcore and nvike depend on net45
// will be ignored on linux
Task("InspectCode")
.WithCriteria(IsRunningOnWindows())
.IsDependentOn("Compile")
.Does(() => {
var NVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First();
var NugetToolPath = GetFiles("./tools/NuGet.CommandLine.*/tools/NuGet.exe").First();
StartProcess(NugetToolPath, $"restore {osuSolution}");
InspectCode(osuSolution, new InspectCodeSettings {
CachesHome = "inspectcode",
OutputFile = "inspectcodereport.xml",
});
StartProcess(NVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors");
});
Task("CodeFileSanity")
.Does(() => {
ValidateCodeSanity(new ValidateCodeSanitySettings {
RootDirectory = ".",
IsAppveyorBuild = AppVeyor.IsRunningOnAppVeyor
});
});
Task("Build")
.IsDependentOn("CodeFileSanity")
.IsDependentOn("InspectCode")
.IsDependentOn("Test");
RunTarget(target);
|
#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools"
#tool "nuget:?package=NVika.MSBuild"
#addin "nuget:?package=CodeFileSanity"
var NVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First();
///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////
var target = Argument("target", "Build");
var framework = Argument("framework", "netcoreapp2.1");
var configuration = Argument("configuration", "Release");
var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj");
var osuSolution = new FilePath("./osu.sln");
var testProjects = GetFiles("**/*.Tests.csproj");
///////////////////////////////////////////////////////////////////////////////
// TASKS
///////////////////////////////////////////////////////////////////////////////
Task("Compile")
.Does(() => {
DotNetCoreBuild(osuDesktop.FullPath, new DotNetCoreBuildSettings {
Framework = framework,
Configuration = configuration
});
});
Task("Test")
.ContinueOnError()
.DoesForEach(testProjects, testProject => {
DotNetCoreTest(testProject.FullPath, new DotNetCoreTestSettings {
Framework = framework,
Configuration = configuration,
Logger = $"trx;LogFileName={testProject.GetFilename()}.trx",
ResultsDirectory = "./TestResults/"
});
});
Task("Restore Nuget")
.Does(() => NuGetRestore(osuSolution));
Task("InspectCode")
.IsDependentOn("Restore Nuget")
.IsDependentOn("Compile")
.Does(() => {
InspectCode(osuSolution, new InspectCodeSettings {
CachesHome = "inspectcode",
OutputFile = "inspectcodereport.xml",
});
StartProcess(NVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors");
});
Task("CodeFileSanity")
.Does(() => {
ValidateCodeSanity(new ValidateCodeSanitySettings {
RootDirectory = ".",
IsAppveyorBuild = AppVeyor.IsRunningOnAppVeyor
});
});
Task("Build")
.IsDependentOn("CodeFileSanity")
.IsDependentOn("InspectCode")
.IsDependentOn("Test");
RunTarget(target);
|
mit
|
C#
|
9df87d2337857d91fde5603af1532a8f469bb8cd
|
Bump version to 0.7.1
|
ar3cka/Journalist
|
src/SolutionInfo.cs
|
src/SolutionInfo.cs
|
// <auto-generated/>
using System.Reflection;
[assembly: AssemblyProductAttribute("Journalist")]
[assembly: AssemblyVersionAttribute("0.7.1")]
[assembly: AssemblyInformationalVersionAttribute("0.7.1")]
[assembly: AssemblyFileVersionAttribute("0.7.1")]
[assembly: AssemblyCompanyAttribute("Anton Mednonogov")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "0.7.1";
}
}
|
// <auto-generated/>
using System.Reflection;
[assembly: AssemblyProductAttribute("Journalist")]
[assembly: AssemblyVersionAttribute("0.7.0")]
[assembly: AssemblyInformationalVersionAttribute("0.7.0")]
[assembly: AssemblyFileVersionAttribute("0.7.0")]
[assembly: AssemblyCompanyAttribute("Anton Mednonogov")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "0.7.0";
}
}
|
apache-2.0
|
C#
|
159edbb1ad6d1b2cb817eedbe55acfbf83819805
|
change message
|
jmrnilsson/efpad,jmrnilsson/efpad,jmrnilsson/efpad,jmrnilsson/efpad
|
02-sqlite/Program.cs
|
02-sqlite/Program.cs
|
using System;
using System.Linq;
using System.Collections.Generic;
using Microsoft.Data.Entity;
namespace ConsoleApp
{
public class Program
{
public static void Main()
{
using (var db = new BloggingContext())
{
db.Blogs.RemoveRange(db.Blogs);
db.Posts.RemoveRange(db.Posts);
db.SaveChanges();
var start = DateTime.UtcNow;
foreach (var index in Enumerable.Range(0, 100))
{
var blog = new Blog();
blog.Url = Guid.NewGuid().ToString();
blog.Posts = new List<Post>();
foreach (var indexPost in Enumerable.Range(0, index % 20))
{
var post = new Post();
post.Title = Guid.NewGuid().ToString();
post.Content = Guid.NewGuid().ToString();
blog.Posts.Add(post);
}
db.Blogs.Add(blog);
}
var count = db.SaveChanges();
var duration = (DateTime.UtcNow - start).TotalMilliseconds;
Console.WriteLine("{0} records updated in {1} ms ", count, duration);
Console.WriteLine("Total of {0} ms per record", duration/count);
}
}
}
}
|
using System;
using System.Linq;
using System.Collections.Generic;
using Microsoft.Data.Entity;
namespace ConsoleApp
{
public class Program
{
public static void Main()
{
using (var db = new BloggingContext())
{
db.Blogs.RemoveRange(db.Blogs);
db.Posts.RemoveRange(db.Posts);
db.SaveChanges();
var start = DateTime.UtcNow;
foreach (var index in Enumerable.Range(0, 100))
{
var blog = new Blog();
blog.Url = Guid.NewGuid().ToString();
blog.Posts = new List<Post>();
foreach (var indexPost in Enumerable.Range(0, index % 20))
{
var post = new Post();
post.Title = Guid.NewGuid().ToString();
post.Content = Guid.NewGuid().ToString();
blog.Posts.Add(post);
}
db.Blogs.Add(blog);
}
var count = db.SaveChanges();
var duration = (DateTime.UtcNow - start).TotalMilliseconds;
var msg = "{0} records saved to database in {1} at {2} ms per record";
Console.WriteLine(msg, count, duration, duration/count);
}
}
}
}
|
mit
|
C#
|
7073c1dbc8a11fb0dd7884a1d5d96edbb3fb7916
|
add sourcetype
|
sebastus/AzureFunctionForSplunk
|
shared/sendToSplunk.csx
|
shared/sendToSplunk.csx
|
#r "Newtonsoft.Json"
using System;
using System.Dynamic;
using System.Net;
using System.Net.Http.Headers;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public class SingleHttpClientInstance
{
private static readonly HttpClient HttpClient;
static SingleHttpClientInstance()
{
HttpClient = new HttpClient();
}
public static async Task<HttpResponseMessage> SendToSplunk(HttpRequestMessage req)
{
HttpResponseMessage response = await HttpClient.SendAsync(req);
return response;
}
}
static async Task SendMessagesToSplunk(string[] messages, TraceWriter log)
{
string newEvent(string json) {
var s = "{\"sourcetype\": " + "azure_monitor_metrics";
s += "{\"event\": " + json + "}";
s += "}";
return s;
}
var converter = new ExpandoObjectConverter();
ServicePointManager.ServerCertificateValidationCallback =
new System.Net.Security.RemoteCertificateValidationCallback(
delegate { return true; });
var client = new SingleHttpClientInstance();
string newClientContent = "";
foreach (var message in messages)
{
try {
dynamic obj = JsonConvert.DeserializeObject<ExpandoObject>(message, converter);
foreach (var record in obj.records)
{
string json = Newtonsoft.Json.JsonConvert.SerializeObject(record);
newClientContent += newEvent(json);
}
} catch (Exception e) {
log.Info($"Error {e.InnerException.Message} caught while parsing message: {message}");
}
}
log.info($"New events going to Splunk: {newClientContent}");
try
{
HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Post, "https://asplunktest.westus.cloudapp.azure.com:8088/services/collector/event");
req.Headers.Accept.Clear();
req.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
req.Headers.Add("Authorization", "Splunk 73A24AB7-60DD-4235-BF71-D892AE47F49D");
req.Content = new StringContent(newClientContent, Encoding.UTF8, "application/json");
HttpResponseMessage response = await SingleHttpClientInstance.SendToSplunk(req);
}
catch (System.Net.Http.HttpRequestException e)
{
log.Info($"Error: \"{e.InnerException.Message}\" was caught while sending to Splunk. Is the Splunk service running?");
}
catch (Exception f)
{
log.Info($"Error \"{f.InnerException.Message}\" was caught while sending to Splunk. Unplanned exception.");
}
}
|
#r "Newtonsoft.Json"
using System;
using System.Dynamic;
using System.Net;
using System.Net.Http.Headers;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public class SingleHttpClientInstance
{
private static readonly HttpClient HttpClient;
static SingleHttpClientInstance()
{
HttpClient = new HttpClient();
}
public static async Task<HttpResponseMessage> SendToSplunk(HttpRequestMessage req)
{
HttpResponseMessage response = await HttpClient.SendAsync(req);
return response;
}
}
static async Task SendMessagesToSplunk(string[] messages, TraceWriter log)
{
string newEvent(string json) {
var s = "{\"sourcetype: " + "azure_monitor_metrics";
s += "{\"event\": " + json + "}";
s += "}";
return s;
}
var converter = new ExpandoObjectConverter();
ServicePointManager.ServerCertificateValidationCallback =
new System.Net.Security.RemoteCertificateValidationCallback(
delegate { return true; });
var client = new SingleHttpClientInstance();
string newClientContent = "";
foreach (var message in messages)
{
try {
dynamic obj = JsonConvert.DeserializeObject<ExpandoObject>(message, converter);
foreach (var record in obj.records)
{
string json = Newtonsoft.Json.JsonConvert.SerializeObject(record);
newClientContent += newEvent(json);
}
} catch (Exception e) {
log.Info($"Error {e.InnerException.Message} caught while parsing message: {message}");
}
}
try
{
HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Post, "https://asplunktest.westus.cloudapp.azure.com:8088/services/collector/event");
req.Headers.Accept.Clear();
req.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
req.Headers.Add("Authorization", "Splunk 73A24AB7-60DD-4235-BF71-D892AE47F49D");
req.Content = new StringContent(newClientContent, Encoding.UTF8, "application/json");
HttpResponseMessage response = await SingleHttpClientInstance.SendToSplunk(req);
}
catch (System.Net.Http.HttpRequestException e)
{
log.Info($"Error: \"{e.InnerException.Message}\" was caught while sending to Splunk. Is the Splunk service running?");
}
catch (Exception f)
{
log.Info($"Error \"{f.InnerException.Message}\" was caught while sending to Splunk. Unplanned exception.");
}
}
|
mit
|
C#
|
f3287200b15be4e0cb20cc78c5cee97b48ba04bb
|
Fix the broken "New" link in the header.
|
ekyoung/contact-repository,ekyoung/contact-repository
|
Source/Web/Views/Shared/_Layout.cshtml
|
Source/Web/Views/Shared/_Layout.cshtml
|
@using System.Web.Optimization
<!DOCTYPE html>
@if (@ViewBag.AngularJsApp != null)
{
@: <html lang="en" ng-app="@ViewBag.AngularJsApp">
}
else
{
@: <html lang="en">
}
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/css")
@RenderSection("head", required: false)
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="@Url.Action("Index", "Home")">Contact Repository</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="#">All Contacts</a></li>
<li><a href="#/create">New Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container">
@RenderBody()
</div>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
@Scripts.Render("~/Content/bootstrap-3.0.2/js/bootstrap.min.js")
</body>
</html>
|
@using System.Web.Optimization
<!DOCTYPE html>
@if (@ViewBag.AngularJsApp != null)
{
@: <html lang="en" ng-app="@ViewBag.AngularJsApp">
}
else
{
@: <html lang="en">
}
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/css")
@RenderSection("head", required: false)
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="@Url.Action("Index", "Home")">Contact Repository</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="#">All Contacts</a></li>
<li><a href="#/new">New</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container">
@RenderBody()
</div>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
@Scripts.Render("~/Content/bootstrap-3.0.2/js/bootstrap.min.js")
</body>
</html>
|
mit
|
C#
|
688a3b14e0b9681924b595392974d3f8928f8f01
|
move each action into a convention list
|
Pondidum/Conifer,Pondidum/Conifer
|
TypedRoutingTest/ConventionalRouter.cs
|
TypedRoutingTest/ConventionalRouter.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web.Http;
using System.Web.Http.Controllers;
namespace TypedRoutingTest
{
public class ConventionalRouter
{
private readonly HttpConfiguration _configuration;
public ConventionalRouter(HttpConfiguration configuration)
{
_configuration = configuration;
}
public void AddRoutes<TController>(string prefix)
where TController : IHttpController
{
var conventions = new List<Action<RouteTemplate>>
{
rt =>
{
rt.Parts.Insert(0, prefix.TrimEnd('/'));
},
rt =>
{
var parameterNames = rt.Method.GetParameters().Select(p => "{" + p.Name + "}");
rt.Parts.Add(string.Join("/", parameterNames));
},
rt =>
{
if (rt.Method.Name.EndsWith("Raw"))
{
rt.Parts.Add("raw");
}
}
};
var type = typeof(TController);
var methods = type
.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public)
.Where(m => m.ReturnType != typeof(void))
.ToList();
foreach (var method in methods)
{
var rt = new RouteTemplate(method);
conventions.ForEach(convention => convention(rt));
var template = string.Join("/", rt.Parts.Select(p => p.Trim('/')));
var route = new TypedRoute(template);
route.Action(method.Name);
route.Controller<TController>();
_configuration.TypedRoute(route);
}
}
private class RouteTemplate
{
public MethodInfo Method { get; private set; }
public List<string> Parts { get; private set; }
public RouteTemplate(MethodInfo method)
{
Method = method;
Parts = new List<string>();
}
}
}
}
|
using System;
using System.Linq;
using System.Reflection;
using System.Web.Http;
using System.Web.Http.Controllers;
namespace TypedRoutingTest
{
public class ConventionalRouter
{
private readonly HttpConfiguration _configuration;
public ConventionalRouter(HttpConfiguration configuration)
{
_configuration = configuration;
}
public void AddRoutes<TController>(string prefix)
where TController : IHttpController
{
var type = typeof(TController);
var methods = type
.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public)
.Where(m => m.ReturnType != typeof(void))
.ToList();
prefix = prefix.TrimEnd('/');
foreach (var method in methods)
{
//make into a convention
var parameterNames = method.GetParameters().Select(p => "{" + p.Name + "}");
var raw = method.Name.EndsWith("raw", StringComparison.OrdinalIgnoreCase)
? "raw"
: "";
var template = string.Format("{0}/{1}/{2}", prefix, string.Join("/", parameterNames), raw);
var route = new TypedRoute(template);
route.Action(method.Name);
route.Controller<TController>();
_configuration.TypedRoute(route);
}
}
}
}
|
lgpl-2.1
|
C#
|
2a2ebceac1892d6d4dd25b8237a14dbe16d1e9f8
|
increment the version
|
B2MSolutions/reyna.net,B2MSolutions/reyna.net
|
src/reyna/Properties/AssemblyInfo.cs
|
src/reyna/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("reyna")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("reyna")]
[assembly: AssemblyCopyright("Copyright © Microsoft 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("d68b9826-3724-4beb-b993-0a32e429eb79")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.36")]
[assembly: InternalsVisibleTo("Reyna.Integration.Facts.dll")]
|
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("reyna")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("reyna")]
[assembly: AssemblyCopyright("Copyright © Microsoft 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("d68b9826-3724-4beb-b993-0a32e429eb79")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
[assembly: InternalsVisibleTo("Reyna.Integration.Facts.dll")]
|
mit
|
C#
|
ad906e7a038e3a68181c4003d7b9719ff1311aea
|
Update FizzBuzz.cs
|
michaeljwebb/Algorithm-Practice
|
LeetCode/FizzBuzz.cs
|
LeetCode/FizzBuzz.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class FizzBuzz
{
private static void Main(string[] args)
{
for (int i = 1; i < 16; i++)
{
if (i % 3 == 0 && i % 5 == 0)
{
Console.WriteLine("FizzBuzz");
}
else if (i % 3 == 0)
{
Console.WriteLine("Fizz");
}
else if (i % 5 == 0)
{
Console.WriteLine("Buzz");
}
else
{
Console.WriteLine(i);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class FizzBuzz
{
private static void Main(string[] args)
{
for (int i = 1; i < 16; i++)
{
if (i % 3 == 0 && i % 5 == 0)
{
Console.WriteLine("FizzBuzz");
}
else if (i % 3 == 0)
{
Console.WriteLine("Fizz");
}
else if (i % 5 == 0)
{
Console.WriteLine("Buzz");
}
else
{
Console.WriteLine(i);
}
}
}
}
|
mit
|
C#
|
6a6e51c3cb2d1fec19a2f1a59de98a5aba698ad0
|
Remove leading tabs.
|
rcorre/libgit2sharp,vivekpradhanC/libgit2sharp,xoofx/libgit2sharp,github/libgit2sharp,GeertvanHorrik/libgit2sharp,OidaTiftla/libgit2sharp,AMSadek/libgit2sharp,libgit2/libgit2sharp,dlsteuer/libgit2sharp,nulltoken/libgit2sharp,GeertvanHorrik/libgit2sharp,Zoxive/libgit2sharp,oliver-feng/libgit2sharp,jamill/libgit2sharp,AMSadek/libgit2sharp,sushihangover/libgit2sharp,psawey/libgit2sharp,OidaTiftla/libgit2sharp,whoisj/libgit2sharp,vivekpradhanC/libgit2sharp,PKRoma/libgit2sharp,shana/libgit2sharp,mono/libgit2sharp,whoisj/libgit2sharp,sushihangover/libgit2sharp,AArnott/libgit2sharp,rcorre/libgit2sharp,Skybladev2/libgit2sharp,ethomson/libgit2sharp,Zoxive/libgit2sharp,red-gate/libgit2sharp,vorou/libgit2sharp,github/libgit2sharp,Skybladev2/libgit2sharp,shana/libgit2sharp,red-gate/libgit2sharp,ethomson/libgit2sharp,vorou/libgit2sharp,yishaigalatzer/LibGit2SharpCheckOutTests,mono/libgit2sharp,jamill/libgit2sharp,jeffhostetler/public_libgit2sharp,jorgeamado/libgit2sharp,jeffhostetler/public_libgit2sharp,dlsteuer/libgit2sharp,AArnott/libgit2sharp,yishaigalatzer/LibGit2SharpCheckOutTests,nulltoken/libgit2sharp,jorgeamado/libgit2sharp,psawey/libgit2sharp,xoofx/libgit2sharp,oliver-feng/libgit2sharp
|
LibGit2Sharp/Mode.cs
|
LibGit2Sharp/Mode.cs
|
namespace LibGit2Sharp
{
/// <summary>
/// Git specific modes for entries.
/// </summary>
public enum Mode
{
// Inspired from http://stackoverflow.com/a/8347325/335418
/// <summary>
/// 000000 file mode (the entry doesn't exist)
/// </summary>
Nonexistent = 0,
/// <summary>
/// 040000 file mode
/// </summary>
Directory = 0x4000,
/// <summary>
/// 100644 file mode
/// </summary>
NonExecutableFile = 0x81A4,
/// <summary>
/// Obsolete 100664 file mode.
/// <para>0100664 mode is an early Git design mistake. It's kept for
/// ascendant compatibility as some <see cref="Tree"/> and
/// <see cref="Repository.Index"/> entries may still bear
/// this mode in some old git repositories, but it's now deprecated.
/// </para>
/// </summary>
NonExecutableGroupWritableFile = 0x81B4,
/// <summary>
/// 100755 file mode
/// </summary>
ExecutableFile = 0x81ED,
/// <summary>
/// 120000 file mode
/// </summary>
SymbolicLink = 0xA000,
/// <summary>
/// 160000 file mode
/// </summary>
GitLink = 0xE000
}
}
|
namespace LibGit2Sharp
{
/// <summary>
/// Git specific modes for entries.
/// </summary>
public enum Mode
{
// Inspired from http://stackoverflow.com/a/8347325/335418
/// <summary>
/// 000000 file mode (the entry doesn't exist)
/// </summary>
Nonexistent = 0,
/// <summary>
/// 040000 file mode
/// </summary>
Directory = 0x4000,
/// <summary>
/// 100644 file mode
/// </summary>
NonExecutableFile = 0x81A4,
/// <summary>
/// Obsolete 100664 file mode.
/// <para>0100664 mode is an early Git design mistake. It's kept for
/// ascendant compatibility as some <see cref="Tree"/> and
/// <see cref="Repository.Index"/> entries may still bear
/// this mode in some old git repositories, but it's now deprecated.
/// </para>
/// </summary>
NonExecutableGroupWritableFile = 0x81B4,
/// <summary>
/// 100755 file mode
/// </summary>
ExecutableFile = 0x81ED,
/// <summary>
/// 120000 file mode
/// </summary>
SymbolicLink = 0xA000,
/// <summary>
/// 160000 file mode
/// </summary>
GitLink = 0xE000
}
}
|
mit
|
C#
|
01e584fac286904792b2824f4e47a58c540dfdda
|
Build and publish nuget package
|
QuickenLoans/XSerializer
|
XSerializer/Properties/AssemblyInfo.cs
|
XSerializer/Properties/AssemblyInfo.cs
|
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("XSerializer")]
[assembly: AssemblyDescription("Advanced, high-performance XML and JSON serializers")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Quicken Loans")]
[assembly: AssemblyProduct("XSerializer")]
[assembly: AssemblyCopyright("Copyright © Quicken Loans 2013-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("5aeaebd0-35de-424c-baa9-ba6d65fa3409")]
[assembly: CLSCompliant(true)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.3.8")]
[assembly: AssemblyInformationalVersion("0.3.8")]
#if !BUILD
[assembly: InternalsVisibleTo("XSerializer.Tests")]
[assembly: InternalsVisibleTo("XSerializer.PerformanceTests")]
#endif
|
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("XSerializer")]
[assembly: AssemblyDescription("Advanced, high-performance XML and JSON serializers")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Quicken Loans")]
[assembly: AssemblyProduct("XSerializer")]
[assembly: AssemblyCopyright("Copyright © Quicken Loans 2013-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("5aeaebd0-35de-424c-baa9-ba6d65fa3409")]
[assembly: CLSCompliant(true)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.3.7")]
[assembly: AssemblyInformationalVersion("0.3.7")]
#if !BUILD
[assembly: InternalsVisibleTo("XSerializer.Tests")]
[assembly: InternalsVisibleTo("XSerializer.PerformanceTests")]
#endif
|
mit
|
C#
|
5b7af842082b19e619d7c9781206aa98fa894f02
|
remove trial_exp claim
|
bitwarden/core,bitwarden/core,bitwarden/core,bitwarden/core
|
src/Api/IdentityServer/ApiResources.cs
|
src/Api/IdentityServer/ApiResources.cs
|
using IdentityServer4.Models;
using System.Collections.Generic;
using System.Security.Claims;
namespace Bit.Api.IdentityServer
{
public class ApiResources
{
public static IEnumerable<ApiResource> GetApiResources()
{
return new List<ApiResource>
{
new ApiResource("api", "Vault API", new string[] {
ClaimTypes.AuthenticationMethod,
ClaimTypes.NameIdentifier,
ClaimTypes.Email,
"securitystamp",
"name",
"email",
"sstamp", // security stamp
"plan",
"device"
})
};
}
}
}
|
using IdentityServer4.Models;
using System.Collections.Generic;
using System.Security.Claims;
namespace Bit.Api.IdentityServer
{
public class ApiResources
{
public static IEnumerable<ApiResource> GetApiResources()
{
return new List<ApiResource>
{
new ApiResource("api", "Vault API", new string[] {
ClaimTypes.AuthenticationMethod,
ClaimTypes.NameIdentifier,
ClaimTypes.Email,
"securitystamp",
"name",
"email",
"sstamp", // security stamp
"plan",
"trial_exp",
"device"
})
};
}
}
}
|
agpl-3.0
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.