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
49295d7b350baed1e8d82d4d70ab2964d873bfd1
bump version to 1.7.1
Terradue/DotNetGeoJson,Siliconrob/DotNetGeoJson
Terradue.GeoJson/Properties/AssemblyInfo.cs
Terradue.GeoJson/Properties/AssemblyInfo.cs
/* * Copyright (C) 2010-2014 Terradue S.r.l. * * This file is part of Terradue.GeoJson. * * Foobar is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with Terradue.OpenSearch. * If not, see http://www.gnu.org/licenses/. */ /*! \namespace Terradue.GeoJson @{ Terradue .NET GeoJson Library. Initially developed to provide an easy way to manage Geometry objects with serialization and deserialization functions and transformation functions from/to GeoJson, it also supports GML, georss and Well Known Text (WKT) \xrefitem sw_version "Versions" "Software Package Version" 1.7.1 \xrefitem sw_link "Links" "Software Package List" [DotNetGeoJson](https://github.com/Terradue/DotNetGeoJson) \xrefitem sw_license "License" "Software License" [GPLv3](https://github.com/Terradue/DotNetGeoJson/blob/master/LICENSE.txt) \ingroup Data @} */ using System.Reflection; using System.Runtime.CompilerServices; using NuGet4Mono.Extensions; [assembly: AssemblyDescription("Terradue.GeoJson is a library targeting .NET 4.0 and above that provides an easy way to manage Geometry objects with serialization and deserialization functions and transformation functions from/to GeoJson, GML, georss and Well Known Text (WKT)")] [assembly: AssemblyTitle("Terradue.GeoJson")] [assembly: AssemblyCompany("Terradue")] [assembly: AssemblyProduct("Terradue.GeoJson")] [assembly: AssemblyAuthors("Emmanuel Mathot")] [assembly: AssemblyProjectUrl("https://github.com/Terradue/DotNetGeoJson")] [assembly: AssemblyLicenseUrl("https://github.com/Terradue/DotNetGeoJson/blob/master/LICENSE")] [assembly: AssemblyCopyright("Terradue")] [assembly: AssemblyVersion("1.7.1.*")] [assembly: AssemblyInformationalVersion("1.7.1")
/* * Copyright (C) 2010-2014 Terradue S.r.l. * * This file is part of Terradue.GeoJson. * * Foobar is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with Terradue.OpenSearch. * If not, see http://www.gnu.org/licenses/. */ /*! \namespace Terradue.GeoJson @{ Terradue .NET GeoJson Library. Initially developed to provide an easy way to manage Geometry objects with serialization and deserialization functions and transformation functions from/to GeoJson, it also supports GML, georss and Well Known Text (WKT) \xrefitem sw_version "Versions" "Software Package Version" 1.7.0 \xrefitem sw_link "Links" "Software Package List" [DotNetGeoJson](https://github.com/Terradue/DotNetGeoJson) \xrefitem sw_license "License" "Software License" [GPLv3](https://github.com/Terradue/DotNetGeoJson/blob/master/LICENSE.txt) \ingroup Data @} */ using System.Reflection; using System.Runtime.CompilerServices; using NuGet4Mono.Extensions; [assembly: AssemblyDescription("Terradue.GeoJson is a library targeting .NET 4.0 and above that provides an easy way to manage Geometry objects with serialization and deserialization functions and transformation functions from/to GeoJson, GML, georss and Well Known Text (WKT)")] [assembly: AssemblyTitle("Terradue.GeoJson")] [assembly: AssemblyCompany("Terradue")] [assembly: AssemblyProduct("Terradue.GeoJson")] [assembly: AssemblyAuthors("Emmanuel Mathot")] [assembly: AssemblyProjectUrl("https://github.com/Terradue/DotNetGeoJson")] [assembly: AssemblyLicenseUrl("https://github.com/Terradue/DotNetGeoJson/blob/master/LICENSE")] [assembly: AssemblyCopyright("Terradue")] [assembly: AssemblyVersion("1.7.0.*")] [assembly: AssemblyInformationalVersion("1.7.0")]
agpl-3.0
C#
2b44f2ffec18b6dd1796f921c3352a92337cdbf7
move copyright and author info to top of the file
GStreamer/gstreamer-sharp,gstreamer-sharp/gstreamer-sharp,freedesktop-unofficial-mirror/gstreamer__gstreamer-sharp,gstreamer-sharp/gstreamer-sharp,GStreamer/gstreamer-sharp,freedesktop-unofficial-mirror/gstreamer__gstreamer-sharp,GStreamer/gstreamer-sharp,gstreamer-sharp/gstreamer-sharp,freedesktop-unofficial-mirror/gstreamer__gstreamer-sharp
sources/custom/Version.cs
sources/custom/Version.cs
// // Version.cs: Lightweight Version Object for GStreamer // // Authors: // Aaron Bockover <[email protected]> // Stephan Sundermann <[email protected]> // // Copyright (C) 2006 Novell, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA using System; using System.Runtime.InteropServices; namespace Gst { public static class Version { private static uint major; private static uint minor; private static uint micro; private static uint nano; private static string version_string; static Version() { gst_version (out major, out minor, out micro, out nano); } public static string Description { get { if (version_string == null) { IntPtr version_string_ptr = gst_version_string(); version_string = GLib.Marshaller.Utf8PtrToString (version_string_ptr); } return version_string; } } public static uint Major { get { return major; } } public static uint Minor { get { return minor; } } public static uint Micro { get { return micro; } } public static uint Nano { get { return nano; } } [DllImport ("libgstreamer-1.0-0.dll") ] private static extern void gst_version (out uint major, out uint minor, out uint micro, out uint nano); [DllImport ("libgstreamer-1.0-0.dll") ] private static extern IntPtr gst_version_string(); } }
// This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // Version.cs: Lightweight Version Object for GStreamer // // Authors: // Aaron Bockover ([email protected]) // Stephan Sundermann ([email protected]) // // Copyright (C) 2006 Novell, Inc. // using System; using System.Runtime.InteropServices; namespace Gst { public static class Version { private static uint major; private static uint minor; private static uint micro; private static uint nano; private static string version_string; static Version() { gst_version (out major, out minor, out micro, out nano); } public static string Description { get { if (version_string == null) { IntPtr version_string_ptr = gst_version_string(); version_string = GLib.Marshaller.Utf8PtrToString (version_string_ptr); } return version_string; } } public static uint Major { get { return major; } } public static uint Minor { get { return minor; } } public static uint Micro { get { return micro; } } public static uint Nano { get { return nano; } } [DllImport ("libgstreamer-1.0-0.dll") ] private static extern void gst_version (out uint major, out uint minor, out uint micro, out uint nano); [DllImport ("libgstreamer-1.0-0.dll") ] private static extern IntPtr gst_version_string(); } }
lgpl-2.1
C#
7d697130dee5f03eb58ca33cd8af1e8014e428f5
Read parameters from command line arguments
TeamnetGroup/schema2fm
src/ConsoleApp/Program.cs
src/ConsoleApp/Program.cs
using static System.Console; namespace ConsoleApp { class Program { private static void Main(string[] args) { if (args.Length != 3) { WriteLine("Usage: schema2fm.exe connectionstring schema table"); return; } var connectionString = args[0];//@"Server=.\SQLEXPRESS;Database=LearnORM;Trusted_Connection=True;"; var schemaName = args[1];//"dbo"; var tableName = args[2];//"Book"; var columnsProvider = new ColumnsProvider(connectionString); var columns = columnsProvider.GetColumnsAsync(schemaName, tableName).GetAwaiter().GetResult(); new Table(tableName, columns).OutputMigrationCode(Out); } } }
using static System.Console; namespace ConsoleApp { class Program { private static void Main() { var connectionString = @"Server=.\SQLEXPRESS;Database=LearnORM;Trusted_Connection=True;"; var schemaName = "dbo"; var tableName = "Book"; var columnsProvider = new ColumnsProvider(connectionString); var columns = columnsProvider.GetColumnsAsync(schemaName, tableName).GetAwaiter().GetResult(); new Table(tableName, columns).OutputMigrationCode(Out); } } }
mit
C#
92fa1ea9410295e0ada133bcc077002abb8a4541
Update the Empty module template.
jtm789/CMS,andyshao/CMS,lingxyd/CMS,Kooboo/CMS,lingxyd/CMS,techwareone/Kooboo-CMS,andyshao/CMS,techwareone/Kooboo-CMS,jtm789/CMS,jtm789/CMS,lingxyd/CMS,techwareone/Kooboo-CMS,andyshao/CMS,Kooboo/CMS,Kooboo/CMS
Kooboo.CMS/Kooboo.CMS.ModuleArea/Areas/Empty/ModuleAction.cs
Kooboo.CMS/Kooboo.CMS.ModuleArea/Areas/Empty/ModuleAction.cs
#region License // // Copyright (c) 2013, Kooboo team // // Licensed under the BSD License // See the file LICENSE.txt for details. // #endregion using Kooboo.CMS.Sites.Extension.ModuleArea; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.Mvc; using Kooboo.CMS.Sites.Extension; using Kooboo.CMS.ModuleArea.Areas.SampleModule.Models; namespace Kooboo.CMS.ModuleArea.Areas.Empty { [Kooboo.CMS.Common.Runtime.Dependency.Dependency(typeof(IModuleAction), Key = ModuleAreaRegistration.ModuleName)] public class ModuleAction : IModuleAction { public void OnExcluded(Sites.Models.Site site) { // Add code here that will be executed when the module was excluded to the site. } public void OnIncluded(Sites.Models.Site site) { // Add code here that will be executed when the module was included to the site. } public void OnInstalling(ControllerContext controllerContext) { // Add code here that will be executed when the module installing. } public void OnUninstalling(ControllerContext controllerContext) { // Add code here that will be executed when the module uninstalling. } } }
#region License // // Copyright (c) 2013, Kooboo team // // Licensed under the BSD License // See the file LICENSE.txt for details. // #endregion using Kooboo.CMS.Sites.Extension.ModuleArea; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.Mvc; using Kooboo.CMS.Sites.Extension; using Kooboo.CMS.ModuleArea.Areas.SampleModule.Models; namespace Kooboo.CMS.ModuleArea.Areas.Empty { [Kooboo.CMS.Common.Runtime.Dependency.Dependency(typeof(IModuleAction), Key = SampleAreaRegistration.ModuleName)] public class ModuleAction : IModuleAction { public void OnExcluded(Sites.Models.Site site) { // Add code here that will be executed when the module was excluded to the site. } public void OnIncluded(Sites.Models.Site site) { // Add code here that will be executed when the module was included to the site. } public void OnInstalling(ControllerContext controllerContext) { var moduleInfo = ModuleInfo.Get(SampleAreaRegistration.ModuleName); var installModel = new InstallModel(); Kooboo.CMS.Sites.Extension.PagePluginHelper.BindModel<InstallModel>(installModel, controllerContext); moduleInfo.DefaultSettings.CustomSettings["DatabaseServer"] = installModel.DatabaseServer; moduleInfo.DefaultSettings.CustomSettings["UserName"] = installModel.UserName; moduleInfo.DefaultSettings.CustomSettings["Password"] = installModel.Password; ModuleInfo.Save(moduleInfo); // Add code here that will be executed when the module installing. } public void OnUninstalling(ControllerContext controllerContext) { // Add code here that will be executed when the module uninstalling. } } }
bsd-3-clause
C#
efc8ac7bb550b1e4bf107c1164dd535f99fab2e5
Update year in copyright
OfficeDev/PnP-Sites-Core,OfficeDev/PnP-Sites-Core,OfficeDev/PnP-Sites-Core
Core/OfficeDevPnP.Core/Properties/AssemblyInfo.cs
Core/OfficeDevPnP.Core/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; 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("OfficeDevPnP.Core")] #if SP2013 [assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint 2013")] #elif SP2016 [assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint 2016")] #else [assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint Online")] #endif [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OfficeDevPnP.Core")] [assembly: AssemblyCopyright("Copyright © Microsoft 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en-US")] // 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("065331b6-0540-44e1-84d5-d38f09f17f9e")] // 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: // Convention: // Major version = current version 2 // Minor version = Sequence...version 0 was with January release...so 1=Feb 2=Mar...11=Jan 2017...15=May 2017...20=Nov // Third part = version indenpendant showing the release month in YYMM // Fourth part = 0 normally or a sequence number when we do an emergency release [assembly: AssemblyVersion("2.22.1801.0")] [assembly: AssemblyFileVersion("2.22.1801.0")] [assembly: InternalsVisibleTo("OfficeDevPnP.Core.Tests")]
using System.Reflection; using System.Resources; 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("OfficeDevPnP.Core")] #if SP2013 [assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint 2013")] #elif SP2016 [assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint 2016")] #else [assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint Online")] #endif [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OfficeDevPnP.Core")] [assembly: AssemblyCopyright("Copyright © Microsoft 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en-US")] // 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("065331b6-0540-44e1-84d5-d38f09f17f9e")] // 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: // Convention: // Major version = current version 2 // Minor version = Sequence...version 0 was with January release...so 1=Feb 2=Mar...11=Jan 2017...15=May 2017...20=Nov // Third part = version indenpendant showing the release month in YYMM // Fourth part = 0 normally or a sequence number when we do an emergency release [assembly: AssemblyVersion("2.22.1801.0")] [assembly: AssemblyFileVersion("2.22.1801.0")] [assembly: InternalsVisibleTo("OfficeDevPnP.Core.Tests")]
mit
C#
5569cb52e396d0fab1795c50d3e490f0e0c5e124
Change default version number in GATest
JapaMala/armok-vision,JapaMala/armok-vision,JapaMala/armok-vision
Assets/TestData/GATest.cs
Assets/TestData/GATest.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; public class GATest : MonoBehaviour { float timer = 1; // Use this for initialization void Start () { StartCoroutine (itr ()); } //for testing IEnumerator itr () { while (true) { yield return new WaitForSeconds (timer); GoogleAnalyticsV4.instance.SendDeviceData ("v0.00", "0.0"); Debug.Log ("Data sent"); } } } public static class GoogleAnalyticExtensions{ /// <summary> /// Will only send data if not in Editor mode. /// </summary> /// <param name="GA">G.</param> /// <param name="DFVersion">Dwarf Fortress version.</param> /// <param name="pluginVersion">Plugin version.</param> public static void SendDeviceData (this GoogleAnalyticsV4 GA, string DFVersion , string pluginVersion) { #if !UNITY_EDITOR GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("Graphics Card") .SetEventAction (SystemInfo.graphicsDeviceVendor) .SetEventLabel (SystemInfo.graphicsDeviceName) .SetEventValue (1) .Validate () ); GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("Processor") .SetEventAction ("Core number") .SetEventLabel (SystemInfo.processorCount.ToString ()) .SetEventValue (1) .Validate () ); GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("Processor") .SetEventAction ("Core frequency") .SetEventLabel (SystemInfo.processorFrequency.ToString ()) .SetEventValue (1) .Validate () ); GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("OS Version") .SetEventAction (SystemInfo.operatingSystem) .SetEventLabel (SystemInfo.operatingSystem) .SetEventValue (1) .Validate () ); GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("Program Version") .SetEventAction ("Dwarf Fortress Version") .SetEventLabel (DFVersion) .SetEventValue (1) .Validate () ); GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("Program Version") .SetEventAction ("Plugin Version") .SetEventLabel (pluginVersion) .SetEventValue (1) .Validate () ); #endif } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class GATest : MonoBehaviour { float timer = 1; // Use this for initialization void Start () { StartCoroutine (itr ()); } //for testing IEnumerator itr () { while (true) { yield return new WaitForSeconds (timer); GoogleAnalyticsV4.instance.SendDeviceData ("v1.012", "1.0"); Debug.Log ("Data sent"); } } } public static class GoogleAnalyticExtensions{ /// <summary> /// Will only send data if not in Editor mode. /// </summary> /// <param name="GA">G.</param> /// <param name="DFVersion">Dwarf Fortress version.</param> /// <param name="pluginVersion">Plugin version.</param> public static void SendDeviceData (this GoogleAnalyticsV4 GA, string DFVersion , string pluginVersion) { #if !UNITY_EDITOR GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("Graphics Card") .SetEventAction (SystemInfo.graphicsDeviceVendor) .SetEventLabel (SystemInfo.graphicsDeviceName) .SetEventValue (1) .Validate () ); GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("Processor") .SetEventAction ("Core number") .SetEventLabel (SystemInfo.processorCount.ToString ()) .SetEventValue (1) .Validate () ); GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("Processor") .SetEventAction ("Core frequency") .SetEventLabel (SystemInfo.processorFrequency.ToString ()) .SetEventValue (1) .Validate () ); GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("OS Version") .SetEventAction (SystemInfo.operatingSystem) .SetEventLabel (SystemInfo.operatingSystem) .SetEventValue (1) .Validate () ); GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("Program Version") .SetEventAction ("Dwarf Fortress Version") .SetEventLabel (DFVersion) .SetEventValue (1) .Validate () ); GA.LogEvent (new EventHitBuilder () .SetCustomDimension (1, SystemInfo.operatingSystemFamily.ToString ()) .SetEventCategory ("Program Version") .SetEventAction ("Plugin Version") .SetEventLabel (pluginVersion) .SetEventValue (1) .Validate () ); #endif } }
mit
C#
5e7ebf9a96387735ae194426bc647b8fe36fa8a2
clean startup
LuccaSA/MerQure
samples/MerQure.Samples/Startup.cs
samples/MerQure.Samples/Startup.cs
using MerQure.RbMQ; using MerQure.RbMQ.Config; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System.IO; namespace MerQure.Samples { public class Startup { public IConfiguration Configuration { get; set; } public Startup() { var configBuilder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("merqure.rbmq.json", optional: true) .AddXmlFile("rabbitMQ.config", optional: true); Configuration = configBuilder.Build(); } public void ConfigureServices(IServiceCollection services) { services.Configure<MerQureConfiguration>(Configuration); services.AddSingleton<SharedConnection>(); services.AddScoped<IMessagingService, MessagingService>(); services.AddScoped<SimpleExample>(); services.AddScoped<StopExample>(); services.AddScoped<DeadLetterExample>(); } } }
using MerQure.RbMQ; using MerQure.RbMQ.Config; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using System.IO; namespace MerQure.Samples { public class Startup { public IConfiguration Configuration { get; set; } public Startup() { var dir = Directory.GetCurrentDirectory(); var configBuilder = new ConfigurationBuilder() .SetBasePath(dir) .AddJsonFile("merqure.rbmq.json", optional: true) .AddXmlFile("rabbitMQ.config", optional: true); Configuration = configBuilder.Build(); configBuilder.AddConfiguration(Configuration); } public void ConfigureServices(IServiceCollection services) { services.Configure<MerQureConfiguration>(Configuration); services.AddSingleton<SharedConnection>(); services.AddScoped<IMessagingService, MessagingService>(); services.AddScoped<SimpleExample>(); services.AddScoped<StopExample>(); services.AddScoped<DeadLetterExample>(); } } }
mit
C#
9392db9466ca1526a1b177144d4cd76e36327303
Update AlphabetSoup.cs
michaeljwebb/Algorithm-Practice
Coderbyte/AlphabetSoup.cs
Coderbyte/AlphabetSoup.cs
//Take the str string parameter being passed and return the string with the letters in alphabetical order. using System; class MainClass { public static string AlphabetSoup(string str) { char[] cArray = str.ToCharArray(); Array.Sort<char>(cArray); string result = ""; for(int i = 0; i < cArray.Length; i++){ result += cArray[i]; str = result; } return str; } static void Main() { // keep this function call here Console.WriteLine(AlphabetSoup(Console.ReadLine())); } }
using System; class MainClass { public static string AlphabetSoup(string str) { char[] cArray = str.ToCharArray(); Array.Sort<char>(cArray); string result = ""; for(int i = 0; i < cArray.Length; i++){ result += cArray[i]; str = result; } return str; } static void Main() { // keep this function call here Console.WriteLine(AlphabetSoup(Console.ReadLine())); } }
mit
C#
c9f11d1fceef8217b05466ce7c2fedcdc965862d
update version
hgupta9/FluentFTP,robinrodricks/FluentFTP,robinrodricks/FluentFTP,worstenbrood/FluentFTP,robinrodricks/FluentFTP
FluentFTP/AssemblyInfo.cs
FluentFTP/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Resources; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("FluentFTP")] [assembly: AssemblyDescription("FTP and FTPS client implementation")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FluentFTP")] [assembly: AssemblyCopyright("J.P. Trosclair")] [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("16.0.15")] // 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("")] [assembly: GuidAttribute("A88FA910-1553-4000-AA56-6FC001AD7CF1")] [assembly: NeutralResourcesLanguageAttribute("en")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Resources; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("FluentFTP")] [assembly: AssemblyDescription("FTP and FTPS client implementation")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FluentFTP")] [assembly: AssemblyCopyright("J.P. Trosclair")] [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("16.0.14")] // 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("")] [assembly: GuidAttribute("A88FA910-1553-4000-AA56-6FC001AD7CF1")] [assembly: NeutralResourcesLanguageAttribute("en")]
mit
C#
6b3a3e6f5cce10df4a23955bd86bbab3507647a9
allow file paths with spaces
jasonracey/ConvertToMp3,jasonracey/ConvertToMp3
ConvertToMp3/Converter.cs
ConvertToMp3/Converter.cs
using System.Collections.Generic; using System.Diagnostics; using System.IO; namespace ConvertToMp3 { public class Converter { public int ProcessedSourceFiles { get; private set; } public int TotalSourceFiles { get; private set; } public string State { get; private set; } public void ConvertFiles(List<string> sourceFilePaths, bool deleteSourceFile) { TotalSourceFiles = sourceFilePaths.Count; foreach (var sourceFilePath in sourceFilePaths) { ConvertFile(sourceFilePath, deleteSourceFile); ProcessedSourceFiles++; } } private void ConvertFile(string sourceFilePath, bool deleteSourceFile) { var sourceFileInfo = new FileInfo(sourceFilePath); var destFilePath = sourceFilePath.Replace(sourceFileInfo.Extension, ".mp3"); if (File.Exists(destFilePath)) { File.Delete(destFilePath); } var processStartInfo = new ProcessStartInfo { CreateNoWindow = true, UseShellExecute = false, FileName = @"C:\Program Files\ffmpeg-20150911-git-f58e011-win64-static\bin\ffmpeg.exe", WindowStyle = ProcessWindowStyle.Hidden, Arguments = $"-i \"{sourceFilePath}\" -ab 320k \"{destFilePath}\"" }; State = $"Converting {sourceFileInfo.Name} ..."; using (var process = Process.Start(processStartInfo)) { process?.WaitForExit(); } if (deleteSourceFile && File.Exists(destFilePath)) { File.Delete(sourceFilePath); } } } }
using System.Collections.Generic; using System.Diagnostics; using System.IO; namespace ConvertToMp3 { public class Converter { public int ProcessedSourceFiles { get; private set; } public int TotalSourceFiles { get; private set; } public string State { get; private set; } public void ConvertFiles(List<string> sourceFilePaths, bool deleteSourceFile) { TotalSourceFiles = sourceFilePaths.Count; foreach (var sourceFilePath in sourceFilePaths) { ConvertFile(sourceFilePath, deleteSourceFile); ProcessedSourceFiles++; } } private void ConvertFile(string sourceFilePath, bool deleteSourceFile) { var sourceFileInfo = new FileInfo(sourceFilePath); var destFilePath = sourceFilePath.Replace(sourceFileInfo.Extension, ".mp3"); if (File.Exists(destFilePath)) { File.Delete(destFilePath); } var processStartInfo = new ProcessStartInfo { CreateNoWindow = true, UseShellExecute = false, FileName = @"C:\Program Files\ffmpeg-20150911-git-f58e011-win64-static\bin\ffmpeg.exe", WindowStyle = ProcessWindowStyle.Hidden, Arguments = $"-i {sourceFilePath} -ab 320k {destFilePath}" }; State = $"Converting {sourceFileInfo.Name} ..."; using (var process = Process.Start(processStartInfo)) { process?.WaitForExit(); } if (deleteSourceFile && File.Exists(destFilePath)) { File.Delete(sourceFilePath); } } } }
mit
C#
761fb9376e696bc017ce2352bd2272b03908d70f
Make way for the extended information which can be requested using the Show Droplet request.
JamieH/DigitalOcean-CSharp
DOAPI/Structs/Droplets.cs
DOAPI/Structs/Droplets.cs
using System.Collections.Generic; namespace DigitalOcean.Structs { public class Droplet { public int id { get; set; } public int image_id { get; set; } public string name { get; set; } public int region_id { get; set; } public int size_id { get; set; } public bool backups_active { get; set; } public List<object> backups { get; set; } //extended public List<object> snapshots { get; set; } //extended public string ip_address { get; set; } public object private_ip_address { get; set; } public bool locked { get; set; } public string status { get; set; } public string created_at { get; set; } } public class Droplets { public string status { get; set; } public List<Droplet> droplets { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DigitalOcean.Structs { public class Droplet { public int id { get; set; } public string name { get; set; } public int image_id { get; set; } public int size_id { get; set; } public int region_id { get; set; } public bool backups_active { get; set; } public string ip_address { get; set; } public object private_ip_address { get; set; } public bool locked { get; set; } public string status { get; set; } public string created_at { get; set; } } public class Droplets { public string status { get; set; } public List<Droplet> droplets { get; set; } } }
mit
C#
800311406348df572ff5c7617e74a36a6e8ced10
Fix ExportItemsFromDownloads.ExportAsGcode
larsbrubaker/MatterControl,larsbrubaker/MatterControl,tellingmachine/MatterControl,rytz/MatterControl,mmoening/MatterControl,mmoening/MatterControl,rytz/MatterControl,jlewin/MatterControl,jlewin/MatterControl,mmoening/MatterControl,jlewin/MatterControl,larsbrubaker/MatterControl,jlewin/MatterControl,rytz/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl,larsbrubaker/MatterControl,tellingmachine/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl
Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs
Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs
using System; using System.Diagnostics; using System.IO; using System.Threading; using System.Threading.Tasks; using MatterHackers.Agg.UI.Tests; using MatterHackers.GuiAutomation; using NUnit.Framework; namespace MatterHackers.MatterControl.Tests.Automation { [TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain] public class ExportGcodeFromExportWindow { [Test, Apartment(ApartmentState.STA)] public async Task ExportAsGcode() { AutomationTest testToRun = (testRunner) => { testRunner.CloseSignInAndPrinterSelect(); MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD"); string firstItemName = "Queue Item Batman"; //Navigate to Downloads Library Provider testRunner.ClickByName("Queue Tab"); testRunner.ClickByName("Queue Add Button", 2); //Get parts to add string rowItemPath = MatterControlUtilities.GetTestItemPath("Batman.stl"); //Add STL part items to Downloads and then type paths into file dialog testRunner.Wait(1); testRunner.Type(MatterControlUtilities.GetTestItemPath("Batman.stl")); testRunner.Wait(1); testRunner.Type("{Enter}"); //Get test results Assert.IsTrue(testRunner.WaitForName(firstItemName, 2) == true); testRunner.ClickByName("Queue Export Button"); testRunner.Wait(2); testRunner.WaitForName("Export Item Window", 2); testRunner.ClickByName("Export as GCode Button", 2); testRunner.Wait(2); string gcodeOutputPath = MatterControlUtilities.PathToExportGcodeFolder; Directory.CreateDirectory(gcodeOutputPath); string fullPathToGcodeFile = Path.Combine(gcodeOutputPath, "Batman"); testRunner.Type(fullPathToGcodeFile); testRunner.Type("{Enter}"); testRunner.Wait(2); Console.WriteLine(gcodeOutputPath); Assert.IsTrue(File.Exists(fullPathToGcodeFile + ".gcode") == true); return Task.FromResult(0); }; await MatterControlUtilities.RunTest(testToRun); } } }
using System; using System.Diagnostics; using System.IO; using System.Threading; using System.Threading.Tasks; using MatterHackers.Agg.UI.Tests; using MatterHackers.GuiAutomation; using NUnit.Framework; namespace MatterHackers.MatterControl.Tests.Automation { [TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain] public class ExportItemsFromDownloads { [Test, Apartment(ApartmentState.STA), Category("FixNeeded" /* Not Finished */)] public async Task ExportAsGcode() { AutomationTest testToRun = (testRunner) => { testRunner.CloseSignInAndPrinterSelect(); MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD"); string firstItemName = "Row Item Batman"; //Navigate to Downloads Library Provider testRunner.ClickByName("Queue Tab"); testRunner.ClickByName("Queue Add Button", 2); //Get parts to add string rowItemPath = MatterControlUtilities.GetTestItemPath("Batman.stl"); //Add STL part items to Downloads and then type paths into file dialog testRunner.Wait(1); testRunner.Type(MatterControlUtilities.GetTestItemPath("Batman.stl")); testRunner.Wait(1); testRunner.Type("{Enter}"); //Get test results Assert.IsTrue(testRunner.WaitForName(firstItemName, 2) == true); testRunner.ClickByName("Queue Edit Button"); testRunner.ClickByName(firstItemName); testRunner.ClickByName("Queue Export Button"); testRunner.Wait(2); testRunner.WaitForName("Export Item Window", 2); testRunner.ClickByName("Export as GCode Button", 2); testRunner.Wait(2); string gcodeExportPath = MatterControlUtilities.PathToExportGcodeFolder; testRunner.Type(gcodeExportPath); testRunner.Type("{Enter}"); testRunner.Wait(2); Console.WriteLine(gcodeExportPath); Assert.IsTrue(File.Exists(gcodeExportPath) == true); return Task.FromResult(0); }; await MatterControlUtilities.RunTest(testToRun); } } }
bsd-2-clause
C#
b97c63de07571ebf641c119dee78780320627ca8
Use Uri's for subdocument file and photos
eggapauli/MyDocs,eggapauli/MyDocs
JsonNetDal/SubDocument.cs
JsonNetDal/SubDocument.cs
using MyDocs.Common; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Windows.Storage; using Logic = MyDocs.Common.Model.Logic; namespace JsonNetDal { public class SubDocument { public string Title { get; set; } public Uri File { get; set; } public List<Uri> Photos { get; set; } public SubDocument() { } public SubDocument(string title, Uri file, IEnumerable<Uri> photos) { Title = title; File = file; Photos = photos.ToList(); } public static SubDocument FromLogic(Logic.SubDocument subDocument) { return new SubDocument(subDocument.Title, subDocument.File.GetUri(), subDocument.Photos.Select(p => p.File.GetUri())); } public async Task<Logic.SubDocument> ToLogic() { var file = await StorageFile.GetFileFromApplicationUriAsync(File); var photoTasks = Photos .Select(StorageFile.GetFileFromApplicationUriAsync) .Select(x => x.AsTask()); var photos = await Task.WhenAll(photoTasks); return new Logic.SubDocument(file, photos.Select(p => new Logic.Photo(p))); } } }
using MyDocs.Common; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Windows.Storage; using Logic = MyDocs.Common.Model.Logic; namespace JsonNetDal { public class SubDocument { public string Title { get; set; } public string File { get; set; } public List<string> Photos { get; set; } public SubDocument() { } public SubDocument(string title, string file, IEnumerable<string> photos) { Title = title; File = file; Photos = photos.ToList(); } public static SubDocument FromLogic(Logic.SubDocument subDocument) { return new SubDocument(subDocument.Title, subDocument.File.GetUri().AbsoluteUri, subDocument.Photos.Select(p => p.File.GetUri().AbsoluteUri)); } public async Task<Logic.SubDocument> ToLogic() { var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(File)); var photoTasks = Photos .Select(p => new Uri(p)) .Select(StorageFile.GetFileFromApplicationUriAsync) .Select(x => x.AsTask()); var photos = await Task.WhenAll(photoTasks); return new Logic.SubDocument(file, photos.Select(p => new Logic.Photo(p))); } } }
mit
C#
2b1d536ec9d0f844c9ad4ee8ad0b8670f8fc044c
Fix major bug when getting event handlers
Elders/Cronus,Elders/Cronus
src/Cronus.Core/Eventing/InMemoryEventBus.cs
src/Cronus.Core/Eventing/InMemoryEventBus.cs
using System; using System.Collections.Generic; using System.Threading.Tasks; namespace Cronus.Core.Eventing { /// <summary> /// Represents an in memory event messaging destribution /// </summary> public class InMemoryEventBus : AbstractEventBus { /// <summary> /// Publishes the given event to all registered event handlers /// </summary> /// <param name="event">An event instance</param> public override bool Publish(IEvent @event) { onPublishEvent(@event); List<Func<IEvent, bool>> eventHandlers; if (handlers.TryGetValue(@event.GetType(), out eventHandlers)) { foreach (var handleMethod in eventHandlers) { var result = handleMethod(@event); if (result == false) return result; } } onEventPublished(@event); return true; } public override Task<bool> PublishAsync(IEvent @event) { return Threading.RunAsync(() => Publish(@event)); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Threading.Tasks; namespace Cronus.Core.Eventing { /// <summary> /// Represents an in memory event messaging destribution /// </summary> public class InMemoryEventBus : AbstractEventBus { /// <summary> /// Publishes the given event to all registered event handlers /// </summary> /// <param name="event">An event instance</param> public override bool Publish(IEvent @event) { onPublishEvent(@event); foreach (var handleMethod in handlers[@event.GetType()]) { var result = handleMethod(@event); if (result == false) return result; } onEventPublished(@event); return true; } public override Task<bool> PublishAsync(IEvent @event) { return Threading.RunAsync(() => Publish(@event)); } } }
apache-2.0
C#
90b6259d4ba70237b5a82593ab24850c4bd8041d
Fix ScriptRunner test
filipw/dotnet-script,filipw/dotnet-script
src/Dotnet.Script.Tests/ScriptRunnerTests.cs
src/Dotnet.Script.Tests/ScriptRunnerTests.cs
using System; using System.Collections.Generic; using Dotnet.Script.Core; using Dotnet.Script.DependencyModel.Runtime; using Dotnet.Script.Shared.Tests; using Moq; using Xunit; namespace Dotnet.Script.Tests { public class ScriptRunnerTests { [Fact] public void ResolveAssembly_ReturnsNull_WhenRuntimeDepsMapDoesNotContainAssembly() { var scriptRunner = CreateScriptRunner(); var result = scriptRunner.ResolveAssembly(new ResolveEventArgs("AnyAssemblyName"), new Dictionary<string, RuntimeAssembly>()); Assert.Null(result); } private ScriptRunner CreateScriptRunner() { var logFactory = TestOutputHelper.CreateTestLogFactory(); var scriptCompiler = new ScriptCompiler(logFactory, false); return new ScriptRunner(scriptCompiler, logFactory, ScriptConsole.Default); } } }
using System; using System.Collections.Generic; using Dotnet.Script.Core; using Dotnet.Script.DependencyModel.Runtime; using Dotnet.Script.Shared.Tests; using Moq; using Xunit; namespace Dotnet.Script.Tests { public class ScriptRunnerTests { [Fact] public void ResolveAssembly_ReturnsNull_WhenRuntimeDepsMapDoesNotContainAssembly() { var scriptRunner = CreateScriptRunner(); var result = scriptRunner.ResolveAssembly(new ResolveEventArgs(It.IsAny<string>()), new Dictionary<string, RuntimeAssembly>()); Assert.Null(result); } private ScriptRunner CreateScriptRunner() { var logFactory = TestOutputHelper.CreateTestLogFactory(); var scriptCompiler = new ScriptCompiler(logFactory, false); return new ScriptRunner(scriptCompiler, logFactory, ScriptConsole.Default); } } }
mit
C#
26a4084804b5cd27929a5960d13875c45cedfbc9
Update RobinManuelThiel.cs
planetxamarin/planetxamarin,stvansolano/planetxamarin,planetxamarin/planetxamarin,beraybentesen/planetxamarin,stvansolano/planetxamarin,beraybentesen/planetxamarin,beraybentesen/planetxamarin,planetxamarin/planetxamarin,MabroukENG/planetxamarin,MabroukENG/planetxamarin,planetxamarin/planetxamarin,MabroukENG/planetxamarin,stvansolano/planetxamarin
src/Firehose.Web/Authors/RobinManuelThiel.cs
src/Firehose.Web/Authors/RobinManuelThiel.cs
using Firehose.Web.Infrastructure; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.ServiceModel.Syndication; namespace Firehose.Web.Authors { public class RobinManuelThiel : IWorkAtXamarinOrMicrosoft, IFilterMyBlogPosts { public string FirstName => "Robin-Manuel"; public string LastName => "Thiel"; public string Title => "technical evangelist at Microsoft"; public string StateOrRegion => "Munich, Germany"; public string EmailAddress => string.Empty; public string TwitterHandle => "einRobby"; public Uri WebSite => new Uri("http://pumpingco.de/"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://pumpingco.de/feed/"); } } public string GravatarHash => "1b8fabaa8d66250a7049bdb9ecf44397"; public DateTime Started => new DateTime(2016, 1, 1); public bool Filter(SyndicationItem item) { return item.Title.Text.ToLowerInvariant().Contains("xamarin") || item.Categories.Where(i => i.Name.Equals("Xamarin", StringComparison.OrdinalIgnoreCase)).Any(); } } }
using Firehose.Web.Infrastructure; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.ServiceModel.Syndication; namespace Firehose.Web.Authors { public class RobinManuelThiel : IWorkAtXamarinOrMicrosoft, IFilterMyBlogPosts { public string FirstName => "Robin-Manuel"; public string LastName => "Thiel"; public string Title => "Technical Evangelist at Microsoft"; public string StateOrRegion => "Munich, Germany"; public string EmailAddress => string.Empty; public string TwitterHandle => "einRobby"; public Uri WebSite => new Uri("http://pumpingco.de/"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://pumpingco.de/feed/"); } } public string GravatarHash => "1b8fabaa8d66250a7049bdb9ecf44397"; public DateTime Started => new DateTime(2016, 1, 1); public bool Filter(SyndicationItem item) { return item.Title.Text.ToLowerInvariant().Contains("xamarin") || item.Categories.Where(i => i.Name.Equals("Xamarin", StringComparison.OrdinalIgnoreCase)).Any(); } } }
mit
C#
592513d9d65e05f4c8432e18851cfeeb7c04212f
Disable Button Logic
ApplETS/ETSMobile-WindowsPlatforms,ApplETS/ETSMobile-WindowsPlatforms
Ets.Mobile/Ets.Mobile.WindowsPhone/Content/Settings/Options.xaml.cs
Ets.Mobile/Ets.Mobile.WindowsPhone/Content/Settings/Options.xaml.cs
using Ets.Mobile.ViewModel.Contracts.Settings; using System; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; namespace Ets.Mobile.Content.Settings { public sealed partial class Options : UserControl { public Options() { InitializeComponent(); this.Events().DataContextChanged.Subscribe(args => { var options = args.NewValue as IOptionsViewModel; if (options != null) { options.HandleScheduleBackgroundService.IsExecuting.Subscribe(isExecuting => { ShowSchedule.IsEnabled = !isExecuting; LoadingShowScheduleChanged.Visibility = isExecuting ? Visibility.Visible : Visibility.Collapsed; }); options.IntegrateScheduleToCalendar.IsExecuting.Subscribe(isIntegrating => { RemoveScheduleFromCalendar.IsEnabled = !isIntegrating; }); options.RemoveScheduleFromCalendar.IsExecuting.Subscribe(isRemovingIntegration => { IntegrateScheduleToCalendar.IsEnabled = !isRemovingIntegration; }); } }); } } }
using Ets.Mobile.ViewModel.Contracts.Settings; using System; using System.Reactive.Linq; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; namespace Ets.Mobile.Content.Settings { public sealed partial class Options : UserControl { public Options() { InitializeComponent(); this.Events().DataContextChanged.Subscribe(args => { var options = args.NewValue as IOptionsViewModel; if (options != null) { options.HandleScheduleBackgroundService.IsExecuting.Subscribe(isExecuting => { ShowSchedule.IsEnabled = !isExecuting; LoadingShowScheduleChanged.Visibility = isExecuting ? Visibility.Visible : Visibility.Collapsed; }); } }); } } }
apache-2.0
C#
9e475cc107d9afd9f301518985dfdca6915d1600
Update RestRepositoryOptions.cs
tiksn/TIKSN-Framework
TIKSN.Core/Web/Rest/RestRepositoryOptions.cs
TIKSN.Core/Web/Rest/RestRepositoryOptions.cs
using System.Collections.Generic; using System.Text; namespace TIKSN.Web.Rest { public class RestRepositoryOptions<T> { public RestRepositoryOptions() { this.MediaType = "application/json"; this.Encoding = Encoding.UTF8; } public string ApiKey { get; set; } public string MediaType { get; set; } public RestAuthenticationType Authentication { get; set; } public Dictionary<double, string> AcceptLanguages { get; set; } public string ResourceTemplate { get; set; } public Encoding Encoding { get; set; } } }
using System; using System.Collections.Generic; using System.Text; namespace TIKSN.Web.Rest { public class RestRepositoryOptions<T> { public RestRepositoryOptions() { this.MediaType = "application/json"; this.Encoding = Encoding.UTF8; } public Guid ApiKey { get; set; } public string MediaType { get; set; } public RestAuthenticationType Authentication { get; set; } public Dictionary<double, string> AcceptLanguages { get; set; } public string ResourceTemplate { get; set; } public Encoding Encoding { get; set; } } }
mit
C#
820673c1d5201ef910becb7ae175734cdca00327
Make shouldhaveelement private
blorgbeard/pickles,picklesdoc/pickles,dirkrombauts/pickles,picklesdoc/pickles,blorgbeard/pickles,irfanah/pickles,irfanah/pickles,dirkrombauts/pickles,irfanah/pickles,ludwigjossieaux/pickles,dirkrombauts/pickles,dirkrombauts/pickles,picklesdoc/pickles,blorgbeard/pickles,magicmonty/pickles,ludwigjossieaux/pickles,blorgbeard/pickles,ludwigjossieaux/pickles,magicmonty/pickles,magicmonty/pickles,picklesdoc/pickles,irfanah/pickles,magicmonty/pickles
src/Pickles/Pickles.Test/AssertExtensions.cs
src/Pickles/Pickles.Test/AssertExtensions.cs
using System; using System.Linq; using System.Xml.Linq; using NFluent; using NFluent.Extensibility; using NUnit.Framework; using PicklesDoc.Pickles.Test.Extensions; namespace PicklesDoc.Pickles.Test { public static class AssertExtensions { public static void HasAttribute(this ICheck<XElement> check, string name, string value) { var actual = ExtensibilityHelper.ExtractChecker(check).Value; ShouldHaveAttribute(actual, name, value); } private static void ShouldHaveAttribute(this XElement element, string name, string value) { XAttribute xAttribute = element.Attributes().FirstOrDefault(attribute => attribute.Name.LocalName == name); Check.That(xAttribute).IsNotNull(); // ReSharper disable once PossibleNullReferenceException Check.That(xAttribute.Value).IsEqualTo(value); } public static void HasElement(this ICheck<XElement> check, string name) { var actual = ExtensibilityHelper.ExtractChecker(check).Value; ShouldHaveElement(actual, name); } private static void ShouldHaveElement(this XElement element, string name) { Check.That(element.HasElement(name)).IsTrue(); } public static void ShouldBeInInNamespace(this XElement element, string _namespace) { Check.That(element.Name.NamespaceName).IsEqualTo(_namespace); } public static void ShouldBeNamed(this XElement element, string name) { Check.That(element.Name.LocalName).IsEqualTo(name); } public static void ShouldDeepEquals(this XElement element, XElement other) { Assert.IsTrue( XNode.DeepEquals(element, other), "Expected:\r\n{0}\r\nActual:\r\n{1}\r\n", element, other); } } }
using System; using System.Linq; using System.Xml.Linq; using NFluent; using NFluent.Extensibility; using NUnit.Framework; using PicklesDoc.Pickles.Test.Extensions; namespace PicklesDoc.Pickles.Test { public static class AssertExtensions { public static void HasAttribute(this ICheck<XElement> check, string name, string value) { var actual = ExtensibilityHelper.ExtractChecker(check).Value; ShouldHaveAttribute(actual, name, value); } private static void ShouldHaveAttribute(this XElement element, string name, string value) { XAttribute xAttribute = element.Attributes().FirstOrDefault(attribute => attribute.Name.LocalName == name); Check.That(xAttribute).IsNotNull(); // ReSharper disable once PossibleNullReferenceException Check.That(xAttribute.Value).IsEqualTo(value); } public static void HasElement(this ICheck<XElement> check, string name) { var actual = ExtensibilityHelper.ExtractChecker(check).Value; ShouldHaveElement(actual, name); } public static void ShouldHaveElement(this XElement element, string name) { Check.That(element.HasElement(name)).IsTrue(); } public static void ShouldBeInInNamespace(this XElement element, string _namespace) { Check.That(element.Name.NamespaceName).IsEqualTo(_namespace); } public static void ShouldBeNamed(this XElement element, string name) { Check.That(element.Name.LocalName).IsEqualTo(name); } public static void ShouldDeepEquals(this XElement element, XElement other) { Assert.IsTrue( XNode.DeepEquals(element, other), "Expected:\r\n{0}\r\nActual:\r\n{1}\r\n", element, other); } } }
apache-2.0
C#
fe0ebb022f840c8c9a346892db4c31ac1584a16d
Change garbage values to sane arguments
ppy/osu-framework,peppy/osu-framework,ppy/osu-framework,peppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,smoogipooo/osu-framework
osu.Framework.Benchmarks/BenchmarkLocalisableString.cs
osu.Framework.Benchmarks/BenchmarkLocalisableString.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using BenchmarkDotNet.Attributes; using osu.Framework.Localisation; namespace osu.Framework.Benchmarks { [MemoryDiagnoser] public class BenchmarkLocalisableString { private string string1; private string string2; private LocalisableString localisableString1; private LocalisableString localisableString2; private LocalisableString romanisableString1; private LocalisableString romanisableString2; private LocalisableString translatableString1; private LocalisableString translatableString2; private LocalisableString formattableString1; private LocalisableString formattableString2; [GlobalSetup] public void GlobalSetup() { string1 = "a"; string2 = "b"; localisableString1 = "a"; localisableString2 = "b"; romanisableString1 = new RomanisableString("a", "b"); romanisableString2 = new RomanisableString("c", "d"); translatableString1 = new TranslatableString("e", "f"); translatableString2 = new TranslatableString("g", "h"); formattableString1 = new LocalisableFormattableString("({0})", new object[] { "j" }); formattableString2 = new LocalisableFormattableString("[{0}]", new object[] { "l" }); } [Benchmark] public bool BenchmarkStringEquals() => string1.Equals(string2, StringComparison.Ordinal); [Benchmark] public bool BenchmarkLocalisableStringEquals() => localisableString1.Equals(localisableString2); [Benchmark] public bool BenchmarkRomanisableEquals() => romanisableString1.Equals(romanisableString2); [Benchmark] public bool BenchmarkTranslatableEquals() => translatableString1.Equals(translatableString2); [Benchmark] public bool BenchmarkFormattableEquals() => formattableString1.Equals(formattableString2); [Benchmark] public int BenchmarkStringGetHashCode() => string1.GetHashCode(); [Benchmark] public int BenchmarkLocalisableStringGetHashCode() => localisableString1.GetHashCode(); [Benchmark] public int BenchmarkRomanisableGetHashCode() => romanisableString1.GetHashCode(); [Benchmark] public int BenchmarkTranslatableGetHashCode() => translatableString1.GetHashCode(); [Benchmark] public int BenchmarkFormattableGetHashCode() => formattableString1.GetHashCode(); } }
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using BenchmarkDotNet.Attributes; using osu.Framework.Localisation; namespace osu.Framework.Benchmarks { [MemoryDiagnoser] public class BenchmarkLocalisableString { private string string1; private string string2; private LocalisableString localisableString1; private LocalisableString localisableString2; private LocalisableString romanisableString1; private LocalisableString romanisableString2; private LocalisableString translatableString1; private LocalisableString translatableString2; private LocalisableString formattableString1; private LocalisableString formattableString2; [GlobalSetup] public void GlobalSetup() { string1 = "a"; string2 = "b"; localisableString1 = "a"; localisableString2 = "b"; romanisableString1 = new RomanisableString("a", "b"); romanisableString2 = new RomanisableString("c", "d"); translatableString1 = new TranslatableString("e", "f"); translatableString2 = new TranslatableString("g", "h"); formattableString1 = new LocalisableFormattableString("i", new object[] { "j" }); formattableString2 = new LocalisableFormattableString("k", new object[] { "l" }); } [Benchmark] public bool BenchmarkStringEquals() => string1.Equals(string2, StringComparison.Ordinal); [Benchmark] public bool BenchmarkLocalisableStringEquals() => localisableString1.Equals(localisableString2); [Benchmark] public bool BenchmarkRomanisableEquals() => romanisableString1.Equals(romanisableString2); [Benchmark] public bool BenchmarkTranslatableEquals() => translatableString1.Equals(translatableString2); [Benchmark] public bool BenchmarkFormattableEquals() => formattableString1.Equals(formattableString2); [Benchmark] public int BenchmarkStringGetHashCode() => string1.GetHashCode(); [Benchmark] public int BenchmarkLocalisableStringGetHashCode() => localisableString1.GetHashCode(); [Benchmark] public int BenchmarkRomanisableGetHashCode() => romanisableString1.GetHashCode(); [Benchmark] public int BenchmarkTranslatableGetHashCode() => translatableString1.GetHashCode(); [Benchmark] public int BenchmarkFormattableGetHashCode() => formattableString1.GetHashCode(); } }
mit
C#
beeb556c0c16131a8eee501f548b90f2df575c30
Set starting RoulettePocket
charvey/CasinoStrats
src/CasinoStrats.Core/RouletteRound.cs
src/CasinoStrats.Core/RouletteRound.cs
using System; using System.Collections.Generic; namespace CasinoStrats.Core { public class RouletteRound { private Dictionary<Tuple<Player, RouletteBet>, decimal> bets; private RoulettePocket pocket; public RouletteRound() { bets = new Dictionary<Tuple<Player, RouletteBet>, decimal>(); pocket = new UnspunRoulettePocket(); } public void PlaceBet(Player player, RouletteBet rouletteBet, decimal betAmount) { if (!player.TryDeduct(betAmount)) return; var key = Tuple.Create(player, rouletteBet); if (bets.ContainsKey(key)) bets[key] += betAmount; else bets[key] = betAmount; } public void SpinWheel() { throw new NotImplementedException(); } public void MakePayouts() { throw new NotImplementedException(); } } }
using System; using System.Collections.Generic; namespace CasinoStrats.Core { public class RouletteRound { private Dictionary<Tuple<Player, RouletteBet>, decimal> bets; private RoulettePocket pocket; public RouletteRound() { bets = new Dictionary<Tuple<Player, RouletteBet>, decimal>(); } public void PlaceBet(Player player, RouletteBet rouletteBet, decimal betAmount) { if (!player.TryDeduct(betAmount)) return; var key = Tuple.Create(player, rouletteBet); if (bets.ContainsKey(key)) bets[key] += betAmount; else bets[key] = betAmount; } public void SpinWheel() { throw new NotImplementedException(); } public void MakePayouts() { throw new NotImplementedException(); } } }
mit
C#
10a1557ba86a8b822e11ef1eec370ec3bd0ce75f
Remove goto statements from command line program
Ackara/Daterpillar
src/Daterpillar.CommandLine/Program.cs
src/Daterpillar.CommandLine/Program.cs
using Gigobyte.Daterpillar.Arguments; using Gigobyte.Daterpillar.Commands; using System; namespace Gigobyte.Daterpillar { public class Program { internal static void Main(string[] args) { InitializeWindow(); do { var commandLineOptions = new Options(); if (args.Length > 0) { CommandLine.Parser.Default.ParseArguments(args, commandLineOptions, onVerbCommand: (verb, arg) => { ICommand command = new CommandFactory().CrateInstance(verb); try { _exitCode = command.Execute(arg); } catch (Exception ex) { _exitCode = ExitCode.UnhandledException; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(ex); } finally { Console.ResetColor(); } }); break; } else { Console.WriteLine(commandLineOptions.GetHelp()); args = Console.ReadLine().Split(new char[] { ' ', '\t', '\n' }); } } while (true); Environment.Exit(_exitCode); } #region Private Members private static int _exitCode; private static void InitializeWindow() { Console.Title = $"{nameof(Daterpillar)} CLI"; } #endregion Private Members } }
using Gigobyte.Daterpillar.Arguments; using Gigobyte.Daterpillar.Commands; using System; namespace Gigobyte.Daterpillar { public class Program { internal static void Main(string[] args) { InitializeWindow(); start: var options = new Options(); if (args.Length > 0) { CommandLine.Parser.Default.ParseArguments(args, options, onVerbCommand: (verb, arg) => { ICommand command = new CommandFactory().CrateInstance(verb); try { _exitCode = command.Execute(arg); } catch (Exception ex) { _exitCode = ExitCode.UnhandledException; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(ex); } }); } else { Console.WriteLine(options.GetHelp()); args = Console.ReadLine().Split(new char[] { ' ', '\t', '\n' }); goto start; } Environment.Exit(_exitCode); } #region Private Members private static int _exitCode; private static void InitializeWindow() { Console.Title = $"{nameof(Daterpillar)} CLI"; } #endregion Private Members } }
mit
C#
35d59bb99709231bcb273c5c31671aeaeef29adc
Put the matrix multiplication in the correct order.
Weingartner/SolidworksAddinFramework
SolidworksAddinFramework/OpenGl/RenderableBase.cs
SolidworksAddinFramework/OpenGl/RenderableBase.cs
using System; using System.Collections.Generic; using System.DoubleNumerics; namespace SolidworksAddinFramework.OpenGl { public abstract class RenderableBase<T> : IRenderable { protected readonly T _Data; protected T _TransformedData; private Matrix4x4 _Transform = Matrix4x4.Identity; private Matrix4x4 _BaseTransform = Matrix4x4.Identity; protected Lazy<Tuple<Vector3, double>> _BoundingSphere; protected RenderableBase(T data) { _Data = data; _TransformedData = data; } protected void UpdateBoundingSphere(IReadOnlyList<Vector3> points) { _BoundingSphere = new Lazy<Tuple<Vector3, double>>(()=> CalcBoundingSphere(points)); } protected void UpdateBoundingSphere(Func<Tuple<Vector3, double>> sphere) { _BoundingSphere = new Lazy<Tuple<Vector3, double>>(sphere); } private Tuple<Vector3, double> CalcBoundingSphere(IReadOnlyList<Vector3> points) { return Renderable.BoundingSphere(points); } public void Render(DateTime time) { DoRender(_TransformedData, time); _BoundingSphere = new Lazy<Tuple<Vector3, double>>(()=> UpdateBoundingSphere(_TransformedData, time)); } public void ApplyTransform(Matrix4x4 transform, bool accumulate = false) { if (accumulate == false) { _Transform = transform; } else { _BaseTransform = _BaseTransform*transform; _Transform = Matrix4x4.Identity; } transform = this._BaseTransform*_Transform; _TransformedData = DoTransform(_Data, transform); } protected abstract T DoTransform(T data, Matrix4x4 transform); protected abstract void DoRender(T data, DateTime time); protected abstract Tuple<Vector3, double> UpdateBoundingSphere(T data, DateTime time); public Tuple<Vector3, double> BoundingSphere => _BoundingSphere.Value; } }
using System; using System.Collections.Generic; using System.DoubleNumerics; namespace SolidworksAddinFramework.OpenGl { public abstract class RenderableBase<T> : IRenderable { protected readonly T _Data; protected T _TransformedData; private Matrix4x4 _Transform = Matrix4x4.Identity; private Matrix4x4 _BaseTransform = Matrix4x4.Identity; protected Lazy<Tuple<Vector3, double>> _BoundingSphere; protected RenderableBase(T data) { _Data = data; _TransformedData = data; } protected void UpdateBoundingSphere(IReadOnlyList<Vector3> points) { _BoundingSphere = new Lazy<Tuple<Vector3, double>>(()=> CalcBoundingSphere(points)); } protected void UpdateBoundingSphere(Func<Tuple<Vector3, double>> sphere) { _BoundingSphere = new Lazy<Tuple<Vector3, double>>(sphere); } private Tuple<Vector3, double> CalcBoundingSphere(IReadOnlyList<Vector3> points) { return Renderable.BoundingSphere(points); } public void Render(DateTime time) { DoRender(_TransformedData, time); _BoundingSphere = new Lazy<Tuple<Vector3, double>>(()=> UpdateBoundingSphere(_TransformedData, time)); } public void ApplyTransform(Matrix4x4 transform, bool accumulate = false) { if (accumulate == false) { _Transform = transform; } else { _BaseTransform = transform*_BaseTransform; _Transform = Matrix4x4.Identity; } transform = _Transform*_BaseTransform; _TransformedData = DoTransform(_Data, transform); } protected abstract T DoTransform(T data, Matrix4x4 transform); protected abstract void DoRender(T data, DateTime time); protected abstract Tuple<Vector3, double> UpdateBoundingSphere(T data, DateTime time); public Tuple<Vector3, double> BoundingSphere => _BoundingSphere.Value; } }
mit
C#
da29ff480849150d9fc20d90e4b5ef485f04eb27
Load csproj with xml- tmp workaround for roslyn bug
tzachshabtay/MonoAGS
Source/Editor/AGS.Editor.Desktop/DotnetProject.cs
Source/Editor/AGS.Editor.Desktop/DotnetProject.cs
using System; using System.Collections.Immutable; using System.Diagnostics; using System.IO; using System.Linq; using System.Threading.Tasks; using System.Xml; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.MSBuild; namespace AGS.Editor.Desktop { public class DotnetProject : IDotnetProject { //private Project _project; //public string OutputFilePath => _project.OutputFilePath; public string OutputFilePath { get; private set; } public async Task Load(string path) { //todo: tmp workaround for roslyn bug- https://github.com/dotnet/roslyn/issues/20848 await loadProjXml(path); /*MSBuildPath.Setup(); var workspace = MSBuildWorkspace.Create(); workspace.WorkspaceFailed += onWorkspaceFailed; _project = await workspace.OpenProjectAsync(path);*/ } private async Task loadProjXml(string path) { await Task.Delay(1); XmlDocument doc = new XmlDocument(); doc.Load(path); XmlNamespaceManager mgr = new XmlNamespaceManager(doc.NameTable); mgr.AddNamespace("foo", doc.DocumentElement.NamespaceURI); XmlNode firstOutputType = doc.SelectSingleNode("//foo:OutputType", mgr); XmlNode firstOutputPath = doc.SelectSingleNode("//foo:OutputPath", mgr); XmlNode firstAssemblyName = doc.SelectSingleNode("//foo:AssemblyName", mgr); string fileExtension = firstOutputType.InnerText == "Exe" ? "exe" : "dll"; string folder = Path.Combine(Directory.GetCurrentDirectory(), firstOutputPath.InnerText.Replace("\\", Path.DirectorySeparatorChar.ToString())); OutputFilePath = Path.Combine(folder, $"{firstAssemblyName.InnerText}.{fileExtension}"); } public async Task<string> Compile() { await Task.Delay(1); return "Compilation currently not supported"; /*var compilation = await _project.GetCompilationAsync(); var emitResult = compilation.Emit(OutputFilePath); if (emitResult.Success) return null; return string.Join(Environment.NewLine, emitResult.Diagnostics .Where(d => d.Severity == DiagnosticSeverity.Error || d.Severity == DiagnosticSeverity.Warning) .Select(d => d.GetMessage()));*/ } private void onWorkspaceFailed(object sender, WorkspaceDiagnosticEventArgs e) { Debug.WriteLine($"Workspace failed: {e.Diagnostic.ToString()}"); } } }
using System; using System.Collections.Immutable; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.MSBuild; namespace AGS.Editor.Desktop { public class DotnetProject : IDotnetProject { private Project _project; public string OutputFilePath => _project.OutputFilePath; public async Task Load(string path) { MSBuildPath.Setup(); var workspace = MSBuildWorkspace.Create(); workspace.WorkspaceFailed += onWorkspaceFailed; _project = await workspace.OpenProjectAsync(path); } public async Task<string> Compile() { var compilation = await _project.GetCompilationAsync(); var emitResult = compilation.Emit(OutputFilePath); if (emitResult.Success) return null; return string.Join(Environment.NewLine, emitResult.Diagnostics .Where(d => d.Severity == DiagnosticSeverity.Error || d.Severity == DiagnosticSeverity.Warning) .Select(d => d.GetMessage())); } private void onWorkspaceFailed(object sender, WorkspaceDiagnosticEventArgs e) { Debug.WriteLine($"Workspace failed: {e.Diagnostic.ToString()}"); } } }
artistic-2.0
C#
84e9227beabef5eff74bd18b4c9b0322f62c1c9b
Update Demo
sunkaixuan/SqlSugar
Src/Asp.Net/SqlServerTest/Demo/DemoE_CodeFirst.cs
Src/Asp.Net/SqlServerTest/Demo/DemoE_CodeFirst.cs
using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace OrmTest { public class DemoE_CodeFirst { public static void Init() { Console.WriteLine(""); Console.WriteLine("#### CodeFirst Start ####"); SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { DbType = DbType.SqlServer, ConnectionString = Config.ConnectionString, InitKeyType = InitKeyType.Attribute, IsAutoCloseConnection = true }); db.CodeFirst.InitTables(typeof(CodeFirstTable1));//Create CodeFirstTable1 Console.WriteLine("#### CodeFirst end ####"); } } public class CodeFirstTable1 { [SugarColumn(IsIdentity = true, IsPrimaryKey = true)] public int Id { get; set; } public string Name { get; set; } [SugarColumn(ColumnDataType = "Nvarchar(255)")]//custom public string Text { get; set; } [SugarColumn(IsNullable = true)] public DateTime CreateTime { get; set; } } }
using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace OrmTest { public class DemoE_CodeFirst { public static void Init() { SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { DbType = DbType.SqlServer, ConnectionString = Config.ConnectionString, InitKeyType = InitKeyType.Attribute, IsAutoCloseConnection = true }); db.CodeFirst.InitTables(typeof(CodeFirstTable1));//Create CodeFirstTable1 } } public class CodeFirstTable1 { [SugarColumn(IsIdentity = true, IsPrimaryKey = true)] public int Id { get; set; } public string Name { get; set; } [SugarColumn(ColumnDataType = "Nvarchar(255)")]//custom public string Text { get; set; } [SugarColumn(IsNullable = true)] public DateTime CreateTime { get; set; } } }
apache-2.0
C#
59651be3bb33fbe9f6e3d9b8c5b1ca234749e761
Update Barbados
tinohager/Nager.Date,tinohager/Nager.Date,tinohager/Nager.Date
Src/Nager.Date/PublicHolidays/BarbadosProvider.cs
Src/Nager.Date/PublicHolidays/BarbadosProvider.cs
using Nager.Date.Model; using System; using System.Collections.Generic; using System.Linq; namespace Nager.Date.PublicHolidays { public class BarbadosProvider : CatholicBaseProvider { public override IEnumerable<PublicHoliday> Get(int year) { //Barbados //https://en.wikipedia.org/wiki/Public_holidays_in_Barbados var countryCode = CountryCode.BB; var easterSunday = base.EasterSunday(year); var firstMondayInAugust = DateSystem.FindDay(year, 8, DayOfWeek.Monday, 1); var items = new List<PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "New Year's Day", "New Year's Day", countryCode)); items.Add(new PublicHoliday(year, 1, 21, "Errol Barrow Day", "Errol Barrow Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Good Friday", "Good Friday", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Easter Monday", "Easter Monday", countryCode)); items.Add(new PublicHoliday(year, 4, 28, "National Heroes' Day", "National Heroes' Day", countryCode)); items.Add(new PublicHoliday(year, 5, 1, "Labour Day", "Labour Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(50), "Whit Monday", "Whit Monday", countryCode)); items.Add(new PublicHoliday(year, 8, 1, "Emancipation Day", "Emancipation Day", countryCode)); items.Add(new PublicHoliday(firstMondayInAugust, "Kadooment Day", "Kadooment Day", countryCode)); items.Add(new PublicHoliday(year, 11, 30, "Independence Day", "Independence Day", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Christmas Day", "Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 12, 26, "Boxing Day", "Boxing Day", countryCode)); return items.OrderBy(o => o.Date); } } }
using Nager.Date.Model; using System; using System.Collections.Generic; using System.Linq; namespace Nager.Date.PublicHolidays { public class BarbadosProvider : CatholicBaseProvider { public override IEnumerable<PublicHoliday> Get(int year) { //Barbados //https://en.wikipedia.org/wiki/Public_holidays_in_Barbados var countryCode = CountryCode.BB; var easterSunday = base.EasterSunday(year); var firstMondayInAugust = DateSystem.FindDay(year, 8, DayOfWeek.Monday, 3); var items = new List<PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "New Year's Day", "New Year's Day", countryCode)); items.Add(new PublicHoliday(year, 1, 21, "Errol Barrow Day", "Errol Barrow Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Good Friday", "Good Friday", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Easter Monday", "Easter Monday", countryCode)); items.Add(new PublicHoliday(year, 4, 28, "National Heroes' Day", "National Heroes' Day", countryCode)); items.Add(new PublicHoliday(year, 5, 1, "Labour Day", "Labour Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(50), "Whit Monday", "Whit Monday", countryCode)); items.Add(new PublicHoliday(year, 8, 1, "Emancipation Day", "Emancipation Day", countryCode)); items.Add(new PublicHoliday(firstMondayInAugust, "Kadooment Day", "Kadooment Day", countryCode)); items.Add(new PublicHoliday(year, 11, 30, "Independence Day", "Independence Day", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Christmas Day", "Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 12, 26, "Boxing Day", "Boxing Day", countryCode)); return items.OrderBy(o => o.Date); } } }
mit
C#
de71ad79ddc0978e0ea7cbb277755a6367b8f56e
Remove obsolete comment
GitTools/GitLink,AArnott/PdbGit,ShaiNahum/GitLink
src/GitLink/Properties/AssemblyInfo.cs
src/GitLink/Properties/AssemblyInfo.cs
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="AssemblyInfo.cs" company="CatenaLogic"> // Copyright (c) 2014 - 2014 CatenaLogic. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("GitLink")] [assembly: AssemblyProduct("GitLink")] [assembly: AssemblyDescription("GitLink library")] // 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. #if !PCL [assembly: ComVisible(false)] #endif
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="AssemblyInfo.cs" company="CatenaLogic"> // Copyright (c) 2014 - 2014 CatenaLogic. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System.Reflection; using System.Runtime.InteropServices; // All other assembly info is defined in SharedAssembly.cs [assembly: AssemblyTitle("GitLink")] [assembly: AssemblyProduct("GitLink")] [assembly: AssemblyDescription("GitLink library")] // 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. #if !PCL [assembly: ComVisible(false)] #endif
mit
C#
bfecc60644715063a68d7115b3864eef4c92dcf6
Add Contentpropertyattribute for xamarin forms
thomasgalliker/ValueConverters.NET
ValueConverters.Shared/StringToObjectConverter.cs
ValueConverters.Shared/StringToObjectConverter.cs
using System; using System.Globalization; #if (NETFX || WINDOWS_PHONE) using System.Windows; using System.Windows.Markup; #elif (NETFX_CORE) using Windows.UI.Xaml; using Windows.UI.Xaml.Markup; #elif (XAMARIN) using Xamarin.Forms; #endif namespace ValueConverters { /// <summary> /// StringToObjectConverter can be used to select different resources based on given string name. /// This can be particularly useful if a string key needs to represent an image on the user interface. /// /// Use the Items property to create a ResourceDictionary which contains object-to-string-name mappings. /// /// Check out following example: /// <example> /// <ResourceDictionary> /// <BitmapImage x:Key="Off" UriSource="/Resources/Images/stop.png" /> /// <BitmapImage x:Key="On" UriSource="/Resources/Images/play.png" /> /// <BitmapImage x:Key="Maybe" UriSource="/Resources/Images/pause.png" /> /// </ResourceDictionary> /// </example> /// Source: http://stackoverflow.com/questions/2787725/how-to-display-different-enum-icons-using-xaml-only /// </summary> #if (NETFX || XAMARIN || WINDOWS_PHONE) [ContentProperty(nameof(Items))] #elif (NETFX_CORE) [ContentProperty(Name = nameof(Items))] #endif public class StringToObjectConverter : SingletonConverterBase<StringToObjectConverter> { public ResourceDictionary Items { get; set; } protected override object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var key = value as string; if (key != null) { if (this.Items != null && ContainsKey(this.Items, key)) { return this.Items[key]; } } return UnsetValue; } #if (NETFX || WINDOWS_PHONE) private static bool ContainsKey(ResourceDictionary dict, string key) { return dict.Contains(key); } #elif (NETFX_CORE || XAMARIN) private static bool ContainsKey(ResourceDictionary dict, string key) { return dict.ContainsKey(key); } #endif } }
using System; using System.Globalization; #if (NETFX || WINDOWS_PHONE) using System.Windows; using System.Windows.Markup; #elif (NETFX_CORE) using Windows.UI.Xaml; using Windows.UI.Xaml.Markup; #elif (XAMARIN) using Xamarin.Forms; #endif namespace ValueConverters { /// <summary> /// StringToObjectConverter can be used to select different resources based on given string name. /// This can be particularly useful if a string key needs to represent an image on the user interface. /// /// Use the Items property to create a ResourceDictionary which contains object-to-string-name mappings. /// /// Check out following example: /// <example> /// <ResourceDictionary> /// <BitmapImage x:Key="Off" UriSource="/Resources/Images/stop.png" /> /// <BitmapImage x:Key="On" UriSource="/Resources/Images/play.png" /> /// <BitmapImage x:Key="Maybe" UriSource="/Resources/Images/pause.png" /> /// </ResourceDictionary> /// </example> /// Source: http://stackoverflow.com/questions/2787725/how-to-display-different-enum-icons-using-xaml-only /// </summary> #if (NETFX || WINDOWS_PHONE) [ContentProperty("Items")] #elif (NETFX_CORE) [ContentProperty(Name = "Items")] #endif public class StringToObjectConverter : SingletonConverterBase<StringToObjectConverter> { public ResourceDictionary Items { get; set; } protected override object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var key = value as string; if (key != null) { if (this.Items != null && ContainsKey(this.Items, key)) { return this.Items[key]; } } return UnsetValue; } #if (NETFX || WINDOWS_PHONE) private static bool ContainsKey(ResourceDictionary dict, string key) { return dict.Contains(key); } #elif (NETFX_CORE || XAMARIN) private static bool ContainsKey(ResourceDictionary dict, string key) { return dict.ContainsKey(key); } #endif } }
mit
C#
3685b1ef79ed8f2f492ca7dc29b777f20bf7c77e
fix serialization warning from code analysis tool
edyoung/prequel
Prequel/UsageException.cs
Prequel/UsageException.cs
using System; using System.Runtime.Serialization; namespace Prequel { [Serializable] public class UsageException : Exception, ISerializable { public UsageException() { ExitCode = 1; } public UsageException(string message) : base(message) { ExitCode = 1; } public UsageException(string message, Exception innerException) : base(message, innerException) { ExitCode = 1; } protected UsageException(SerializationInfo info, StreamingContext context) : base(info, context) { ExitCode = 1; } public override void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("ExitCode", ExitCode); base.GetObjectData(info, context); } void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) throw new ArgumentNullException("info"); GetObjectData(info, context); } public int ExitCode { get; set; } } }
using System; using System.Runtime.Serialization; namespace Prequel { [Serializable] public class UsageException : Exception { public UsageException() { ExitCode = 1; } public UsageException(string message) : base(message) { ExitCode = 1; } public UsageException(string message, Exception innerException) : base(message, innerException) { ExitCode = 1; } protected UsageException(SerializationInfo info, StreamingContext context) : base(info, context) { ExitCode = 1; } public int ExitCode { get; set; } } }
mit
C#
ebbb481fea06ca57b8bf16069ac0052272aa2c3c
Print hello world for k10 project.
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
samples/MvcSample/Program.cs
samples/MvcSample/Program.cs
using System; #if NET45 using Microsoft.Owin.Hosting; #endif namespace MvcSample { public class Program { const string baseUrl = "http://localhost:9001/"; public static void Main() { #if NET45 using (WebApp.Start<Startup>(new StartOptions(baseUrl))) { Console.WriteLine("Listening at {0}", baseUrl); Console.WriteLine("Press any key to exit"); Console.ReadKey(); } #else Console.WriteLine("Hello World"); #endif } } }
#if NET45 using System; using Microsoft.Owin.Hosting; namespace MvcSample { public class Program { const string baseUrl = "http://localhost:9001/"; public static void Main() { using (WebApp.Start<Startup>(new StartOptions(baseUrl))) { Console.WriteLine("Listening at {0}", baseUrl); Console.WriteLine("Press any key to exit"); Console.ReadKey(); } } } } #endif
apache-2.0
C#
d903b1d4c93cea12e2d1d69f0c6b8d16eb975472
Add dummy commit
michael-reichenauer/GitMind
GitMind/GitModel/Branch.cs
GitMind/GitModel/Branch.cs
using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; namespace GitMind.GitModel { // A Branch internal class Branch { private readonly Repository repository; private readonly string tipCommitId; private readonly string firstCommitId; private readonly string parentCommitId; private readonly IReadOnlyList<string> commitIds; private readonly string parentBranchId; public Branch( Repository repository, string id, string name, string tipCommitId, string firstCommitId, string parentCommitId, IReadOnlyList<string> commitIds, string parentBranchId, IReadOnlyList<string> childBranchNames, bool isActive, bool isMultiBranch, int localAheadCount, int remoteAheadCount) { this.repository = repository; this.tipCommitId = tipCommitId; this.firstCommitId = firstCommitId; this.parentCommitId = parentCommitId; this.commitIds = commitIds; this.parentBranchId = parentBranchId; Id = id; Name = name; ChildBranchNames = childBranchNames; IsActive = isActive; IsMultiBranch = isMultiBranch; LocalAheadCount = localAheadCount; RemoteAheadCount = remoteAheadCount; } public string Id { get; } public string Name { get; } public IReadOnlyList<string> ChildBranchNames { get; } public bool IsActive { get; } public bool IsMultiBranch { get; } public int LocalAheadCount { get; } public int RemoteAheadCount { get; } public Commit TipCommit => repository.Commits[tipCommitId]; public Commit FirstCommit => repository.Commits[firstCommitId]; public Commit ParentCommit => repository.Commits[parentCommitId]; public IEnumerable<Commit> Commits => commitIds.Select(id => repository.Commits[id]); public bool HasParentBranch => parentBranchId != null; public Branch ParentBranch => repository.Branches[parentBranchId]; public bool IsCurrentBranch => repository.CurrentBranch == this; public bool IsMergeable => IsCurrentBranch && repository.Status.ConflictCount == 0 && repository.Status.StatusCount == 0; public IEnumerable<Branch> GetChildBranches() { foreach (Branch branch in repository.Branches .Where(b => b.HasParentBranch && b.ParentBranch == this) .Distinct() .OrderByDescending(b => b.ParentCommit.CommitDate)) { yield return branch; } } public IEnumerable<Branch> Parents() { Branch current = this; while (current.HasParentBranch) { current = current.ParentBranch; yield return current; } } public override string ToString() => Name; } }
using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; namespace GitMind.GitModel { internal class Branch { private readonly Repository repository; private readonly string tipCommitId; private readonly string firstCommitId; private readonly string parentCommitId; private readonly IReadOnlyList<string> commitIds; private readonly string parentBranchId; public Branch( Repository repository, string id, string name, string tipCommitId, string firstCommitId, string parentCommitId, IReadOnlyList<string> commitIds, string parentBranchId, IReadOnlyList<string> childBranchNames, bool isActive, bool isMultiBranch, int localAheadCount, int remoteAheadCount) { this.repository = repository; this.tipCommitId = tipCommitId; this.firstCommitId = firstCommitId; this.parentCommitId = parentCommitId; this.commitIds = commitIds; this.parentBranchId = parentBranchId; Id = id; Name = name; ChildBranchNames = childBranchNames; IsActive = isActive; IsMultiBranch = isMultiBranch; LocalAheadCount = localAheadCount; RemoteAheadCount = remoteAheadCount; } public string Id { get; } public string Name { get; } public IReadOnlyList<string> ChildBranchNames { get; } public bool IsActive { get; } public bool IsMultiBranch { get; } public int LocalAheadCount { get; } public int RemoteAheadCount { get; } public Commit TipCommit => repository.Commits[tipCommitId]; public Commit FirstCommit => repository.Commits[firstCommitId]; public Commit ParentCommit => repository.Commits[parentCommitId]; public IEnumerable<Commit> Commits => commitIds.Select(id => repository.Commits[id]); public bool HasParentBranch => parentBranchId != null; public Branch ParentBranch => repository.Branches[parentBranchId]; public bool IsCurrentBranch => repository.CurrentBranch == this; public bool IsMergeable => IsCurrentBranch && repository.Status.ConflictCount == 0 && repository.Status.StatusCount == 0; public IEnumerable<Branch> GetChildBranches() { foreach (Branch branch in repository.Branches .Where(b => b.HasParentBranch && b.ParentBranch == this) .Distinct() .OrderByDescending(b => b.ParentCommit.CommitDate)) { yield return branch; } } public IEnumerable<Branch> Parents() { Branch current = this; while (current.HasParentBranch) { current = current.ParentBranch; yield return current; } } public override string ToString() => Name; } }
mit
C#
303a9017a865060ad0bc208efb443ea5632680cf
Clean code
polvila/JS_test,polvila/JS_test,polvila/JS_test
Assets/TestScript.cs
Assets/TestScript.cs
using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using UnityEngine; using UnityEngine.UI; public class TestScript : MonoBehaviour { [DllImport("__Internal")] private static extern void OpenRechargePopup(); public Button btn; public Text txt; // Use this for initialization void Start () { btn.onClick.AddListener(() => OnClickEnter()); } private void OnClickEnter() { Debug.Log("OnClickEnter"); OpenRechargePopup(); } private void FillText() { txt.text = "Well done!"; } // Update is called once per frame void Update () { } }
using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using UnityEngine; using UnityEngine.UI; public class TestScript : MonoBehaviour { [DllImport("__Internal")] private static extern void OpenRechargePopup(); public Button btn; public Text txt; // Use this for initialization void Start () { btn.onClick.AddListener(() => OnClickEnter()); } private void OnClickEnter() { Debug.Log("OnClickEnter"); OpenRechargePopup(); //Application.ExternalCall("OpenRechargePopup"); } private void FillText() { txt.text = "Well done!"; } // Update is called once per frame void Update () { } }
mit
C#
d5029e593ebe831788bfc3de1ee70792aad8ad62
Fix #1
uheerme/core,uheerme/core,uheerme/core
Samesound.Core/Channel.cs
Samesound.Core/Channel.cs
using Samesound.Core.Interfaces; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Samesound.Core { public class Channel : IDateTrackable { public Channel() { Musics = new List<Music>(); } [Key] public int Id { get; set; } [Required] public string Name { get; set; } [Required] public string Owner { get; set; } public string NetworkIdentifier { get; set; } public virtual ICollection<Music> Musics { get; set; } [ForeignKey("Playing")] public int? MusicId { get; set; } public virtual Music Playing { get; set; } public DateTime DateCreated { get; set; } public DateTime? DateUpdated { get; set; } } }
using Samesound.Core.Interfaces; using System; using System.ComponentModel.DataAnnotations; namespace Samesound.Core { public class Channel : IDateTrackable { [Key] public int Id { get; set; } [Required] public string Name { get; set; } [Required] public string Owner { get; set; } public DateTime DateCreated { get; set; } public DateTime? DateUpdated { get; set; } } }
mit
C#
a30f872792c87bf0eaf47a20dc73bd40cfc748cd
Use MongoDB C# conventions to map object attributes
peterblazejewicz/asp5-mvc6-examples,peterblazejewicz/asp5-mvc6-examples,peterblazejewicz/asp5-mvc6-examples,peterblazejewicz/asp5-mvc6-examples
MongoMvc/Models/Speaker.cs
MongoMvc/Models/Speaker.cs
using MongoDB.Bson; using System; namespace MongoMvc.Models { public class Speaker { public ObjectId Id { get; set; } public string Blog { get; set; } public string First { get; set; } public string Last { get; set; } public string Title { get; set; } public string Twitter { get; set; } } }
using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using System; namespace MongoMvc.Models { public class Speaker { public ObjectId Id { get; set; } [BsonElement("blog")] public string Blog { get; set; } [BsonElement("first")] public string First { get; set; } [BsonElement("last")] public string Last { get; set; } [BsonElement("title")] public string Title { get; set; } [BsonElement("twitter")] public string Twitter { get; set; } } }
mit
C#
59c2eabb9e2a2ce90a61e3e00a078ed6851bd8e7
Update ANDGate.cs
irtezasyed007/CSC523-Game-Project
Gates/ANDGate.cs
Gates/ANDGate.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CSC_523_Game { class ANDGate : Gate { public ANDGate(Variable [] vars) : base(vars) { } public override bool getResult() { bool assignedValue = false; bool result = false; foreach (Variable v in Variables) { if (!assignedValue) { result = v.getTruthValue(); assignedValue = true; } else result = result && v.getTruthValue(); } return result; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CSC_523_Game { class ANDGate : Gate { public ANDGate(Variable [] vars) : base(vars) { } public override bool getResult() { bool result = false; foreach(Variable v in vars) { result = result && v.getTruthValue(); } return result; } } }
mit
C#
c2fec2ec0dd4756f08b0dbc86b0d839f7c4a117b
Add params to OpenApiBodyParameterAttribute
quails4Eva/NSwag,RSuter/NSwag,quails4Eva/NSwag,RSuter/NSwag,RSuter/NSwag,RSuter/NSwag,RSuter/NSwag,quails4Eva/NSwag,quails4Eva/NSwag
src/NSwag.Annotations/OpenApiBodyParameterAttribute.cs
src/NSwag.Annotations/OpenApiBodyParameterAttribute.cs
//----------------------------------------------------------------------- // <copyright file="OpenApiBodyParameterAttribute.cs" company="NSwag"> // Copyright (c) Rico Suter. All rights reserved. // </copyright> // <license>https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md</license> // <author>Rico Suter, [email protected]</author> //----------------------------------------------------------------------- using System; namespace NSwag.Annotations { /// <summary>Specifies that the operation consumes the POST body.</summary> [AttributeUsage(AttributeTargets.Method)] public class OpenApiBodyParameterAttribute : Attribute { /// <summary>Initializes a new instance of the <see cref="OpenApiBodyParameterAttribute"/> class with the 'application/json' mime type.</summary> public OpenApiBodyParameterAttribute() { MimeTypes = new[] { "application/json" }; } /// <summary>Initializes a new instance of the <see cref="OpenApiBodyParameterAttribute"/> class.</summary> /// <param name="mimeTypes">The expected mime types.</param> public OpenApiBodyParameterAttribute(string[] mimeTypes) { MimeTypes = mimeTypes; } /// <summary> /// Gets the expected body mime type. /// </summary> public string[] MimeTypes { get; } } }
//----------------------------------------------------------------------- // <copyright file="OpenApiBodyParameterAttribute.cs" company="NSwag"> // Copyright (c) Rico Suter. All rights reserved. // </copyright> // <license>https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md</license> // <author>Rico Suter, [email protected]</author> //----------------------------------------------------------------------- using System; namespace NSwag.Annotations { /// <summary>Specifies that the operation consumes the POST body.</summary> [AttributeUsage(AttributeTargets.Method)] public class OpenApiBodyParameterAttribute : Attribute { /// <summary>Initializes a new instance of the <see cref="OpenApiBodyParameterAttribute"/> class.</summary> public OpenApiBodyParameterAttribute() { MimeTypes = new[] { "application/json" }; } /// <summary>Initializes a new instance of the <see cref="OpenApiBodyParameterAttribute"/> class.</summary> /// <param name="mimeTypes">The expected mime types.</param> public OpenApiBodyParameterAttribute(params string[] mimeTypes) { MimeTypes = mimeTypes; } /// <summary> /// Gets the expected body mime type. /// </summary> public string[] MimeTypes { get; } } }
mit
C#
6647930968f8f664dd2e677e3175a4c53c2073b6
Bump version
o11c/WebMConverter,Yuisbean/WebMConverter,nixxquality/WebMConverter
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("WebM for Retards")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WebM for Retards")] [assembly: AssemblyCopyright("Copyright © 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("88d1c5f0-e3e0-445a-8e11-a02441ab6ca8")] // 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.16.1")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("WebM for Retards")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WebM for Retards")] [assembly: AssemblyCopyright("Copyright © 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("88d1c5f0-e3e0-445a-8e11-a02441ab6ca8")] // 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.16.0")]
mit
C#
1e8f00642df43b4915870f71cd01c4ac35df4546
Bump version
Naxiz/TeleBotDotNet,LouisMT/TeleBotDotNet
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TeleBotDotNet")] [assembly: AssemblyDescription("Telegram Bot API wrapper for .NET")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("U5R")] [assembly: AssemblyProduct("TeleBotDotNet")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("bdc2c81d-c3e9-40b1-8b21-69796411ad56")] // 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("2015.12.29.1")] [assembly: AssemblyFileVersion("2015.12.29.1")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TeleBotDotNet")] [assembly: AssemblyDescription("Telegram Bot API wrapper for .NET")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("U5R")] [assembly: AssemblyProduct("TeleBotDotNet")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("bdc2c81d-c3e9-40b1-8b21-69796411ad56")] // 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("2015.10.18.1")] [assembly: AssemblyFileVersion("2015.10.18.1")]
mit
C#
70afc72406cc5831bd84b8feaecfdc5d0f1fc379
upgrade version
ezaurum/dapper
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("dapper extention")] [assembly: AssemblyDescription("dapper auto generated repository extension")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Ezaurum")] [assembly: AssemblyProduct("dapper extention")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("c3a998b9-1a09-4589-9e91-481383acb2ec")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.1.16")] [assembly: AssemblyFileVersion("0.0.1.16")]
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("dapper extention")] [assembly: AssemblyDescription("dapper auto generated repository extension")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Ezaurum")] [assembly: AssemblyProduct("dapper extention")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("c3a998b9-1a09-4589-9e91-481383acb2ec")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.1.15")] [assembly: AssemblyFileVersion("0.0.1.15")]
mit
C#
1d4d396abe95cb2f10c8a6dc54d1c45f64341d9d
Change release version number to 1.2.0.0
GLotsapot/HellionSaveEditor
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("HellionSaveEditor")] [assembly: AssemblyDescription("Edits health and resources in Hellion Save Games")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Necrosoft")] [assembly: AssemblyProduct("HellionSaveEditor")] [assembly: AssemblyCopyright("Copyright Necrosoft© 2017")] [assembly: AssemblyTrademark("Written by GLotsapot")] [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("30d0ae60-12e2-4fed-804e-880ecbd3344c")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.2.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: NeutralResourcesLanguage("en")]
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("HellionSaveEditor")] [assembly: AssemblyDescription("Edits health and resources in Hellion Save Games")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Necrosoft")] [assembly: AssemblyProduct("HellionSaveEditor")] [assembly: AssemblyCopyright("Copyright Necrosoft© 2017")] [assembly: AssemblyTrademark("Written by GLotsapot")] [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("30d0ae60-12e2-4fed-804e-880ecbd3344c")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
34a54240d724b9b7610ab907f66286c8b9d151c1
Add classes for prime numbers
sakapon/Samples-2016,sakapon/Samples-2016
AzureBatchSample/TaskWebJob/Program.cs
AzureBatchSample/TaskWebJob/Program.cs
using System; using System.Collections.Generic; using System.Linq; using Microsoft.Azure.WebJobs; namespace TaskWebJob { // To learn more about Microsoft Azure WebJobs SDK, please see http://go.microsoft.com/fwlink/?LinkID=320976 class Program { // Please set the following connection strings in app.config for this WebJob to run: // AzureWebJobsDashboard and AzureWebJobsStorage static void Main() { using (var host = new JobHost()) { host.Call(typeof(Functions).GetMethod(nameof(Functions.RecordTimeAndSleep)), new { startTime = DateTime.UtcNow }); } } } public static class PrimeNumbers { public static IEnumerable<long> GetPrimeNumbers(long minValue, long maxValue) => new[] { new { primes = new List<long>(), min = Math.Max(minValue, 2), max = Math.Max(maxValue, 0), root_max = maxValue >= 0 ? (long)Math.Sqrt(maxValue) : 0, } } .SelectMany(_ => Enumerable2.Range2(2, Math.Min(_.root_max, _.min - 1)) .Concat(Enumerable2.Range2(_.min, _.max)) .Select(i => new { _.primes, i, root_i = (long)Math.Sqrt(i) })) .Where(_ => _.primes .TakeWhile(p => p <= _.root_i) .All(p => _.i % p != 0)) .Do(_ => _.primes.Add(_.i)) .Select(_ => _.i) .SkipWhile(i => i < minValue); } public static class Enumerable2 { public static IEnumerable<long> Range2(long minValue, long maxValue) { for (var i = minValue; i <= maxValue; i++) { yield return i; } } public static IEnumerable<TSource> Do<TSource>(this IEnumerable<TSource> source, Action<TSource> action) { if (source == null) throw new ArgumentNullException("source"); if (action == null) throw new ArgumentNullException("action"); foreach (var item in source) { action(item); yield return item; } } } }
using System; using System.Collections.Generic; using System.Linq; using Microsoft.Azure.WebJobs; namespace TaskWebJob { // To learn more about Microsoft Azure WebJobs SDK, please see http://go.microsoft.com/fwlink/?LinkID=320976 class Program { // Please set the following connection strings in app.config for this WebJob to run: // AzureWebJobsDashboard and AzureWebJobsStorage static void Main() { using (var host = new JobHost()) { host.Call(typeof(Functions).GetMethod(nameof(Functions.RecordTimeAndSleep)), new { startTime = DateTime.UtcNow }); } } } }
mit
C#
035010e8ddb47d42cf69ddc5086e0edfe477339a
put comments in bg-2
MacsDickinson/blog,MacsDickinson/blog
Snow/_layouts/post.cshtml
Snow/_layouts/post.cshtml
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Snow.ViewModels.PostViewModel> @using System.Collections.Generic @{ Layout = "default.cshtml"; } @section menu { <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav sf-menu"> <li class="current"><a href="/">Blog</a></li> <!--<li><a href="/projects">Projects</a></li>--> <li><a href="/categories">Categories</a></li> <li><a href="/archive">Archive</a></li> </ul> </div> } <div class="post"> <div class="row"> <div class="col-sm-8 col-sm-offset-2"> <h1> @Model.Title <span>@Model.PostDate.ToString("dd MMM yyyy")</span> </h1> <p> @foreach (var category in Model.Categories) { <a class="btn btn-default btn-sm" href="/category/@category.Url"><i class="fa fa-tag"></i> @category.Name</a> } </p> @Html.RenderSeries() @Html.Raw(Model.PostContent) </div> </div> </div> <div class="post"> <div class="row"> <div class="col-sm-8 col-sm-offset-2"> <div id="disqus_thread"></div> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = 'macsenblog'; // required: replace example with your forum shortname /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-****"></script> </div> </div> </div>
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Snow.ViewModels.PostViewModel> @using System.Collections.Generic @{ Layout = "default.cshtml"; } @section menu { <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav sf-menu"> <li class="current"><a href="/">Blog</a></li> <!--<li><a href="/projects">Projects</a></li>--> <li><a href="/categories">Categories</a></li> <li><a href="/archive">Archive</a></li> </ul> </div> } <div class="post"> <div class="row"> <div class="col-sm-8 col-sm-offset-2"> <h1> @Model.Title <span>@Model.PostDate.ToString("dd MMM yyyy")</span> </h1> <p> @foreach (var category in Model.Categories) { <a class="btn btn-default btn-sm" href="/category/@category.Url"><i class="fa fa-tag"></i> @category.Name</a> } </p> @Html.RenderSeries() @Html.Raw(Model.PostContent) <div id="disqus_thread"></div> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = 'macsenblog'; // required: replace example with your forum shortname /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-****"></script> </div> <div> </div>
mit
C#
cca231440e3d592a2e22aa419e4d279cbecb6005
Bump version to 0.9.0
quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot
CactbotOverlay/Properties/AssemblyInfo.cs
CactbotOverlay/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("CactbotOverlay")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CactbotOverlay")] [assembly: AssemblyCopyright("Copyright 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")] // Version: // - Major Version // - Minor Version // - Build Number // - Revision // GitHub has only 3 version components, so Revision should always be 0. [assembly: AssemblyVersion("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("CactbotOverlay")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CactbotOverlay")] [assembly: AssemblyCopyright("Copyright 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")] // Version: // - Major Version // - Minor Version // - Build Number // - Revision // GitHub has only 3 version components, so Revision should always be 0. [assembly: AssemblyVersion("0.8.7.0")] [assembly: AssemblyFileVersion("0.8.7.0")]
apache-2.0
C#
a9a5809e940f2f424958533d6f6e46e133b985f1
Fix incorrect xmldoc in `MoveSelectionEvent`
smoogipoo/osu,peppy/osu,NeoAdonis/osu,ppy/osu,smoogipooo/osu,peppy/osu,NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu,UselessToucan/osu,ppy/osu,UselessToucan/osu,peppy/osu-new,peppy/osu,ppy/osu,UselessToucan/osu
osu.Game/Screens/Edit/Compose/Components/MoveSelectionEvent.cs
osu.Game/Screens/Edit/Compose/Components/MoveSelectionEvent.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Rulesets.Edit; using osuTK; namespace osu.Game.Screens.Edit.Compose.Components { /// <summary> /// An event which occurs when a <see cref="OverlaySelectionBlueprint"/> is moved. /// </summary> public class MoveSelectionEvent<T> { /// <summary> /// The <see cref="SelectionBlueprint{T}"/> that triggered this <see cref="MoveSelectionEvent{T}"/>. /// </summary> public readonly SelectionBlueprint<T> Blueprint; /// <summary> /// The expected screen-space position of the blueprint's item at the current cursor position. /// </summary> public readonly Vector2 ScreenSpacePosition; /// <summary> /// The distance between <see cref="ScreenSpacePosition"/> and the blueprint's current position, in the coordinate-space of the blueprint item's parent. /// </summary> public readonly Vector2 InstantDelta; public MoveSelectionEvent(SelectionBlueprint<T> blueprint, Vector2 screenSpacePosition) { Blueprint = blueprint; ScreenSpacePosition = screenSpacePosition; InstantDelta = Blueprint.GetInstantDelta(ScreenSpacePosition); } } }
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Rulesets.Edit; using osuTK; namespace osu.Game.Screens.Edit.Compose.Components { /// <summary> /// An event which occurs when a <see cref="OverlaySelectionBlueprint"/> is moved. /// </summary> public class MoveSelectionEvent<T> { /// <summary> /// The <see cref="SelectionBlueprint{T}"/> that triggered this <see cref="MoveSelectionEvent{T}"/>. /// </summary> public readonly SelectionBlueprint<T> Blueprint; /// <summary> /// The expected screen-space position of the hitobject at the current cursor position. /// </summary> public readonly Vector2 ScreenSpacePosition; /// <summary> /// The distance between <see cref="ScreenSpacePosition"/> and the hitobject's current position, in the coordinate-space of the hitobject's parent. /// </summary> public readonly Vector2 InstantDelta; public MoveSelectionEvent(SelectionBlueprint<T> blueprint, Vector2 screenSpacePosition) { Blueprint = blueprint; ScreenSpacePosition = screenSpacePosition; InstantDelta = Blueprint.GetInstantDelta(ScreenSpacePosition); } } }
mit
C#
98570a26257fa776257b416add94230b1b2169ab
Fix semi colon problem
bitsummation/pickaxe,bitsummation/pickaxe
DotNetCore/Pickaxe.Console/Interactive.cs
DotNetCore/Pickaxe.Console/Interactive.cs
using System; using System.Collections.Generic; using System.Text; using System.Threading; namespace Pickaxe.Console { internal class Interactive { public static void Prompt() { var builder = new StringBuilder(); System.Console.Write("pickaxe> "); while (true) { var line = System.Console.ReadLine(); builder.AppendLine(line); if(line.EndsWith(';')) //run it { var source = builder.ToString(); source = source.Replace(";", ""); Thread thread = new Thread(() => Runner.Run(new[] { source }, new string[0])); thread.Start(); thread.Join(); builder.Clear(); System.Console.Write("pickaxe> "); continue; } System.Console.Write(" -> "); } } } }
using System; using System.Collections.Generic; using System.Text; using System.Threading; namespace Pickaxe.Console { internal class Interactive { public static void Prompt() { var builder = new StringBuilder(); System.Console.Write("pickaxe> "); while (true) { var line = System.Console.ReadLine(); builder.Append(line); if(line.EndsWith(';')) //run it { builder.Remove(builder.Length - 1, 1); //remove ; var source = builder.ToString(); Thread thread = new Thread(() => Runner.Run(new[] { source }, new string[0])); thread.Start(); thread.Join(); builder.Clear(); System.Console.Write("pickaxe> "); continue; } System.Console.Write(" -> "); } } } }
apache-2.0
C#
81658e2485350c0f4f29125eaf2279f3030f201b
Add resets when reloading level
neuroidss/nupic.research,ThomasMiconi/htmresearch,ywcui1990/htmresearch,cogmission/nupic.research,ThomasMiconi/htmresearch,ywcui1990/htmresearch,mrcslws/htmresearch,BoltzmannBrain/nupic.research,mrcslws/htmresearch,ThomasMiconi/htmresearch,subutai/htmresearch,BoltzmannBrain/nupic.research,subutai/htmresearch,subutai/htmresearch,marionleborgne/nupic.research,ywcui1990/htmresearch,cogmission/nupic.research,BoltzmannBrain/nupic.research,marionleborgne/nupic.research,BoltzmannBrain/nupic.research,ThomasMiconi/htmresearch,subutai/htmresearch,mrcslws/htmresearch,chanceraine/nupic.research,ThomasMiconi/nupic.research,BoltzmannBrain/nupic.research,ThomasMiconi/htmresearch,ThomasMiconi/htmresearch,chanceraine/nupic.research,cogmission/nupic.research,chanceraine/nupic.research,numenta/htmresearch,ywcui1990/nupic.research,ywcui1990/nupic.research,mrcslws/htmresearch,ywcui1990/htmresearch,cogmission/nupic.research,numenta/htmresearch,ywcui1990/nupic.research,chanceraine/nupic.research,ywcui1990/nupic.research,subutai/htmresearch,BoltzmannBrain/nupic.research,marionleborgne/nupic.research,ywcui1990/htmresearch,ywcui1990/nupic.research,neuroidss/nupic.research,ywcui1990/htmresearch,mrcslws/htmresearch,ywcui1990/nupic.research,neuroidss/nupic.research,numenta/htmresearch,mrcslws/htmresearch,ThomasMiconi/nupic.research,ThomasMiconi/nupic.research,subutai/htmresearch,ThomasMiconi/nupic.research,marionleborgne/nupic.research,ywcui1990/htmresearch,marionleborgne/nupic.research,neuroidss/nupic.research,ywcui1990/nupic.research,mrcslws/htmresearch,cogmission/nupic.research,subutai/htmresearch,numenta/htmresearch,chanceraine/nupic.research,subutai/htmresearch,ThomasMiconi/nupic.research,cogmission/nupic.research,ThomasMiconi/htmresearch,mrcslws/htmresearch,ywcui1990/htmresearch,neuroidss/nupic.research,numenta/htmresearch,numenta/htmresearch,neuroidss/nupic.research,marionleborgne/nupic.research,ThomasMiconi/nupic.research,ThomasMiconi/nupic.research,cogmission/nupic.research,BoltzmannBrain/nupic.research,ThomasMiconi/nupic.research,numenta/htmresearch,ThomasMiconi/htmresearch,chanceraine/nupic.research,neuroidss/nupic.research,neuroidss/nupic.research,marionleborgne/nupic.research,BoltzmannBrain/nupic.research,cogmission/nupic.research,numenta/htmresearch,ywcui1990/nupic.research,marionleborgne/nupic.research
vehicle-control/simulation/Assets/Scripts/CarCollisions.cs
vehicle-control/simulation/Assets/Scripts/CarCollisions.cs
/* ---------------------------------------------------------------------- Numenta Platform for Intelligent Computing (NuPIC) Copyright (C) 2015, Numenta, Inc. Unless you have an agreement with Numenta, Inc., for a separate license for this software code, the following terms and conditions apply: This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses. http://numenta.org/licenses/ ---------------------------------------------------------------------- */ using UnityEngine; using System.Collections; public class CarCollisions : MonoBehaviour { void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == "Boundary") { API.instance.Reset(); Application.LoadLevel(Application.loadedLevel); } else if (collision.gameObject.tag == "Finish") { API.instance.Reset(); Application.LoadLevel(Application.loadedLevel + 1); } } }
/* ---------------------------------------------------------------------- Numenta Platform for Intelligent Computing (NuPIC) Copyright (C) 2015, Numenta, Inc. Unless you have an agreement with Numenta, Inc., for a separate license for this software code, the following terms and conditions apply: This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses. http://numenta.org/licenses/ ---------------------------------------------------------------------- */ using UnityEngine; using System.Collections; public class CarCollisions : MonoBehaviour { void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == "Boundary") { Application.LoadLevel(Application.loadedLevel); } else if (collision.gameObject.tag == "Finish") { Application.LoadLevel(Application.loadedLevel + 1); } } }
agpl-3.0
C#
10467ecceae53fa296f5661dc8a484de07ce9ce9
Update AssemblyInfo.cs
DHGMS-Solutions/gripewithroslyn
src/Dhgms.GripeWithRoslyn.UnitTests/Properties/AssemblyInfo.cs
src/Dhgms.GripeWithRoslyn.UnitTests/Properties/AssemblyInfo.cs
// Copyright (c) 2019 DHGMS Solutions and Contributors. All rights reserved. // This file is licensed to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.Diagnostics.CodeAnalysis; 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: AssemblyDescription("")] [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)] // 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:ExcludeFromCodeCoverage]
// Copyright (c) 2019 DHGMS Solutions and Contributors. All rights reserved. // This file is licensed to you under the MIT license. // See the LICENSE file in the project root for full license information. 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: AssemblyDescription("")] [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)] // 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.*")]
mit
C#
4fe0192a47d23729f65ba26b4a2e6ae209d8898e
Add gu prefix.
JohanLarsson/Gu.Wpf.ValidationScope
Gu.Wpf.ValidationScope/AssemblyAttributes.cs
Gu.Wpf.ValidationScope/AssemblyAttributes.cs
using System.Runtime.CompilerServices; using System.Windows; using System.Windows.Markup; [assembly: InternalsVisibleTo("Gu.Wpf.ValidationScope.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010081C17142540667A1F595C54AD2B5916395C55177D9770A78B6610298EA5B0442D18B95AE9A789CF9D5C04A88B0E1BFE73E7FD2E033BDC37F4E7916376F4BD7E213BD792EBBB77DFEADF5F8D221289AA0EF2130CE8BDD33B1526F0EE2D6C1B472F956E2A3067769435880507D779468531A3C97270628E44FC15727B0BC915BC7", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("Gu.Wpf.ValidationScope.Demo, PublicKey=002400000480000094000000060200000024000052534131000400000100010081C17142540667A1F595C54AD2B5916395C55177D9770A78B6610298EA5B0442D18B95AE9A789CF9D5C04A88B0E1BFE73E7FD2E033BDC37F4E7916376F4BD7E213BD792EBBB77DFEADF5F8D221289AA0EF2130CE8BDD33B1526F0EE2D6C1B472F956E2A3067769435880507D779468531A3C97270628E44FC15727B0BC915BC7", AllInternalsVisible = true)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: XmlnsDefinition("https://github.com/JohanLarsson/Gu.Wpf.ValidationScope", "Gu.Wpf.ValidationScope")] [assembly: XmlnsPrefix("https://github.com/JohanLarsson/Gu.Wpf.ValidationScope", "validation")] [assembly: XmlnsDefinition("https://github.com/GuOrg/Gu.Wpf.ValidationScope", "Gu.Wpf.ValidationScope")] [assembly: XmlnsPrefix("https://github.com/GuOrg/Gu.Wpf.ValidationScope", "gu")]
using System.Runtime.CompilerServices; using System.Windows; using System.Windows.Markup; [assembly: InternalsVisibleTo("Gu.Wpf.ValidationScope.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010081C17142540667A1F595C54AD2B5916395C55177D9770A78B6610298EA5B0442D18B95AE9A789CF9D5C04A88B0E1BFE73E7FD2E033BDC37F4E7916376F4BD7E213BD792EBBB77DFEADF5F8D221289AA0EF2130CE8BDD33B1526F0EE2D6C1B472F956E2A3067769435880507D779468531A3C97270628E44FC15727B0BC915BC7", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("Gu.Wpf.ValidationScope.Demo, PublicKey=002400000480000094000000060200000024000052534131000400000100010081C17142540667A1F595C54AD2B5916395C55177D9770A78B6610298EA5B0442D18B95AE9A789CF9D5C04A88B0E1BFE73E7FD2E033BDC37F4E7916376F4BD7E213BD792EBBB77DFEADF5F8D221289AA0EF2130CE8BDD33B1526F0EE2D6C1B472F956E2A3067769435880507D779468531A3C97270628E44FC15727B0BC915BC7", AllInternalsVisible = true)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.None)] [assembly: XmlnsDefinition("https://github.com/JohanLarsson/Gu.Wpf.ValidationScope", "Gu.Wpf.ValidationScope")] [assembly: XmlnsPrefix("https://github.com/JohanLarsson/Gu.Wpf.ValidationScope", "validation")]
mit
C#
2734d2b2ce543981e89ff9a6c437cc47a6473a89
Fix async warning
icsharpcode/ResourceFirstTranslations,icsharpcode/ResourceFirstTranslations,icsharpcode/ResourceFirstTranslations
src/ResourcesFirstTranslations/Services/Stubs/DevStubMailService.cs
src/ResourcesFirstTranslations/Services/Stubs/DevStubMailService.cs
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ResourcesFirstTranslations.Services.Stubs { public class DevStubMailService : IMailService { public Task<bool> SendMailAsync(MailMessage mm, bool suppressExceptions = true) { Debug.WriteLine("--- DevStub sending email ---"); Debug.WriteLine(mm.Subject); Debug.WriteLine(mm.Body); return Task.FromResult(true); } } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ResourcesFirstTranslations.Services.Stubs { public class DevStubMailService : IMailService { public async Task<bool> SendMailAsync(MailMessage mm, bool suppressExceptions = true) { Debug.WriteLine("--- DevStub sending email ---"); Debug.WriteLine(mm.Subject); Debug.WriteLine(mm.Body); return true; } } }
mit
C#
6a1b24c8ea2cbc5e6321cc7424fabbaf9f5c5bc2
document the IContainerAdapter used to embed other IOCs
timba/NServiceKit,ZocDoc/ServiceStack,NServiceKit/NServiceKit,nataren/NServiceKit,meebey/ServiceStack,ZocDoc/ServiceStack,MindTouch/NServiceKit,ZocDoc/ServiceStack,NServiceKit/NServiceKit,nataren/NServiceKit,timba/NServiceKit,nataren/NServiceKit,nataren/NServiceKit,MindTouch/NServiceKit,ZocDoc/ServiceStack,MindTouch/NServiceKit,meebey/ServiceStack,MindTouch/NServiceKit,NServiceKit/NServiceKit,timba/NServiceKit,NServiceKit/NServiceKit,timba/NServiceKit
src/ServiceStack.Interfaces/Configuration/IContainerAdapter.cs
src/ServiceStack.Interfaces/Configuration/IContainerAdapter.cs
namespace ServiceStack.Configuration { /// <summary> /// Allow delegation of dependencies to other IOC's /// </summary> public interface IContainerAdapter { /// <summary> /// Resolve Property Dependency /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> T TryResolve<T>(); /// <summary> /// Resolve Constructor Dependency /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> T Resolve<T>(); } }
namespace ServiceStack.Configuration { public interface IContainerAdapter { T TryResolve<T>(); T Resolve<T>(); } }
bsd-3-clause
C#
7ad5426b9beadf2b971a2264b417da184230a563
Fix the Composer list
KevinJump/uSync,KevinJump/uSync,KevinJump/uSync
uSync8.BackOffice/uSyncBackOfficeComposer.cs
uSync8.BackOffice/uSyncBackOfficeComposer.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Umbraco.Core; using Umbraco.Core.Composing; using uSync8.BackOffice.Configuration; using uSync8.BackOffice.Services; using uSync8.BackOffice.SyncHandlers; using uSync8.Core; namespace uSync8.BackOffice { [ComposeAfter(typeof(uSyncCoreComposer))] public class uSyncBackOfficeConfigComposer : IUserComposer { public void Compose(Composition composition) { composition.Configs.Add<uSyncConfig>(() => new uSyncConfig()); } } [ComposeAfter(typeof(uSyncBackOfficeConfigComposer))] public class uSyncBackOfficeComposer : IUserComposer { public void Compose(Composition composition) { composition.RegisterUnique<SyncFileService>(); composition.WithCollectionBuilder<SyncHandlerCollectionBuilder>() .Add(() => composition.TypeLoader.GetTypes<ISyncHandler>()); composition.RegisterUnique<SyncHandlerFactory>(); composition.RegisterUnique<uSyncService>(); composition.Components().Append<uSyncBackofficeComponent>(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Umbraco.Core; using Umbraco.Core.Composing; using uSync8.BackOffice.Configuration; using uSync8.BackOffice.Services; using uSync8.BackOffice.SyncHandlers; using uSync8.Core; namespace uSync8.BackOffice { [ComposeAfter(typeof(uSyncCoreComposer))] public class uSyncBackOfficeConfigComposer : IUserComposer { public void Compose(Composition composition) { composition.Configs.Add<uSyncConfig>(() => new uSyncConfig()); } } [ComposeAfter(typeof(uSyncBackOfficeConfigComposer))] public class uSyncBackOfficeComposer : IUserComposer { public void Compose(Composition composition) { composition.RegisterUnique<SyncFileService>(); composition.WithCollectionBuilder<SyncHandlerCollectionBuilder>() .Add(() => composition.TypeLoader.GetTypes<ISyncHandler>()); composition.RegisterUnique<SyncHandlerFactory>(); composition.RegisterUnique<uSyncService>(); } } }
mpl-2.0
C#
23f9e85d7464cd831f853bf2f9e068bedefe888a
Fix exception message for GetRequiredService
sharwell/roslyn,jmarolf/roslyn,AmadeusW/roslyn,reaction1989/roslyn,jasonmalinowski/roslyn,gafter/roslyn,weltkante/roslyn,mgoertz-msft/roslyn,reaction1989/roslyn,tmat/roslyn,stephentoub/roslyn,dotnet/roslyn,eriawan/roslyn,tannergooding/roslyn,agocke/roslyn,bartdesmet/roslyn,heejaechang/roslyn,abock/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,ErikSchierboom/roslyn,heejaechang/roslyn,eriawan/roslyn,shyamnamboodiripad/roslyn,AmadeusW/roslyn,agocke/roslyn,AlekseyTs/roslyn,stephentoub/roslyn,heejaechang/roslyn,genlu/roslyn,MichalStrehovsky/roslyn,tannergooding/roslyn,brettfo/roslyn,nguerrera/roslyn,KevinRansom/roslyn,brettfo/roslyn,mavasani/roslyn,jasonmalinowski/roslyn,abock/roslyn,stephentoub/roslyn,davkean/roslyn,jmarolf/roslyn,swaroop-sridhar/roslyn,aelij/roslyn,MichalStrehovsky/roslyn,diryboy/roslyn,aelij/roslyn,mavasani/roslyn,physhi/roslyn,physhi/roslyn,agocke/roslyn,KirillOsenkov/roslyn,CyrusNajmabadi/roslyn,eriawan/roslyn,gafter/roslyn,jasonmalinowski/roslyn,mgoertz-msft/roslyn,sharwell/roslyn,weltkante/roslyn,brettfo/roslyn,genlu/roslyn,sharwell/roslyn,MichalStrehovsky/roslyn,wvdd007/roslyn,davkean/roslyn,davkean/roslyn,wvdd007/roslyn,diryboy/roslyn,panopticoncentral/roslyn,KirillOsenkov/roslyn,weltkante/roslyn,diryboy/roslyn,AlekseyTs/roslyn,aelij/roslyn,KirillOsenkov/roslyn,genlu/roslyn,dotnet/roslyn,nguerrera/roslyn,ErikSchierboom/roslyn,wvdd007/roslyn,panopticoncentral/roslyn,dotnet/roslyn,nguerrera/roslyn,jmarolf/roslyn,tmat/roslyn,gafter/roslyn,KevinRansom/roslyn,ErikSchierboom/roslyn,tmat/roslyn,shyamnamboodiripad/roslyn,mgoertz-msft/roslyn,CyrusNajmabadi/roslyn,panopticoncentral/roslyn,swaroop-sridhar/roslyn,shyamnamboodiripad/roslyn,swaroop-sridhar/roslyn,reaction1989/roslyn,bartdesmet/roslyn,physhi/roslyn,AlekseyTs/roslyn,CyrusNajmabadi/roslyn,mavasani/roslyn,abock/roslyn,tannergooding/roslyn,AmadeusW/roslyn
src/Workspaces/Core/Portable/Workspace/Host/HostLanguageServices.cs
src/Workspaces/Core/Portable/Workspace/Host/HostLanguageServices.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; namespace Microsoft.CodeAnalysis.Host { /// <summary> /// Per language services provided by the host environment. /// </summary> public abstract class HostLanguageServices { /// <summary> /// The <see cref="HostWorkspaceServices"/> that originated this language service. /// </summary> public abstract HostWorkspaceServices WorkspaceServices { get; } /// <summary> /// The name of the language /// </summary> public abstract string Language { get; } /// <summary> /// Gets a language specific service provided by the host identified by the service type. /// If the host does not provide the service, this method returns null. /// </summary> public abstract TLanguageService GetService<TLanguageService>() where TLanguageService : ILanguageService; /// <summary> /// Gets a language specific service provided by the host identified by the service type. /// If the host does not provide the service, this method returns throws <see cref="InvalidOperationException"/>. /// </summary> public TLanguageService GetRequiredService<TLanguageService>() where TLanguageService : ILanguageService { var service = GetService<TLanguageService>(); if (service == null) { throw new InvalidOperationException(string.Format(WorkspacesResources.Service_of_type_0_is_required_to_accomplish_the_task_but_is_not_available_from_the_workspace, typeof(TLanguageService))); } return service; } // common services /// <summary> /// A factory for creating compilations instances. /// </summary> internal virtual ICompilationFactoryService CompilationFactory { get { return this.GetService<ICompilationFactoryService>(); } } // needs some work on the interface before it can be public internal virtual ISyntaxTreeFactoryService SyntaxTreeFactory { get { return this.GetService<ISyntaxTreeFactoryService>(); } } } }
// 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; namespace Microsoft.CodeAnalysis.Host { /// <summary> /// Per language services provided by the host environment. /// </summary> public abstract class HostLanguageServices { /// <summary> /// The <see cref="HostWorkspaceServices"/> that originated this language service. /// </summary> public abstract HostWorkspaceServices WorkspaceServices { get; } /// <summary> /// The name of the language /// </summary> public abstract string Language { get; } /// <summary> /// Gets a language specific service provided by the host identified by the service type. /// If the host does not provide the service, this method returns null. /// </summary> public abstract TLanguageService GetService<TLanguageService>() where TLanguageService : ILanguageService; /// <summary> /// Gets a language specific service provided by the host identified by the service type. /// If the host does not provide the service, this method returns throws <see cref="InvalidOperationException"/>. /// </summary> public TLanguageService GetRequiredService<TLanguageService>() where TLanguageService : ILanguageService { var service = GetService<TLanguageService>(); if (service == null) { throw new InvalidOperationException(WorkspacesResources.Service_of_type_0_is_required_to_accomplish_the_task_but_is_not_available_from_the_workspace); } return service; } // common services /// <summary> /// A factory for creating compilations instances. /// </summary> internal virtual ICompilationFactoryService CompilationFactory { get { return this.GetService<ICompilationFactoryService>(); } } // needs some work on the interface before it can be public internal virtual ISyntaxTreeFactoryService SyntaxTreeFactory { get { return this.GetService<ISyntaxTreeFactoryService>(); } } } }
mit
C#
49a6e5f885dd1927ba0f18adbca976a6937a4088
fix leader stuff in group
Foglio1024/Tera-custom-cooldowns,Foglio1024/Tera-custom-cooldowns
TCC.Core/Data/GroupInfo.cs
TCC.Core/Data/GroupInfo.cs
using System.Collections.Generic; using System.Linq; using TeraDataLite; namespace TCC.Data { public class GroupInfo { public bool InGroup { get; private set; } public bool IsRaid { get; private set; } public bool AmILeader => Game.Me.Name == Leader.Name; private GroupMemberData Leader { get; set; } = new GroupMemberData(); private List<GroupMemberData> Members { get; set; } = new List<GroupMemberData>(); public void SetGroup(List<GroupMemberData> members, bool raid) { Members = members; Leader = members.Find(m => m.IsLeader); IsRaid = raid; InGroup = true; } public void ChangeLeader(string name) { Members.ForEach(x => x.IsLeader = x.Name == name); Leader = Members.FirstOrDefault(m => m.Name == name); } public void Remove(uint playerId, uint serverId) { var target = Members.Find(m => m.PlayerId == playerId && m.ServerId == serverId); Members.Remove(target); } public void Disband() { Members.Clear(); Leader = new GroupMemberData(); IsRaid = false; InGroup = false; } public bool Has(string name) { return Members.Any(m => m.Name == name); } public bool Has(uint pId) { return Members.Any(m => m.PlayerId == pId); } public bool HasPowers(string name) { return Has(name) && Members.FirstOrDefault(x => x.Name == name)?.CanInvite == true; } public bool TryGetMember(uint playerId, uint serverId, out GroupMemberData member) { member = Members.FirstOrDefault(m => m.PlayerId == playerId && m.ServerId == serverId); return member != null; } public bool TryGetMember(string name, out GroupMemberData member) { member = Members.FirstOrDefault(m => m.Name == name); return member != null; } } }
using System.Collections.Generic; using System.Linq; using TeraDataLite; namespace TCC.Data { public class GroupInfo { public bool InGroup { get; private set; } public bool IsRaid { get; private set; } public bool AmILeader => Game.Me.Name == Leader.Name; public GroupMemberData Leader { get; private set; } public List<GroupMemberData> Members { get; private set; } = new List<GroupMemberData>(); public void SetGroup(List<GroupMemberData> members, bool raid) { Members = members; Leader = members.Find(m => m.IsLeader); IsRaid = raid; InGroup = true; } public void ChangeLeader(string name) { Members.ForEach(m => m.IsLeader = m.Name == name); } public void Remove(uint playerId, uint serverId) { var target = Members.Find(m => m.PlayerId == playerId && m.ServerId == serverId); Members.Remove(target); } public void Disband() { Members.Clear(); Leader = default; IsRaid = false; InGroup = false; } public bool Has(string name) { return Members.Any(m => m.Name == name); } public bool HasPowers(string name) { return Has(name) && Members.FirstOrDefault(x => x.Name == name).CanInvite; } public bool TryGetMember(uint playerId, uint serverId, out GroupMemberData member) { member = Members.FirstOrDefault(m => m.PlayerId == playerId && m.ServerId == serverId); return !member.Equals(default(GroupMemberData)); } public bool TryGetMember(string name, out GroupMemberData member) { member = Members.FirstOrDefault(m => m.Name == name); return !member.Equals(default(GroupMemberData)); } } }
mit
C#
7e11387f0b593163736a567a977df5e8f03b75f7
Add some documentation.
mcneel/RhinoCycles
LinearWorkflow.cs
LinearWorkflow.cs
/** Copyright 2014-2016 Robert McNeel and Associates Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **/ using System; using LwFlow = Rhino.Render.ChangeQueue.LinearWorkflow; namespace RhinoCyclesCore { /// <summary> /// Intermediate class to convey linear workflow settings: /// gamma, reciprocal gamma, active. /// </summary> public class LinearWorkflow { public bool Active { get; set; } public float Gamma { get; set; } public float GammaReciprocal { get; set; } /// <summary> /// Copy constructor from <see cref="Rhino.Render.ChangeQueue.LinearWorkflow"/> /// </summary> /// <param name="lwf"><see cref="Rhino.Render.ChangeQueue.LinearWorkflow"/></param> public LinearWorkflow(LwFlow lwf) { Active = lwf.Active; Gamma = lwf.Gamma; GammaReciprocal = lwf.GammaReciprocal; } /// <summary> /// Default constructor /// </summary> /// <param name="active"></param> /// <param name="gamma"></param> public LinearWorkflow(bool active, float gamma) { Active = active; Gamma = gamma; GammaReciprocal = 1.0f/gamma; } /// <summary> /// Copy constructor from <see cref="LinearWorkflow"/> /// </summary> /// <param name="old"><see cref="LinearWorkflow"/></param> public LinearWorkflow(LinearWorkflow old) { Active = old.Active; Gamma = old.Gamma; GammaReciprocal = old.GammaReciprocal; } public override bool Equals(object obj) { LinearWorkflow lwf = obj as LinearWorkflow; if (lwf == null) return false; return Active == lwf.Active && Math.Abs(Gamma-lwf.Gamma) < float.Epsilon && Math.Abs(GammaReciprocal - lwf.GammaReciprocal) < float.Epsilon; } public override int GetHashCode() { return base.GetHashCode(); } } }
/** Copyright 2014-2016 Robert McNeel and Associates Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **/ using System; using LwFlow = Rhino.Render.ChangeQueue.LinearWorkflow; namespace RhinoCyclesCore { public class LinearWorkflow { public bool Active { get; set; } public float Gamma { get; set; } public float GammaReciprocal { get; set; } public LinearWorkflow(LwFlow lwf) { Active = lwf.Active; Gamma = lwf.Gamma; GammaReciprocal = lwf.GammaReciprocal; } public LinearWorkflow(bool active, float gamma) { Active = active; Gamma = gamma; GammaReciprocal = 1.0f/gamma; } public LinearWorkflow(LinearWorkflow old) { Active = old.Active; Gamma = old.Gamma; GammaReciprocal = old.GammaReciprocal; } public override bool Equals(object obj) { LinearWorkflow lwf = obj as LinearWorkflow; if (lwf == null) return false; return Active == lwf.Active && Math.Abs(Gamma-lwf.Gamma) < float.Epsilon && Math.Abs(GammaReciprocal - lwf.GammaReciprocal) < float.Epsilon; } } }
apache-2.0
C#
3c965548269cc15d4b7ab50e230b072640c2d458
Fix Actipro language to construct the correct set of language services
terrajobst/nquery-vnext
NQuery.Language.ActiproWpf/NQueryLanguage.cs
NQuery.Language.ActiproWpf/NQueryLanguage.cs
using System; using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; using System.ComponentModel.Composition.Primitives; using ActiproSoftware.Text.Implementation; using NQuery.Language.Services.BraceMatching; using NQuery.Language.Wpf; namespace NQuery.Language.ActiproWpf { public sealed class NQueryLanguage : SyntaxLanguage, IDisposable { private readonly CompositionContainer _compositionContainer; public NQueryLanguage() : this(GetDefaultCatalog()) { } public NQueryLanguage(ComposablePartCatalog catalog) : base("NQuery") { _compositionContainer = new CompositionContainer(catalog); _compositionContainer.SatisfyImportsOnce(this); var serviceProviders = _compositionContainer.GetExportedValues<ILanguageServiceRegistrar>(); foreach (var serviceProvider in serviceProviders) serviceProvider.RegisterServices(this); } private static ComposablePartCatalog GetDefaultCatalog() { var servicesAssembly = new AssemblyCatalog(typeof (IBraceMatchingService).Assembly); var wpfAssembly = new AssemblyCatalog(typeof(INQueryGlyphService).Assembly); var thisAssembly = new AssemblyCatalog(typeof (NQueryLanguage).Assembly); return new AggregateCatalog(servicesAssembly, wpfAssembly, thisAssembly); } public void Dispose() { _compositionContainer.Dispose(); } } }
using System; using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; using System.ComponentModel.Composition.Primitives; using ActiproSoftware.Text.Implementation; using NQuery.Language.Services.BraceMatching; namespace NQuery.Language.ActiproWpf { public sealed class NQueryLanguage : SyntaxLanguage, IDisposable { private readonly CompositionContainer _compositionContainer; public NQueryLanguage() : this(GetDefaultCatalog()) { } public NQueryLanguage(ComposablePartCatalog catalog) : base("NQuery") { _compositionContainer = new CompositionContainer(catalog); _compositionContainer.SatisfyImportsOnce(this); var serviceProviders = _compositionContainer.GetExportedValues<ILanguageServiceRegistrar>(); foreach (var serviceProvider in serviceProviders) serviceProvider.RegisterServices(this); } private static ComposablePartCatalog GetDefaultCatalog() { var servicesAssembly = new AssemblyCatalog(typeof (IBraceMatchingService).Assembly); var thisAssembly = new AssemblyCatalog(typeof (NQueryLanguage).Assembly); return new AggregateCatalog(servicesAssembly, thisAssembly); } public void Dispose() { _compositionContainer.Dispose(); } } }
mit
C#
639f67fb7d3e41f198d8c7bdae58098af823f998
Fix GetStronglyTypedModularContent test case
Kentico/delivery-sdk-net,Kentico/Deliver-.NET-SDK
KenticoCloud.Delivery.Tests/Models/Item/ContentItemTests.cs
KenticoCloud.Delivery.Tests/Models/Item/ContentItemTests.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using NUnit.Framework; using Newtonsoft.Json.Linq; namespace KenticoCloud.Delivery.Tests { [TestFixture] public class ContentItemTests { [TestCase] public void CastTo_GetStronglyTypedModularContent() { const string SANDBOX_PROJECT_ID = "e1167a11-75af-4a08-ad84-0582b463b010"; var client = new DeliveryClient(SANDBOX_PROJECT_ID); ArticleModel parentArticle = Task.Run(() => client.GetItemAsync<ArticleModel>("article_1")).Result.Item; ArticleModel relatedArticle = parentArticle.RelatedArticles.First().CastTo<ArticleModel>(); Assert.AreEqual("Title of article 2", relatedArticle.Title); Assert.AreEqual("Article 2", relatedArticle.System.Name); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using NUnit.Framework; using Newtonsoft.Json.Linq; namespace KenticoCloud.Delivery.Tests { [TestFixture] public class ContentItemTests { // TODO: Unable to build due to change in visiblity level of ContentItem class from public to internal. //[TestCase] //public void CastTo_GetStronglyTypedModularContent() //{ // var jsonDefinition = @"{ // ""item"":{ // ""system"":{ // ""id"":""cd17ddf8-7bc6-47de-8beb-0e15a2381d76"", // ""name"":""Parent"", // ""codename"":""parent"", // ""type"":""article"", // ""sitemap_locations"":[], // ""last_modified"":""2017-02-22T00:52:03.9370993Z"" // }, // ""elements"":{ // ""title"":{ // ""type"":""text"", // ""name"":""Title"", // ""value"":""Title of Article"" // }, // ""related_articles"":{ // ""type"":""modular_content"", // ""name"":""Modular content field"", // ""value"":[ // ""article2"" // ] // } // } // }, // ""modular_content"":{ // ""article2"":{ // ""system"":{ // ""id"":""b30d533f-9822-4518-8113-e4b3437641b5"", // ""name"":""Article 2"", // ""codename"":""article2"", // ""type"":""article"", // ""sitemap_locations"":[], // ""last_modified"":""2017-02-21T04:29:42.9564205Z"" // }, // ""elements"":{ // ""title"":{ // ""type"":""text"", // ""name"":""Title"", // ""value"":""Title of Article 2"" // }, // ""related_articles"":{ // ""type"":""modular_content"", // ""name"":""Modular content field"", // ""value"":[] // } // } // } // } //}"; // JObject contentItem = JObject.Parse(jsonDefinition); // ArticleModel parentArticle = new ContentItem(contentItem["item"], contentItem["modular_content"]).CastTo<ArticleModel>(); // ArticleModel relatedArticle = parentArticle.RelatedArticles.First().CastTo<ArticleModel>(); // Assert.AreEqual("Title of Article 2", relatedArticle.Title); // Assert.AreEqual("Article 2", relatedArticle.System.Name); //} } }
mit
C#
52ee0a22953e974c137582e41e0d1f7699358271
Fix comments
gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer,DaggerES/LunaMultiPlayer
LmpClient/Systems/VesselFairingsSys/VesselFairingsSystem.cs
LmpClient/Systems/VesselFairingsSys/VesselFairingsSystem.cs
using LmpClient.Base; using LmpClient.Systems.TimeSync; using System; using System.Collections.Concurrent; namespace LmpClient.Systems.VesselFairingsSys { /// <summary> /// This class syncs the fairings between players /// </summary> public class VesselFairingsSystem : MessageSystem<VesselFairingsSystem, VesselFairingsMessageSender, VesselFairingsMessageHandler> { #region Fields & properties public ConcurrentDictionary<Guid, VesselFairingQueue> VesselFairings { get; } = new ConcurrentDictionary<Guid, VesselFairingQueue>(); private VesselFairingEvents VesselFairingEvents { get; } = new VesselFairingEvents(); #endregion #region Base overrides protected override bool ProcessMessagesInUnityThread => false; public override string SystemName { get; } = nameof(VesselFairingsSystem); protected override void OnEnabled() { base.OnEnabled(); GameEvents.onFairingsDeployed.Add(VesselFairingEvents.FairingsDeployed); SetupRoutine(new RoutineDefinition(1500, RoutineExecution.Update, ProcessVesselFairings)); } protected override void OnDisabled() { base.OnDisabled(); VesselFairings.Clear(); } #endregion #region Update routines private void ProcessVesselFairings() { foreach (var keyVal in VesselFairings) { while (keyVal.Value.TryPeek(out var update) && update.GameTime <= TimeSyncSystem.UniversalTime) { keyVal.Value.TryDequeue(out update); update.ProcessFairing(); keyVal.Value.Recycle(update); } } } #endregion #region Public methods /// <summary> /// Removes a vessel from the system /// </summary> public void RemoveVessel(Guid vesselId) { VesselFairings.TryRemove(vesselId, out _); } #endregion } }
using System; using System.Collections.Concurrent; using LmpClient.Base; using LmpClient.Systems.TimeSync; namespace LmpClient.Systems.VesselFairingsSys { /// <summary> /// This class sends some parts of the vessel information to other players. We do it in another system as we don't want to send this information so often as /// the vessel position system and also we want to send it more oftenly than the vessel proto. /// </summary> public class VesselFairingsSystem : MessageSystem<VesselFairingsSystem, VesselFairingsMessageSender, VesselFairingsMessageHandler> { #region Fields & properties public ConcurrentDictionary<Guid, VesselFairingQueue> VesselFairings { get; } = new ConcurrentDictionary<Guid, VesselFairingQueue>(); private VesselFairingEvents VesselFairingEvents { get; } = new VesselFairingEvents(); #endregion #region Base overrides protected override bool ProcessMessagesInUnityThread => false; public override string SystemName { get; } = nameof(VesselFairingsSystem); protected override void OnEnabled() { base.OnEnabled(); GameEvents.onFairingsDeployed.Add(VesselFairingEvents.FairingsDeployed); SetupRoutine(new RoutineDefinition(1500, RoutineExecution.Update, ProcessVesselFairings)); } protected override void OnDisabled() { base.OnDisabled(); VesselFairings.Clear(); } #endregion #region Update routines private void ProcessVesselFairings() { foreach (var keyVal in VesselFairings) { while (keyVal.Value.TryPeek(out var update) && update.GameTime <= TimeSyncSystem.UniversalTime) { keyVal.Value.TryDequeue(out update); update.ProcessFairing(); keyVal.Value.Recycle(update); } } } #endregion #region Public methods /// <summary> /// Removes a vessel from the system /// </summary> public void RemoveVessel(Guid vesselId) { VesselFairings.TryRemove(vesselId, out _); } #endregion } }
mit
C#
c1c67e29329989cc9a8747cccf0aa58a878c4d1c
refactor address
eeaquino/DotNetShipping,kylewest/DotNetShipping
DotNetShipping/Address.cs
DotNetShipping/Address.cs
namespace DotNetShipping { /// <summary> /// Summary description for Address. /// </summary> public class Address { public string City { get; set; } public string CountryCode { get; set; } public string Line1 { get; set; } public string Line2 { get; set; } public string Line3 { get; set; } public string PostalCode { get; set; } public string State { get; set; } #region .ctor public Address(string city, string state, string postalCode, string countryCode) : this(null, null, null, city, state, postalCode, countryCode) { } public Address(string line1, string line2, string line3, string city, string state, string postalCode, string countryCode) { Line1 = line1; Line2 = line2; Line3 = line3; City = city; State = state; PostalCode = postalCode; CountryCode = countryCode; } #endregion } }
namespace DotNetShipping { /// <summary> /// Summary description for Address. /// </summary> public class Address { #region Fields public readonly string City; public readonly string CountryCode; public readonly string Line1; public readonly string Line2; public readonly string Line3; public readonly string PostalCode; public readonly string State; #endregion #region .ctor public Address(string city, string state, string postalCode, string countryCode) : this(null, null, null, city, state, postalCode, countryCode) { } public Address(string line1, string line2, string line3, string city, string state, string postalCode, string countryCode) { Line1 = line1; Line2 = line2; Line3 = line3; City = city; State = state; PostalCode = postalCode; CountryCode = countryCode; } #endregion } }
mit
C#
e4aad30c1fc04ff8dc7cade00c877645857e99f9
Add fancy links to me and the contributors
jeremycook/PickupMailViewer,jeremycook/PickupMailViewer
PickupMailViewer/Views/Shared/_Layout.cshtml
PickupMailViewer/Views/Shared/_Layout.cshtml
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title</title> <script type="text/javascript"> var baseUrl = "@Url.Content("~")"; </script> @Styles.Render("~/Content/css") @Styles.Render("~/Content/themes/base/css") @Scripts.Render("~/bundles/modernizr") <meta name="description" content="Mail viewer" /> </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("Mail Viewer", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home")</li> </ul> </div> </div> </div> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; 2014-2015 - <a href="https://github.com/albinsunnanbo">Albin Sunnanbo</a> and <a href="https://github.com/albinsunnanbo/PickupMailViewer/network/members">contributors</a></p> <p><a href="https://github.com/albinsunnanbo/PickupMailViewer">https://github.com/albinsunnanbo/PickupMailViewer</a></p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @Scripts.Render("~/bundles/jquery-ui") @Scripts.Render("~/bundles/app") @RenderSection("scripts", required: false) </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title</title> <script type="text/javascript"> var baseUrl = "@Url.Content("~")"; </script> @Styles.Render("~/Content/css") @Styles.Render("~/Content/themes/base/css") @Scripts.Render("~/bundles/modernizr") <meta name="description" content="Mail viewer" /> </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("Mail Viewer", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home")</li> </ul> </div> </div> </div> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; 2014-2015 - Albin Sunnanbo and Contributors</p> <p><a href="https://github.com/albinsunnanbo/PickupMailViewer">https://github.com/albinsunnanbo/PickupMailViewer</a></p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @Scripts.Render("~/bundles/jquery-ui") @Scripts.Render("~/bundles/app") @RenderSection("scripts", required: false) </body> </html>
mit
C#
ba09f84fd547945b623b0037a17a8080b979cbb6
Make AutoLevel instantaneous instead of taking minutes.
Fenex/Pinta,Mailaender/Pinta,jakeclawson/Pinta,PintaProject/Pinta,PintaProject/Pinta,Fenex/Pinta,PintaProject/Pinta,jakeclawson/Pinta,Mailaender/Pinta
Pinta.Effects/Adjustments/AutoLevelEffect.cs
Pinta.Effects/Adjustments/AutoLevelEffect.cs
///////////////////////////////////////////////////////////////////////////////// // Paint.NET // // Copyright (C) dotPDN LLC, Rick Brewster, Tom Jackson, and contributors. // // Portions Copyright (C) Microsoft Corporation. All Rights Reserved. // // See license-pdn.txt for full licensing and attribution details. // // // // Ported to Pinta by: Jonathan Pobst <[email protected]> // ///////////////////////////////////////////////////////////////////////////////// using System; using Cairo; using Pinta.Core; namespace Pinta.Effects { [System.ComponentModel.Composition.Export (typeof (BaseEffect))] public class AutoLevelEffect : BaseEffect { UnaryPixelOps.Level op; public override string Icon { get { return "Menu.Adjustments.AutoLevel.png"; } } public override string Text { get { return Mono.Unix.Catalog.GetString ("Auto Level"); } } public override EffectAdjustment EffectOrAdjustment { get { return EffectAdjustment.Adjustment; } } public override Gdk.Key AdjustmentMenuKey { get { return Gdk.Key.L; } } public override void RenderEffect (ImageSurface src, ImageSurface dest, Gdk.Rectangle[] rois) { if (op == null) { HistogramRgb histogram = new HistogramRgb (); histogram.UpdateHistogram (src, new Gdk.Rectangle (0, 0, src.Width, src.Height)); op = histogram.MakeLevelsAuto (); } if (op.isValid) op.Apply (dest, src, rois); } } }
///////////////////////////////////////////////////////////////////////////////// // Paint.NET // // Copyright (C) dotPDN LLC, Rick Brewster, Tom Jackson, and contributors. // // Portions Copyright (C) Microsoft Corporation. All Rights Reserved. // // See license-pdn.txt for full licensing and attribution details. // // // // Ported to Pinta by: Jonathan Pobst <[email protected]> // ///////////////////////////////////////////////////////////////////////////////// using System; using Cairo; using Pinta.Core; namespace Pinta.Effects { [System.ComponentModel.Composition.Export (typeof (BaseEffect))] public class AutoLevelEffect : BaseEffect { UnaryPixelOps.Level op; public override string Icon { get { return "Menu.Adjustments.AutoLevel.png"; } } public override string Text { get { return Mono.Unix.Catalog.GetString ("Auto Level"); } } public override EffectAdjustment EffectOrAdjustment { get { return EffectAdjustment.Adjustment; } } public override Gdk.Key AdjustmentMenuKey { get { return Gdk.Key.L; } } public override void RenderEffect (ImageSurface src, ImageSurface dest, Gdk.Rectangle[] rois) { HistogramRgb histogram = new HistogramRgb (); histogram.UpdateHistogram (src, new Gdk.Rectangle (0, 0, src.Width, src.Height)); op = histogram.MakeLevelsAuto (); if (op.isValid) op.Apply (dest, src, rois); } } }
mit
C#
e28b96893804c72245fc4d52c7aa616c1b77a2d8
Add missing documentation for Pair
henrikfroehling/TraktApiSharp
Source/Lib/TraktApiSharp/Utils/Pair.cs
Source/Lib/TraktApiSharp/Utils/Pair.cs
namespace TraktApiSharp.Utils { /// <summary>A small container containing two values of different types.</summary> /// <typeparam name="T">The type of the first element in this pair.</typeparam> /// <typeparam name="U">The type of the second element in this pair.</typeparam> public sealed class Pair<T, U> { /// <summary>Initializes a new instance of the <see cref="Pair{T,U}" /> class.</summary> public Pair() { } /// <summary>Initializes a new instance of the <see cref="Pair{T,U}" /> class.</summary> /// <param name="first">The pair's first value.</param> /// <param name="second">The pair's second value.</param> public Pair(T first, U second) { First = first; Second = second; } /// <summary>Gets or sets the first value of the pair.</summary> public T First { get; set; } /// <summary>Gets or sets the second value of the pair.</summary> public U Second { get; set; } } }
namespace TraktApiSharp.Utils { public sealed class Pair<T, U> { /// <summary>Initializes a new instance of the <see cref="Pair{T,U}" /> class.</summary> public Pair() { } /// <summary>Initializes a new instance of the <see cref="Pair{T,U}" /> class.</summary> /// <param name="first">The pair's first value.</param> /// <param name="second">The pair's second value.</param> public Pair(T first, U second) { First = first; Second = second; } /// <summary>Gets or sets the first value of the pair.</summary> public T First { get; set; } /// <summary>Gets or sets the second value of the pair.</summary> public U Second { get; set; } } }
mit
C#
f3e45d6187a3f1ff523b2d4026dc794aab2ea26e
update version
gaochundong/Cowboy
Cowboy/SolutionVersion.cs
Cowboy/SolutionVersion.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyDescription("Cowboy is a C# library for building sockets based services.")] [assembly: AssemblyCompany("Dennis Gao")] [assembly: AssemblyProduct("Cowboy")] [assembly: AssemblyCopyright("Copyright © 2015-2017 Dennis Gao")] [assembly: AssemblyTrademark("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.3.9.0")] [assembly: AssemblyFileVersion("1.3.9.0")] [assembly: ComVisible(false)]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyDescription("Cowboy is a C# library for building sockets based services.")] [assembly: AssemblyCompany("Dennis Gao")] [assembly: AssemblyProduct("Cowboy")] [assembly: AssemblyCopyright("Copyright © 2015-2017 Dennis Gao")] [assembly: AssemblyTrademark("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.3.8.0")] [assembly: AssemblyFileVersion("1.3.8.0")] [assembly: ComVisible(false)]
mit
C#
e1b646cbd050915b82c59833cfc12edf50ccb746
Test Commit
Rut0/DataSerializer
DataSerializer/Program.cs
DataSerializer/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DataSerializer { class Program { static void Main(string[] args) { Console.ReadLine(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DataSerializer { class Program { static void Main(string[] args) { } } }
mit
C#
ed933e2c8e1b46aa1970a82efeecea09e3fb2aa8
Update Pascal's Triangle exercise to latest canonical data
ErikSchierboom/xcsharp,robkeim/xcsharp,robkeim/xcsharp,GKotfis/csharp,exercism/xcsharp,GKotfis/csharp,exercism/xcsharp,ErikSchierboom/xcsharp
exercises/pascals-triangle/PascalsTriangleTest.cs
exercises/pascals-triangle/PascalsTriangleTest.cs
// This file was auto-generated based on version 1.2.0 of the canonical data. using Xunit; using System; public class PascalsTriangleTest { [Fact] public void Zero_rows() { Assert.Empty(PascalsTriangle.Calculate(0)); } [Fact(Skip = "Remove to run test")] public void Single_row() { var expected = new[] { new[] { 1 } }; Assert.Equal(expected, PascalsTriangle.Calculate(1)); } [Fact(Skip = "Remove to run test")] public void Two_rows() { var expected = new[] { new[] { 1 }, new[] { 1, 1 } }; Assert.Equal(expected, PascalsTriangle.Calculate(2)); } [Fact(Skip = "Remove to run test")] public void Three_rows() { var expected = new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 } }; Assert.Equal(expected, PascalsTriangle.Calculate(3)); } [Fact(Skip = "Remove to run test")] public void Four_rows() { var expected = new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 }, new[] { 1, 3, 3, 1 } }; Assert.Equal(expected, PascalsTriangle.Calculate(4)); } [Fact(Skip = "Remove to run test")] public void Five_rows() { var expected = new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 }, new[] { 1, 3, 3, 1 }, new[] { 1, 4, 6, 4, 1 } }; Assert.Equal(expected, PascalsTriangle.Calculate(5)); } [Fact(Skip = "Remove to run test")] public void Six_rows() { var expected = new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 }, new[] { 1, 3, 3, 1 }, new[] { 1, 4, 6, 4, 1 }, new[] { 1, 5, 10, 10, 5, 1 } }; Assert.Equal(expected, PascalsTriangle.Calculate(6)); } [Fact(Skip = "Remove to run test")] public void Ten_rows() { var expected = new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 }, new[] { 1, 3, 3, 1 }, new[] { 1, 4, 6, 4, 1 }, new[] { 1, 5, 10, 10, 5, 1 }, new[] { 1, 6, 15, 20, 15, 6, 1 }, new[] { 1, 7, 21, 35, 35, 21, 7, 1 }, new[] { 1, 8, 28, 56, 70, 56, 28, 8, 1 }, new[] { 1, 9, 36, 84, 126, 126, 84, 36, 9, 1 } }; Assert.Equal(expected, PascalsTriangle.Calculate(10)); } [Fact(Skip = "Remove to run test")] public void Negative_rows() { Assert.Throws<ArgumentOutOfRangeException>(() => PascalsTriangle.Calculate(-1)); } }
// This file was auto-generated based on version 1.0.0 of the canonical data. using Xunit; using System; public class PascalsTriangleTest { [Fact] public void Zero_rows() { Assert.Empty(PascalsTriangle.Calculate(0)); } [Fact(Skip = "Remove to run test")] public void Single_row() { var expected = new[] { new[] { 1 } }; Assert.Equal(expected, PascalsTriangle.Calculate(1)); } [Fact(Skip = "Remove to run test")] public void Two_rows() { var expected = new[] { new[] { 1 }, new[] { 1, 1 } }; Assert.Equal(expected, PascalsTriangle.Calculate(2)); } [Fact(Skip = "Remove to run test")] public void Three_rows() { var expected = new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 } }; Assert.Equal(expected, PascalsTriangle.Calculate(3)); } [Fact(Skip = "Remove to run test")] public void Four_rows() { var expected = new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 }, new[] { 1, 3, 3, 1 } }; Assert.Equal(expected, PascalsTriangle.Calculate(4)); } [Fact(Skip = "Remove to run test")] public void Negative_rows() { Assert.Throws<ArgumentOutOfRangeException>(() => PascalsTriangle.Calculate(-1)); } }
mit
C#
8c126fe539332c7099398caed47478ff47cafeaa
fix crash when logging on archer
Foglio1024/Tera-custom-cooldowns,Foglio1024/Tera-custom-cooldowns
TCC.Core/Controls/ArcherFocusControl.xaml.cs
TCC.Core/Controls/ArcherFocusControl.xaml.cs
using System; using System.ComponentModel; using System.Threading; using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Animation; using TCC.Data; namespace TCC.Controls { /// <inheritdoc cref="UserControl" /> /// <summary> /// Logica di interazione per ArcherFocusControl.xaml /// </summary> public partial class ArcherFocusControl { public ArcherFocusControl() { InitializeComponent(); } private ArcherFocusTracker _context; private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (DesignerProperties.GetIsInDesignMode(this)) return; //lazy way of making sure that DataContext is not null while (_context == null) { _context = (ArcherFocusTracker)DataContext; Thread.Sleep(500); } _context.PropertyChanged += _context_PropertyChanged; } private void _context_PropertyChanged(object sender, PropertyChangedEventArgs e) { if(e.PropertyName == "Refresh") { AnimateArcPartial(_context.Stacks); } else if(e.PropertyName == "StartFocus") { AnimateArcPartial(_context.Stacks); } else if(e.PropertyName == "StartFocusX") { AnimateArc(); } else if(e.PropertyName == "Ended") { ResetArc(); } } private void ResetArc() { InternalArc.BeginAnimation(Arc.StartAngleProperty, new DoubleAnimation(0, TimeSpan.FromMilliseconds(100)) {EasingFunction = new QuadraticEase() }); } private void AnimateArc() { ExternalArc.BeginAnimation(Arc.EndAngleProperty, new DoubleAnimation(359.9,0, TimeSpan.FromMilliseconds(_context.Duration))); } private void AnimateArcPartial(int newStacks) { InternalArc.BeginAnimation(Arc.StartAngleProperty, new DoubleAnimation(newStacks*36, TimeSpan.FromMilliseconds(100)) { EasingFunction = new QuadraticEase() }); } } }
using System; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Animation; using TCC.Data; namespace TCC.Controls { /// <inheritdoc cref="UserControl" /> /// <summary> /// Logica di interazione per ArcherFocusControl.xaml /// </summary> public partial class ArcherFocusControl { public ArcherFocusControl() { InitializeComponent(); } private ArcherFocusTracker _context; private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (DesignerProperties.GetIsInDesignMode(this)) return; _context = (ArcherFocusTracker)DataContext; _context.PropertyChanged += _context_PropertyChanged; } private void _context_PropertyChanged(object sender, PropertyChangedEventArgs e) { if(e.PropertyName == "Refresh") { AnimateArcPartial(_context.Stacks); } else if(e.PropertyName == "StartFocus") { AnimateArcPartial(_context.Stacks); } else if(e.PropertyName == "StartFocusX") { AnimateArc(); } else if(e.PropertyName == "Ended") { ResetArc(); } } private void ResetArc() { InternalArc.BeginAnimation(Arc.StartAngleProperty, new DoubleAnimation(0, TimeSpan.FromMilliseconds(100)) {EasingFunction = new QuadraticEase() }); } private void AnimateArc() { ExternalArc.BeginAnimation(Arc.EndAngleProperty, new DoubleAnimation(359.9,0, TimeSpan.FromMilliseconds(_context.Duration))); } private void AnimateArcPartial(int newStacks) { InternalArc.BeginAnimation(Arc.StartAngleProperty, new DoubleAnimation(newStacks*36, TimeSpan.FromMilliseconds(100)) { EasingFunction = new QuadraticEase() }); } } }
mit
C#
a7feda509e6519269601512f044e289679402a32
Allow clicks on the label to change the radio button.
blackradley/nesscliffe,blackradley/nesscliffe,blackradley/nesscliffe
WebApplication/Helpers/SiteYesNoForHelper.cs
WebApplication/Helpers/SiteYesNoForHelper.cs
using System; using System.Linq.Expressions; using System.Web.Mvc; using System.Web.Mvc.Html; namespace WebApplication.Helpers { public static class SiteYesNoForHelper { /// <summary> /// Extension method to provide consistent radio button layouts. /// </summary> public static MvcHtmlString SiteYesNoFor<TModel, TValue>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TValue>> expression) { //<div class="col-md-3 col-sm-6"> // @Html.LabelFor(model => model.IsRetail) // <label> // @Html.RadioButtonFor(model => model.IsRetail, "true") Yes // @Html.RadioButtonFor(model => model.IsRetail, "false") No // </label> // <a href="#" data-toggle="tooltip" data-title="Is there a shop at your site?"> // <span class="glyphicon glyphicon-info-sign"></span> // </a> //</div> var divBuilder = new TagBuilder("div"); divBuilder.AddCssClass("col-md-3 col-sm-6"); divBuilder.InnerHtml += htmlHelper.LabelFor(expression) + "</br>"; var labelYesBuilder = new TagBuilder("label"); labelYesBuilder.InnerHtml += " "; labelYesBuilder.InnerHtml += htmlHelper.RadioButtonFor(expression, "true") + " Yes "; labelYesBuilder.InnerHtml += "&nbsp;"; var labelNoBuilder = new TagBuilder("label"); labelNoBuilder.InnerHtml += " "; labelNoBuilder.InnerHtml += htmlHelper.RadioButtonFor(expression, "false") + " No "; var helpIcon = " " + htmlHelper.SiteHelpFor(expression); var validation = " " + htmlHelper.ValidationMessageFor(expression); divBuilder.InnerHtml += labelYesBuilder.ToString(); divBuilder.InnerHtml += labelNoBuilder.ToString(); divBuilder.InnerHtml += helpIcon; divBuilder.InnerHtml += validation; return MvcHtmlString.Create(divBuilder.ToString()); } } }
using System; using System.Linq.Expressions; using System.Web.Mvc; using System.Web.Mvc.Html; namespace WebApplication.Helpers { public static class SiteYesNoForHelper { /// <summary> /// Extension method to provide consistent radio button layouts. /// </summary> public static MvcHtmlString SiteYesNoFor<TModel, TValue>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TValue>> expression) { //<div class="col-md-3 col-sm-6"> // @Html.LabelFor(model => model.IsRetail) // <label> // @Html.RadioButtonFor(model => model.IsRetail, "true") Yes // @Html.RadioButtonFor(model => model.IsRetail, "false") No // </label> // <a href="#" data-toggle="tooltip" data-title="Is there a shop at your site?"> // <span class="glyphicon glyphicon-info-sign"></span> // </a> //</div> var divBuilder = new TagBuilder("div"); divBuilder.AddCssClass("col-md-3 col-sm-6"); divBuilder.InnerHtml += htmlHelper.LabelFor(expression) + " "; var labelbuilder = new TagBuilder("label"); labelbuilder.InnerHtml += " "; labelbuilder.InnerHtml += htmlHelper.RadioButtonFor(expression, "true") + " Yes "; labelbuilder.InnerHtml += htmlHelper.RadioButtonFor(expression, "false") + " No "; var helpIcon = " " + htmlHelper.SiteHelpFor(expression); var validation = " " + htmlHelper.ValidationMessageFor(expression); divBuilder.InnerHtml += labelbuilder.ToString(); divBuilder.InnerHtml += helpIcon; divBuilder.InnerHtml += validation; return MvcHtmlString.Create(divBuilder.ToString()); } } }
mit
C#
f5fec8fd225bb3a4c0e173b8a5173b319ed60372
Simplify island get
wwwwwwzx/3DSRNGTool
3DSRNGTool/Gen7/Gen7Encounter/FishingArea7.cs
3DSRNGTool/Gen7/Gen7Encounter/FishingArea7.cs
using Pk3DSRNGTool.Core; namespace Pk3DSRNGTool { public class FishingArea7 : EncounterArea { public override int[] Species { get; set; } = new int[2]; public byte NPC; public bool Longdelay; // 89/97 vs 78 public bool Lapras; // Increase pkm generation delay by 2 public byte LevelMin = 10; public byte LevelMax; public byte SlotType; // Bubbling slottype++ public byte[] getitemslots(bool IsUltraBubbling) { byte[] slots = new byte[2]; int index = Island + (IsUltraBubbling ? 4 : 0); slots[0] = FishingItemSlots[index * 3]; slots[1] = (byte)(FishingItemSlots[index * 3] + FishingItemSlots[index * 3 + 1]); return slots; } private int Island => Location / 50; private static byte[] FishingItemSlots = new byte[] { 50,30,20, 50,30,20, 50,40,10, 60,30,10, 60,30,10, // Ultra Bubbling 45,30,25, 40,30,30, 80,19,01, }; public override int[] getSpecies(int ver, bool IsNight) => (int[])Species.Clone(); } }
using Pk3DSRNGTool.Core; namespace Pk3DSRNGTool { public class FishingArea7 : EncounterArea { public override int[] Species { get; set; } = new int[2]; public byte NPC; public bool Longdelay; // 89/97 vs 78 public bool Lapras; // Increase pkm generation delay by 2 public byte LevelMin = 10; public byte LevelMax; public byte SlotType; // Bubbling slottype++ public byte[] getitemslots(bool IsUltraBubbling) { byte[] slots = new byte[2]; int index = Island + (IsUltraBubbling ? 4 : 0); slots[0] = FishingItemSlots[index * 3]; slots[1] = (byte)(FishingItemSlots[index * 3] + FishingItemSlots[index * 3 + 1]); return slots; } private byte Island { get { if (Location < 50) return 0; if (Location < 106) return 1; if (Location < 156) return 2; return 3; } } private static byte[] FishingItemSlots = new byte[] { 50,30,20, 50,30,20, 50,40,10, 60,30,10, 60,30,10, // Ultra Bubbling 45,30,25, 40,30,30, 80,19,01, }; public override int[] getSpecies(int ver, bool IsNight) => (int[])Species.Clone(); } }
mit
C#
26a836d49531df76714e467ee01ffb213934835c
Fix for json string
DBCG/Dataphor,DBCG/Dataphor,DBCG/Dataphor,DBCG/Dataphor,DBCG/Dataphor,DBCG/Dataphor
Dataphoria/Dataphoria.Web/Controllers/DataController.cs
Dataphoria/Dataphoria.Web/Controllers/DataController.cs
using Alphora.Dataphor.DAE.REST; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Net.Http; using System.Text; using System.Web.Http; using System.Web.Http.Cors; namespace Alphora.Dataphor.Dataphoria.Web.Controllers { [RoutePrefix("data")] [EnableCors("*", "*", "*")] public class DataController : ApiController { [HttpGet, Route("{table}")] public HttpResponseMessage Get(string table) { // Libraries/Qualifiers? // Filter? // Order By? // Project? // Links? // Includes? // Paging? // Functions? var result = ProcessorInstance.Instance.Evaluate(string.Format("select Get('{0}')", table), null); var temp = JsonConvert.SerializeObject(((RESTResult)result).Value); var res = Request.CreateResponse(System.Net.HttpStatusCode.OK); res.Content = new StringContent(temp, Encoding.UTF8, "application/json"); return res; } [HttpGet, Route("{table}/{key}")] public JToken Get(string table, string key) { //select GetByKey('Patients', '1') var result = ProcessorInstance.Instance.Evaluate(string.Format("select GetByKey('{0}', '{1}')", table, key), null); return JsonConvert.SerializeObject(((RESTResult)result).Value); } [HttpPost, Route("{table}")] public void Post(string table, [FromBody]object value) { // TODO: Upsert conditions... ProcessorInstance.Instance.Evaluate(String.Format("Post('{0}', ARow)", table), new Dictionary<string, object> { { "ARow", value } }); } [HttpPut, Route("{table}/{key}")] public void Put(string table, string key, [FromBody]object value) { // TODO: Concurrency using ETags... // TODO: if-match conditions? ProcessorInstance.Instance.Evaluate(String.Format("Put('{0}', '{1}', ARow)", table, key), new Dictionary<string, object> { { "ARow", value } }); } [HttpPatch, Route("{table}/{key}")] public void Patch(string table, string key, [FromBody]object updatedValues) { // TODO: Concurrency using ETags... // TODO: if-match conditions? ProcessorInstance.Instance.Evaluate(String.Format("Patch('{0}', '{1}', ARow)", table, key), new Dictionary<string, object> { { "ARow", updatedValues } }); } [HttpDelete, Route("{table}/{key}")] public void Delete(string table, string key) { ProcessorInstance.Instance.Evaluate(String.Format("Delete('{0}', '{1}')", table, key), null); } } }
using Alphora.Dataphor.DAE.REST; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Web.Http; using System.Web.Http.Cors; namespace Alphora.Dataphor.Dataphoria.Web.Controllers { [RoutePrefix("data")] [EnableCors("*", "*", "*")] public class DataController : ApiController { [HttpGet, Route("{table}")] public JToken Get(string table) { // Libraries/Qualifiers? // Filter? // Order By? // Project? // Links? // Includes? // Paging? // Functions? var result = ProcessorInstance.Instance.Evaluate(string.Format("select Get('{0}')", table), null); return JsonConvert.SerializeObject(((RESTResult)result).Value); } [HttpGet, Route("{table}/{key}")] public JToken Get(string table, string key) { //select GetByKey('Patients', '1') var result = ProcessorInstance.Instance.Evaluate(string.Format("select GetByKey('{0}', '{1}')", table, key), null); return JsonConvert.SerializeObject(((RESTResult)result).Value); } [HttpPost, Route("{table}")] public void Post(string table, [FromBody]object value) { // TODO: Upsert conditions... ProcessorInstance.Instance.Evaluate(String.Format("Post('{0}', ARow)", table), new Dictionary<string, object> { { "ARow", value } }); } [HttpPut, Route("{table}/{key}")] public void Put(string table, string key, [FromBody]object value) { // TODO: Concurrency using ETags... // TODO: if-match conditions? ProcessorInstance.Instance.Evaluate(String.Format("Put('{0}', '{1}', ARow)", table, key), new Dictionary<string, object> { { "ARow", value } }); } [HttpPatch, Route("{table}/{key}")] public void Patch(string table, string key, [FromBody]object updatedValues) { // TODO: Concurrency using ETags... // TODO: if-match conditions? ProcessorInstance.Instance.Evaluate(String.Format("Patch('{0}', '{1}', ARow)", table, key), new Dictionary<string, object> { { "ARow", updatedValues } }); } [HttpDelete, Route("{table}/{key}")] public void Delete(string table, string key) { ProcessorInstance.Instance.Evaluate(String.Format("Delete('{0}', '{1}')", table, key), null); } } }
bsd-3-clause
C#
d6aa5682db14637ef894c4822e928469204e159d
Remove new line
inputfalken/Sharpy
GeneratorAPI/Generator.cs
GeneratorAPI/Generator.cs
using System; namespace GeneratorAPI { public static class Generator { /// <summary> /// <para> /// Contains methods for creating Generators with various Providers. /// </para> /// </summary> public static GeneratorFactory Factory { get; } = new GeneratorFactory(); } /// <summary> /// </summary> /// <typeparam name="TProvider"></typeparam> public class Generator<TProvider> { public Generator(TProvider provider) { Provider = provider; } public TProvider Provider { get; } /// <summary> /// <para> /// Turn Generator into Generation&lt;TResult&gt; /// </para> /// </summary> /// <typeparam name="TResult"></typeparam> /// <param name="fn"></param> /// <returns></returns> public Generation<TResult> Generate<TResult>(Func<TProvider, TResult> fn) { return new Generation<TResult>(() => fn(Provider)); } } /// <summary> /// <para> /// Contains methods for creating Generators with various Providers. /// </para> /// </summary> public class GeneratorFactory { /// <summary> /// <para> /// A Generator using System.Random as provider. /// </para> /// </summary> /// <param name="random"></param> /// <returns></returns> public Generator<Random> RandomGenerator(Random random) { return Create(random); } /// <summary> /// <para> /// Create a Generator with TProivder as provider. /// </para> /// </summary> /// <typeparam name="TProvider"></typeparam> /// <param name="provider"></param> /// <returns></returns> public Generator<TProvider> Create<TProvider>(TProvider provider) { return new Generator<TProvider>(provider); } } }
using System; namespace GeneratorAPI { public static class Generator { /// <summary> /// <para> /// Contains methods for creating Generators with various Providers. /// </para> /// </summary> public static GeneratorFactory Factory { get; } = new GeneratorFactory(); } /// <summary> /// </summary> /// <typeparam name="TProvider"></typeparam> public class Generator<TProvider> { public Generator(TProvider provider) { Provider = provider; } public TProvider Provider { get; } /// <summary> /// <para> /// Turn Generator into Generation&lt;TResult&gt; /// </para> /// </summary> /// <typeparam name="TResult"></typeparam> /// <param name="fn"></param> /// <returns></returns> public Generation<TResult> Generate<TResult>(Func<TProvider, TResult> fn) { return new Generation<TResult>( () => fn(Provider)); } } /// <summary> /// <para> /// Contains methods for creating Generators with various Providers. /// </para> /// </summary> public class GeneratorFactory { /// <summary> /// <para> /// A Generator using System.Random as provider. /// </para> /// </summary> /// <param name="random"></param> /// <returns></returns> public Generator<Random> RandomGenerator(Random random) { return Create(random); } /// <summary> /// <para> /// Create a Generator with TProivder as provider. /// </para> /// </summary> /// <typeparam name="TProvider"></typeparam> /// <param name="provider"></param> /// <returns></returns> public Generator<TProvider> Create<TProvider>(TProvider provider) { return new Generator<TProvider>(provider); } } }
mit
C#
5461188c3912a2dd30f97bfad7ca874ab03281eb
Update DateTimeExtensions.cs
keith-hall/Extensions,keith-hall/Extensions
src/DateTimeExtensions.cs
src/DateTimeExtensions.cs
using System; using System.Globalization; namespace HallLibrary.Extensions { public static class DateTimeExtensions { /// <summary> /// Converts the specified <see cref="DateTime"/> to a <see cref="String"/>, in ISO-8601 format. /// </summary> /// <param name="dt">The date to convert.</param> /// <param name="withT">Whether or not to include the 'T' in the output. If false, a space will be used instead.</param> /// <param name="toUTC">Whether or not to convert the time to UTC or not first.</param> /// <returns>An ISO-8601 formatted <see cref="String"/> representation of the specified <see cref="DateTime"/>.</returns> public static string ToISO8601String(this DateTime dt, bool withT, bool toUTC) { // ISO-8601 date format var utc = dt.ToUniversalTime(); double difference; string offset = string.Empty; if (!toUTC && (difference = dt.Subtract(utc).TotalMinutes) != 0) { var diff = new TimeSpan(0, (int)difference, 0); offset = (diff.Hours > 0 ? @"+" : string.Empty) + diff.Hours.ToString(@"00"); offset += @":" + diff.Minutes.ToString(@"00"); } else { dt = utc; offset = @"Z"; } var formatted = dt.ToString(@"yyyy-MM-ddTHH:mm:ss.fff", CultureInfo.InvariantCulture); if (!withT) formatted = formatted.Replace('T', ' '); return formatted + offset; } } }
using System; using System.Globalization; namespace HallLibrary.Extensions { public static class DateTimeExtensions { public static string ToISO8601String(this DateTime dt) { // ISO-8601 date format return dt.ToString(@"yyyy-MM-ddTHH:mm:ss.fff", CultureInfo.InvariantCulture); } } }
apache-2.0
C#
bf567e6df56fad7ef637a03b274cad2a1afa10fc
Make settings textboxes commit on focus lost
peppy/osu,johnneijzen/osu,peppy/osu-new,smoogipoo/osu,NeoAdonis/osu,johnneijzen/osu,ppy/osu,NeoAdonis/osu,ppy/osu,UselessToucan/osu,smoogipoo/osu,smoogipooo/osu,EVAST9919/osu,peppy/osu,peppy/osu,2yangk23/osu,NeoAdonis/osu,UselessToucan/osu,UselessToucan/osu,smoogipoo/osu,EVAST9919/osu,2yangk23/osu,ppy/osu
osu.Game/Overlays/Settings/SettingsTextBox.cs
osu.Game/Overlays/Settings/SettingsTextBox.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { public class SettingsTextBox : SettingsItem<string> { protected override Drawable CreateControl() => new OsuTextBox { Margin = new MarginPadding { Top = 5 }, RelativeSizeAxes = Axes.X, CommitOnFocusLost = true, }; } }
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { public class SettingsTextBox : SettingsItem<string> { protected override Drawable CreateControl() => new OsuTextBox { Margin = new MarginPadding { Top = 5 }, RelativeSizeAxes = Axes.X, }; } }
mit
C#
fd3340c7260bc6d99c0db07f0b5cfb3647e6251d
Update XPathGeometryTypeConverter.cs
wieslawsoltes/Core2D,Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,Core2D/Core2D
src/Serializer.Xaml/Converters/XPathGeometryTypeConverter.cs
src/Serializer.Xaml/Converters/XPathGeometryTypeConverter.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Globalization; #if NETSTANDARD1_3 using System.ComponentModel; #endif using Core2D.Path; using Core2D.Path.Parser; using Portable.Xaml.ComponentModel; namespace Serializer.Xaml.Converters { /// <summary> /// Defines <see cref="XPathGeometry"/> type converter. /// </summary> internal class XPathGeometryTypeConverter : TypeConverter { /// <inheritdoc/> public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return sourceType == typeof(string); } /// <inheritdoc/> public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { return destinationType == typeof(string); } /// <inheritdoc/> public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { return XPathGeometryParser.Parse((string)value); } /// <inheritdoc/> public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { var geometry = value as XPathGeometry; if (geometry != null) { return geometry.ToString(); } throw new NotSupportedException(); } } }
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Globalization; #if NETSTANDARD1_3 using System.ComponentModel; #else using Portable.Xaml.ComponentModel; #endif using Core2D.Path; using Core2D.Path.Parser; namespace Serializer.Xaml.Converters { /// <summary> /// Defines <see cref="XPathGeometry"/> type converter. /// </summary> internal class XPathGeometryTypeConverter : TypeConverter { /// <inheritdoc/> public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return sourceType == typeof(string); } /// <inheritdoc/> public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { return destinationType == typeof(string); } /// <inheritdoc/> public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { return XPathGeometryParser.Parse((string)value); } /// <inheritdoc/> public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { var geometry = value as XPathGeometry; if (geometry != null) { return geometry.ToString(); } throw new NotSupportedException(); } } }
mit
C#
069d0a0f5d0007a8cdc78b7adb571340456e9329
Update NotesRepository.cs
CarmelSoftware/MVCDataRepositoryXML
Models/NotesRepository.cs
Models/NotesRepository.cs
////// TODO The repo here will take care of all CRUD operations
////// TODO
mit
C#
0687754857db6b9a081256db721b011834258528
Update assembly signature
muojp/ptfluentapi-portable
PivotalTracker.FluentAPI.PCL/Properties/AssemblyInfo.cs
PivotalTracker.FluentAPI.PCL/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("PivotalTracker.FluentAPI.PCL")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("muo_jp")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
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("PivotalTracker.FluentAPI.PCL")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("keinakazawa")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
mit
C#
37bf1aa593da1c0cea441487b2a0a56f996e0bf7
implement StandardSerializator serialize()
zhanglei4214/Cache.NET
SharpCache/Common/Serialization/StandardSerializator.cs
SharpCache/Common/Serialization/StandardSerializator.cs
namespace SharpCache.Common.Serialization { #region Using Directives using System; using System.IO; using System.Xml; using System.Xml.Serialization; #endregion internal class StandardSerializator { public static byte[] Serialize(object value) { if (!value.GetType().IsSerializable) { throw new ArgumentException("The type must be serializable"); } if (ReferenceEquals(value, null)) { throw new NullReferenceException("Souce cannot be null"); } //Remove the namespaces XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); ns.Add("", ""); // Remove the <?xml version="1.0" encoding="utf-8"?> XmlWriterSettings settings = new XmlWriterSettings(); settings.OmitXmlDeclaration = true; StringWriter sw = new StringWriter(); XmlWriter xmlWriter = XmlWriter.Create(sw, settings); XmlSerializer xml = new XmlSerializer(value.GetType()); xml.Serialize(xmlWriter, value, ns); System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); return encoding.GetBytes(sw.ToString()); } public static ISerializableCache Deserialize(byte[] value) { throw new NotImplementedException(); } } }
namespace SharpCache.Common.Serialization { #region Using Directives using System; #endregion internal class StandardSerializator { public static byte[] Serialize(object value) { throw new NotImplementedException(); } public static ISerializableCache Deserialize(byte[] value) { throw new NotImplementedException(); } } }
mit
C#
b205ddd62147a7d4bad60fc674a8ca5c0ff3496d
Reimplement old style of listing for AccessScopeService
clement911/ShopifySharp,nozzlegear/ShopifySharp
ShopifySharp/Services/AccessScope/AccessScopeService.cs
ShopifySharp/Services/AccessScope/AccessScopeService.cs
using ShopifySharp.Filters; using ShopifySharp.Infrastructure; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; using ShopifySharp.Lists; namespace ShopifySharp { /// <summary> /// A service for getting the access scopes associated with the access token /// </summary> public class AccessScopeService : ShopifyService { /// <summary> /// Creates a new instance of the service. /// </summary> /// <param name="myShopifyUrl">The shop's *.myshopify.com URL.</param> /// <param name="shopAccessToken">An API access token for the shop.</param> public AccessScopeService(string myShopifyUrl, string shopAccessToken) : base(myShopifyUrl, shopAccessToken) { } //oauth endpoints don't support versioning protected override bool SupportsAPIVersioning => false; /// <summary> /// Retrieves a list of access scopes associated to the access token. /// </summary> public virtual async Task<IEnumerable<AccessScope>> ListAsync() { var req = PrepareRequest("oauth/access_scopes.json"); var response = await ExecuteRequestAsync<List<AccessScope>>(req, HttpMethod.Get, rootElement: "access_scopes"); return response.Result; } } }
using ShopifySharp.Filters; using ShopifySharp.Infrastructure; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; namespace ShopifySharp { /// <summary> /// A service for getting the access scopes associated with the access token /// </summary> public class AccessScopeService : ShopifyService { /// <summary> /// Creates a new instance of the service. /// </summary> /// <param name="myShopifyUrl">The shop's *.myshopify.com URL.</param> /// <param name="shopAccessToken">An API access token for the shop.</param> public AccessScopeService(string myShopifyUrl, string shopAccessToken) : base(myShopifyUrl, shopAccessToken) { } //oauth endpoints don't support versioning protected override bool SupportsAPIVersioning => false; /// <summary> /// Retrieves a list of access scopes associated to the access token. /// </summary> public virtual async Task<IEnumerable<AccessScope>> ListAsync(IListFilter filter) { throw new System.Exception("not yet implemented"); // return await ExecuteRequestAsync<List<AccessScope>>(req, HttpMethod.Get, rootElement: "access_scopes"); } } }
mit
C#
e43dba8084b47fc5b9649f49ce4316cf4b855e7c
Update nuget url to https
NuGetPackageExplorer/NuGetPackageExplorer,campersau/NuGetPackageExplorer,NuGetPackageExplorer/NuGetPackageExplorer
Core/NuGetConstants.cs
Core/NuGetConstants.cs
namespace NuGetPe { public static class NuGetConstants { public static readonly string DefaultFeedUrl = "https://www.nuget.org/api/v2/"; public static readonly string V2LegacyFeedUrl = "https://nuget.org/api/v2/"; public static readonly string PluginFeedUrl = "http://www.myget.org/F/npe/"; public const string V2LegacyNuGetPublishFeed = "https://nuget.org"; public const string NuGetPublishFeed = "https://www.nuget.org"; } }
namespace NuGetPe { public static class NuGetConstants { public static readonly string DefaultFeedUrl = "http://www.nuget.org/api/v2/"; public static readonly string V2LegacyFeedUrl = "https://nuget.org/api/v2/"; public static readonly string PluginFeedUrl = "http://www.myget.org/F/npe/"; public const string V2LegacyNuGetPublishFeed = "https://nuget.org"; public const string NuGetPublishFeed = "https://www.nuget.org"; } }
mit
C#
31230a0ae8bd8a27ccd9355da61ac25ce601b554
Add interface
MistyKuu/bitbucket-for-visual-studio,MistyKuu/bitbucket-for-visual-studio
Source/GitClientVS.Contracts/Interfaces/Services/IGitWatcher.cs
Source/GitClientVS.Contracts/Interfaces/Services/IGitWatcher.cs
using GitClientVS.Contracts.Models.GitClientModels; namespace GitClientVS.Contracts.Interfaces.Services { public interface IGitWatcher { GitRemoteRepository ActiveRepo { get; } } }
namespace GitClientVS.Contracts.Interfaces.Services { public interface IGitWatcher { } }
mit
C#
e59bd73db7553c6976e6759afef6cb1699521d62
update version
prodot/ReCommended-Extension
Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
using System.Reflection; using ReCommendedExtension; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle(ZoneMarker.ExtensionName)] [assembly: AssemblyDescription(ZoneMarker.ExtensionDescription)] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("prodot GmbH")] [assembly: AssemblyProduct(ZoneMarker.ExtensionId)] [assembly: AssemblyCopyright("© 2012-2019 prodot GmbH")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("3.6.3.0")] [assembly: AssemblyFileVersion("3.6.3")]
using System.Reflection; using ReCommendedExtension; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle(ZoneMarker.ExtensionName)] [assembly: AssemblyDescription(ZoneMarker.ExtensionDescription)] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("prodot GmbH")] [assembly: AssemblyProduct(ZoneMarker.ExtensionId)] [assembly: AssemblyCopyright("© 2012-2019 prodot GmbH")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("3.6.2.0")] [assembly: AssemblyFileVersion("3.6.2")]
apache-2.0
C#
f1c6ae026b408ceb8657d1facbfa6aeac38d53f7
Add GetCandles to PatternForm
alexeykuzmin0/DTW
DTW/GUI/PatternForm.cs
DTW/GUI/PatternForm.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace GUI { public partial class PatternForm : Form { Finance.AbstractCandleTokenizer candles; public PatternForm(Finance.AbstractCandleTokenizer ct) { InitializeComponent(); candles = ct; candleStickChart1.SetCandles(ct); candleStickChart1.GraphPane.Title.IsVisible = false; candleStickChart1.IsModifiable = true; candleStickChart1.IsShowHScrollBar = false; } private void button1_Click(object sender, EventArgs e) { if (saveFileDialog1.ShowDialog() == DialogResult.OK) { candles.Save(new System.IO.StreamWriter(saveFileDialog1.FileName)); } } private void button2_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { candles = new Finance.CandleTokenizer(new System.IO.StreamReader(openFileDialog1.FileName)); candleStickChart1.SetCandles(candles); candleStickChart1.Invalidate(); } } public Finance.AbstractCandleTokenizer GetCandles() { return candles; } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace GUI { public partial class PatternForm : Form { Finance.AbstractCandleTokenizer candles; public PatternForm(Finance.AbstractCandleTokenizer ct) { InitializeComponent(); candles = ct; candleStickChart1.SetCandles(ct); candleStickChart1.GraphPane.Title.IsVisible = false; candleStickChart1.IsModifiable = true; candleStickChart1.IsShowHScrollBar = false; } private void button1_Click(object sender, EventArgs e) { if (saveFileDialog1.ShowDialog() == DialogResult.OK) { candles.Save(new System.IO.StreamWriter(saveFileDialog1.FileName)); } } private void button2_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { candles = new Finance.CandleTokenizer(new System.IO.StreamReader(openFileDialog1.FileName)); candleStickChart1.SetCandles(candles); candleStickChart1.Invalidate(); } } } }
apache-2.0
C#
c1af5824a0aa02f924e4178f42e6106c5b380d79
Bump nuget packages to v2.0.0-beta2
honestegg/cassette,damiensawyer/cassette,BluewireTechnologies/cassette,andrewdavey/cassette,BluewireTechnologies/cassette,andrewdavey/cassette,honestegg/cassette,andrewdavey/cassette,damiensawyer/cassette,damiensawyer/cassette,honestegg/cassette
src/SharedAssemblyInfo.cs
src/SharedAssemblyInfo.cs
using System.Reflection; [assembly: AssemblyCompany("Andrew Davey")] [assembly: AssemblyProduct("Cassette")] [assembly: AssemblyCopyright("Copyright © 2011 Andrew Davey")] [assembly: AssemblyInformationalVersion("2.0.0-beta2")] [assembly: AssemblyVersion("2.0.0.*")] [assembly: AssemblyFileVersion("2.0.0.0")]
using System.Reflection; [assembly: AssemblyCompany("Andrew Davey")] [assembly: AssemblyProduct("Cassette")] [assembly: AssemblyCopyright("Copyright © 2011 Andrew Davey")] [assembly: AssemblyInformationalVersion("2.0.0-beta1")] [assembly: AssemblyVersion("2.0.0.*")] [assembly: AssemblyFileVersion("2.0.0.0")]
mit
C#
63a012ef142bdb2785d0405af641cdffeb153502
Update SheetFilterType.cs
smartsheet-platform/smartsheet-csharp-sdk,smartsheet-platform/smartsheet-csharp-sdk
main/Smartsheet/Api/Models/SheetFilterType.cs
main/Smartsheet/Api/Models/SheetFilterType.cs
// #[license] // SmartsheetClient SDK for C# // %% // Copyright (C) 2018 SmartsheetClient // %% // 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. // %[license] using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Smartsheet.Api.Models { /// <summary> /// Represents the types of sheet filters /// </summary> public enum SheetFilterType { ADHOC, PERSONAL, SHARED } }
// #[license] // SmartsheetClient SDK for C# // %% // Copyright (C) 2018 SmartsheetClient // %% // 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. // %[license] using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Smartsheet.Api.Models { /// <summary> /// Represents the types of sheet filters /// </summary> public enum SheetFilterType { ADHOC, PERSONAL, SHARED } }
apache-2.0
C#
e659fc18ba76ae619d376de65b20a6212aadc0e8
add HitTestContext.layerMask, HitTestContext.maxDistance
fairygui/FairyGUI-unity
Source/Scripts/Core/HitTest/HitTestContext.cs
Source/Scripts/Core/HitTest/HitTestContext.cs
using System.Collections.Generic; using UnityEngine; namespace FairyGUI { /// <summary> /// /// </summary> public class HitTestContext { //set before hit test public static Vector2 screenPoint; public static Vector3 worldPoint; public static Vector3 direction; public static bool forTouch; public static int layerMask = -1; public static float maxDistance = Mathf.Infinity; static Dictionary<Camera, RaycastHit?> raycastHits = new Dictionary<Camera, RaycastHit?>(); /// <summary> /// /// </summary> /// <param name="camera"></param> /// <param name="hit"></param> /// <returns></returns> public static bool GetRaycastHitFromCache(Camera camera, out RaycastHit hit) { RaycastHit? hitRef; if (!HitTestContext.raycastHits.TryGetValue(camera, out hitRef)) { Ray ray = camera.ScreenPointToRay(HitTestContext.screenPoint); if (Physics.Raycast(ray, out hit, maxDistance, layerMask)) { HitTestContext.raycastHits[camera] = hit; return true; } else { HitTestContext.raycastHits[camera] = null; return false; } } else if (hitRef == null) { hit = new RaycastHit(); return false; } else { hit = (RaycastHit)hitRef; return true; } } /// <summary> /// /// </summary> /// <param name="camera"></param> /// <param name="hit"></param> public static void CacheRaycastHit(Camera camera, ref RaycastHit hit) { HitTestContext.raycastHits[camera] = hit; } /// <summary> /// /// </summary> public static void ClearRaycastHitCache() { raycastHits.Clear(); } } }
using System.Collections.Generic; using UnityEngine; namespace FairyGUI { /// <summary> /// /// </summary> public class HitTestContext { //set before hit test public static Vector2 screenPoint; public static Vector3 worldPoint; public static Vector3 direction; public static bool forTouch; static Dictionary<Camera, RaycastHit?> raycastHits = new Dictionary<Camera, RaycastHit?>(); /// <summary> /// /// </summary> /// <param name="camera"></param> /// <param name="hit"></param> /// <returns></returns> public static bool GetRaycastHitFromCache(Camera camera, out RaycastHit hit) { RaycastHit? hitRef; if (!HitTestContext.raycastHits.TryGetValue(camera, out hitRef)) { Ray ray = camera.ScreenPointToRay(HitTestContext.screenPoint); if (Physics.Raycast(ray, out hit)) { HitTestContext.raycastHits[camera] = hit; return true; } else { HitTestContext.raycastHits[camera] = null; return false; } } else if (hitRef == null) { hit = new RaycastHit(); return false; } else { hit = (RaycastHit)hitRef; return true; } } /// <summary> /// /// </summary> /// <param name="camera"></param> /// <param name="hit"></param> public static void CacheRaycastHit(Camera camera, ref RaycastHit hit) { HitTestContext.raycastHits[camera] = hit; } /// <summary> /// /// </summary> public static void ClearRaycastHitCache() { raycastHits.Clear(); } } }
mit
C#
f75e6c307df4189a75e56aab01ab0a2ab16c475a
Remove reference to unused "Tasks".
ivanpointer/NuLog,ivanpointer/NuLog,ivanpointer/NuLog,ivanpointer/NuLog,ivanpointer/NuLog
Take2/NuLog/Targets/ConsoleTarget.cs
Take2/NuLog/Targets/ConsoleTarget.cs
/* © 2017 Ivan Pointer MIT License: https://github.com/ivanpointer/NuLog/blob/master/LICENSE Source on GitHub: https://github.com/ivanpointer/NuLog */ using NuLog.LogEvents; using System; namespace NuLog.Targets { public class ConsoleTarget : LayoutTargetBase { public override void Write(LogEvent logEvent) { var message = Layout.Format(logEvent); Console.Write(message); } } }
/* © 2017 Ivan Pointer MIT License: https://github.com/ivanpointer/NuLog/blob/master/LICENSE Source on GitHub: https://github.com/ivanpointer/NuLog */ using NuLog.LogEvents; using System; using System.Threading.Tasks; namespace NuLog.Targets { public class ConsoleTarget : LayoutTargetBase { public override void Write(LogEvent logEvent) { var message = Layout.Format(logEvent); Console.Write(message); } } }
mit
C#
e9e4427b42f4a8db052d300862b0969206dc84b2
Update core-setup dependency versions (#3231)
mlorbetske/cli,borgdylan/dotnet-cli,ravimeda/cli,ravimeda/cli,mylibero/cli,johnbeisner/cli,mlorbetske/cli,naamunds/cli,johnbeisner/cli,mylibero/cli,JohnChen0/cli,Faizan2304/cli,AbhitejJohn/cli,AbhitejJohn/cli,blackdwarf/cli,Faizan2304/cli,weshaggard/cli,svick/cli,MichaelSimons/cli,FubarDevelopment/cli,svick/cli,MichaelSimons/cli,weshaggard/cli,JohnChen0/cli,mlorbetske/cli,naamunds/cli,MichaelSimons/cli,ravimeda/cli,mylibero/cli,Faizan2304/cli,blackdwarf/cli,AbhitejJohn/cli,harshjain2/cli,naamunds/cli,dasMulli/cli,mylibero/cli,naamunds/cli,EdwardBlair/cli,borgdylan/dotnet-cli,livarcocc/cli-1,jonsequitur/cli,harshjain2/cli,borgdylan/dotnet-cli,blackdwarf/cli,weshaggard/cli,nguerrera/cli,nguerrera/cli,weshaggard/cli,JohnChen0/cli,JohnChen0/cli,FubarDevelopment/cli,FubarDevelopment/cli,MichaelSimons/cli,blackdwarf/cli,mylibero/cli,livarcocc/cli-1,EdwardBlair/cli,jonsequitur/cli,livarcocc/cli-1,weshaggard/cli,AbhitejJohn/cli,harshjain2/cli,svick/cli,borgdylan/dotnet-cli,nguerrera/cli,MichaelSimons/cli,jonsequitur/cli,borgdylan/dotnet-cli,EdwardBlair/cli,nguerrera/cli,naamunds/cli,johnbeisner/cli,dasMulli/cli,dasMulli/cli,jonsequitur/cli,FubarDevelopment/cli,mlorbetske/cli
build_projects/shared-build-targets-utils/DependencyVersions.cs
build_projects/shared-build-targets-utils/DependencyVersions.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Microsoft.DotNet.Cli.Build { public class DependencyVersions { public static readonly string CoreCLRVersion = "1.0.2-rc3-24123-01"; public static readonly string SharedFrameworkVersion = "1.0.0-rc3-004308"; public static readonly string SharedHostVersion = "1.0.1-rc3-004308-00"; public static readonly string SharedFrameworkChannel = "preview"; public static readonly string SharedHostChannel = "preview"; } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Microsoft.DotNet.Cli.Build { public class DependencyVersions { public static readonly string CoreCLRVersion = "1.0.2-rc3-24123-01"; public static readonly string SharedFrameworkVersion = "1.0.0-rc3-004306"; public static readonly string SharedHostVersion = "1.0.1-rc3-004306-00"; public static readonly string SharedFrameworkChannel = "preview"; public static readonly string SharedHostChannel = "preview"; } }
mit
C#
7e321e4833740559a86ae1692122d5db3b654b65
Fix serialization bug -- Airport cannot be deserialized
karolz-ms/diagnostics-eventflow
AirTrafficControl.Interfaces/Fix.cs
AirTrafficControl.Interfaces/Fix.cs
using System; using System.Runtime.Serialization; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AirTrafficControl.Interfaces { [DataContract] [KnownType(typeof(Airport))] public class Fix { public Fix(string name, string displayName) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException(); } Name = name; DisplayName = displayName; } [DataMember] public string Name { get; private set; } [DataMember] public string DisplayName { get; private set; } public override bool Equals(object obj) { Fix other = obj as Fix; if (other == null) { return false; } return this.Name == other.Name; } public override int GetHashCode() { return Name.GetHashCode(); } public override string ToString() { return Name; } } }
using System; using System.Runtime.Serialization; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AirTrafficControl.Interfaces { [DataContract] public class Fix { public Fix(string name, string displayName) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException(); } Name = name; DisplayName = displayName; } [DataMember] public string Name { get; private set; } [DataMember] public string DisplayName { get; private set; } public override bool Equals(object obj) { Fix other = obj as Fix; if (other == null) { return false; } return this.Name == other.Name; } public override int GetHashCode() { return Name.GetHashCode(); } public override string ToString() { return Name; } } }
mit
C#
e2ea92e21f7d3a6fad4459a8cfdaadbbcfead410
Use framework method to convert rad to deg
smoogipoo/osu,ppy/osu,EVAST9919/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,UselessToucan/osu,peppy/osu,ppy/osu,smoogipoo/osu,EVAST9919/osu,smoogipooo/osu,peppy/osu-new,peppy/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,NeoAdonis/osu
osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs
osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Utils; using osu.Game.Graphics; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Objects.Drawables; namespace osu.Game.Rulesets.Osu.Mods { public class OsuModSpunOut : Mod, IApplicableToDrawableHitObjects { public override string Name => "Spun Out"; public override string Acronym => "SO"; public override IconUsage? Icon => OsuIcon.ModSpunout; public override ModType Type => ModType.Automation; public override string Description => @"Spinners will be automatically completed."; public override double ScoreMultiplier => 0.9; public override bool Ranked => true; public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(OsuModAutopilot) }; public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables) { foreach (var hitObject in drawables) { if (hitObject is DrawableSpinner spinner) { spinner.Disc.Enabled = false; spinner.OnUpdate += autoSpin; } } } private void autoSpin(Drawable drawable) { if (drawable is DrawableSpinner spinner) { if (spinner.Disc.Valid) spinner.Disc.Rotate(MathUtils.RadiansToDegrees((float)spinner.Clock.ElapsedFrameTime * 0.03f)); if (!spinner.SpmCounter.IsPresent) spinner.SpmCounter.FadeIn(spinner.HitObject.TimeFadeIn); } } } }
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Objects.Drawables; namespace osu.Game.Rulesets.Osu.Mods { public class OsuModSpunOut : Mod, IApplicableToDrawableHitObjects { public override string Name => "Spun Out"; public override string Acronym => "SO"; public override IconUsage? Icon => OsuIcon.ModSpunout; public override ModType Type => ModType.Automation; public override string Description => @"Spinners will be automatically completed."; public override double ScoreMultiplier => 0.9; public override bool Ranked => true; public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(OsuModAutopilot) }; public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables) { foreach (var hitObject in drawables) { if (hitObject is DrawableSpinner spinner) { spinner.Disc.Enabled = false; spinner.OnUpdate += autoSpin; } } } private void autoSpin(Drawable drawable) { if (drawable is DrawableSpinner spinner) { if (spinner.Disc.Valid) spinner.Disc.Rotate(180 / MathF.PI * (float)spinner.Clock.ElapsedFrameTime * 0.03f); if (!spinner.SpmCounter.IsPresent) spinner.SpmCounter.FadeIn(spinner.HitObject.TimeFadeIn); } } } }
mit
C#
64f62ad1b93060b10392ee0d921ea3e9736624ab
Rename JoystickEvent.PressedJoystickButtons -> PressedButtons
EVAST9919/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,DrabWeb/osu-framework,peppy/osu-framework,Tom94/osu-framework,DrabWeb/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,ZLima12/osu-framework,DrabWeb/osu-framework,Tom94/osu-framework,ppy/osu-framework
osu.Framework/Input/Events/JoystickButtonEvent.cs
osu.Framework/Input/Events/JoystickButtonEvent.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <[email protected]>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System.Collections.Generic; using osu.Framework.Extensions.TypeExtensions; using osu.Framework.Input.States; namespace osu.Framework.Input.Events { /// <summary> /// Events of a joystick button. /// </summary> public abstract class JoystickButtonEvent : UIEvent { public readonly JoystickButton Button; protected JoystickButtonEvent(InputState state, JoystickButton button) : base(state) { Button = button; } /// <summary> /// List of currently pressed joystick buttons. /// </summary> public IEnumerable<JoystickButton> PressedButtons => CurrentState.Joystick.Buttons; /// <summary> /// List of joystick axes. Axes which have zero value may be omitted. /// </summary> public IEnumerable<JoystickAxis> Axes => CurrentState.Joystick.Axes; public override string ToString() => $"{GetType().ReadableName()}({Button})"; } }
// Copyright (c) 2007-2018 ppy Pty Ltd <[email protected]>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System.Collections.Generic; using osu.Framework.Extensions.TypeExtensions; using osu.Framework.Input.States; namespace osu.Framework.Input.Events { /// <summary> /// Events of a joystick button. /// </summary> public abstract class JoystickButtonEvent : UIEvent { public readonly JoystickButton Button; protected JoystickButtonEvent(InputState state, JoystickButton button) : base(state) { Button = button; } /// <summary> /// List of currently pressed joystick buttons. /// </summary> public IEnumerable<JoystickButton> PressedJoystickButtons => CurrentState.Joystick.Buttons; /// <summary> /// List of joystick axes. Axes which have zero value may be omitted. /// </summary> public IEnumerable<JoystickAxis> JoystickAxes => CurrentState.Joystick.Axes; public override string ToString() => $"{GetType().ReadableName()}({Button})"; } }
mit
C#
6534ac8c2cc07212e15326e7f0c409e836fef34e
fix for #56
rough007/PythLR
CyLR/src/archive/SharpZipArchive.cs
CyLR/src/archive/SharpZipArchive.cs
#if DOT_NET_4_0 using System; using System.IO; using ICSharpCode.SharpZipLib.Core; using ICSharpCode.SharpZipLib.Zip; namespace CyLR.archive { class SharpZipArchive : Archive { private readonly ZipOutputStream archive; public SharpZipArchive(Stream destination, String password) : base(destination) { archive = new ZipOutputStream(destination); archive.IsStreamOwner = false; if (!string.IsNullOrEmpty(password)) { archive.Password = password; } } protected override void WriteStreamToArchive(string entryName, Stream stream, DateTimeOffset timestamp) { var entry = new ZipEntry(entryName) { DateTime = timestamp.DateTime }; archive.PutNextEntry(entry); archive.SetLevel(3); StreamUtils.Copy(stream, archive, new byte[4096]); archive.CloseEntry(); } protected override void Dispose(bool disposing) { if (disposing) { archive.Dispose(); } } } } #endif
#if DOT_NET_4_0 using System; using System.IO; using ICSharpCode.SharpZipLib.Core; using ICSharpCode.SharpZipLib.Zip; namespace CyLR.archive { class SharpZipArchive : Archive { private readonly ZipOutputStream archive; public SharpZipArchive(Stream destination, String password) : base(destination) { archive = new ZipOutputStream(destination); archive.IsStreamOwner = false; if (string.IsNullOrEmpty(password)) { archive.Password = password; } } protected override void WriteStreamToArchive(string entryName, Stream stream, DateTimeOffset timestamp) { var entry = new ZipEntry(entryName) { DateTime = timestamp.DateTime }; archive.PutNextEntry(entry); archive.SetLevel(3); StreamUtils.Copy(stream, archive, new byte[4096]); archive.CloseEntry(); } protected override void Dispose(bool disposing) { if (disposing) { archive.Dispose(); } } } } #endif
apache-2.0
C#
63e7abde53ffa6cea674b65ebf73e6ac19fb81eb
Bump version to 10.2.0.23180
HearthSim/HearthDb
HearthDb/Properties/AssemblyInfo.cs
HearthDb/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("HearthDb")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("HearthSim")] [assembly: AssemblyProduct("HearthDb")] [assembly: AssemblyCopyright("Copyright © HearthSim 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("7ed14243-e02b-4b94-af00-a67a62c282f0")] // 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("10.2.0.23180")] [assembly: AssemblyFileVersion("10.2.0.23180")]
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("HearthDb")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("HearthSim")] [assembly: AssemblyProduct("HearthDb")] [assembly: AssemblyCopyright("Copyright © HearthSim 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("7ed14243-e02b-4b94-af00-a67a62c282f0")] // 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("10.0.0.22611")] [assembly: AssemblyFileVersion("10.0.0.22611")]
mit
C#
b783daa7e84bac981771818fe213beb2a8ea48c9
Update StringExtensions.cs
BenjaminAbt/snippets
CSharp/StringExtensions.cs
CSharp/StringExtensions.cs
using System; namespace SchwabenCode.Core { public static class StringExtensions { /// <summary> /// Cuts a string with the given max length /// </summary> public static string WithMaxLength(this string value, int maxLength) { return value?.Substring(0, Math.Min(value.Length, maxLength)); } } }
using System; namespace SchwabenCode.StringExtensions { public static class StringExtensions { /// <summary> /// Cuts a string with the given max length /// </summary> public static string WithMaxLength(this string value, int maxLength) { return value?.Substring(0, Math.Min(value.Length, maxLength)); } } }
mit
C#
1d2f2e44a73683db188c610009a28e43b508398f
Improve SchemeHandler documentation
battewr/CefSharp,battewr/CefSharp,windygu/CefSharp,illfang/CefSharp,ruisebastiao/CefSharp,jamespearce2006/CefSharp,Livit/CefSharp,wangzheng888520/CefSharp,rlmcneary2/CefSharp,jamespearce2006/CefSharp,jamespearce2006/CefSharp,AJDev77/CefSharp,AJDev77/CefSharp,zhangjingpu/CefSharp,wangzheng888520/CefSharp,joshvera/CefSharp,twxstar/CefSharp,windygu/CefSharp,illfang/CefSharp,NumbersInternational/CefSharp,ruisebastiao/CefSharp,Haraguroicha/CefSharp,battewr/CefSharp,gregmartinhtc/CefSharp,haozhouxu/CefSharp,yoder/CefSharp,ITGlobal/CefSharp,rlmcneary2/CefSharp,twxstar/CefSharp,illfang/CefSharp,joshvera/CefSharp,ruisebastiao/CefSharp,jamespearce2006/CefSharp,haozhouxu/CefSharp,yoder/CefSharp,Haraguroicha/CefSharp,battewr/CefSharp,NumbersInternational/CefSharp,VioletLife/CefSharp,rlmcneary2/CefSharp,jamespearce2006/CefSharp,illfang/CefSharp,ITGlobal/CefSharp,joshvera/CefSharp,twxstar/CefSharp,windygu/CefSharp,yoder/CefSharp,ruisebastiao/CefSharp,zhangjingpu/CefSharp,haozhouxu/CefSharp,gregmartinhtc/CefSharp,yoder/CefSharp,Livit/CefSharp,rlmcneary2/CefSharp,Livit/CefSharp,dga711/CefSharp,joshvera/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,Haraguroicha/CefSharp,ITGlobal/CefSharp,AJDev77/CefSharp,zhangjingpu/CefSharp,NumbersInternational/CefSharp,twxstar/CefSharp,VioletLife/CefSharp,AJDev77/CefSharp,gregmartinhtc/CefSharp,Haraguroicha/CefSharp,Haraguroicha/CefSharp,dga711/CefSharp,zhangjingpu/CefSharp,haozhouxu/CefSharp,windygu/CefSharp,wangzheng888520/CefSharp,dga711/CefSharp,ITGlobal/CefSharp,wangzheng888520/CefSharp,NumbersInternational/CefSharp,VioletLife/CefSharp,VioletLife/CefSharp,dga711/CefSharp
CefSharp/ISchemeHandler.cs
CefSharp/ISchemeHandler.cs
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. namespace CefSharp { public interface ISchemeHandler { /// <summary> /// Processes a custom scheme-based request asynchronously. /// The implementing method should call <see cref="ISchemeHandlerResponse.ProcessRequestCallback"/> when complete. /// </summary> /// <param name="request">The request object.</param> /// <param name="response">The <see cref="ISchemeHandlerResponse"/> object in which the handler is supposed to place the response /// information.</param> /// <returns>true if the request is handled, false otherwise.</returns> bool ProcessRequestAsync(IRequest request, ISchemeHandlerResponse response); } }
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. namespace CefSharp { public interface ISchemeHandler { /// <summary> /// Processes a custom scheme-based request asynchronously. The implementing method should call the callback whenever the /// request is completed. /// </summary> /// <param name="request">The request object.</param> /// <param name="response">The SchemeHandlerResponse object in which the handler is supposed to place the response /// information.</param> /// <returns>true if the request is handled, false otherwise.</returns> bool ProcessRequestAsync(IRequest request, ISchemeHandlerResponse response); } }
bsd-3-clause
C#
ce780bf948e9223b38a6255f4de25eeb868b6ac0
Fix TextInputSource getting created when there's no window for it to use.
RedNesto/osu-framework,DrabWeb/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,Tom94/osu-framework,naoey/osu-framework,ppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,DrabWeb/osu-framework,ppy/osu-framework,RedNesto/osu-framework,peppy/osu-framework,Tom94/osu-framework,default0/osu-framework,paparony03/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,Nabile-Rahmani/osu-framework,EVAST9919/osu-framework,Nabile-Rahmani/osu-framework,default0/osu-framework,paparony03/osu-framework,naoey/osu-framework,DrabWeb/osu-framework
osu.Framework.Desktop/Platform/DesktopGameHost.cs
osu.Framework.Desktop/Platform/DesktopGameHost.cs
// Copyright (c) 2007-2016 ppy Pty Ltd <[email protected]>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System.Threading.Tasks; using osu.Framework.Platform; using OpenTK; using osu.Framework.Desktop.Input; using osu.Framework.Input; namespace osu.Framework.Desktop.Platform { public abstract class DesktopGameHost : BasicGameHost { private TcpIpcProvider IpcProvider; private Task IpcTask; public DesktopGameHost(string gameName = @"", bool bindIPCPort = false) : base(gameName) { if (bindIPCPort) { IpcProvider = new TcpIpcProvider(); IsPrimaryInstance = IpcProvider.Bind(); if (IsPrimaryInstance) { IpcProvider.MessageReceived += msg => OnMessageReceived(msg); IpcTask = IpcProvider.Start(); } } } public override TextInputSource GetTextInput() => Window == null ? null : new GameWindowTextInput(Window); protected override void LoadGame(BaseGame game) { //delay load until we have a size. if (Size == Vector2.Zero) { UpdateScheduler.Add(delegate { LoadGame(game); }); return; } base.LoadGame(game); } public override async Task SendMessage(IpcMessage message) { await IpcProvider.SendMessage(message); } protected override void Dispose(bool isDisposing) { IpcProvider?.Dispose(); IpcTask?.Wait(50); base.Dispose(isDisposing); } } }
// Copyright (c) 2007-2016 ppy Pty Ltd <[email protected]>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System.Threading.Tasks; using osu.Framework.Platform; using OpenTK; using osu.Framework.Desktop.Input; using osu.Framework.Input; namespace osu.Framework.Desktop.Platform { public abstract class DesktopGameHost : BasicGameHost { private TcpIpcProvider IpcProvider; private Task IpcTask; public DesktopGameHost(string gameName = @"", bool bindIPCPort = false) : base(gameName) { if (bindIPCPort) { IpcProvider = new TcpIpcProvider(); IsPrimaryInstance = IpcProvider.Bind(); if (IsPrimaryInstance) { IpcProvider.MessageReceived += msg => OnMessageReceived(msg); IpcTask = IpcProvider.Start(); } } } public override TextInputSource GetTextInput() => new GameWindowTextInput(Window); protected override void LoadGame(BaseGame game) { //delay load until we have a size. if (Size == Vector2.Zero) { UpdateScheduler.Add(delegate { LoadGame(game); }); return; } base.LoadGame(game); } public override async Task SendMessage(IpcMessage message) { await IpcProvider.SendMessage(message); } protected override void Dispose(bool isDisposing) { IpcProvider?.Dispose(); IpcTask?.Wait(50); base.Dispose(isDisposing); } } }
mit
C#
54f6d569fdc0a5a47ee6cef7e16a35e36fa22950
Simplify the .pro file names
markfinal/BuildAMation,markfinal/BuildAMation,markfinal/BuildAMation,markfinal/BuildAMation,markfinal/BuildAMation
packages/QtCreatorBuilder/dev/QtCreatorBuilder.cs
packages/QtCreatorBuilder/dev/QtCreatorBuilder.cs
// <copyright file="QtCreatorBuilder.cs" company="Mark Final"> // Opus package // </copyright> // <summary>QtCreator package</summary> // <author>Mark Final</author> [assembly: Opus.Core.DeclareBuilder("QtCreator", typeof(QtCreatorBuilder.QtCreatorBuilder))] // Automatically generated by Opus v0.20 namespace QtCreatorBuilder { public sealed partial class QtCreatorBuilder : Opus.Core.IBuilder { public static string GetProFilePath(Opus.Core.DependencyNode node) { //string proFileDirectory = System.IO.Path.Combine(node.GetModuleBuildDirectory(), "QMake"); string proFileDirectory = node.GetModuleBuildDirectory(); //string proFilePath = System.IO.Path.Combine(proFileDirectory, System.String.Format("{0}_{1}.pro", node.UniqueModuleName, node.Target)); string proFilePath = System.IO.Path.Combine(proFileDirectory, System.String.Format("{0}.pro", node.ModuleName)); Opus.Core.Log.MessageAll("ProFile : '{0}'", proFilePath); return proFilePath; } public static string GetQtConfiguration(Opus.Core.Target target) { if (target.Configuration != Opus.Core.EConfiguration.Debug && target.Configuration != Opus.Core.EConfiguration.Optimized) { throw new Opus.Core.Exception("QtCreator only supports debug and optimized configurations"); } string QtCreatorConfiguration = (target.Configuration == Opus.Core.EConfiguration.Debug) ? "debug" : "release"; return QtCreatorConfiguration; } } }
// <copyright file="QtCreatorBuilder.cs" company="Mark Final"> // Opus package // </copyright> // <summary>QtCreator package</summary> // <author>Mark Final</author> [assembly: Opus.Core.DeclareBuilder("QtCreator", typeof(QtCreatorBuilder.QtCreatorBuilder))] // Automatically generated by Opus v0.20 namespace QtCreatorBuilder { public sealed partial class QtCreatorBuilder : Opus.Core.IBuilder { public static string GetProFilePath(Opus.Core.DependencyNode node) { //string proFileDirectory = System.IO.Path.Combine(node.GetModuleBuildDirectory(), "QMake"); string proFileDirectory = node.GetModuleBuildDirectory(); string proFilePath = System.IO.Path.Combine(proFileDirectory, System.String.Format("{0}_{1}.pro", node.UniqueModuleName, node.Target)); Opus.Core.Log.MessageAll("ProFile : '{0}'", proFilePath); return proFilePath; } public static string GetQtConfiguration(Opus.Core.Target target) { if (target.Configuration != Opus.Core.EConfiguration.Debug && target.Configuration != Opus.Core.EConfiguration.Optimized) { throw new Opus.Core.Exception("QtCreator only supports debug and optimized configurations"); } string QtCreatorConfiguration = (target.Configuration == Opus.Core.EConfiguration.Debug) ? "debug" : "release"; return QtCreatorConfiguration; } } }
bsd-3-clause
C#
a49d6139f709aad72119ddd290a7c7425b369254
Add instanceperrequest lifetime scope to all services
erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner
Zk/App_Start/IocConfig.cs
Zk/App_Start/IocConfig.cs
using System.Web.Mvc; using Autofac; using Autofac.Integration.Mvc; using Zk.Models; using Zk.Services; using Zk.Repositories; namespace Zk { public static class IocConfig { public static void RegisterDependencies() { var builder = new ContainerBuilder(); builder.RegisterControllers(typeof(MvcApplication).Assembly); builder.RegisterType<ZkContext>() .As<IZkContext>() .InstancePerRequest(); builder.RegisterType<Repository>() .InstancePerRequest(); builder.RegisterType<AuthenticationService>() .InstancePerRequest(); builder.RegisterType<UserService>() .Keyed<IUserService>(AuthenticatedStatus.Anonymous); builder.RegisterType<UserService>() .Keyed<IUserService>(AuthenticatedStatus.Authenticated); builder.RegisterType<PasswordRecoveryService>() .InstancePerRequest(); builder.RegisterType<CalendarService>() .InstancePerRequest(); builder.RegisterType<FarmingActionService>() .InstancePerRequest(); builder.RegisterType<CropProvider>() .InstancePerRequest();; var container = builder.Build(); DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); } } }
using System.Web.Mvc; using Autofac; using Autofac.Integration.Mvc; using Zk.Models; using Zk.Services; using Zk.Repositories; namespace Zk { public static class IocConfig { public static void RegisterDependencies() { var builder = new ContainerBuilder(); builder.RegisterControllers(typeof(MvcApplication).Assembly); builder.RegisterType<ZkContext>() .As<IZkContext>() .InstancePerRequest(); builder.RegisterType<Repository>(); builder.RegisterType<AuthenticationService>(); builder.RegisterType<UserService>() .Keyed<IUserService>(AuthenticatedStatus.Anonymous); builder.RegisterType<UserService>() .Keyed<IUserService>(AuthenticatedStatus.Authenticated); builder.RegisterType<PasswordRecoveryService>(); builder.RegisterType<CalendarService>(); builder.RegisterType<FarmingActionService>(); builder.RegisterType<CropProvider>(); var container = builder.Build(); DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); } } }
mit
C#
6c602edd18faea59c6a9d2351c175fffebe739a1
Change CaF file system paths
ColdMatter/EDMSuite,ColdMatter/EDMSuite,ColdMatter/EDMSuite,ColdMatter/EDMSuite
DAQ/PHBonesawFileSystem.cs
DAQ/PHBonesawFileSystem.cs
using System; namespace DAQ.Environment { public class PHBonesawFileSystem : DAQ.Environment.FileSystem { public PHBonesawFileSystem() { Paths.Add("MOTMasterDataPath", "C:\\Users\\cafmot\\Box Sync\\CaF MOT\\MOTData\\MOTMasterData\\"); Paths.Add("scriptListPath", "C:\\ControlPrograms\\EDMSuite\\MoleculeMOTMasterScripts"); Paths.Add("daqDLLPath", "C:\\ControlPrograms\\EDMSuite\\DAQ\\bin\\CaF\\daq.dll"); Paths.Add("MOTMasterExePath", "C:\\ControlPrograms\\EDMSuite\\MOTMaster\\bin\\CaF\\"); Paths.Add("ExternalFilesPath", "C:\\Users\\cafmot\\Documents\\Temp Camera Images\\"); Paths.Add("HardwareClassPath", "C:\\ControlPrograms\\EDMSuite\\DAQ\\MoleculeMOTHardware.cs"); DataSearchPaths.Add(Paths["scanMasterDataPath"]); SortDataByDate = false; } } }
using System; namespace DAQ.Environment { public class PHBonesawFileSystem : DAQ.Environment.FileSystem { public PHBonesawFileSystem() { Paths.Add("MOTMasterDataPath", "C:\\Users\\cafmot\\Box\\CaF MOT\\MOTData\\MOTMasterData\\"); Paths.Add("scriptListPath", "C:\\ControlPrograms\\EDMSuite\\MoleculeMOTMasterScripts"); Paths.Add("daqDLLPath", "C:\\ControlPrograms\\EDMSuite\\DAQ\\bin\\CaF\\daq.dll"); Paths.Add("MOTMasterExePath", "C:\\ControlPrograms\\EDMSuite\\MOTMaster\\bin\\CaF\\"); Paths.Add("ExternalFilesPath", "C:\\Users\\cafmot\\Documents\\Temp Camera Images\\"); Paths.Add("HardwareClassPath", "C:\\ControlPrograms\\EDMSuite\\DAQ\\MoleculeMOTHardware.cs"); DataSearchPaths.Add(Paths["scanMasterDataPath"]); SortDataByDate = false; } } }
mit
C#
4e9b3be6feb25a95dc671ca2bf380d975f191c35
Remove duplication in Command classes.
ryanjfitz/SimpSim.NET
SimpSim.NET.Presentation/Command.cs
SimpSim.NET.Presentation/Command.cs
using System; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; namespace SimpSim.NET.Presentation { internal class Command : ICommand { protected readonly Action ExecuteAction; protected readonly Func<bool> CanExecuteFunc; public Command(Action executeAction, Func<bool> canExecuteFunc, SimpleSimulator simulator) { ExecuteAction = executeAction; CanExecuteFunc = canExecuteFunc; simulator.Machine.StateChanged += RaiseCanExecuteChanged; } public virtual bool CanExecute(object parameter) { return CanExecuteFunc.Invoke(); } public virtual void Execute(object parameter) { ExecuteAction.Invoke(); } public event EventHandler CanExecuteChanged { add => CommandManager.RequerySuggested += value; remove => CommandManager.RequerySuggested -= value; } protected void RaiseCanExecuteChanged() { Application.Current?.Dispatcher?.Invoke(CommandManager.InvalidateRequerySuggested); } } public interface IAsyncCommand : ICommand { Task ExecuteAsync(object parameter); } internal class AsyncCommand : Command, IAsyncCommand { private bool _isExecuting; public AsyncCommand(Action executeAction, Func<bool> canExecuteFunc, SimpleSimulator simulator) : base(executeAction, canExecuteFunc, simulator) { } public override bool CanExecute(object parameter) { return !_isExecuting && CanExecuteFunc.Invoke(); } public override async void Execute(object parameter) { await ExecuteAsync(parameter); } public async Task ExecuteAsync(object parameter) { _isExecuting = true; RaiseCanExecuteChanged(); await Task.Run(() => ExecuteAction.Invoke()); _isExecuting = false; RaiseCanExecuteChanged(); } } }
using System; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; namespace SimpSim.NET.Presentation { internal class Command : ICommand { private readonly Action _executeAction; private readonly Func<bool> _canExecuteFunc; public Command(Action executeAction, Func<bool> canExecuteFunc, SimpleSimulator simulator) { _executeAction = executeAction; _canExecuteFunc = canExecuteFunc; simulator.Machine.StateChanged += OnCanExecuteChanged; } public bool CanExecute(object parameter) { return _canExecuteFunc.Invoke(); } public void Execute(object parameter) { _executeAction.Invoke(); } public event EventHandler CanExecuteChanged; private void OnCanExecuteChanged() { Application.Current?.Dispatcher?.Invoke(() => CanExecuteChanged?.Invoke(this, EventArgs.Empty)); } } public interface IAsyncCommand : ICommand { Task ExecuteAsync(object parameter); } internal class AsyncCommand : IAsyncCommand { private bool _isExecuting; private readonly Action _executeAction; private readonly Func<bool> _canExecuteFunc; public AsyncCommand(Action executeAction, Func<bool> canExecuteFunc, SimpleSimulator simulator) { _executeAction = executeAction; _canExecuteFunc = canExecuteFunc; simulator.Machine.StateChanged += OnCanExecuteChanged; } public bool CanExecute(object parameter) { return !_isExecuting && _canExecuteFunc.Invoke(); } public async void Execute(object parameter) { await ExecuteAsync(parameter); } public async Task ExecuteAsync(object parameter) { _isExecuting = true; OnCanExecuteChanged(); await Task.Run(() => _executeAction.Invoke()); _isExecuting = false; OnCanExecuteChanged(); } public event EventHandler CanExecuteChanged { add => CommandManager.RequerySuggested += value; remove => CommandManager.RequerySuggested -= value; } private void OnCanExecuteChanged() { CommandManager.InvalidateRequerySuggested(); } } }
mit
C#
ceaa48958e7df7003c1750ed8e8f7aeb568913a6
use UID.ID as GetHashCode()
dotmos/uGameFramework,dotmos/uGameFramework
Unity/Assets/GameFramework/Modules/ECS/UID.cs
Unity/Assets/GameFramework/Modules/ECS/UID.cs
using System.Collections; using System.Collections.Generic; namespace ECS { /// <summary> /// Unique ID /// </summary> public struct UID { public int ID; public UID(int ID) { this.ID = ID; } public void SetID(int ID) { this.ID = ID; } public bool IsNull() { return ID == 0; } public override bool Equals(object obj) { if (obj is UID) { return ((UID)obj).ID == ID; } else { return base.Equals(obj); } } public static bool operator ==(UID c1, UID c2) { return c1.ID == c2.ID; } public static bool operator !=(UID c1, UID c2) { return c1.ID != c2.ID; } public override int GetHashCode() { return ID; } public static readonly UID NULL = new UID() { ID = 0 }; } }
using System.Collections; using System.Collections.Generic; namespace ECS { /// <summary> /// Unique ID /// </summary> public struct UID { public int ID; public UID(int ID) { this.ID = ID; } public void SetID(int ID) { this.ID = ID; } public bool IsNull() { return ID == 0; } public override bool Equals(object obj) { if (obj is UID) { return ((UID)obj).ID == ID; } else { return base.Equals(obj); } } public static bool operator ==(UID c1, UID c2) { return c1.ID == c2.ID; } public static bool operator !=(UID c1, UID c2) { return c1.ID != c2.ID; } /* public override int GetHashCode() { return ID; }*/ public static readonly UID NULL = new UID() { ID = 0 }; } }
mit
C#
5cf869cf8edca26496f90c1d54d31062a06816d4
Fix incorrect nullability specific on `ITrackableConfigManager`
ppy/osu-framework,ppy/osu-framework,peppy/osu-framework,peppy/osu-framework,peppy/osu-framework,ppy/osu-framework
osu.Framework/Configuration/Tracking/ITrackableConfigManager.cs
osu.Framework/Configuration/Tracking/ITrackableConfigManager.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; namespace osu.Framework.Configuration.Tracking { /// <summary> /// An <see cref="IConfigManager"/> that provides a way to track its config settings. /// </summary> public interface ITrackableConfigManager : IConfigManager { /// <summary> /// Retrieves all the settings of this <see cref="ConfigManager{T}"/> that are to be tracked for changes. /// </summary> /// <returns>A list of <see cref="ITrackedSetting"/>.</returns> TrackedSettings? CreateTrackedSettings(); /// <summary> /// Loads <see cref="Bindable{T}"/>s into <see cref="TrackedSettings"/>. /// </summary> /// <param name="settings">The settings to load into.</param> void LoadInto(TrackedSettings settings); } }
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; namespace osu.Framework.Configuration.Tracking { /// <summary> /// An <see cref="IConfigManager"/> that provides a way to track its config settings. /// </summary> public interface ITrackableConfigManager : IConfigManager { /// <summary> /// Retrieves all the settings of this <see cref="ConfigManager{T}"/> that are to be tracked for changes. /// </summary> /// <returns>A list of <see cref="ITrackedSetting"/>.</returns> TrackedSettings CreateTrackedSettings(); /// <summary> /// Loads <see cref="Bindable{T}"/>s into <see cref="TrackedSettings"/>. /// </summary> /// <param name="settings">The settings to load into.</param> void LoadInto(TrackedSettings settings); } }
mit
C#
9a10ecb3789630bd3715ce5e38ffd2cfe5bc1b24
Clarify purpose of `APIUserScoreAggregate`
peppy/osu,ppy/osu,peppy/osu,ppy/osu,ppy/osu,peppy/osu
osu.Game/Online/API/Requests/Responses/APIUserScoreAggregate.cs
osu.Game/Online/API/Requests/Responses/APIUserScoreAggregate.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using System; using Newtonsoft.Json; using osu.Game.Rulesets.Mods; using osu.Game.Scoring; namespace osu.Game.Online.API.Requests.Responses { /// <summary> /// Represents an aggregate score for a user based off all beatmaps that have been played in the playlist. /// </summary> public class APIUserScoreAggregate { [JsonProperty("attempts")] public int TotalAttempts { get; set; } [JsonProperty("completed")] public int CompletedBeatmaps { get; set; } [JsonProperty("accuracy")] public double Accuracy { get; set; } [JsonProperty(@"pp")] public double? PP { get; set; } [JsonProperty(@"room_id")] public long RoomID { get; set; } [JsonProperty("total_score")] public long TotalScore { get; set; } [JsonProperty(@"user_id")] public long UserID { get; set; } [JsonProperty("user")] public APIUser User { get; set; } [JsonProperty("position")] public int? Position { get; set; } public ScoreInfo CreateScoreInfo() => new ScoreInfo { Accuracy = Accuracy, PP = PP, TotalScore = TotalScore, User = User, Position = Position, Mods = Array.Empty<Mod>() }; } }
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using System; using Newtonsoft.Json; using osu.Game.Rulesets.Mods; using osu.Game.Scoring; namespace osu.Game.Online.API.Requests.Responses { public class APIUserScoreAggregate { [JsonProperty("attempts")] public int TotalAttempts { get; set; } [JsonProperty("completed")] public int CompletedBeatmaps { get; set; } [JsonProperty("accuracy")] public double Accuracy { get; set; } [JsonProperty(@"pp")] public double? PP { get; set; } [JsonProperty(@"room_id")] public long RoomID { get; set; } [JsonProperty("total_score")] public long TotalScore { get; set; } [JsonProperty(@"user_id")] public long UserID { get; set; } [JsonProperty("user")] public APIUser User { get; set; } [JsonProperty("position")] public int? Position { get; set; } public ScoreInfo CreateScoreInfo() => new ScoreInfo { Accuracy = Accuracy, PP = PP, TotalScore = TotalScore, User = User, Position = Position, Mods = Array.Empty<Mod>() }; } }
mit
C#