commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 1
4.87k
| subject
stringlengths 15
778
| message
stringlengths 15
8.75k
| lang
stringclasses 266
values | license
stringclasses 13
values | repos
stringlengths 5
127k
|
|---|---|---|---|---|---|---|---|---|---|
6e0c939167d5e6c7d6a013c7bfa7afff87662cb2
|
Nancy.AttributeRouting/ViewAttribute.cs
|
Nancy.AttributeRouting/ViewAttribute.cs
|
namespace Nancy.AttributeRouting
{
using System;
using System.Reflection;
/// <summary>
/// The View attribute indicates the view path to render from request.
/// </summary>
/// <example>
/// The following code will render <c>View/index.html</c> with routing instance.
/// <code>
/// View('View/index.html')
/// </code>
/// </example>
[AttributeUsage(AttributeTargets.Method)]
public class ViewAttribute : Attribute
{
private readonly string path;
/// <summary>
/// Initializes a new instance of the <see cref="ViewAttribute"/> class.
/// </summary>
/// <param name="path">The view path for rendering.</param>
public ViewAttribute(string path)
{
this.path = path.Trim('/');
}
internal static string GetPath(MethodBase method)
{
var attr = method.GetCustomAttribute<ViewAttribute>(false);
if (attr == null)
{
return string.Empty;
}
string prefix = ViewPrefixAttribute.GetPrefix(method.DeclaringType);
string path = string.Format("{0}/{1}", prefix, attr.path);
return path;
}
}
}
|
namespace Nancy.AttributeRouting
{
using System;
using System.Reflection;
/// <summary>
/// The View attribute indicates the view path to render from request.
/// </summary>
/// <example>
/// The following code will render <c>View/index.html</c> with routing instance.
/// <code>
/// View('View/index.html')
/// </code>
/// </example>
[AttributeUsage(AttributeTargets.Method)]
public class ViewAttribute : Attribute
{
private readonly string path;
/// <summary>
/// Initializes a new instance of the <see cref="ViewAttribute"/> class.
/// </summary>
/// <param name="path">The view path for rendering.</param>
public ViewAttribute(string path)
{
this.path = path.Trim('/');
}
internal static string GetPath(MethodBase method)
{
var attr = method.GetCustomAttribute<ViewAttribute>(false);
if (attr == null)
{
return string.Empty;
}
string prefix = ViewPrefixAttribute.GetPrefix(method.DeclaringType);
string path = string.Format("{0}/{1}", prefix, attr.path).Trim('/');
return path;
}
}
}
|
Fix the failing test case.
|
Fix the failing test case.
|
C#
|
mit
|
lijunle/Nancy.AttributeRouting,lijunle/Nancy.AttributeRouting
|
ae6ee01ad4d126e64369f274aa292e836a674a5c
|
target-clicker/MainWindow.xaml.cs
|
target-clicker/MainWindow.xaml.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WindowsInput;
namespace TargetClicker
{
/// <summary>
/// MainWindow.xaml の相互作用ロジック
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void clickButtonClick(object sender, RoutedEventArgs e)
{
var sim = new InputSimulator();
sim.Mouse.MoveMouseTo(0, 0);
sim.Mouse.RightButtonClick();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WindowsInput;
using NHotkey;
using NHotkey.Wpf;
namespace TargetClicker
{
/// <summary>
/// MainWindow.xaml の相互作用ロジック
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
HotkeyManager.Current.AddOrReplace("clickTarget", Key.D1 , ModifierKeys.Control | ModifierKeys.Alt, clickTarget);
}
private void clickButtonClick(object sender, RoutedEventArgs e)
{
var sim = new InputSimulator();
sim.Mouse.MoveMouseTo(0, 0);
sim.Mouse.RightButtonClick();
}
private void clickTarget(object sender, HotkeyEventArgs e)
{
var sim = new InputSimulator();
sim.Mouse.MoveMouseTo(0, 0);
sim.Mouse.RightButtonClick();
}
}
}
|
Add right click by a short cut key comination
|
Add right click by a short cut key comination
|
C#
|
mit
|
camphortree/mouse-capability-extender,camphortree/target-clicker
|
4ea31961fea5e0a802b1e1077cf0cc720c237e8b
|
Tests/Launcher.cs
|
Tests/Launcher.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AgateLib;
namespace Tests
{
class Launcher
{
[STAThread]
public static void Main(string[] args)
{
AgateFileProvider.Assemblies.AddPath("../Drivers");
AgateFileProvider.Images.AddPath("Data");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmLauncher());
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AgateLib;
namespace Tests
{
class Launcher
{
[STAThread]
public static void Main(string[] args)
{
AgateFileProvider.Images.AddPath("Data");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmLauncher());
}
}
}
|
Fix test launcher to not use Drivers directory.
|
Fix test launcher to not use Drivers directory.
|
C#
|
mit
|
eylvisaker/AgateLib
|
d06b9dc424af75d19b5bf17da775f1c4fa862c2f
|
Schedutalk/Schedutalk/Schedutalk/Logic/HttpRequestor.cs
|
Schedutalk/Schedutalk/Schedutalk/Logic/HttpRequestor.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace Schedutalk.Logic
{
class HttpRequestor
{
public async Task<string> getHttpRequestAsString(Func<string, HttpRequestMessage> requestTask, string input)
{
HttpClient httpClient = new HttpClient();
HttpRequestMessage request = requestTask(input);
var response = httpClient.SendAsync(request);
var result = await response.Result.Content.ReadAsStringAsync();
return result;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace Schedutalk.Logic
{
class HttpRequestor
{
public async Task<string> getHttpRequestAsString(Func<string, HttpRequestMessage> requestTask, string input)
{
HttpClient httpClient = new HttpClient();
HttpRequestMessage request = requestTask(input);
var response = httpClient.SendAsync(request);
var result = await response.Result.Content.ReadAsStringAsync();
return result;
}
public string getJSONAsString(Func<string, HttpRequestMessage> requestTask, string placeName)
{
Task<string> task = getHttpRequestAsString(requestTask, "E2");
task.Wait();
//Format string
string replacement = task.Result;
if (0 == replacement[0].CompareTo('[')) replacement = replacement.Substring(1);
if (0 == replacement[replacement.Length - 1].CompareTo(']')) replacement = replacement.Remove(replacement.Length - 1);
return replacement;
}
}
}
|
Implement utlity for requesting JSON as string
|
Implement utlity for requesting JSON as string
|
C#
|
mit
|
Zalodu/Schedutalk,Zalodu/Schedutalk
|
4a491ca6f02122e9dc4dcff568134e0660ff767d
|
src/Common/src/System/Net/Http/HttpHandlerDefaults.cs
|
src/Common/src/System/Net/Http/HttpHandlerDefaults.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace System.Net.Http
{
/// <summary>
/// Defines default values for http handler properties which is meant to be re-used across WinHttp & UnixHttp Handlers
/// </summary>
internal static class HttpHandlerDefaults
{
public const int DefaultMaxAutomaticRedirections = 50;
public const DecompressionMethods DefaultAutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
public const bool DefaultAutomaticRedirection = true;
public const bool DefaultUseCookies = true;
public const bool DefaultPreAuthenticate = false;
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace System.Net.Http
{
/// <summary>
/// Defines default values for http handler properties which is meant to be re-used across WinHttp and UnixHttp Handlers
/// </summary>
internal static class HttpHandlerDefaults
{
public const int DefaultMaxAutomaticRedirections = 50;
public const DecompressionMethods DefaultAutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
public const bool DefaultAutomaticRedirection = true;
public const bool DefaultUseCookies = true;
public const bool DefaultPreAuthenticate = false;
}
}
|
Fix XML docs containing an ampersand
|
Fix XML docs containing an ampersand
|
C#
|
mit
|
ptoonen/corefx,yizhang82/corefx,shimingsg/corefx,rjxby/corefx,pallavit/corefx,elijah6/corefx,twsouthwick/corefx,twsouthwick/corefx,mmitche/corefx,Jiayili1/corefx,mokchhya/corefx,cydhaselton/corefx,jlin177/corefx,kkurni/corefx,akivafr123/corefx,twsouthwick/corefx,twsouthwick/corefx,benpye/corefx,josguil/corefx,zhenlan/corefx,rubo/corefx,manu-silicon/corefx,shmao/corefx,tijoytom/corefx,richlander/corefx,jcme/corefx,richlander/corefx,lggomez/corefx,pallavit/corefx,manu-silicon/corefx,mazong1123/corefx,axelheer/corefx,benpye/corefx,JosephTremoulet/corefx,SGuyGe/corefx,pallavit/corefx,Ermiar/corefx,mazong1123/corefx,ericstj/corefx,stephenmichaelf/corefx,mokchhya/corefx,the-dwyer/corefx,tijoytom/corefx,krk/corefx,Jiayili1/corefx,Petermarcu/corefx,shahid-pk/corefx,Priya91/corefx-1,Yanjing123/corefx,mmitche/corefx,ravimeda/corefx,BrennanConroy/corefx,jlin177/corefx,parjong/corefx,rjxby/corefx,Yanjing123/corefx,cartermp/corefx,ellismg/corefx,gkhanna79/corefx,ViktorHofer/corefx,kkurni/corefx,dhoehna/corefx,ravimeda/corefx,stone-li/corefx,nbarbettini/corefx,yizhang82/corefx,nchikanov/corefx,kkurni/corefx,nchikanov/corefx,mellinoe/corefx,nchikanov/corefx,benjamin-bader/corefx,dhoehna/corefx,bitcrazed/corefx,adamralph/corefx,690486439/corefx,SGuyGe/corefx,yizhang82/corefx,mellinoe/corefx,axelheer/corefx,parjong/corefx,zhenlan/corefx,vidhya-bv/corefx-sorting,DnlHarvey/corefx,jeremymeng/corefx,parjong/corefx,janhenke/corefx,janhenke/corefx,stone-li/corefx,jhendrixMSFT/corefx,n1ghtmare/corefx,richlander/corefx,wtgodbe/corefx,ellismg/corefx,weltkante/corefx,marksmeltzer/corefx,marksmeltzer/corefx,mmitche/corefx,benpye/corefx,elijah6/corefx,krk/corefx,marksmeltzer/corefx,ericstj/corefx,marksmeltzer/corefx,zhenlan/corefx,manu-silicon/corefx,wtgodbe/corefx,pallavit/corefx,tijoytom/corefx,alexandrnikitin/corefx,mmitche/corefx,yizhang82/corefx,dhoehna/corefx,Jiayili1/corefx,690486439/corefx,dotnet-bot/corefx,690486439/corefx,YoupHulsebos/corefx,benpye/corefx,shahid-pk/corefx,krytarowski/corefx,jhendrixMSFT/corefx,nbarbettini/corefx,billwert/corefx,nbarbettini/corefx,seanshpark/corefx,bitcrazed/corefx,shimingsg/corefx,mellinoe/corefx,Jiayili1/corefx,n1ghtmare/corefx,jeremymeng/corefx,SGuyGe/corefx,josguil/corefx,dsplaisted/corefx,the-dwyer/corefx,ViktorHofer/corefx,yizhang82/corefx,ellismg/corefx,shmao/corefx,wtgodbe/corefx,DnlHarvey/corefx,benjamin-bader/corefx,shimingsg/corefx,josguil/corefx,benjamin-bader/corefx,lggomez/corefx,iamjasonp/corefx,mazong1123/corefx,mokchhya/corefx,dsplaisted/corefx,rjxby/corefx,YoupHulsebos/corefx,mafiya69/corefx,rahku/corefx,Yanjing123/corefx,dotnet-bot/corefx,tijoytom/corefx,richlander/corefx,adamralph/corefx,mafiya69/corefx,shahid-pk/corefx,stone-li/corefx,nchikanov/corefx,marksmeltzer/corefx,krk/corefx,mokchhya/corefx,nchikanov/corefx,wtgodbe/corefx,ravimeda/corefx,dhoehna/corefx,alexandrnikitin/corefx,alexperovich/corefx,JosephTremoulet/corefx,iamjasonp/corefx,mellinoe/corefx,lggomez/corefx,stone-li/corefx,akivafr123/corefx,jeremymeng/corefx,shmao/corefx,Jiayili1/corefx,krk/corefx,n1ghtmare/corefx,ellismg/corefx,rjxby/corefx,rjxby/corefx,zhenlan/corefx,nbarbettini/corefx,nchikanov/corefx,SGuyGe/corefx,YoupHulsebos/corefx,dotnet-bot/corefx,SGuyGe/corefx,seanshpark/corefx,richlander/corefx,gkhanna79/corefx,n1ghtmare/corefx,ravimeda/corefx,elijah6/corefx,the-dwyer/corefx,lggomez/corefx,parjong/corefx,alphonsekurian/corefx,richlander/corefx,alphonsekurian/corefx,DnlHarvey/corefx,jcme/corefx,DnlHarvey/corefx,dhoehna/corefx,billwert/corefx,YoupHulsebos/corefx,benjamin-bader/corefx,Priya91/corefx-1,tijoytom/corefx,mazong1123/corefx,ptoonen/corefx,cydhaselton/corefx,Priya91/corefx-1,iamjasonp/corefx,rjxby/corefx,bitcrazed/corefx,krytarowski/corefx,mmitche/corefx,iamjasonp/corefx,ellismg/corefx,MaggieTsang/corefx,ptoonen/corefx,Chrisboh/corefx,Ermiar/corefx,MaggieTsang/corefx,billwert/corefx,zhenlan/corefx,marksmeltzer/corefx,akivafr123/corefx,bitcrazed/corefx,stephenmichaelf/corefx,tstringer/corefx,jhendrixMSFT/corefx,seanshpark/corefx,ViktorHofer/corefx,cartermp/corefx,cartermp/corefx,jhendrixMSFT/corefx,rahku/corefx,alexperovich/corefx,wtgodbe/corefx,iamjasonp/corefx,alexperovich/corefx,Jiayili1/corefx,alphonsekurian/corefx,marksmeltzer/corefx,the-dwyer/corefx,gkhanna79/corefx,mafiya69/corefx,tstringer/corefx,alphonsekurian/corefx,cydhaselton/corefx,rjxby/corefx,pallavit/corefx,rahku/corefx,mazong1123/corefx,rubo/corefx,Chrisboh/corefx,yizhang82/corefx,JosephTremoulet/corefx,fgreinacher/corefx,ptoonen/corefx,billwert/corefx,axelheer/corefx,ericstj/corefx,lggomez/corefx,janhenke/corefx,alexperovich/corefx,krytarowski/corefx,PatrickMcDonald/corefx,shmao/corefx,shimingsg/corefx,Yanjing123/corefx,shmao/corefx,tstringer/corefx,vidhya-bv/corefx-sorting,josguil/corefx,fgreinacher/corefx,mokchhya/corefx,PatrickMcDonald/corefx,weltkante/corefx,alexperovich/corefx,axelheer/corefx,wtgodbe/corefx,nbarbettini/corefx,jcme/corefx,MaggieTsang/corefx,mmitche/corefx,ViktorHofer/corefx,richlander/corefx,stephenmichaelf/corefx,weltkante/corefx,jlin177/corefx,parjong/corefx,kkurni/corefx,ptoonen/corefx,jhendrixMSFT/corefx,Petermarcu/corefx,seanshpark/corefx,akivafr123/corefx,Ermiar/corefx,rubo/corefx,vidhya-bv/corefx-sorting,mokchhya/corefx,dotnet-bot/corefx,Ermiar/corefx,ViktorHofer/corefx,janhenke/corefx,ViktorHofer/corefx,krk/corefx,MaggieTsang/corefx,krytarowski/corefx,nbarbettini/corefx,manu-silicon/corefx,benpye/corefx,cartermp/corefx,benpye/corefx,rahku/corefx,parjong/corefx,kkurni/corefx,kkurni/corefx,MaggieTsang/corefx,the-dwyer/corefx,ViktorHofer/corefx,lggomez/corefx,alexperovich/corefx,JosephTremoulet/corefx,rubo/corefx,elijah6/corefx,gkhanna79/corefx,stone-li/corefx,twsouthwick/corefx,690486439/corefx,ravimeda/corefx,Chrisboh/corefx,Jiayili1/corefx,Petermarcu/corefx,vidhya-bv/corefx-sorting,cydhaselton/corefx,YoupHulsebos/corefx,jhendrixMSFT/corefx,khdang/corefx,ericstj/corefx,Priya91/corefx-1,stone-li/corefx,Priya91/corefx-1,Petermarcu/corefx,vidhya-bv/corefx-sorting,ravimeda/corefx,krytarowski/corefx,Yanjing123/corefx,dotnet-bot/corefx,iamjasonp/corefx,jlin177/corefx,benjamin-bader/corefx,nchikanov/corefx,krk/corefx,weltkante/corefx,billwert/corefx,khdang/corefx,Petermarcu/corefx,dsplaisted/corefx,axelheer/corefx,mmitche/corefx,tstringer/corefx,ellismg/corefx,Priya91/corefx-1,alexperovich/corefx,seanshpark/corefx,weltkante/corefx,ericstj/corefx,Chrisboh/corefx,ericstj/corefx,MaggieTsang/corefx,krytarowski/corefx,khdang/corefx,n1ghtmare/corefx,gkhanna79/corefx,tstringer/corefx,nbarbettini/corefx,690486439/corefx,elijah6/corefx,shimingsg/corefx,jlin177/corefx,stephenmichaelf/corefx,alphonsekurian/corefx,DnlHarvey/corefx,Ermiar/corefx,Ermiar/corefx,JosephTremoulet/corefx,stone-li/corefx,tstringer/corefx,the-dwyer/corefx,josguil/corefx,mafiya69/corefx,ericstj/corefx,the-dwyer/corefx,zhenlan/corefx,jcme/corefx,dotnet-bot/corefx,lggomez/corefx,ptoonen/corefx,shahid-pk/corefx,Petermarcu/corefx,gkhanna79/corefx,dhoehna/corefx,PatrickMcDonald/corefx,mafiya69/corefx,rahku/corefx,tijoytom/corefx,fgreinacher/corefx,stephenmichaelf/corefx,JosephTremoulet/corefx,fgreinacher/corefx,shahid-pk/corefx,elijah6/corefx,manu-silicon/corefx,axelheer/corefx,rahku/corefx,PatrickMcDonald/corefx,Chrisboh/corefx,gkhanna79/corefx,mazong1123/corefx,BrennanConroy/corefx,shimingsg/corefx,janhenke/corefx,manu-silicon/corefx,Petermarcu/corefx,jcme/corefx,billwert/corefx,dotnet-bot/corefx,jlin177/corefx,wtgodbe/corefx,josguil/corefx,yizhang82/corefx,pallavit/corefx,shimingsg/corefx,elijah6/corefx,cartermp/corefx,seanshpark/corefx,cydhaselton/corefx,khdang/corefx,manu-silicon/corefx,MaggieTsang/corefx,SGuyGe/corefx,Ermiar/corefx,BrennanConroy/corefx,khdang/corefx,jhendrixMSFT/corefx,adamralph/corefx,JosephTremoulet/corefx,janhenke/corefx,zhenlan/corefx,weltkante/corefx,shahid-pk/corefx,benjamin-bader/corefx,weltkante/corefx,mellinoe/corefx,billwert/corefx,PatrickMcDonald/corefx,jlin177/corefx,cydhaselton/corefx,parjong/corefx,twsouthwick/corefx,krk/corefx,YoupHulsebos/corefx,dhoehna/corefx,ravimeda/corefx,krytarowski/corefx,rubo/corefx,iamjasonp/corefx,mellinoe/corefx,seanshpark/corefx,shmao/corefx,cartermp/corefx,tijoytom/corefx,alexandrnikitin/corefx,twsouthwick/corefx,stephenmichaelf/corefx,jcme/corefx,akivafr123/corefx,alphonsekurian/corefx,DnlHarvey/corefx,cydhaselton/corefx,jeremymeng/corefx,alphonsekurian/corefx,stephenmichaelf/corefx,alexandrnikitin/corefx,DnlHarvey/corefx,alexandrnikitin/corefx,khdang/corefx,jeremymeng/corefx,mafiya69/corefx,bitcrazed/corefx,rahku/corefx,mazong1123/corefx,shmao/corefx,YoupHulsebos/corefx,ptoonen/corefx,Chrisboh/corefx
|
2d7921396ec49950d1a8042a43bde4bb7db1135f
|
Source/Libraries/openXDA.Model/SystemCenter/Setting.cs
|
Source/Libraries/openXDA.Model/SystemCenter/Setting.cs
|
//******************************************************************************************************
// Setting.cs - Gbtc
//
// Copyright © 2021, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
// file except in compliance with the License. You may obtain a copy of the License at:
//
// http://opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 06/09/2021 - Billy Ernest
// Generated original version of source code.
//
//******************************************************************************************************
using GSF.Data.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SystemCenter.Model
{
[ConfigFileTableNamePrefix, TableName("SystemCenter.Setting"), UseEscapedName, AllowSearch]
[PostRoles("Administrator")]
[DeleteRoles("Administrator")]
[PatchRoles("Administrator")]
public class Setting: openXDA.Model.Setting {}
}
|
//******************************************************************************************************
// Setting.cs - Gbtc
//
// Copyright © 2021, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
// file except in compliance with the License. You may obtain a copy of the License at:
//
// http://opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 06/09/2021 - Billy Ernest
// Generated original version of source code.
//
//******************************************************************************************************
using GSF.Data.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SystemCenter.Model
{
[TableName("SystemCenter.Setting"), UseEscapedName, AllowSearch]
[PostRoles("Administrator")]
[DeleteRoles("Administrator")]
[PatchRoles("Administrator")]
public class Setting: openXDA.Model.Setting {}
}
|
Remove configfile prefix from settings file and let tablename drive naming.
|
Remove configfile prefix from settings file and let tablename drive naming.
|
C#
|
mit
|
GridProtectionAlliance/openXDA,GridProtectionAlliance/openXDA,GridProtectionAlliance/openXDA,GridProtectionAlliance/openXDA
|
f719b9bef58da1e82dce0d702c8f498446dd5865
|
osu.Game.Rulesets.Mania/UI/ManiaScrollingInfo.cs
|
osu.Game.Rulesets.Mania/UI/ManiaScrollingInfo.cs
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Configuration;
using osu.Game.Rulesets.Mania.Configuration;
using osu.Game.Rulesets.UI.Scrolling;
namespace osu.Game.Rulesets.Mania.UI
{
public class ManiaScrollingInfo : IScrollingInfo
{
private readonly Bindable<ManiaScrollingDirection> configDirection = new Bindable<ManiaScrollingDirection>();
public readonly Bindable<ScrollingDirection> Direction = new Bindable<ScrollingDirection>();
IBindable<ScrollingDirection> IScrollingInfo.Direction => Direction;
public ManiaScrollingInfo(ManiaConfigManager config)
{
config.BindWith(ManiaSetting.ScrollDirection, configDirection);
configDirection.BindValueChanged(v => Direction.Value = (ScrollingDirection)v);
}
}
}
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Configuration;
using osu.Game.Rulesets.Mania.Configuration;
using osu.Game.Rulesets.UI.Scrolling;
namespace osu.Game.Rulesets.Mania.UI
{
public class ManiaScrollingInfo : IScrollingInfo
{
private readonly Bindable<ManiaScrollingDirection> configDirection = new Bindable<ManiaScrollingDirection>();
public readonly Bindable<ScrollingDirection> Direction = new Bindable<ScrollingDirection>();
IBindable<ScrollingDirection> IScrollingInfo.Direction => Direction;
public ManiaScrollingInfo(ManiaConfigManager config)
{
config.BindWith(ManiaSetting.ScrollDirection, configDirection);
configDirection.BindValueChanged(v => Direction.Value = (ScrollingDirection)v, true);
}
}
}
|
Fix mania scroll direction not being read from database
|
Fix mania scroll direction not being read from database
|
C#
|
mit
|
EVAST9919/osu,UselessToucan/osu,ppy/osu,UselessToucan/osu,ZLima12/osu,peppy/osu-new,smoogipoo/osu,NeoAdonis/osu,naoey/osu,peppy/osu,EVAST9919/osu,NeoAdonis/osu,smoogipoo/osu,2yangk23/osu,ZLima12/osu,ppy/osu,DrabWeb/osu,naoey/osu,peppy/osu,johnneijzen/osu,peppy/osu,johnneijzen/osu,smoogipoo/osu,DrabWeb/osu,naoey/osu,UselessToucan/osu,ppy/osu,smoogipooo/osu,DrabWeb/osu,2yangk23/osu,NeoAdonis/osu
|
e7da5b0400e3d388529c9eaa1c9b1dd3423c7971
|
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
|
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
{
/// <summary>
/// Represents the skill required to press keys with regards to keeping up with the speed at which objects need to be hit.
/// </summary>
public class Speed : Skill
{
protected override double SkillMultiplier => 1400;
protected override double StrainDecayBase => 0.3;
protected override double StrainValueOf(OsuDifficultyHitObject current)
{
double distance = Math.Min(SINGLE_SPACING_THRESHOLD, current.TravelDistance + current.JumpDistance);
return (0.95 + Math.Pow(distance / SINGLE_SPACING_THRESHOLD, 4)) / current.StrainTime;
}
}
}
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
{
/// <summary>
/// Represents the skill required to press keys with regards to keeping up with the speed at which objects need to be hit.
/// </summary>
public class Speed : Skill
{
protected override double SkillMultiplier => 1400;
protected override double StrainDecayBase => 0.3;
private const double min_speed_bonus = 75; // ~200BPM
private const double max_speed_bonus = 45; // ~330BPM
private const double speed_balancing_factor = 40;
protected override double StrainValueOf(OsuDifficultyHitObject current)
{
double distance = Math.Min(SINGLE_SPACING_THRESHOLD, current.TravelDistance + current.JumpDistance);
double deltaTime = Math.Max(max_speed_bonus, current.DeltaTime);
double speedBonus = 1.0;
if (deltaTime < min_speed_bonus)
speedBonus = 1 + Math.Pow((min_speed_bonus - deltaTime) / speed_balancing_factor, 2);
return speedBonus * (0.95 + Math.Pow(distance / SINGLE_SPACING_THRESHOLD, 4)) / current.StrainTime;
}
}
}
|
Add the [200 .. 300] bpm speed bonus
|
Add the [200 .. 300] bpm speed bonus
|
C#
|
mit
|
EVAST9919/osu,johnneijzen/osu,DrabWeb/osu,DrabWeb/osu,NeoAdonis/osu,naoey/osu,naoey/osu,smoogipoo/osu,2yangk23/osu,NeoAdonis/osu,johnneijzen/osu,peppy/osu-new,smoogipooo/osu,UselessToucan/osu,peppy/osu,smoogipoo/osu,peppy/osu,DrabWeb/osu,EVAST9919/osu,smoogipoo/osu,ppy/osu,2yangk23/osu,ZLima12/osu,naoey/osu,UselessToucan/osu,ppy/osu,peppy/osu,ppy/osu,NeoAdonis/osu,ZLima12/osu,UselessToucan/osu
|
3f083cf9070113ec71f0721e94c5016dc13bce3a
|
src/ChillTeasureTime/Assets/src/scripts/GroundCheck.cs
|
src/ChillTeasureTime/Assets/src/scripts/GroundCheck.cs
|
using System;
using UnityEngine;
using System.Collections;
public class GroundCheck : MonoBehaviour
{
public bool IsOnGround { get; private set; }
public void OnTriggerEnter(Collider other)
{
var geometry = other.gameObject.GetComponent<LevelGeometry>();
if (geometry != null)
{
IsOnGround = true;
}
}
public void OnTriggerExit(Collider other)
{
var geometry = other.gameObject.GetComponent<LevelGeometry>();
if (geometry != null)
{
IsOnGround = false;
}
}
}
|
using System;
using UnityEngine;
using System.Collections;
public class GroundCheck : MonoBehaviour
{
public bool IsOnGround { get; private set; }
public void OnTriggerStay(Collider other)
{
var geometry = other.gameObject.GetComponent<LevelGeometry>();
if (geometry != null)
{
IsOnGround = true;
}
}
public void OnTriggerExit(Collider other)
{
var geometry = other.gameObject.GetComponent<LevelGeometry>();
if (geometry != null)
{
IsOnGround = false;
}
}
}
|
Fix landing on the ground not working occasionally
|
Fix landing on the ground not working occasionally
|
C#
|
mit
|
harjup/ChillTreasureTime
|
0d147b4ad9f7a7bc308eef9508034b45b499add5
|
osu.Game/IPC/ArchiveImportIPCChannel.cs
|
osu.Game/IPC/ArchiveImportIPCChannel.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using osu.Framework.Platform;
using osu.Game.Database;
namespace osu.Game.IPC
{
public class ArchiveImportIPCChannel : IpcChannel<ArchiveImportMessage>
{
private readonly ICanAcceptFiles importer;
public ArchiveImportIPCChannel(IIpcHost host, ICanAcceptFiles importer = null)
: base(host)
{
this.importer = importer;
MessageReceived += msg =>
{
Debug.Assert(importer != null);
ImportAsync(msg.Path).ContinueWith(t =>
{
if (t.Exception != null) throw t.Exception;
}, TaskContinuationOptions.OnlyOnFaulted);
};
}
public async Task ImportAsync(string path)
{
if (importer == null)
{
// we want to contact a remote osu! to handle the import.
await SendMessageAsync(new ArchiveImportMessage { Path = path }).ConfigureAwait(false);
return;
}
if (importer.HandledExtensions.Contains(Path.GetExtension(path)?.ToLowerInvariant()))
await importer.Import(path).ConfigureAwait(false);
}
}
public class ArchiveImportMessage
{
public string Path;
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using osu.Framework.Platform;
using osu.Game.Database;
namespace osu.Game.IPC
{
public class ArchiveImportIPCChannel : IpcChannel<ArchiveImportMessage>
{
private readonly ICanAcceptFiles importer;
public ArchiveImportIPCChannel(IIpcHost host, ICanAcceptFiles importer = null)
: base(host)
{
this.importer = importer;
MessageReceived += msg =>
{
Debug.Assert(importer != null);
ImportAsync(msg.Path).ContinueWith(t =>
{
if (t.Exception != null) throw t.Exception;
}, TaskContinuationOptions.OnlyOnFaulted);
return null;
};
}
public async Task ImportAsync(string path)
{
if (importer == null)
{
// we want to contact a remote osu! to handle the import.
await SendMessageAsync(new ArchiveImportMessage { Path = path }).ConfigureAwait(false);
return;
}
if (importer.HandledExtensions.Contains(Path.GetExtension(path)?.ToLowerInvariant()))
await importer.Import(path).ConfigureAwait(false);
}
}
public class ArchiveImportMessage
{
public string Path;
}
}
|
Return null IPC response for archive imports
|
Return null IPC response for archive imports
|
C#
|
mit
|
ppy/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,ppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu,peppy/osu
|
87dd7bcf6b2d31d7338c153c96b998f0bc70b37d
|
osu.Game/Tests/Visual/EditorTestCase.cs
|
osu.Game/Tests/Visual/EditorTestCase.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Game.Rulesets;
using osu.Game.Screens.Edit;
using osu.Game.Tests.Beatmaps;
namespace osu.Game.Tests.Visual
{
public abstract class EditorTestCase : ScreenTestCase
{
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(Editor), typeof(EditorScreen) };
private readonly Ruleset ruleset;
protected EditorTestCase(Ruleset ruleset)
{
this.ruleset = ruleset;
}
[BackgroundDependencyLoader]
private void load()
{
Beatmap.Value = new TestWorkingBeatmap(ruleset.RulesetInfo, Clock);
LoadComponentAsync(new Editor(), LoadScreen);
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Game.Rulesets;
using osu.Game.Screens.Edit;
using osu.Game.Tests.Beatmaps;
namespace osu.Game.Tests.Visual
{
public abstract class EditorTestCase : ScreenTestCase
{
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(Editor), typeof(EditorScreen) };
private readonly Ruleset ruleset;
protected EditorTestCase(Ruleset ruleset)
{
this.ruleset = ruleset;
}
[BackgroundDependencyLoader]
private void load()
{
Beatmap.Value = new TestWorkingBeatmap(ruleset.RulesetInfo, null);
LoadComponentAsync(new Editor(), LoadScreen);
}
}
}
|
Fix one more test regression
|
Fix one more test regression
|
C#
|
mit
|
DrabWeb/osu,naoey/osu,ppy/osu,UselessToucan/osu,peppy/osu,ZLima12/osu,peppy/osu-new,smoogipooo/osu,2yangk23/osu,peppy/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,DrabWeb/osu,EVAST9919/osu,EVAST9919/osu,naoey/osu,NeoAdonis/osu,ppy/osu,NeoAdonis/osu,johnneijzen/osu,johnneijzen/osu,peppy/osu,naoey/osu,smoogipoo/osu,DrabWeb/osu,ZLima12/osu,2yangk23/osu,smoogipoo/osu,UselessToucan/osu
|
4c86b29c9da8644be39aec41192df805342dc867
|
src/Hosting/PageMatcherPolicy.cs
|
src/Hosting/PageMatcherPolicy.cs
|
// Copyright (c) 2014-2020 Sarin Na Wangkanai, All Rights Reserved.
// The Apache v2. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Matching;
namespace Wangkanai.Detection.Hosting
{
internal class ResponsivePageMatcherPolicy : MatcherPolicy, IEndpointComparerPolicy, IEndpointSelectorPolicy
{
public ResponsivePageMatcherPolicy() => Comparer = EndpointMetadataComparer<IResponsiveMetadata>.Default;
public IComparer<Endpoint> Comparer { get; }
public override int Order => 10000;
public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints)
{
for (var i = 0; i < endpoints.Count; i++)
if (endpoints[i].Metadata.GetMetadata<IResponsiveMetadata>() != null)
return true;
return false;
}
public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates)
{
var device = httpContext.GetDevice();
for (var i = 0; i < candidates.Count; i++)
{
var endpoint = candidates[i].Endpoint;
var metadata = endpoint.Metadata.GetMetadata<IResponsiveMetadata>();
if (metadata?.Device != null && device != metadata.Device)
{
// This endpoint is not a match for the selected device.
candidates.SetValidity(i, false);
}
}
return Task.CompletedTask;
}
}
}
|
// Copyright (c) 2014-2020 Sarin Na Wangkanai, All Rights Reserved.
// The Apache v2. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Matching;
namespace Wangkanai.Detection.Hosting
{
internal class ResponsivePageMatcherPolicy : MatcherPolicy, IEndpointComparerPolicy, IEndpointSelectorPolicy
{
public ResponsivePageMatcherPolicy() => Comparer = EndpointMetadataComparer<IResponsiveMetadata>.Default;
public IComparer<Endpoint> Comparer { get; }
public override int Order => 10000;
public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints)
{
foreach (var endpoint in endpoints)
if (endpoint?.Metadata.GetMetadata<IResponsiveMetadata>() != null)
return true;
return false;
}
public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates)
{
var device = httpContext.GetDevice();
for (var i = 0; i < candidates.Count; i++)
{
var endpoint = candidates[i].Endpoint;
var metadata = endpoint.Metadata.GetMetadata<IResponsiveMetadata>();
if (metadata?.Device != null && device != metadata.Device)
{
// This endpoint is not a match for the selected device.
candidates.SetValidity(i, false);
}
}
return Task.CompletedTask;
}
}
}
|
Change for to foreach in endpoints list
|
Change for to foreach in endpoints list
|
C#
|
apache-2.0
|
wangkanai/Detection
|
5c16c60ad5bacae3d2f01fd6ff5f24061d8ae4d1
|
src/StateMechanic/InvalidEventTransitionException.cs
|
src/StateMechanic/InvalidEventTransitionException.cs
|
using System;
namespace StateMechanic
{
/// <summary>
/// Exception thrown when a transition could not be created from a state on an event, because the state and event do not belong to the same state machine
/// </summary>
public class InvalidEventTransitionException : Exception
{
/// <summary>
/// Gets the state from which the transition could not be created
/// </summary>
public IState From { get; private set; }
/// <summary>
/// Gets the event on which the transition could not be created
/// </summary>
public IEvent Event { get; private set; }
internal InvalidEventTransitionException(IState from, IEvent @event)
: base(String.Format("Unable to create from state {0} on event {1}, as state {0} does not belong to the same state machine as event {1}, or to a child state machine of event {1}", from.Name, @event.Name))
{
this.From = from;
this.Event = @event;
}
}
}
|
using System;
namespace StateMechanic
{
/// <summary>
/// Exception thrown when a transition could not be created from a state on an event, because the state and event do not belong to the same state machine
/// </summary>
public class InvalidEventTransitionException : Exception
{
/// <summary>
/// Gets the state from which the transition could not be created
/// </summary>
public IState From { get; private set; }
/// <summary>
/// Gets the event on which the transition could not be created
/// </summary>
public IEvent Event { get; private set; }
internal InvalidEventTransitionException(IState from, IEvent @event)
: base(String.Format("Unable to create transition from state {0} on event {1}, as state {0} does not belong to the same state machine as event {1}, or to a child state machine of event {1}", from.Name, @event.Name))
{
this.From = from;
this.Event = @event;
}
}
}
|
Fix typo in exception message
|
Fix typo in exception message
|
C#
|
mit
|
canton7/StateMechanic,canton7/StateMechanic
|
d527e066a5d343e8c7cacf083102a6cd6c413c1f
|
SlothUnit/SlothUnit.Parser.Test/ClangWrapperShould.cs
|
SlothUnit/SlothUnit.Parser.Test/ClangWrapperShould.cs
|
using System.IO;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using SlothUnitParser;
/* TODO
*/
namespace SlothUnit.Parser.Test
{
[TestFixture]
class ClangWrapperShould : FileSystemTest
{
[Test]
public void retrieve_the_name_of_a_cursor()
{
var filePath = Path.Combine(TestProjectDir, "ClangWrapperShould.h");
var clangWrapper = new ClangWrapper();
var classCursor = clangWrapper.GetClassCursorsIn(filePath).Single();
ClangWrapper.GetCursorName(classCursor).Should().Be("ClangWrapperShould");
}
[Test]
public void retrieve_the_line_of_a_cursor()
{
var filePath = Path.Combine(TestProjectDir, "ClangWrapperShould.h");
var clangWrapper = new ClangWrapper();
var classCursor = clangWrapper.GetClassCursorsIn(filePath).Single();
ClangWrapper.GetCursorLine(classCursor).Should().Be(6);
}
[Test]
public void retrieve_the_filepath_for_the_file_a_cursor_is_in()
{
var filePath = Path.Combine(TestProjectDir, "ClangWrapperShould.h");
var clangWrapper = new ClangWrapper();
var classCursor = clangWrapper.GetClassCursorsIn(filePath).Single();
ClangWrapper.GetCursorFilePath(classCursor).Should().Be(filePath);
}
}
}
|
using System.IO;
using System.Linq;
using ClangSharp;
using FluentAssertions;
using NUnit.Framework;
using SlothUnitParser;
/* TODO
*/
namespace SlothUnit.Parser.Test
{
[TestFixture]
class ClangWrapperShould : FileSystemTest
{
private CXCursor ClassCursor { get; set; }
private string FilePath { get; set; }
[SetUp]
public void given_a_class_cursor_in_a_file()
{
FilePath = Path.Combine(TestProjectDir, "ClangWrapperShould.h");
ClassCursor = new ClangWrapper().GetClassCursorsIn(FilePath).Single();
}
[Test]
public void retrieve_the_filepath_for_the_file_a_cursor_is_in()
{
ClangWrapper.GetCursorFilePath(ClassCursor).Should().Be(FilePath);
}
[Test]
public void retrieve_the_name_of_a_cursor()
{
ClangWrapper.GetCursorName(ClassCursor).Should().Be("ClangWrapperShould");
}
[Test]
public void retrieve_the_line_of_a_cursor()
{
ClangWrapper.GetCursorLine(ClassCursor).Should().Be(6);
}
}
}
|
Refactor introduce SetUp in test
|
Refactor introduce SetUp in test
|
C#
|
mit
|
Suui/SlothUnit,Suui/SlothUnit,Suui/SlothUnit
|
5e09d92cb58678a485e8ba86fc8c7451ffc83b05
|
Joey/UI/Fragments/LogTimeEntriesListFragment.cs
|
Joey/UI/Fragments/LogTimeEntriesListFragment.cs
|
using System;
using System.Linq;
using Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
using Toggl.Joey.UI.Adapters;
namespace Toggl.Joey.UI.Fragments
{
public class LogTimeEntriesListFragment : ListFragment
{
public override void OnViewCreated (View view, Bundle savedInstanceState)
{
base.OnViewCreated (view, savedInstanceState);
ListAdapter = new LogTimeEntriesAdapter ();
}
public override void OnListItemClick (ListView l, View v, int position, long id)
{
var adapter = l.Adapter as LogTimeEntriesAdapter;
if (adapter == null)
return;
var model = adapter.GetModel (position);
if (model == null)
return;
model.Continue ();
}
}
}
|
using System;
using System.Linq;
using Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
using Toggl.Joey.UI.Adapters;
namespace Toggl.Joey.UI.Fragments
{
public class LogTimeEntriesListFragment : ListFragment
{
public override void OnViewCreated (View view, Bundle savedInstanceState)
{
base.OnViewCreated (view, savedInstanceState);
ListAdapter = new LogTimeEntriesAdapter ();
}
public override void OnListItemClick (ListView l, View v, int position, long id)
{
var adapter = l.Adapter as LogTimeEntriesAdapter;
if (adapter == null)
return;
var model = adapter.GetModel (position);
if (model == null)
return;
model.IsPersisted = true;
model.Continue ();
}
}
}
|
Fix continuing historic time entries.
|
Fix continuing historic time entries.
All of the time entries in the AllTimeEntriesView aren't guaranteed to
be persisted. Thus need to make sure that the entry that the user is
trying to continue is marked as IsPersisted beforehand.
|
C#
|
bsd-3-clause
|
peeedge/mobile,ZhangLeiCharles/mobile,eatskolnikov/mobile,eatskolnikov/mobile,peeedge/mobile,masterrr/mobile,eatskolnikov/mobile,masterrr/mobile,ZhangLeiCharles/mobile
|
2d21d5c958894944e0e2a7b0febc2325a0ac02fb
|
Tests/Cosmos.TestRunner.Full/DefaultEngineConfiguration.cs
|
Tests/Cosmos.TestRunner.Full/DefaultEngineConfiguration.cs
|
using System;
using System.Collections.Generic;
using Cosmos.Build.Common;
using Cosmos.TestRunner.Core;
namespace Cosmos.TestRunner.Full
{
public class DefaultEngineConfiguration : IEngineConfiguration
{
public virtual int AllowedSecondsInKernel => 6000;
public virtual IEnumerable<RunTargetEnum> RunTargets
{
get
{
yield return RunTargetEnum.Bochs;
//yield return RunTargetEnum.VMware;
//yield return RunTargetEnum.HyperV;
//yield return RunTargetEnum.Qemu;
}
}
public virtual bool RunWithGDB => true;
public virtual bool StartBochsDebugGUI => true;
public virtual bool DebugIL2CPU => true;
public virtual string KernelPkg => String.Empty;
public virtual TraceAssemblies TraceAssembliesLevel => TraceAssemblies.User;
public virtual bool EnableStackCorruptionChecks => true;
public virtual StackCorruptionDetectionLevel StackCorruptionDetectionLevel => StackCorruptionDetectionLevel.MethodFooters;
public virtual DebugMode DebugMode => DebugMode.Source;
public virtual IEnumerable<string> KernelAssembliesToRun
{
get
{
foreach (var xKernelType in TestKernelSets.GetKernelTypesToRun())
{
yield return xKernelType.Assembly.Location;
}
}
}
}
}
|
using System;
using System.Collections.Generic;
using Cosmos.Build.Common;
using Cosmos.TestRunner.Core;
namespace Cosmos.TestRunner.Full
{
public class DefaultEngineConfiguration : IEngineConfiguration
{
public virtual int AllowedSecondsInKernel => 6000;
public virtual IEnumerable<RunTargetEnum> RunTargets
{
get
{
yield return RunTargetEnum.Bochs;
//yield return RunTargetEnum.VMware;
//yield return RunTargetEnum.HyperV;
//yield return RunTargetEnum.Qemu;
}
}
public virtual bool RunWithGDB => true;
public virtual bool StartBochsDebugGUI => true;
public virtual bool DebugIL2CPU => false;
public virtual string KernelPkg => String.Empty;
public virtual TraceAssemblies TraceAssembliesLevel => TraceAssemblies.User;
public virtual bool EnableStackCorruptionChecks => true;
public virtual StackCorruptionDetectionLevel StackCorruptionDetectionLevel => StackCorruptionDetectionLevel.MethodFooters;
public virtual DebugMode DebugMode => DebugMode.Source;
public virtual IEnumerable<string> KernelAssembliesToRun
{
get
{
foreach (var xKernelType in TestKernelSets.GetKernelTypesToRun())
{
yield return xKernelType.Assembly.Location;
}
}
}
}
}
|
Disable DebugIL2CPU to test all kernels
|
Disable DebugIL2CPU to test all kernels
|
C#
|
bsd-3-clause
|
CosmosOS/Cosmos,CosmosOS/Cosmos,zarlo/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,zarlo/Cosmos,zarlo/Cosmos,zarlo/Cosmos
|
ee27faf6662addbbb8a0ad2b9058c9682d166a03
|
Octokit/Models/Request/NewDeployKey.cs
|
Octokit/Models/Request/NewDeployKey.cs
|
using System;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
/// <summary>
/// Describes a new deployment key to create.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class NewDeployKey
{
public string Title { get; set; }
public string Key { get; set; }
internal string DebuggerDisplay
{
get { return String.Format(CultureInfo.InvariantCulture, "Key: {0}, Title: {1}", Key, Title); }
}
}
}
|
using System;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
/// <summary>
/// Describes a new deployment key to create.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class NewDeployKey
{
public string Title { get; set; }
public string Key { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the key will only be able to read repository contents. Otherwise,
/// the key will be able to read and write.
/// </summary>
/// <value>
/// <c>true</c> if [read only]; otherwise, <c>false</c>.
/// </value>
public bool ReadOnly { get; set; }
internal string DebuggerDisplay
{
get { return String.Format(CultureInfo.InvariantCulture, "Key: {0}, Title: {1}", Key, Title); }
}
}
}
|
Add the ability to create a readonly deploy key
|
Add the ability to create a readonly deploy key
|
C#
|
mit
|
mminns/octokit.net,octokit/octokit.net,dampir/octokit.net,bslliw/octokit.net,octokit-net-test-org/octokit.net,hahmed/octokit.net,cH40z-Lord/octokit.net,octokit-net-test-org/octokit.net,devkhan/octokit.net,rlugojr/octokit.net,ivandrofly/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,chunkychode/octokit.net,shiftkey-tester/octokit.net,thedillonb/octokit.net,shiftkey-tester/octokit.net,SamTheDev/octokit.net,editor-tools/octokit.net,SmithAndr/octokit.net,M-Zuber/octokit.net,gabrielweyer/octokit.net,eriawan/octokit.net,Sarmad93/octokit.net,eriawan/octokit.net,ivandrofly/octokit.net,adamralph/octokit.net,gdziadkiewicz/octokit.net,hahmed/octokit.net,rlugojr/octokit.net,mminns/octokit.net,editor-tools/octokit.net,alfhenrik/octokit.net,shana/octokit.net,shiftkey/octokit.net,SmithAndr/octokit.net,shana/octokit.net,Sarmad93/octokit.net,gdziadkiewicz/octokit.net,thedillonb/octokit.net,alfhenrik/octokit.net,TattsGroup/octokit.net,octokit/octokit.net,SamTheDev/octokit.net,dampir/octokit.net,M-Zuber/octokit.net,TattsGroup/octokit.net,fake-organization/octokit.net,khellang/octokit.net,chunkychode/octokit.net,shiftkey/octokit.net,khellang/octokit.net,gabrielweyer/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,devkhan/octokit.net
|
7097ac5f52cd26b8d4f8f5a0cec169c8fade49fa
|
src/Firehose.Web/Extensions/SyndicationItemExtensions.cs
|
src/Firehose.Web/Extensions/SyndicationItemExtensions.cs
|
using System.Linq;
using System.ServiceModel.Syndication;
namespace Firehose.Web.Extensions
{
public static class SyndicationItemExtensions
{
public static bool ApplyDefaultFilter(this SyndicationItem item)
{
if (item == null)
return false;
var hasPowerShellCategory = false;
var hasPowerShellKeywords = false;
if (item.Categories.Count > 0)
{
hasPowerShellCategory = item.Categories.Any(category =>
category.Name.ToLowerInvariant().Contains("powershell"));
}
if (item.ElementExtensions.Count > 0)
{
var element = item.ElementExtensions.FirstOrDefault(e => e.OuterName == "keywords");
if (element != null)
{
var keywords = element.GetObject<string>();
hasPowerShellKeywords = keywords.ToLowerInvariant().Contains("powershell");
}
}
var hasPowerShellTitle = item.Title?.Text.ToLowerInvariant().Contains("powershell") ?? false;
return hasPowerShellTitle || hasPowerShellCategory || hasPowerShellKeywords;
}
public static string ToHtml(this SyndicationContent content)
{
var textSyndicationContent = content as TextSyndicationContent;
if (textSyndicationContent != null)
{
return textSyndicationContent.Text;
}
return content.ToString();
}
}
}
|
using System.Linq;
using System.ServiceModel.Syndication;
namespace Firehose.Web.Extensions
{
public static class SyndicationItemExtensions
{
public static bool ApplyDefaultFilter(this SyndicationItem item)
{
if (item == null)
return false;
var hasPowerShellCategory = false;
var hasPowerShellKeywords = false;
var hasPWSHCategory = false;
var hasPWSHKeywords = false;
if (item.Categories.Count > 0)
{
hasPowerShellCategory = item.Categories.Any(category =>
category.Name.ToLowerInvariant().Contains("powershell"));
hasPWSHCategory = item.Categories.Any(category =>
category.Name.ToLowerInvariant().Contains("pwsh"));
}
if (item.ElementExtensions.Count > 0)
{
var element = item.ElementExtensions.FirstOrDefault(e => e.OuterName == "keywords");
if (element != null)
{
var keywords = element.GetObject<string>();
hasPowerShellKeywords = keywords.ToLowerInvariant().Contains("powershell");
hasPWSHKeywords = keywords.ToLowerInvariant().Contains("pwsh");
}
}
var hasPowerShellTitle = item.Title?.Text.ToLowerInvariant().Contains("powershell") ?? false;
var hasPWSHTitle = item.Title?.Text.ToLowerInvariant().Contains("pwsh") ?? false;
return hasPowerShellTitle || hasPowerShellCategory || hasPowerShellKeywords || hasPWSHTitle || hasPWSHCategory || hasPWSHKeywords;
}
public static string ToHtml(this SyndicationContent content)
{
var textSyndicationContent = content as TextSyndicationContent;
if (textSyndicationContent != null)
{
return textSyndicationContent.Text;
}
return content.ToString();
}
}
}
|
Update filter to support PWSH
|
Update filter to support PWSH
|
C#
|
mit
|
planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell
|
fa73fa9290db661827a5f457a957b8ad8fb2222f
|
src/SkiResort.XamarinApp/SkiResort.XamarinApp/Config.cs
|
src/SkiResort.XamarinApp/SkiResort.XamarinApp/Config.cs
|
using SkiResort.XamarinApp.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace SkiResort.XamarinApp
{
public static class Config
{
public const string API_URL = "__SERVERURI__/api";
public const double USER_DEFAULT_POSITION_LATITUDE = 40.7201013;
public const double USER_DEFAULT_POSITION_LONGITUDE = -74.0101931;
public static Color BAR_COLOR_BLACK = Color.FromHex("#141414");
}
}
|
using SkiResort.XamarinApp.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace SkiResort.XamarinApp
{
public static class Config
{
public const string API_URL = "__SERVERURI__";
public const double USER_DEFAULT_POSITION_LATITUDE = 40.7201013;
public const double USER_DEFAULT_POSITION_LONGITUDE = -74.0101931;
public static Color BAR_COLOR_BLACK = Color.FromHex("#141414");
}
}
|
Fix an issue with the default URI
|
Fix an issue with the default URI
|
C#
|
mit
|
PlainConcepts/AdventureWorksSkiApp,PlainConcepts/AdventureWorksSkiApp,PlainConcepts/AdventureWorksSkiApp,PlainConcepts/AdventureWorksSkiApp,PlainConcepts/AdventureWorksSkiApp
|
7af03232c45090d52902e8a5b35d6fd5ef699058
|
Assets/UnityUtilities/Scripts/Misc/UnityUtils.cs
|
Assets/UnityUtilities/Scripts/Misc/UnityUtils.cs
|
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Networking;
public static class UnityUtils
{
public static bool IsAnyKeyUp(KeyCode[] keys)
{
foreach (KeyCode key in keys)
{
if (Input.GetKeyUp(key))
return true;
}
return false;
}
public static bool IsAnyKeyDown(KeyCode[] keys)
{
foreach (KeyCode key in keys)
{
if (Input.GetKeyDown(key))
return true;
}
return false;
}
public static bool IsHeadless()
{
return SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null;
}
public static bool TryGetByNetId<T>(NetworkInstanceId targetNetId, out T output) where T : Component
{
output = null;
GameObject foundObject = ClientScene.FindLocalObject(targetNetId);
if (foundObject == null)
return false;
output = foundObject.GetComponent<T>();
if (output == null)
return false;
return true;
}
}
|
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Networking;
public static class UnityUtils
{
public static bool IsAnyKeyUp(KeyCode[] keys)
{
foreach (KeyCode key in keys)
{
if (Input.GetKeyUp(key))
return true;
}
return false;
}
public static bool IsAnyKeyDown(KeyCode[] keys)
{
foreach (KeyCode key in keys)
{
if (Input.GetKeyDown(key))
return true;
}
return false;
}
public static bool IsAnyKey(KeyCode[] keys)
{
foreach (KeyCode key in keys)
{
if (Input.GetKey(key))
return true;
}
return false;
}
public static bool IsHeadless()
{
return SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null;
}
public static bool TryGetByNetId<T>(NetworkInstanceId targetNetId, out T output) where T : Component
{
output = null;
GameObject foundObject = ClientScene.FindLocalObject(targetNetId);
if (foundObject == null)
return false;
output = foundObject.GetComponent<T>();
if (output == null)
return false;
return true;
}
}
|
Add Is any key function
|
Add Is any key function
|
C#
|
mit
|
insthync/unity-utilities
|
6a723bc27886c89b7e879ea222787b8341371498
|
ZirMed.TrainingSandbox/Views/Home/Contact.cshtml
|
ZirMed.TrainingSandbox/Views/Home/Contact.cshtml
|
@{
ViewBag.Title = "Contact";
}
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<address>
One Microsoft Way<br />
Redmond, WA 98052-6399<br />
<abbr title="Phone">P:</abbr>
425.555.0100
</address>
<address>
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@wechangedthis.com</a><br />
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
<strong>Batman:</strong> <a href="mailto:Batman@batman.com">Batman@batman.com</a>
<strong>Peter Parker</strong> <a href="mailto:spiderman@spiderman.com">Spiderman@spiderman.com</a>
</address>
|
@{
ViewBag.Title = "Contact";
}
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<address>
One Microsoft Way<br />
Redmond, WA 98052-6399<br />
<abbr title="Phone">P:</abbr>
425.555.0100
</address>
<address>
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@wechangedthis.com</a><br />
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
<strong>Batman:</strong> <a href="mailto:Batman@batman.com">Batman@batman.com</a>
<strong>Peter Parker</strong> <a href="mailto:spiderman@spiderman.com">Spiderman@spiderman.com</a>
<strong>Travis Elkins</strong>
</address>
|
Add Travis to contact page.
|
Add Travis to contact page.
|
C#
|
mit
|
jpfultonzm/trainingsandbox,jpfultonzm/trainingsandbox,jpfultonzm/trainingsandbox
|
3d72c8fa7bdb9b7c0715cb5d389e471e33826f49
|
GitTfs/Commands/Unshelve.cs
|
GitTfs/Commands/Unshelve.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using CommandLine.OptParse;
using Sep.Git.Tfs.Core;
using Sep.Git.Tfs.Core.TfsInterop;
using StructureMap;
namespace Sep.Git.Tfs.Commands
{
[Pluggable("unshelve")]
[Description("unshelve [options] (-l | shelveset-name destination-branch)")]
[RequiresValidGitRepository]
public class Unshelve : GitTfsCommand
{
private readonly Globals _globals;
public Unshelve(Globals globals)
{
_globals = globals;
}
[OptDef(OptValType.ValueReq)]
[ShortOptionName('u')]
[LongOptionName("user")]
[UseNameAsLongOption(false)]
[Description("Shelveset owner (default is the current user; 'all' means all users)")]
public string Owner { get; set; }
public IEnumerable<IOptionResults> ExtraOptions
{
get { return this.MakeNestedOptionResults(); }
}
public int Run(IList<string> args)
{
// TODO -- let the remote be specified on the command line.
var remote = _globals.Repository.ReadAllTfsRemotes().First();
return remote.Tfs.Unshelve(this, remote, args);
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using CommandLine.OptParse;
using Sep.Git.Tfs.Core;
using StructureMap;
namespace Sep.Git.Tfs.Commands
{
[Pluggable("unshelve")]
[Description("unshelve [options] (-l | shelveset-name destination-branch)")]
[RequiresValidGitRepository]
public class Unshelve : GitTfsCommand
{
private readonly Globals _globals;
public Unshelve(Globals globals)
{
_globals = globals;
}
[OptDef(OptValType.ValueReq)]
[ShortOptionName('u')]
[LongOptionName("user")]
[UseNameAsLongOption(false)]
[Description("Shelveset owner (default is the current user; 'all' means all users)")]
public string Owner { get; set; }
public IEnumerable<IOptionResults> ExtraOptions
{
get { return this.MakeNestedOptionResults(); }
}
public int Run(IList<string> args)
{
var remote = _globals.Repository.ReadTfsRemote(_globals.RemoteId);
return remote.Tfs.Unshelve(this, remote, args);
}
}
}
|
Fix the TODO item in Ushelve so it can support multiple TFS remotes
|
Fix the TODO item in Ushelve so it can support multiple TFS remotes
|
C#
|
apache-2.0
|
modulexcite/git-tfs,timotei/git-tfs,steveandpeggyb/Public,spraints/git-tfs,jeremy-sylvis-tmg/git-tfs,NathanLBCooper/git-tfs,bleissem/git-tfs,allansson/git-tfs,allansson/git-tfs,hazzik/git-tfs,hazzik/git-tfs,bleissem/git-tfs,adbre/git-tfs,vzabavnov/git-tfs,NathanLBCooper/git-tfs,hazzik/git-tfs,guyboltonking/git-tfs,guyboltonking/git-tfs,kgybels/git-tfs,TheoAndersen/git-tfs,allansson/git-tfs,NathanLBCooper/git-tfs,steveandpeggyb/Public,irontoby/git-tfs,TheoAndersen/git-tfs,modulexcite/git-tfs,kgybels/git-tfs,codemerlin/git-tfs,TheoAndersen/git-tfs,git-tfs/git-tfs,spraints/git-tfs,TheoAndersen/git-tfs,irontoby/git-tfs,kgybels/git-tfs,codemerlin/git-tfs,adbre/git-tfs,modulexcite/git-tfs,WolfVR/git-tfs,andyrooger/git-tfs,adbre/git-tfs,bleissem/git-tfs,steveandpeggyb/Public,allansson/git-tfs,spraints/git-tfs,jeremy-sylvis-tmg/git-tfs,hazzik/git-tfs,WolfVR/git-tfs,codemerlin/git-tfs,WolfVR/git-tfs,pmiossec/git-tfs,irontoby/git-tfs,jeremy-sylvis-tmg/git-tfs,timotei/git-tfs,PKRoma/git-tfs,guyboltonking/git-tfs,timotei/git-tfs
|
dac733cced62e30089f52fa6147f5210197b3e20
|
osu.Game.Rulesets.Osu/Edit/OsuChecker.cs
|
osu.Game.Rulesets.Osu/Edit/OsuChecker.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Edit.Checks.Components;
using osu.Game.Rulesets.Osu.Edit.Checks;
namespace osu.Game.Rulesets.Osu.Edit
{
public class OsuChecker : Checker
{
public readonly List<Check> beatmapChecks = new List<Check>
{
new CheckOffscreenObjects()
};
public override IEnumerable<Issue> Run(IBeatmap beatmap)
{
// Also run mode-invariant checks.
foreach (var issue in base.Run(beatmap))
yield return issue;
foreach (var issue in beatmapChecks.SelectMany(check => check.Run(beatmap)))
yield return issue;
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Edit.Checks.Components;
using osu.Game.Rulesets.Osu.Edit.Checks;
namespace osu.Game.Rulesets.Osu.Edit
{
public class OsuChecker : Checker
{
private readonly List<Check> checks = new List<Check>
{
new CheckOffscreenObjects()
};
public override IEnumerable<Issue> Run(IBeatmap beatmap)
{
// Also run mode-invariant checks.
foreach (var issue in base.Run(beatmap))
yield return issue;
foreach (var issue in checks.SelectMany(check => check.Run(beatmap)))
yield return issue;
}
}
}
|
Fix field name and accessibility
|
Fix field name and accessibility
|
C#
|
mit
|
smoogipoo/osu,ppy/osu,peppy/osu,NeoAdonis/osu,smoogipoo/osu,ppy/osu,peppy/osu,UselessToucan/osu,UselessToucan/osu,peppy/osu-new,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,ppy/osu,peppy/osu,smoogipooo/osu,UselessToucan/osu
|
d0bd83f0207a734011a050402c7d2debd0f8ecac
|
setup.cake
|
setup.cake
|
#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease
Environment.SetVariableNames();
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./",
title: "Cake.FileHelpers",
repositoryOwner: "cake-contrib",
repositoryName: "Cake.FileHelpers",
appVeyorAccountName: "cakecontrib",
shouldRunDupFinder: false,
shouldRunInspectCode: false);
BuildParameters.PrintParameters(Context);
ToolSettings.SetToolSettings(context: Context,
dupFinderExcludePattern: new string[] {
BuildParameters.RootDirectoryPath + "/Cake.FileHelpers.Tests/*.cs" },
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* -[FakeItEasy]*",
testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",
testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs");
Build.RunDotNetCore();
|
#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease
Environment.SetVariableNames();
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: Context.Environment.WorkingDirectory,
title: "Cake.FileHelpers",
repositoryOwner: "cake-contrib",
repositoryName: "Cake.FileHelpers",
appVeyorAccountName: "cakecontrib",
shouldRunDupFinder: false,
shouldRunInspectCode: false);
BuildParameters.PrintParameters(Context);
ToolSettings.SetToolSettings(context: Context,
dupFinderExcludePattern: new string[] {
BuildParameters.RootDirectoryPath + "/Cake.FileHelpers.Tests/*.cs" },
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* -[FakeItEasy]*",
testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",
testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs");
Build.RunDotNetCore();
|
Fix source dir path (doesn't like "./")
|
Fix source dir path (doesn't like "./")
|
C#
|
apache-2.0
|
Redth/Cake.FileHelpers,Redth/Cake.FileHelpers
|
92f212f07b0d00f1d96e6aa6b5cf968270b8ab90
|
xFunc.Library.Maths/Expressions/AssignMathExpression.cs
|
xFunc.Library.Maths/Expressions/AssignMathExpression.cs
|
using System;
namespace xFunc.Library.Maths.Expressions
{
public class AssignMathExpression : IMathExpression
{
private VariableMathExpression variable;
private IMathExpression value;
public AssignMathExpression()
: this(null, null)
{
}
public AssignMathExpression(VariableMathExpression variable, IMathExpression value)
{
this.variable = variable;
this.value = value;
}
public double Calculate(MathParameterCollection parameters)
{
if (parameters == null)
throw new ArgumentNullException("parameters");
parameters.Add(variable.Variable, value.Calculate(parameters));
return double.NaN;
}
public IMathExpression Derivative()
{
throw new NotSupportedException();
}
public IMathExpression Derivative(VariableMathExpression variable)
{
throw new NotSupportedException();
}
public VariableMathExpression Variable
{
get
{
return variable;
}
set
{
variable = value;
}
}
public IMathExpression Value
{
get
{
return this.value;
}
set
{
this.value = value;
}
}
public IMathExpression Parent
{
get
{
return null;
}
set
{
}
}
}
}
|
using System;
namespace xFunc.Library.Maths.Expressions
{
public class AssignMathExpression : IMathExpression
{
private VariableMathExpression variable;
private IMathExpression value;
public AssignMathExpression()
: this(null, null)
{
}
public AssignMathExpression(VariableMathExpression variable, IMathExpression value)
{
this.variable = variable;
this.value = value;
}
public double Calculate(MathParameterCollection parameters)
{
if (parameters == null)
throw new ArgumentNullException("parameters");
parameters[variable.Variable] = value.Calculate(parameters);
return double.NaN;
}
public IMathExpression Derivative()
{
throw new NotSupportedException();
}
public IMathExpression Derivative(VariableMathExpression variable)
{
throw new NotSupportedException();
}
public VariableMathExpression Variable
{
get
{
return variable;
}
set
{
variable = value;
}
}
public IMathExpression Value
{
get
{
return this.value;
}
set
{
this.value = value;
}
}
public IMathExpression Parent
{
get
{
return null;
}
set
{
}
}
}
}
|
Fix bug with reassigning the variable.
|
Fix bug with reassigning the variable.
|
C#
|
mit
|
sys27/xFunc
|
262a4bac529a3e212282eec6428cb39de74fd8c2
|
Scripts/Utils/Reflection.cs
|
Scripts/Utils/Reflection.cs
|
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace LiteNetLibManager.Utils
{
public class Reflection
{
private static readonly Dictionary<string, ObjectActivator> objectActivators = new Dictionary<string, ObjectActivator>();
private static string tempTypeName;
// Improve reflection constructor performance with Linq expression (https://rogerjohansson.blog/2008/02/28/linq-expressions-creating-objects/)
public delegate object ObjectActivator();
public static ObjectActivator GetActivator(Type type)
{
tempTypeName = type.Name;
if (!objectActivators.ContainsKey(tempTypeName))
{
if (type.IsClass)
objectActivators.Add(tempTypeName, Expression.Lambda<ObjectActivator>(Expression.New(type)).Compile());
else
objectActivators.Add(tempTypeName, Expression.Lambda<ObjectActivator>(Expression.Convert(Expression.New(type), typeof(object))).Compile());
}
return objectActivators[tempTypeName];
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace LiteNetLibManager.Utils
{
public class Reflection
{
private static readonly Dictionary<string, ObjectActivator> objectActivators = new Dictionary<string, ObjectActivator>();
private static string tempTypeName;
// Improve reflection constructor performance with Linq expression (https://rogerjohansson.blog/2008/02/28/linq-expressions-creating-objects/)
public delegate object ObjectActivator();
public static ObjectActivator GetActivator(Type type)
{
tempTypeName = type.FullName;
if (!objectActivators.ContainsKey(tempTypeName))
{
if (type.IsClass)
objectActivators.Add(tempTypeName, Expression.Lambda<ObjectActivator>(Expression.New(type)).Compile());
else
objectActivators.Add(tempTypeName, Expression.Lambda<ObjectActivator>(Expression.Convert(Expression.New(type), typeof(object))).Compile());
}
return objectActivators[tempTypeName];
}
}
}
|
Use fullname for sure that it will not duplicate with other
|
Use fullname for sure that it will not duplicate with other
|
C#
|
mit
|
insthync/LiteNetLibManager,insthync/LiteNetLibManager
|
86b6e0e302102774d7810bb46baa3afa96655e4b
|
Src/AutoFixture.NUnit3.UnitTest/DependencyConstraints.cs
|
Src/AutoFixture.NUnit3.UnitTest/DependencyConstraints.cs
|
using System.Linq;
using NUnit.Framework;
namespace Ploeh.AutoFixture.NUnit3.UnitTest
{
[TestFixture]
public class DependencyConstraints
{
[TestCase("Moq")]
[TestCase("Rhino.Mocks")]
public void AutoFixtureNUnit3DoesNotReference(string assemblyName)
{
// Fixture setup
// Exercise system
var references = typeof(AutoDataAttribute).Assembly.GetReferencedAssemblies();
// Verify outcome
Assert.False(references.Any(an => an.Name == assemblyName));
// Teardown
}
[TestCase("Moq")]
[TestCase("Rhino.Mocks")]
public void AutoFixtureNUnit3UnitTestsDoNotReference(string assemblyName)
{
// Fixture setup
// Exercise system
var references = this.GetType().Assembly.GetReferencedAssemblies();
// Verify outcome
Assert.False(references.Any(an => an.Name == assemblyName));
// Teardown
}
}
}
|
using System.Linq;
using NUnit.Framework;
namespace Ploeh.AutoFixture.NUnit3.UnitTest
{
[TestFixture]
public class DependencyConstraints
{
[TestCase("FakeItEasy")]
[TestCase("Foq")]
[TestCase("FsCheck")]
[TestCase("Moq")]
[TestCase("NSubstitute")]
[TestCase("Rhino.Mocks")]
[TestCase("Unquote")]
[TestCase("xunit")]
[TestCase("xunit.extensions")]
public void AutoFixtureNUnit3DoesNotReference(string assemblyName)
{
// Fixture setup
// Exercise system
var references = typeof(AutoDataAttribute).Assembly.GetReferencedAssemblies();
// Verify outcome
Assert.False(references.Any(an => an.Name == assemblyName));
// Teardown
}
[TestCase("FakeItEasy")]
[TestCase("Foq")]
[TestCase("FsCheck")]
[TestCase("Moq")]
[TestCase("NSubstitute")]
[TestCase("Rhino.Mocks")]
[TestCase("Unquote")]
[TestCase("xunit")]
[TestCase("xunit.extensions")]
public void AutoFixtureNUnit3UnitTestsDoNotReference(string assemblyName)
{
// Fixture setup
// Exercise system
var references = this.GetType().Assembly.GetReferencedAssemblies();
// Verify outcome
Assert.False(references.Any(an => an.Name == assemblyName));
// Teardown
}
}
}
|
Add other mocking libs in dependency contraints
|
Add other mocking libs in dependency contraints
|
C#
|
mit
|
adamchester/AutoFixture,sergeyshushlyapin/AutoFixture,adamchester/AutoFixture,dcastro/AutoFixture,sbrockway/AutoFixture,hackle/AutoFixture,AutoFixture/AutoFixture,dcastro/AutoFixture,sbrockway/AutoFixture,Pvlerick/AutoFixture,zvirja/AutoFixture,sergeyshushlyapin/AutoFixture,hackle/AutoFixture,sean-gilliam/AutoFixture
|
a358a30583d61c8f75b66f21106145efb3af068f
|
Assets/Scripts/Helpers/InputInterceptor.cs
|
Assets/Scripts/Helpers/InputInterceptor.cs
|
using System;
using UnityEngine;
public static class InputInterceptor
{
static InputInterceptor()
{
Type abstractControlsType = ReflectionHelper.FindType("AbstractControls");
_inputSystems = Resources.FindObjectsOfTypeAll(abstractControlsType);
}
public static void EnableInput()
{
foreach (UnityEngine.Object inputSystem in _inputSystems)
{
try
{
((MonoBehaviour)inputSystem).gameObject.SetActive(true);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
}
}
public static void DisableInput()
{
foreach (UnityEngine.Object inputSystem in _inputSystems)
{
try
{
((MonoBehaviour)inputSystem).gameObject.SetActive(false);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
}
}
private static UnityEngine.Object[] _inputSystems = null;
}
|
using System;
using UnityEngine;
public static class InputInterceptor
{
static InputInterceptor()
{
Type abstractControlsType = ReflectionHelper.FindType("AbstractControls");
_inputSystems = Resources.FindObjectsOfTypeAll(abstractControlsType);
}
public static void EnableInput()
{
foreach (UnityEngine.Object inputSystem in _inputSystems)
{
try
{
((MonoBehaviour)inputSystem).gameObject.SetActive(true);
Cursor.visible = true;
}
catch (Exception ex)
{
Debug.LogException(ex);
}
}
}
public static void DisableInput()
{
foreach (UnityEngine.Object inputSystem in _inputSystems)
{
try
{
((MonoBehaviour)inputSystem).gameObject.SetActive(false);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
}
}
private static UnityEngine.Object[] _inputSystems = null;
}
|
Stop mouse cursor disappearing when input is restored with Esc button
|
Stop mouse cursor disappearing when input is restored with Esc button
|
C#
|
mit
|
CaitSith2/ktanemod-twitchplays,ashbash1987/ktanemod-twitchplays
|
957ac3742a3b571098e85ab32e4e84a57c6b0c1c
|
CertiPay.Payroll.Common/ExtensionMethods.cs
|
CertiPay.Payroll.Common/ExtensionMethods.cs
|
using System;
using System.ComponentModel;
using System.Reflection;
namespace CertiPay.Payroll.Common
{
public static class ExtensionMethods
{
/// <summary>
/// Returns the display name from the description attribute on the enumeration, if available.
/// Otherwise returns the ToString() value.
/// </summary>
public static string DisplayName(this Enum val)
{
FieldInfo fi = val.GetType().GetField(val.ToString());
DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);
if (attributes != null && attributes.Length > 0)
{
return attributes[0].Description;
}
return val.ToString();
}
}
}
|
using System;
using System.ComponentModel;
using System.Reflection;
namespace CertiPay.Payroll.Common
{
public static class ExtensionMethods
{
/// <summary>
/// Round the decimal to the given number of decimal places using the given method of rounding.
/// By default, this is 2 decimal places to the nearest even for middle values
/// i.e. 1.455 -> 1.46
/// </summary>
public static Decimal Round(this Decimal val, int decimals = 2, MidpointRounding rounding = MidpointRounding.ToEven)
{
return Math.Round(val, decimals, rounding);
}
/// <summary>
/// Returns the display name from the description attribute on the enumeration, if available.
/// Otherwise returns the ToString() value.
/// </summary>
public static string DisplayName(this Enum val)
{
FieldInfo fi = val.GetType().GetField(val.ToString());
DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);
if (attributes != null && attributes.Length > 0)
{
return attributes[0].Description;
}
return val.ToString();
}
}
}
|
Add method for rounding decimals.
|
Add method for rounding decimals.
|
C#
|
mit
|
mattgwagner/CertiPay.Payroll.Common
|
e4297ffeaded24ea61f8fd188e7fb92215d70674
|
osu.Game/Rulesets/Mods/ModCinema.cs
|
osu.Game/Rulesets/Mods/ModCinema.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.UI;
using osu.Game.Screens.Play;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModCinema<T> : ModCinema, IApplicableToDrawableRuleset<T>
where T : HitObject
{
public virtual void ApplyToDrawableRuleset(DrawableRuleset<T> drawableRuleset)
{
drawableRuleset.SetReplayScore(CreateReplayScore(drawableRuleset.Beatmap));
drawableRuleset.Playfield.AlwaysPresent = true;
drawableRuleset.Playfield.Hide();
}
}
public class ModCinema : ModAutoplay, IApplicableToHUD, IApplicableToPlayer
{
public override string Name => "Cinema";
public override string Acronym => "CN";
public override IconUsage Icon => OsuIcon.ModCinema;
public override string Description => "Watch the video without visual distractions.";
public void ApplyToHUD(HUDOverlay overlay)
{
overlay.AlwaysPresent = true;
overlay.Hide();
}
public void ApplyToPlayer(Player player)
{
player.Background.EnableUserDim.Value = false;
player.DimmableVideo.IgnoreUserSettings.Value = true;
player.DimmableStoryboard.IgnoreUserSettings.Value = true;
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.UI;
using osu.Game.Screens.Play;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModCinema<T> : ModCinema, IApplicableToDrawableRuleset<T>
where T : HitObject
{
public virtual void ApplyToDrawableRuleset(DrawableRuleset<T> drawableRuleset)
{
drawableRuleset.SetReplayScore(CreateReplayScore(drawableRuleset.Beatmap));
drawableRuleset.Playfield.AlwaysPresent = true;
drawableRuleset.Playfield.Hide();
}
}
public class ModCinema : ModAutoplay, IApplicableToHUD, IApplicableToPlayer
{
public override string Name => "Cinema";
public override string Acronym => "CN";
public override IconUsage Icon => OsuIcon.ModCinema;
public override string Description => "Watch the video without visual distractions.";
public void ApplyToHUD(HUDOverlay overlay)
{
overlay.ShowHud.Value = false;
overlay.ShowHud.Disabled = true;
}
public void ApplyToPlayer(Player player)
{
player.Background.EnableUserDim.Value = false;
player.DimmableVideo.IgnoreUserSettings.Value = true;
player.DimmableStoryboard.IgnoreUserSettings.Value = true;
}
}
}
|
Hide HUD in a better way
|
Hide HUD in a better way
|
C#
|
mit
|
peppy/osu,UselessToucan/osu,2yangk23/osu,ppy/osu,smoogipoo/osu,EVAST9919/osu,NeoAdonis/osu,2yangk23/osu,UselessToucan/osu,NeoAdonis/osu,ppy/osu,johnneijzen/osu,EVAST9919/osu,smoogipoo/osu,johnneijzen/osu,peppy/osu,peppy/osu-new,ppy/osu,smoogipoo/osu,smoogipooo/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu
|
cfe44c640de8f732fd9a7a0573e42e9f2036d266
|
Titan/Logging/LogCreator.cs
|
Titan/Logging/LogCreator.cs
|
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using Serilog;
using Serilog.Core;
namespace Titan.Logging
{
public class LogCreator
{
public static DirectoryInfo LogDirectory = new DirectoryInfo(Environment.CurrentDirectory +
Path.DirectorySeparatorChar + "logs");
public static Logger Create(string name)
{
return new LoggerConfiguration()
.WriteTo.LiterateConsole(outputTemplate:
"{Timestamp:HH:mm:ss} [{Thread}] {Level:u} {Name} - {Message}{NewLine}{Exception}")
.WriteTo.Async(a => a.RollingFile(Path.Combine(LogDirectory.ToString(),
name + "-{Date}.log"), outputTemplate:
"[{Timestamp:HH:mm:ss} {Level:u}] {Name} @ {ThreadId} - {Message}{NewLine}{Exception}"))
.MinimumLevel.Debug() // TODO: Change this to "INFO" on release.
.Enrich.WithProperty("Name", name)
.Enrich.WithProperty("Thread", Thread.CurrentThread.Name)
.Enrich.FromLogContext()
.Enrich.WithThreadId()
.CreateLogger();
}
public static Logger Create()
{
var reflectedType = new StackTrace().GetFrame(1).GetMethod().ReflectedType;
return Create(reflectedType != null ? reflectedType.Name : "Titan (unknown Parent)");
}
}
}
|
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using Serilog;
using Serilog.Core;
namespace Titan.Logging
{
public class LogCreator
{
private static DirectoryInfo _logDir = new DirectoryInfo(Environment.CurrentDirectory +
Path.DirectorySeparatorChar + "logs");
public static Logger Create(string name)
{
return new LoggerConfiguration()
.WriteTo.LiterateConsole(outputTemplate:
"{Timestamp:HH:mm:ss} [{Thread}] {Level:u} {Name} - {Message}{NewLine}{Exception}")
.WriteTo.Async(a => a.RollingFile(Path.Combine(_logDir.ToString(),
name + "-{Date}.log"), outputTemplate:
"[{Timestamp:HH:mm:ss} {Level:u}] {Name} @ {ThreadId} - {Message}{NewLine}{Exception}"))
.MinimumLevel.Debug() // TODO: Change this to "INFO" on release.
.Enrich.WithProperty("Name", name)
.Enrich.WithProperty("Thread", Thread.CurrentThread.Name)
.Enrich.FromLogContext()
.Enrich.WithThreadId()
.CreateLogger();
}
public static Logger Create()
{
var reflectedType = new StackTrace().GetFrame(1).GetMethod().ReflectedType;
return Create(reflectedType != null ? reflectedType.Name : "Titan (unknown Parent)");
}
}
}
|
Change field name to "_logDir"
|
Change field name to "_logDir"
|
C#
|
mit
|
Marc3842h/Titan,Marc3842h/Titan,Marc3842h/Titan
|
2479494d5a4243d1d0bbbf638d215800637696a4
|
osu.Framework/Input/FrameworkActionContainer.cs
|
osu.Framework/Input/FrameworkActionContainer.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Input.Bindings;
namespace osu.Framework.Input
{
internal class FrameworkActionContainer : KeyBindingContainer<FrameworkAction>
{
public override IEnumerable<KeyBinding> DefaultKeyBindings => new[]
{
new KeyBinding(new[] { InputKey.Control, InputKey.F1 }, FrameworkAction.ToggleDrawVisualiser),
new KeyBinding(new[] { InputKey.Control, InputKey.F2 }, FrameworkAction.ToggleGlobalStatistics),
new KeyBinding(new[] { InputKey.Control, InputKey.F11 }, FrameworkAction.CycleFrameStatistics),
new KeyBinding(new[] { InputKey.Control, InputKey.F10 }, FrameworkAction.ToggleLogOverlay),
new KeyBinding(new[] { InputKey.Alt, InputKey.Enter }, FrameworkAction.ToggleFullscreen),
};
protected override bool Prioritised => true;
}
public enum FrameworkAction
{
CycleFrameStatistics,
ToggleDrawVisualiser,
ToggleGlobalStatistics,
ToggleLogOverlay,
ToggleFullscreen
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Input.Bindings;
namespace osu.Framework.Input
{
internal class FrameworkActionContainer : KeyBindingContainer<FrameworkAction>
{
public override IEnumerable<KeyBinding> DefaultKeyBindings => new[]
{
new KeyBinding(new[] { InputKey.Control, InputKey.F1 }, FrameworkAction.ToggleDrawVisualiser),
new KeyBinding(new[] { InputKey.Control, InputKey.F2 }, FrameworkAction.ToggleGlobalStatistics),
new KeyBinding(new[] { InputKey.Control, InputKey.F11 }, FrameworkAction.CycleFrameStatistics),
new KeyBinding(new[] { InputKey.Control, InputKey.F10 }, FrameworkAction.ToggleLogOverlay),
new KeyBinding(new[] { InputKey.Alt, InputKey.Enter }, FrameworkAction.ToggleFullscreen),
new KeyBinding(new[] { InputKey.F11 }, FrameworkAction.ToggleFullscreen)
};
protected override bool Prioritised => true;
}
public enum FrameworkAction
{
CycleFrameStatistics,
ToggleDrawVisualiser,
ToggleGlobalStatistics,
ToggleLogOverlay,
ToggleFullscreen
}
}
|
Allow using F11 to toggle fullscreen
|
Allow using F11 to toggle fullscreen
|
C#
|
mit
|
smoogipooo/osu-framework,ZLima12/osu-framework,ZLima12/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,ppy/osu-framework,peppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework
|
4045a1584681b646ffe05ee10123921eeec4aa7b
|
examples/Precompiled/CdnUrlModifier.cs
|
examples/Precompiled/CdnUrlModifier.cs
|
using System;
using System.Web;
using Cassette;
namespace Precompiled
{
/// <summary>
/// An example implementation of Cassette.IUrlModifier.
///
/// </summary>
public class CdnUrlModifier : IUrlModifier
{
public string Modify(string url)
{
// The url passed to modify will be a relative path.
// For example: "_cassette/scriptbundle/scripts/app_abc123"
// We can return a modified URL. For example, prefixing something like "http://mycdn.com/myapp/"
var prefix = GetCdnUrlPrefix();
return prefix + url;
}
static string GetCdnUrlPrefix()
{
// We don't have a CDN for this sample.
// So just build an absolute URL instead.
var host = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority);
var prefix = host + HttpRuntime.AppDomainAppVirtualPath.TrimEnd('/') + "/";
return prefix;
}
}
}
|
using System;
using System.Web;
using Cassette;
namespace Precompiled
{
/// <summary>
/// An example implementation of Cassette.IUrlModifier.
/// </summary>
public class CdnUrlModifier : IUrlModifier
{
readonly string prefix;
public CdnUrlModifier(HttpContextBase httpContext)
{
// We don't have a CDN for this sample.
// So just build an absolute URL instead.
var host = httpContext.Request.Url.GetLeftPart(UriPartial.Authority);
prefix = host + httpContext.Request.ApplicationPath.TrimEnd('/') + "/";
}
public string Modify(string url)
{
// The url passed to modify will be a relative path.
// For example: "_cassette/scriptbundle/scripts/app_abc123"
// We can return a modified URL. For example, prefixing something like "http://mycdn.com/myapp/"
return prefix + url;
}
}
}
|
Update IUrlModifier to work on any thread by not using HttpContext.Current in the Modify method.
|
Update IUrlModifier to work on any thread by not using HttpContext.Current in the Modify method.
|
C#
|
mit
|
damiensawyer/cassette,BluewireTechnologies/cassette,BluewireTechnologies/cassette,damiensawyer/cassette,damiensawyer/cassette,honestegg/cassette,andrewdavey/cassette,andrewdavey/cassette,honestegg/cassette,honestegg/cassette,andrewdavey/cassette
|
7be05293f92a1d1c2f645bc026baeecbfa58e1bc
|
src/Web/WebMVC/Views/Catalog/_pagination.cshtml
|
src/Web/WebMVC/Views/Catalog/_pagination.cshtml
|
@model Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination.PaginationInfo
<div class="esh-pager">
<div class="container">
<article class="esh-pager-wrapper row">
<nav>
<a class="esh-pager-item esh-pager-item--navigable @Model.Previous"
id="Previous"
href="@Url.Action("Index","Catalog", new { page = Model.ActualPage -1 })"
aria-label="Previous">
Previous
</a>
<span class="esh-pager-item">
Showing @Html.DisplayFor(modelItem => modelItem.ItemsPerPage) of @Html.DisplayFor(modelItem => modelItem.TotalItems) products - Page @(Model.ActualPage + 1) - @Html.DisplayFor(x => x.TotalPages)
</span>
<a class="esh-pager-item esh-pager-item--navigable @Model.Next"
id="Next"
href="@Url.Action("Index","Catalog", new { page = Model.ActualPage + 1 })"
aria-label="Next">
Next
</a>
</nav>
</article>
</div>
</div>
|
@model Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination.PaginationInfo
<div class="esh-pager">
<div class="container">
<article class="esh-pager-wrapper row">
<nav>
<a class="esh-pager-item esh-pager-item--navigable @Model.Previous"
id="Previous"
asp-controller="Catalog"
asp-action="Index"
asp-route-page="@(Model.ActualPage -1)"
aria-label="Previous">
Previous
</a>
<span class="esh-pager-item">
Showing @Model.ItemsPerPage of @Model.TotalItems products - Page @(Model.ActualPage + 1) - @Model.TotalPages
</span>
<a class="esh-pager-item esh-pager-item--navigable @Model.Next"
id="Next"
asp-controller="Catalog"
asp-action="Index"
asp-route-page="@(Model.ActualPage + 1)"
aria-label="Next">
Next
</a>
</nav>
</article>
</div>
</div>
|
Refactor in pagination view to use tag helpers
|
Refactor in pagination view to use tag helpers
|
C#
|
mit
|
skynode/eShopOnContainers,andrelmp/eShopOnContainers,albertodall/eShopOnContainers,dotnet-architecture/eShopOnContainers,oferns/eShopOnContainers,productinfo/eShopOnContainers,BillWagner/eShopOnContainers,oferns/eShopOnContainers,skynode/eShopOnContainers,albertodall/eShopOnContainers,oferns/eShopOnContainers,dotnet-architecture/eShopOnContainers,albertodall/eShopOnContainers,andrelmp/eShopOnContainers,productinfo/eShopOnContainers,andrelmp/eShopOnContainers,productinfo/eShopOnContainers,productinfo/eShopOnContainers,skynode/eShopOnContainers,BillWagner/eShopOnContainers,albertodall/eShopOnContainers,albertodall/eShopOnContainers,BillWagner/eShopOnContainers,productinfo/eShopOnContainers,skynode/eShopOnContainers,oferns/eShopOnContainers,TypeW/eShopOnContainers,andrelmp/eShopOnContainers,BillWagner/eShopOnContainers,dotnet-architecture/eShopOnContainers,andrelmp/eShopOnContainers,TypeW/eShopOnContainers,TypeW/eShopOnContainers,oferns/eShopOnContainers,skynode/eShopOnContainers,TypeW/eShopOnContainers,dotnet-architecture/eShopOnContainers,andrelmp/eShopOnContainers,BillWagner/eShopOnContainers,TypeW/eShopOnContainers,productinfo/eShopOnContainers,dotnet-architecture/eShopOnContainers
|
1892ba8d0a7ac9106467e703f43519b2a8327bbb
|
Duplicati/UnitTest/RepairHandlerTests.cs
|
Duplicati/UnitTest/RepairHandlerTests.cs
|
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Duplicati.Library.Main;
using NUnit.Framework;
namespace Duplicati.UnitTest
{
[TestFixture]
public class RepairHandlerTests : BasicSetupHelper
{
public override void SetUp()
{
base.SetUp();
File.WriteAllBytes(Path.Combine(this.DATAFOLDER, "emptyFile"), new byte[] {0});
}
[Test]
[Category("RepairHandler")]
[TestCase("true")]
[TestCase("false")]
public void RepairMissingIndexFiles(string noEncryption)
{
Dictionary<string, string> options = new Dictionary<string, string>(this.TestOptions) {["no-encryption"] = noEncryption};
using (Controller c = new Controller("file://" + this.TARGETFOLDER, options, null))
{
c.Backup(new[] {this.DATAFOLDER});
}
string[] dindexFiles = Directory.EnumerateFiles(this.TARGETFOLDER, "*dindex*").ToArray();
Assert.Greater(dindexFiles.Length, 0);
foreach (string f in dindexFiles)
{
File.Delete(f);
}
using (Controller c = new Controller("file://" + this.TARGETFOLDER, options, null))
{
c.Repair();
}
foreach (string file in dindexFiles)
{
Assert.IsTrue(File.Exists(Path.Combine(this.TARGETFOLDER, file)));
}
}
}
}
|
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Duplicati.Library.Main;
using NUnit.Framework;
namespace Duplicati.UnitTest
{
[TestFixture]
public class RepairHandlerTests : BasicSetupHelper
{
public override void SetUp()
{
base.SetUp();
File.WriteAllBytes(Path.Combine(this.DATAFOLDER, "file"), new byte[] {0});
}
[Test]
[Category("RepairHandler")]
[TestCase("true")]
[TestCase("false")]
public void RepairMissingIndexFiles(string noEncryption)
{
Dictionary<string, string> options = new Dictionary<string, string>(this.TestOptions) {["no-encryption"] = noEncryption};
using (Controller c = new Controller("file://" + this.TARGETFOLDER, options, null))
{
c.Backup(new[] {this.DATAFOLDER});
}
string[] dindexFiles = Directory.EnumerateFiles(this.TARGETFOLDER, "*dindex*").ToArray();
Assert.Greater(dindexFiles.Length, 0);
foreach (string f in dindexFiles)
{
File.Delete(f);
}
using (Controller c = new Controller("file://" + this.TARGETFOLDER, options, null))
{
c.Repair();
}
foreach (string file in dindexFiles)
{
Assert.IsTrue(File.Exists(Path.Combine(this.TARGETFOLDER, file)));
}
}
}
}
|
Fix poorly named test file.
|
Fix poorly named test file.
|
C#
|
lgpl-2.1
|
mnaiman/duplicati,duplicati/duplicati,duplicati/duplicati,mnaiman/duplicati,duplicati/duplicati,mnaiman/duplicati,mnaiman/duplicati,mnaiman/duplicati,duplicati/duplicati,duplicati/duplicati
|
eae585b4735ac058596b9723c466e8576149d28f
|
src/Core2D.Avalonia/Presenters/CachedContentPresenter.cs
|
src/Core2D.Avalonia/Presenters/CachedContentPresenter.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 Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using System;
using System.Collections.Generic;
namespace Core2D.Avalonia.Presenters
{
public class CachedContentPresenter : ContentPresenter
{
private static IDictionary<Type, Func<Control>> _factory = new Dictionary<Type, Func<Control>>();
private readonly IDictionary<Type, Control> _cache = new Dictionary<Type, Control>();
public static void Register(Type type, Func<Control> create) => _factory[type] = create;
public CachedContentPresenter()
{
this.GetObservable(DataContextProperty).Subscribe((value) => SetContent(value));
}
public Control GetControl(Type type)
{
Control control;
_cache.TryGetValue(type, out control);
if (control == null)
{
Func<Control> createInstance;
_factory.TryGetValue(type, out createInstance);
control = createInstance?.Invoke();
if (control != null)
{
_cache[type] = control;
}
else
{
throw new Exception($"Can not find factory method for type: {type}");
}
}
return control;
}
public void SetContent(object value)
{
Control control = null;
if (value != null)
{
control = GetControl(value.GetType());
}
this.Content = control;
}
}
}
|
// 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 Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using System;
using System.Collections.Generic;
namespace Core2D.Avalonia.Presenters
{
public class CachedContentPresenter : ContentPresenter
{
private static IDictionary<Type, Func<Control>> _factory = new Dictionary<Type, Func<Control>>();
private readonly IDictionary<Type, Control> _cache = new Dictionary<Type, Control>();
public static void Register(Type type, Func<Control> create) => _factory[type] = create;
public CachedContentPresenter()
{
this.GetObservable(DataContextProperty).Subscribe((value) => Content = value);
}
protected override IControl CreateChild()
{
var content = Content;
if (content != null)
{
Type type = content.GetType();
Control control;
_cache.TryGetValue(type, out control);
if (control == null)
{
Func<Control> createInstance;
_factory.TryGetValue(type, out createInstance);
control = createInstance?.Invoke();
if (control != null)
{
_cache[type] = control;
}
else
{
throw new Exception($"Can not find factory method for type: {type}");
}
}
return control;
}
return base.CreateChild();
}
}
}
|
Use CreateChild to override child creation
|
Use CreateChild to override child creation
|
C#
|
mit
|
wieslawsoltes/Core2D,Core2D/Core2D,Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D
|
d4f5f7a16a7bc22356974712119699806ae5ede1
|
src/Glimpse.Web.Common/Framework/MasterRequestRuntime.cs
|
src/Glimpse.Web.Common/Framework/MasterRequestRuntime.cs
|
using System;
using System.Collections.Generic;
using Microsoft.Framework.DependencyInjection;
using System.Threading.Tasks;
namespace Glimpse.Web
{
public class MasterRequestRuntime
{
private readonly IDiscoverableCollection<IRequestRuntime> _requestRuntimes;
private readonly IDiscoverableCollection<IRequestHandler> _requestHandlers;
public MasterRequestRuntime(IServiceProvider serviceProvider)
{
_requestRuntimes = serviceProvider.GetService<IDiscoverableCollection<IRequestRuntime>>();
_requestRuntimes.Discover();
_requestHandlers = serviceProvider.GetService<IDiscoverableCollection<IRequestHandler>>();
_requestHandlers.Discover();
}
public async Task Begin(IHttpContext context)
{
foreach (var requestRuntime in _requestRuntimes)
{
await requestRuntime.Begin(context);
}
}
public bool TryGetHandle(IHttpContext context, out IRequestHandler handeler)
{
foreach (var requestHandler in _requestHandlers)
{
if (requestHandler.WillHandle(context))
{
handeler = requestHandler;
return true;
}
}
handeler = null;
return false;
}
public async Task End(IHttpContext context)
{
foreach (var requestRuntime in _requestRuntimes)
{
await requestRuntime.End(context);
}
}
}
}
|
using System;
using System.Collections.Generic;
using Microsoft.Framework.DependencyInjection;
using System.Threading.Tasks;
namespace Glimpse.Web
{
public class MasterRequestRuntime
{
private readonly IDiscoverableCollection<IRequestRuntime> _requestRuntimes;
private readonly IDiscoverableCollection<IRequestHandler> _requestHandlers;
public MasterRequestRuntime(IServiceProvider serviceProvider)
{
// TODO: Switch these over to being injected and doing the serviceProvider resolve in the middleware
_requestRuntimes = serviceProvider.GetService<IDiscoverableCollection<IRequestRuntime>>();
_requestRuntimes.Discover();
_requestHandlers = serviceProvider.GetService<IDiscoverableCollection<IRequestHandler>>();
_requestHandlers.Discover();
}
public async Task Begin(IHttpContext context)
{
foreach (var requestRuntime in _requestRuntimes)
{
await requestRuntime.Begin(context);
}
}
public bool TryGetHandle(IHttpContext context, out IRequestHandler handeler)
{
foreach (var requestHandler in _requestHandlers)
{
if (requestHandler.WillHandle(context))
{
handeler = requestHandler;
return true;
}
}
handeler = null;
return false;
}
public async Task End(IHttpContext context)
{
foreach (var requestRuntime in _requestRuntimes)
{
await requestRuntime.End(context);
}
}
}
}
|
Add todo about shifting where messages are to be resolved
|
Add todo about shifting where messages are to be resolved
|
C#
|
mit
|
Glimpse/Glimpse.Prototype,pranavkm/Glimpse.Prototype,pranavkm/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,pranavkm/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype
|
9958de9672c4d011a0f7ea2a3c53790df6d486e6
|
SimpleZipCode/Properties/AssemblyInfo.cs
|
SimpleZipCode/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("SimpleZipCode")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SimpleZipCode")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f5a869d6-0f69-4c26-bee2-917e3da08061")]
// 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.2")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SimpleZipCode")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyProduct("SimpleZipCode")]
[assembly: AssemblyCopyright("Copyright © 2017")]
// 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("f5a869d6-0f69-4c26-bee2-917e3da08061")]
// 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.*")]
|
Change version number to auto-increment
|
Change version number to auto-increment
|
C#
|
mit
|
alexmaris/simplezipcode
|
b9734c6ca4413eb45d2971783a51dc4c62e26d0d
|
src/SFA.DAS.Reservations.Api.Types/ReservationsHelper.cs
|
src/SFA.DAS.Reservations.Api.Types/ReservationsHelper.cs
|
using System;
using System.Threading.Tasks;
using SFA.DAS.Reservations.Api.Types.Configuration;
namespace SFA.DAS.Reservations.Api.Types
{
public class ReservationHelper : IReservationHelper
{
private readonly ReservationsClientApiConfiguration _config;
public ReservationHelper(ReservationsClientApiConfiguration config)
{
_config = config;
}
public Task<ReservationValidationResult> ValidateReservation(ValidationReservationMessage request, Func<string, object, Task<ReservationValidationResult>> call)
{
var effectiveApiBaseUrl = _config.EffectiveApiBaseUrl.TrimEnd(new[] {'/'});
var url = $"{effectiveApiBaseUrl}/api/reservations/validate/{request.ReservationId}?courseCode={request.CourseCode}&startDate={request.StartDate}";
var data = new
{
StartDate = request.StartDate.ToString("yyyy-MM-dd"),
request.CourseCode
};
return call(url, data);
}
}
}
|
using System;
using System.Threading.Tasks;
using SFA.DAS.Reservations.Api.Types.Configuration;
namespace SFA.DAS.Reservations.Api.Types
{
public class ReservationHelper : IReservationHelper
{
private readonly ReservationsClientApiConfiguration _config;
public ReservationHelper(ReservationsClientApiConfiguration config)
{
_config = config;
}
public Task<ReservationValidationResult> ValidateReservation(ValidationReservationMessage request, Func<string, object, Task<ReservationValidationResult>> call)
{
var effectiveApiBaseUrl = _config.EffectiveApiBaseUrl.TrimEnd(new[] {'/'});
var url = $"{effectiveApiBaseUrl}/api/reservations/validate/{request.ReservationId}";
var data = new
{
StartDate = request.StartDate.ToString("yyyy-MM-dd"),
request.CourseCode
};
return call(url, data);
}
}
}
|
Remove explicit parameters from the reservation query string
|
Remove explicit parameters from the reservation query string
|
C#
|
mit
|
SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments
|
d965fff4dee0f5219d99ae6ef35b243ec6976c8b
|
src/ComputeManagement/Properties/AssemblyInfo.cs
|
src/ComputeManagement/Properties/AssemblyInfo.cs
|
//
// Copyright (c) Microsoft. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using System.Reflection;
using System.Resources;
[assembly: AssemblyTitle("Windows Azure Compute Management Library")]
[assembly: AssemblyDescription("Provides management functionality for Windows Azure Virtual Machines and Hosted Services.")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.2.1.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Windows Azure .NET SDK")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
|
//
// Copyright (c) Microsoft. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using System.Reflection;
using System.Resources;
[assembly: AssemblyTitle("Windows Azure Compute Management Library")]
[assembly: AssemblyDescription("Provides management functionality for Windows Azure Virtual Machines and Hosted Services.")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.3.0.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Windows Azure .NET SDK")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
|
Change Assembly Version to 2.3.0.0
|
Change Assembly Version to 2.3.0.0
|
C#
|
apache-2.0
|
AuxMon/azure-sdk-for-net,juvchan/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,samtoubia/azure-sdk-for-net,pattipaka/azure-sdk-for-net,dasha91/azure-sdk-for-net,guiling/azure-sdk-for-net,naveedaz/azure-sdk-for-net,avijitgupta/azure-sdk-for-net,AzCiS/azure-sdk-for-net,atpham256/azure-sdk-for-net,jtlibing/azure-sdk-for-net,bgold09/azure-sdk-for-net,oaastest/azure-sdk-for-net,jamestao/azure-sdk-for-net,shuainie/azure-sdk-for-net,scottrille/azure-sdk-for-net,arijitt/azure-sdk-for-net,MabOneSdk/azure-sdk-for-net,vladca/azure-sdk-for-net,AzCiS/azure-sdk-for-net,pomortaz/azure-sdk-for-net,vivsriaus/azure-sdk-for-net,yitao-zhang/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,pinwang81/azure-sdk-for-net,DeepakRajendranMsft/azure-sdk-for-net,mumou/azure-sdk-for-net,oaastest/azure-sdk-for-net,shixiaoyu/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,akromm/azure-sdk-for-net,jamestao/azure-sdk-for-net,Nilambari/azure-sdk-for-net,tpeplow/azure-sdk-for-net,avijitgupta/azure-sdk-for-net,nemanja88/azure-sdk-for-net,alextolp/azure-sdk-for-net,mabsimms/azure-sdk-for-net,naveedaz/azure-sdk-for-net,namratab/azure-sdk-for-net,mumou/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,robertla/azure-sdk-for-net,djyou/azure-sdk-for-net,tpeplow/azure-sdk-for-net,shipram/azure-sdk-for-net,olydis/azure-sdk-for-net,dominiqa/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,stankovski/azure-sdk-for-net,xindzhan/azure-sdk-for-net,oburlacu/azure-sdk-for-net,namratab/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,djyou/azure-sdk-for-net,MabOneSdk/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,divyakgupta/azure-sdk-for-net,abhing/azure-sdk-for-net,amarzavery/azure-sdk-for-net,hyonholee/azure-sdk-for-net,herveyw/azure-sdk-for-net,rohmano/azure-sdk-for-net,nathannfan/azure-sdk-for-net,divyakgupta/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,makhdumi/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,travismc1/azure-sdk-for-net,peshen/azure-sdk-for-net,DeepakRajendranMsft/azure-sdk-for-net,samtoubia/azure-sdk-for-net,yitao-zhang/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,nacaspi/azure-sdk-for-net,hallihan/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,hovsepm/azure-sdk-for-net,vivsriaus/azure-sdk-for-net,alextolp/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,AuxMon/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,felixcho-msft/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,relmer/azure-sdk-for-net,makhdumi/azure-sdk-for-net,yadavbdev/azure-sdk-for-net,hovsepm/azure-sdk-for-net,mihymel/azure-sdk-for-net,bgold09/azure-sdk-for-net,msfcolombo/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,yoreddy/azure-sdk-for-net,yadavbdev/azure-sdk-for-net,kagamsft/azure-sdk-for-net,pattipaka/azure-sdk-for-net,Matt-Westphal/azure-sdk-for-net,r22016/azure-sdk-for-net,hallihan/azure-sdk-for-net,marcoippel/azure-sdk-for-net,stankovski/azure-sdk-for-net,pankajsn/azure-sdk-for-net,SpotLabsNET/azure-sdk-for-net,dasha91/azure-sdk-for-net,btasdoven/azure-sdk-for-net,akromm/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,samtoubia/azure-sdk-for-net,nathannfan/azure-sdk-for-net,rohmano/azure-sdk-for-net,nathannfan/azure-sdk-for-net,ailn/azure-sdk-for-net,xindzhan/azure-sdk-for-net,jasper-schneider/azure-sdk-for-net,jamestao/azure-sdk-for-net,zaevans/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AzCiS/azure-sdk-for-net,Matt-Westphal/azure-sdk-for-net,yadavbdev/azure-sdk-for-net,robertla/azure-sdk-for-net,herveyw/azure-sdk-for-net,enavro/azure-sdk-for-net,jtlibing/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,cwickham3/azure-sdk-for-net,hyonholee/azure-sdk-for-net,pinwang81/azure-sdk-for-net,pilor/azure-sdk-for-net,hyonholee/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,shuagarw/azure-sdk-for-net,juvchan/azure-sdk-for-net,atpham256/azure-sdk-for-net,guiling/azure-sdk-for-net,MabOneSdk/azure-sdk-for-net,dasha91/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,yitao-zhang/azure-sdk-for-net,amarzavery/azure-sdk-for-net,shuainie/azure-sdk-for-net,jtlibing/azure-sdk-for-net,bgold09/azure-sdk-for-net,SpotLabsNET/azure-sdk-for-net,Nilambari/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,scottrille/azure-sdk-for-net,divyakgupta/azure-sdk-for-net,ailn/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,shuagarw/azure-sdk-for-net,rohmano/azure-sdk-for-net,olydis/azure-sdk-for-net,dominiqa/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,btasdoven/azure-sdk-for-net,yoreddy/azure-sdk-for-net,avijitgupta/azure-sdk-for-net,mihymel/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,smithab/azure-sdk-for-net,naveedaz/azure-sdk-for-net,DeepakRajendranMsft/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,nemanja88/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,jamestao/azure-sdk-for-net,msfcolombo/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,pattipaka/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,hyonholee/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,jasper-schneider/azure-sdk-for-net,pilor/azure-sdk-for-net,SpotLabsNET/azure-sdk-for-net,oaastest/azure-sdk-for-net,gubookgu/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,oburlacu/azure-sdk-for-net,tonytang-microsoft-com/azure-sdk-for-net,vladca/azure-sdk-for-net,shutchings/azure-sdk-for-net,jasper-schneider/azure-sdk-for-net,makhdumi/azure-sdk-for-net,akromm/azure-sdk-for-net,robertla/azure-sdk-for-net,tonytang-microsoft-com/azure-sdk-for-net,djoelz/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,shutchings/azure-sdk-for-net,peshen/azure-sdk-for-net,r22016/azure-sdk-for-net,relmer/azure-sdk-for-net,mabsimms/azure-sdk-for-net,marcoippel/azure-sdk-for-net,cwickham3/azure-sdk-for-net,msfcolombo/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,dominiqa/azure-sdk-for-net,pomortaz/azure-sdk-for-net,shipram/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,Matt-Westphal/azure-sdk-for-net,r22016/azure-sdk-for-net,Nilambari/azure-sdk-for-net,pankajsn/azure-sdk-for-net,namratab/azure-sdk-for-net,ogail/azure-sdk-for-net,atpham256/azure-sdk-for-net,cwickham3/azure-sdk-for-net,felixcho-msft/azure-sdk-for-net,hyonholee/azure-sdk-for-net,guiling/azure-sdk-for-net,tonytang-microsoft-com/azure-sdk-for-net,markcowl/azure-sdk-for-net,vivsriaus/azure-sdk-for-net,mihymel/azure-sdk-for-net,ogail/azure-sdk-for-net,ailn/azure-sdk-for-net,jianghaolu/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,lygasch/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,enavro/azure-sdk-for-net,gubookgu/azure-sdk-for-net,yoreddy/azure-sdk-for-net,oburlacu/azure-sdk-for-net,kagamsft/azure-sdk-for-net,samtoubia/azure-sdk-for-net,amarzavery/azure-sdk-for-net,ogail/azure-sdk-for-net,felixcho-msft/azure-sdk-for-net,abhing/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,arijitt/azure-sdk-for-net,nacaspi/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,vladca/azure-sdk-for-net,scottrille/azure-sdk-for-net,juvchan/azure-sdk-for-net,pinwang81/azure-sdk-for-net,shuagarw/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,tpeplow/azure-sdk-for-net,marcoippel/azure-sdk-for-net,begoldsm/azure-sdk-for-net,smithab/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,lygasch/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,abhing/azure-sdk-for-net,vhamine/azure-sdk-for-net,gubookgu/azure-sdk-for-net,begoldsm/azure-sdk-for-net,vhamine/azure-sdk-for-net,nemanja88/azure-sdk-for-net,herveyw/azure-sdk-for-net,djoelz/azure-sdk-for-net,lygasch/azure-sdk-for-net,xindzhan/azure-sdk-for-net,AuxMon/azure-sdk-for-net,zaevans/azure-sdk-for-net,relmer/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,pilor/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,pomortaz/azure-sdk-for-net,enavro/azure-sdk-for-net,smithab/azure-sdk-for-net,hovsepm/azure-sdk-for-net,kagamsft/azure-sdk-for-net,zaevans/azure-sdk-for-net,shipram/azure-sdk-for-net,shutchings/azure-sdk-for-net,mabsimms/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,begoldsm/azure-sdk-for-net,djyou/azure-sdk-for-net,btasdoven/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,olydis/azure-sdk-for-net,pankajsn/azure-sdk-for-net,shixiaoyu/azure-sdk-for-net,alextolp/azure-sdk-for-net,peshen/azure-sdk-for-net
|
48120faeb2f669ab97e6fba4dc9e68f023d9d876
|
osu.Game/Online/Rooms/JoinRoomRequest.cs
|
osu.Game/Online/Rooms/JoinRoomRequest.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Net.Http;
using osu.Framework.IO.Network;
using osu.Game.Online.API;
namespace osu.Game.Online.Rooms
{
public class JoinRoomRequest : APIRequest
{
public readonly Room Room;
public readonly string Password;
public JoinRoomRequest(Room room, string password)
{
Room = room;
Password = password;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.Method = HttpMethod.Put;
req.AddParameter(@"password", Password, RequestParameterType.Query);
return req;
}
protected override string Target => $@"rooms/{Room.RoomID.Value}/users/{User.Id}";
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Net.Http;
using osu.Framework.IO.Network;
using osu.Game.Online.API;
namespace osu.Game.Online.Rooms
{
public class JoinRoomRequest : APIRequest
{
public readonly Room Room;
public readonly string Password;
public JoinRoomRequest(Room room, string password)
{
Room = room;
Password = password;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.Method = HttpMethod.Put;
if (!string.IsNullOrEmpty(Password))
req.AddParameter(@"password", Password, RequestParameterType.Query);
return req;
}
protected override string Target => $@"rooms/{Room.RoomID.Value}/users/{User.Id}";
}
}
|
Fix inability to join a multiplayer room which has no password
|
Fix inability to join a multiplayer room which has no password
|
C#
|
mit
|
NeoAdonis/osu,UselessToucan/osu,peppy/osu,smoogipooo/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu-new,UselessToucan/osu,peppy/osu,NeoAdonis/osu,smoogipoo/osu,ppy/osu,smoogipoo/osu,peppy/osu,UselessToucan/osu,ppy/osu
|
031607a3d96f3709a6d882085f8c15d6492b8ed5
|
Vidly/Controllers/CustomersController.cs
|
Vidly/Controllers/CustomersController.cs
|
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Vidly.Models;
namespace Vidly.Controllers
{
public class CustomersController : Controller
{
public ActionResult Index()
{
var customers = GetCustomers();
return View(customers);
}
//[Route("Customers/Details/{id}")]
public ActionResult Details(int id)
{
var customer = GetCustomers().SingleOrDefault(c => c.Id == id);
if (customer == null)
return HttpNotFound();
return View(customer);
}
private IEnumerable<Customer> GetCustomers()
{
return new List<Customer>
{
new Customer() {Id = 1, Name = "John Smith"},
new Customer() {Id = 2, Name = "Mary Williams"}
};
}
}
}
|
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Vidly.Models;
namespace Vidly.Controllers
{
public class CustomersController : Controller
{
private ApplicationDbContext _context;
public CustomersController()
{
_context = new ApplicationDbContext();
}
protected override void Dispose(bool disposing)
{
_context.Dispose();
}
public ActionResult Index()
{
var customers = _context.Customers.ToList();
return View(customers);
}
public ActionResult Details(int id)
{
var customer = _context.Customers.SingleOrDefault(c => c.Id == id);
if (customer == null)
return HttpNotFound();
return View(customer);
}
}
}
|
Load customers from the database.
|
Load customers from the database.
|
C#
|
mit
|
Dissolving-in-Eternity/Vidly,Dissolving-in-Eternity/Vidly,Dissolving-in-Eternity/Vidly
|
f7aab26175a5ac3c809e663ce5d25d335191543c
|
src/FastSerialization/_README.cs
|
src/FastSerialization/_README.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Welcome to the Utilities code base. This _README.cs file is your table of contents.
//
// You will notice that the code is littered with code: qualifiers. If you install the 'hyperAddin' for
// Visual Studio, these qualifiers turn into hyperlinks that allow easy cross references. The hyperAddin is
// available on http://www.codeplex.com/hyperAddin
//
// -------------------------------------------------------------------------------------
// Overview of files
//
// * file:GrowableArray.cs - holds a VERY LEAN implentation of a variable sized array (it is
// striped down, fast version of List<T>. There is never a reason to implement this logic by hand.
//
// * file:StreamUtilities.cs holds code:StreamUtilities which knows how to copy a stream.
//
// * file:FastSerialization.cs - holds defintions for code:FastSerialization.Serializer and
// code:FastSerialization.Deserializer which are general purpose, very fast and efficient ways of dumping
// an object graph to a stream (typically a file). It is used as a very convinient, versionable,
// efficient and extensible file format.
//
// * file:StreamReaderWriter.cs - holds concreate subclasses of
// code:FastSerialization.IStreamReader and code:FastSerialization.IStreamWriter, which allow you to
// write files a byte, chareter, int, or string at a time efficiently.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Welcome to the Utilities code base. This _README.cs file is your table of contents.
//
// You will notice that the code is littered with code: qualifiers. If you install the 'hyperAddin' for
// Visual Studio, these qualifiers turn into hyperlinks that allow easy cross references. The hyperAddin is
// available on http://www.codeplex.com/hyperAddin
//
// -------------------------------------------------------------------------------------
// Overview of files
//
// * file:GrowableArray.cs - holds a VERY LEAN implentation of a variable sized array (it is
// striped down, fast version of List<T>. There is never a reason to implement this logic by hand.
//
// * file:StreamUtilities.cs holds code:StreamUtilities which knows how to copy a stream.
//
// * file:FastSerialization.cs - holds defintions for code:FastSerialization.Serializer and
// code:FastSerialization.Deserializer which are general purpose, very fast and efficient ways of dumping
// an object graph to a stream (typically a file). It is used as a very convenient, versionable,
// efficient and extensible file format.
//
// * file:StreamReaderWriter.cs - holds concreate subclasses of
// code:FastSerialization.IStreamReader and code:FastSerialization.IStreamWriter, which allow you to
// write files a byte, chareter, int, or string at a time efficiently.
|
Update Readme for FastSerialization to fix a typo
|
Update Readme for FastSerialization to fix a typo
|
C#
|
mit
|
vancem/perfview,vancem/perfview,vancem/perfview,vancem/perfview,vancem/perfview
|
9667934ed9d0a7a44f55af4c7515fdb0df3bded8
|
osu.Game/Beatmaps/Formats/LegacyDifficultyCalculatorBeatmapDecoder.cs
|
osu.Game/Beatmaps/Formats/LegacyDifficultyCalculatorBeatmapDecoder.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using osu.Game.Beatmaps.ControlPoints;
namespace osu.Game.Beatmaps.Formats
{
/// <summary>
/// A <see cref="LegacyBeatmapDecoder"/> built for difficulty calculation of legacy <see cref="Beatmap"/>s
/// <remarks>
/// To use this, the decoder must be registered by the application through <see cref="LegacyDifficultyCalculatorBeatmapDecoder.Register"/>.
/// Doing so will override any existing <see cref="Beatmap"/> decoders.
/// </remarks>
/// </summary>
public class LegacyDifficultyCalculatorBeatmapDecoder : LegacyBeatmapDecoder
{
public LegacyDifficultyCalculatorBeatmapDecoder(int version = LATEST_VERSION)
: base(version)
{
ApplyOffsets = false;
}
public new static void Register()
{
AddDecoder<Beatmap>(@"osu file format v", m => new LegacyDifficultyCalculatorBeatmapDecoder(int.Parse(m.Split('v').Last())));
SetFallbackDecoder<Beatmap>(() => new LegacyDifficultyCalculatorBeatmapDecoder());
}
protected override TimingControlPoint CreateTimingControlPoint()
=> new LegacyDifficultyCalculatorTimingControlPoint();
private class LegacyDifficultyCalculatorTimingControlPoint : TimingControlPoint
{
public LegacyDifficultyCalculatorTimingControlPoint()
{
BeatLengthBindable.MinValue = double.MinValue;
BeatLengthBindable.MaxValue = double.MaxValue;
}
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using osu.Game.Beatmaps.ControlPoints;
namespace osu.Game.Beatmaps.Formats
{
/// <summary>
/// A <see cref="LegacyBeatmapDecoder"/> built for difficulty calculation of legacy <see cref="Beatmap"/>s
/// <remarks>
/// To use this, the decoder must be registered by the application through <see cref="LegacyDifficultyCalculatorBeatmapDecoder.Register"/>.
/// Doing so will override any existing <see cref="Beatmap"/> decoders.
/// </remarks>
/// </summary>
public class LegacyDifficultyCalculatorBeatmapDecoder : LegacyBeatmapDecoder
{
public LegacyDifficultyCalculatorBeatmapDecoder(int version = LATEST_VERSION)
: base(version)
{
ApplyOffsets = false;
}
public new static void Register()
{
AddDecoder<Beatmap>(@"osu file format v", m => new LegacyDifficultyCalculatorBeatmapDecoder(int.Parse(m.Split('v').Last())));
SetFallbackDecoder<Beatmap>(() => new LegacyDifficultyCalculatorBeatmapDecoder());
}
}
}
|
Remove unlimited timing points in difficulty calculation
|
Remove unlimited timing points in difficulty calculation
|
C#
|
mit
|
NeoAdonis/osu,smoogipoo/osu,smoogipooo/osu,ppy/osu,ppy/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu-new,smoogipoo/osu,smoogipoo/osu,peppy/osu,UselessToucan/osu,UselessToucan/osu,peppy/osu,peppy/osu,ppy/osu,EVAST9919/osu,EVAST9919/osu,NeoAdonis/osu
|
bc20a8d5117692760098adabcfd46176e06b8902
|
CorePlugin/ScriptExecutor.cs
|
CorePlugin/ScriptExecutor.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using Duality;
using PythonScripting.Resources;
using IronPython.Hosting;
using Microsoft.Scripting.Hosting;
using IronPython.Compiler;
namespace PythonScripting
{
public class ScriptExecutor : Component, ICmpInitializable
{
public ContentRef<PythonScript> Script { get; set; }
public void OnInit(InitContext context)
{
if (context == InitContext.Activate)
{
}
}
public void OnShutdown(ShutdownContext context)
{
if (context == ShutdownContext.Deactivate)
{
GameObj.DisposeLater();
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using Duality;
using PythonScripting.Resources;
using IronPython.Hosting;
using IronPython.Runtime;
using IronPython.Compiler;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
namespace PythonScripting
{
public class ScriptExecutor : Component, ICmpInitializable, ICmpUpdatable
{
public ContentRef<PythonScript> Script { get; set; }
public void OnInit(InitContext context)
{
if (context == InitContext.Activate)
{
}
}
public void OnUpdate()
{
}
public void OnShutdown(ShutdownContext context)
{
if (context == ShutdownContext.Deactivate)
{
GameObj.DisposeLater();
}
}
}
}
|
Add placeholder support for OnUpdate
|
Add placeholder support for OnUpdate
|
C#
|
mit
|
RockyTV/Duality.IronPython
|
3cd70d6acd922e6a99046e4b17532d806756b7bd
|
Assets/Scripts/Player/PlayerMovement.cs
|
Assets/Scripts/Player/PlayerMovement.cs
|
using UnityEngine;
using System.Collections;
public class PlayerMovement : MonoBehaviour
{
public float speed = 6f;
Vector3 movement;
Rigidbody rb;
float cameraRayLength = 100;
int floorMask;
void Awake()
{
floorMask = LayerMask.GetMask ("Floor");
rb = GetComponent<Rigidbody> ();
}
void FixedUpdate()
{
float moveHorizontal = Input.GetAxisRaw ("Horizontal");
float moveVertical = Input.GetAxisRaw ("Vertical");
Move (moveHorizontal, moveVertical);
Turning ();
}
void Move(float horizontal, float vertical)
{
movement.Set (horizontal, 0f, vertical);
movement = movement * speed * Time.deltaTime;
rb.MovePosition (transform.position + movement);
}
void Turning()
{
Ray cameraRay = Camera.main.ScreenPointToRay (Input.mousePosition);
RaycastHit floorHit;
if (Physics.Raycast (cameraRay, out floorHit, cameraRayLength, floorMask)) {
Vector3 playerToMouse = floorHit.point - transform.position;
playerToMouse.y = 0f;
Quaternion newRotation = Quaternion.LookRotation (playerToMouse);
rb.MoveRotation (newRotation);
}
}
}
|
using UnityEngine;
using System.Collections;
public class PlayerMovement : MonoBehaviour
{
public float speed = 6f;
public float jumpSpeed = 8.0F;
public float gravity = 20.0F;
private Vector3 moveDirection = Vector3.zero;
private CharacterController cc;
private float cameraRayLength = 100;
private int floorMask;
void Awake()
{
floorMask = LayerMask.GetMask ("Floor");
cc = GetComponent<CharacterController> ();
}
void FixedUpdate()
{
float moveHorizontal = Input.GetAxisRaw ("Horizontal");
float moveVertical = Input.GetAxisRaw ("Vertical");
Move (moveHorizontal, moveVertical);
Turning ();
}
void Move(float horizontal, float vertical)
{
if (cc.isGrounded) {
moveDirection = new Vector3(horizontal, 0, vertical);
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= speed;
if (Input.GetButton ("Jump")) {
moveDirection.y = jumpSpeed;
}
}
moveDirection.y -= gravity * Time.deltaTime;
cc.Move(moveDirection * Time.deltaTime);
}
void Turning()
{
Ray cameraRay = Camera.main.ScreenPointToRay (Input.mousePosition);
RaycastHit floorHit;
if (Physics.Raycast (cameraRay, out floorHit, cameraRayLength, floorMask)) {
Vector3 playerToMouse = floorHit.point - transform.position;
playerToMouse.y = 0f;
Quaternion newRotation = Quaternion.LookRotation (playerToMouse);
transform.rotation = newRotation;
}
}
}
|
Change movement, player folow mouse
|
Change movement, player folow mouse
|
C#
|
mit
|
d0niek/PGK-2016,d0niek/PGK-2016
|
d26f1497a00182110e8548329e2d2778762c1467
|
LegoSharpTest/ReadmeTests.cs
|
LegoSharpTest/ReadmeTests.cs
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using LegoSharp;
using System.Linq;
using System.Reflection;
using System.IO.MemoryMappedFiles;
namespace LegoSharpTest
{
[TestClass]
public class ReadmeTests
{
[TestMethod]
public async Task PickABrickExample()
{
LegoGraphClient graphClient = new LegoGraphClient();
await graphClient.authenticateAsync();
PickABrickQuery query = new PickABrickQuery();
query.addFilter(new BrickColorFilter()
.addValue(BrickColor.Black)
);
query.query = "wheel";
PickABrickQueryResult result = await graphClient.pickABrick(query);
foreach (Brick brick in result.elements)
{
// do something with each brick
}
}
[TestMethod]
public async Task ProductSearchExample()
{
LegoGraphClient graphClient = new LegoGraphClient();
await graphClient.authenticateAsync();
ProductSearchQuery query = new ProductSearchQuery();
query.addFilter(new ProductCategoryFilter()
.addValue(ProductCategory.Sets)
);
query.query = "train";
await graphClient.productSearch(query);
}
}
}
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using LegoSharp;
using System.Linq;
using System.Reflection;
using System.IO.MemoryMappedFiles;
namespace LegoSharpTest
{
[TestClass]
public class ReadmeTests
{
[TestMethod]
public async Task pickABrickExample()
{
LegoGraphClient graphClient = new LegoGraphClient();
await graphClient.authenticateAsync();
PickABrickQuery query = new PickABrickQuery();
query.addFilter(new BrickColorFilter()
.addValue(BrickColor.Black)
);
query.query = "wheel";
PickABrickQueryResult result = await graphClient.pickABrick(query);
foreach (Brick brick in result.elements)
{
// do something with each brick
}
}
[TestMethod]
public async Task productSearchExample()
{
LegoGraphClient graphClient = new LegoGraphClient();
await graphClient.authenticateAsync();
ProductSearchQuery query = new ProductSearchQuery();
query.addFilter(new ProductCategoryFilter()
.addValue(ProductCategory.Sets)
);
query.query = "train";
await graphClient.productSearch(query);
}
}
}
|
Fix bad casing for readme tests
|
Fix bad casing for readme tests
|
C#
|
mit
|
rolledback/LegoSharp
|
515a1c31185b340aea5665d438f4d64608a2f1d1
|
Terraria_Server/Messages/SummonSkeletronMessage.cs
|
Terraria_Server/Messages/SummonSkeletronMessage.cs
|
using System;
namespace Terraria_Server.Messages
{
public class SummonSkeletronMessage : IMessage
{
public Packet GetPacket()
{
return Packet.SUMMON_SKELETRON;
}
public void Process(int start, int length, int num, int whoAmI, byte[] readBuffer, byte bufferData)
{
byte action = readBuffer[num];
if (action == 1)
{
NPC.SpawnSkeletron();
}
else if (action == 2)
{
NetMessage.SendData (51, -1, whoAmI, "", action, (float)readBuffer[num + 1], 0f, 0f, 0);
}
}
}
}
|
using System;
namespace Terraria_Server.Messages
{
public class SummonSkeletronMessage : IMessage
{
public Packet GetPacket()
{
return Packet.SUMMON_SKELETRON;
}
public void Process(int start, int length, int num, int whoAmI, byte[] readBuffer, byte bufferData)
{
int player = readBuffer[num++]; //TODO: maybe check for forgery
byte action = readBuffer[num];
if (action == 1)
{
NPC.SpawnSkeletron();
}
else if (action == 2)
{
NetMessage.SendData (51, -1, whoAmI, "", player, action, 0f, 0f, 0);
}
}
}
}
|
Fix Skeletron summoning message decoding.
|
Fix Skeletron summoning message decoding.
|
C#
|
mit
|
DeathCradle/Terraria-s-Dedicated-Server-Mod,DeathCradle/Terraria-s-Dedicated-Server-Mod,DeathCradle/Terraria-s-Dedicated-Server-Mod,DeathCradle/Terraria-s-Dedicated-Server-Mod
|
a1b7bf3986666e7ec07a226988386a3b84b75507
|
osu.Game.Rulesets.Osu/Skinning/Default/KiaiFlash.cs
|
osu.Game.Rulesets.Osu/Skinning/Default/KiaiFlash.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Containers;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public class KiaiFlash : BeatSyncedContainer
{
private const double fade_length = 80;
private const float flash_opacity = 0.25f;
public KiaiFlash()
{
EarlyActivationMilliseconds = 80;
Blending = BlendingParameters.Additive;
Child = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White,
Alpha = 0f,
};
}
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
{
if (!effectPoint.KiaiMode)
return;
Child
.FadeTo(flash_opacity, EarlyActivationMilliseconds, Easing.OutQuint)
.Then()
.FadeOut(Math.Max(0, timingPoint.BeatLength - fade_length), Easing.OutSine);
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Containers;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public class KiaiFlash : BeatSyncedContainer
{
private const double fade_length = 80;
private const float flash_opacity = 0.25f;
public KiaiFlash()
{
EarlyActivationMilliseconds = 80;
Blending = BlendingParameters.Additive;
Child = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White,
Alpha = 0f,
};
}
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
{
if (!effectPoint.KiaiMode)
return;
Child
.FadeTo(flash_opacity, EarlyActivationMilliseconds, Easing.OutQuint)
.Then()
.FadeOut(Math.Max(fade_length, timingPoint.BeatLength - fade_length), Easing.OutSine);
}
}
}
|
Use a minimum fade length for clamping rather than zero
|
Use a minimum fade length for clamping rather than zero
Co-authored-by: Bartłomiej Dach <809709723693c4e7ecc6f5379a3099c830279741@gmail.com>
|
C#
|
mit
|
NeoAdonis/osu,ppy/osu,ppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu,NeoAdonis/osu,peppy/osu,peppy/osu
|
3efe2ab49bedb402b73a173fffd2900cad631d5c
|
DesktopWidgets/Actions/ActionBase.cs
|
DesktopWidgets/Actions/ActionBase.cs
|
using System;
using System.ComponentModel;
using System.Windows;
using DesktopWidgets.Classes;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
namespace DesktopWidgets.Actions
{
public abstract class ActionBase
{
[PropertyOrder(0)]
[DisplayName("Delay")]
public TimeSpan Delay { get; set; } = TimeSpan.FromSeconds(0);
[PropertyOrder(1)]
[DisplayName("Show Errors")]
public bool ShowErrors { get; set; } = false;
public void Execute()
{
DelayedAction.RunAction((int) Delay.TotalMilliseconds, () =>
{
try
{
ExecuteAction();
}
catch (Exception ex)
{
if (ShowErrors)
Popup.ShowAsync($"{GetType().Name} failed to execute.\n\n{ex.Message}",
image: MessageBoxImage.Error);
}
});
}
protected virtual void ExecuteAction()
{
}
}
}
|
using System;
using System.ComponentModel;
using System.Windows;
using DesktopWidgets.Classes;
using DesktopWidgets.Helpers;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
namespace DesktopWidgets.Actions
{
public abstract class ActionBase
{
[PropertyOrder(0)]
[DisplayName("Delay")]
public TimeSpan Delay { get; set; } = TimeSpan.FromSeconds(0);
[PropertyOrder(1)]
[DisplayName("Works If Foreground Is Fullscreen")]
public bool WorksIfForegroundIsFullscreen { get; set; }
[PropertyOrder(2)]
[DisplayName("Works If Muted")]
public bool WorksIfMuted { get; set; }
[PropertyOrder(3)]
[DisplayName("Show Errors")]
public bool ShowErrors { get; set; } = false;
public void Execute()
{
if (!WorksIfMuted && App.IsMuted ||
(!WorksIfForegroundIsFullscreen && FullScreenHelper.DoesAnyMonitorHaveFullscreenApp()))
return;
DelayedAction.RunAction((int) Delay.TotalMilliseconds, () =>
{
try
{
ExecuteAction();
}
catch (Exception ex)
{
if (ShowErrors)
Popup.ShowAsync($"{GetType().Name} failed to execute.\n\n{ex.Message}",
image: MessageBoxImage.Error);
}
});
}
protected virtual void ExecuteAction()
{
}
}
}
|
Add action "Works If Muted", "Works If Foreground Is Fullscreen" options
|
Add action "Works If Muted", "Works If Foreground Is Fullscreen" options
|
C#
|
apache-2.0
|
danielchalmers/DesktopWidgets
|
295b8019af96c056904c1e8912d79513ae024e74
|
src/AppShell.Mobile/Views/ShellView.xaml.cs
|
src/AppShell.Mobile/Views/ShellView.xaml.cs
|
using Xamarin.Forms;
namespace AppShell.Mobile.Views
{
[ContentProperty("ShellContent")]
public partial class ShellView : ContentView
{
public static readonly BindableProperty ShellContentProperty = BindableProperty.Create<ShellView, View>(d => d.ShellContent, null, propertyChanged: ShellContentPropertyChanged);
public static readonly BindableProperty HasNavigationBarProperty = BindableProperty.Create<ShellView, bool>(x => x.HasNavigationBar, true, propertyChanged: OnHasNavigationBarChanged);
public View ShellContent { get { return (View)GetValue(ShellContentProperty); } set { SetValue(ShellContentProperty, value); } }
public bool HasNavigationBar { get { return (bool)GetValue(HasNavigationBarProperty); } set { SetValue(HasNavigationBarProperty, value); } }
public static void ShellContentPropertyChanged(BindableObject d, View oldValue, View newValue)
{
ShellView shellView = d as ShellView;
shellView.ShellContent = newValue;
}
private static void OnHasNavigationBarChanged(BindableObject d, bool oldValue, bool newValue)
{
ShellView shellView = d as ShellView;
NavigationPage.SetHasNavigationBar(shellView, newValue);
if (!newValue)
shellView.Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0);
}
public ShellView()
{
InitializeComponent();
SetBinding(HasNavigationBarProperty, new Binding("HasNavigationBar"));
}
}
}
|
using Xamarin.Forms;
namespace AppShell.Mobile.Views
{
[ContentProperty("ShellContent")]
public partial class ShellView : ContentView
{
public static readonly BindableProperty ShellContentProperty = BindableProperty.Create<ShellView, View>(d => d.ShellContent, null, propertyChanged: ShellContentPropertyChanged);
public static readonly BindableProperty HasNavigationBarProperty = BindableProperty.Create<ShellView, bool>(x => x.HasNavigationBar, true, propertyChanged: OnHasNavigationBarChanged);
public View ShellContent { get { return (View)GetValue(ShellContentProperty); } set { SetValue(ShellContentProperty, value); } }
public bool HasNavigationBar { get { return (bool)GetValue(HasNavigationBarProperty); } set { SetValue(HasNavigationBarProperty, value); } }
public static void ShellContentPropertyChanged(BindableObject d, View oldValue, View newValue)
{
ShellView shellView = d as ShellView;
shellView.ShellContentView.Content = newValue;
}
private static void OnHasNavigationBarChanged(BindableObject d, bool oldValue, bool newValue)
{
ShellView shellView = d as ShellView;
NavigationPage.SetHasNavigationBar(shellView, newValue);
if (!newValue)
shellView.Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0);
}
public ShellView()
{
InitializeComponent();
SetBinding(HasNavigationBarProperty, new Binding("HasNavigationBar"));
}
}
}
|
Revert "Fixed compile error in shell view"
|
Revert "Fixed compile error in shell view"
This reverts commit 87b52b03724b961dc2050ae8c37175ee660037e0.
|
C#
|
mit
|
cschwarz/AppShell,cschwarz/AppShell
|
804cbe5aae2d0796331435a691258e077851317b
|
Training/DataGenerator/OszArchive.cs
|
Training/DataGenerator/OszArchive.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
namespace Meowtrix.osuAMT.Training.DataGenerator
{
class OszArchive : Archive, IDisposable
{
public ZipArchive archive;
private FileInfo fileinfo;
public OszArchive(FileInfo file)
{
fileinfo = file;
string name = file.Name;
Name = name.EndsWith(".osz") ? name.Substring(0, name.Length - 4) : name;
}
public override string Name { get; }
public void Dispose() => archive.Dispose();
private void EnsureArchiveOpened()
{
if (archive == null)
archive = new ZipArchive(fileinfo.OpenRead(), ZipArchiveMode.Read, false);
}
public override Stream OpenFile(string filename)
{
EnsureArchiveOpened();
return archive.GetEntry(filename).Open();
}
public override IEnumerable<Stream> OpenOsuFiles()
{
EnsureArchiveOpened();
return archive.Entries.Where(x => x.Name.EndsWith(".osu")).Select(e => e.Open());
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
namespace Meowtrix.osuAMT.Training.DataGenerator
{
class OszArchive : Archive, IDisposable
{
public ZipArchive archive;
private FileInfo fileinfo;
public OszArchive(FileInfo file)
{
fileinfo = file;
string name = file.Name;
Name = name.EndsWith(".osz") ? name.Substring(0, name.Length - 4) : name;
}
public override string Name { get; }
public void Dispose() => archive.Dispose();
private void EnsureArchiveOpened()
{
if (archive == null)
archive = new ZipArchive(fileinfo.OpenRead(), ZipArchiveMode.Read, false);
}
public override Stream OpenFile(string filename)
{
EnsureArchiveOpened();
var temp = new MemoryStream();
using (var deflate = archive.GetEntry(filename).Open())
{
deflate.CopyTo(temp);
temp.Seek(0, SeekOrigin.Begin);
return temp;
}
}
public override IEnumerable<Stream> OpenOsuFiles()
{
EnsureArchiveOpened();
return archive.Entries.Where(x => x.Name.EndsWith(".osu")).Select(e => e.Open());
}
}
}
|
Copy deflate stream to temporary memory stream.
|
Copy deflate stream to temporary memory stream.
|
C#
|
mit
|
Meowtrix/osu-Auto-Mapping-Toolkit
|
2f4634dcf6806e04d5a041b2f6c367f4801b992d
|
uSync8.BackOffice/Controllers/Trees/uSyncTreeController.cs
|
uSync8.BackOffice/Controllers/Trees/uSyncTreeController.cs
|
using System.Net.Http.Formatting;
using System.Web.Http.ModelBinding;
using Umbraco.Core;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi.Filters;
namespace uSync8.BackOffice.Controllers.Trees
{
[Tree(Constants.Applications.Settings, uSync.Trees.uSync,
TreeGroup = uSync.Trees.Group,
TreeTitle = uSync.Name, SortOrder = 35)]
[PluginController(uSync.Name)]
public class uSyncTreeController : TreeController
{
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
{
var root = base.CreateRootNode(queryStrings);
root.RoutePath = $"{Constants.Applications.Settings}/{uSync.Trees.uSync}/dashboard";
root.Icon = "icon-infinity";
root.HasChildren = false;
root.MenuUrl = null;
return root;
}
protected override MenuItemCollection GetMenuForNode(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))] FormDataCollection queryStrings)
{
return null;
}
protected override TreeNodeCollection GetTreeNodes(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))] FormDataCollection queryStrings)
{
return new TreeNodeCollection();
}
}
}
|
using System.Net.Http.Formatting;
using System.Web.Http.ModelBinding;
using Umbraco.Core;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi.Filters;
namespace uSync8.BackOffice.Controllers.Trees
{
[Tree(Constants.Applications.Settings, uSync.Trees.uSync,
TreeGroup = uSync.Trees.Group,
TreeTitle = uSync.Name, SortOrder = 35)]
[PluginController(uSync.Name)]
public class uSyncTreeController : TreeController
{
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
{
var root = base.CreateRootNode(queryStrings);
root.RoutePath = $"{this.SectionAlias}/{uSync.Trees.uSync}/dashboard";
root.Icon = "icon-infinity";
root.HasChildren = false;
root.MenuUrl = null;
return root;
}
protected override MenuItemCollection GetMenuForNode(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))] FormDataCollection queryStrings)
{
return null;
}
protected override TreeNodeCollection GetTreeNodes(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))] FormDataCollection queryStrings)
{
return new TreeNodeCollection();
}
}
}
|
Remove reference to settings section in routePath (so we can move the tree in theory)
|
Remove reference to settings section in routePath (so we can move the tree in theory)
|
C#
|
mpl-2.0
|
KevinJump/uSync,KevinJump/uSync,KevinJump/uSync
|
eec9c2151a21744dff37670d28f8dd43cef8a73f
|
rethinkdb-net-newtonsoft/Configuration/NewtonSerializer.cs
|
rethinkdb-net-newtonsoft/Configuration/NewtonSerializer.cs
|
using RethinkDb.DatumConverters;
namespace RethinkDb.Newtonsoft.Configuration
{
public class NewtonSerializer : AggregateDatumConverterFactory
{
public NewtonSerializer() : base(
PrimitiveDatumConverterFactory.Instance,
TupleDatumConverterFactory.Instance,
AnonymousTypeDatumConverterFactory.Instance,
BoundEnumDatumConverterFactory.Instance,
NullableDatumConverterFactory.Instance,
NewtonsoftDatumConverterFactory.Instance
)
{
}
}
}
|
using RethinkDb.DatumConverters;
namespace RethinkDb.Newtonsoft.Configuration
{
public class NewtonSerializer : AggregateDatumConverterFactory
{
public NewtonSerializer() : base(
PrimitiveDatumConverterFactory.Instance,
TupleDatumConverterFactory.Instance,
AnonymousTypeDatumConverterFactory.Instance,
BoundEnumDatumConverterFactory.Instance,
NullableDatumConverterFactory.Instance,
NamedValueDictionaryDatumConverterFactory.Instance,
NewtonsoftDatumConverterFactory.Instance
)
{
}
}
}
|
Add NamedValueDictionaryDatumConverterFactory to newtonsoft converter
|
Add NamedValueDictionaryDatumConverterFactory to newtonsoft converter
Allows access to the .Keys colllection of a Dictionary<string,object>,
in an expression.
|
C#
|
apache-2.0
|
Ernesto99/rethinkdb-net,nkreipke/rethinkdb-net,kangkot/rethinkdb-net,bbqchickenrobot/rethinkdb-net,bbqchickenrobot/rethinkdb-net,Ernesto99/rethinkdb-net,LukeForder/rethinkdb-net,LukeForder/rethinkdb-net,kangkot/rethinkdb-net,nkreipke/rethinkdb-net
|
bdf644790572fc8b72d08ffa6b4f5285c0645a6e
|
src/ExRam.Gremlinq.Core/Extensions/EnumerableExtensions.cs
|
src/ExRam.Gremlinq.Core/Extensions/EnumerableExtensions.cs
|
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using ExRam.Gremlinq.Core.Projections;
using ExRam.Gremlinq.Core.Steps;
namespace ExRam.Gremlinq.Core
{
public static class EnumerableExtensions
{
public static Traversal ToTraversal(this IEnumerable<Step> steps) => new(
steps is Step[] array
? (Step[])array.Clone()
: steps.ToArray(),
Projection.Empty);
internal static bool InternalAny(this IEnumerable enumerable)
{
var enumerator = enumerable.GetEnumerator();
return enumerator.MoveNext();
}
internal static IAsyncEnumerable<TElement> ToNonNullAsyncEnumerable<TElement>(this IEnumerable enumerable)
{
return AsyncEnumerable.Create(Core);
async IAsyncEnumerator<TElement> Core(CancellationToken ct)
{
foreach (TElement element in enumerable)
{
ct.ThrowIfCancellationRequested();
if (element is not null)
yield return element;
}
}
}
}
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using ExRam.Gremlinq.Core.Projections;
using ExRam.Gremlinq.Core.Steps;
namespace ExRam.Gremlinq.Core
{
public static class EnumerableExtensions
{
public static Traversal ToTraversal(this IEnumerable<Step> steps) => new(
steps is Step[] array
? (Step[])array.Clone()
: steps.ToArray(),
Projection.Empty);
internal static bool InternalAny(this IEnumerable enumerable)
{
if (enumerable is ICollection collection)
return collection.Count > 0;
var enumerator = enumerable.GetEnumerator();
try
{
return enumerator.MoveNext();
}
finally
{
if (enumerator is IDisposable disposable)
disposable.Dispose();
}
}
internal static IAsyncEnumerable<TElement> ToNonNullAsyncEnumerable<TElement>(this IEnumerable enumerable)
{
return AsyncEnumerable.Create(Core);
async IAsyncEnumerator<TElement> Core(CancellationToken ct)
{
foreach (TElement element in enumerable)
{
ct.ThrowIfCancellationRequested();
if (element is not null)
yield return element;
}
}
}
}
}
|
Rework InternalAny to take IDisposables into account and short-cut on ICollections.
|
Rework InternalAny to take IDisposables into account and short-cut on ICollections.
|
C#
|
mit
|
ExRam/ExRam.Gremlinq
|
21a782732e23b95c280a575b57b14a61edb4c994
|
Assets/Scripts/HarryPotterUnity/Utils/GameManager.cs
|
Assets/Scripts/HarryPotterUnity/Utils/GameManager.cs
|
using System.Collections.Generic;
using HarryPotterUnity.Cards.Generic;
using HarryPotterUnity.Tween;
using UnityEngine;
namespace HarryPotterUnity.Utils
{
public static class GameManager {
public const int PreviewLayer = 9;
public const int CardLayer = 10;
public const int ValidChoiceLayer = 11;
public const int IgnoreRaycastLayer = 2;
public const int DeckLayer = 12;
public static byte NetworkIdCounter;
public static readonly List<GenericCard> AllCards = new List<GenericCard>();
public static Camera PreviewCamera;
public static readonly TweenQueue TweenQueue = new TweenQueue();
public static void DisableCards(List<GenericCard> cards)
{
cards.ForEach(card => card.Disable());
}
public static void EnableCards(List<GenericCard> cards)
{
cards.ForEach(card => card.Enable());
}
}
}
|
using System.Collections.Generic;
using HarryPotterUnity.Cards.Generic;
using HarryPotterUnity.Tween;
using UnityEngine;
namespace HarryPotterUnity.Utils
{
public static class GameManager {
public const int PREVIEW_LAYER = 9;
public const int CARD_LAYER = 10;
public const int VALID_CHOICE_LAYER = 11;
public const int IGNORE_RAYCAST_LAYER = 2;
public const int DECK_LAYER = 12;
public static byte _networkIdCounter;
public static readonly List<GenericCard> AllCards = new List<GenericCard>();
public static Camera _previewCamera;
public static readonly TweenQueue TweenQueue = new TweenQueue();
public static void DisableCards(List<GenericCard> cards)
{
cards.ForEach(card => card.Disable());
}
public static void EnableCards(List<GenericCard> cards)
{
cards.ForEach(card => card.Enable());
}
}
}
|
Rename some variables for consistency
|
Rename some variables for consistency
|
C#
|
mit
|
StefanoFiumara/Harry-Potter-Unity
|
1d09c204192d58fda1cbc0a37f4972c9c0f2ab19
|
table.cs
|
table.cs
|
using System;
namespace Table {
public class Table {
public int Width;
public int Spacing;
public Table(int width, int spacing) {
Width = width;
Spacing = spacing;
}
}
}
|
using System;
namespace Hangman {
public class Table {
public int Width;
public int Spacing;
public Table(int width, int spacing) {
Width = width;
Spacing = spacing;
}
}
}
|
Make the namespace uniform accross the project
|
Make the namespace uniform accross the project
|
C#
|
unlicense
|
12joan/hangman
|
f69e1e96091fdafb1b75602723fcbcc4aa77e3e9
|
src/QtBindings/Libs.cs
|
src/QtBindings/Libs.cs
|
using System;
using Mono.VisualC.Interop;
using Mono.VisualC.Interop.ABI;
namespace Qt {
// Will be internal; public for testing
public static class Libs {
public static CppLibrary QtCore = null;
public static CppLibrary QtGui = null;
static Libs ()
{
string lib;
CppAbi abi;
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{ // for Windows...
lib = "{0}d4.dll";
abi = new MsvcAbi ();
} else { // for Mac...
lib = "/Library/Frameworks/{0}.framework/Versions/Current/{0}";
abi = new ItaniumAbi ();
}
QtCore = new CppLibrary (string.Format(lib, "QtCore"), abi);
QtGui = new CppLibrary (string.Format(lib, "QtGui"), abi);
}
}
}
|
using System;
using Mono.VisualC.Interop;
using Mono.VisualC.Interop.ABI;
namespace Qt {
// Will be internal; public for testing
public static class Libs {
public static CppLibrary QtCore = null;
public static CppLibrary QtGui = null;
static Libs ()
{
string lib;
CppAbi abi;
if (Environment.OSVersion.Platform == PlatformID.Unix) {
lib = "{0}.so";
abi = new ItaniumAbi ();
} else if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{ // for Windows...
lib = "{0}d4.dll";
abi = new MsvcAbi ();
} else { // for Mac...
lib = "/Library/Frameworks/{0}.framework/Versions/Current/{0}";
abi = new ItaniumAbi ();
}
QtCore = new CppLibrary (string.Format(lib, "QtCore"), abi);
QtGui = new CppLibrary (string.Format(lib, "QtGui"), abi);
}
}
}
|
Use proper library/abi for qt on linux.
|
Use proper library/abi for qt on linux.
|
C#
|
mit
|
txdv/CppSharp,ddobrev/CppSharp,mydogisbox/CppSharp,KonajuGames/CppSharp,genuinelucifer/CppSharp,mydogisbox/CppSharp,imazen/CppSharp,imazen/CppSharp,zillemarco/CppSharp,Samana/CppSharp,u255436/CppSharp,xistoso/CppSharp,mono/CppSharp,inordertotest/CppSharp,mydogisbox/CppSharp,zillemarco/CppSharp,corngood/cxxi,Samana/CppSharp,ktopouzi/CppSharp,xistoso/CppSharp,corngood/cxxi,mono/cxxi,u255436/CppSharp,Samana/CppSharp,genuinelucifer/CppSharp,SonyaSa/CppSharp,mohtamohit/CppSharp,u255436/CppSharp,mohtamohit/CppSharp,ktopouzi/CppSharp,KonajuGames/CppSharp,inordertotest/CppSharp,txdv/CppSharp,mohtamohit/CppSharp,Samana/CppSharp,mono/CppSharp,shana/cppinterop,ddobrev/CppSharp,nalkaro/CppSharp,nalkaro/CppSharp,zillemarco/CppSharp,KonajuGames/CppSharp,pacificIT/cxxi,Samana/CppSharp,SonyaSa/CppSharp,ddobrev/CppSharp,imazen/CppSharp,zillemarco/CppSharp,xistoso/CppSharp,txdv/CppSharp,txdv/CppSharp,SonyaSa/CppSharp,nalkaro/CppSharp,SonyaSa/CppSharp,mono/CppSharp,pacificIT/cxxi,shana/cppinterop,xistoso/CppSharp,xistoso/CppSharp,u255436/CppSharp,nalkaro/CppSharp,ktopouzi/CppSharp,mono/CppSharp,ddobrev/CppSharp,KonajuGames/CppSharp,nalkaro/CppSharp,genuinelucifer/CppSharp,mono/CppSharp,u255436/CppSharp,genuinelucifer/CppSharp,mono/cxxi,ddobrev/CppSharp,mono/CppSharp,mohtamohit/CppSharp,SonyaSa/CppSharp,zillemarco/CppSharp,shana/cppinterop,inordertotest/CppSharp,corngood/cxxi,mydogisbox/CppSharp,imazen/CppSharp,mono/cxxi,imazen/CppSharp,inordertotest/CppSharp,mono/cxxi,genuinelucifer/CppSharp,mydogisbox/CppSharp,ktopouzi/CppSharp,ktopouzi/CppSharp,shana/cppinterop,KonajuGames/CppSharp,pacificIT/cxxi,inordertotest/CppSharp,txdv/CppSharp,mohtamohit/CppSharp
|
28f788602fe67e8b01dd5a053a8032b2239a1191
|
Web/Areas/Admin/Views/Device/Index.cshtml
|
Web/Areas/Admin/Views/Device/Index.cshtml
|
@using RightpointLabs.ConferenceRoom.Domain
@model IEnumerable<RightpointLabs.ConferenceRoom.Domain.Models.Entities.DeviceEntity>
@{
var buildings = (Dictionary<string, string>)ViewBag.Buildings;
var rooms = (Dictionary<string, string>)ViewBag.Rooms;
}
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.Id)
</th>
<th>
@Html.DisplayNameFor(model => model.BuildingId)
</th>
<th>
@Html.DisplayNameFor(model => model.ControlledRoomIds)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@buildings.TryGetValue(item.Id)
</td>
<td>
@(null == item.BuildingId ? "" : buildings.TryGetValue(item.BuildingId))
</td>
<td>
@string.Join(", ", item.ControlledRoomIds.Select(_ => rooms.TryGetValue(_)))
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
@Html.ActionLink("Details", "Details", new { id=item.Id }) |
@Html.ActionLink("Delete", "Delete", new { id=item.Id })
</td>
</tr>
}
</table>
|
@using RightpointLabs.ConferenceRoom.Domain
@model IEnumerable<RightpointLabs.ConferenceRoom.Domain.Models.Entities.DeviceEntity>
@{
var buildings = (Dictionary<string, string>)ViewBag.Buildings;
var rooms = (Dictionary<string, string>)ViewBag.Rooms;
}
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.Id)
</th>
<th>
@Html.DisplayNameFor(model => model.BuildingId)
</th>
<th>
@Html.DisplayNameFor(model => model.ControlledRoomIds)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@item.Id
</td>
<td>
@(null == item.BuildingId ? "" : buildings.TryGetValue(item.BuildingId))
</td>
<td>
@string.Join(", ", (item.ControlledRoomIds ?? new string[0]).Select(_ => rooms.TryGetValue(_)))
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
@Html.ActionLink("Details", "Details", new { id=item.Id }) |
@Html.ActionLink("Delete", "Delete", new { id=item.Id })
</td>
</tr>
}
</table>
|
Fix up some room display issues
|
Fix up some room display issues
|
C#
|
mit
|
RightpointLabs/conference-room,jorupp/conference-room,RightpointLabs/conference-room,jorupp/conference-room,jorupp/conference-room,jorupp/conference-room,RightpointLabs/conference-room,RightpointLabs/conference-room
|
6fa4b470f7300eba698c0a4a588136cec24f75f6
|
CefSharp.Wpf/Rendering/InteropBitmapInfo.cs
|
CefSharp.Wpf/Rendering/InteropBitmapInfo.cs
|
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace CefSharp.Wpf.Rendering
{
public class InteropBitmapInfo : WpfBitmapInfo
{
private static readonly PixelFormat PixelFormat = PixelFormats.Bgra32;
public InteropBitmap Bitmap { get; private set; }
public InteropBitmapInfo()
{
BytesPerPixel = PixelFormat.BitsPerPixel / 8;
}
public override bool CreateNewBitmap
{
get { return Bitmap == null; }
}
public override void ClearBitmap()
{
Bitmap = null;
}
public override void Invalidate()
{
if (Bitmap != null)
{
Bitmap.Invalidate();
}
}
public override BitmapSource CreateBitmap()
{
var stride = Width * BytesPerPixel;
if (FileMappingHandle == IntPtr.Zero)
{
ClearBitmap();
}
else
{
Bitmap = (InteropBitmap)Imaging.CreateBitmapSourceFromMemorySection(FileMappingHandle, Width, Height, PixelFormat, stride, 0);
}
return Bitmap;
}
}
}
|
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace CefSharp.Wpf.Rendering
{
public class InteropBitmapInfo : WpfBitmapInfo
{
private static readonly PixelFormat PixelFormat = PixelFormats.Bgra32;
public InteropBitmap Bitmap { get; private set; }
public InteropBitmapInfo()
{
BytesPerPixel = PixelFormat.BitsPerPixel / 8;
}
public override bool CreateNewBitmap
{
get { return Bitmap == null; }
}
public override void ClearBitmap()
{
Bitmap = null;
}
public override void Invalidate()
{
if (Bitmap != null)
{
Bitmap.Invalidate();
}
}
public override BitmapSource CreateBitmap()
{
var stride = Width * BytesPerPixel;
// Unable to create bitmap without valid File Handle (Most likely control is being disposed)
if (FileMappingHandle == IntPtr.Zero)
{
return null;
}
else
{
Bitmap = (InteropBitmap)Imaging.CreateBitmapSourceFromMemorySection(FileMappingHandle, Width, Height, PixelFormat, stride, 0);
}
return Bitmap;
}
}
}
|
Return null immediately if file handle is not valid
|
Return null immediately if file handle is not valid
|
C#
|
bsd-3-clause
|
joshvera/CefSharp,zhangjingpu/CefSharp,zhangjingpu/CefSharp,Livit/CefSharp,ITGlobal/CefSharp,dga711/CefSharp,haozhouxu/CefSharp,yoder/CefSharp,Livit/CefSharp,dga711/CefSharp,battewr/CefSharp,windygu/CefSharp,jamespearce2006/CefSharp,NumbersInternational/CefSharp,joshvera/CefSharp,AJDev77/CefSharp,rlmcneary2/CefSharp,illfang/CefSharp,NumbersInternational/CefSharp,ruisebastiao/CefSharp,yoder/CefSharp,dga711/CefSharp,jamespearce2006/CefSharp,haozhouxu/CefSharp,wangzheng888520/CefSharp,wangzheng888520/CefSharp,ITGlobal/CefSharp,joshvera/CefSharp,AJDev77/CefSharp,jamespearce2006/CefSharp,illfang/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,Livit/CefSharp,gregmartinhtc/CefSharp,gregmartinhtc/CefSharp,windygu/CefSharp,VioletLife/CefSharp,battewr/CefSharp,haozhouxu/CefSharp,wangzheng888520/CefSharp,illfang/CefSharp,windygu/CefSharp,Haraguroicha/CefSharp,Haraguroicha/CefSharp,jamespearce2006/CefSharp,VioletLife/CefSharp,yoder/CefSharp,VioletLife/CefSharp,zhangjingpu/CefSharp,zhangjingpu/CefSharp,twxstar/CefSharp,battewr/CefSharp,yoder/CefSharp,illfang/CefSharp,NumbersInternational/CefSharp,haozhouxu/CefSharp,wangzheng888520/CefSharp,Haraguroicha/CefSharp,twxstar/CefSharp,VioletLife/CefSharp,battewr/CefSharp,twxstar/CefSharp,rlmcneary2/CefSharp,joshvera/CefSharp,NumbersInternational/CefSharp,dga711/CefSharp,ITGlobal/CefSharp,ruisebastiao/CefSharp,Haraguroicha/CefSharp,gregmartinhtc/CefSharp,Haraguroicha/CefSharp,ruisebastiao/CefSharp,ruisebastiao/CefSharp,AJDev77/CefSharp,jamespearce2006/CefSharp,windygu/CefSharp,rlmcneary2/CefSharp,twxstar/CefSharp,AJDev77/CefSharp,rlmcneary2/CefSharp,ITGlobal/CefSharp
|
30098480fe0a17f8afd708f05f5799f6d840bd86
|
src/AdoNetProfiler/AdoNetProfiler/AdoNetProfilerFactory.cs
|
src/AdoNetProfiler/AdoNetProfiler/AdoNetProfilerFactory.cs
|
using System;
using System.Reflection;
namespace AdoNetProfiler
{
/// <summary>
/// The factory to create the object of <see cref="IProfiler"/>.
/// </summary>
public class AdoNetProfilerFactory
{
// ConstructorInfo is faster than Func<IProfiler> when invoking.
private static ConstructorInfo _constructor;
/// <summary>
/// Initialize the setting for profiling of database accessing with ADO.NET.
/// </summary>
/// <param name="profilerType">The type to implement <see cref="IProfiler"/>.</param>
public static void Initialize(Type profilerType)
{
if (profilerType == null)
throw new ArgumentNullException(nameof(profilerType));
if (profilerType != typeof(IProfiler))
throw new ArgumentException($"The type must be {typeof(IProfiler).FullName}.", nameof(profilerType));
var constructor = profilerType.GetConstructor(Type.EmptyTypes);
if (constructor == null)
throw new InvalidOperationException("There is no default constructor. The profiler must have it.");
_constructor = constructor;
}
public static IProfiler GetProfiler()
{
return (IProfiler)_constructor.Invoke(null);
}
}
}
|
using System;
using System.Reflection;
using System.Threading;
namespace AdoNetProfiler
{
/// <summary>
/// The factory to create the object of <see cref="IProfiler"/>.
/// </summary>
public class AdoNetProfilerFactory
{
// ConstructorInfo is faster than Func<IProfiler> when invoking.
private static ConstructorInfo _constructor;
private static bool _initialized = false;
private static readonly ReaderWriterLockSlim _readerWriterLockSlim = new ReaderWriterLockSlim();
/// <summary>
/// Initialize the setting for profiling of database accessing with ADO.NET.
/// </summary>
/// <param name="profilerType">The type to implement <see cref="IProfiler"/>.</param>
public static void Initialize(Type profilerType)
{
if (profilerType == null)
throw new ArgumentNullException(nameof(profilerType));
if (profilerType != typeof(IProfiler))
throw new ArgumentException($"The type must be {typeof(IProfiler).FullName}.", nameof(profilerType));
_readerWriterLockSlim.ExecuteWithReadLock(() =>
{
if (_initialized)
throw new InvalidOperationException("This factory class has already initialized.");
var constructor = profilerType.GetConstructor(Type.EmptyTypes);
if (constructor == null)
throw new InvalidOperationException("There is no default constructor. The profiler must have it.");
_constructor = constructor;
_initialized = true;
});
}
public static IProfiler GetProfiler()
{
return _readerWriterLockSlim.ExecuteWithWriteLock(() =>
{
if (!_initialized)
throw new InvalidOperationException("This factory class has not initialized yet.");
return (IProfiler)_constructor.Invoke(null);
});
}
}
}
|
Use the lock in the factory class.
|
Use the lock in the factory class.
|
C#
|
mit
|
ttakahari/AdoNetProfiler
|
edb55399ec5bf204cb84b0adfb943727cf001217
|
KenticoInspector.Core/AbstractReport.cs
|
KenticoInspector.Core/AbstractReport.cs
|
using KenticoInspector.Core.Models;
using System;
using System.Collections.Generic;
namespace KenticoInspector.Core
{
public abstract class AbstractReport : IReport
{
public string Codename => GetCodename(this.GetType());
public static string GetCodename(Type reportType) {
return GetDirectParentNamespace(reportType);
}
public abstract IList<Version> CompatibleVersions { get; }
public virtual IList<Version> IncompatibleVersions => new List<Version>();
public abstract IList<string> Tags { get; }
public abstract ReportResults GetResults();
private static string GetDirectParentNamespace(Type reportType)
{
var fullNameSpace = reportType.Namespace;
var indexAfterLastPeriod = fullNameSpace.LastIndexOf('.') + 1;
return fullNameSpace.Substring(indexAfterLastPeriod, fullNameSpace.Length - indexAfterLastPeriod);
}
}
}
|
using KenticoInspector.Core.Models;
using System;
using System.Collections.Generic;
namespace KenticoInspector.Core
{
public abstract class AbstractReport<T> : IReport, IWithMetadata<T> where T : new()
{
public string Codename => GetCodename(this.GetType());
public static string GetCodename(Type reportType) {
return GetDirectParentNamespace(reportType);
}
public abstract IList<Version> CompatibleVersions { get; }
public virtual IList<Version> IncompatibleVersions => new List<Version>();
public abstract IList<string> Tags { get; }
public abstract Metadata<T> Metadata { get; }
public abstract ReportResults GetResults();
private static string GetDirectParentNamespace(Type reportType)
{
var fullNameSpace = reportType.Namespace;
var indexAfterLastPeriod = fullNameSpace.LastIndexOf('.') + 1;
return fullNameSpace.Substring(indexAfterLastPeriod, fullNameSpace.Length - indexAfterLastPeriod);
}
}
}
|
Add metadata support to abstract report
|
Add metadata support to abstract report
|
C#
|
mit
|
ChristopherJennings/KInspector,ChristopherJennings/KInspector,Kentico/KInspector,ChristopherJennings/KInspector,Kentico/KInspector,ChristopherJennings/KInspector,Kentico/KInspector,Kentico/KInspector
|
1bff640e31ccf84de67b1d8a6ee2b3275ddea512
|
src/Cassette.Web/ModuleRequestHandler.cs
|
src/Cassette.Web/ModuleRequestHandler.cs
|
using System;
using System.Web;
using System.Web.Routing;
namespace Cassette
{
public class ModuleRequestHandler<T> : IHttpHandler
where T : Module
{
public ModuleRequestHandler(IModuleContainer<T> moduleContainer, RequestContext requestContext)
{
this.moduleContainer = moduleContainer;
this.requestContext = requestContext;
}
readonly IModuleContainer<T> moduleContainer;
readonly RequestContext requestContext;
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext _)
{
var path = requestContext.RouteData.GetRequiredString("path");
var index = path.LastIndexOf('_');
if (index >= 0)
{
path = path.Substring(0, index);
}
var module = moduleContainer.FindModuleByPath(path);
var response = requestContext.HttpContext.Response;
if (module == null)
{
response.StatusCode = 404;
}
else
{
response.Cache.SetCacheability(HttpCacheability.Public);
response.Cache.SetMaxAge(TimeSpan.FromDays(365));
response.ContentType = module.ContentType;
using (var assetStream = module.Assets[0].OpenStream())
{
assetStream.CopyTo(response.OutputStream);
}
}
}
}
}
|
using System;
using System.Web;
using System.Web.Routing;
namespace Cassette.Web
{
public class ModuleRequestHandler<T> : IHttpHandler
where T : Module
{
public ModuleRequestHandler(IModuleContainer<T> moduleContainer, RequestContext requestContext)
{
this.moduleContainer = moduleContainer;
this.requestContext = requestContext;
}
readonly IModuleContainer<T> moduleContainer;
readonly RequestContext requestContext;
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext _)
{
var path = requestContext.RouteData.GetRequiredString("path");
var index = path.LastIndexOf('_');
if (index >= 0)
{
path = path.Substring(0, index);
}
var module = moduleContainer.FindModuleByPath(path);
var response = requestContext.HttpContext.Response;
if (module == null)
{
response.StatusCode = 404;
}
else
{
response.Cache.SetCacheability(HttpCacheability.Public);
response.Cache.SetMaxAge(TimeSpan.FromDays(365));
response.ContentType = module.ContentType;
using (var assetStream = module.Assets[0].OpenStream())
{
assetStream.CopyTo(response.OutputStream);
}
}
}
}
}
|
Move class into correct namespace.
|
Move class into correct namespace.
|
C#
|
mit
|
honestegg/cassette,andrewdavey/cassette,damiensawyer/cassette,BluewireTechnologies/cassette,damiensawyer/cassette,andrewdavey/cassette,BluewireTechnologies/cassette,andrewdavey/cassette,honestegg/cassette,damiensawyer/cassette,honestegg/cassette
|
855be1ec27572f522669e9e70f754d465792559b
|
lib/irule.cs
|
lib/irule.cs
|
// The code is new, but the idea is from http://wiki.tcl.tk/9563
using System;
using System.Runtime.InteropServices;
namespace Irule
{
public class TclInterp : IDisposable
{
[DllImport("libtcl.dylib")]
protected static extern IntPtr Tcl_CreateInterp();
[DllImport("libtcl.dylib")]
protected static extern int Tcl_Init(IntPtr interp);
[DllImport("libtcl.dylib")]
protected static extern int Tcl_Eval(IntPtr interp, string script);
[DllImport("libtcl.dylib")]
protected static extern IntPtr Tcl_GetStringResult(IntPtr interp);
[DllImport("libtcl.dylib")]
protected static extern void Tcl_DeleteInterp(IntPtr interp);
[DllImport("libtcl.dylib")]
protected static extern void Tcl_Finalize();
private IntPtr interp;
private bool disposed;
public TclInterp()
{
interp = Tcl_CreateInterp();
Tcl_Init(interp);
disposed = false;
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
if (disposing && interp != IntPtr.Zero)
{
Tcl_DeleteInterp(interp);
Tcl_Finalize();
}
interp = IntPtr.Zero;
disposed = true;
}
}
public string Eval(string text)
{
if (disposed)
{
throw new ObjectDisposedException("Attempt to use disposed Tcl interpreter");
}
Tcl_Eval(interp, text);
var result = Tcl_GetStringResult(interp);
return Marshal.PtrToStringAnsi(result);
}
}
}
|
// The code is new, but the idea is from http://wiki.tcl.tk/9563
using System;
using System.Runtime.InteropServices;
namespace Irule
{
public class TclInterp : IDisposable
{
[DllImport("tcl8.4")]
protected static extern IntPtr Tcl_CreateInterp();
[DllImport("tcl8.4")]
protected static extern int Tcl_Init(IntPtr interp);
[DllImport("tcl8.4")]
protected static extern int Tcl_Eval(IntPtr interp, string script);
[DllImport("tcl8.4")]
protected static extern IntPtr Tcl_GetStringResult(IntPtr interp);
[DllImport("tcl8.4")]
protected static extern void Tcl_DeleteInterp(IntPtr interp);
[DllImport("tcl8.4")]
protected static extern void Tcl_Finalize();
private IntPtr interp;
private bool disposed;
public TclInterp()
{
interp = Tcl_CreateInterp();
Tcl_Init(interp);
disposed = false;
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
if (disposing && interp != IntPtr.Zero)
{
Tcl_DeleteInterp(interp);
Tcl_Finalize();
}
interp = IntPtr.Zero;
disposed = true;
}
}
public string Eval(string text)
{
if (disposed)
{
throw new ObjectDisposedException("Attempt to use disposed Tcl interpreter");
}
Tcl_Eval(interp, text);
var result = Tcl_GetStringResult(interp);
return Marshal.PtrToStringAnsi(result);
}
}
}
|
Load Tcl in a cross-platform way
|
Load Tcl in a cross-platform way
|
C#
|
mit
|
undees/irule,undees/irule
|
0ee3267f1d4852b954bc9f4a2abfaac5eff1a84d
|
mugo/PizzaModel.cs
|
mugo/PizzaModel.cs
|
using System;
using Engine.cgimin.material.simpletexture;
using Engine.cgimin.object3d;
using Engine.cgimin.texture;
using OpenTK;
namespace Mugo
{
class PizzaModel : ClonedObject<PizzaModelInternal>, ITunnelSegementElementModel
{
private static readonly SimpleTextureMaterial material = new SimpleTextureMaterial();
public float Radius => radius;
public new Matrix4 Transformation {
get { return base.Transformation; }
set { base.Transformation = value; }
}
public void Draw ()
{
material.Draw(this, internalObject.TextureId);
}
}
internal class PizzaModelInternal : ObjLoaderObject3D
{
private const String objFilePath = "data/objects/Pizza.model";
private const String texturePath = "data/textures/Pizza.png";
public PizzaModelInternal () : base (objFilePath)
{
TextureId = TextureManager.LoadTexture (texturePath);
Transformation *= Matrix4.CreateScale (0.2f);
Transformation *= Matrix4.CreateRotationY (MathHelper.DegreesToRadians (90));
Transformation *= Matrix4.CreateRotationX (MathHelper.DegreesToRadians (90));
Transformation *= Matrix4.CreateTranslation (0f, 1.5f, -TunnelSegmentConfig.Depth / 2f);
DefaultTransformation = Transformation;
}
public int TextureId { get; private set; }
public Matrix4 DefaultTransformation { get; }
}
}
|
using System;
using Engine.cgimin.material.simpletexture;
using Engine.cgimin.object3d;
using Engine.cgimin.texture;
using OpenTK;
namespace Mugo
{
class PizzaModel : ClonedObject<PizzaModelInternal>, ITunnelSegementElementModel
{
private static readonly SimpleTextureMaterial material = new SimpleTextureMaterial();
public float Radius => radius;
public new Matrix4 Transformation {
get { return base.Transformation; }
set { base.Transformation = value; }
}
public void Draw ()
{
material.Draw(this, internalObject.TextureId);
}
}
internal class PizzaModelInternal : ObjLoaderObject3D
{
private const String objFilePath = "data/objects/Pizza.model";
private const String texturePath = "data/textures/Pizza.png";
public PizzaModelInternal () : base (objFilePath, 0.2f)
{
TextureId = TextureManager.LoadTexture (texturePath);
Transformation *= Matrix4.CreateRotationY (MathHelper.DegreesToRadians (90));
Transformation *= Matrix4.CreateRotationX (MathHelper.DegreesToRadians (90));
Transformation *= Matrix4.CreateTranslation (0f, 1.5f, -TunnelSegmentConfig.Depth / 2f);
DefaultTransformation = Transformation;
}
public int TextureId { get; private set; }
public Matrix4 DefaultTransformation { get; }
}
}
|
Move scale operation to base constructor.
|
Move scale operation to base constructor.
This fixes the incorrect radius calculation.
|
C#
|
mit
|
saschb2b/mugo
|
c8c727e1bad3d92f667cbc27306ee4ebf148950c
|
Console-IO-Homework/SumOfNNumbers/SumOfNNumbers.cs
|
Console-IO-Homework/SumOfNNumbers/SumOfNNumbers.cs
|
/*Problem 9. Sum of n Numbers
Write a program that enters a number n and after that enters more n numbers and calculates and prints their sum.
Note: You may need to use a for-loop.
Examples:
numbers sum
3 90
20
60
10
5 6.5
2
-1
-0.5
4
2
1 1
1
*/
using System;
class SumOfNNumbers
{
static void Main()
{
Console.Title = "Sum of n Numbers"; //Changing the title of the console.
Console.Write("Please, enter an integer n: ");
int n = int.Parse(Console.ReadLine());
double sum = 0;
for (int i = 1; i <= n; i++)
{
sum += double.Parse(Console.ReadLine());
}
Console.WriteLine("\nsum = " + sum);
Console.ReadKey(); // Keeping the console opened.
}
}
|
/*Problem 9. Sum of n Numbers
Write a program that enters a number n and after that enters more n numbers and calculates and prints their sum.
Note: You may need to use a for-loop.
Examples:
numbers sum
3 90
20
60
10
5 6.5
2
-1
-0.5
4
2
1 1
1
*/
using System;
class SumOfNNumbers
{
static void Main()
{
Console.Title = "Sum of n Numbers"; //Changing the title of the console.
Console.Write("Please, enter an integer n and n numbers after that.\nn: ");
int n = int.Parse(Console.ReadLine());
double sum = 0;
for (int i = 1; i <= n; i++)
{
Console.Write("number {0}: ", i);
sum += double.Parse(Console.ReadLine());
}
Console.WriteLine("\nsum = " + sum);
Console.ReadKey(); // Keeping the console opened.
}
}
|
Update to Problem 9. Sum of n Numbers
|
Update to Problem 9. Sum of n Numbers
|
C#
|
mit
|
SimoPrG/CSharpPart1Homework
|
26dfe4aac323cedb1fb6122a503fa216cd0a90fa
|
src/Lloyd.AzureMailGateway.Models.Tests/EMailBuilderTests.cs
|
src/Lloyd.AzureMailGateway.Models.Tests/EMailBuilderTests.cs
|
using System;
using System.Linq;
using AutoFixture.Xunit2;
using Shouldly;
using Xunit;
namespace Lloyd.AzureMailGateway.Models.Tests
{
public class EMailBuilderTests
{
//[Fact]
//public void BuilderShouldReturnNonNullEMailInstance()
//{
// // Arrange
// var builder = new EMailBuilder();
// // Act
// var email = new EMailBuilder().Build();
// // Assert
//}
[Fact]
public void BuildShouldThrowOnInvalidState()
{
// Arrange
var builder = new EMailBuilder();
// Act / Assert
Should.Throw<InvalidOperationException>(() => new EMailBuilder().Build());
}
[Theory, AutoData]
public void BuilderShouldSetToAndFromProperties(Address toAddress, Address fromAddress)
{
// Arrange
var builder = new EMailBuilder();
// Act
builder
.To(toAddress.EMail, toAddress.Name)
.From(fromAddress.EMail, fromAddress.Name);
var email = builder.Build();
// Assert
email.To.Addresses.First().EMail.ShouldBe(toAddress.EMail);
email.To.Addresses.First().Name.ShouldBe(toAddress.Name);
}
}
}
|
using System;
using System.Linq;
using AutoFixture.Xunit2;
using Shouldly;
using Xunit;
namespace Lloyd.AzureMailGateway.Models.Tests
{
public class EMailBuilderTests
{
[Fact]
public void BuildShouldThrowOnInvalidState()
{
// Arrange
var builder = new EMailBuilder();
// Act / Assert
Should.Throw<InvalidOperationException>(() => new EMailBuilder().Build());
}
[Theory, AutoData]
public void BuilderShouldSetToAndFromProperties(Address toAddress, Address fromAddress)
{
// Arrange
var builder = new EMailBuilder();
// Act
builder
.To(toAddress.EMail, toAddress.Name)
.From(fromAddress.EMail, fromAddress.Name);
var email = builder.Build();
// Assert
email.To.Addresses.First().EMail.ShouldBe(toAddress.EMail);
email.To.Addresses.First().Name.ShouldBe(toAddress.Name);
}
}
}
|
Remove obsolete unit test (null check - can no longer be null)
|
Remove obsolete unit test (null check - can no longer be null)
|
C#
|
mit
|
lloydjatkinson/Lloyd.AzureMailGateway
|
ed66db4e13b0d327477f9024235e430f15ca2ee4
|
Assets/Resources/Microgames/RemiCover/Scripts/RemiCover_UmbrellaBehaviour.cs
|
Assets/Resources/Microgames/RemiCover/Scripts/RemiCover_UmbrellaBehaviour.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RemiCover_UmbrellaBehaviour : MonoBehaviour {
public float verticalPosition;
// Use this for initialization
void Start () {
Cursor.visible = false;
}
// Update is called once per frame
void Update() {
Vector2 mousePosition = CameraHelper.getCursorPosition();
this.transform.position = new Vector2(mousePosition.x, verticalPosition);
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RemiCover_UmbrellaBehaviour : MonoBehaviour {
public float verticalPosition;
// Use this for initialization
void Start () {
Cursor.visible = false;
}
// Update is called once per frame
void Update() {
if (!MicrogameController.instance.getVictory())
return;
Vector2 mousePosition = CameraHelper.getCursorPosition();
this.transform.position = new Vector2(mousePosition.x, verticalPosition);
}
}
|
Stop umbrella on player loss
|
Stop umbrella on player loss
Basically sends the message to the player that they're done and messed
up
|
C#
|
mit
|
Barleytree/NitoriWare,NitorInc/NitoriWare,plrusek/NitoriWare,Barleytree/NitoriWare,uulltt/NitoriWare,NitorInc/NitoriWare
|
a51c6a82aba60e4927d62c968abddef55de7982a
|
Mond/Compiler/Parselets/ObjectParselet.cs
|
Mond/Compiler/Parselets/ObjectParselet.cs
|
using System.Collections.Generic;
using Mond.Compiler.Expressions;
namespace Mond.Compiler.Parselets
{
class ObjectParselet : IPrefixParselet
{
public Expression Parse(Parser parser, Token token)
{
var values = new List<KeyValuePair<string, Expression>>();
while (!parser.Match(TokenType.RightBrace))
{
var identifier = parser.Take(TokenType.Identifier);
parser.Take(TokenType.Colon);
var value = parser.ParseExpession();
values.Add(new KeyValuePair<string, Expression>(identifier.Contents, value));
if (!parser.Match(TokenType.Comma))
break;
parser.Take(TokenType.Comma);
}
parser.Take(TokenType.RightBrace);
return new ObjectExpression(token, values);
}
}
}
|
using System.Collections.Generic;
using Mond.Compiler.Expressions;
namespace Mond.Compiler.Parselets
{
class ObjectParselet : IPrefixParselet
{
public Expression Parse(Parser parser, Token token)
{
var values = new List<KeyValuePair<string, Expression>>();
while (!parser.Match(TokenType.RightBrace))
{
var identifier = parser.Take(TokenType.Identifier);
Expression value;
if (parser.Match(TokenType.Comma) || parser.Match(TokenType.RightBrace))
{
value = new IdentifierExpression(identifier);
}
else
{
parser.Take(TokenType.Colon);
value = parser.ParseExpession();
}
values.Add(new KeyValuePair<string, Expression>(identifier.Contents, value));
if (!parser.Match(TokenType.Comma))
break;
parser.Take(TokenType.Comma);
}
parser.Take(TokenType.RightBrace);
return new ObjectExpression(token, values);
}
}
}
|
Add support for array-like object declarations
|
Add support for array-like object declarations
|
C#
|
mit
|
SirTony/Mond,Rohansi/Mond,Rohansi/Mond,SirTony/Mond,Rohansi/Mond,SirTony/Mond
|
b9859e0f76124786dc588cf36d5a261bb63943a0
|
YGOSharp.Network/Utils/BinaryExtensions.cs
|
YGOSharp.Network/Utils/BinaryExtensions.cs
|
using System;
using System.IO;
using System.Text;
namespace YGOSharp.Network.Utils
{
public static class BinaryExtensions
{
public static void WriteUnicode(this BinaryWriter writer, string text, int len)
{
byte[] unicode = Encoding.Unicode.GetBytes(text);
byte[] result = new byte[len * 2];
int max = len * 2 - 2;
Array.Copy(unicode, result, unicode.Length > max ? max : unicode.Length);
writer.Write(result);
}
public static string ReadUnicode(this BinaryReader reader, int len)
{
byte[] unicode = reader.ReadBytes(len * 2);
string text = Encoding.Unicode.GetString(unicode);
text = text.Substring(0, text.IndexOf('\0'));
return text;
}
public static byte[] ReadToEnd(this BinaryReader reader)
{
return reader.ReadBytes((int)(reader.BaseStream.Length - reader.BaseStream.Position));
}
}
}
|
using System;
using System.IO;
using System.Text;
namespace YGOSharp.Network.Utils
{
public static class BinaryExtensions
{
public static void WriteUnicode(this BinaryWriter writer, string text, int len)
{
byte[] unicode = Encoding.Unicode.GetBytes(text);
byte[] result = new byte[len * 2];
int max = len * 2 - 2;
Array.Copy(unicode, result, unicode.Length > max ? max : unicode.Length);
writer.Write(result);
}
public static string ReadUnicode(this BinaryReader reader, int len)
{
byte[] unicode = reader.ReadBytes(len * 2);
string text = Encoding.Unicode.GetString(unicode);
int index = text.IndexOf('\0');
if (index > 0) text = text.Substring(0, index);
return text;
}
public static byte[] ReadToEnd(this BinaryReader reader)
{
return reader.ReadBytes((int)(reader.BaseStream.Length - reader.BaseStream.Position));
}
}
}
|
Fix a crash if we receive a too long unicode string
|
Fix a crash if we receive a too long unicode string
|
C#
|
mit
|
IceYGO/ygosharp
|
6825521f2d7a1fe3effea3d79e2d36ef00105e1a
|
src/SyncTrayzor/SyncThing/Api/ItemStartedEvent.cs
|
src/SyncTrayzor/SyncThing/Api/ItemStartedEvent.cs
|
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SyncTrayzor.SyncThing.Api
{
public class ItemStartedEventData
{
[JsonProperty("item")]
public string Item { get; set; }
[JsonProperty("folder")]
public string Folder { get; set; }
}
public class ItemStartedEvent : Event
{
[JsonProperty("data")]
public ItemStartedEventData Data { get; set; }
public override void Visit(IEventVisitor visitor)
{
visitor.Accept(this);
}
public override string ToString()
{
return String.Format("<ItemStarted ID={0} Time={1} Item={2} Folder={3}>", this.Id, this.Time, this.Data.Item, this.Data.Folder);
}
}
}
|
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SyncTrayzor.SyncThing.Api
{
public class ItemStartedEventDetails
{
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("Flags")]
public int Flags { get; set; }
[JsonProperty("Modified")]
public long Modified { get; set; } // Is this supposed to be a DateTime?
[JsonProperty("Version")]
public int Version { get; set; }
[JsonProperty("LocalVersion")]
public int LocalVersion { get; set; }
[JsonProperty("NumBlocks")]
public int NumBlocks { get; set; }
}
public class ItemStartedEventData
{
[JsonProperty("item")]
public string Item { get; set; }
[JsonProperty("folder")]
public string Folder { get; set; }
[JsonProperty("details")]
public ItemStartedEventDetails Details { get; set; }
}
public class ItemStartedEvent : Event
{
[JsonProperty("data")]
public ItemStartedEventData Data { get; set; }
public override void Visit(IEventVisitor visitor)
{
visitor.Accept(this);
}
public override string ToString()
{
return String.Format("<ItemStarted ID={0} Time={1} Item={2} Folder={3} Name={4} Flags={5} Modified={6} Version={7} LocalVersion={8} NumBlocks={9}>",
this.Id, this.Time, this.Data.Item, this.Data.Folder, this.Data.Details.Name, this.Data.Details.Flags, this.Data.Details.Modified,
this.Data.Details.Version, this.Data.Details.LocalVersion, this.Data.Details.NumBlocks);
}
}
}
|
Support details for ItemStarted event
|
Support details for ItemStarted event
|
C#
|
mit
|
canton7/SyncTrayzor,canton7/SyncTrayzor,canton7/SyncTrayzor
|
02f5fda330306b6ae9b3a67dad6f50b2373562c6
|
osu.Game/Online/RealtimeMultiplayer/NotJoinedRoomException.cs
|
osu.Game/Online/RealtimeMultiplayer/NotJoinedRoomException.cs
|
using System;
namespace osu.Game.Online.RealtimeMultiplayer
{
public class NotJoinedRoomException : Exception
{
public NotJoinedRoomException()
: base("This user has not yet joined a multiplayer room.")
{
}
}
}
|
using System;
namespace osu.Game.Online.RealtimeMultiplayer
{
public class NotJoinedRoomException : Exception
{
public NotJoinedRoomException()
: base("This user has not yet joined a multiplayer room.")
{
}
}
}
|
Add missing final newline in file
|
Add missing final newline in file
|
C#
|
mit
|
peppy/osu,NeoAdonis/osu,ppy/osu,ppy/osu,peppy/osu-new,smoogipoo/osu,ppy/osu,peppy/osu,smoogipoo/osu,peppy/osu,smoogipooo/osu,UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,UselessToucan/osu,NeoAdonis/osu,UselessToucan/osu
|
04008653170cb10ddce75f7c35d1720e45b2f0b3
|
MusicRandomizer/MusicRandomizer/NewPlaylistForm.cs
|
MusicRandomizer/MusicRandomizer/NewPlaylistForm.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace MusicRandomizer
{
public partial class NewPlaylistForm : Form
{
public String name;
public NewPlaylistForm()
{
InitializeComponent();
}
private void btnSave_Click(object sender, EventArgs e)
{
name = txtName.Text;
// Check to make sure the user actually entered a name
if (name.Length == 0)
{
MessageBox.Show("Please enter in a name.");
return;
}
// Check for invalid characters in the filename
foreach (char c in Path.GetInvalidFileNameChars())
{
if (name.Contains(c))
{
MessageBox.Show("There are invalid characters in the playlist name.");
return;
}
}
// Check to make sure this name isn't already taken
String[] playlists = Directory.GetFiles("playlists");
foreach (String playlist in playlists)
{
if (playlist.Equals(name))
{
MessageBox.Show("This playlist already exists.");
return;
}
}
// Create the playlist
using (FileStream writer = File.OpenWrite("playlists\\" + name + ".xml"))
{
MainForm.serializer.Serialize(writer, new List<MusicFile>());
}
this.Close();
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace MusicRandomizer
{
public partial class NewPlaylistForm : Form
{
public String name;
public NewPlaylistForm()
{
InitializeComponent();
}
private void btnSave_Click(object sender, EventArgs e)
{
name = txtName.Text;
// Check to make sure the user actually entered a name
if (name.Length == 0)
{
MessageBox.Show("Please enter in a name.");
return;
}
// Check for invalid characters in the filename
foreach (char c in Path.GetInvalidFileNameChars())
{
if (name.Contains(c))
{
MessageBox.Show("There are invalid characters in the playlist name.");
return;
}
}
// Check to make sure this name isn't already taken
if (File.Exists("playlists\\" + name + ".xml"))
{
MessageBox.Show("That playlist already exists.");
return;
}
// Create the playlist
using (FileStream writer = File.OpenWrite("playlists\\" + name + ".xml"))
{
MainForm.serializer.Serialize(writer, new List<MusicFile>());
}
this.Close();
}
}
}
|
Fix a bug where you could create an already existing playlist
|
MusicRandomizer: Fix a bug where you could create an already existing playlist
|
C#
|
mit
|
OatmealDome/SplatoonUtilities
|
25efe0cbd01016d49c1033119fb70c944f624fa6
|
DesktopWidgets/Widgets/PictureSlideshow/Settings.cs
|
DesktopWidgets/Widgets/PictureSlideshow/Settings.cs
|
using System;
using System.ComponentModel;
using DesktopWidgets.WidgetBase.Settings;
namespace DesktopWidgets.Widgets.PictureSlideshow
{
public class Settings : WidgetSettingsBase
{
public Settings()
{
Width = 384;
Height = 216;
}
[Category("General")]
[DisplayName("Root Folder")]
public string RootPath { get; set; }
[Category("General")]
[DisplayName("Allowed File Extensions")]
public string FileFilterExtension { get; set; } = ".jpg|.jpeg|.png|.bmp|.gif|.ico|.tiff|.wmp";
[Category("General")]
[DisplayName("Maximum File Size (bytes)")]
public double FileFilterSize { get; set; } = 1024000;
[Category("General")]
[DisplayName("Next Image Interval")]
public TimeSpan ChangeInterval { get; set; } = TimeSpan.FromSeconds(15);
[Category("General")]
[DisplayName("Shuffle")]
public bool Shuffle { get; set; } = true;
[Category("General")]
[DisplayName("Recursive")]
public bool Recursive { get; set; } = false;
[Category("General")]
[DisplayName("Current Image Path")]
public string ImageUrl { get; set; }
[Category("General")]
[DisplayName("Allow Dropping Images")]
public bool AllowDropFiles { get; set; } = true;
[Category("General")]
[DisplayName("Freeze")]
public bool Freeze { get; set; }
}
}
|
using System;
using System.ComponentModel;
using DesktopWidgets.WidgetBase.Settings;
namespace DesktopWidgets.Widgets.PictureSlideshow
{
public class Settings : WidgetSettingsBase
{
public Settings()
{
Width = 384;
Height = 216;
}
[Category("General")]
[DisplayName("Image Folder Path")]
public string RootPath { get; set; }
[Category("General")]
[DisplayName("Allowed File Extensions")]
public string FileFilterExtension { get; set; } = ".jpg|.jpeg|.png|.bmp|.gif|.ico|.tiff|.wmp";
[Category("General")]
[DisplayName("Maximum File Size (bytes)")]
public double FileFilterSize { get; set; } = 1024000;
[Category("General")]
[DisplayName("Next Image Interval")]
public TimeSpan ChangeInterval { get; set; } = TimeSpan.FromSeconds(15);
[Category("General")]
[DisplayName("Shuffle")]
public bool Shuffle { get; set; } = true;
[Category("General")]
[DisplayName("Recursive")]
public bool Recursive { get; set; } = false;
[Category("General")]
[DisplayName("Current Image Path")]
public string ImageUrl { get; set; }
[Category("General")]
[DisplayName("Allow Dropping Images")]
public bool AllowDropFiles { get; set; } = true;
[Category("General")]
[DisplayName("Freeze")]
public bool Freeze { get; set; }
}
}
|
Change "Slideshow" "Root Folder" option name
|
Change "Slideshow" "Root Folder" option name
|
C#
|
apache-2.0
|
danielchalmers/DesktopWidgets
|
d61a8327da94243b65d7761ee23d9a5f4649a5fe
|
osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs
|
osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
/// <summary>
/// A hit used specifically for drum rolls, where spawning flying hits is required.
/// </summary>
public class DrawableFlyingHit : DrawableHit
{
public DrawableFlyingHit(DrawableDrumRollTick drumRollTick)
: base(new IgnoreHit
{
StartTime = drumRollTick.HitObject.StartTime + drumRollTick.Result.TimeOffset,
IsStrong = drumRollTick.HitObject.IsStrong,
Type = drumRollTick.JudgementType
})
{
HitObject.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
}
protected override void LoadComplete()
{
base.LoadComplete();
ApplyResult(r => r.Type = r.Judgement.MaxResult);
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
/// <summary>
/// A hit used specifically for drum rolls, where spawning flying hits is required.
/// </summary>
public class DrawableFlyingHit : DrawableHit
{
public DrawableFlyingHit(DrawableDrumRollTick drumRollTick)
: base(new IgnoreHit
{
StartTime = drumRollTick.HitObject.StartTime + drumRollTick.Result.TimeOffset,
IsStrong = drumRollTick.HitObject.IsStrong,
Type = drumRollTick.JudgementType
})
{
HitObject.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
}
protected override void LoadComplete()
{
base.LoadComplete();
ApplyResult(r => r.Type = r.Judgement.MaxResult);
}
protected override void LoadSamples()
{
// block base call - flying hits are not supposed to play samples
// the base call could overwrite the type of this hit
}
}
}
|
Fix rim flying hits changing colour
|
Fix rim flying hits changing colour
|
C#
|
mit
|
peppy/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,smoogipooo/osu,peppy/osu,NeoAdonis/osu,smoogipoo/osu,peppy/osu,smoogipoo/osu,peppy/osu-new,UselessToucan/osu,ppy/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu
|
ef8b1aa7858be45bf8705faaf477b3dba41f7853
|
Working_with_images/Working_with_images/AppDelegate.cs
|
Working_with_images/Working_with_images/AppDelegate.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Working_with_images
{
/// <summary>
/// The UIApplicationDelegate for the application. This class is responsible for launching the
/// User Interface of the application, as well as listening (and optionally responding) to
/// application events from iOS.
/// </summary>
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow window;
/// <summary>
/// This method is invoked when the application has loaded and is ready to run. In this
/// method you should instantiate the window, load the UI into it and then make the window
/// visible.
/// </summary>
/// <remarks>
/// You have 5 seconds to return from this method, or iOS will terminate your application.
/// </remarks>
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
// If you have defined a view, add it here:
// window.AddSubview (navigationController.View);
// make the window visible
window.MakeKeyAndVisible ();
return true;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Working_with_images
{
/// <summary>
/// The UIApplicationDelegate for the application. This class is responsible for launching the
/// User Interface of the application, as well as listening (and optionally responding) to
/// application events from iOS.
/// </summary>
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow window;
// Added contoller. As of MonoTouch 5.0.2, applications are expected to
// have a root view controller at the end of application launch
UIViewController controller;
UILabel label;
/// <summary>
/// This method is invoked when the application has loaded and is ready to run. In this
/// method you should instantiate the window, load the UI into it and then make the window
/// visible.
/// </summary>
/// <remarks>
/// You have 5 seconds to return from this method, or iOS will terminate your application.
/// </remarks>
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
controller = new UIViewController ();
controller.View.BackgroundColor = UIColor.White;
label = new UILabel();
label.Frame = new System.Drawing.RectangleF(10 ,10, UIScreen.MainScreen.Bounds.Width, 50);
label.Text = "Hello, Working with Images";
controller.View.AddSubview(label);
window.RootViewController = controller;
// make the window visible
window.MakeKeyAndVisible ();
return true;
}
}
}
|
Update Mike's Working with Images sample.
|
Update Mike's Working with Images sample.
|
C#
|
mit
|
nervevau2/monotouch-samples,a9upam/monotouch-samples,labdogg1003/monotouch-samples,nervevau2/monotouch-samples,sakthivelnagarajan/monotouch-samples,andypaul/monotouch-samples,albertoms/monotouch-samples,YOTOV-LIMITED/monotouch-samples,andypaul/monotouch-samples,robinlaide/monotouch-samples,W3SS/monotouch-samples,hongnguyenpro/monotouch-samples,labdogg1003/monotouch-samples,davidrynn/monotouch-samples,xamarin/monotouch-samples,robinlaide/monotouch-samples,haithemaraissia/monotouch-samples,xamarin/monotouch-samples,peteryule/monotouch-samples,a9upam/monotouch-samples,iFreedive/monotouch-samples,peteryule/monotouch-samples,albertoms/monotouch-samples,kingyond/monotouch-samples,haithemaraissia/monotouch-samples,W3SS/monotouch-samples,markradacz/monotouch-samples,labdogg1003/monotouch-samples,hongnguyenpro/monotouch-samples,kingyond/monotouch-samples,markradacz/monotouch-samples,YOTOV-LIMITED/monotouch-samples,nelzomal/monotouch-samples,markradacz/monotouch-samples,sakthivelnagarajan/monotouch-samples,YOTOV-LIMITED/monotouch-samples,sakthivelnagarajan/monotouch-samples,robinlaide/monotouch-samples,iFreedive/monotouch-samples,haithemaraissia/monotouch-samples,labdogg1003/monotouch-samples,hongnguyenpro/monotouch-samples,hongnguyenpro/monotouch-samples,nelzomal/monotouch-samples,davidrynn/monotouch-samples,andypaul/monotouch-samples,nervevau2/monotouch-samples,davidrynn/monotouch-samples,xamarin/monotouch-samples,a9upam/monotouch-samples,peteryule/monotouch-samples,a9upam/monotouch-samples,YOTOV-LIMITED/monotouch-samples,andypaul/monotouch-samples,nelzomal/monotouch-samples,kingyond/monotouch-samples,sakthivelnagarajan/monotouch-samples,nelzomal/monotouch-samples,bratsche/monotouch-samples,haithemaraissia/monotouch-samples,davidrynn/monotouch-samples,peteryule/monotouch-samples,robinlaide/monotouch-samples,albertoms/monotouch-samples,iFreedive/monotouch-samples,nervevau2/monotouch-samples,bratsche/monotouch-samples,W3SS/monotouch-samples
|
bfaba2fe74bb3749cf0b544153f08bd7e8d07265
|
Assets/Scripts/HUD.cs
|
Assets/Scripts/HUD.cs
|
using UnityEngine;
using System.Collections;
public sealed class HUD : MonoBehaviour {
private int frameCount = 0;
private float dt = 0.0F;
private float fps = 0.0F;
private float updateRate = 4.0F;
void Start () {
}
void Update () {
frameCount++;
dt += Time.deltaTime;
if (dt > 1.0F / updateRate) {
fps = frameCount / dt ;
frameCount = 0;
dt -= 1.0F / updateRate;
}
}
void OnGUI () {
GUI.Label(new Rect(10, 10, 150, 100), "Current FPS: " + ((int)fps).ToString());
GUI.Box(new Rect(Screen.width / 2, Screen.height / 2, 0, 0), "This is a crosshair");
}
}
|
using UnityEngine;
using System.Collections;
public sealed class HUD : MonoBehaviour {
private int FrameCount = 0;
private float DeltaTime = 0.0F;
private float FPS = 0.0F;
private float UpdateRate = 5.0F;
void Start () {
}
void Update () {
FrameCount++;
DeltaTime += Time.deltaTime;
if (DeltaTime > 1.0F / UpdateRate) {
FPS = FrameCount / DeltaTime ;
FrameCount = 0;
DeltaTime -= 1.0F / UpdateRate;
}
}
void OnGUI () {
GUI.Label(new Rect(10, 10, 150, 100), "Current FPS: " + ((int)FPS).ToString());
GUI.Box(new Rect(Screen.width / 2, Screen.height / 2, 0, 0), "This is a crosshair");
}
}
|
Change some some syntax conventions.
|
Change some some syntax conventions.
|
C#
|
mit
|
Warhead-Entertainment/OpenWorld
|
b424d20f267b26104eca245cf1f3de926f29849b
|
osu.Game/Graphics/UserInterfaceV2/RoundedButton.cs
|
osu.Game/Graphics/UserInterfaceV2/RoundedButton.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
namespace osu.Game.Graphics.UserInterfaceV2
{
public class RoundedButton : OsuButton, IFilterable
{
public override float Height
{
get => base.Height;
set
{
base.Height = value;
if (IsLoaded)
updateCornerRadius();
}
}
[BackgroundDependencyLoader(true)]
private void load([CanBeNull] OverlayColourProvider overlayColourProvider, OsuColour colours)
{
BackgroundColour = overlayColourProvider?.Highlight1 ?? colours.Blue3;
}
protected override void LoadComplete()
{
base.LoadComplete();
updateCornerRadius();
}
private void updateCornerRadius() => Content.CornerRadius = DrawHeight / 2;
public virtual IEnumerable<string> FilterTerms => new[] { Text.ToString() };
public bool MatchingFilter
{
set => this.FadeTo(value ? 1 : 0);
}
public bool FilteringActive { get; set; }
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
using osuTK.Graphics;
namespace osu.Game.Graphics.UserInterfaceV2
{
public class RoundedButton : OsuButton, IFilterable
{
public override float Height
{
get => base.Height;
set
{
base.Height = value;
if (IsLoaded)
updateCornerRadius();
}
}
[BackgroundDependencyLoader(true)]
private void load([CanBeNull] OverlayColourProvider overlayColourProvider, OsuColour colours)
{
if (BackgroundColour == Color4.White)
BackgroundColour = overlayColourProvider?.Highlight1 ?? colours.Blue3;
}
protected override void LoadComplete()
{
base.LoadComplete();
updateCornerRadius();
}
private void updateCornerRadius() => Content.CornerRadius = DrawHeight / 2;
public virtual IEnumerable<string> FilterTerms => new[] { Text.ToString() };
public bool MatchingFilter
{
set => this.FadeTo(value ? 1 : 0);
}
public bool FilteringActive { get; set; }
}
}
|
Fix rounded buttons not allowing custom colour specifications
|
Fix rounded buttons not allowing custom colour specifications
|
C#
|
mit
|
NeoAdonis/osu,peppy/osu,peppy/osu,NeoAdonis/osu,NeoAdonis/osu,ppy/osu,ppy/osu,ppy/osu,peppy/osu
|
59e40904ad6d6cbd68f4c1c3eecda73a02973c03
|
samples/SampleApp/Startup.cs
|
samples/SampleApp/Startup.cs
|
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using System;
using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;
namespace SampleApp
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.Run(async context =>
{
Console.WriteLine("{0} {1}{2}{3}",
context.Request.Method,
context.Request.PathBase,
context.Request.Path,
context.Request.QueryString);
if (context.IsWebSocketRequest)
{
var webSocket = await context.AcceptWebSocketAsync();
await EchoAsync(webSocket);
}
else
{
context.Response.ContentLength = 11;
context.Response.ContentType = "text/plain";
await context.Response.WriteAsync("Hello world");
}
});
}
public async Task EchoAsync(WebSocket webSocket)
{
var buffer = new ArraySegment<byte>(new byte[8192]);
for (; ;)
{
var result = await webSocket.ReceiveAsync(
buffer,
CancellationToken.None);
if (result.MessageType == WebSocketMessageType.Close)
{
return;
}
else if (result.MessageType == WebSocketMessageType.Text)
{
Console.WriteLine("{0}", System.Text.Encoding.UTF8.GetString(buffer.Array, 0, result.Count));
}
await webSocket.SendAsync(
new ArraySegment<byte>(buffer.Array, 0, result.Count),
result.MessageType,
result.EndOfMessage,
CancellationToken.None);
}
}
}
}
|
using System;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
namespace SampleApp
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.Run(async context =>
{
Console.WriteLine("{0} {1}{2}{3}",
context.Request.Method,
context.Request.PathBase,
context.Request.Path,
context.Request.QueryString);
context.Response.ContentLength = 11;
context.Response.ContentType = "text/plain";
await context.Response.WriteAsync("Hello world");
});
}
}
}
|
Remove redundant websocket sample code.
|
Remove redundant websocket sample code.
|
C#
|
apache-2.0
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
283de80c77cfb08d2f1f381c5e75e6621f8b381d
|
osu.Framework/Input/UserInputManager.cs
|
osu.Framework/Input/UserInputManager.cs
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Event;
using osu.Framework.Input.Handlers;
using osu.Framework.Platform;
using OpenTK;
namespace osu.Framework.Input
{
public class UserInputManager : PassThroughInputManager
{
protected override IEnumerable<InputHandler> InputHandlers => Host.AvailableInputHandlers;
protected override bool HandleHoverEvents => Host.Window?.CursorInWindow ?? true;
public UserInputManager()
{
UseParentInput = false;
}
public override void HandleInputStateChange(InputStateChangeEvent inputStateChange)
{
if (inputStateChange is MousePositionChangeEvent mousePositionChange)
{
var mouse = mousePositionChange.InputState.Mouse;
// confine cursor
if (Host.Window != null && (Host.Window.CursorState & CursorState.Confined) > 0)
mouse.Position = Vector2.Clamp(mouse.Position, Vector2.Zero, new Vector2(Host.Window.Width, Host.Window.Height));
}
if (inputStateChange is MouseScrollChangeEvent)
{
if (Host.Window != null && !Host.Window.CursorInWindow) return;
}
base.HandleInputStateChange(inputStateChange);
}
}
}
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Event;
using osu.Framework.Input.Handlers;
using osu.Framework.Platform;
using OpenTK;
namespace osu.Framework.Input
{
public class UserInputManager : PassThroughInputManager
{
protected override IEnumerable<InputHandler> InputHandlers => Host.AvailableInputHandlers;
protected override bool HandleHoverEvents => Host.Window?.CursorInWindow ?? true;
public UserInputManager()
{
UseParentInput = false;
}
public override void HandleInputStateChange(InputStateChangeEvent inputStateChange)
{
switch (inputStateChange)
{
case MousePositionChangeEvent mousePositionChange:
var mouse = mousePositionChange.InputState.Mouse;
// confine cursor
if (Host.Window != null && (Host.Window.CursorState & CursorState.Confined) > 0)
mouse.Position = Vector2.Clamp(mouse.Position, Vector2.Zero, new Vector2(Host.Window.Width, Host.Window.Height));
break;
case MouseScrollChangeEvent _:
if (Host.Window != null && !Host.Window.CursorInWindow)
return;
break;
}
base.HandleInputStateChange(inputStateChange);
}
}
}
|
Use switch instead of ifs
|
Use switch instead of ifs
|
C#
|
mit
|
DrabWeb/osu-framework,smoogipooo/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,ppy/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,Tom94/osu-framework,ZLima12/osu-framework,peppy/osu-framework,ppy/osu-framework,DrabWeb/osu-framework,peppy/osu-framework
|
3538431784be41ddc2c2a22648924b2901527fb0
|
Zermelo.App.UWP/Schedule/ScheduleView.xaml.cs
|
Zermelo.App.UWP/Schedule/ScheduleView.xaml.cs
|
using System;
using System.Linq;
using Autofac;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace Zermelo.App.UWP.Schedule
{
public sealed partial class ScheduleView : Page
{
public ScheduleView()
{
this.InitializeComponent();
NavigationCacheMode = NavigationCacheMode.Enabled;
}
ScheduleViewModel _viewModel;
public ScheduleViewModel ViewModel => _viewModel ?? (_viewModel = (ScheduleViewModel)DataContext);
private void Page_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
CalendarView.SelectedDates.Add(ViewModel.Date);
}
private void ScheduleListView_ItemClick(object sender, ItemClickEventArgs e)
{
ViewModel.SelectedAppointment = e.ClickedItem as Appointment;
Modal.IsModal = true;
}
private void CalendarView_SelectedDatesChanged(CalendarView sender, CalendarViewSelectedDatesChangedEventArgs args)
{
if (args.AddedDates.Count > 0)
ViewModel.Date = args.AddedDates.FirstOrDefault();
else
CalendarView.SelectedDates.Add(ViewModel.Date);
}
private void CalendarView_CalendarViewDayItemChanging(CalendarView sender, CalendarViewDayItemChangingEventArgs args)
{
var day = args.Item.Date.DayOfWeek;
if (day == DayOfWeek.Saturday || day == DayOfWeek.Sunday)
args.Item.IsBlackout = true;
}
}
}
|
using System;
using System.Linq;
using Autofac;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace Zermelo.App.UWP.Schedule
{
public sealed partial class ScheduleView : Page
{
public ScheduleView()
{
this.InitializeComponent();
NavigationCacheMode = NavigationCacheMode.Enabled;
}
ScheduleViewModel _viewModel;
public ScheduleViewModel ViewModel => _viewModel ?? (_viewModel = (ScheduleViewModel)DataContext);
private void Page_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
if (CalendarView.SelectedDates.Count < 1)
CalendarView.SelectedDates.Add(ViewModel.Date);
}
private void ScheduleListView_ItemClick(object sender, ItemClickEventArgs e)
{
ViewModel.SelectedAppointment = e.ClickedItem as Appointment;
Modal.IsModal = true;
}
private void CalendarView_SelectedDatesChanged(CalendarView sender, CalendarViewSelectedDatesChangedEventArgs args)
{
if (args.AddedDates.Count > 0)
ViewModel.Date = args.AddedDates.FirstOrDefault();
else
CalendarView.SelectedDates.Add(ViewModel.Date);
}
private void CalendarView_CalendarViewDayItemChanging(CalendarView sender, CalendarViewDayItemChangingEventArgs args)
{
var day = args.Item.Date.DayOfWeek;
if (day == DayOfWeek.Saturday || day == DayOfWeek.Sunday)
args.Item.IsBlackout = true;
}
}
}
|
Fix crash when navigating back to ScheduleView
|
Fix crash when navigating back to ScheduleView
Because the Page got loaded, it tried to add the current date to CalendarView.SelectedDates, but since SelectionMode is set to a single item, it crashed when it loaded for the second time.
|
C#
|
mit
|
arthurrump/Zermelo.App.UWP
|
e2e703c2c298ca3fc32d5e305c266a0bec0adfbd
|
source/WsFed/Models/RelyingParty.cs
|
source/WsFed/Models/RelyingParty.cs
|
/*
* Copyright (c) Dominick Baier, Brock Allen. All rights reserved.
* see license
*/
using System.Collections.Generic;
namespace Thinktecture.IdentityServer.WsFed.Models
{
public class RelyingParty
{
public string Name { get; set; }
public bool Enabled { get; set; }
public string Realm { get; set; }
public string ReplyUrl { get; set; }
public string TokenType { get; set; }
public int TokenLifeTime { get; set; }
public Dictionary<string, string> ClaimMappings { get; set; }
}
}
|
/*
* Copyright (c) Dominick Baier, Brock Allen. All rights reserved.
* see license
*/
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
namespace Thinktecture.IdentityServer.WsFed.Models
{
public class RelyingParty
{
public string Name { get; set; }
public bool Enabled { get; set; }
public string Realm { get; set; }
public string ReplyUrl { get; set; }
public string TokenType { get; set; }
public int TokenLifeTime { get; set; }
public X509Certificate2 EncryptingCertificate { get; set; }
public Dictionary<string, string> ClaimMappings { get; set; }
}
}
|
Add encryption support to relying party model
|
Add encryption support to relying party model
|
C#
|
apache-2.0
|
bodell/IdentityServer3,codeice/IdentityServer3,18098924759/IdentityServer3,tbitowner/IdentityServer3,roflkins/IdentityServer3,iamkoch/IdentityServer3,ryanvgates/IdentityServer3,feanz/Thinktecture.IdentityServer.v3,remunda/IdentityServer3,kouweizhong/IdentityServer3,faithword/IdentityServer3,tonyeung/IdentityServer3,feanz/Thinktecture.IdentityServer.v3,iamkoch/IdentityServer3,faithword/IdentityServer3,roflkins/IdentityServer3,paulofoliveira/IdentityServer3,angelapper/IdentityServer3,codeice/IdentityServer3,bestwpw/IdentityServer3,delloncba/IdentityServer3,AscendXYZ/Thinktecture.IdentityServer.v3,IdentityServer/IdentityServer3,angelapper/IdentityServer3,openbizgit/IdentityServer3,johnkors/Thinktecture.IdentityServer.v3,wondertrap/IdentityServer3,SonOfSam/IdentityServer3,tonyeung/IdentityServer3,bestwpw/IdentityServer3,buddhike/IdentityServer3,Agrando/IdentityServer3,uoko-J-Go/IdentityServer,delRyan/IdentityServer3,bodell/IdentityServer3,buddhike/IdentityServer3,uoko-J-Go/IdentityServer,openbizgit/IdentityServer3,yanjustino/IdentityServer3,codeice/IdentityServer3,IdentityServer/IdentityServer3,jonathankarsh/IdentityServer3,remunda/IdentityServer3,maz100/Thinktecture.IdentityServer.v3,jackswei/IdentityServer3,ryanvgates/IdentityServer3,18098924759/IdentityServer3,johnkors/Thinktecture.IdentityServer.v3,olohmann/IdentityServer3,tuyndv/IdentityServer3,SonOfSam/IdentityServer3,jackswei/IdentityServer3,faithword/IdentityServer3,olohmann/IdentityServer3,chicoribas/IdentityServer3,delloncba/IdentityServer3,EternalXw/IdentityServer3,delloncba/IdentityServer3,wondertrap/IdentityServer3,paulofoliveira/IdentityServer3,maz100/Thinktecture.IdentityServer.v3,charoco/IdentityServer3,roflkins/IdentityServer3,delRyan/IdentityServer3,maz100/Thinktecture.IdentityServer.v3,Agrando/IdentityServer3,18098924759/IdentityServer3,jackswei/IdentityServer3,huoxudong125/Thinktecture.IdentityServer.v3,huoxudong125/Thinktecture.IdentityServer.v3,charoco/IdentityServer3,mvalipour/IdentityServer3,buddhike/IdentityServer3,kouweizhong/IdentityServer3,kouweizhong/IdentityServer3,SonOfSam/IdentityServer3,chicoribas/IdentityServer3,olohmann/IdentityServer3,IdentityServer/IdentityServer3,ryanvgates/IdentityServer3,mvalipour/IdentityServer3,AscendXYZ/Thinktecture.IdentityServer.v3,charoco/IdentityServer3,openbizgit/IdentityServer3,tuyndv/IdentityServer3,feanz/Thinktecture.IdentityServer.v3,iamkoch/IdentityServer3,tbitowner/IdentityServer3,EternalXw/IdentityServer3,yanjustino/IdentityServer3,yanjustino/IdentityServer3,remunda/IdentityServer3,wondertrap/IdentityServer3,angelapper/IdentityServer3,mvalipour/IdentityServer3,tonyeung/IdentityServer3,huoxudong125/Thinktecture.IdentityServer.v3,Agrando/IdentityServer3,tuyndv/IdentityServer3,jonathankarsh/IdentityServer3,bestwpw/IdentityServer3,chicoribas/IdentityServer3,uoko-J-Go/IdentityServer,delRyan/IdentityServer3,bodell/IdentityServer3,EternalXw/IdentityServer3,johnkors/Thinktecture.IdentityServer.v3,paulofoliveira/IdentityServer3,jonathankarsh/IdentityServer3,tbitowner/IdentityServer3
|
fc6548d87bb740c60dd2d3fe1b7dc7cba9ad3507
|
src/Umbraco.Core/Models/Entities/TreeEntityPath.cs
|
src/Umbraco.Core/Models/Entities/TreeEntityPath.cs
|
namespace Umbraco.Core.Models.Entities
{
/// <summary>
/// Represents the path of a tree entity.
/// </summary>
public class TreeEntityPath
{
/// <summary>
/// Gets or sets the identifier of the entity.
/// </summary>
public int Id { get; set; }
/// <summary>
/// Gets or sets the path of the entity.
/// </summary>
public string Path { get; set; }
}
}
|
namespace Umbraco.Core.Models.Entities
{
/// <summary>
/// Represents the path of a tree entity.
/// </summary>
public class TreeEntityPath
{
/// <summary>
/// Gets or sets the identifier of the entity.
/// </summary>
public int Id { get; set; }
/// <summary>
/// Gets or sets the path of the entity.
/// </summary>
public string Path { get; set; }
/// <summary>
/// Proxy of the Id
/// </summary>
public int NodeId
{
get => Id;
set => Id = value;
}
}
}
|
Fix issue where Id was not set when loading all entity paths
|
Fix issue where Id was not set when loading all entity paths
|
C#
|
mit
|
JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,hfloyd/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,NikRimington/Umbraco-CMS,marcemarc/Umbraco-CMS,tcmorris/Umbraco-CMS,rasmuseeg/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,KevinJump/Umbraco-CMS,madsoulswe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,tcmorris/Umbraco-CMS,abryukhov/Umbraco-CMS,leekelleher/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abryukhov/Umbraco-CMS,tcmorris/Umbraco-CMS,hfloyd/Umbraco-CMS,dawoe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abryukhov/Umbraco-CMS,NikRimington/Umbraco-CMS,tcmorris/Umbraco-CMS,mattbrailsford/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,madsoulswe/Umbraco-CMS,leekelleher/Umbraco-CMS,arknu/Umbraco-CMS,abryukhov/Umbraco-CMS,arknu/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,robertjf/Umbraco-CMS,madsoulswe/Umbraco-CMS,umbraco/Umbraco-CMS,umbraco/Umbraco-CMS,bjarnef/Umbraco-CMS,abjerner/Umbraco-CMS,umbraco/Umbraco-CMS,dawoe/Umbraco-CMS,marcemarc/Umbraco-CMS,bjarnef/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,KevinJump/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abjerner/Umbraco-CMS,arknu/Umbraco-CMS,bjarnef/Umbraco-CMS,leekelleher/Umbraco-CMS,abjerner/Umbraco-CMS,mattbrailsford/Umbraco-CMS,KevinJump/Umbraco-CMS,arknu/Umbraco-CMS,tcmorris/Umbraco-CMS,NikRimington/Umbraco-CMS,marcemarc/Umbraco-CMS,rasmuseeg/Umbraco-CMS,hfloyd/Umbraco-CMS,abjerner/Umbraco-CMS,rasmuseeg/Umbraco-CMS,bjarnef/Umbraco-CMS,marcemarc/Umbraco-CMS,hfloyd/Umbraco-CMS,dawoe/Umbraco-CMS,leekelleher/Umbraco-CMS,marcemarc/Umbraco-CMS,umbraco/Umbraco-CMS,leekelleher/Umbraco-CMS
|
866725d9d00d6a50b07964426b0c53672f3ea94f
|
src/Kernel32.Desktop/Kernel32+CHAR_INFO_ENCODING.cs
|
src/Kernel32.Desktop/Kernel32+CHAR_INFO_ENCODING.cs
|
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
namespace PInvoke
{
using System.Runtime.InteropServices;
/// <content>
/// Contains the <see cref="CHAR_INFO_ENCODING"/> nested type.
/// </content>
public partial class Kernel32
{
/// <summary>
/// A union of the Unicode and Ascii encodings.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public struct CHAR_INFO_ENCODING
{
/// <summary>
/// Unicode character of a screen buffer character cell.
/// </summary>
[FieldOffset(0)]
public ushort UnicodeChar;
/// <summary>
/// ANSI character of a screen buffer character cell.
/// </summary>
[FieldOffset(0)]
public byte AsciiChar;
}
}
}
|
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
namespace PInvoke
{
using System.Runtime.InteropServices;
/// <content>
/// Contains the <see cref="CHAR_INFO_ENCODING"/> nested type.
/// </content>
public partial class Kernel32
{
/// <summary>
/// A union of the Unicode and Ascii encodings.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public struct CHAR_INFO_ENCODING
{
/// <summary>
/// Unicode character of a screen buffer character cell.
/// </summary>
[FieldOffset(0)]
public char UnicodeChar;
/// <summary>
/// ANSI character of a screen buffer character cell.
/// </summary>
[FieldOffset(0)]
public byte AsciiChar;
}
}
}
|
Use 'char' instead of 'ushort' for unicode character
|
Use 'char' instead of 'ushort' for unicode character
|
C#
|
mit
|
jmelosegui/pinvoke,vbfox/pinvoke,AArnott/pinvoke
|
0e6a3ae392fbb2b2b723426a85664b016310004a
|
src/Views/Articles/Index.cshtml
|
src/Views/Articles/Index.cshtml
|
@{
ViewData["Title"] = "List of Articles I've Written";
}
<h1 id="page_title">Articles I've written</h1>
<div class="centered_wrapper">
<input type="text" class="search" placeholder="Filter by title/tag">
<article>
<p class="date">Monday Aug 28</p>
<h2><a href="#">Change Kestrel default url on Asp Net Core</a></h2>
<div class="tags">
<a href="#">asp net core</a>
<a href="#">asp net core</a>
<a href="#">asp net core</a>
</div>
<hr>
</article>
<article>
<p class="date">Monday Aug 28</p>
<h2><a href="#">Change Kestrel default url on Asp Net Core</a></h2>
<div class="tags">
<a href="#">asp net core</a>
<a href="#">asp net core</a>
<a href="#">asp net core</a>
</div>
<hr>
</article>
<article>
<p class="date">Monday Aug 28</p>
<h2><a href="#">Change Kestrel default url on Asp Net Core</a></h2>
<div class="tags">
<a href="#">asp net core</a>
<a href="#">asp net core</a>
<a href="#">asp net core</a>
</div>
<hr>
</article>
<article>
<p class="date">Monday Aug 28</p>
<h2><a href="#">Change Kestrel default url on Asp Net Core</a></h2>
<div class="tags">
<a href="#">asp net core</a>
<a href="#">asp net core</a>
<a href="#">asp net core</a>
</div>
<hr>
</article>
</div>
<div class="pagination">
<span class="previous_page disabled">Previous</span>
<span class="current">1</span>
<a href="#" rel="next">2</a>
<a href="#" class="next_page">Next</a>
</div>
|
@model IEnumerable<ArticleModel>
@{
ViewData["Title"] = "List of Articles I've Written";
}
<h1 id="page_title">Articles I've written</h1>
<div class="centered_wrapper">
<input type="text" class="search" placeholder="Filter by title/tag">
@foreach (var article in Model)
{
<article>
<p class="date">@article.FormattedPublishedAt()</p>
<h2><a href="@article.Link" target="_blank">@article.Title</a></h2>
<div class="tags">
@foreach (var tag in article.Tags)
{
<a href="#">@tag</a>
}
</div>
<hr>
</article>
}
</div>
<!--<div class="pagination">
<span class="previous_page disabled">Previous</span>
<span class="current">1</span>
<a href="#" rel="next">2</a>
<a href="#" class="next_page">Next</a>
</div>-->
|
Change static content to dynamic
|
Change static content to dynamic
|
C#
|
mit
|
AustinFelipe/website,AustinFelipe/website,AustinFelipe/website
|
e94ca287a510428f0f462b658c03cbbd28773af9
|
DynamixelServo.Quadruped/BasicQuadrupedGaitEngine.cs
|
DynamixelServo.Quadruped/BasicQuadrupedGaitEngine.cs
|
using System;
using System.Numerics;
namespace DynamixelServo.Quadruped
{
public class BasicQuadrupedGaitEngine : QuadrupedGaitEngine
{
private const int Speed = 10;
private const int MaxForward = 5;
private const int MinForward = -5;
private const int LegDistance = 15;
private const int LegHeight = -13;
private bool _movingForward;
private Vector3 _lastWrittenPosition = Vector3.Zero;
public BasicQuadrupedGaitEngine(QuadrupedIkDriver driver) : base(driver)
{
Driver.Setup();
Driver.StandUpfromGround();
StartEngine();
}
protected override void EngineSpin()
{
var translate = Vector3.Zero;
if (_movingForward)
{
translate.Y += Speed * 0.001f * TimeSincelastTick;
}
else
{
translate.Y -= Speed * 0.001f * TimeSincelastTick;
}
_lastWrittenPosition += translate;
if (_movingForward && _lastWrittenPosition.Y > MaxForward)
{
_movingForward = false;
}
else if (!_movingForward && _lastWrittenPosition.Y < MinForward)
{
_movingForward = true;
}
Driver.MoveAbsoluteCenterMass(_lastWrittenPosition, LegDistance, LegHeight);
}
}
}
|
using System;
using System.Numerics;
namespace DynamixelServo.Quadruped
{
public class BasicQuadrupedGaitEngine : QuadrupedGaitEngine
{
private const int Speed = 12;
private int _currentIndex;
private readonly Vector3[] _positions =
{
new Vector3(-5, 5, 3),
new Vector3(5, 5, -3),
new Vector3(5, -5, 3),
new Vector3(-5, -5, -3)
};
private const float LegHeight = -11f;
private const int LegDistance = 15;
private Vector3 _lastWrittenPosition = Vector3.Zero;
public BasicQuadrupedGaitEngine(QuadrupedIkDriver driver) : base(driver)
{
Driver.Setup();
Driver.StandUpfromGround();
StartEngine();
}
protected override void EngineSpin()
{
if (_lastWrittenPosition.Similar(_positions[_currentIndex], 0.25f))
{
_currentIndex++;
if (_currentIndex >= _positions.Length)
{
_currentIndex = 0;
}
}
_lastWrittenPosition =
_lastWrittenPosition.MoveTowards(_positions[_currentIndex], Speed * 0.001f * TimeSincelastTick);
Driver.MoveAbsoluteCenterMass(_lastWrittenPosition, LegDistance, LegHeight);
}
}
}
|
Add simple interpolated motion driver
|
Add simple interpolated motion driver
|
C#
|
apache-2.0
|
dmweis/DynamixelServo,dmweis/DynamixelServo,dmweis/DynamixelServo,dmweis/DynamixelServo
|
b519218f55efce641b7053140a9caa60c6ac89fc
|
AnimalHope/AnimalHope.Web/App_Start/FilterConfig.cs
|
AnimalHope/AnimalHope.Web/App_Start/FilterConfig.cs
|
namespace AnimalHope.Web
{
using System.Web;
using System.Web.Mvc;
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
|
namespace AnimalHope.Web
{
using System.Web;
using System.Web.Mvc;
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
filters.Add(new ValidateInputAttribute(false));
}
}
}
|
Handle correctly the special HTML characters and tags
|
Handle correctly the special HTML characters and tags
|
C#
|
mit
|
juliameleshko/AnimalHope,juliameleshko/AnimalHope
|
5f86239652cb97aeddff4e9d07b8dd13736fa5b8
|
src/CommonBotLibrary/Services/Models/RedditResult.cs
|
src/CommonBotLibrary/Services/Models/RedditResult.cs
|
using System.Diagnostics;
using CommonBotLibrary.Interfaces.Models;
using RedditSharp.Things;
namespace CommonBotLibrary.Services.Models
{
[DebuggerDisplay("{Url, nq}")]
public class RedditResult : IWebpage
{
public RedditResult(Post post)
{
Title = post.Title;
Url = post.Url.OriginalString;
Post = post;
}
/// <summary>
/// The wrapped model returned by RedditSharp with more submission props.
/// </summary>
public Post Post { get; }
public string Url { get; set; }
public string Title { get; set; }
public static implicit operator Post(RedditResult redditResult)
=> redditResult.Post;
public enum PostCategory
{
New,
Controversial,
Rising,
Hot,
Top
}
}
}
|
using System.Diagnostics;
using CommonBotLibrary.Interfaces.Models;
using RedditSharp.Things;
namespace CommonBotLibrary.Services.Models
{
[DebuggerDisplay("{Url, nq}")]
public class RedditResult : IWebpage
{
public RedditResult(Post post)
{
Title = post.Title;
Url = post.Url.OriginalString;
Post = post;
}
/// <summary>
/// The wrapped model returned by RedditSharp with more submission props.
/// </summary>
public Post Post { get; }
public string Url { get; set; }
public string Title { get; set; }
public static implicit operator Post(RedditResult redditResult)
=> redditResult.Post;
public enum PostCategory
{
Hot,
New,
Controversial,
Rising,
Top
}
}
}
|
Make Hot the default reddit post category
|
Make Hot the default reddit post category
|
C#
|
mit
|
bcanseco/common-bot-library,bcanseco/common-bot-library
|
560f075321ab6fa570a24f0bdf1c4a4a6da0d49d
|
src/EditorFeatures/TestUtilities/Async/WaitHelper.cs
|
src/EditorFeatures/TestUtilities/Async/WaitHelper.cs
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
namespace Roslyn.Test.Utilities
{
public static class WaitHelper
{
public static void WaitForDispatchedOperationsToComplete(DispatcherPriority priority)
{
new FrameworkElement().Dispatcher.DoEvents();
}
public static void PumpingWait(this Task task)
{
PumpingWaitAll(new[] { task });
}
public static T PumpingWaitResult<T>(this Task<T> task)
{
PumpingWait(task);
return task.Result;
}
public static void PumpingWaitAll(this IEnumerable<Task> tasks)
{
var smallTimeout = TimeSpan.FromMilliseconds(10);
var taskArray = tasks.ToArray();
var done = false;
while (!done)
{
done = Task.WaitAll(taskArray, smallTimeout);
if (!done)
{
WaitForDispatchedOperationsToComplete(DispatcherPriority.ApplicationIdle);
}
}
foreach (var task in tasks)
{
if (task.Exception != null)
{
throw task.Exception;
}
}
}
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
namespace Roslyn.Test.Utilities
{
public static class WaitHelper
{
public static void WaitForDispatchedOperationsToComplete(DispatcherPriority priority)
{
Action action = delegate { };
new FrameworkElement().Dispatcher.Invoke(action, priority);
}
public static void PumpingWait(this Task task)
{
PumpingWaitAll(new[] { task });
}
public static T PumpingWaitResult<T>(this Task<T> task)
{
PumpingWait(task);
return task.Result;
}
public static void PumpingWaitAll(this IEnumerable<Task> tasks)
{
var smallTimeout = TimeSpan.FromMilliseconds(10);
var taskArray = tasks.ToArray();
var done = false;
while (!done)
{
done = Task.WaitAll(taskArray, smallTimeout);
if (!done)
{
WaitForDispatchedOperationsToComplete(DispatcherPriority.ApplicationIdle);
}
}
foreach (var task in tasks)
{
if (task.Exception != null)
{
throw task.Exception;
}
}
}
}
}
|
Revert change to pump in the wrong spot.
|
Revert change to pump in the wrong spot.
|
C#
|
mit
|
amcasey/roslyn,Pvlerick/roslyn,nguerrera/roslyn,a-ctor/roslyn,oocx/roslyn,orthoxerox/roslyn,dotnet/roslyn,OmarTawfik/roslyn,DustinCampbell/roslyn,dotnet/roslyn,jhendrixMSFT/roslyn,zooba/roslyn,AArnott/roslyn,mattwar/roslyn,bartdesmet/roslyn,CaptainHayashi/roslyn,srivatsn/roslyn,wvdd007/roslyn,khellang/roslyn,Shiney/roslyn,bbarry/roslyn,mavasani/roslyn,MattWindsor91/roslyn,bkoelman/roslyn,MattWindsor91/roslyn,orthoxerox/roslyn,jbhensley/roslyn,basoundr/roslyn,mseamari/Stuff,stephentoub/roslyn,sharwell/roslyn,aelij/roslyn,swaroop-sridhar/roslyn,wvdd007/roslyn,dpoeschl/roslyn,michalhosala/roslyn,Hosch250/roslyn,antonssonj/roslyn,Hosch250/roslyn,genlu/roslyn,jeffanders/roslyn,zooba/roslyn,thomaslevesque/roslyn,Inverness/roslyn,VPashkov/roslyn,jmarolf/roslyn,ljw1004/roslyn,bbarry/roslyn,mseamari/Stuff,jaredpar/roslyn,brettfo/roslyn,AnthonyDGreen/roslyn,sharadagrawal/Roslyn,Maxwe11/roslyn,danielcweber/roslyn,MichalStrehovsky/roslyn,danielcweber/roslyn,tvand7093/roslyn,sharwell/roslyn,amcasey/roslyn,ErikSchierboom/roslyn,MatthieuMEZIL/roslyn,sharwell/roslyn,natgla/roslyn,lorcanmooney/roslyn,Maxwe11/roslyn,tmeschter/roslyn,CaptainHayashi/roslyn,KevinRansom/roslyn,jhendrixMSFT/roslyn,Pvlerick/roslyn,jeffanders/roslyn,jkotas/roslyn,wvdd007/roslyn,davkean/roslyn,Shiney/roslyn,AlekseyTs/roslyn,CyrusNajmabadi/roslyn,AArnott/roslyn,swaroop-sridhar/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,ErikSchierboom/roslyn,robinsedlaczek/roslyn,diryboy/roslyn,tmat/roslyn,budcribar/roslyn,pdelvo/roslyn,ljw1004/roslyn,ErikSchierboom/roslyn,KiloBravoLima/roslyn,tmat/roslyn,tmat/roslyn,sharadagrawal/Roslyn,amcasey/roslyn,oocx/roslyn,AnthonyDGreen/roslyn,budcribar/roslyn,antonssonj/roslyn,leppie/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,weltkante/roslyn,heejaechang/roslyn,DustinCampbell/roslyn,HellBrick/roslyn,dpoeschl/roslyn,pdelvo/roslyn,cston/roslyn,mattscheffer/roslyn,bbarry/roslyn,stephentoub/roslyn,rgani/roslyn,mgoertz-msft/roslyn,moozzyk/roslyn,TyOverby/roslyn,reaction1989/roslyn,natidea/roslyn,srivatsn/roslyn,xasx/roslyn,VSadov/roslyn,AmadeusW/roslyn,srivatsn/roslyn,heejaechang/roslyn,basoundr/roslyn,thomaslevesque/roslyn,KirillOsenkov/roslyn,shyamnamboodiripad/roslyn,balajikris/roslyn,ValentinRueda/roslyn,drognanar/roslyn,ericfe-ms/roslyn,aelij/roslyn,natidea/roslyn,KevinRansom/roslyn,yeaicc/roslyn,agocke/roslyn,xoofx/roslyn,agocke/roslyn,nguerrera/roslyn,MattWindsor91/roslyn,mattwar/roslyn,khyperia/roslyn,jasonmalinowski/roslyn,diryboy/roslyn,leppie/roslyn,tannergooding/roslyn,a-ctor/roslyn,mmitche/roslyn,KevinH-MS/roslyn,agocke/roslyn,bkoelman/roslyn,mattscheffer/roslyn,tmeschter/roslyn,ljw1004/roslyn,aelij/roslyn,jasonmalinowski/roslyn,kelltrick/roslyn,vcsjones/roslyn,jcouv/roslyn,mgoertz-msft/roslyn,KevinH-MS/roslyn,MattWindsor91/roslyn,davkean/roslyn,HellBrick/roslyn,jamesqo/roslyn,cston/roslyn,jcouv/roslyn,vslsnap/roslyn,danielcweber/roslyn,physhi/roslyn,TyOverby/roslyn,MatthieuMEZIL/roslyn,aanshibudhiraja/Roslyn,robinsedlaczek/roslyn,VPashkov/roslyn,tmeschter/roslyn,KevinRansom/roslyn,stephentoub/roslyn,MichalStrehovsky/roslyn,davkean/roslyn,balajikris/roslyn,Inverness/roslyn,managed-commons/roslyn,VPashkov/roslyn,VSadov/roslyn,MichalStrehovsky/roslyn,akrisiun/roslyn,jmarolf/roslyn,sharadagrawal/Roslyn,brettfo/roslyn,mattwar/roslyn,mavasani/roslyn,tvand7093/roslyn,weltkante/roslyn,ValentinRueda/roslyn,tvand7093/roslyn,gafter/roslyn,natgla/roslyn,SeriaWei/roslyn,jmarolf/roslyn,Giftednewt/roslyn,yeaicc/roslyn,cston/roslyn,gafter/roslyn,eriawan/roslyn,KirillOsenkov/roslyn,khyperia/roslyn,kelltrick/roslyn,CyrusNajmabadi/roslyn,jaredpar/roslyn,shyamnamboodiripad/roslyn,brettfo/roslyn,ericfe-ms/roslyn,oocx/roslyn,jeffanders/roslyn,abock/roslyn,AnthonyDGreen/roslyn,AlekseyTs/roslyn,CaptainHayashi/roslyn,drognanar/roslyn,natgla/roslyn,nguerrera/roslyn,physhi/roslyn,paulvanbrenk/roslyn,bartdesmet/roslyn,rgani/roslyn,DustinCampbell/roslyn,AmadeusW/roslyn,jcouv/roslyn,khyperia/roslyn,AlekseyTs/roslyn,natidea/roslyn,jamesqo/roslyn,mgoertz-msft/roslyn,xasx/roslyn,xasx/roslyn,dpoeschl/roslyn,akrisiun/roslyn,OmarTawfik/roslyn,genlu/roslyn,VSadov/roslyn,eriawan/roslyn,paulvanbrenk/roslyn,lorcanmooney/roslyn,bkoelman/roslyn,xoofx/roslyn,antonssonj/roslyn,tannergooding/roslyn,OmarTawfik/roslyn,reaction1989/roslyn,jkotas/roslyn,dotnet/roslyn,aanshibudhiraja/Roslyn,lorcanmooney/roslyn,MatthieuMEZIL/roslyn,aanshibudhiraja/Roslyn,kelltrick/roslyn,AArnott/roslyn,Giftednewt/roslyn,abock/roslyn,HellBrick/roslyn,a-ctor/roslyn,yeaicc/roslyn,TyOverby/roslyn,ValentinRueda/roslyn,eriawan/roslyn,heejaechang/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,KiloBravoLima/roslyn,mattscheffer/roslyn,xoofx/roslyn,managed-commons/roslyn,gafter/roslyn,jbhensley/roslyn,rgani/roslyn,vcsjones/roslyn,moozzyk/roslyn,leppie/roslyn,swaroop-sridhar/roslyn,Shiney/roslyn,zooba/roslyn,physhi/roslyn,tannergooding/roslyn,vslsnap/roslyn,AmadeusW/roslyn,basoundr/roslyn,Pvlerick/roslyn,orthoxerox/roslyn,vcsjones/roslyn,Giftednewt/roslyn,jaredpar/roslyn,jkotas/roslyn,panopticoncentral/roslyn,KevinH-MS/roslyn,mavasani/roslyn,SeriaWei/roslyn,jamesqo/roslyn,robinsedlaczek/roslyn,ericfe-ms/roslyn,paulvanbrenk/roslyn,shyamnamboodiripad/roslyn,balajikris/roslyn,Maxwe11/roslyn,akrisiun/roslyn,CyrusNajmabadi/roslyn,budcribar/roslyn,diryboy/roslyn,mmitche/roslyn,Hosch250/roslyn,michalhosala/roslyn,panopticoncentral/roslyn,khellang/roslyn,jbhensley/roslyn,drognanar/roslyn,KiloBravoLima/roslyn,KirillOsenkov/roslyn,mseamari/Stuff,jhendrixMSFT/roslyn,jasonmalinowski/roslyn,genlu/roslyn,vslsnap/roslyn,weltkante/roslyn,managed-commons/roslyn,bartdesmet/roslyn,SeriaWei/roslyn,panopticoncentral/roslyn,pdelvo/roslyn,khellang/roslyn,Inverness/roslyn,thomaslevesque/roslyn,michalhosala/roslyn,moozzyk/roslyn,abock/roslyn,reaction1989/roslyn,mmitche/roslyn
|
f1742412956ea5c1b17a181560240924d332fbb9
|
src/AppHarbor/Program.cs
|
src/AppHarbor/Program.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.Windsor;
namespace AppHarbor
{
class Program
{
static void Main(string[] args)
{
var container = new WindsorContainer()
.Install(new AppHarborInstaller());
var commandDispatcher = container.Resolve<CommandDispatcher>();
try
{
commandDispatcher.Dispatch(args);
}
catch (DispatchException exception)
{
Console.WriteLine();
Console.WriteLine("Error: {0}", exception.Message);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.Windsor;
namespace AppHarbor
{
class Program
{
static void Main(string[] args)
{
var container = new WindsorContainer()
.Install(new AppHarborInstaller());
var commandDispatcher = container.Resolve<CommandDispatcher>();
try
{
commandDispatcher.Dispatch(args);
}
catch (DispatchException exception)
{
Console.WriteLine();
using (new ForegroundColor(ConsoleColor.Red))
{
Console.WriteLine("Error: {0}", exception.Message);
}
}
}
}
}
|
Use red color when outputting error message
|
Use red color when outputting error message
|
C#
|
mit
|
appharbor/appharbor-cli
|
121b0018c2fd4c011271363dca84d9fcd82bcf71
|
NBi.UI.Genbi/View/TestSuiteGenerator/SettingsControl.cs
|
NBi.UI.Genbi/View/TestSuiteGenerator/SettingsControl.cs
|
using System;
using System.Linq;
using System.Windows.Forms;
using NBi.UI.Genbi.Presenter;
namespace NBi.UI.Genbi.View.TestSuiteGenerator
{
public partial class SettingsControl : UserControl
{
public SettingsControl()
{
InitializeComponent();
}
internal void DataBind(SettingsPresenter presenter)
{
if (presenter != null)
{
settingsName.DataSource = presenter.SettingsNames;
settingsName.DataBindings.Add("SelectedItem", presenter, "SettingsNameSelected", true, DataSourceUpdateMode.OnValidation);
settingsName.SelectedIndexChanged += (s, args) => settingsName.DataBindings["SelectedItem"].WriteValue();
settingsValue.DataBindings.Add("Text", presenter, "SettingsValue", true, DataSourceUpdateMode.OnPropertyChanged);
}
}
public Button AddCommand
{
get {return addReference;}
}
public Button RemoveCommand
{
get { return removeReference; }
}
}
}
|
using System;
using System.Linq;
using System.Windows.Forms;
using NBi.UI.Genbi.Presenter;
namespace NBi.UI.Genbi.View.TestSuiteGenerator
{
public partial class SettingsControl : UserControl
{
public SettingsControl()
{
InitializeComponent();
}
internal void DataBind(SettingsPresenter presenter)
{
if (presenter != null)
{
settingsName.DataSource = presenter.SettingsNames;
settingsName.DataBindings.Add("SelectedItem", presenter, "SettingsNameSelected", true, DataSourceUpdateMode.OnValidation);
settingsName.SelectedIndexChanged += (s, args) => settingsName.DataBindings["SelectedItem"].WriteValue();
settingsValue.TextChanged += (s, args) => presenter.UpdateValue((string)settingsName.SelectedValue, settingsValue.Text);
settingsValue.DataBindings.Add("Text", presenter, "SettingsValue", true, DataSourceUpdateMode.OnPropertyChanged);
}
}
private void toto(object s, EventArgs args)
{
MessageBox.Show("Hello");
}
public Button AddCommand
{
get {return addReference;}
}
public Button RemoveCommand
{
get { return removeReference; }
}
}
}
|
Fix issue that the changes to the connection strings were not registered before you're changing the focus to another connection string.
|
Fix issue that the changes to the connection strings were not registered before you're changing the focus to another connection string.
|
C#
|
apache-2.0
|
Seddryck/NBi,Seddryck/NBi
|
17277e2abedfb58aa5b09139326b59e4c7542f42
|
Assets/MixedRealityToolkit.Examples/Demos/Input/Scenes/PrimaryPointer/PrimaryPointerHandlerExample.cs
|
Assets/MixedRealityToolkit.Examples/Demos/Input/Scenes/PrimaryPointer/PrimaryPointerHandlerExample.cs
|
using System;
using Microsoft.MixedReality.Toolkit;
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine;
// Simple example script that subscribes to primary pointer changes and applies a cursor highlight to the current one.
public class PrimaryPointerHandlerExample : MonoBehaviour
{
public GameObject CursorHighlight;
private void OnEnable()
{
MixedRealityToolkit.InputSystem?.FocusProvider?.SubscribeToPrimaryPointerChanged(OnPrimaryPointerChanged, true);
}
private void OnPrimaryPointerChanged(IMixedRealityPointer oldPointer, IMixedRealityPointer newPointer)
{
if (CursorHighlight != null)
{
if (newPointer != null)
{
Transform parentTransform = newPointer.BaseCursor?.GameObjectReference?.transform;
// If there's no cursor try using the controller pointer transform instead
if (parentTransform == null)
{
var controllerPointer = newPointer as BaseControllerPointer;
parentTransform = controllerPointer?.transform;
}
if (parentTransform != null)
{
CursorHighlight.transform.SetParent(parentTransform, false);
CursorHighlight.SetActive(true);
return;
}
}
CursorHighlight.SetActive(false);
CursorHighlight.transform.SetParent(null, false);
}
}
private void OnDisable()
{
MixedRealityToolkit.InputSystem?.FocusProvider?.UnsubscribeFromPrimaryPointerChanged(OnPrimaryPointerChanged);
OnPrimaryPointerChanged(null, null);
}
}
|
using Microsoft.MixedReality.Toolkit;
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Examples.Demos
{
// Simple example script that subscribes to primary pointer changes and applies a cursor highlight to the current one.
public class PrimaryPointerHandlerExample : MonoBehaviour
{
public GameObject CursorHighlight;
private void OnEnable()
{
MixedRealityToolkit.InputSystem?.FocusProvider?.SubscribeToPrimaryPointerChanged(OnPrimaryPointerChanged, true);
}
private void OnPrimaryPointerChanged(IMixedRealityPointer oldPointer, IMixedRealityPointer newPointer)
{
if (CursorHighlight != null)
{
if (newPointer != null)
{
Transform parentTransform = newPointer.BaseCursor?.GameObjectReference?.transform;
// If there's no cursor try using the controller pointer transform instead
if (parentTransform == null)
{
var controllerPointer = newPointer as BaseControllerPointer;
parentTransform = controllerPointer?.transform;
}
if (parentTransform != null)
{
CursorHighlight.transform.SetParent(parentTransform, false);
CursorHighlight.SetActive(true);
return;
}
}
CursorHighlight.SetActive(false);
CursorHighlight.transform.SetParent(null, false);
}
}
private void OnDisable()
{
MixedRealityToolkit.InputSystem?.FocusProvider?.UnsubscribeFromPrimaryPointerChanged(OnPrimaryPointerChanged);
OnPrimaryPointerChanged(null, null);
}
}
}
|
Fix the broken NuGet build.
|
Fix the broken NuGet build.
It's been a few days of us not building NuGet packages - here's what happened.
We hit a CI outage earlier in the week caused by an upstream Azure DevOps issue (a bad nuget push package was pushed out). Our build was broken for a couple of days, during which we still had changes going in (mostly we were judging by green-ness of mrtk_pr, which is identical to CI except it doesn't produce and publish NuGet packages).
The problem is, without coverage on the NuGet building, we didn't know that we broke the nuget packages until the upstream nuget push package got fixed.
This fix in particular is simply because the asset retargeter assumes that every single class/object in the MRTK is prefixed by the MRTK namespace. This is a fairly reasonable assumption to make, and it throws when it finds something that violates it (so that we can then fix it)
I will follow up here and do work to make sure that the build breaks when this happens, instead of just showing warnings.
|
C#
|
mit
|
killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity
|
2a4406cdae3bff53430d2dac034aa9bd0ed04c02
|
Mollie.Api/Models/Payment/PaymentMethod.cs
|
Mollie.Api/Models/Payment/PaymentMethod.cs
|
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Mollie.Api.Models.Payment {
[JsonConverter(typeof(StringEnumConverter))]
public enum PaymentMethod {
[EnumMember(Value = "ideal")] Ideal,
[EnumMember(Value = "creditcard")] CreditCard,
[EnumMember(Value = "mistercash")] MisterCash,
[EnumMember(Value = "sofort")] Sofort,
[EnumMember(Value = "banktransfer")] BankTransfer,
[EnumMember(Value = "directdebit")] DirectDebit,
[EnumMember(Value = "belfius")] Belfius,
[EnumMember(Value = "bitcoin")] Bitcoin,
[EnumMember(Value = "podiumcadeaukaart")] PodiumCadeaukaart,
[EnumMember(Value = "paypal")] PayPal,
[EnumMember(Value = "paysafecard")] PaySafeCard,
[EnumMember(Value = "kbc")] Kbc,
[EnumMember(Value = "giftcard")] GiftCard,
[EnumMember(Value = "inghomepay")] IngHomePay,
}
}
|
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Mollie.Api.Models.Payment {
[JsonConverter(typeof(StringEnumConverter))]
public enum PaymentMethod {
[EnumMember(Value = "ideal")] Ideal,
[EnumMember(Value = "creditcard")] CreditCard,
[EnumMember(Value = "mistercash")] MisterCash,
[EnumMember(Value = "sofort")] Sofort,
[EnumMember(Value = "banktransfer")] BankTransfer,
[EnumMember(Value = "directdebit")] DirectDebit,
[EnumMember(Value = "belfius")] Belfius,
[EnumMember(Value = "bitcoin")] Bitcoin,
[EnumMember(Value = "podiumcadeaukaart")] PodiumCadeaukaart,
[EnumMember(Value = "paypal")] PayPal,
[EnumMember(Value = "paysafecard")] PaySafeCard,
[EnumMember(Value = "kbc")] Kbc,
[EnumMember(Value = "giftcard")] GiftCard,
[EnumMember(Value = "inghomepay")] IngHomePay,
[EnumMember(Value = "refund")] Refund,
}
}
|
Add Refund as paymentmethod so we can use it in SettlementPeriodRevenue.
|
Add Refund as paymentmethod so we can use it in SettlementPeriodRevenue.
|
C#
|
mit
|
Viincenttt/MollieApi,Viincenttt/MollieApi
|
fe825029b472249f39d7afd1c6a899b7680be56a
|
KenticoInspector.WebApplication/Startup.cs
|
KenticoInspector.WebApplication/Startup.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace KenticoInspector.WebApplication
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseMvc();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace KenticoInspector.WebApplication
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
services.AddSpaStaticFiles(configuration => {
configuration.RootPath = "ClientApp/dist";
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseSpaStaticFiles();
app.UseMvc();
app.UseSpa(spa => {
spa.Options.SourcePath = "ClientApp";
//if (env.IsDevelopment()) {
// spa.UseProxyToSpaDevelopmentServer("http://localhost:1234");
//}
});
}
}
}
|
Add basics to load compiled client app
|
Add basics to load compiled client app
|
C#
|
mit
|
ChristopherJennings/KInspector,ChristopherJennings/KInspector,ChristopherJennings/KInspector,ChristopherJennings/KInspector,Kentico/KInspector,Kentico/KInspector,Kentico/KInspector,Kentico/KInspector
|
ddbff6c3af36c4287ab97303072b81c73a8dffe2
|
Kudu.Services.Web/Detectors/Default.cshtml
|
Kudu.Services.Web/Detectors/Default.cshtml
|
@{
var ownerName = Environment.GetEnvironmentVariable("WEBSITE_OWNER_NAME") ?? "";
var subscriptionId = ownerName;
var resourceGroup = Environment.GetEnvironmentVariable("WEBSITE_RESOURCE_GROUP") ?? "";
var siteName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME") ?? "";
var index = ownerName.IndexOf('+');
if (index >= 0)
{
subscriptionId = ownerName.Substring(0, index);
}
string detectorPath;
if (Kudu.Core.Helpers.OSDetector.IsOnWindows())
{
detectorPath = "diagnostics%2Favailability%2Fanalysis";
}
else
{
detectorPath = "detectors%2FLinuxAppDown";
}
var detectorDeepLink = "https://portal.azure.com/?websitesextension_ext=asd.featurePath%3D"
+ detectorPath
+ "#resource/subscriptions/" + subscriptionId
+ "/resourceGroups/" + resourceGroup
+ "/providers/Microsoft.Web/sites/"
+ siteName
+ "/troubleshoot";
Response.Redirect(detectorDeepLink);
}
|
@{
var ownerName = Environment.GetEnvironmentVariable("WEBSITE_OWNER_NAME") ?? "";
var subscriptionId = ownerName;
var resourceGroup = Environment.GetEnvironmentVariable("WEBSITE_RESOURCE_GROUP") ?? "";
var siteName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME") ?? "";
var hostName = Environment.GetEnvironmentVariable("HTTP_HOST") ?? "";
var index = ownerName.IndexOf('+');
if (index >= 0)
{
subscriptionId = ownerName.Substring(0, index);
}
string detectorPath;
if (Kudu.Core.Helpers.OSDetector.IsOnWindows())
{
detectorPath = "diagnostics%2Favailability%2Fanalysis";
}
else
{
detectorPath = "detectors%2FLinuxAppDown";
}
var hostNameIndex = hostName.IndexOf('.');
if (hostNameIndex >= 0)
{
hostName = hostName.Substring(0, hostNameIndex);
}
var runtimeSuffxIndex = siteName.IndexOf("__");
if (runtimeSuffxIndex >= 0)
{
siteName = siteName.Substring(0, runtimeSuffxIndex);
}
// Get the slot name
if (!hostName.Equals(siteName, StringComparison.CurrentCultureIgnoreCase))
{
var slotNameIndex = siteName.Length;
if (hostName.Length > slotNameIndex && hostName[slotNameIndex] == '-')
{
// Fix up hostName by replacing "-SLOTNAME" with "/slots/SLOTNAME"
var slotName = hostName.Substring(slotNameIndex + 1);
hostName = hostName.Substring(0, slotNameIndex) + "/slots/" + slotName;
}
}
var detectorDeepLink = "https://portal.azure.com/?websitesextension_ext=asd.featurePath%3D"
+ detectorPath
+ "#resource/subscriptions/" + subscriptionId
+ "/resourceGroups/" + resourceGroup
+ "/providers/Microsoft.Web/sites/"
+ hostName
+ "/troubleshoot";
Response.Redirect(detectorDeepLink);
}
|
Fix detectors link to the slot
|
Fix detectors link to the slot
|
C#
|
apache-2.0
|
projectkudu/kudu,projectkudu/kudu,EricSten-MSFT/kudu,projectkudu/kudu,EricSten-MSFT/kudu,projectkudu/kudu,EricSten-MSFT/kudu,projectkudu/kudu,EricSten-MSFT/kudu,EricSten-MSFT/kudu
|
f92e8425be868c76f4d6091551da3c026906263b
|
DynamixelServo.Quadruped/Vector3Extensions.cs
|
DynamixelServo.Quadruped/Vector3Extensions.cs
|
using System.Numerics;
namespace DynamixelServo.Quadruped
{
public static class Vector3Extensions
{
public static Vector3 Normal(this Vector3 vector)
{
return Vector3.Normalize(vector);
}
public static bool Similar(this Vector3 a, Vector3 b, float marginOfError = float.Epsilon)
{
return Vector3.Distance(a, b) <= marginOfError;
}
}
}
|
using System.Numerics;
namespace DynamixelServo.Quadruped
{
public static class Vector3Extensions
{
public static Vector3 Normal(this Vector3 vector)
{
return Vector3.Normalize(vector);
}
public static bool Similar(this Vector3 a, Vector3 b, float marginOfError = float.Epsilon)
{
return Vector3.Distance(a, b) <= marginOfError;
}
public static Vector3 MoveTowards(this Vector3 current, Vector3 target, float distance)
{
var transport = target - current;
var len = transport.Length();
if (len < distance)
{
return target;
}
return current + transport.Normal() * distance;
}
}
}
|
Add move towards method for vectors
|
Add move towards method for vectors
|
C#
|
apache-2.0
|
dmweis/DynamixelServo,dmweis/DynamixelServo,dmweis/DynamixelServo,dmweis/DynamixelServo
|
2024eca3c813c9017fdebd8042b75c41876f1d40
|
src/Spiffy.Monitoring/Behavior.cs
|
src/Spiffy.Monitoring/Behavior.cs
|
using System;
using System.Diagnostics;
namespace Spiffy.Monitoring
{
public static class Behavior
{
static Action<Level, string> _loggingAction;
/// <summary>
/// Whether or not to remove newline characters from logged values.
/// </summary>
/// <returns>
/// <code>true</code> if newline characters will be removed from logged
/// values, <code>false</code> otherwise.
/// </returns>
public static bool RemoveNewlines { get; set; }
public static void UseBuiltInLogging(BuiltInLogging behavior)
{
switch (behavior)
{
case Monitoring.BuiltInLogging.Console:
_loggingAction = (level, message) => Console.WriteLine(message);
break;
case Monitoring.BuiltInLogging.Trace:
_loggingAction = (level, message) => Trace.WriteLine(message);
break;
default:
throw new NotSupportedException($"{behavior} is not supported");
}
}
public static void UseCustomLogging(Action<Level, string> loggingAction)
{
_loggingAction = loggingAction;
}
internal static Action<Level, string> GetLoggingAction()
{
return _loggingAction;
}
}
public enum BuiltInLogging
{
Trace,
Console
}
}
|
using System;
using System.Diagnostics;
namespace Spiffy.Monitoring
{
public static class Behavior
{
static Action<Level, string> _loggingAction;
/// <summary>
/// Whether or not to remove newline characters from logged values.
/// </summary>
/// <returns>
/// <code>true</code> if newline characters will be removed from logged
/// values, <code>false</code> otherwise.
/// </returns>
public static bool RemoveNewlines { get; set; }
public static void UseBuiltInLogging(BuiltInLogging behavior)
{
switch (behavior)
{
case Monitoring.BuiltInLogging.Console:
_loggingAction = (level, message) =>
{
if (level == Level.Error)
{
Console.Error.WriteLine(message);
}
else
{
Console.WriteLine(message);
}
};
break;
case Monitoring.BuiltInLogging.Trace:
_loggingAction = (level, message) =>
{
switch (level)
{
case Level.Info:
Trace.TraceInformation(message);
break;
case Level.Warning:
Trace.TraceWarning(message);
break;
case Level.Error:
Trace.TraceError(message);
break;
default:
Trace.WriteLine(message);
break;
}
};
break;
default:
throw new NotSupportedException($"{behavior} is not supported");
}
}
public static void UseCustomLogging(Action<Level, string> loggingAction)
{
_loggingAction = loggingAction;
}
internal static Action<Level, string> GetLoggingAction()
{
return _loggingAction;
}
}
public enum BuiltInLogging
{
Trace,
Console
}
}
|
Update default logging behaviors to use functions that correspond to log level
|
Update default logging behaviors to use functions that correspond to log level
|
C#
|
mit
|
chris-peterson/Spiffy
|
8e4e83d39eb35aad46036464672acf3d60e6d0c5
|
Source/DialogueSystem/DialogueSystem.Build.cs
|
Source/DialogueSystem/DialogueSystem.Build.cs
|
//Copyright (c) 2016 Artem A. Mavrin and other contributors
using UnrealBuildTool;
public class DialogueSystem : ModuleRules
{
public DialogueSystem(TargetInfo Target)
{
PrivateIncludePaths.AddRange(
new string[] {"DialogueSystem/Private"});
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"UMG",
"SlateCore",
"Slate",
"AIModule"
}
);
}
}
|
//Copyright (c) 2016 Artem A. Mavrin and other contributors
using UnrealBuildTool;
public class DialogueSystem : ModuleRules
{
public DialogueSystem(TargetInfo Target)
{
PrivateIncludePaths.AddRange(
new string[] {"DialogueSystem/Private"});
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"UMG",
"SlateCore",
"Slate",
"AIModule",
"GameplayTasks"
}
);
}
}
|
Fix build issues with 4.12
|
Fix build issues with 4.12
|
C#
|
mit
|
serioussam909/UE4-DialogueSystem,artemavrin/UE4-DialogueSystem,artemavrin/UE4-DialogueSystem,serioussam909/UE4-DialogueSystem,artemavrin/UE4-DialogueSystem,serioussam909/UE4-DialogueSystem
|
d17942e79c70fe12ad0098b683979dbbad874686
|
src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/ValueForms/DefaultSafeNamespaceValueFormModel.cs
|
src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/ValueForms/DefaultSafeNamespaceValueFormModel.cs
|
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;
namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects.ValueForms
{
public class DefaultSafeNamespaceValueFormModel : IValueForm
{
public DefaultSafeNamespaceValueFormModel()
{
}
public static readonly string FormName = "safe_namespace";
public virtual string Identifier => FormName;
public string Name => Identifier;
public IValueForm FromJObject(string name, JObject configuration)
{
throw new NotImplementedException();
}
public virtual string Process(IReadOnlyDictionary<string, IValueForm> forms, string value)
{
string workingValue = Regex.Replace(value, @"(^\s+|\s+$)", "");
workingValue = Regex.Replace(workingValue, @"(((?<=\.)|^)(?=\d)|[^\w\.])", "_");
return workingValue;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;
namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects.ValueForms
{
public class DefaultSafeNamespaceValueFormModel : IValueForm
{
public DefaultSafeNamespaceValueFormModel()
{
}
public static readonly string FormName = "safe_namespace";
public virtual string Identifier => FormName;
public string Name => Identifier;
public IValueForm FromJObject(string name, JObject configuration)
{
throw new NotImplementedException();
}
public virtual string Process(IReadOnlyDictionary<string, IValueForm> forms, string value)
{
string workingValue = Regex.Replace(value, @"(^\s+|\s+$)", "");
workingValue = Regex.Replace(workingValue, @"(((?<=\.)|^)((?=\d)|\.)|[^\w\.])", "_");
return workingValue;
}
}
}
|
Update expression to match dots following dots
|
Update expression to match dots following dots
|
C#
|
mit
|
mlorbetske/templating,mlorbetske/templating
|
8604de484e403ebac2e3a1f12464bb75a8d6b62a
|
src/SFA.DAS.EmployerApprenticeshipsService.Domain/Configuration/EmployerApprenticeshipsServiceConfiguration.cs
|
src/SFA.DAS.EmployerApprenticeshipsService.Domain/Configuration/EmployerApprenticeshipsServiceConfiguration.cs
|
using System.Collections.Generic;
namespace SFA.DAS.EmployerApprenticeshipsService.Domain.Configuration
{
public class EmployerApprenticeshipsServiceConfiguration
{
public CompaniesHouseConfiguration CompaniesHouse { get; set; }
public EmployerConfiguration Employer { get; set; }
public string ServiceBusConnectionString { get; set; }
public IdentityServerConfiguration Identity { get; set; }
public SmtpConfiguration SmtpServer { get; set; }
public string DashboardUrl { get; set; }
public HmrcConfiguration Hmrc { get; set; }
}
public class HmrcConfiguration
{
public string BaseUrl { get; set; }
public string ClientId { get; set; }
public string Scope { get; set; }
public string ClientSecret { get; set; }
}
public class IdentityServerConfiguration
{
public bool UseFake { get; set; }
public string ClientId { get; set; }
public string ClientSecret { get; set; }
public string BaseAddress { get; set; }
}
public class EmployerConfiguration
{
public string DatabaseConnectionString { get; set; }
}
public class CompaniesHouseConfiguration
{
public string ApiKey { get; set; }
}
public class SmtpConfiguration
{
public string ServerName { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public string Port { get; set; }
}
}
|
using System.Collections.Generic;
namespace SFA.DAS.EmployerApprenticeshipsService.Domain.Configuration
{
public class EmployerApprenticeshipsServiceConfiguration
{
public CompaniesHouseConfiguration CompaniesHouse { get; set; }
public EmployerConfiguration Employer { get; set; }
public string ServiceBusConnectionString { get; set; }
public IdentityServerConfiguration Identity { get; set; }
public SmtpConfiguration SmtpServer { get; set; }
public string DashboardUrl { get; set; }
public HmrcConfiguration Hmrc { get; set; }
}
public class HmrcConfiguration
{
public string BaseUrl { get; set; }
public string ClientId { get; set; }
public string Scope { get; set; }
public string ClientSecret { get; set; }
public bool DuplicatesCheck { get; set; }
}
public class IdentityServerConfiguration
{
public bool UseFake { get; set; }
public string ClientId { get; set; }
public string ClientSecret { get; set; }
public string BaseAddress { get; set; }
}
public class EmployerConfiguration
{
public string DatabaseConnectionString { get; set; }
}
public class CompaniesHouseConfiguration
{
public string ApiKey { get; set; }
}
public class SmtpConfiguration
{
public string ServerName { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public string Port { get; set; }
}
}
|
Add new config value for testing scenarios related to duplicate PAYE schemes. This will be deleted
|
Add new config value for testing scenarios related to duplicate PAYE schemes. This will be deleted
|
C#
|
mit
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.