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
|
|---|---|---|---|---|---|---|---|---|---|
80fdefef2a0283b2d36954f4266e4aaa3133e702
|
ConsoleProgressBar/Program.cs
|
ConsoleProgressBar/Program.cs
|
using System;
using System.Threading;
namespace ConsoleProgressBar
{
/// <summary>
/// Simple program with sample usage of ConsoleProgressBar.
/// </summary>
class Program
{
public static void Main(string[] args)
{
using (var progressBar = new ConsoleProgressBar(totalUnitsOfWork: 3500))
{
for (uint i = 0; i < 3500; ++i)
{
progressBar.Draw(i + 1);
Thread.Sleep(1);
}
}
using (var progressBar = new ConsoleProgressBar(
totalUnitsOfWork: 2000,
startingPosition: 10,
widthInCharacters: 65,
completedColor: ConsoleColor.DarkBlue,
remainingColor: ConsoleColor.DarkGray))
{
for (uint i = 0; i < 2000; ++i)
{
progressBar.Draw(i + 1);
Thread.Sleep(1);
}
}
}
}
}
|
using System;
using System.Threading;
namespace ConsoleProgressBar
{
/// <summary>
/// Simple program with sample usage of ConsoleProgressBar.
/// </summary>
class Program
{
public static void Main(string[] args)
{
using (var progressBar = new ConsoleProgressBar(totalUnitsOfWork: 3500))
{
for (uint i = 0; i < 3500; ++i)
{
progressBar.Draw(i + 1);
Thread.Sleep(1);
}
}
using (var progressBar = new ConsoleProgressBar(
totalUnitsOfWork: 2000,
startingPosition: 3,
widthInCharacters: 48,
completedColor: ConsoleColor.DarkBlue,
remainingColor: ConsoleColor.DarkGray))
{
for (uint i = 0; i < 2000; ++i)
{
progressBar.Draw(i + 1);
Thread.Sleep(1);
}
}
}
}
}
|
Adjust sample to fit on default Windows cmd console.
|
Adjust sample to fit on default Windows cmd console.
|
C#
|
mit
|
cmarcusreid/cs-console-progress
|
250bed5d62c82a7d7c30140918d82d4a30f134e9
|
KryptPadWebApp/Email/EmailHelper.cs
|
KryptPadWebApp/Email/EmailHelper.cs
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Threading.Tasks;
using System.Web;
namespace KryptPadWebApp.Email
{
public class EmailHelper
{
/// <summary>
/// Sends an email
/// </summary>
/// <param name="subject"></param>
/// <param name="body"></param>
/// <param name="to"></param>
/// <returns></returns>
public static Task SendAsync(string subject, string body, string to)
{
// Credentials
var credentialUserName = ConfigurationManager.AppSettings["SmtpUserName"];
var sentFrom = ConfigurationManager.AppSettings["SmtpSendFrom"];
var pwd = ConfigurationManager.AppSettings["SmtpPassword"];
var server = ConfigurationManager.AppSettings["SmtpHostName"];
var port = Convert.ToInt32(ConfigurationManager.AppSettings["SmtpPort"]);
// Configure the client
var client = new SmtpClient(server);
client.Port = port;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
// Create the credentials
var credentials = new NetworkCredential(credentialUserName, pwd);
client.EnableSsl = false;
client.Credentials = credentials;
// Create the message
var mail = new MailMessage(sentFrom, to);
mail.IsBodyHtml = true;
mail.Subject = subject;
mail.Body = body;
// Send
return client.SendMailAsync(mail);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Threading.Tasks;
using System.Web;
namespace KryptPadWebApp.Email
{
public class EmailHelper
{
/// <summary>
/// Sends an email
/// </summary>
/// <param name="subject"></param>
/// <param name="body"></param>
/// <param name="to"></param>
/// <returns></returns>
public static Task SendAsync(string subject, string body, string to)
{
// Credentials
var credentialUserName = ConfigurationManager.AppSettings["SmtpUserName"];
var sentFrom = ConfigurationManager.AppSettings["SmtpSendFrom"];
var pwd = ConfigurationManager.AppSettings["SmtpPassword"];
var server = ConfigurationManager.AppSettings["SmtpHostName"];
var port = Convert.ToInt32(ConfigurationManager.AppSettings["SmtpPort"]);
// Configure the client
var client = new SmtpClient(server);
client.Port = port;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.EnableSsl = false;
// Create the credentials
client.Credentials = new NetworkCredential(credentialUserName, pwd);
// Create the message
var mail = new MailMessage(sentFrom, to);
mail.IsBodyHtml = true;
mail.Subject = subject;
mail.Body = body;
// Send
return client.SendMailAsync(mail);
}
}
}
|
Update to send mail function
|
Update to send mail function
|
C#
|
mit
|
KryptPad/KryptPadWebsite,KryptPad/KryptPadWebsite,KryptPad/KryptPadWebsite
|
402267bf8efd9fd525eda96bb123c9aa185d9b5a
|
CefSharp.MinimalExample.Wpf/App.xaml.cs
|
CefSharp.MinimalExample.Wpf/App.xaml.cs
|
using System;
using System.Windows;
namespace CefSharp.MinimalExample.Wpf
{
public partial class App : Application
{
public App()
{
//Perform dependency check to make sure all relevant resources are in our output directory.
var settings = new CefSettings();
settings.EnableInternalPdfViewerOffScreen();
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
}
}
}
|
using System;
using System.Windows;
namespace CefSharp.MinimalExample.Wpf
{
public partial class App : Application
{
public App()
{
//Perform dependency check to make sure all relevant resources are in our output directory.
var settings = new CefSettings();
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
}
}
}
|
Remove call to EnableInternalPdfViewerOffScreen as it's been removed as Chromium no longer supports disabling of surfaces
|
Remove call to EnableInternalPdfViewerOffScreen as it's been removed as Chromium no longer supports disabling of surfaces
|
C#
|
mit
|
cefsharp/CefSharp.MinimalExample
|
e49d82e2290b3427df3f134ceb6db430955b5a73
|
SPAD.Interfaces/Configuration/IProfileOptionsProvider.cs
|
SPAD.Interfaces/Configuration/IProfileOptionsProvider.cs
|
using SPAD.neXt.Interfaces.Profile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace SPAD.neXt.Interfaces.Configuration
{
public interface ISettingsProvider : IProfileOptionsProvider, IWindowPlacementProvider
{ }
public interface IProfileOptionsProvider
{
IProfileOption AddOption(string key, Interfaces.Profile.ProfileOptionTypes type, string defaultValue, bool needrestart = false, bool editable = false, bool hidden = false);
IProfileOption GetOption(string key);
void SetOption(string key, string value);
}
public interface IWindowPlacementProvider
{
IWindowPlacement GetWindowPlacement(string key);
void SetWindowPlacement(IWindowPlacement placement);
}
public interface IWindowPlacement
{
string Key { get; }
double Top { get; set; }
double Left { get; set; }
double Height { get; set; }
double Width { get; set; }
bool HasValues { get; }
void ApplyPlacement(Window w);
bool SavePlacement(Window w);
T GetOption<T>(string key, T defaultValue = default(T));
void SetOption(string key, object value);
}
}
|
using SPAD.neXt.Interfaces.Profile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace SPAD.neXt.Interfaces.Configuration
{
public interface ISettingsProvider : IProfileOptionsProvider, IWindowPlacementProvider
{ }
public interface IProfileOptionsProvider
{
IProfileOption AddOption(string key, Interfaces.Profile.ProfileOptionTypes type, string defaultValue, bool needrestart = false, bool editable = false, bool hidden = false,string groupName="Other");
IProfileOption GetOption(string key);
void SetOption(string key, string value);
}
public interface IWindowPlacementProvider
{
IWindowPlacement GetWindowPlacement(string key);
void SetWindowPlacement(IWindowPlacement placement);
}
public interface IWindowPlacement
{
string Key { get; }
double Top { get; set; }
double Left { get; set; }
double Height { get; set; }
double Width { get; set; }
bool HasValues { get; }
void ApplyPlacement(Window w);
bool SavePlacement(Window w);
T GetOption<T>(string key, T defaultValue = default(T));
void SetOption(string key, object value);
}
}
|
Add option for groupname to group options by groups
|
Add option for groupname to group options by groups
|
C#
|
mit
|
c0nnex/SPAD.neXt,c0nnex/SPAD.neXt
|
49fc2d9af406e5f3c6e44cb5e3c0d68840bce3d8
|
Database.Migrations/Migrator.cs
|
Database.Migrations/Migrator.cs
|
using System;
using FluentMigrator.Runner;
using FluentMigrator.Runner.Announcers;
using FluentMigrator.Runner.Initialization;
using FluentMigrator.Runner.Processors.SqlServer;
namespace BroadbandStats.Database.Migrations
{
public sealed class Migrator
{
private readonly string connectionString;
public Migrator(string connectionString)
{
if (connectionString == null)
{
throw new ArgumentNullException(nameof(connectionString));
}
this.connectionString = connectionString;
}
public void MigrateToLatestSchema()
{
var todaysDate = DateTime.Today.ToString("yyyyMMdd");
var todaysSchemaVersion = long.Parse(todaysDate);
MigrateTo(todaysSchemaVersion);
}
private void MigrateTo(long targetVersion)
{
var options = new MigrationOptions { PreviewOnly = false, Timeout = 60 };
var announcer = new NullAnnouncer();
var processor = new SqlServer2012ProcessorFactory().Create(connectionString, announcer, options);
var migrationContext = new RunnerContext(announcer) { Namespace = "BroadbandSpeedTests.Database.Migrations.Migrations" };
var runner = new MigrationRunner(GetType().Assembly, migrationContext, processor);
runner.MigrateUp(targetVersion, true);
}
}
}
|
using System;
using BroadbandStats.Database.Migrations.Migrations;
using FluentMigrator.Runner;
using FluentMigrator.Runner.Announcers;
using FluentMigrator.Runner.Initialization;
using FluentMigrator.Runner.Processors.SqlServer;
namespace BroadbandStats.Database.Migrations
{
public sealed class Migrator
{
private readonly string connectionString;
public Migrator(string connectionString)
{
if (connectionString == null)
{
throw new ArgumentNullException(nameof(connectionString));
}
this.connectionString = connectionString;
}
public void MigrateToLatestSchema()
{
var todaysDate = DateTime.Today.ToString("yyyyMMdd");
var todaysSchemaVersion = long.Parse(todaysDate);
MigrateTo(todaysSchemaVersion);
}
private void MigrateTo(long targetVersion)
{
var options = new MigrationOptions { PreviewOnly = false, Timeout = 60 };
var announcer = new NullAnnouncer();
var processor = new SqlServer2012ProcessorFactory().Create(connectionString, announcer, options);
var migrationContext = new RunnerContext(announcer) { Namespace = typeof(InitialDatabase).Namespace };
var runner = new MigrationRunner(GetType().Assembly, migrationContext, processor);
runner.MigrateUp(targetVersion, true);
}
}
}
|
Fix the namespace following an earlier rename
|
Fix the namespace following an earlier rename
|
C#
|
mit
|
adrianbanks/BroadbandSpeedStats,adrianbanks/BroadbandSpeedStats,adrianbanks/BroadbandSpeedStats,adrianbanks/BroadbandSpeedStats
|
146bb4a8b32e0e4eff491febac2122ec4c9dfe76
|
Plugins/ITabsterPlugin.cs
|
Plugins/ITabsterPlugin.cs
|
namespace Tabster.Core.Plugins
{
public interface ITabsterPlugin
{
string Name { get; }
string Description { get; }
string Author { get; }
string Version { get; }
string[] PluginClasses { get; }
}
}
|
using System;
namespace Tabster.Core.Plugins
{
public interface ITabsterPlugin
{
string Name { get; }
string Description { get; }
string Author { get; }
string Version { get; }
Type[] Types { get; }
}
}
|
Use types instead of fully qualified names.
|
Use types instead of fully qualified names.
|
C#
|
apache-2.0
|
GetTabster/Tabster.Core
|
4edfd8153dfade6e8fcdf18e4b93d6fae18707ec
|
Common/Data/OnionState.cs
|
Common/Data/OnionState.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common.Data
{
public class OnionState
{
public bool Enabled { get; set; } = true;
public bool CustomWorldSize { get; set; } = false;
public int Width { get; set; } = 256;
public int Height { get; set; } = 384;
public bool Debug { get; set; } = false;
public bool FreeCamera { get; set; } = true;
public bool CustomMaxCameraDistance { get; set; } = true;
public float MaxCameraDistance { get; set; } = 300;
public bool LogSeed { get; set; } = true;
public bool CustomSeeds { get; set; } = false;
public int WorldSeed { get; set; } = 0;
public int LayoutSeed { get; set; } = 0;
public int TerrainSeed { get; set; } = 0;
public int NoiseSeed { get; set; } = 0;
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common.Data
{
public class OnionState
{
public bool Enabled { get; set; } = true;
public bool CustomWorldSize { get; set; } = false;
public int Width { get; set; } = 8;
public int Height { get; set; } = 12;
public bool Debug { get; set; } = false;
public bool FreeCamera { get; set; } = true;
public bool CustomMaxCameraDistance { get; set; } = true;
public float MaxCameraDistance { get; set; } = 300;
public bool LogSeed { get; set; } = true;
public bool CustomSeeds { get; set; } = false;
public int WorldSeed { get; set; } = 0;
public int LayoutSeed { get; set; } = 0;
public int TerrainSeed { get; set; } = 0;
public int NoiseSeed { get; set; } = 0;
}
}
|
Change default world size to compensate for use of chunks
|
Change default world size to compensate for use of chunks
|
C#
|
mit
|
fistak/MaterialColor
|
e86f46099d2d26c81bea033ad4db8ed506a8bb3c
|
CefSharp/IRequest.cs
|
CefSharp/IRequest.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.Collections.Specialized;
namespace CefSharp
{
public interface IRequest
{
string Url { get; set; }
string Method { get; }
string Body { get; }
NameValueCollection Headers { get; set; }
TransitionType TransitionType { get; }
}
}
|
// 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.Collections.Specialized;
namespace CefSharp
{
public interface IRequest
{
string Url { get; set; }
string Method { get; }
string Body { get; }
NameValueCollection Headers { get; set; }
/// <summary>
/// Get the transition type for this request.
/// Applies to requests that represent a main frame or sub-frame navigation.
/// </summary>
TransitionType TransitionType { get; }
}
}
|
Add xml comment to TransitionType
|
Add xml comment to TransitionType
|
C#
|
bsd-3-clause
|
wangzheng888520/CefSharp,dga711/CefSharp,rlmcneary2/CefSharp,gregmartinhtc/CefSharp,twxstar/CefSharp,battewr/CefSharp,AJDev77/CefSharp,NumbersInternational/CefSharp,ITGlobal/CefSharp,battewr/CefSharp,rover886/CefSharp,rover886/CefSharp,gregmartinhtc/CefSharp,rover886/CefSharp,Haraguroicha/CefSharp,jamespearce2006/CefSharp,VioletLife/CefSharp,joshvera/CefSharp,haozhouxu/CefSharp,Octopus-ITSM/CefSharp,Octopus-ITSM/CefSharp,joshvera/CefSharp,Livit/CefSharp,windygu/CefSharp,Haraguroicha/CefSharp,NumbersInternational/CefSharp,VioletLife/CefSharp,illfang/CefSharp,ruisebastiao/CefSharp,Octopus-ITSM/CefSharp,haozhouxu/CefSharp,rlmcneary2/CefSharp,windygu/CefSharp,yoder/CefSharp,windygu/CefSharp,gregmartinhtc/CefSharp,AJDev77/CefSharp,rlmcneary2/CefSharp,battewr/CefSharp,wangzheng888520/CefSharp,NumbersInternational/CefSharp,dga711/CefSharp,illfang/CefSharp,Livit/CefSharp,dga711/CefSharp,VioletLife/CefSharp,haozhouxu/CefSharp,zhangjingpu/CefSharp,VioletLife/CefSharp,NumbersInternational/CefSharp,jamespearce2006/CefSharp,AJDev77/CefSharp,twxstar/CefSharp,illfang/CefSharp,zhangjingpu/CefSharp,wangzheng888520/CefSharp,AJDev77/CefSharp,twxstar/CefSharp,gregmartinhtc/CefSharp,ITGlobal/CefSharp,battewr/CefSharp,joshvera/CefSharp,haozhouxu/CefSharp,ruisebastiao/CefSharp,rover886/CefSharp,ITGlobal/CefSharp,wangzheng888520/CefSharp,Haraguroicha/CefSharp,rover886/CefSharp,illfang/CefSharp,ITGlobal/CefSharp,yoder/CefSharp,yoder/CefSharp,Livit/CefSharp,dga711/CefSharp,jamespearce2006/CefSharp,zhangjingpu/CefSharp,yoder/CefSharp,ruisebastiao/CefSharp,Octopus-ITSM/CefSharp,zhangjingpu/CefSharp,Haraguroicha/CefSharp,joshvera/CefSharp,jamespearce2006/CefSharp,ruisebastiao/CefSharp,Haraguroicha/CefSharp,rlmcneary2/CefSharp,Livit/CefSharp,windygu/CefSharp,twxstar/CefSharp,jamespearce2006/CefSharp
|
58dbc63c6e85fecf9f13aea709e1397bd790161b
|
osu.Game.Rulesets.Catch/Mods/CatchModHardRock.cs
|
osu.Game.Rulesets.Catch/Mods/CatchModHardRock.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.Game.Rulesets.Mods;
namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModHardRock : ModHardRock
{
public override double ScoreMultiplier => 1.12;
public override bool Ranked => true;
}
}
|
// 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.MathUtils;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Mods;
using System;
namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModHardRock : ModHardRock, IApplicableToHitObject<CatchHitObject>
{
public override double ScoreMultiplier => 1.12;
public override bool Ranked => true;
private float lastStartX;
private int lastStartTime;
public void ApplyToHitObject(CatchHitObject hitObject)
{
// Code from Stable, we keep calculation on a scale of 0 to 512
float position = hitObject.X * 512;
int startTime = (int)hitObject.StartTime;
if (lastStartX == 0)
{
lastStartX = position;
lastStartTime = startTime;
return;
}
float diff = lastStartX - position;
int timeDiff = startTime - lastStartTime;
if (timeDiff > 1000)
{
lastStartX = position;
lastStartTime = startTime;
return;
}
if (diff == 0)
{
bool right = RNG.NextBool();
float rand = Math.Min(20, (float)RNG.NextDouble(0, timeDiff / 4));
if (right)
{
if (position + rand <= 512)
position += rand;
else
position -= rand;
}
else
{
if (position - rand >= 0)
position -= rand;
else
position += rand;
}
hitObject.X = position / 512;
return;
}
if (Math.Abs(diff) < timeDiff / 3)
{
if (diff > 0)
{
if (position - diff > 0)
position -= diff;
}
else
{
if (position - diff < 512)
position -= diff;
}
}
hitObject.X = position / 512;
lastStartX = position;
lastStartTime = startTime;
}
}
}
|
Add HardRock position mangling for CatchTheBeat
|
Add HardRock position mangling for CatchTheBeat
|
C#
|
mit
|
NeoAdonis/osu,johnneijzen/osu,NeoAdonis/osu,2yangk23/osu,DrabWeb/osu,UselessToucan/osu,UselessToucan/osu,smoogipoo/osu,EVAST9919/osu,EVAST9919/osu,smoogipoo/osu,DrabWeb/osu,smoogipoo/osu,ZLima12/osu,peppy/osu,peppy/osu,DrabWeb/osu,Nabile-Rahmani/osu,naoey/osu,2yangk23/osu,ppy/osu,peppy/osu,ppy/osu,NeoAdonis/osu,naoey/osu,smoogipooo/osu,peppy/osu-new,ppy/osu,johnneijzen/osu,UselessToucan/osu,ZLima12/osu,naoey/osu
|
73026d1332bd46711a1f30ade51476855ce19d10
|
RavenDBBlogConsole/Program.cs
|
RavenDBBlogConsole/Program.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Raven.Client.Document;
namespace RavenDBBlogConsole
{
class Program
{
static void Main(string[] args)
{
var docStore = new DocumentStore()
{
Url = "http://localhost:8080"
};
docStore.Initialize();
using (var session = docStore.OpenSession())
{
var blog = session.Load<Blog>("blogs/1");
Console.WriteLine("Name: {0}, Author: {1}", blog.Name, blog.Author);
}
}
}
public class Blog
{
public string Id { get; set; }
public string Name { get; set; }
public string Author { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Raven.Client.Document;
namespace RavenDBBlogConsole
{
class Program
{
static void Main(string[] args)
{
var docStore = new DocumentStore()
{
Url = "http://localhost:8080"
};
docStore.Initialize();
using (var session = docStore.OpenSession())
{
var post = new Post()
{
BlogId = "blogs/33",
Comments = new List<Comment>() { new Comment() { CommenterName = "Bob", Text = "Hello!" } },
Content = "Some text",
Tags = new List<string>() { "tech" },
Title = "First post",
};
session.Store(post);
session.SaveChanges();
}
}
}
public class Blog
{
public string Id { get; set; }
public string Name { get; set; }
public string Author { get; set; }
}
public class Post
{
public string Id { get; set; }
public string BlogId { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public List<Comment> Comments { get; set; }
public List<string> Tags { get; set; }
}
public class Comment
{
public string CommenterName { get; set; }
public string Text { get; set; }
}
}
|
Add object with collection properties
|
Add object with collection properties
|
C#
|
mit
|
bmsullivan/RavenDBBlogConsole
|
f8f0535532eb8e18083f68160c8ee3b45d9a27c1
|
BmpListener/Bmp/BMPInitiation.cs
|
BmpListener/Bmp/BMPInitiation.cs
|
using System;
namespace BmpListener.Bmp
{
public class BmpInitiation : BmpMessage
{
public BmpInitiation(BmpHeader bmpHeader)
: base(bmpHeader)
{ }
}
}
|
using System;
namespace BmpListener.Bmp
{
public class BmpInitiation : BmpMessage
{
public BmpInitiation(BmpHeader bmpHeader)
: base(bmpHeader)
{
BmpVersion = BmpHeader.Version;
}
public int BmpVersion { get; }
}
}
|
Add BMP version to initiation message
|
Add BMP version to initiation message
|
C#
|
mit
|
mstrother/BmpListener
|
b89f71d2de8366172f190f46951a36cdca38e06a
|
Source/TimesheetParser/MainViewModel.cs
|
Source/TimesheetParser/MainViewModel.cs
|
using System.Windows.Input;
using Microsoft.Practices.Prism.Commands;
namespace TimesheetParser
{
class MainViewModel
{
public ICommand CopyCommand { get; set; }
public MainViewModel()
{
CopyCommand = new DelegateCommand<string>(CopyCommand_Executed);
}
void CopyCommand_Executed(string param)
{
}
}
}
|
using System.Windows;
using System.Windows.Input;
using Microsoft.Practices.Prism.Commands;
namespace TimesheetParser
{
class MainViewModel
{
public ICommand CopyCommand { get; set; }
public MainViewModel()
{
CopyCommand = new DelegateCommand<string>(CopyCommand_Executed);
}
void CopyCommand_Executed(string param)
{
Clipboard.SetData(DataFormats.UnicodeText, param);
}
}
}
|
Implement text copying to Clipboard.
|
Implement text copying to Clipboard.
|
C#
|
mit
|
dermeister0/TimesheetParser,dermeister0/TimesheetParser
|
9c6939b886a5c621ceb63fcf9d4333d8dd055ba0
|
WebApplication/Views/Sites/Index.cshtml
|
WebApplication/Views/Sites/Index.cshtml
|
@using DataAccess
@using Localization
@using WebApplication.Helpers
@using WebGrease
@model IEnumerable<DataAccess.Site>
@{
ViewBag.Title = Resources.LabelSitesList;
}
@Html.Partial("_PageTitlePartial")
<table class="table">
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
<th class="hidden-sm">Postcode</th>
<th class="hidden-xs">Features</th>
<th style="font-weight:normal;">@Html.ActionLink("Create a New Site", "Create")</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.ActionLink("Delete Site", "Delete", new { id = item.Id })
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td class="hidden-sm" style="text-transform:uppercase;">@Html.DisplayFor(modelItem => item.Postcode)</td>
<td class="hidden-xs">
@Html.SiteSummaryIconsFor(item)
</td>
<td>
@Html.ActionLink("Site Report", "Report", new { id = item.Id }) |
@Html.ActionLink("Edit Site", "Edit", new { id = item.Id }) |
@Html.ActionLink(Resources.LabelPerformanceData, "Index", "Months", new { id = item.Id }, null)
</td>
</tr>
}
</table>
|
@using DataAccess
@using Localization
@using WebApplication.Helpers
@using WebGrease
@model IEnumerable<DataAccess.Site>
@{
ViewBag.Title = Resources.LabelSitesList;
}
@Html.Partial("_PageTitlePartial")
<table class="table">
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
<th class="hidden-sm hidden-xs">Postcode</th>
<th class="hidden-xs">Features</th>
<th style="font-weight:normal;">@Html.ActionLink("Create a New Site", "Create")</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.ActionLink("Delete Site", "Delete", new { id = item.Id })
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td class="hidden-sm hidden-xs" style="text-transform:uppercase;">@Html.DisplayFor(modelItem => item.Postcode)</td>
<td class="hidden-xs">
@Html.SiteSummaryIconsFor(item)
</td>
<td>
<span class="hidden-xs">@Html.ActionLink("Site Report", "Report", new { id = item.Id }) | </span>
@Html.ActionLink("Edit Site", "Edit", new { id = item.Id }) |
@Html.ActionLink(Resources.LabelPerformanceData, "Index", "Months", new { id = item.Id }, null)
</td>
</tr>
}
</table>
|
Hide the site report on really small screens.
|
Hide the site report on really small screens.
|
C#
|
mit
|
blackradley/nesscliffe,blackradley/nesscliffe,blackradley/nesscliffe
|
372b44969157835b8acf25dd8b098f23ffce6a44
|
WolfyBot.Core/IRCMessage.cs
|
WolfyBot.Core/IRCMessage.cs
|
//
// Copyright 2014 luke
//
// 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;
namespace WolfyBot.Core
{
public class IRCMessage
{
public IRCMessage ()
{
}
}
}
|
//
// Copyright 2014 luke
//
// 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;
namespace WolfyBot.Core
{
public class IRCMessage
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="WolfyBot.Core.IRCMessage"/> class.
/// </summary>
/// <param name="ircMessage">A Message formatted in the IRC Protocol</param>
public IRCMessage (String ircMessage)
{
TimeStamp = DateTime.Now;
//TODO: write IRC Parser
}
//Copy Constructor
public IRCMessage (IRCMessage other)
{
TimeStamp = other.TimeStamp;
Prefix = new String (other.Prefix);
Command = new String (other.Command);
Parameters = new String (other.Parameters);
TrailingParameters = new String (other.TrailingParameters);
}
#endregion
#region Methods
public String ToIRCString ()
{
//TODO: Implement Serialization to IRC Protocol
}
public String ToLogString ()
{
//TODO: Implement Serialization to logging format
}
#endregion
#region Properties
public String Prefix {
get;
set;
}
public String Command {
get;
set;
}
public String Parameters {
get;
set;
}
public String TrailingParameters {
get;
set;
}
public DateTime TimeStamp {
get;
set;
}
#endregion
}
}
|
Implement basic IRC Message without parsing IRC format yet
|
Implement basic IRC Message without parsing IRC
format yet
|
C#
|
apache-2.0
|
Luke-Wolf/wolfybot
|
d77256c6ba3258fa08435a798b974dd2523c936e
|
Tool/Support/DaemonEventLoop.cs
|
Tool/Support/DaemonEventLoop.cs
|
using System.Linq;
using OdjfsScraper.Database;
namespace OdjfsScraper.Tool.Support
{
public class DaemonEventLoop
{
private readonly Entities _ctx;
public DaemonEventLoop(Entities ctx)
{
_ctx = ctx;
UpdateCounts();
CurrentStep = 0;
IsRunning = true;
}
public bool IsRunning { get; set; }
public int CurrentStep { get; private set; }
public int CountyCount { get; private set; }
public int ChildCareCount { get; private set; }
private int StepCount
{
get { return CountyCount + ChildCareCount; }
}
public int ChildCaresPerCounty
{
get
{
if (CountyCount == 0)
{
return 0;
}
return ChildCareCount/CountyCount;
}
}
public bool IsCountyStep
{
get
{
if (ChildCaresPerCounty == 0)
{
return true;
}
return CurrentStep%ChildCaresPerCounty == 1;
}
}
public bool IsChildCareStep
{
get { return !IsCountyStep; }
}
private void UpdateCounts()
{
CountyCount = _ctx.Counties.Count();
ChildCareCount = _ctx.ChildCares.Count();
}
public bool NextStep()
{
CurrentStep = (CurrentStep + 1)%StepCount;
if (CurrentStep == 0)
{
UpdateCounts();
}
return IsRunning;
}
}
}
|
using System.Linq;
using OdjfsScraper.Database;
namespace OdjfsScraper.Tool.Support
{
public class DaemonEventLoop
{
private readonly Entities _ctx;
public DaemonEventLoop(Entities ctx)
{
_ctx = ctx;
UpdateCounts();
CurrentStep = -1;
IsRunning = true;
}
public bool IsRunning { get; set; }
public int CurrentStep { get; private set; }
public int CountyCount { get; private set; }
public int ChildCareCount { get; private set; }
private int StepCount
{
get { return CountyCount + ChildCareCount; }
}
public int ChildCaresPerCounty
{
get
{
if (CountyCount == 0)
{
return 0;
}
return ChildCareCount/CountyCount;
}
}
public bool IsCountyStep
{
get
{
if (ChildCaresPerCounty == 0)
{
return true;
}
return CurrentStep%ChildCaresPerCounty == 1;
}
}
public bool IsChildCareStep
{
get { return !IsCountyStep; }
}
private void UpdateCounts()
{
CountyCount = _ctx.Counties.Count();
ChildCareCount = _ctx.ChildCares.Count() + _ctx.ChildCareStubs.Count();
}
public bool NextStep()
{
CurrentStep = (CurrentStep + 1)%StepCount;
if (CurrentStep == 0)
{
UpdateCounts();
}
return IsRunning;
}
}
}
|
Fix daemon event loop bugs
|
Fix daemon event loop bugs
|
C#
|
mit
|
SmartRoutes/OdjfsScraper
|
2e5a40eddf839b6ce4cfbca727db92828e504562
|
osu.Android/OsuGameActivity.cs
|
osu.Android/OsuGameActivity.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 Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;
using osu.Framework.Android;
namespace osu.Android
{
[Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.FullUser, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = false)]
public class OsuGameActivity : AndroidGameActivity
{
protected override Framework.Game CreateGame() => new OsuGameAndroid(this);
protected override void OnCreate(Bundle savedInstanceState)
{
// The default current directory on android is '/'.
// On some devices '/' maps to the app data directory. On others it maps to the root of the internal storage.
// In order to have a consistent current directory on all devices the full path of the app data directory is set as the current directory.
System.Environment.CurrentDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
base.OnCreate(savedInstanceState);
Window.AddFlags(WindowManagerFlags.Fullscreen);
Window.AddFlags(WindowManagerFlags.KeepScreenOn);
}
}
}
|
// 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 Android.App;
using Android.Content;
using Android.Content.PM;
using Android.OS;
using Android.Views;
using osu.Framework.Android;
namespace osu.Android
{
[Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.FullUser, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = false)]
[IntentFilter(new[] { Intent.ActionDefault }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable, Intent.CategoryAppFiles }, DataSchemes = new[] { "content" }, DataPathPatterns = new[] { ".*\\.osz", ".*\\.osk" }, DataMimeType = "application/*")]
public class OsuGameActivity : AndroidGameActivity
{
protected override Framework.Game CreateGame() => new OsuGameAndroid(this);
protected override void OnCreate(Bundle savedInstanceState)
{
// The default current directory on android is '/'.
// On some devices '/' maps to the app data directory. On others it maps to the root of the internal storage.
// In order to have a consistent current directory on all devices the full path of the app data directory is set as the current directory.
System.Environment.CurrentDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
base.OnCreate(savedInstanceState);
Window.AddFlags(WindowManagerFlags.Fullscreen);
Window.AddFlags(WindowManagerFlags.KeepScreenOn);
}
}
}
|
Add an IntentFilter to handle osu! files.
|
Add an IntentFilter to handle osu! files.
|
C#
|
mit
|
smoogipoo/osu,ppy/osu,UselessToucan/osu,peppy/osu,peppy/osu,ppy/osu,ppy/osu,smoogipoo/osu,peppy/osu,smoogipoo/osu,smoogipooo/osu,peppy/osu-new,UselessToucan/osu,NeoAdonis/osu,NeoAdonis/osu,NeoAdonis/osu,UselessToucan/osu
|
7e816677ae812add67236baedfcff9fc0da265b2
|
ActorTestingFramework/RandomScheduler.cs
|
ActorTestingFramework/RandomScheduler.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
namespace ActorTestingFramework
{
public class RandomScheduler : IScheduler
{
private readonly Random rand;
public RandomScheduler(int seed)
{
rand = new Random(seed);
}
private static bool IsProgressOp(OpType op)
{
switch (op)
{
case OpType.INVALID:
case OpType.START:
case OpType.END:
case OpType.CREATE:
case OpType.JOIN:
case OpType.WaitForDeadlock:
case OpType.Yield:
return false;
case OpType.SEND:
case OpType.RECEIVE:
return true;
default:
throw new ArgumentOutOfRangeException(nameof(op), op, null);
}
}
#region Implementation of IScheduler
public ActorInfo GetNext(List<ActorInfo> actorList, ActorInfo currentActor)
{
if (currentActor.currentOp == OpType.Yield)
{
currentActor.enabled = false;
}
if (IsProgressOp(currentActor.currentOp))
{
foreach (var actorInfo in
actorList.Where(info => info.currentOp == OpType.Yield && !info.enabled))
{
actorInfo.enabled = true;
}
}
var enabled = actorList.Where(info => info.enabled).ToList();
if (enabled.Count == 0)
{
return null;
}
int nextIndex = rand.Next(enabled.Count - 1);
return enabled[nextIndex];
}
public void NextSchedule()
{
}
#endregion
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
namespace ActorTestingFramework
{
public class RandomScheduler : IScheduler
{
private readonly Random rand;
public RandomScheduler(int seed)
{
rand = new Random(seed);
}
private static bool IsProgressOp(OpType op)
{
switch (op)
{
case OpType.INVALID:
case OpType.WaitForDeadlock:
case OpType.Yield:
return false;
case OpType.START:
case OpType.END:
case OpType.CREATE:
case OpType.JOIN:
case OpType.SEND:
case OpType.RECEIVE:
return true;
default:
throw new ArgumentOutOfRangeException(nameof(op), op, null);
}
}
#region Implementation of IScheduler
public ActorInfo GetNext(List<ActorInfo> actorList, ActorInfo currentActor)
{
if (currentActor.currentOp == OpType.Yield)
{
currentActor.enabled = false;
}
if (IsProgressOp(currentActor.currentOp))
{
foreach (var actorInfo in
actorList.Where(info => info.currentOp == OpType.Yield && !info.enabled))
{
actorInfo.enabled = true;
}
}
var enabled = actorList.Where(info => info.enabled).ToList();
if (enabled.Count == 0)
{
return null;
}
int nextIndex = rand.Next(enabled.Count - 1);
return enabled[nextIndex];
}
public void NextSchedule()
{
}
#endregion
}
}
|
Change how yield works: treat more op types as "progress".
|
Change how yield works: treat more op types as "progress".
|
C#
|
mit
|
paulthomson/adara-actors
|
987f6f8924ac9938bd620723890a9b21942faf22
|
Source/SerializableTypesValueProvider.cs
|
Source/SerializableTypesValueProvider.cs
|
using System.Reflection;
#if !NETCORE
using System.Runtime.Serialization;
#endif
namespace Moq
{
/// <summary>
/// A <see cref="IDefaultValueProvider"/> that returns an empty default value
/// for serializable types that do not implement <see cref="ISerializable"/> properly,
/// and returns the value provided by the decorated provider otherwise.
/// </summary>
internal class SerializableTypesValueProvider : IDefaultValueProvider
{
private readonly IDefaultValueProvider decorated;
private readonly EmptyDefaultValueProvider emptyDefaultValueProvider = new EmptyDefaultValueProvider();
public SerializableTypesValueProvider(IDefaultValueProvider decorated)
{
this.decorated = decorated;
}
public void DefineDefault<T>(T value)
{
decorated.DefineDefault(value);
}
public object ProvideDefault(MethodInfo member)
{
return !member.ReturnType.GetTypeInfo().IsSerializable || member.ReturnType.IsSerializableMockable()
? decorated.ProvideDefault(member)
: emptyDefaultValueProvider.ProvideDefault(member);
}
}
}
|
using System.Reflection;
#if !NETCORE
using System.Runtime.Serialization;
#endif
namespace Moq
{
#if !NETCORE
/// <summary>
/// A <see cref="IDefaultValueProvider"/> that returns an empty default value
/// for serializable types that do not implement <see cref="ISerializable"/> properly,
/// and returns the value provided by the decorated provider otherwise.
/// </summary>
#else
/// <summary>
/// A <see cref="IDefaultValueProvider"/> that returns an empty default value
/// for serializable types that do not implement ISerializable properly,
/// and returns the value provided by the decorated provider otherwise.
/// </summary>
#endif
internal class SerializableTypesValueProvider : IDefaultValueProvider
{
private readonly IDefaultValueProvider decorated;
private readonly EmptyDefaultValueProvider emptyDefaultValueProvider = new EmptyDefaultValueProvider();
public SerializableTypesValueProvider(IDefaultValueProvider decorated)
{
this.decorated = decorated;
}
public void DefineDefault<T>(T value)
{
decorated.DefineDefault(value);
}
public object ProvideDefault(MethodInfo member)
{
return !member.ReturnType.GetTypeInfo().IsSerializable || member.ReturnType.IsSerializableMockable()
? decorated.ProvideDefault(member)
: emptyDefaultValueProvider.ProvideDefault(member);
}
}
}
|
Fix an issue where ISerializable is not available on .NET Core
|
Fix an issue where ISerializable is not available on .NET Core
It's unfortunate that conditional compilation directives cannnot
contain just part of a Xml Doc comment.
|
C#
|
bsd-3-clause
|
Moq/moq4,ocoanet/moq4
|
9bfb2d9f865f10b308ce85d2efc2d34ec4d3390b
|
src/Resonance.Windows/Program.cs
|
src/Resonance.Windows/Program.cs
|
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.WindowsServices;
using Resonance.Common.Web;
using System.Diagnostics;
using System.Linq;
namespace Resonance.Windows
{
public class Program
{
public static void Main(string[] args)
{
var isService = !(Debugger.IsAttached || args.Contains("--console"));
var host = ResonanceWebHostBuilderExtensions.GetWebHostBuilder()
.UseStartup<Startup>()
.UseApplicationInsights()
.Build();
if (isService)
{
System.IO.Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.BaseDirectory);
host.RunAsService();
}
else
{
host.Run();
}
}
}
}
|
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.WindowsServices;
using Resonance.Common.Web;
using System.Diagnostics;
using System.Linq;
namespace Resonance.Windows
{
public class Program
{
public static void Main(string[] args)
{
System.IO.Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.BaseDirectory);
var isService = !(Debugger.IsAttached || args.Contains("--console"));
var host = ResonanceWebHostBuilderExtensions.GetWebHostBuilder()
.UseStartup<Startup>()
.UseApplicationInsights()
.Build();
if (isService)
{
host.RunAsService();
}
else
{
host.Run();
}
}
}
}
|
Fix execution of windows app
|
Fix execution of windows app
|
C#
|
apache-2.0
|
archrival/Resonance
|
e278ab67bd7ce8cd2cd4f5bde9520ea82545d8dc
|
src/Core/SupurlativeOptions.cs
|
src/Core/SupurlativeOptions.cs
|
using System;
using System.Collections.Generic;
namespace RimDev.Supurlative
{
public class SupurlativeOptions
{
public static readonly SupurlativeOptions Defaults =
new SupurlativeOptions();
public UriKind UriKind { get; set; }
public string PropertyNameSeperator { get; set; }
public bool LowercaseKeys { get; set; }
public SupurlativeOptions()
{
UriKind = UriKind.Absolute;
PropertyNameSeperator = ".";
Formatters = new List<BaseFormatterAttribute>();
LowercaseKeys = true;
}
public void Validate()
{
if (UriKind == UriKind.RelativeOrAbsolute) throw new ArgumentException("must choose between relative or absolute", "UriKind");
if (PropertyNameSeperator == null) throw new ArgumentNullException("PropertyNameSeperator", "seperator must not be null");
}
public IList<BaseFormatterAttribute> Formatters { get; protected set; }
public SupurlativeOptions AddFormatter(BaseFormatterAttribute formatter)
{
if (formatter == null) throw new ArgumentNullException("formatter");
Formatters.Add(formatter);
return this;
}
public SupurlativeOptions AddFormatter<T>()
where T : BaseFormatterAttribute
{
return AddFormatter(Activator.CreateInstance<T>());
}
public SupurlativeOptions AddFormatter<T>(Func<T, string> func)
{
return AddFormatter(new LambdaFormatter(typeof(T), (x) => func((T)x)));
}
}
}
|
using System;
using System.Collections.Generic;
namespace RimDev.Supurlative
{
public class SupurlativeOptions
{
public static SupurlativeOptions Defaults
{
get
{
return new SupurlativeOptions();
}
}
public UriKind UriKind { get; set; }
public string PropertyNameSeperator { get; set; }
public bool LowercaseKeys { get; set; }
public SupurlativeOptions()
{
UriKind = UriKind.Absolute;
PropertyNameSeperator = ".";
Formatters = new List<BaseFormatterAttribute>();
LowercaseKeys = true;
}
public void Validate()
{
if (UriKind == UriKind.RelativeOrAbsolute) throw new ArgumentException("must choose between relative or absolute", "UriKind");
if (PropertyNameSeperator == null) throw new ArgumentNullException("PropertyNameSeperator", "seperator must not be null");
}
public IList<BaseFormatterAttribute> Formatters { get; protected set; }
public SupurlativeOptions AddFormatter(BaseFormatterAttribute formatter)
{
if (formatter == null) throw new ArgumentNullException("formatter");
Formatters.Add(formatter);
return this;
}
public SupurlativeOptions AddFormatter<T>()
where T : BaseFormatterAttribute
{
return AddFormatter(Activator.CreateInstance<T>());
}
public SupurlativeOptions AddFormatter<T>(Func<T, string> func)
{
return AddFormatter(new LambdaFormatter(typeof(T), (x) => func((T)x)));
}
}
}
|
Fix issue of singleton causing false-positives during running of full test-suite
|
Fix issue of singleton causing false-positives during running of full test-suite
Commit 0de2fbaf70a6617a00243c26871cda53bafb3101 introduced a `DummyFormatter` which is intended to throw an exception during invoking of the formatter.
Related tests capture this exception.
However, since most tests use the `SupurlativeOptions.Defaults` singleton, other tests adding formatters get passed to tests not expecting this formatters.
And, based on the ordering of when tests are executed (seems random between VS2013, VS2015, command-line runners), some tests get the `DummyFormatter` which causes that test to throw a false-positive.
This behavior is interesting since the previous assumption is that each test is run independently and the full-stack is tore down and rebuilt between tests.
New behavior retains static defaults property (to retain backwards compatibility), but now creates a new instance with each call.
A better approach might include just resetting formatters within the test-suite.
|
C#
|
mit
|
kendaleiv/Supurlative,ritterim/Supurlative,billboga/Supurlative
|
732d2a7d75c2b35977c0056c4b34ef26678766ae
|
src/GifWin/Data/GifWinDatabaseHelper.cs
|
src/GifWin/Data/GifWinDatabaseHelper.cs
|
using Microsoft.Data.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GifWin.Data
{
class GifWinDatabaseHelper : IDisposable
{
GifWinContext db;
public GifWinDatabaseHelper()
{
db = new GifWinContext();
}
public async Task<int> ConvertGifWitLibraryAsync(GifWitLibrary librarySource)
{
foreach (var entry in librarySource) {
var newGif = new GifEntry {
Url = entry.Url.ToString(),
AddedAt = DateTimeOffset.UtcNow,
};
foreach (var tag in entry.KeywordString.Split(' ')) {
newGif.Tags.Add(new GifTag { Tag = tag });
}
db.Gifs.Add(newGif);
}
return await db.SaveChangesAsync().ConfigureAwait(false);
}
public async Task<IEnumerable<GifEntry>> LoadAllGifsAsync()
{
return await db.Gifs.Include(ge => ge.Tags).ToArrayAsync().ConfigureAwait(false);
}
private bool disposedValue = false;
protected virtual void Dispose(bool disposing)
{
if (!disposedValue) {
if (disposing) {
db.Dispose();
}
disposedValue = true;
}
}
public void Dispose()
{
Dispose(true);
}
}
}
|
using Microsoft.Data.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GifWin.Data
{
class GifWinDatabaseHelper : IDisposable
{
GifWinContext db;
public GifWinDatabaseHelper()
{
db = new GifWinContext();
}
public async Task<int> ConvertGifWitLibraryAsync(GifWitLibrary librarySource)
{
foreach (var entry in librarySource) {
var newGif = new GifEntry {
Url = entry.Url.ToString(),
AddedAt = DateTimeOffset.UtcNow,
};
foreach (var tag in entry.KeywordString.Split(' ')) {
newGif.Tags.Add(new GifTag { Tag = tag });
}
db.Gifs.Add(newGif);
}
return await db.SaveChangesAsync().ConfigureAwait(false);
}
public async Task RecordGifUsageAsync(int gifId)
{
var gif = await db.Gifs.SingleOrDefaultAsync(ge => ge.Id == gifId).ConfigureAwait(false);
if (gif != null) {
var ts = DateTimeOffset.UtcNow;
var usage = new GifUsage();
gif.LastUsed = usage.UsedAt = ts;
gif.Usages.Add(usage);
await db.SaveChangesAsync().ConfigureAwait(false);
}
}
public async Task<IQueryable<GifEntry>> LoadAllGifsAsync()
{
var query = db.Gifs.Include(ge => ge.Tags);
await query.LoadAsync().ConfigureAwait(false);
return query;
}
private bool disposedValue = false;
protected virtual void Dispose(bool disposing)
{
if (!disposedValue) {
if (disposing) {
db.Dispose();
}
disposedValue = true;
}
}
public void Dispose()
{
Dispose(true);
}
}
}
|
Add way to record usage, fix LoadAllGifsAsync
|
Add way to record usage, fix LoadAllGifsAsync
Avoid some of the overhead of calling .ToArrayAsync() by
calling LoadAsync.
|
C#
|
mit
|
bojanrajkovic/GifWin
|
6fff253d07e459f72b41f4e3dcd0597c54472597
|
src/Activities/SyncActivity.cs
|
src/Activities/SyncActivity.cs
|
using System;
using System.Threading.Tasks;
namespace MicroFlow
{
public abstract class SyncActivity<TResult> : Activity<TResult>
{
public sealed override Task<TResult> Execute()
{
var tcs = new TaskCompletionSource<TResult>();
try
{
TResult result = ExecuteActivity();
tcs.TrySetResult(result);
}
catch (Exception ex)
{
tcs.TrySetException(ex);
}
return tcs.Task;
}
protected abstract TResult ExecuteActivity();
}
public abstract class SyncActivity : Activity
{
protected sealed override Task ExecuteCore()
{
var tcs = new TaskCompletionSource<Null>();
try
{
ExecuteActivity();
tcs.TrySetResult(null);
}
catch (Exception ex)
{
tcs.TrySetException(ex);
}
return tcs.Task;
}
protected abstract void ExecuteActivity();
}
}
|
using System;
using System.Threading.Tasks;
namespace MicroFlow
{
public abstract class SyncActivity<TResult> : Activity<TResult>
{
public sealed override Task<TResult> Execute()
{
try
{
TResult result = ExecuteActivity();
return TaskHelper.FromResult(result);
}
catch (Exception ex)
{
return TaskHelper.FromException<TResult>(ex);
}
}
protected abstract TResult ExecuteActivity();
}
public abstract class SyncActivity : Activity
{
protected sealed override Task ExecuteCore()
{
try
{
ExecuteActivity();
return TaskHelper.CompletedTask;
}
catch (Exception ex)
{
return TaskHelper.FromException(ex);
}
}
protected abstract void ExecuteActivity();
}
}
|
Use `TaskHelper` instead of TCS
|
Use `TaskHelper` instead of TCS
|
C#
|
mit
|
akarpov89/MicroFlow
|
7394b3593f50d852439f0f61467c0ed07c818639
|
Akavache.Mobile/Registrations.cs
|
Akavache.Mobile/Registrations.cs
|
using Newtonsoft.Json;
using ReactiveUI.Mobile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Akavache.Mobile
{
public class Registrations : IWantsToRegisterStuff
{
public void Register(Action<Func<object>, Type, string> registerFunction)
{
registerFunction(() => new JsonSerializerSettings()
{
ObjectCreationHandling = ObjectCreationHandling.Replace,
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
TypeNameHandling = TypeNameHandling.All,
}, typeof(JsonSerializerSettings), null);
var akavacheDriver = new AkavacheDriver();
registerFunction(() => akavacheDriver, typeof(ISuspensionDriver), null);
#if APPKIT || UIKIT
registerFunction(() => new MacFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif
#if ANDROID
registerFunction(() => new AndroidFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif
}
}
}
|
using Newtonsoft.Json;
using ReactiveUI.Mobile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#if UIKIT
using MonoTouch.Foundation;
using ReactiveUI.Mobile;
#endif
#if APPKIT
using MonoMac.Foundation;
#endif
#if ANDROID
using Android.App;
#endif
#if APPKIT
namespace Akavache.Mac
#else
namespace Akavache.Mobile
#endif
{
public class Registrations : IWantsToRegisterStuff
{
public void Register(Action<Func<object>, Type, string> registerFunction)
{
registerFunction(() => new JsonSerializerSettings()
{
ObjectCreationHandling = ObjectCreationHandling.Replace,
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
TypeNameHandling = TypeNameHandling.All,
}, typeof(JsonSerializerSettings), null);
var akavacheDriver = new AkavacheDriver();
registerFunction(() => akavacheDriver, typeof(ISuspensionDriver), null);
#if APPKIT || UIKIT
BlobCache.ApplicationName = NSBundle.MainBundle.BundleIdentifier;
registerFunction(() => new MacFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif
#if ANDROID
var ai = Application.Context.PackageManager.GetApplicationInfo(Application.Context.PackageName, 0);
BlobCache.ApplicationName = ai.LoadLabel(Application.Context.PackageManager);
registerFunction(() => new AndroidFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif
}
}
}
|
Bring back setting the app name based on the package info
|
Bring back setting the app name based on the package info
|
C#
|
mit
|
gimsum/Akavache,MathieuDSTP/MyAkavache,shana/Akavache,bbqchickenrobot/Akavache,PureWeen/Akavache,akavache/Akavache,mms-/Akavache,jcomtois/Akavache,MarcMagnin/Akavache,Loke155/Akavache,ghuntley/AkavacheSandpit,shiftkey/Akavache,christer155/Akavache,kmjonmastro/Akavache,martijn00/Akavache,shana/Akavache
|
da369d96c93948d0561a16440a1054a97511db6f
|
src/HtmlLogger/Model/LogCategory.cs
|
src/HtmlLogger/Model/LogCategory.cs
|
namespace HtmlLogger.Model
{
public enum LogCategory
{
Info,
Error
}
}
|
namespace HtmlLogger.Model
{
public enum LogCategory
{
Info,
Warning,
Error
}
}
|
Add Warning value to the enumeration.
|
Add Warning value to the enumeration.
|
C#
|
mit
|
Binjaaa/BasicHtmlLogger,Binjaaa/BasicHtmlLogger,Binjaaa/BasicHtmlLogger
|
16ed3248093e58c2159e7d9c353ff3398db45208
|
LibPhoneNumber.Contrib/Properties/AssemblyInfo.cs
|
LibPhoneNumber.Contrib/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("LibPhoneNumber.Contrib")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LibPhoneNumber.Contrib")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9ea084a1-6add-4b90-97fe-5ec441b8cb76")]
[assembly: AssemblyVersion(AssemblyMeta.Version)]
[assembly: AssemblyFileVersion(AssemblyMeta.Version)]
[assembly: AssemblyInformationalVersion(AssemblyMeta.Version)]
internal static class AssemblyMeta
{
public const string Version = "1.1.2";
}
|
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("LibPhoneNumber.Contrib")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LibPhoneNumber.Contrib")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9ea084a1-6add-4b90-97fe-5ec441b8cb76")]
[assembly: AssemblyVersion(AssemblyMeta.Version)]
[assembly: AssemblyFileVersion(AssemblyMeta.Version)]
[assembly: AssemblyInformationalVersion(AssemblyMeta.Version)]
internal static class AssemblyMeta
{
public const string Version = "1.2.0";
}
|
Update the assembly version for LibPhoneNumber.Contrib since we added a new extension method.
|
Update the assembly version for LibPhoneNumber.Contrib since we added a new extension method.
|
C#
|
mit
|
Smartrak/Smartrak.Library
|
a28c7d89c4d77cbe4dab7ea18bf191255c0c7612
|
Backend/Mono/Nonagon.Modular/DataModuleInterface.cs
|
Backend/Mono/Nonagon.Modular/DataModuleInterface.cs
|
using ServiceStack.OrmLite;
namespace Nonagon.Modular
{
/// <summary>
/// Data module interface base class.
/// </summary>
public abstract class DataModuleInterface : ModuleInterface, IDataModuleInterface
{
/// <summary>
/// Gets or sets the db connection factory.
/// </summary>
/// <value>The db connection factory.</value>
public IDbConnectionFactory DbConnectionFactory { get; private set; }
public DataModuleInterface(IDbConnectionFactory dbConnectionFactory)
{
DbConnectionFactory = dbConnectionFactory;
}
/// <summary>
/// Resolve the instance of operation from type parameter.
/// </summary>
/// <typeparam name="TOperation">The IDataModuleOperation to be instantiated.</typeparam>
protected override TOperation Resolve<TOperation>()
{
TOperation opt = base.Resolve<TOperation>();
if(opt is IDataModuleOperation)
(opt as IDataModuleOperation).DbConnectionFactory = DbConnectionFactory;
return opt;
}
}
}
|
using ServiceStack.OrmLite;
namespace Nonagon.Modular
{
/// <summary>
/// Data module interface base class.
/// </summary>
public abstract class DataModuleInterface : ModuleInterface, IDataModuleInterface
{
/// <summary>
/// Gets or sets the db connection factory.
/// </summary>
/// <value>The db connection factory.</value>
public IDbConnectionFactory DbConnectionFactory { get; private set; }
protected DataModuleInterface(IDbConnectionFactory dbConnectionFactory)
{
DbConnectionFactory = dbConnectionFactory;
}
/// <summary>
/// Resolve the instance of operation from type parameter.
/// </summary>
/// <typeparam name="TOperation">The IDataModuleOperation to be instantiated.</typeparam>
protected override TOperation Resolve<TOperation>()
{
TOperation opt = base.Resolve<TOperation>();
var iDataModuleOperation = opt as IDataModuleOperation;
if(iDataModuleOperation != null)
iDataModuleOperation.DbConnectionFactory = DbConnectionFactory;
return opt;
}
}
}
|
Fix code as suggested by compiler.
|
Fix code as suggested by compiler.
|
C#
|
bsd-3-clause
|
Nonagon-x/Nonagon.Modular
|
f17bb5b571f97e83ce95481128e49753e2409107
|
src/dotnet-setversion/Options.cs
|
src/dotnet-setversion/Options.cs
|
using System.Collections.Generic;
using CommandLine;
using CommandLine.Text;
namespace dotnet_setversion
{
public class Options
{
[Option('r', "recursive", Default = false, HelpText =
"Recursively search the current directory for csproj files and apply the given version to all files found. " +
"Mutually exclusive to the csprojFile argument.")]
public bool Recursive { get; set; }
[Value(0, MetaName = "version", HelpText = "The version to apply to the given csproj file(s).",
Required = true)]
public string Version { get; set; }
[Value(1, MetaName = "csprojFile", Required = false, HelpText =
"Path to a csproj file to apply the given version. Mutually exclusive to the --recursive option.")]
public string CsprojFile { get; set; }
[Usage(ApplicationAlias = "dotnet setversion")]
public static IEnumerable<Example> Examples
{
get
{
yield return new Example("Directory with a single csproj file", new Options {Version = "1.2.3"});
yield return new Example("Explicitly specifying a csproj file",
new Options {Version = "1.2.3", CsprojFile = "MyProject.csproj"});
yield return new Example("Large repo with multiple csproj files in nested directories",
new UnParserSettings {PreferShortName = true}, new Options {Version = "1.2.3", Recursive = true});
}
}
}
}
|
using System.Collections.Generic;
using CommandLine;
using CommandLine.Text;
namespace dotnet_setversion
{
public class Options
{
[Option('r', "recursive", Default = false, HelpText =
"Recursively search the current directory for csproj files and apply the given version to all files found. " +
"Mutually exclusive to the csprojFile argument.")]
public bool Recursive { get; set; }
[Value(0, MetaName = "version", HelpText = "The version to apply to the given csproj file(s).",
Required = true)]
public string Version { get; set; }
[Value(1, MetaName = "csprojFile", Required = false, HelpText =
"Path to a csproj file to apply the given version. Mutually exclusive to the --recursive option.")]
public string CsprojFile { get; set; }
[Usage(ApplicationAlias = "setversion")]
public static IEnumerable<Example> Examples
{
get
{
yield return new Example("Directory with a single csproj file", new Options {Version = "1.2.3"});
yield return new Example("Explicitly specifying a csproj file",
new Options {Version = "1.2.3", CsprojFile = "MyProject.csproj"});
yield return new Example("Large repo with multiple csproj files in nested directories",
new UnParserSettings {PreferShortName = true}, new Options {Version = "1.2.3", Recursive = true});
}
}
}
}
|
Update alias in usage examples
|
Update alias in usage examples
Renamed alias from "dotnet setversion" to just "setversion" to reflect that this tool is a global .NET Core tool.
|
C#
|
mit
|
TAGC/dotnet-setversion
|
de8271ad6bff2193377e12fafbccf0953d99402d
|
osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs
|
osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Beatmaps;
using osu.Game.Rulesets.Mania.Objects;
using System;
using System.Collections.Generic;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using System.Linq;
namespace osu.Game.Rulesets.Mania.Beatmaps
{
public class ManiaBeatmapConverter : BeatmapConverter<ManiaHitObject>
{
protected override IEnumerable<Type> ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) };
protected override Beatmap<ManiaHitObject> ConvertBeatmap(Beatmap original)
{
// Todo: This should be cased when we get better conversion methods
var converter = new LegacyConverter(original);
return new Beatmap<ManiaHitObject>
{
BeatmapInfo = original.BeatmapInfo,
TimingInfo = original.TimingInfo,
HitObjects = original.HitObjects.SelectMany(converter.Convert).ToList()
};
}
protected override IEnumerable<ManiaHitObject> ConvertHitObject(HitObject original, Beatmap beatmap)
{
// Handled by the LegacyConvereter
yield return null;
}
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Beatmaps;
using osu.Game.Rulesets.Mania.Objects;
using System;
using System.Collections.Generic;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using System.Linq;
namespace osu.Game.Rulesets.Mania.Beatmaps
{
public class ManiaBeatmapConverter : BeatmapConverter<ManiaHitObject>
{
protected override IEnumerable<Type> ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) };
protected override Beatmap<ManiaHitObject> ConvertBeatmap(Beatmap original)
{
// Todo: This should be cased when we get better conversion methods
var converter = new LegacyConverter(original);
return new Beatmap<ManiaHitObject>
{
BeatmapInfo = original.BeatmapInfo,
TimingInfo = original.TimingInfo,
// We need to sort here, because the converter generates patterns
HitObjects = original.HitObjects.SelectMany(converter.Convert).OrderBy(h => h.StartTime).ToList()
};
}
protected override IEnumerable<ManiaHitObject> ConvertHitObject(HitObject original, Beatmap beatmap)
{
// Handled by the LegacyConvereter
yield return null;
}
}
}
|
Fix out of range exceptions due to out-of-order hitobjects.
|
Fix out of range exceptions due to out-of-order hitobjects.
|
C#
|
mit
|
peppy/osu,UselessToucan/osu,naoey/osu,smoogipoo/osu,osu-RP/osu-RP,Nabile-Rahmani/osu,EVAST9919/osu,2yangk23/osu,smoogipooo/osu,johnneijzen/osu,NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,naoey/osu,Damnae/osu,johnneijzen/osu,UselessToucan/osu,UselessToucan/osu,ppy/osu,ZLima12/osu,tacchinotacchi/osu,peppy/osu,smoogipoo/osu,naoey/osu,ppy/osu,Drezi126/osu,ZLima12/osu,peppy/osu-new,NeoAdonis/osu,Frontear/osuKyzer,EVAST9919/osu,DrabWeb/osu,DrabWeb/osu,DrabWeb/osu,peppy/osu,ppy/osu,2yangk23/osu
|
186d43366f08e9e6d6c50e3bb33afeb34a7054d0
|
HouseCannith.Frontend/Program.cs
|
HouseCannith.Frontend/Program.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
namespace HouseCannith_Frontend
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseUrls("https://localhost:5001")
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
namespace HouseCannith_Frontend
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
// This URL is only applicable to Development - when run behind a reverse-proxy IIS
// instance (like Azure App Service does in production), this is overriden
.UseUrls("https://localhost:5001")
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
}
}
}
|
Add comment explaining UseUrls usage
|
Add comment explaining UseUrls usage
|
C#
|
mit
|
dbjorge/housecannith,dbjorge/housecannith,dbjorge/housecannith
|
eeda7820bf1c779d4728f901039f268117d1bc91
|
source/XeroApi/Model/Payment.cs
|
source/XeroApi/Model/Payment.cs
|
using System;
namespace XeroApi.Model
{
public class Payment : EndpointModelBase
{
[ItemId]
public Guid? PaymentID { get; set; }
public DateTime Date { get; set; }
public decimal Amount { get; set; }
public string Reference { get; set; }
public decimal? CurrencyRate { get; set; }
public string PaymentType { get; set; }
public string Status { get; set; }
[ItemUpdatedDate]
public DateTime? UpdatedDateUTC { get; set; }
public Account Account { get; set; }
public Invoice Invoice { get; set; }
}
public class Payments : ModelList<Payment>
{
}
}
|
using System;
namespace XeroApi.Model
{
public class Payment : EndpointModelBase
{
[ItemId]
public Guid? PaymentID { get; set; }
public DateTime Date { get; set; }
public decimal Amount { get; set; }
public string Reference { get; set; }
public decimal? CurrencyRate { get; set; }
public string PaymentType { get; set; }
public string Status { get; set; }
public bool IsReconciled { get; set; }
[ItemUpdatedDate]
public DateTime? UpdatedDateUTC { get; set; }
public Account Account { get; set; }
public Invoice Invoice { get; set; }
}
public class Payments : ModelList<Payment>
{
}
}
|
Allow payments to be marked as reconciled
|
Allow payments to be marked as reconciled
Update with version 2.43
|
C#
|
mit
|
TDaphneB/XeroAPI.Net,XeroAPI/XeroAPI.Net,MatthewSteeples/XeroAPI.Net,jcvandan/XeroAPI.Net
|
c98c761a8024de92a94c4ba060629d62c9505159
|
src/LibSassGen/CodeGenerator.cs
|
src/LibSassGen/CodeGenerator.cs
|
using System;
using System.IO;
namespace LibSassGen
{
public partial class CodeGenerator
{
private const string DefaultIncludeDir = @"../../../../../libsass/include";
private const string DefaultOutputFilePath = @"../../../../SharpScss/LibSass.Generated.cs";
private const int IndentMultiplier = 4;
private int _indentLevel;
private TextWriter _writer;
private TextWriter _writerBody;
private TextWriter _writerGlobal;
public bool OutputToConsole { get; set; }
public void Run()
{
var outputFilePath = Path.Combine(Environment.CurrentDirectory, DefaultOutputFilePath);
outputFilePath = Path.GetFullPath(outputFilePath);
_writerGlobal = new StringWriter();
_writerBody = new StringWriter();
ParseAndWrite();
var finalWriter = OutputToConsole
? Console.Out
: new StreamWriter(outputFilePath);
finalWriter.Write(_writerGlobal);
if (!OutputToConsole)
{
finalWriter.Flush();
finalWriter.Dispose();
finalWriter = null;
}
}
}
}
|
using System;
using System.IO;
namespace LibSassGen
{
public partial class CodeGenerator
{
private const string DefaultIncludeDir = @"../../../../libsass/include";
private const string DefaultOutputFilePath = @"../../../SharpScss/LibSass.Generated.cs";
private const int IndentMultiplier = 4;
private int _indentLevel;
private TextWriter _writer;
private TextWriter _writerBody;
private TextWriter _writerGlobal;
public bool OutputToConsole { get; set; }
public void Run()
{
var outputFilePath = Path.Combine(Environment.CurrentDirectory, DefaultOutputFilePath);
outputFilePath = Path.GetFullPath(outputFilePath);
_writerGlobal = new StringWriter();
_writerBody = new StringWriter();
ParseAndWrite();
var finalWriter = OutputToConsole
? Console.Out
: new StreamWriter(outputFilePath);
finalWriter.Write(_writerGlobal);
if (!OutputToConsole)
{
finalWriter.Flush();
finalWriter.Dispose();
finalWriter = null;
}
}
}
}
|
Update code generator relative filepath
|
Update code generator relative filepath
|
C#
|
bsd-2-clause
|
xoofx/SharpScss,xoofx/SharpScss
|
28fb1221601afdf629420509ae4147953aa9c3b4
|
src/Xpdm.PurpleOnion/Program.cs
|
src/Xpdm.PurpleOnion/Program.cs
|
using System;
using System.IO;
using System.Security.Cryptography;
using Mono.Security;
using Mono.Security.Cryptography;
namespace Xpdm.PurpleOnion
{
class Program
{
private static void Main()
{
long count = 0;
while (true)
{
RSA pki = RSA.Create();
ASN1 asn = RSAExtensions.ToAsn1Key(pki);
byte[] hash = SHA1CryptoServiceProvider.Create().ComputeHash(asn.GetBytes());
string onion = ConvertExtensions.FromBytesToBase32String(hash).Substring(0,16).ToLowerInvariant();
if (onion.Contains("tor") || onion.Contains("mirror"))
{
Console.WriteLine("Found: " + onion);
Directory.CreateDirectory(onion);
File.WriteAllText(Path.Combine(onion, "pki.xml"), pki.ToXmlString(true));
File.WriteAllText(Path.Combine(onion, "private_key"), System.Convert.ToBase64String(PKCS8.PrivateKeyInfo.Encode(pki)));
File.WriteAllText(Path.Combine(onion, "hostname"), onion + ".onion");
}
Console.WriteLine(onion + " " + ++count);
}
}
}
}
|
using System;
using System.IO;
using System.Security.Cryptography;
using Mono.Security;
using Mono.Security.Cryptography;
namespace Xpdm.PurpleOnion
{
static class Program
{
private static void Main()
{
long count = 0;
while (true)
{
RSA pki = RSA.Create();
ASN1 asn = RSAExtensions.ToAsn1Key(pki);
byte[] hash = SHA1CryptoServiceProvider.Create().ComputeHash(asn.GetBytes());
string onion = ConvertExtensions.FromBytesToBase32String(hash).Substring(0,16).ToLowerInvariant();
if (onion.Contains("tor") || onion.Contains("mirror"))
{
Console.WriteLine("Found: " + onion);
Directory.CreateDirectory(onion);
File.WriteAllText(Path.Combine(onion, "pki.xml"), pki.ToXmlString(true));
File.WriteAllText(Path.Combine(onion, "private_key"), System.Convert.ToBase64String(PKCS8.PrivateKeyInfo.Encode(pki)));
File.WriteAllText(Path.Combine(onion, "hostname"), onion + ".onion");
}
Console.WriteLine(onion + " " + ++count);
}
}
}
}
|
Make main program class static
|
Make main program class static
(Gendarme:AvoidConstructorsInStaticTypes)
|
C#
|
bsd-3-clause
|
printerpam/purpleonion,neoeinstein/purpleonion,printerpam/purpleonion
|
94fbba76bf11440c0d97403c4123247b69e31af3
|
GoldenAnvil.Utility.Windows/EnumToDisplayStringConverter.cs
|
GoldenAnvil.Utility.Windows/EnumToDisplayStringConverter.cs
|
using System;
using System.Resources;
using System.Windows.Data;
namespace GoldenAnvil.Utility.Windows
{
public sealed class EnumToDisplayStringConverter : IValueConverter
{
public static readonly EnumToDisplayStringConverter Instance = new EnumToDisplayStringConverter();
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (!(parameter is ResourceManager resources))
throw new ArgumentException($"{nameof(parameter)} must be a ResourceManager.");
var method = typeof(ResourceManagerUtility).GetMethod("EnumToDisplayString");
var generic = method.MakeGenericMethod(value.GetType());
return generic.Invoke(null, new [] { resources, value });
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
|
using System;
using System.Resources;
using System.Windows.Data;
namespace GoldenAnvil.Utility.Windows
{
public sealed class EnumToDisplayStringConverter : IValueConverter
{
public static readonly EnumToDisplayStringConverter Instance = new EnumToDisplayStringConverter();
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (!(parameter is ResourceManager resources))
throw new ArgumentException($"{nameof(parameter)} must be a ResourceManager.");
// sometimes an empty string can be passed instead of a null value
if (value is string stringValue)
{
if (stringValue == "")
return null;
}
var method = typeof(ResourceManagerUtility).GetMethod("EnumToDisplayString");
var generic = method.MakeGenericMethod(value.GetType());
return generic.Invoke(null, new [] { resources, value });
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
|
Fix crash when clearing resetting template
|
Fix crash when clearing resetting template
|
C#
|
mit
|
SaberSnail/GoldenAnvil.Utility
|
65a7c5e1226b82c8bc1d57effd6a7e22f3d27a8e
|
src/Smooth.IoC.Dapper.Repository.UnitOfWork/Data/IDbFactory.cs
|
src/Smooth.IoC.Dapper.Repository.UnitOfWork/Data/IDbFactory.cs
|
using System;
using System.Data;
namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Data
{
public interface IDbFactory
{
/// <summary>
/// Creates an instance of your ISession expanded interface
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns>ISession</returns>
T Create<T>() where T : class, ISession;
[Obsolete]
T CreateSession<T>() where T : class, ISession;
TUnitOfWork Create<TUnitOfWork, TSession>(IsolationLevel isolationLevel= IsolationLevel.Serializable) where TUnitOfWork : class, IUnitOfWork where TSession : class, ISession;
T Create<T>(IDbFactory factory, ISession session, IsolationLevel isolationLevel = IsolationLevel.Serializable) where T : class, IUnitOfWork;
void Release(IDisposable instance);
}
}
|
using System;
using System.Data;
namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Data
{
public interface IDbFactory
{
/// <summary>
/// Creates an instance of your ISession expanded interface
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns>ISession</returns>
T Create<T>() where T : class, ISession;
/// <summary>
/// Creates a UnitOfWork and Session at same time. The session has the same scope as the unit of work.
/// </summary>
/// <param name="isolationLevel"></param>
/// <typeparam name="TUnitOfWork"></typeparam>
/// <typeparam name="TSession"></typeparam>
/// <returns></returns>
TUnitOfWork Create<TUnitOfWork, TSession>(IsolationLevel isolationLevel= IsolationLevel.Serializable) where TUnitOfWork : class, IUnitOfWork where TSession : class, ISession;
/// <summary>
/// Used for Session base to create UnitOfWork. Not recommeded to use in other code
/// </summary>
/// <param name="factory"></param>
/// <param name="session"></param>
/// <param name="isolationLevel"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
T Create<T>(IDbFactory factory, ISession session, IsolationLevel isolationLevel = IsolationLevel.Serializable) where T : class, IUnitOfWork;
/// <summary>
/// Release the component. Done by Sessnion and UnitOfWork on there own.
/// </summary>
/// <param name="instance"></param>
void Release(IDisposable instance);
}
}
|
Remove obsolete methods and add sumary texts.
|
Remove obsolete methods and add sumary texts.
|
C#
|
mit
|
generik0/Smooth.IoC.Dapper.Repository.UnitOfWork,generik0/Smooth.IoC.Dapper.Repository.UnitOfWork
|
81f004f0aeedd4d241f23f9e7aee35de2d9bae5a
|
source/Playnite/CefTools.cs
|
source/Playnite/CefTools.cs
|
using CefSharp;
using CefSharp.Wpf;
using Playnite.Common;
using Playnite.Settings;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Playnite
{
public class CefTools
{
public static bool IsInitialized { get; private set; }
public static void ConfigureCef()
{
FileSystem.CreateDirectory(PlaynitePaths.BrowserCachePath);
var settings = new CefSettings();
settings.WindowlessRenderingEnabled = true;
if (settings.CefCommandLineArgs.ContainsKey("disable-gpu"))
{
settings.CefCommandLineArgs.Remove("disable-gpu");
}
if (settings.CefCommandLineArgs.ContainsKey("disable-gpu-compositing"))
{
settings.CefCommandLineArgs.Remove("disable-gpu-compositing");
}
settings.CefCommandLineArgs.Add("disable-gpu", "1");
settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1");
settings.CachePath = PlaynitePaths.BrowserCachePath;
settings.PersistSessionCookies = true;
settings.LogFile = Path.Combine(PlaynitePaths.ConfigRootPath, "cef.log");
IsInitialized = Cef.Initialize(settings);
}
public static void Shutdown()
{
Cef.Shutdown();
IsInitialized = false;
}
}
}
|
using CefSharp;
using CefSharp.Wpf;
using Playnite.Common;
using Playnite.Settings;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Playnite
{
public class CefTools
{
public static bool IsInitialized { get; private set; }
public static void ConfigureCef()
{
FileSystem.CreateDirectory(PlaynitePaths.BrowserCachePath);
var settings = new CefSettings();
settings.WindowlessRenderingEnabled = true;
if (settings.CefCommandLineArgs.ContainsKey("disable-gpu"))
{
settings.CefCommandLineArgs.Remove("disable-gpu");
}
if (settings.CefCommandLineArgs.ContainsKey("disable-gpu-compositing"))
{
settings.CefCommandLineArgs.Remove("disable-gpu-compositing");
}
settings.CefCommandLineArgs.Add("disable-gpu", "1");
settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1");
settings.CachePath = PlaynitePaths.BrowserCachePath;
settings.PersistSessionCookies = true;
settings.LogFile = Path.Combine(PlaynitePaths.ConfigRootPath, "cef.log");
settings.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0";
IsInitialized = Cef.Initialize(settings);
}
public static void Shutdown()
{
Cef.Shutdown();
IsInitialized = false;
}
}
}
|
Change default user agent for web views
|
Change default user agent for web views
|
C#
|
mit
|
JosefNemec/Playnite,JosefNemec/Playnite,JosefNemec/Playnite
|
ed264518b7dfea6d7f7366b2c03eca9baf24ec50
|
Framework/Pair.cs
|
Framework/Pair.cs
|
using System;
using System.Collections.Generic;
namespace TirkxDownloader.Framework
{
public sealed class Pair<TFirst, TSecond> : IEquatable<Pair<TFirst, TSecond>>
{
private readonly TFirst first;
private readonly TSecond second;
public Pair(TFirst first, TSecond second)
{
this.first = first;
this.second = second;
}
public TFirst First
{
get { return first; }
}
public TSecond Second
{
get { return second; }
}
public override bool Equals(Pair<TFirst, TSecond> other)
{
if (other == null)
{
return false;
}
return EqualityComparer<TFirst>.Default.Equals(first, other.first) &&
EqualityComparer<TSecond>.Default.Equals(second, other.second);
}
public override int GetHashCode()
{
return EqualityComparer<TFirst>.Default.GetHashCode(first) * 37 +
EqualityComparer<TSecond>.Default.GetHashCode(second);
}
}
}
|
using System;
using System.Collections.Generic;
namespace TirkxDownloader.Framework
{
public sealed class Pair<TFirst, TSecond> : IEquatable<Pair<TFirst, TSecond>>
{
private readonly TFirst first;
private readonly TSecond second;
public Pair(TFirst first, TSecond second)
{
this.first = first;
this.second = second;
}
public TFirst First
{
get { return first; }
}
public TSecond Second
{
get { return second; }
}
public bool Equals(Pair<TFirst, TSecond> other)
{
if (other == null)
{
return false;
}
return EqualityComparer<TFirst>.Default.Equals(first, other.first) &&
EqualityComparer<TSecond>.Default.Equals(second, other.second);
}
public override int GetHashCode()
{
return EqualityComparer<TFirst>.Default.GetHashCode(first) * 37 +
EqualityComparer<TSecond>.Default.GetHashCode(second);
}
}
}
|
Delete override keyword from Equals method to indicate that this method implement interface
|
Delete override keyword from Equals method to indicate that this method implement interface
|
C#
|
mit
|
witoong623/TirkxDownloader,witoong623/TirkxDownloader
|
06e92f7e92dc026c255d329404017ac2d8c24872
|
Tests/AirbrakeValidator.cs
|
Tests/AirbrakeValidator.cs
|
using System;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using NUnit.Framework;
namespace SharpBrake.Tests
{
public class AirbrakeValidator
{
public static void ValidateSchema(string xml)
{
var schema = GetXmlSchema();
XmlReaderSettings settings = new XmlReaderSettings
{
ValidationType = ValidationType.Schema,
};
var errorBuffer = new StringBuilder();
settings.ValidationEventHandler += (sender, args) => errorBuffer.AppendLine(args.Message);
settings.Schemas.Add(schema);
using (var reader = new StringReader(xml))
{
using (var xmlReader = new XmlTextReader(reader))
{
using (var validator = XmlReader.Create(xmlReader, settings))
{
while (validator.Read())
{
}
}
}
}
if (errorBuffer.Length > 0)
Assert.Fail(errorBuffer.ToString());
}
private static XmlSchema GetXmlSchema()
{
const string xsd = "hoptoad_2_1.xsd";
Type clientType = typeof(AirbrakeClient);
XmlSchema schema;
using (Stream schemaStream = clientType.Assembly.GetManifestResourceStream(clientType, xsd))
{
if (schemaStream == null)
Assert.Fail("{0}.{1} not found.", clientType.Namespace, xsd);
schema = XmlSchema.Read(schemaStream, (sender, args) => { });
}
return schema;
}
}
}
|
using System;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using NUnit.Framework;
namespace SharpBrake.Tests
{
public class AirbrakeValidator
{
public static void ValidateSchema(string xml)
{
var schema = GetXmlSchema();
XmlReaderSettings settings = new XmlReaderSettings
{
ValidationType = ValidationType.Schema,
};
var errorBuffer = new StringBuilder();
settings.ValidationEventHandler += (sender, args) => errorBuffer.AppendLine(args.Message);
settings.Schemas.Add(schema);
using (var reader = new StringReader(xml))
{
using (var xmlReader = new XmlTextReader(reader))
{
using (var validator = XmlReader.Create(xmlReader, settings))
{
while (validator.Read())
{
}
}
}
}
if (errorBuffer.Length > 0)
Assert.Fail(errorBuffer.ToString());
}
private static XmlSchema GetXmlSchema()
{
Type clientType = typeof(AirbrakeClient);
const string xsd = "hoptoad_2_1.xsd";
using (Stream schemaStream = clientType.Assembly.GetManifestResourceStream(clientType, xsd))
{
if (schemaStream == null)
Assert.Fail("{0}.{1} not found.", clientType.Namespace, xsd);
return XmlSchema.Read(schemaStream, (sender, args) => { });
}
}
}
}
|
Return instead of using a variable.
|
Return instead of using a variable.
|
C#
|
mit
|
airbrake/SharpBrake,kayoom/SharpBrake,cbtnuggets/SharpBrake,airbrake/SharpBrake
|
5a1654893223486ca082e6456c8994a25c377ae4
|
Alexa.NET.Management/IVendorApi.cs
|
Alexa.NET.Management/IVendorApi.cs
|
using Alexa.NET.Management.Vendors;
using Refit;
namespace Alexa.NET.Management
{
[Headers("Authorization: Bearer")]
public interface IVendorApi
{
[Get("/vendors")]
Vendor[] Get();
}
}
|
using System.Threading.Tasks;
using Alexa.NET.Management.Vendors;
using Refit;
namespace Alexa.NET.Management
{
[Headers("Authorization: Bearer")]
public interface IVendorApi
{
[Get("/vendors")]
Task<Vendor[]> Get();
}
}
|
Update vendor api to ensure task returned
|
Update vendor api to ensure task returned
|
C#
|
mit
|
stoiveyp/Alexa.NET.Management
|
a6efcc866fd11c0861c11fbbc87bfbf21fb80929
|
EndlessClient/XNAControlsDependencyContainer.cs
|
EndlessClient/XNAControlsDependencyContainer.cs
|
// Original Work Copyright (c) Ethan Moffat 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file
using EndlessClient.GameExecution;
using EOLib.DependencyInjection;
using Microsoft.Practices.Unity;
using Microsoft.Xna.Framework;
namespace EndlessClient
{
public class XNAControlsDependencyContainer : IInitializableContainer
{
public void RegisterDependencies(IUnityContainer container)
{
}
public void InitializeDependencies(IUnityContainer container)
{
var game = (Game)container.Resolve<IEndlessGame>();
XNAControls.GameRepository.SetGame(game);
//todo: remove this once converted to new XNAControls code
XNAControls.Old.XNAControls.Initialize(game);
XNAControls.Old.XNAControls.IgnoreEnterForDialogs = true;
XNAControls.Old.XNAControls.IgnoreEscForDialogs = true;
}
}
}
|
// Original Work Copyright (c) Ethan Moffat 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file
using EndlessClient.GameExecution;
using EOLib.DependencyInjection;
using Microsoft.Practices.Unity;
using Microsoft.Xna.Framework;
namespace EndlessClient
{
public class XNAControlsDependencyContainer : IInitializableContainer
{
public void RegisterDependencies(IUnityContainer container)
{
}
public void InitializeDependencies(IUnityContainer container)
{
var game = (Game)container.Resolve<IEndlessGame>();
XNAControls.GameRepository.SetGame(game);
}
}
}
|
Remove old XNAControls code from initialization. Crash & burn if old XNAControls are used.
|
Remove old XNAControls code from initialization. Crash & burn if old XNAControls are used.
|
C#
|
mit
|
ethanmoffat/EndlessClient
|
b2df0a0d29e94d1decd5c6be9cce94585ff1497e
|
Prism/Mods/Hooks/ModDefHooks.cs
|
Prism/Mods/Hooks/ModDefHooks.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using Prism.API;
namespace Prism.Mods.Hooks
{
class ModDefHooks : IHookManager
{
IEnumerable<Action>
onAllModsLoaded,
onUnload ,
preUpdate ,
postUpdate ;
public void Create()
{
onAllModsLoaded = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "OnAllModsLoaded");
onUnload = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "OnUnload" );
preUpdate = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "PreUpdate" );
postUpdate = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "PostUpdate" );
}
public void Clear ()
{
onAllModsLoaded = null;
onUnload = null;
postUpdate = null;
}
public void OnAllModsLoaded()
{
HookManager.Call(onAllModsLoaded);
}
public void OnUnload ()
{
HookManager.Call(onUnload);
}
public void PreUpdate ()
{
HookManager.Call(preUpdate);
}
public void PostUpdate ()
{
HookManager.Call(postUpdate);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using Prism.API;
namespace Prism.Mods.Hooks
{
class ModDefHooks : IHookManager
{
IEnumerable<Action>
onAllModsLoaded,
onUnload ,
preUpdate ,
postUpdate ;
public void Create()
{
onAllModsLoaded = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "OnAllModsLoaded");
onUnload = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "OnUnload" );
preUpdate = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "PreUpdate" );
postUpdate = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "PostUpdate" );
}
public void Clear ()
{
onAllModsLoaded = null;
onUnload = null;
preUpdate = null;
postUpdate = null;
}
public void OnAllModsLoaded()
{
HookManager.Call(onAllModsLoaded);
}
public void OnUnload ()
{
HookManager.Call(onUnload);
}
public void PreUpdate ()
{
HookManager.Call(preUpdate);
}
public void PostUpdate ()
{
HookManager.Call(postUpdate);
}
}
}
|
Set preUpdate to null with the rest of the hooks.
|
Set preUpdate to null with the rest of the hooks.
|
C#
|
artistic-2.0
|
Nopezal/Prism,Nopezal/Prism
|
3da596eedffd3d891b3a423b4e53027729cc1bfb
|
src/Umbraco.Web/PublishedCache/UmbracoContextPublishedSnapshotAccessor.cs
|
src/Umbraco.Web/PublishedCache/UmbracoContextPublishedSnapshotAccessor.cs
|
using System;
namespace Umbraco.Web.PublishedCache
{
public class UmbracoContextPublishedSnapshotAccessor : IPublishedSnapshotAccessor
{
private readonly IUmbracoContextAccessor _umbracoContextAccessor;
public UmbracoContextPublishedSnapshotAccessor(IUmbracoContextAccessor umbracoContextAccessor)
{
_umbracoContextAccessor = umbracoContextAccessor;
}
public IPublishedSnapshot PublishedSnapshot
{
get
{
var umbracoContext = _umbracoContextAccessor.UmbracoContext;
if (umbracoContext == null) throw new Exception("The IUmbracoContextAccessor could not provide an UmbracoContext.");
return umbracoContext.PublishedSnapshot;
}
set
{
throw new NotSupportedException(); // not ok to set
}
}
}
}
|
using System;
namespace Umbraco.Web.PublishedCache
{
public class UmbracoContextPublishedSnapshotAccessor : IPublishedSnapshotAccessor
{
private readonly IUmbracoContextAccessor _umbracoContextAccessor;
public UmbracoContextPublishedSnapshotAccessor(IUmbracoContextAccessor umbracoContextAccessor)
{
_umbracoContextAccessor = umbracoContextAccessor;
}
public IPublishedSnapshot PublishedSnapshot
{
get
{
var umbracoContext = _umbracoContextAccessor.UmbracoContext;
return umbracoContext?.PublishedSnapshot;
}
set => throw new NotSupportedException(); // not ok to set
}
}
}
|
Fix PublishedSnapshotAccessor to not throw but return null
|
Fix PublishedSnapshotAccessor to not throw but return null
|
C#
|
mit
|
tcmorris/Umbraco-CMS,bjarnef/Umbraco-CMS,leekelleher/Umbraco-CMS,tompipe/Umbraco-CMS,KevinJump/Umbraco-CMS,arknu/Umbraco-CMS,madsoulswe/Umbraco-CMS,umbraco/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,KevinJump/Umbraco-CMS,hfloyd/Umbraco-CMS,mattbrailsford/Umbraco-CMS,arknu/Umbraco-CMS,leekelleher/Umbraco-CMS,hfloyd/Umbraco-CMS,abryukhov/Umbraco-CMS,robertjf/Umbraco-CMS,leekelleher/Umbraco-CMS,rasmuseeg/Umbraco-CMS,lars-erik/Umbraco-CMS,robertjf/Umbraco-CMS,rasmuseeg/Umbraco-CMS,tcmorris/Umbraco-CMS,hfloyd/Umbraco-CMS,NikRimington/Umbraco-CMS,bjarnef/Umbraco-CMS,arknu/Umbraco-CMS,marcemarc/Umbraco-CMS,hfloyd/Umbraco-CMS,tompipe/Umbraco-CMS,mattbrailsford/Umbraco-CMS,bjarnef/Umbraco-CMS,leekelleher/Umbraco-CMS,umbraco/Umbraco-CMS,lars-erik/Umbraco-CMS,lars-erik/Umbraco-CMS,WebCentrum/Umbraco-CMS,hfloyd/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,umbraco/Umbraco-CMS,robertjf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abryukhov/Umbraco-CMS,KevinJump/Umbraco-CMS,NikRimington/Umbraco-CMS,bjarnef/Umbraco-CMS,KevinJump/Umbraco-CMS,tcmorris/Umbraco-CMS,umbraco/Umbraco-CMS,lars-erik/Umbraco-CMS,abjerner/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,WebCentrum/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,tcmorris/Umbraco-CMS,robertjf/Umbraco-CMS,tcmorris/Umbraco-CMS,robertjf/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,WebCentrum/Umbraco-CMS,marcemarc/Umbraco-CMS,KevinJump/Umbraco-CMS,mattbrailsford/Umbraco-CMS,tompipe/Umbraco-CMS,marcemarc/Umbraco-CMS,dawoe/Umbraco-CMS,dawoe/Umbraco-CMS,rasmuseeg/Umbraco-CMS,tcmorris/Umbraco-CMS,dawoe/Umbraco-CMS,abjerner/Umbraco-CMS,arknu/Umbraco-CMS,lars-erik/Umbraco-CMS,dawoe/Umbraco-CMS,madsoulswe/Umbraco-CMS,leekelleher/Umbraco-CMS,NikRimington/Umbraco-CMS,abjerner/Umbraco-CMS,madsoulswe/Umbraco-CMS
|
4ddd08cc9733abfa7859840782c331109e5b5627
|
src/MICore/NativeMethods.cs
|
src/MICore/NativeMethods.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Runtime.InteropServices;
namespace MICore
{
internal class NativeMethods
{
// TODO: It would be better to route these to the correct .so files directly rather than pasing through system.native.
[DllImport("System.Native", SetLastError = true)]
internal static extern int Kill(int pid, int mode);
[DllImport("System.Native", SetLastError = true)]
internal static extern int MkFifo(string name, int mode);
[DllImport("System.Native", SetLastError = true)]
internal static extern uint GetEUid();
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Runtime.InteropServices;
namespace MICore
{
internal class NativeMethods
{
private const string Libc = "libc";
[DllImport(Libc, EntryPoint = "kill", SetLastError = true)]
internal static extern int Kill(int pid, int mode);
[DllImport(Libc, EntryPoint = "mkfifo", SetLastError = true)]
internal static extern int MkFifo(string name, int mode);
[DllImport(Libc, EntryPoint = "geteuid", SetLastError = true)]
internal static extern uint GetEUid();
}
}
|
Change interop calls to directly pinvoke.
|
Change interop calls to directly pinvoke.
|
C#
|
mit
|
orbitcowboy/MIEngine,rajkumar42/MIEngine,caslan/MIEngine,edumunoz/MIEngine,csiusers/MIEngine,pieandcakes/MIEngine,wesrupert/MIEngine,edumunoz/MIEngine,caslan/MIEngine,chuckries/MIEngine,xingshenglu/MIEngine,devilman3d/MIEngine,wiktork/MIEngine,caslan/MIEngine,csiusers/MIEngine,orbitcowboy/MIEngine,Microsoft/MIEngine,wesrupert/MIEngine,rajkumar42/MIEngine,csiusers/MIEngine,edumunoz/MIEngine,faxue-msft/MIEngine,pieandcakes/MIEngine,xingshenglu/MIEngine,faxue-msft/MIEngine,orbitcowboy/MIEngine,wiktork/MIEngine,devilman3d/MIEngine,xingshenglu/MIEngine,orbitcowboy/MIEngine,faxue-msft/MIEngine,caslan/MIEngine,chuckries/MIEngine,wiktork/MIEngine,jacdavis/MIEngine,rajkumar42/MIEngine,devilman3d/MIEngine,pieandcakes/MIEngine,devilman3d/MIEngine,wesrupert/MIEngine,Microsoft/MIEngine,edumunoz/MIEngine,Microsoft/MIEngine,csiusers/MIEngine,pieandcakes/MIEngine,jacdavis/MIEngine,jacdavis/MIEngine,chuckries/MIEngine,faxue-msft/MIEngine,chuckries/MIEngine,wesrupert/MIEngine,Microsoft/MIEngine,rajkumar42/MIEngine
|
5eccd45a7ed9b4fddc9345fad1f7f63fa5d0adf3
|
src/runtime/Loader.cs
|
src/runtime/Loader.cs
|
using System;
using System.Text;
namespace Python.Runtime
{
using static Runtime;
[Obsolete("Only to be used from within Python")]
static class Loader
{
public unsafe static int Initialize(IntPtr data, int size)
{
try
{
var dllPath = Encoding.UTF8.GetString((byte*)data.ToPointer(), size);
if (!string.IsNullOrEmpty(dllPath))
{
PythonDLL = dllPath;
}
else
{
PythonDLL = null;
}
var gs = PyGILState_Ensure();
try
{
// Console.WriteLine("Startup thread");
PythonEngine.InitExt();
// Console.WriteLine("Startup finished");
}
finally
{
PyGILState_Release(gs);
}
}
catch (Exception exc)
{
Console.Error.Write(
$"Failed to initialize pythonnet: {exc}\n{exc.StackTrace}"
);
return 1;
}
return 0;
}
public unsafe static int Shutdown(IntPtr data, int size)
{
try
{
var command = Encoding.UTF8.GetString((byte*)data.ToPointer(), size);
if (command == "full_shutdown")
{
var gs = PyGILState_Ensure();
try
{
PythonEngine.Shutdown();
}
finally
{
PyGILState_Release(gs);
}
}
}
catch (Exception exc)
{
Console.Error.Write(
$"Failed to shutdown pythonnet: {exc}\n{exc.StackTrace}"
);
return 1;
}
return 0;
}
}
}
|
using System;
using System.Text;
namespace Python.Runtime
{
using static Runtime;
[Obsolete("Only to be used from within Python")]
static class Loader
{
public unsafe static int Initialize(IntPtr data, int size)
{
try
{
var dllPath = Encoding.UTF8.GetString((byte*)data.ToPointer(), size);
if (!string.IsNullOrEmpty(dllPath))
{
PythonDLL = dllPath;
}
else
{
PythonDLL = null;
}
using var _ = Py.GIL();
PythonEngine.InitExt();
}
catch (Exception exc)
{
Console.Error.Write(
$"Failed to initialize pythonnet: {exc}\n{exc.StackTrace}"
);
return 1;
}
return 0;
}
public unsafe static int Shutdown(IntPtr data, int size)
{
try
{
var command = Encoding.UTF8.GetString((byte*)data.ToPointer(), size);
if (command == "full_shutdown")
{
using var _ = Py.GIL();
PythonEngine.Shutdown();
}
}
catch (Exception exc)
{
Console.Error.Write(
$"Failed to shutdown pythonnet: {exc}\n{exc.StackTrace}"
);
return 1;
}
return 0;
}
}
}
|
Use Py.GIL directly, now that it doesn't try to init anymore
|
Use Py.GIL directly, now that it doesn't try to init anymore
|
C#
|
mit
|
pythonnet/pythonnet,pythonnet/pythonnet,pythonnet/pythonnet
|
5d0db6250b39f85cce2653edab728cc3e8e60aaa
|
Controllers/CommitsController.cs
|
Controllers/CommitsController.cs
|
using System;
using GitHubSharp.Models;
using System.Collections.Generic;
namespace GitHubSharp.Controllers
{
public class CommitsController : Controller
{
public RepositoryController RepositoryController { get; private set; }
public CommitController this[string key]
{
get { return new CommitController(Client, RepositoryController, key); }
}
public CommitsController(Client client, RepositoryController repo)
: base(client)
{
RepositoryController = repo;
}
public GitHubRequest<List<CommitModel>> GetAll(string sha = null)
{
if (sha == null)
return GitHubRequest.Get<List<CommitModel>>(Uri);
else
return GitHubRequest.Get<List<CommitModel>>(Uri, new { sha = sha });
}
public override string Uri
{
get { return RepositoryController.Uri + "/commits"; }
}
}
public class CommitController : Controller
{
public RepositoryController RepositoryController { get; private set; }
public string Sha { get; private set; }
public CommitCommentsController Comments
{
get { return new CommitCommentsController(Client, this); }
}
public CommitController(Client client, RepositoryController repositoryController, string sha)
: base(client)
{
RepositoryController = repositoryController;
Sha = sha;
}
public GitHubRequest<CommitModel> Get()
{
return GitHubRequest.Get<CommitModel>(Uri);
}
public override string Uri
{
get { return RepositoryController.Uri + "/commits/" + Sha; }
}
}
}
|
using System;
using GitHubSharp.Models;
using System.Collections.Generic;
namespace GitHubSharp.Controllers
{
public class CommitsController : Controller
{
public string FilePath { get; set; }
public RepositoryController RepositoryController { get; private set; }
public CommitController this[string key]
{
get { return new CommitController(Client, RepositoryController, key); }
}
public CommitsController(Client client, RepositoryController repo)
: base(client)
{
RepositoryController = repo;
}
public GitHubRequest<List<CommitModel>> GetAll(string sha = null)
{
if (sha == null)
return GitHubRequest.Get<List<CommitModel>>(Uri);
else
return GitHubRequest.Get<List<CommitModel>>(Uri, new { sha = sha });
}
public override string Uri
{
get { return RepositoryController.Uri + "/commits" + (string.IsNullOrEmpty(this.FilePath) ? string.Empty : "?path=" + this.FilePath); }
}
}
public class CommitController : Controller
{
public RepositoryController RepositoryController { get; private set; }
public string Sha { get; private set; }
public CommitCommentsController Comments
{
get { return new CommitCommentsController(Client, this); }
}
public CommitController(Client client, RepositoryController repositoryController, string sha)
: base(client)
{
RepositoryController = repositoryController;
Sha = sha;
}
public GitHubRequest<CommitModel> Get()
{
return GitHubRequest.Get<CommitModel>(Uri);
}
public override string Uri
{
get { return RepositoryController.Uri + "/commits/" + Sha; }
}
}
}
|
Support commit listing for single file within repository
|
Support commit listing for single file within repository
|
C#
|
mit
|
thedillonb/GitHubSharp
|
e5f8628e792b3e32e265a3c9ce75bd3aab7c5923
|
TargetAnimationPath.cs
|
TargetAnimationPath.cs
|
namespace ATP.AnimationPathTools {
public class TargetAnimationPath : AnimationPath {
}
}
|
using UnityEngine;
namespace ATP.AnimationPathTools {
public class TargetAnimationPath : AnimationPath {
/// <summary>
/// Color of the gizmo curve.
/// </summary>
private Color gizmoCurveColor = Color.magenta;
}
}
|
Set default target path gizmo curve color
|
Set default target path gizmo curve color
|
C#
|
mit
|
bartlomiejwolk/AnimationPathAnimator
|
cd0c3ba22122b4083c8cc31b2c830db215eaa4fe
|
TourOfCSharp6/Point.cs
|
TourOfCSharp6/Point.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TourOfCSharp6
{
public class Point
{
public double X { get; set; }
public double Y { get; set; }
public double Distance
{
get
{
return Math.Sqrt(X * X + Y * Y);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TourOfCSharp6
{
public class Point
{
public double X { get; set; }
public double Y { get; set; }
public double Distance => Math.Sqrt(X * X + Y * Y);
}
}
|
Convert Distance to Expression Bodied Member
|
Convert Distance to Expression Bodied Member
This gives a simpler version of the class.
|
C#
|
mit
|
BillWagner/TourOfCSharp6
|
e87b71d99e4c8d4063525428114848e9afe412a7
|
src/Global/GlobalAssemblyInfo.cs
|
src/Global/GlobalAssemblyInfo.cs
|
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[ assembly : ComVisible( false ) ]
[ assembly : AssemblyProduct( "ShipStationAccess" ) ]
[ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ]
[ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ]
[ assembly : AssemblyDescription( "ShipStation webservices API wrapper." ) ]
[ assembly : AssemblyTrademark( "" ) ]
[ assembly : AssemblyCulture( "" ) ]
[ assembly : CLSCompliant( false ) ]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
// Keep in track with CA API version
[ assembly : AssemblyVersion( "1.3.76.0" ) ]
|
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[ assembly : ComVisible( false ) ]
[ assembly : AssemblyProduct( "ShipStationAccess" ) ]
[ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ]
[ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ]
[ assembly : AssemblyDescription( "ShipStation webservices API wrapper." ) ]
[ assembly : AssemblyTrademark( "" ) ]
[ assembly : AssemblyCulture( "" ) ]
[ assembly : CLSCompliant( false ) ]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
// Keep in track with CA API version
[ assembly : AssemblyVersion( "1.3.75.0" ) ]
|
Revert "bump version again to 1.3.76.0"
|
Revert "bump version again to 1.3.76.0"
This reverts commit 0bbf8e1a07481611eb85b8913c55d1b0b9a867d2.
|
C#
|
bsd-3-clause
|
agileharbor/shipStationAccess
|
51a63210ca1c927e1343178ca903e6231823f10e
|
CertiPay.Common.Testing/TestExtensions.cs
|
CertiPay.Common.Testing/TestExtensions.cs
|
namespace CertiPay.Common.Testing
{
using ApprovalTests;
using Newtonsoft.Json;
using Ploeh.AutoFixture;
public static class TestExtensions
{
private static readonly Fixture _fixture = new Fixture { };
/// <summary>
/// Runs ApprovalTests's VerifyJson against a JSON.net serialized representation of the provided object
/// </summary>
public static void VerifyMe(this object obj)
{
var json = JsonConvert.SerializeObject(obj);
Approvals.VerifyJson(json);
}
/// <summary>
/// Returns an auto-initialized instance of the type T, filled via mock
/// data via AutoFixture.
///
/// This will not work for interfaces, only concrete types.
/// </summary>
public static T AutoGenerate<T>()
{
return _fixture.Create<T>();
}
}
}
|
namespace CertiPay.Common.Testing
{
using ApprovalTests;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Ploeh.AutoFixture;
public static class TestExtensions
{
private static readonly Fixture _fixture = new Fixture { };
private static readonly JsonSerializerSettings _settings = new JsonSerializerSettings
{
Formatting = Formatting.Indented
};
static TestExtensions()
{
_settings.Converters.Add(new StringEnumConverter { });
}
/// <summary>
/// Runs ApprovalTests's VerifyJson against a JSON.net serialized representation of the provided object
/// </summary>
public static void VerifyMe(this object obj)
{
var json = JsonConvert.SerializeObject(obj, _settings);
Approvals.VerifyJson(json);
}
/// <summary>
/// Returns an auto-initialized instance of the type T, filled via mock
/// data via AutoFixture.
///
/// This will not work for interfaces, only concrete types.
/// </summary>
public static T AutoGenerate<T>()
{
return _fixture.Create<T>();
}
}
}
|
Use StringEnumConvert for Approvals.VerifyJson / VerifyMe
|
Use StringEnumConvert for Approvals.VerifyJson / VerifyMe
Note, this is a breaking change if there are existing results with
enums in their output
|
C#
|
mit
|
mattgwagner/CertiPay.Common
|
8db44315204f31a29989ad09a2fd59fd49c93062
|
Software/CSharp/GrovePi/Sensors/Sensor.cs
|
Software/CSharp/GrovePi/Sensors/Sensor.cs
|
using System;
namespace GrovePi.Sensors
{
public abstract class Sensor<TSensorType> where TSensorType : class
{
protected readonly IGrovePi Device;
protected readonly Pin Pin;
internal Sensor(IGrovePi device, Pin pin, PinMode pinMode)
{
if (device == null) throw new ArgumentNullException(nameof(device));
device.PinMode(Pin, pinMode);
Device = device;
Pin = pin;
}
internal Sensor(IGrovePi device, Pin pin)
{
if (device == null) throw new ArgumentNullException(nameof(device));
Device = device;
Pin = pin;
}
public SensorStatus CurrentState => (SensorStatus) Device.DigitalRead(Pin);
public TSensorType ChangeState(SensorStatus newState)
{
Device.DigitalWrite(Pin, (byte) newState);
return this as TSensorType;
}
public void AnalogWrite(byte value)
{
Device.AnalogWrite(Pin,value);
}
}
}
|
using System;
namespace GrovePi.Sensors
{
public abstract class Sensor<TSensorType> where TSensorType : class
{
protected readonly IGrovePi Device;
protected readonly Pin Pin;
internal Sensor(IGrovePi device, Pin pin, PinMode pinMode)
{
if (device == null) throw new ArgumentNullException(nameof(device));
Device = device;
Pin = pin;
device.PinMode(Pin, pinMode);
}
internal Sensor(IGrovePi device, Pin pin)
{
if (device == null) throw new ArgumentNullException(nameof(device));
Device = device;
Pin = pin;
}
public SensorStatus CurrentState => (SensorStatus) Device.DigitalRead(Pin);
public TSensorType ChangeState(SensorStatus newState)
{
Device.DigitalWrite(Pin, (byte) newState);
return this as TSensorType;
}
public void AnalogWrite(byte value)
{
Device.AnalogWrite(Pin,value);
}
}
}
|
Fix bug in pinmode usage The device.PinMode was being set from internal members which had not been stored yet. Would result in Relay module not working as expected.
|
Fix bug in pinmode usage
The device.PinMode was being set from internal members which had not been stored yet. Would result in Relay module not working as expected.
|
C#
|
mit
|
penoud/GrovePi,penoud/GrovePi,karan259/GrovePi,karan259/GrovePi,karan259/GrovePi,karan259/GrovePi,rpedersen/GrovePi,rpedersen/GrovePi,rpedersen/GrovePi,karan259/GrovePi,karan259/GrovePi,rpedersen/GrovePi,rpedersen/GrovePi,karan259/GrovePi,rpedersen/GrovePi,penoud/GrovePi,karan259/GrovePi,penoud/GrovePi,rpedersen/GrovePi,rpedersen/GrovePi,penoud/GrovePi,penoud/GrovePi,penoud/GrovePi,penoud/GrovePi,karan259/GrovePi
|
912b3d15b5eadb5f1f8dc2781c60b31950888054
|
Enum/EnumListLambda.cs
|
Enum/EnumListLambda.cs
|
using System.Collections;
class IENumDemo
{
/// <summary>
/// Create a cosinus table enumerator with 0..360 deg values
/// </summary>
private IEnumerator costable = new Func<List<float>>(() =>
{
List<float> nn = new List<float>();
for (int v = 0; v < 360; v++)
{
nn.Add((float)Math.Cos(v * Math.PI / 180));
}
return nn;
}
)().GetEnumerator();
/// <summary>
/// Demonstrates eternal fetch of next value from an IEnumerator
/// At end of list the enumerator is reset to start of list
/// </summary>
/// <returns></returns>
private float GetaNum()
{
//Advance to next item
if (!costable.MoveNext())
{
//End of list - reset and advance to first
costable.Reset();
costable.MoveNext();
}
//Return Enum current value
yield return costable.Current;
}
}
|
using System.Collections;
class IENumDemo
{
/// <summary>
/// Create a cosinus table enumerator with 0..360 deg values
/// </summary>
private IEnumerator costable = new Func<List<float>>(() =>
{
List<float> nn = new List<float>();
for (int v = 0; v < 360; v++)
{
nn.Add((float)Math.Cos(v * Math.PI / 180));
}
return nn;
}
)().GetEnumerator();
/// <summary>
/// Demonstrates eternal fetch of next value from an IEnumerator
/// At end of list the enumerator is reset to start of list
/// </summary>
/// <returns></returns>
private float GetaNum()
{
//Advance to next item
if (!costable.MoveNext())
{
//End of list - reset and advance to first
costable.Reset();
costable.MoveNext();
}
//Return Enum current value
return costable.Current;
}
}
|
Revert "Now with "yield" in GetaNum()"
|
Revert "Now with "yield" in GetaNum()"
This reverts commit df203e6297237ad55c0dd216706a2035ed1a8bd3.
|
C#
|
mit
|
flodis/C-Sharp-Fragments
|
4a4d9b0dc6ef79a48c5718ae6d3e211095f0aa02
|
osu.Game.Rulesets.Osu/Mods/OsuModMirror.cs
|
osu.Game.Rulesets.Osu/Mods/OsuModMirror.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.Bindables;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Utils;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModMirror : ModMirror, IApplicableToHitObject
{
public override string Description => "Reflect the playfield.";
public override Type[] IncompatibleMods => new[] { typeof(ModHardRock) };
[SettingSource("Mirrored axes", "Choose which of the playfield's axes are mirrored.")]
public Bindable<MirrorType> Reflection { get; } = new Bindable<MirrorType>();
public void ApplyToHitObject(HitObject hitObject)
{
var osuObject = (OsuHitObject)hitObject;
switch (Reflection.Value)
{
case MirrorType.Horizontal:
OsuHitObjectGenerationUtils.ReflectHorizontally(osuObject);
break;
case MirrorType.Vertical:
OsuHitObjectGenerationUtils.ReflectVertically(osuObject);
break;
case MirrorType.Both:
OsuHitObjectGenerationUtils.ReflectHorizontally(osuObject);
OsuHitObjectGenerationUtils.ReflectVertically(osuObject);
break;
}
}
public enum MirrorType
{
Horizontal,
Vertical,
Both
}
}
}
|
// 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.Bindables;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Utils;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModMirror : ModMirror, IApplicableToHitObject
{
public override string Description => "Flip objects on the chosen axes.";
public override Type[] IncompatibleMods => new[] { typeof(ModHardRock) };
[SettingSource("Mirrored axes", "Choose which axes objects are mirrored over.")]
public Bindable<MirrorType> Reflection { get; } = new Bindable<MirrorType>();
public void ApplyToHitObject(HitObject hitObject)
{
var osuObject = (OsuHitObject)hitObject;
switch (Reflection.Value)
{
case MirrorType.Horizontal:
OsuHitObjectGenerationUtils.ReflectHorizontally(osuObject);
break;
case MirrorType.Vertical:
OsuHitObjectGenerationUtils.ReflectVertically(osuObject);
break;
case MirrorType.Both:
OsuHitObjectGenerationUtils.ReflectHorizontally(osuObject);
OsuHitObjectGenerationUtils.ReflectVertically(osuObject);
break;
}
}
public enum MirrorType
{
Horizontal,
Vertical,
Both
}
}
}
|
Update description to match mania mirror implementation
|
Update description to match mania mirror implementation
|
C#
|
mit
|
NeoAdonis/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,peppy/osu,ppy/osu,smoogipoo/osu,smoogipoo/osu,peppy/osu-new,UselessToucan/osu,smoogipooo/osu,UselessToucan/osu,UselessToucan/osu,smoogipoo/osu,ppy/osu,peppy/osu,ppy/osu
|
4cbe71f4882cec9d87b1739bb7ed7c40c422c438
|
Rant/Vocabulary/RantTableLoadException.cs
|
Rant/Vocabulary/RantTableLoadException.cs
|
using System;
using Rant.Localization;
namespace Rant.Vocabulary
{
/// <summary>
/// Thrown when Rant encounters an error while loading a dictionary table.
/// </summary>
public sealed class RantTableLoadException : Exception
{
internal RantTableLoadException(string origin, int line, int col, string messageType, params object[] messageArgs)
: base(Txtres.GetString("src-line-col", Txtres.GetString(messageType, messageArgs), line, col))
{
Line = line;
Column = col;
Origin = origin;
}
/// <summary>
/// Gets the line number on which the error occurred.
/// </summary>
public int Line { get; }
/// <summary>
/// Gets the column on which the error occurred.
/// </summary>
public int Column { get; }
/// <summary>
/// Gets a string describing where the table was loaded from. For tables loaded from disk, this will be the file path.
/// </summary>
public string Origin { get; }
}
}
|
using System;
using Rant.Localization;
namespace Rant.Vocabulary
{
/// <summary>
/// Thrown when Rant encounters an error while loading a dictionary table.
/// </summary>
public sealed class RantTableLoadException : Exception
{
internal RantTableLoadException(string origin, int line, int col, string messageType, params object[] messageArgs)
: base($"{Txtres.GetString("src-line-col", origin, line, col)} {Txtres.GetString(messageType, messageArgs)}")
{
Line = line;
Column = col;
Origin = origin;
}
/// <summary>
/// Gets the line number on which the error occurred.
/// </summary>
public int Line { get; }
/// <summary>
/// Gets the column on which the error occurred.
/// </summary>
public int Column { get; }
/// <summary>
/// Gets a string describing where the table was loaded from. For tables loaded from disk, this will be the file path.
/// </summary>
public string Origin { get; }
}
}
|
Fix formatting of table load errors
|
Fix formatting of table load errors
|
C#
|
mit
|
TheBerkin/Rant
|
e45fa431e957a64f7407a3a8a8958443bef80b1c
|
src/SaveWatcher.cs
|
src/SaveWatcher.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace BetterLoadSaveGame
{
class SaveWatcher : IDisposable
{
private FileSystemWatcher _watcher;
public event FileSystemEventHandler OnSave;
public SaveWatcher()
{
_watcher = new FileSystemWatcher(Util.SaveDir);
_watcher.Created += FileCreated;
_watcher.EnableRaisingEvents = true;
}
private void FileCreated(object sender, FileSystemEventArgs e)
{
if (OnSave != null)
{
OnSave(sender, e);
}
}
public void Dispose()
{
_watcher.Dispose();
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace BetterLoadSaveGame
{
class SaveWatcher : IDisposable
{
private FileSystemWatcher _watcher;
public event FileSystemEventHandler OnSave;
public SaveWatcher()
{
_watcher = new FileSystemWatcher(Util.SaveDir);
_watcher.Created += FileCreated;
_watcher.Changed += FileCreated;
_watcher.EnableRaisingEvents = true;
}
private void FileCreated(object sender, FileSystemEventArgs e)
{
if (OnSave != null)
{
OnSave(sender, e);
}
}
public void Dispose()
{
_watcher.Dispose();
}
}
}
|
Fix updating screenshots for quicksave
|
Fix updating screenshots for quicksave
|
C#
|
mit
|
jefftimlin/BetterLoadSaveGame
|
892482e94e165be8aea689b8d9b6573613c7b890
|
Common/NuGetConstants.cs
|
Common/NuGetConstants.cs
|
using System;
namespace NuGet
{
public static class NuGetConstants
{
public static readonly string DefaultFeedUrl = "https://go.microsoft.com/fwlink/?LinkID=230477";
public static readonly string V1FeedUrl = "https://go.microsoft.com/fwlink/?LinkID=206669";
public static readonly string DefaultGalleryServerUrl = "http://go.microsoft.com/fwlink/?LinkID=207106";
public static readonly string DefaultSymbolServerUrl = "http://nuget.gw.symbolsource.org/Public/NuGet";
}
}
|
using System;
namespace NuGet
{
public static class NuGetConstants
{
public static readonly string DefaultFeedUrl = "https://go.microsoft.com/fwlink/?LinkID=230477";
public static readonly string V1FeedUrl = "https://go.microsoft.com/fwlink/?LinkID=206669";
public static readonly string DefaultGalleryServerUrl = "https://www.nuget.org";
public static readonly string DefaultSymbolServerUrl = "http://nuget.gw.symbolsource.org/Public/NuGet";
}
}
|
Update default publishing url to point to v2 feed.
|
Update default publishing url to point to v2 feed.
--HG--
branch : 1.6
|
C#
|
apache-2.0
|
chocolatey/nuget-chocolatey,GearedToWar/NuGet2,xoofx/NuGet,jholovacs/NuGet,xoofx/NuGet,xoofx/NuGet,antiufo/NuGet2,alluran/node.net,jholovacs/NuGet,jholovacs/NuGet,OneGet/nuget,antiufo/NuGet2,xoofx/NuGet,mrward/nuget,themotleyfool/NuGet,mrward/NuGet.V2,indsoft/NuGet2,OneGet/nuget,OneGet/nuget,ctaggart/nuget,antiufo/NuGet2,alluran/node.net,GearedToWar/NuGet2,alluran/node.net,zskullz/nuget,ctaggart/nuget,indsoft/NuGet2,chocolatey/nuget-chocolatey,mrward/nuget,mono/nuget,RichiCoder1/nuget-chocolatey,rikoe/nuget,dolkensp/node.net,mrward/nuget,RichiCoder1/nuget-chocolatey,GearedToWar/NuGet2,GearedToWar/NuGet2,atheken/nuget,oliver-feng/nuget,pratikkagda/nuget,RichiCoder1/nuget-chocolatey,pratikkagda/nuget,indsoft/NuGet2,oliver-feng/nuget,GearedToWar/NuGet2,mrward/nuget,jmezach/NuGet2,indsoft/NuGet2,rikoe/nuget,themotleyfool/NuGet,RichiCoder1/nuget-chocolatey,xoofx/NuGet,dolkensp/node.net,themotleyfool/NuGet,zskullz/nuget,chester89/nugetApi,mono/nuget,akrisiun/NuGet,oliver-feng/nuget,jmezach/NuGet2,mrward/NuGet.V2,jholovacs/NuGet,oliver-feng/nuget,RichiCoder1/nuget-chocolatey,chocolatey/nuget-chocolatey,antiufo/NuGet2,mrward/NuGet.V2,jmezach/NuGet2,xoofx/NuGet,jholovacs/NuGet,xero-github/Nuget,zskullz/nuget,mrward/NuGet.V2,kumavis/NuGet,atheken/nuget,chocolatey/nuget-chocolatey,oliver-feng/nuget,mrward/nuget,mono/nuget,ctaggart/nuget,ctaggart/nuget,chocolatey/nuget-chocolatey,OneGet/nuget,RichiCoder1/nuget-chocolatey,zskullz/nuget,antiufo/NuGet2,chocolatey/nuget-chocolatey,indsoft/NuGet2,pratikkagda/nuget,jmezach/NuGet2,mono/nuget,rikoe/nuget,mrward/nuget,mrward/NuGet.V2,GearedToWar/NuGet2,dolkensp/node.net,pratikkagda/nuget,anurse/NuGet,rikoe/nuget,pratikkagda/nuget,oliver-feng/nuget,dolkensp/node.net,jholovacs/NuGet,jmezach/NuGet2,pratikkagda/nuget,mrward/NuGet.V2,chester89/nugetApi,akrisiun/NuGet,antiufo/NuGet2,alluran/node.net,kumavis/NuGet,indsoft/NuGet2,jmezach/NuGet2,anurse/NuGet
|
771df86f66ae777b7e616c70f0fa15ebc77a18f3
|
JustSaying.Models/Message.cs
|
JustSaying.Models/Message.cs
|
using System;
namespace JustSaying.Models
{
public abstract class Message
{
protected Message()
{
TimeStamp = DateTime.UtcNow;
Id = Guid.NewGuid();
}
public Guid Id { get; set; }
public DateTime TimeStamp { get; private set; }
public string RaisingComponent { get; set; }
public string Version{ get; private set; }
public string SourceIp { get; private set; }
public string Tenant { get; set; }
public string Conversation { get; set; }
//footprint in order to avoid the same message being processed multiple times.
public virtual string UniqueKey()
{
return Id.ToString();
}
}
}
|
using System;
namespace JustSaying.Models
{
public abstract class Message
{
protected Message()
{
TimeStamp = DateTime.UtcNow;
Id = Guid.NewGuid();
}
public Guid Id { get; set; }
public DateTime TimeStamp { get; set; }
public string RaisingComponent { get; set; }
public string Version{ get; private set; }
public string SourceIp { get; private set; }
public string Tenant { get; set; }
public string Conversation { get; set; }
//footprint in order to avoid the same message being processed multiple times.
public virtual string UniqueKey()
{
return Id.ToString();
}
}
}
|
Allow message TimeStamp to be set when deserializing
|
Allow message TimeStamp to be set when deserializing
Made TimeStamp property setter public so that Json.NET can restore it's state to whatever is in the json, rather than leaving it to the time of when it was deserialized.
|
C#
|
apache-2.0
|
Intelliflo/JustSaying,eric-davis/JustSaying,Intelliflo/JustSaying
|
5d659b38601b2620054b286c941a5d53f1da20ae
|
ReSharperTnT/Bootstrapper.cs
|
ReSharperTnT/Bootstrapper.cs
|
using System.Reflection;
using System.Web.Http;
using Autofac;
using Autofac.Integration.WebApi;
namespace ReSharperTnT
{
public class Bootstrapper
{
public static void Init()
{
var bootstrapper = new Bootstrapper();
var container = bootstrapper.CreateContainer();
var autofacWebApiDependencyResolver = new AutofacWebApiDependencyResolver(container);
GlobalConfiguration.Configuration.DependencyResolver = autofacWebApiDependencyResolver;
}
private readonly IContainer _container;
public Bootstrapper()
{
var builder = new ContainerBuilder();
builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
builder.RegisterAssemblyTypes(typeof (Bootstrapper).Assembly)
.AsImplementedInterfaces();
_container = builder.Build();
}
public IContainer CreateContainer()
{
return _container;
}
public T Get<T>()
{
return _container.Resolve<T>();
}
}
}
|
using System.Web.Http;
using Autofac;
using Autofac.Integration.WebApi;
namespace ReSharperTnT
{
public class Bootstrapper
{
static Bootstrapper()
{
Init();
}
public static void Init()
{
var bootstrapper = new Bootstrapper();
var container = bootstrapper.CreateContainer();
var autofacWebApiDependencyResolver = new AutofacWebApiDependencyResolver(container);
GlobalConfiguration.Configuration.DependencyResolver = autofacWebApiDependencyResolver;
}
private readonly IContainer _container;
public Bootstrapper()
{
var builder = new ContainerBuilder();
builder.RegisterAssemblyTypes(typeof (Bootstrapper).Assembly)
.AsImplementedInterfaces();
builder.RegisterAssemblyTypes(typeof (Bootstrapper).Assembly)
.Where(c=>c.Name.EndsWith("Controller"))
.AsSelf();
_container = builder.Build();
}
public IContainer CreateContainer()
{
return _container;
}
public T Get<T>()
{
return _container.Resolve<T>();
}
}
}
|
Revert "registration of api controllers fixed"
|
Revert "registration of api controllers fixed"
This reverts commit 390d797cd77acd347c5f42645ebd16c4e940190e.
|
C#
|
apache-2.0
|
borismod/ReSharperTnT,borismod/ReSharperTnT
|
814cafb7eb541a4080d6ac9e521f8ba2f39bf35b
|
src/SyncTrayzor/Utils/AtomicFileStream.cs
|
src/SyncTrayzor/Utils/AtomicFileStream.cs
|
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace SyncTrayzor.Utils
{
public class AtomicFileStream : FileStream
{
private const string DefaultTempFileSuffix = ".tmp";
private readonly string path;
private readonly string tempPath;
public AtomicFileStream(string path)
: this(path, TempFilePath(path))
{
}
public AtomicFileStream(string path, string tempPath)
: base(tempPath, FileMode.Create, FileAccess.ReadWrite)
{
this.path = path ?? throw new ArgumentNullException("path");
this.tempPath = tempPath ?? throw new ArgumentNullException("tempPath");
}
private static string TempFilePath(string path)
{
return path + DefaultTempFileSuffix;
}
public override void Close()
{
base.Close();
bool success = NativeMethods.MoveFileEx(this.tempPath, this.path, MoveFileFlags.ReplaceExisting | MoveFileFlags.WriteThrough);
if (!success)
Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error());
}
[Flags]
private enum MoveFileFlags
{
None = 0,
ReplaceExisting = 1,
CopyAllowed = 2,
DelayUntilReboot = 4,
WriteThrough = 8,
CreateHardlink = 16,
FailIfNotTrackable = 32,
}
private static class NativeMethods
{
[DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern bool MoveFileEx(
[In] string lpExistingFileName,
[In] string lpNewFileName,
[In] MoveFileFlags dwFlags);
}
}
}
|
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace SyncTrayzor.Utils
{
public class AtomicFileStream : FileStream
{
private const string DefaultTempFileSuffix = ".tmp";
private readonly string path;
private readonly string tempPath;
public AtomicFileStream(string path)
: this(path, TempFilePath(path))
{
}
public AtomicFileStream(string path, string tempPath)
: base(tempPath, FileMode.Create, FileAccess.ReadWrite)
{
this.path = path ?? throw new ArgumentNullException("path");
this.tempPath = tempPath ?? throw new ArgumentNullException("tempPath");
}
private static string TempFilePath(string path)
{
return path + DefaultTempFileSuffix;
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
bool success = NativeMethods.MoveFileEx(this.tempPath, this.path, MoveFileFlags.ReplaceExisting | MoveFileFlags.WriteThrough);
if (!success)
Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error());
}
[Flags]
private enum MoveFileFlags
{
None = 0,
ReplaceExisting = 1,
CopyAllowed = 2,
DelayUntilReboot = 4,
WriteThrough = 8,
CreateHardlink = 16,
FailIfNotTrackable = 32,
}
private static class NativeMethods
{
[DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern bool MoveFileEx(
[In] string lpExistingFileName,
[In] string lpNewFileName,
[In] MoveFileFlags dwFlags);
}
}
}
|
Fix possible cause of null bytes in config file
|
Fix possible cause of null bytes in config file
Relates to: #471
|
C#
|
mit
|
canton7/SyncTrayzor,canton7/SyncTrayzor,canton7/SyncTrayzor
|
a8f67e58088e06be3df6df51f35551d85db1f7f9
|
ApiCheck/Loader/AssemblyLoader.cs
|
ApiCheck/Loader/AssemblyLoader.cs
|
using System;
using System.IO;
using System.Reflection;
namespace ApiCheck.Loader
{
public sealed class AssemblyLoader : IDisposable
{
public AssemblyLoader()
{
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += CurrentDomainOnReflectionOnlyAssemblyResolve;
}
public void Dispose()
{
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve -= CurrentDomainOnReflectionOnlyAssemblyResolve;
}
private Assembly CurrentDomainOnReflectionOnlyAssemblyResolve(object sender, ResolveEventArgs args)
{
AssemblyName assemblyName = new AssemblyName(args.Name);
string path = Path.Combine(Path.GetDirectoryName(args.RequestingAssembly.Location), assemblyName.Name + ".dll");
if (File.Exists(path))
{
return Assembly.ReflectionOnlyLoadFrom(path);
}
return Assembly.ReflectionOnlyLoad(args.Name);
}
public Assembly ReflectionOnlyLoad(string path)
{
return Assembly.ReflectionOnlyLoadFrom(path);
}
}
}
|
using System;
using System.IO;
using System.Reflection;
namespace ApiCheck.Loader
{
public sealed class AssemblyLoader : IDisposable
{
public AssemblyLoader()
{
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += CurrentDomainOnReflectionOnlyAssemblyResolve;
}
public void Dispose()
{
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve -= CurrentDomainOnReflectionOnlyAssemblyResolve;
}
private Assembly CurrentDomainOnReflectionOnlyAssemblyResolve(object sender, ResolveEventArgs args)
{
AssemblyName assemblyName = new AssemblyName(args.Name);
string path = Path.Combine(Path.GetDirectoryName(args.RequestingAssembly.Location), assemblyName.Name + ".dll");
if (File.Exists(path))
{
return Assembly.ReflectionOnlyLoadFrom(path);
}
return Assembly.ReflectionOnlyLoad(AppDomain.CurrentDomain.ApplyPolicy(args.Name));
}
public Assembly ReflectionOnlyLoad(string path)
{
return Assembly.ReflectionOnlyLoadFrom(path);
}
}
}
|
Apply policy when loading reflection only assemblys
|
Apply policy when loading reflection only assemblys
|
C#
|
mit
|
PMudra/ApiCheck
|
eb829a9276058401ab6dbc2b27aa2afcf10be1b1
|
Calculator.Droid/ButtonAdapter.cs
|
Calculator.Droid/ButtonAdapter.cs
|
using Android.Content;
using Android.Views;
using Android.Widget;
namespace Calculator.Droid
{
public class ButtonAdapter : BaseAdapter
{
Context context;
string[] buttons = new string[] {
"<-", "C", "±", "/",
"7", "8", "9", "*",
"4", "5", "6", "-",
"1", "2", "3", "+",
"0", ".", null, "="
};
public ButtonAdapter (Context context)
{
this.context = context;
}
public override Java.Lang.Object GetItem (int position)
{
return null;
}
public override long GetItemId (int position)
{
return 0;
}
public override View GetView (int position, View convertView, ViewGroup parent)
{
Button button = null;
string text = buttons [position];
if (convertView != null) {
button = (Button)convertView;
} else {
button = new Button (context);
}
if (text != null) {
button.Text = text;
} else {
button.Visibility = ViewStates.Invisible;
}
return button;
}
public override int Count {
get { return buttons.Length; }
}
}
}
|
using Android.Content;
using Android.Views;
using Android.Widget;
namespace Calculator.Droid
{
public class ButtonAdapter : BaseAdapter
{
Context context;
string[] buttons = new string[] {
"←", "C", "±", "/",
"7", "8", "9", "*",
"4", "5", "6", "-",
"1", "2", "3", "+",
"0", ".", null, "="
};
public ButtonAdapter (Context context)
{
this.context = context;
}
public override Java.Lang.Object GetItem (int position)
{
return null;
}
public override long GetItemId (int position)
{
return 0;
}
public override View GetView (int position, View convertView, ViewGroup parent)
{
Button button = null;
string text = buttons [position];
if (convertView != null) {
button = (Button)convertView;
} else {
button = new Button (context);
}
if (text != null) {
button.Text = text;
} else {
button.Visibility = ViewStates.Invisible;
}
return button;
}
public override int Count {
get { return buttons.Length; }
}
}
}
|
Use single arrow character for backspace.
|
Use single arrow character for backspace.
Previously it was two characters "<-"
|
C#
|
mit
|
mrward/xamarin-calculator
|
5b24a580d65272e7e29723d1665eb608dc973e8e
|
tests/src/GC/API/GC/TotalMemory.cs
|
tests/src/GC/API/GC/TotalMemory.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// Tests GC.TotalMemory
using System;
public class Test {
public static int Main() {
GC.Collect();
GC.Collect();
int[] array1 = new int[20000];
int memold = (int) GC.GetTotalMemory(false);
Console.WriteLine("Total Memory: " + memold);
array1=null;
GC.Collect();
int[] array2 = new int[40000];
int memnew = (int) GC.GetTotalMemory(false);
Console.WriteLine("Total Memory: " + memnew);
if(memnew >= memold) {
Console.WriteLine("Test for GC.TotalMemory passed!");
return 100;
}
else {
Console.WriteLine("Test for GC.TotalMemory failed!");
return 1;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// Tests GC.TotalMemory
using System;
public class Test {
public static int Main() {
GC.Collect();
GC.Collect();
int[] array1 = new int[20000];
int memold = (int) GC.GetTotalMemory(false);
Console.WriteLine("Total Memory: " + memold);
array1=null;
GC.Collect();
int[] array2 = new int[40000];
int memnew = (int) GC.GetTotalMemory(false);
Console.WriteLine("Total Memory: " + memnew);
GC.KeepAlive(array2);
if(memnew >= memold) {
Console.WriteLine("Test for GC.TotalMemory passed!");
return 100;
}
else {
Console.WriteLine("Test for GC.TotalMemory failed!");
return 1;
}
}
}
|
Fix the GC total memory test.
|
Fix the GC total memory test.
This test was relying upon the result of GC.GetTotalMemory() returning a
greater number after allocating a large array. However, the array was
not kept live past the call to GC.GetTotalMemory, which resulted in this
test failing under GCStress=0xC (in which a GC is performed after each
instruction). This change adds the requisite call to GC.KeepAlive to
keep the allocated array live enough to be observed by
GC.GetTotalMemory.
|
C#
|
mit
|
ruben-ayrapetyan/coreclr,qiudesong/coreclr,wateret/coreclr,yeaicc/coreclr,AlexGhiondea/coreclr,cydhaselton/coreclr,James-Ko/coreclr,alexperovich/coreclr,krytarowski/coreclr,alexperovich/coreclr,cmckinsey/coreclr,pgavlin/coreclr,neurospeech/coreclr,yeaicc/coreclr,rartemev/coreclr,neurospeech/coreclr,pgavlin/coreclr,tijoytom/coreclr,YongseopKim/coreclr,cmckinsey/coreclr,russellhadley/coreclr,sagood/coreclr,sjsinju/coreclr,sagood/coreclr,russellhadley/coreclr,wtgodbe/coreclr,JonHanna/coreclr,kyulee1/coreclr,hseok-oh/coreclr,mskvortsov/coreclr,russellhadley/coreclr,alexperovich/coreclr,YongseopKim/coreclr,JosephTremoulet/coreclr,mskvortsov/coreclr,ruben-ayrapetyan/coreclr,gkhanna79/coreclr,mmitche/coreclr,gkhanna79/coreclr,rartemev/coreclr,AlexGhiondea/coreclr,mmitche/coreclr,yeaicc/coreclr,rartemev/coreclr,mmitche/coreclr,parjong/coreclr,qiudesong/coreclr,neurospeech/coreclr,yeaicc/coreclr,sagood/coreclr,dpodder/coreclr,ragmani/coreclr,ragmani/coreclr,yeaicc/coreclr,neurospeech/coreclr,ruben-ayrapetyan/coreclr,dpodder/coreclr,wateret/coreclr,yizhang82/coreclr,ragmani/coreclr,qiudesong/coreclr,cydhaselton/coreclr,poizan42/coreclr,krk/coreclr,russellhadley/coreclr,yeaicc/coreclr,James-Ko/coreclr,sjsinju/coreclr,sagood/coreclr,tijoytom/coreclr,krytarowski/coreclr,ruben-ayrapetyan/coreclr,mskvortsov/coreclr,jamesqo/coreclr,cshung/coreclr,krk/coreclr,cshung/coreclr,parjong/coreclr,yizhang82/coreclr,kyulee1/coreclr,mskvortsov/coreclr,poizan42/coreclr,JonHanna/coreclr,mmitche/coreclr,mmitche/coreclr,yizhang82/coreclr,wtgodbe/coreclr,JonHanna/coreclr,parjong/coreclr,sjsinju/coreclr,mskvortsov/coreclr,rartemev/coreclr,cydhaselton/coreclr,botaberg/coreclr,jamesqo/coreclr,mmitche/coreclr,krk/coreclr,cmckinsey/coreclr,botaberg/coreclr,cmckinsey/coreclr,kyulee1/coreclr,jamesqo/coreclr,parjong/coreclr,ragmani/coreclr,wtgodbe/coreclr,pgavlin/coreclr,qiudesong/coreclr,hseok-oh/coreclr,krytarowski/coreclr,cydhaselton/coreclr,jamesqo/coreclr,botaberg/coreclr,mskvortsov/coreclr,sjsinju/coreclr,jamesqo/coreclr,tijoytom/coreclr,hseok-oh/coreclr,wateret/coreclr,AlexGhiondea/coreclr,poizan42/coreclr,YongseopKim/coreclr,poizan42/coreclr,botaberg/coreclr,cshung/coreclr,yeaicc/coreclr,tijoytom/coreclr,wateret/coreclr,rartemev/coreclr,JosephTremoulet/coreclr,kyulee1/coreclr,AlexGhiondea/coreclr,dpodder/coreclr,parjong/coreclr,dpodder/coreclr,parjong/coreclr,pgavlin/coreclr,cshung/coreclr,gkhanna79/coreclr,cmckinsey/coreclr,JonHanna/coreclr,krytarowski/coreclr,wateret/coreclr,JosephTremoulet/coreclr,cydhaselton/coreclr,alexperovich/coreclr,krytarowski/coreclr,James-Ko/coreclr,JosephTremoulet/coreclr,neurospeech/coreclr,cshung/coreclr,botaberg/coreclr,ragmani/coreclr,cydhaselton/coreclr,yizhang82/coreclr,dpodder/coreclr,jamesqo/coreclr,krk/coreclr,krk/coreclr,JonHanna/coreclr,wtgodbe/coreclr,kyulee1/coreclr,sagood/coreclr,sjsinju/coreclr,pgavlin/coreclr,James-Ko/coreclr,AlexGhiondea/coreclr,JosephTremoulet/coreclr,wateret/coreclr,qiudesong/coreclr,hseok-oh/coreclr,poizan42/coreclr,tijoytom/coreclr,James-Ko/coreclr,cmckinsey/coreclr,sagood/coreclr,JonHanna/coreclr,JosephTremoulet/coreclr,AlexGhiondea/coreclr,botaberg/coreclr,James-Ko/coreclr,krk/coreclr,sjsinju/coreclr,russellhadley/coreclr,hseok-oh/coreclr,ruben-ayrapetyan/coreclr,yizhang82/coreclr,tijoytom/coreclr,YongseopKim/coreclr,YongseopKim/coreclr,ragmani/coreclr,ruben-ayrapetyan/coreclr,alexperovich/coreclr,dpodder/coreclr,cmckinsey/coreclr,cshung/coreclr,krytarowski/coreclr,gkhanna79/coreclr,wtgodbe/coreclr,wtgodbe/coreclr,gkhanna79/coreclr,poizan42/coreclr,neurospeech/coreclr,alexperovich/coreclr,rartemev/coreclr,hseok-oh/coreclr,gkhanna79/coreclr,russellhadley/coreclr,pgavlin/coreclr,kyulee1/coreclr,qiudesong/coreclr,YongseopKim/coreclr,yizhang82/coreclr
|
b4145303cafe8775a213b5dd9217f93429b3ce45
|
Trappist/src/Promact.Trappist.Core/Controllers/QuestionsController.cs
|
Trappist/src/Promact.Trappist.Core/Controllers/QuestionsController.cs
|
using Microsoft.AspNetCore.Mvc;
using Promact.Trappist.DomainModel.Models.Question;
using Promact.Trappist.Repository.Questions;
using System;
namespace Promact.Trappist.Core.Controllers
{
[Route("api/question")]
public class QuestionsController : Controller
{
private readonly IQuestionRepository _questionsRepository;
public QuestionsController(IQuestionRepository questionsRepository)
{
_questionsRepository = questionsRepository;
}
[HttpGet]
/// <summary>
/// Gets all questions
/// </summary>
/// <returns>Questions list</returns>
public IActionResult GetQuestions()
{
var questions = _questionsRepository.GetAllQuestions();
return Json(questions);
}
[HttpPost]
/// <summary>
///
/// </summary>
/// <param name="singleMultipleAnswerQuestion"></param>
/// <returns></returns>
public IActionResult AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion)
{
_questionsRepository.AddSingleMultipleAnswerQuestion(singleMultipleAnswerQuestion);
return Ok();
}
/// <summary>
///
/// </summary>
/// <param name="singleMultipleAnswerQuestion"></param>
/// <returns></returns>
public IActionResult AddSingleMultipleAnswerQuestionOption(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption)
{
_questionsRepository.AddSingleMultipleAnswerQuestionOption(singleMultipleAnswerQuestionOption);
return Ok();
}
}
}
|
using Microsoft.AspNetCore.Mvc;
using Promact.Trappist.DomainModel.Models.Question;
using Promact.Trappist.Repository.Questions;
using System;
namespace Promact.Trappist.Core.Controllers
{
[Route("api/question")]
public class QuestionsController : Controller
{
private readonly IQuestionRepository _questionsRepository;
public QuestionsController(IQuestionRepository questionsRepository)
{
_questionsRepository = questionsRepository;
}
[HttpGet]
/// <summary>
/// Gets all questions
/// </summary>
/// <returns>Questions list</returns>
public IActionResult GetQuestions()
{
var questions = _questionsRepository.GetAllQuestions();
return Json(questions);
}
[HttpPost]
/// <summary>
/// Add single multiple answer question into SingleMultipleAnswerQuestion model
/// </summary>
/// <param name="singleMultipleAnswerQuestion"></param>
/// <returns></returns>
public IActionResult AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion)
{
_questionsRepository.AddSingleMultipleAnswerQuestion(singleMultipleAnswerQuestion);
return Ok();
}
/// <summary>
/// Add options of single multiple answer question to SingleMultipleAnswerQuestionOption model
/// </summary>
/// <param name="singleMultipleAnswerQuestionOption"></param>
/// <returns></returns>
public IActionResult AddSingleMultipleAnswerQuestionOption(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption)
{
_questionsRepository.AddSingleMultipleAnswerQuestionOption(singleMultipleAnswerQuestionOption);
return Ok();
}
}
}
|
Update server side API for single multiple answer question
|
Update server side API for single multiple answer question
|
C#
|
mit
|
Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist
|
e1b04c9463ae632f65b164a1ab390f62099f8411
|
samples/GenericReceivers/WebHooks/GenericJsonWebHookHandler.cs
|
samples/GenericReceivers/WebHooks/GenericJsonWebHookHandler.cs
|
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.WebHooks;
using Newtonsoft.Json.Linq;
namespace GenericReceivers.WebHooks
{
public class GenericJsonWebHookHandler : WebHookHandler
{
public GenericJsonWebHookHandler()
{
this.Receiver = "genericjson";
}
public override Task ExecuteAsync(string generator, WebHookHandlerContext context)
{
// Get JSON from WebHook
JObject data = context.GetDataOrDefault<JObject>();
// Get the action for this WebHook coming from the action query parameter in the URI
string action = context.Actions.FirstOrDefault();
return Task.FromResult(true);
}
}
}
|
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.WebHooks;
using Newtonsoft.Json.Linq;
namespace GenericReceivers.WebHooks
{
public class GenericJsonWebHookHandler : WebHookHandler
{
public GenericJsonWebHookHandler()
{
this.Receiver = "genericjson";
}
public override Task ExecuteAsync(string receiver, WebHookHandlerContext context)
{
// Get JSON from WebHook
JObject data = context.GetDataOrDefault<JObject>();
// Get the action for this WebHook coming from the action query parameter in the URI
string action = context.Actions.FirstOrDefault();
return Task.FromResult(true);
}
}
}
|
Update param name to match IWebHookHandler
|
Update param name to match IWebHookHandler
This class doesn't seem to use the param, so shouldn't effect anything but it should be consistently named.
|
C#
|
apache-2.0
|
aspnet/WebHooks,PriyaChandak/DemoForProjectShare,garora/WebHooks,aspnet/WebHooks
|
bc7e44713193ab66f8ed11d6a92b7daa925f7349
|
ParsecSharp/GlobalSuppressions.cs
|
ParsecSharp/GlobalSuppressions.cs
|
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Style", "IDE0071:Simplify interpolation", Justification = "IDE0071 considerably decreases the performance of string construction")]
|
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Style", "IDE0071:Simplify interpolation", Justification = "IDE0071 considerably decreases the performance of string construction")]
[assembly: SuppressMessage("Style", "IDE0071WithoutSuggestion")]
|
Revert "remove a suppression no longer needed"
|
Revert "remove a suppression no longer needed"
This reverts commit dababde0a8b99a4c01cc9ed4a232e1b5f82e25bc.
|
C#
|
mit
|
acple/ParsecSharp
|
94a7d20cfccea581812aeaf38df3a0cdc4e7407f
|
src/client/NP/NPFileException.cs
|
src/client/NP/NPFileException.cs
|
using System;
namespace NPSharp.NP
{
internal class NpFileException : Exception
{
internal NpFileException(int error)
: base(error == 1 ? @"File not found on NP server" : @"Internal error on NP server")
{
}
internal NpFileException()
: base(@"Could not fetch file from NP server.")
{
}
}
}
|
using System;
namespace NPSharp.NP
{
public class NpFileException : Exception
{
internal NpFileException(int error)
: base(error == 1 ? @"File not found on NP server" : @"Internal error on NP server")
{
}
internal NpFileException()
: base(@"Could not fetch file from NP server.")
{
}
}
}
|
Make NP file exception class public
|
Make NP file exception class public
|
C#
|
mit
|
icedream/NPSharp
|
07cc1822c8c8e9a46997f926e86a3d53b3277710
|
Client/API/APIInfo.cs
|
Client/API/APIInfo.cs
|
using CareerHub.Client.API.Meta;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CareerHub.Client.API {
public class APIInfo {
public APIInfo() {
this.SupportedComponents = new List<string>();
}
public string BaseUrl { get; set; }
public string Version { get; set; }
public IEnumerable<string> SupportedComponents { get; set; }
public static async Task<APIInfo> GetFromRemote(string baseUrl, ApiArea area) {
var metaApi = new MetaApi(baseUrl);
var result = await metaApi.GetAPIInfo();
if (!result.Success) {
throw new ApplicationException(result.Error);
}
var remoteInfo = result.Content;
string areaname = area.ToString();
var remoteArea = remoteInfo.Areas.Single(a => a.Name == areaname);
if (remoteArea == null) {
return null;
}
return new APIInfo {
BaseUrl = baseUrl,
Version = remoteArea.LatestVersion,
SupportedComponents = remoteInfo.Components
};
}
}
}
|
using CareerHub.Client.API.Meta;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CareerHub.Client.API {
public class APIInfo {
public APIInfo() {
this.SupportedComponents = new List<string>();
}
public string BaseUrl { get; set; }
public string Version { get; set; }
public IEnumerable<string> SupportedComponents { get; set; }
public static async Task<APIInfo> GetFromRemote(string baseUrl, ApiArea area) {
var metaApi = new MetaApi(baseUrl);
var result = await metaApi.GetAPIInfo();
if (!result.Success) {
throw new ApplicationException(result.Error);
}
var remoteInfo = result.Content;
string areaname = area.ToString();
var remoteArea = remoteInfo.Areas.SingleOrDefault(a => a.Name.Equals(areaname, StringComparison.OrdinalIgnoreCase));
if (remoteArea == null) {
return null;
}
return new APIInfo {
BaseUrl = baseUrl,
Version = remoteArea.LatestVersion,
SupportedComponents = remoteInfo.Components
};
}
}
}
|
Make area name case insensitive, better error handling
|
Make area name case insensitive, better error handling
|
C#
|
mit
|
CareerHub/.NET-CareerHub-API-Client,CareerHub/.NET-CareerHub-API-Client
|
80beb6b7b4b7cf12dec0ecd74dfa40e485039935
|
Bravo/Models/Album.cs
|
Bravo/Models/Album.cs
|
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Bravo.Models {
public class Album {
[Required]
public int AlbumId { get; set; }
[Required, MaxLength(255), Display(Name = "Title")]
public string AlbumName { get; set; }
[Required]
public int GenreId { get; set; }
[Required]
public int ArtistId { get; set; }
public ICollection<Song> Songs { get; set; }
}
}
|
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Bravo.Models {
public class Album {
[Required]
public int AlbumId { get; set; }
[Required, MaxLength(255), Display(Name = "Title")]
public string AlbumName { get; set; }
[Required]
public int GenreId { get; set; }
[Required]
public int ArtistId { get; set; }
public virtual Genre Genre { get; set; }
public virtual Artist Artist { get; set; }
public ICollection<Song> Songs { get; set; }
}
}
|
Add virtual property to album model
|
Add virtual property to album model
|
C#
|
mit
|
lukecahill/Bravo,lukecahill/Bravo,lukecahill/Bravo
|
b3152406a7da31664c437366baabddd770f6de45
|
MessageBird/Client.cs
|
MessageBird/Client.cs
|
using System;
using MessageBird.Objects;
using MessageBird.Resources;
using MessageBird.Net;
namespace MessageBird
{
public class Client
{
private IRestClient restClient;
private Client(IRestClient restClient)
{
this.restClient = restClient;
}
public static Client Create(IRestClient restClient)
{
return new Client(restClient);
}
public static Client CreateDefault(string accessKey)
{
return new Client(new RestClient(accessKey));
}
public Message SendMessage(Message message)
{
Messages messageToSend = new Messages(message);
Messages result = (Messages)restClient.Create(messageToSend);
return result.Message;
}
public Message SendMessage(string originator, string body, long[] msisdns, MessageOptionalArguments optionalArguments = null)
{
Recipients recipients = new Recipients(msisdns);
Message message = new Message(originator, body, recipients, optionalArguments);
Messages messages = new Messages(message);
Messages result = (Messages)restClient.Create(messages);
return result.Message;
}
public Message ViewMessage(string id)
{
Messages messageToView = new Messages(id);
Messages result = (Messages)restClient.Retrieve(messageToView);
return result.Message;
}
}
}
|
using System;
using MessageBird.Objects;
using MessageBird.Resources;
using MessageBird.Net;
namespace MessageBird
{
public class Client
{
private IRestClient restClient;
private Client(IRestClient restClient)
{
this.restClient = restClient;
}
public static Client Create(IRestClient restClient)
{
return new Client(restClient);
}
public static Client CreateDefault(string accessKey)
{
return new Client(new RestClient(accessKey));
}
public Message SendMessage(string originator, string body, long[] msisdns, MessageOptionalArguments optionalArguments = null)
{
Recipients recipients = new Recipients(msisdns);
Message message = new Message(originator, body, recipients, optionalArguments);
Messages messages = new Messages(message);
Messages result = (Messages)restClient.Create(messages);
return result.Message;
}
public Message ViewMessage(string id)
{
Messages messageToView = new Messages(id);
Messages result = (Messages)restClient.Retrieve(messageToView);
return result.Message;
}
}
}
|
Remove obsolete send message method
|
Remove obsolete send message method
There are better alternatives that doesn't require manual construction of a message object.
|
C#
|
isc
|
messagebird/csharp-rest-api
|
bf66bd70d21f77fe1453c2cbea695398d37f165e
|
Derby/Models/Competition.cs
|
Derby/Models/Competition.cs
|
using System;
using System.ComponentModel.DataAnnotations;
using Derby.Infrastructure;
namespace Derby.Models
{
public class Competition
{
public int Id { get; set; }
public int PackId { get; set; }
public string Title { get; set; }
public string Location { get; set; }
[Required]
[Display(Name = "Race Type")]
public RaceType RaceType { get; set; }
[Display(Name = "Created Date")]
public DateTime CreatedDate { get; set; }
[Required]
[Display(Name = "Event Date")]
[DataType(DataType.Date)]
public DateTime EventDate { get; set; }
[Required]
[Display(Name = "Number of Lanes")]
public int LaneCount { get; set; }
public string CreatedById { get; set; }
public Pack Pack { get; set; }
public bool Completed { get; set; }
}
}
|
using System;
using System.ComponentModel.DataAnnotations;
using Derby.Infrastructure;
namespace Derby.Models
{
public class Competition
{
public int Id { get; set; }
public int PackId { get; set; }
public string Title { get; set; }
public string Location { get; set; }
[Required]
[Display(Name = "Race Type")]
public DerbyType RaceType { get; set; }
[Display(Name = "Created Date")]
public DateTime CreatedDate { get; set; }
[Required]
[Display(Name = "Event Date")]
[DataType(DataType.Date)]
public DateTime EventDate { get; set; }
[Required]
[Display(Name = "Number of Lanes")]
public int LaneCount { get; set; }
public string CreatedById { get; set; }
public Pack Pack { get; set; }
public bool Completed { get; set; }
}
}
|
Refactor from RaceType to DerbyType
|
Refactor from RaceType to DerbyType
|
C#
|
mit
|
tmeers/Derby,tmeers/Derby,tmeers/Derby
|
3412c598caa6b08095bc02e4a770069950c284a5
|
EncryptApp/Program.cs
|
EncryptApp/Program.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using BabelMark;
using Newtonsoft.Json;
namespace EncryptApp
{
class Program
{
static int Main(string[] args)
{
if (args.Length != 1)
{
Console.WriteLine("Usage: passphrase");
return 1;
}
Environment.SetEnvironmentVariable(MarkdownRegistry.PassphraseEnv, args[0]);
var entries = MarkdownRegistry.Instance.GetEntriesAsync().Result;
foreach (var entry in entries)
{
if (!entry.Url.StartsWith("http"))
{
entry.Url = StringCipher.Decrypt(entry.Url, args[0]);
}
else
{
var originalUrl = entry.Url;
entry.Url = StringCipher.Encrypt(entry.Url, args[0]);
var testDecrypt = StringCipher.Decrypt(entry.Url, args[0]);
if (originalUrl != testDecrypt)
{
Console.WriteLine("Unexpected error while encrypt/decrypt. Not matching");
return 1;
}
}
}
Console.WriteLine(JsonConvert.SerializeObject(entries, Formatting.Indented));
return 0;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using BabelMark;
using Newtonsoft.Json;
namespace EncryptApp
{
class Program
{
static int Main(string[] args)
{
if (args.Length != 2)
{
Console.WriteLine("Usage: passphrase decode|encode");
return 1;
}
if (!(args[1] == "decode" || args[1] == "encode"))
{
Console.WriteLine("Usage: passphrase decode|encode");
Console.WriteLine($"Invalid argument ${args[1]}");
return 1;
}
var encode = args[1] == "encode";
Environment.SetEnvironmentVariable(MarkdownRegistry.PassphraseEnv, args[0]);
var entries = MarkdownRegistry.Instance.GetEntriesAsync().Result;
foreach (var entry in entries)
{
if (encode)
{
var originalUrl = entry.Url;
entry.Url = StringCipher.Encrypt(entry.Url, args[0]);
var testDecrypt = StringCipher.Decrypt(entry.Url, args[0]);
if (originalUrl != testDecrypt)
{
Console.WriteLine("Unexpected error while encrypt/decrypt. Not matching");
return 1;
}
}
}
Console.WriteLine(JsonConvert.SerializeObject(entries, Formatting.Indented));
return 0;
}
}
}
|
Allow to encode/decode the registry
|
Allow to encode/decode the registry
|
C#
|
bsd-2-clause
|
babelmark/babelmark-proxy
|
f2d3110729b052da68062e971f0d70533258dc7b
|
src/ExpressiveAnnotations.MvcWebSample.UITests/DriverFixture.cs
|
src/ExpressiveAnnotations.MvcWebSample.UITests/DriverFixture.cs
|
using System;
using OpenQA.Selenium.PhantomJS;
using OpenQA.Selenium.Remote;
namespace ExpressiveAnnotations.MvcWebSample.UITests
{
public class DriverFixture : IDisposable
{
public DriverFixture() // called before every test class
{
var service = PhantomJSDriverService.CreateDefaultService();
service.IgnoreSslErrors = true;
service.WebSecurity = false;
var options = new PhantomJSOptions();
Driver = new PhantomJSDriver(service, options, TimeSpan.FromSeconds(15)); // headless browser testing
}
public RemoteWebDriver Driver { get; private set; }
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (Driver != null)
{
Driver.Quit();
Driver = null;
}
}
}
public void Dispose() // called after every test class
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}
|
using System;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.PhantomJS;
using OpenQA.Selenium.Remote;
namespace ExpressiveAnnotations.MvcWebSample.UITests
{
public class DriverFixture : IDisposable
{
public DriverFixture() // called before every test class
{
//var service = PhantomJSDriverService.CreateDefaultService();
//service.IgnoreSslErrors = true;
//service.WebSecurity = false;
//var options = new PhantomJSOptions();
//Driver = new PhantomJSDriver(service, options, TimeSpan.FromSeconds(15)); // headless browser testing
Driver = new FirefoxDriver();
}
public RemoteWebDriver Driver { get; private set; }
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (Driver != null)
{
Driver.Quit();
Driver = null;
}
}
}
public void Dispose() // called after every test class
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}
|
Switch to FirefoxDriver due to instability of PhantomJS headless testing.
|
Switch to FirefoxDriver due to instability of PhantomJS headless testing.
|
C#
|
mit
|
jwaliszko/ExpressiveAnnotations,JaroslawWaliszko/ExpressiveAnnotations,JaroslawWaliszko/ExpressiveAnnotations,jwaliszko/ExpressiveAnnotations,jwaliszko/ExpressiveAnnotations,jwaliszko/ExpressiveAnnotations,JaroslawWaliszko/ExpressiveAnnotations,JaroslawWaliszko/ExpressiveAnnotations
|
5a611f17a605f9c207c45bfdbfd12db74a1fc2e6
|
OneWireConsoleScanner/Program.cs
|
OneWireConsoleScanner/Program.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OneWireConsoleScanner
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("OneWire scanner");
var ports = OneWire.OneWire.GetPortNames();
if (ports.Length == 0)
{
Console.WriteLine("No one availible port");
return;
}
var oneWire = new OneWire.OneWire();
foreach (var port in ports)
{
oneWire.PortName = port;
try
{
oneWire.Open();
if (oneWire.ResetLine())
{
List<OneWire.OneWire.Address> devices;
oneWire.FindDevices(out devices);
Console.WriteLine("Found {0} devices on port {1}", devices.Count, port);
devices.ForEach(Console.WriteLine);
}
else
{
Console.WriteLine("No devices on port {0}", port);
}
}
catch
{
Console.WriteLine("Can't scan port {0}", port);
}
finally
{
oneWire.Close();
}
}
}
}
}
|
using System;
using System.Collections.Generic;
namespace OneWireConsoleScanner
{
internal class Program
{
private static void Main(string[] args)
{
Console.WriteLine("OneWire scanner");
var ports = OneWire.OneWire.GetPortNames();
if (ports.Length == 0)
{
Console.WriteLine("No one availible port");
return;
}
var oneWire = new OneWire.OneWire();
foreach (var port in ports)
{
oneWire.PortName = port;
try
{
oneWire.Open();
if (oneWire.ResetLine())
{
if (args.Length > 0)
{
// when read concrete devices
var sensor = new OneWire.SensorDS18B20(oneWire)
{
Address = OneWire.OneWire.Address.Parse(args[0])
};
if (sensor.UpdateValue())
{
Console.WriteLine("Sensor's {0} value is {1} C", sensor.Address, sensor.Value);
}
}
else
{
List<OneWire.OneWire.Address> devices;
oneWire.FindDevices(out devices);
Console.WriteLine("Found {0} devices on port {1}", devices.Count, port);
devices.ForEach(Console.WriteLine);
}
}
else
{
Console.WriteLine("No devices on port {0}", port);
}
}
catch
{
Console.WriteLine("Can't scan port {0}", port);
}
finally
{
oneWire.Close();
}
}
}
}
}
|
Read value of OneWire device with address in first command-line argument
|
Read value of OneWire device with address in first command-line argument
|
C#
|
mit
|
Aleks-K/1-Wire-Termometer
|
31603d8498a955d0f6b7610814ee2aa681b02b41
|
DataAccess/Entities/User.cs
|
DataAccess/Entities/User.cs
|
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Azimuth.DataAccess.Infrastructure;
namespace Azimuth.DataAccess.Entities
{
public class User : BaseEntity
{
public virtual Name Name { get; set; }
public virtual string ScreenName { get; set; }
public virtual string Gender { get; set; }
public virtual string Birthday { get; set; }
public virtual string Photo { get; set; }
public virtual int Timezone { get; set; }
public virtual Location Location { get; set; }
public virtual string Email { get; set; }
public virtual ICollection<UserSocialNetwork> SocialNetworks { get; set; }
public virtual ICollection<User> Followers { get; set; }
public virtual ICollection<User> Following { get; set; }
public virtual ICollection<PlaylistLike> PlaylistFollowing { get; set; }
public User()
{
SocialNetworks = new List<UserSocialNetwork>();
Followers = new List<User>();
Following = new List<User>();
PlaylistFollowing = new List<PlaylistLike>();
}
public override string ToString()
{
return Name.FirstName + Name.LastName + ScreenName + Gender + Email + Birthday + Timezone + Location.City +
", " + Location.Country + Photo;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Azimuth.DataAccess.Infrastructure;
namespace Azimuth.DataAccess.Entities
{
public class User : BaseEntity
{
public virtual Name Name { get; set; }
public virtual string ScreenName { get; set; }
public virtual string Gender { get; set; }
public virtual string Birthday { get; set; }
public virtual string Photo { get; set; }
public virtual int Timezone { get; set; }
public virtual Location Location { get; set; }
public virtual string Email { get; set; }
public virtual ICollection<UserSocialNetwork> SocialNetworks { get; set; }
public virtual ICollection<User> Followers { get; set; }
public virtual ICollection<User> Following { get; set; }
public virtual ICollection<PlaylistLike> PlaylistFollowing { get; set; }
public User()
{
SocialNetworks = new List<UserSocialNetwork>();
Followers = new List<User>();
Following = new List<User>();
PlaylistFollowing = new List<PlaylistLike>();
}
public override string ToString()
{
return Name.FirstName ??
String.Empty + Name.LastName ??
String.Empty + ScreenName ??
String.Empty + Gender ??
String.Empty + Email ??
String.Empty + Birthday ??
String.Empty + Timezone ??
String.Empty + ((Location != null) ? Location.City ?? String.Empty : String.Empty) +
", " + ((Location != null) ? Location.Country ?? String.Empty : String.Empty) + Photo ?? String.Empty;
}
}
}
|
Insert check user fields for null
|
Insert check user fields for null
|
C#
|
mit
|
B1naryStudio/Azimuth,B1naryStudio/Azimuth
|
829c5884b3e169d779bd6aca256e021ae9ad80e5
|
src/Bakery/Security/BasicAuthenticationParser.cs
|
src/Bakery/Security/BasicAuthenticationParser.cs
|
namespace Bakery.Security
{
using System;
using System.Text;
using Text;
public class BasicAuthenticationParser
: IBasicAuthenticationParser
{
private readonly IBase64Parser base64Parser;
private readonly Encoding encoding;
public BasicAuthenticationParser(IBase64Parser base64Parser, Encoding encoding)
{
this.base64Parser = base64Parser;
this.encoding = encoding;
}
public IBasicAuthentication TryParse(String @string)
{
if (!@string.StartsWith("BASIC ", StringComparison.OrdinalIgnoreCase))
return null;
var basicAuthenticationBase64 = @string.Substring(6);
var basicAuthenticationBytes = base64Parser.TryParse(basicAuthenticationBase64);
if (basicAuthenticationBytes == null)
return null;
var basicAuthenticationText = TryGetString(basicAuthenticationBytes);
if (basicAuthenticationText == null)
return null;
var parts = basicAuthenticationText.Split(new Char[] { ':' }, 2);
if (parts.Length != 2)
return null;
return new BasicAuthentication()
{
Password = parts[0],
Username = parts[1]
};
}
private String TryGetString(Byte[] bytes)
{
try
{
return encoding.GetString(bytes);
}
catch { return null; }
}
}
}
|
namespace Bakery.Security
{
using System;
using System.Text;
using Text;
public class BasicAuthenticationParser
: IBasicAuthenticationParser
{
private readonly IBase64Parser base64Parser;
private readonly Encoding encoding;
public BasicAuthenticationParser(IBase64Parser base64Parser, Encoding encoding)
{
this.base64Parser = base64Parser;
this.encoding = encoding;
}
public IBasicAuthentication TryParse(String @string)
{
if (!@string.StartsWith("BASIC ", StringComparison.OrdinalIgnoreCase))
return null;
var basicAuthenticationBase64 = @string.Substring(6);
var basicAuthenticationBytes = base64Parser.TryParse(basicAuthenticationBase64);
if (basicAuthenticationBytes == null)
return null;
var basicAuthenticationText = TryGetString(basicAuthenticationBytes);
if (basicAuthenticationText == null)
return null;
var parts = basicAuthenticationText.Split(new Char[] { ':' }, 2);
if (parts.Length != 2)
return null;
return new BasicAuthentication()
{
Password = parts[1],
Username = parts[0]
};
}
private String TryGetString(Byte[] bytes)
{
try
{
return encoding.GetString(bytes);
}
catch { return null; }
}
}
}
|
Fix mis-matched split string indices (username is 0, password is 1).
|
Fix mis-matched split string indices (username is 0, password is 1).
|
C#
|
mit
|
brendanjbaker/Bakery
|
474e7fd2cb1ed672f905edae9473642baf2d626e
|
WalletWasabi/Crypto/Extensions.cs
|
WalletWasabi/Crypto/Extensions.cs
|
using System.Collections.Generic;
using WalletWasabi.Helpers;
using WalletWasabi.Crypto.Groups;
namespace System.Linq
{
public static class Extensions
{
public static GroupElement Sum(this IEnumerable<GroupElement> groupElements) =>
groupElements.Aggregate(GroupElement.Infinity, (ge, acc) => ge + acc);
public static IEnumerable<TResult> Zip<TFirst, TSecond, TThird, TResult>(this IEnumerable<TFirst> first, IEnumerable<TSecond> second, IEnumerable<TThird> third, Func<TFirst, TSecond, TThird, TResult> resultSelector)
{
Guard.NotNull(nameof(first), first);
Guard.NotNull(nameof(second), second);
Guard.NotNull(nameof(third), third);
Guard.NotNull(nameof(resultSelector), resultSelector);
using var e1 = first.GetEnumerator();
using var e2 = second.GetEnumerator();
using var e3 = third.GetEnumerator();
while (e1.MoveNext() && e2.MoveNext() && e3.MoveNext())
{
yield return resultSelector(e1.Current, e2.Current, e3.Current);
}
}
}
}
|
using System.Collections.Generic;
using WalletWasabi.Helpers;
using WalletWasabi.Crypto.Groups;
using WalletWasabi.Crypto.ZeroKnowledge.LinearRelation;
using WalletWasabi.Crypto;
namespace System.Linq
{
public static class Extensions
{
public static GroupElement Sum(this IEnumerable<GroupElement> groupElements) =>
groupElements.Aggregate(GroupElement.Infinity, (ge, acc) => ge + acc);
public static IEnumerable<TResult> Zip<TFirst, TSecond, TThird, TResult>(this IEnumerable<TFirst> first, IEnumerable<TSecond> second, IEnumerable<TThird> third, Func<TFirst, TSecond, TThird, TResult> resultSelector)
{
Guard.NotNull(nameof(first), first);
Guard.NotNull(nameof(second), second);
Guard.NotNull(nameof(third), third);
Guard.NotNull(nameof(resultSelector), resultSelector);
using var e1 = first.GetEnumerator();
using var e2 = second.GetEnumerator();
using var e3 = third.GetEnumerator();
while (e1.MoveNext() && e2.MoveNext() && e3.MoveNext())
{
yield return resultSelector(e1.Current, e2.Current, e3.Current);
}
}
public static void CheckDimesions(this IEnumerable<Equation> equations, IEnumerable<ScalarVector> allResponses)
{
if (equations.Count() != allResponses.Count() ||
Enumerable.Zip(equations, allResponses).Any(x => x.First.Generators.Count() != x.Second.Count()))
{
throw new ArgumentException("The number of responses and the number of generators in the equations do not match.");
}
}
}
}
|
Add extension method to check eq mat dimensions
|
Add extension method to check eq mat dimensions
|
C#
|
mit
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
0f7ed9ff3168bb90f9796fc07c95d88d876cd447
|
Assets/HoloToolkit/Utilities/Scripts/CameraCache.cs
|
Assets/HoloToolkit/Utilities/Scripts/CameraCache.cs
|
using UnityEngine;
namespace HoloToolkit.Unity
{
public static class CameraCache
{
private static Camera cachedCamera;
/// <summary>
/// Returns a cached reference to the main camera and uses Camera.main if it hasn't been cached yet.
/// </summary>
public static Camera main
{
get
{
return cachedCamera ?? CacheMain(Camera.main);
}
}
/// <summary>
/// Set the cached camera to a new reference and return it
/// </summary>
/// <param name="newMain">New main camera to cache</param>
/// <returns></returns>
private static Camera CacheMain(Camera newMain)
{
return cachedCamera = newMain;
}
}
}
|
using UnityEngine;
namespace HoloToolkit.Unity
{
public static class CameraCache
{
private static Camera cachedCamera;
/// <summary>
/// Returns a cached reference to the main camera and uses Camera.main if it hasn't been cached yet.
/// </summary>
public static Camera main
{
get
{
return cachedCamera ?? Refresh(Camera.main);
}
}
/// <summary>
/// Set the cached camera to a new reference and return it
/// </summary>
/// <param name="newMain">New main camera to cache</param>
/// <returns></returns>
public static Camera Refresh(Camera newMain)
{
return cachedCamera = newMain;
}
}
}
|
Rename cache refresh and make public
|
Rename cache refresh and make public
|
C#
|
mit
|
HoloFan/HoloToolkit-Unity,NeerajW/HoloToolkit-Unity,HattMarris1/HoloToolkit-Unity,paseb/MixedRealityToolkit-Unity,willcong/HoloToolkit-Unity,out-of-pixel/HoloToolkit-Unity,dbastienMS/HoloToolkit-Unity,ForrestTrepte/HoloToolkit-Unity,paseb/HoloToolkit-Unity
|
9f9cb635e259554e39ccdc42c9152be8fdf8bd65
|
CertiPay.Common.Notifications/Notifications/AndroidNotification.cs
|
CertiPay.Common.Notifications/Notifications/AndroidNotification.cs
|
using System;
namespace CertiPay.Common.Notifications
{
public class AndroidNotification : Notification
{
public static string QueueName { get; } = "AndroidNotifications";
// Message => Content
/// <summary>
/// The subject line of the email
/// </summary>
public String Title { get; set; }
// TODO Android specific properties? Image, Sound, Action Button, Picture, Priority
}
}
|
using System;
namespace CertiPay.Common.Notifications
{
/// <summary>
/// Describes a notification sent to an Android device via Google Cloud Messaging
/// </summary>
public class AndroidNotification : Notification
{
public static string QueueName { get; } = "AndroidNotifications";
/// <summary>
/// The subject line of the notification
/// </summary>
public String Title { get; set; }
/// <summary>
/// Maximum lifespan of the message, from 0 to 4 weeks, after which delivery attempts will expire.
/// Setting this to 0 seconds will prevent GCM from throttling the "now or never" message.
///
/// GCM defaults this to 4 weeks.
/// </summary>
public TimeSpan? TimeToLive { get; set; }
/// <summary>
/// Set high priority only if the message is time-critical and requires the user’s
/// immediate interaction, and beware that setting your messages to high priority contributes
/// more to battery drain compared to normal priority messages.
/// </summary>
public Boolean HighPriority { get; set; } = false;
}
}
|
Add comments and the TTL and highPriority flags for android notifications
|
Add comments and the TTL and highPriority flags for android notifications
|
C#
|
mit
|
mattgwagner/CertiPay.Common
|
a354d96879f03146e403d8c4c219fd3cbb18d038
|
Examples/CSharp/Outlook/OLM/LoadAndReadOLMFile.cs
|
Examples/CSharp/Outlook/OLM/LoadAndReadOLMFile.cs
|
using System;
using Aspose.Email.Storage.Olm;
using Aspose.Email.Mapi;
namespace Aspose.Email.Examples.CSharp.Email.Outlook.OLM
{
class LoadAndReadOLMFile
{
public static void Run()
{
// The path to the File directory.
string dataDir = RunExamples.GetDataDir_Outlook();
string dst = dataDir + "OutlookforMac.olm";
// ExStart:LoadAndReadOLMFile
using (OlmStorage storage = new OlmStorage(dst))
{
foreach (OlmFolder folder in storage.FolderHierarchy)
{
if (folder.HasMessages)
{
// extract messages from folder
foreach (MapiMessage msg in storage.EnumerateMessages(folder))
{
Console.WriteLine("Subject: " + msg.Subject);
}
}
// read sub-folders
if (folder.SubFolders.Count > 0)
{
foreach (OlmFolder sub_folder in folder.SubFolders)
{
Console.WriteLine("Subfolder: " + sub_folder.Name);
}
}
}
}
// ExEnd:LoadAndReadOLMFile
}
}
}
|
using System;
using Aspose.Email.Storage.Olm;
using Aspose.Email.Mapi;
namespace Aspose.Email.Examples.CSharp.Email.Outlook.OLM
{
class LoadAndReadOLMFile
{
public static void Run()
{
// The path to the File directory.
string dataDir = RunExamples.GetDataDir_Outlook();
string dst = dataDir + "OutlookforMac.olm";
// ExStart:LoadAndReadOLMFile
using (OlmStorage storage = new OlmStorage(dst))
{
foreach (OlmFolder folder in storage.FolderHierarchy)
{
if (folder.HasMessages)
{
// extract messages from folder
foreach (MapiMessage msg in storage.EnumerateMessages(folder))
{
Console.WriteLine("Subject: " + msg.Subject);
}
}
// read sub-folders
if (folder.SubFolders.Count > 0)
{
foreach (OlmFolder sub_folder in folder.SubFolders)
{
Console.WriteLine("Subfolder: " + sub_folder.Name);
}
}
}
}
// ExEnd:LoadAndReadOLMFile
}
}
}
|
Revert "Revert "Revert "Update Examples/.vs/Aspose.Email.Examples.CSharp/v15/Server/sqlite3/storage.ide-wal"""
|
Revert "Revert "Revert "Update Examples/.vs/Aspose.Email.Examples.CSharp/v15/Server/sqlite3/storage.ide-wal"""
This reverts commit e1e166ae66421c038c24c05e5d71481d6c86cb20.
|
C#
|
mit
|
aspose-email/Aspose.Email-for-.NET,asposeemail/Aspose_Email_NET
|
45714a9616262c9a7a49cfcdcf9376f06fa5653f
|
ExtractCopyright.Tests/Properties/AssemblyInfo.cs
|
ExtractCopyright.Tests/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("ExtractCopyright.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("085a7785-c407-4623-80c0-bffd2b0d2475")]
#if STRONG_NAME
[assembly: AssemblyKeyFileAttribute("../palaso.snk")]
#endif
|
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("ExtractCopyright.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("085a7785-c407-4623-80c0-bffd2b0d2475")]
#if STRONG_NAME
[assembly: AssemblyKeyFileAttribute("../palaso.snk")]
#endif
|
Add nl to end of file
|
Add nl to end of file
|
C#
|
mit
|
ermshiperete/libpalaso,sillsdev/libpalaso,sillsdev/libpalaso,glasseyes/libpalaso,gtryus/libpalaso,gmartin7/libpalaso,sillsdev/libpalaso,glasseyes/libpalaso,glasseyes/libpalaso,ermshiperete/libpalaso,glasseyes/libpalaso,gtryus/libpalaso,ermshiperete/libpalaso,gtryus/libpalaso,ermshiperete/libpalaso,sillsdev/libpalaso,gtryus/libpalaso,gmartin7/libpalaso,gmartin7/libpalaso,gmartin7/libpalaso
|
4de31f3710e79d8dbd01503dc9fba79757af2ea0
|
src/ZeroLog.Tests/UninitializedLogManagerTests.cs
|
src/ZeroLog.Tests/UninitializedLogManagerTests.cs
|
using NUnit.Framework;
namespace ZeroLog.Tests
{
[TestFixture]
public class UninitializedLogManagerTests
{
[TearDown]
public void Teardown()
{
LogManager.Shutdown();
}
[Test]
public void should_log_without_initialize()
{
LogManager.GetLogger("Test").Info($"Test");
}
}
}
|
using System;
using NFluent;
using NUnit.Framework;
using ZeroLog.Configuration;
namespace ZeroLog.Tests
{
[TestFixture, NonParallelizable]
public class UninitializedLogManagerTests
{
private TestAppender _testAppender;
[SetUp]
public void SetUpFixture()
{
_testAppender = new TestAppender(true);
}
[TearDown]
public void Teardown()
{
LogManager.Shutdown();
}
[Test]
public void should_log_without_initialize()
{
LogManager.GetLogger("Test").Info($"Test");
}
[Test]
public void should_log_correctly_when_logger_is_retrieved_before_log_manager_is_initialized()
{
var log = LogManager.GetLogger<LogManagerTests>();
LogManager.Initialize(new ZeroLogConfiguration
{
LogMessagePoolSize = 10,
RootLogger =
{
Appenders = { _testAppender }
}
});
var signal = _testAppender.SetMessageCountTarget(1);
log.Info("Lol");
Check.That(signal.Wait(TimeSpan.FromMilliseconds(100))).IsTrue();
}
}
}
|
Add unit test that checks that a logger retrieved before the log manager is initialised can log correctly
|
Add unit test that checks that a logger retrieved before the log manager is initialised can log correctly
|
C#
|
mit
|
Abc-Arbitrage/ZeroLog
|
420b715b6e2e7134a9ede19bc6c89bb1d1b270fe
|
Renci.SshClient/Renci.SshClient/ConnectionInfo.cs
|
Renci.SshClient/Renci.SshClient/ConnectionInfo.cs
|
using System;
namespace Renci.SshClient
{
public class ConnectionInfo
{
public string Host { get; set; }
public int Port { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public PrivateKeyFile KeyFile { get; set; }
public TimeSpan Timeout { get; set; }
public int RetryAttempts { get; set; }
public int MaxSessions { get; set; }
public ConnectionInfo()
{
// Set default connection values
this.Port = 22;
this.Timeout = TimeSpan.FromMinutes(30);
this.RetryAttempts = 10;
this.MaxSessions = 10;
}
}
}
|
using System;
namespace Renci.SshClient
{
public class ConnectionInfo
{
public string Host { get; set; }
public int Port { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public PrivateKeyFile KeyFile { get; set; }
public TimeSpan Timeout { get; set; }
public int RetryAttempts { get; set; }
public int MaxSessions { get; set; }
public ConnectionInfo()
{
// Set default connection values
this.Port = 22;
this.Timeout = TimeSpan.FromSeconds(30);
this.RetryAttempts = 10;
this.MaxSessions = 10;
}
}
}
|
Change default timeout to 30 seconds
|
Change default timeout to 30 seconds
|
C#
|
mit
|
GenericHero/SSH.NET,Bloomcredit/SSH.NET,miniter/SSH.NET,sshnet/SSH.NET
|
c0c1b8d62014bb0c23dad2e3b924051af5467303
|
osu.Game.Rulesets.Catch/UI/CatcherTrail.cs
|
osu.Game.Rulesets.Catch/UI/CatcherTrail.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;
using osu.Framework.Graphics.Pooling;
using osu.Framework.Timing;
using osuTK;
namespace osu.Game.Rulesets.Catch.UI
{
/// <summary>
/// A trail of the catcher.
/// It also represents a hyper dash afterimage.
/// </summary>
public class CatcherTrail : PoolableDrawable
{
public CatcherAnimationState AnimationState
{
set => body.AnimationState.Value = value;
}
private readonly SkinnableCatcher body;
public CatcherTrail()
{
Size = new Vector2(CatcherArea.CATCHER_SIZE);
Origin = Anchor.TopCentre;
Blending = BlendingParameters.Additive;
InternalChild = body = new SkinnableCatcher
{
// Using a frozen clock because trails should not be animated when the skin has an animated catcher.
// TODO: The animation should be frozen at the animation frame at the time of the trail generation.
Clock = new FramedClock(new ManualClock()),
};
}
protected override void FreeAfterUse()
{
ClearTransforms();
base.FreeAfterUse();
}
}
}
|
// 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;
using osu.Framework.Graphics.Pooling;
using osu.Framework.Timing;
using osuTK;
namespace osu.Game.Rulesets.Catch.UI
{
/// <summary>
/// A trail of the catcher.
/// It also represents a hyper dash afterimage.
/// </summary>
public class CatcherTrail : PoolableDrawable
{
public CatcherAnimationState AnimationState
{
set => body.AnimationState.Value = value;
}
private readonly SkinnableCatcher body;
public CatcherTrail()
{
Size = new Vector2(CatcherArea.CATCHER_SIZE);
Origin = Anchor.TopCentre;
Blending = BlendingParameters.Additive;
InternalChild = body = new SkinnableCatcher
{
// Using a frozen clock because trails should not be animated when the skin has an animated catcher.
// TODO: The animation should be frozen at the animation frame at the time of the trail generation.
Clock = new FramedClock(new ManualClock()),
};
}
protected override void FreeAfterUse()
{
ClearTransforms();
Alpha = 1;
base.FreeAfterUse();
}
}
}
|
Fix catcher hyper-dash afterimage is not always displayed
|
Fix catcher hyper-dash afterimage is not always displayed
|
C#
|
mit
|
smoogipoo/osu,NeoAdonis/osu,UselessToucan/osu,smoogipoo/osu,smoogipoo/osu,ppy/osu,NeoAdonis/osu,ppy/osu,ppy/osu,peppy/osu,peppy/osu,UselessToucan/osu,NeoAdonis/osu,smoogipooo/osu,peppy/osu-new,peppy/osu,UselessToucan/osu
|
22c09ec893b184b6a3611eae18a5daa43b85b5a7
|
osu.Game/Database/LegacyBeatmapImporter.cs
|
osu.Game/Database/LegacyBeatmapImporter.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.Platform;
using osu.Game.Beatmaps;
using osu.Game.IO;
namespace osu.Game.Database
{
public class LegacyBeatmapImporter : LegacyModelImporter<BeatmapSetInfo>
{
protected override string ImportFromStablePath => ".";
protected override Storage PrepareStableStorage(StableStorage stableStorage) => stableStorage.GetSongStorage();
public LegacyBeatmapImporter(IModelImporter<BeatmapSetInfo> importer)
: base(importer)
{
}
}
}
|
// 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.Framework.IO.Stores;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Game.IO;
namespace osu.Game.Database
{
public class LegacyBeatmapImporter : LegacyModelImporter<BeatmapSetInfo>
{
protected override string ImportFromStablePath => ".";
protected override Storage PrepareStableStorage(StableStorage stableStorage) => stableStorage.GetSongStorage();
protected override IEnumerable<string> GetStableImportPaths(Storage storage)
{
foreach (string beatmapDirectory in storage.GetDirectories(string.Empty))
{
var beatmapStorage = storage.GetStorageForDirectory(beatmapDirectory);
if (!beatmapStorage.GetFiles(string.Empty).ExcludeSystemFileNames().Any())
{
// if a directory doesn't contain files, attempt looking for beatmaps inside of that directory.
// this is a special behaviour in stable for beatmaps only, see https://github.com/ppy/osu/issues/18615.
foreach (string beatmapInDirectory in GetStableImportPaths(beatmapStorage))
yield return beatmapStorage.GetFullPath(beatmapInDirectory);
}
else
yield return storage.GetFullPath(beatmapDirectory);
}
}
public LegacyBeatmapImporter(IModelImporter<BeatmapSetInfo> importer)
: base(importer)
{
}
}
}
|
Handle subdirectories during beatmap stable import
|
Handle subdirectories during beatmap stable import
|
C#
|
mit
|
peppy/osu,peppy/osu,peppy/osu,ppy/osu,ppy/osu,ppy/osu
|
1a8ebaf77a289df7a37b5da39f9376b5bee5605f
|
test/Templates.Test/WebApiTemplateTest.cs
|
test/Templates.Test/WebApiTemplateTest.cs
|
using Xunit;
using Xunit.Abstractions;
namespace Templates.Test
{
public class WebApiTemplateTest : TemplateTestBase
{
public WebApiTemplateTest(ITestOutputHelper output) : base(output)
{
}
[Theory]
[InlineData(null)]
[InlineData("net461")]
public void WebApiTemplate_Works(string targetFrameworkOverride)
{
RunDotNetNew("api", targetFrameworkOverride);
foreach (var publish in new[] { false, true })
{
using (var aspNetProcess = StartAspNetProcess(targetFrameworkOverride, publish))
{
aspNetProcess.AssertOk("/api/values");
aspNetProcess.AssertNotFound("/");
}
}
}
}
}
|
using Xunit;
using Xunit.Abstractions;
namespace Templates.Test
{
public class WebApiTemplateTest : TemplateTestBase
{
public WebApiTemplateTest(ITestOutputHelper output) : base(output)
{
}
[Theory]
[InlineData(null)]
[InlineData("net461")]
public void WebApiTemplate_Works(string targetFrameworkOverride)
{
RunDotNetNew("webapi", targetFrameworkOverride);
foreach (var publish in new[] { false, true })
{
using (var aspNetProcess = StartAspNetProcess(targetFrameworkOverride, publish))
{
aspNetProcess.AssertOk("/api/values");
aspNetProcess.AssertNotFound("/");
}
}
}
}
}
|
Update tests to use newer name for 'webapi' template
|
Update tests to use newer name for 'webapi' template
|
C#
|
apache-2.0
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
d18e8b04b3df0023519fae781421df695761037d
|
Plating/Bootstrapper.cs
|
Plating/Bootstrapper.cs
|
using Nancy;
namespace Plating
{
public class Bootstrapper : DefaultNancyBootstrapper
{
public Bootstrapper()
{
Cassette.Nancy.CassetteNancyStartup.OptimizeOutput = true;
}
}
}
|
using Nancy;
namespace Plating
{
public class Bootstrapper : DefaultNancyBootstrapper
{
public Bootstrapper()
{
StaticConfiguration.DisableErrorTraces = false;
Cassette.Nancy.CassetteNancyStartup.OptimizeOutput = true;
}
}
}
|
Enable error traces for Razor.
|
Enable error traces for Razor.
|
C#
|
mit
|
eidolonic/plating,eidolonic/plating
|
7a26d0ea7b75dbe6b3aee3f30633048c889dcba2
|
src/CompetitionPlatform/Helpers/StreamsConstants.cs
|
src/CompetitionPlatform/Helpers/StreamsConstants.cs
|
namespace CompetitionPlatform.Helpers
{
public static class StreamsRoles
{
public const string Admin = "ADMIN";
}
public static class ResultVoteTypes
{
public const string Admin = "ADMIN";
public const string Author = "AUTHOR";
}
public static class OrderingConstants
{
public const string All = "All";
public const string Ascending = "Ascending";
public const string Descending = "Descending";
}
public static class LykkeEmailDomains
{
public const string LykkeCom = "lykke.com";
public const string LykkexCom = "lykkex.com";
}
}
|
namespace CompetitionPlatform.Helpers
{
public static class StreamsRoles
{
public const string Admin = "ADMIN";
}
public static class ResultVoteTypes
{
public const string Admin = "ADMIN";
public const string Author = "AUTHOR";
}
public static class OrderingTypes
{
public const string All = "All";
public const string Ascending = "Ascending";
public const string Descending = "Descending";
}
public static class LykkeEmailDomains
{
public const string LykkeCom = "lykke.com";
public const string LykkexCom = "lykkex.com";
}
}
|
Change class name to OrderingTypes.
|
Change class name to OrderingTypes.
|
C#
|
mit
|
LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform
|
d5d6f626845c30f5c00b799468bfd5a58933f68b
|
Snowflake.API/Ajax/AjaxMethodParameterAttribute.cs
|
Snowflake.API/Ajax/AjaxMethodParameterAttribute.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Snowflake.Ajax
{
/// <summary>
/// A metadata attribute to indicate parameter methods
/// Does not affect execution.
/// </summary>
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
public class AjaxMethodParameterAttribute : Attribute
{
public string ParameterName { get; set; }
public AjaxMethodParameterType ParameterType { get; set; }
}
public enum AjaxMethodParameterType
{
StringParameter,
ObjectParameter,
ArrayParameter
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Snowflake.Ajax
{
/// <summary>
/// A metadata attribute to indicate parameter methods
/// Does not affect execution.
/// </summary>
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
public class AjaxMethodParameterAttribute : Attribute
{
public string ParameterName { get; set; }
public AjaxMethodParameterType ParameterType { get; set; }
}
public enum AjaxMethodParameterType
{
StringParameter,
ObjectParameter,
ArrayParameter,
BoolParameter,
IntParameter
}
}
|
Add BoolParameter and IntParameter to enum
|
Ajax: Add BoolParameter and IntParameter to enum
|
C#
|
mpl-2.0
|
faint32/snowflake-1,RonnChyran/snowflake,SnowflakePowered/snowflake,SnowflakePowered/snowflake,RonnChyran/snowflake,SnowflakePowered/snowflake,faint32/snowflake-1,faint32/snowflake-1,RonnChyran/snowflake
|
b5f5400e069bcc8cb720391eccea385a45bfe7b5
|
OpenSim/Region/Framework/Interfaces/ISearchModule.cs
|
OpenSim/Region/Framework/Interfaces/ISearchModule.cs
|
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using OpenMetaverse;
namespace OpenSim.Framework
{
public interface ISearchModule
{
}
}
|
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using OpenMetaverse;
namespace OpenSim.Framework
{
public interface ISearchModule
{
void Refresh();
}
}
|
Add Refresh() Method to ISerachModule to allow forcing a sim to resend it's search data
|
Add Refresh() Method to ISerachModule to allow forcing a sim to resend it's
search data
|
C#
|
bsd-3-clause
|
EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,TomDataworks/opensim,TomDataworks/opensim,RavenB/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,TomDataworks/opensim,TomDataworks/opensim,TomDataworks/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,TomDataworks/opensim,TomDataworks/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,RavenB/opensim,RavenB/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,RavenB/opensim,RavenB/opensim,RavenB/opensim,RavenB/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC
|
0c30c87f50a560e823667ff016caa9c92ce850ef
|
src/dotless.Core/Parser/Functions/RgbaFunction.cs
|
src/dotless.Core/Parser/Functions/RgbaFunction.cs
|
namespace dotless.Core.Parser.Functions
{
using System.Linq;
using Infrastructure;
using Infrastructure.Nodes;
using Tree;
using Utils;
public class RgbaFunction : Function
{
protected override Node Evaluate(Env env)
{
if (Arguments.Count == 2)
{
Guard.ExpectNode<Color>(Arguments[0], this, Location);
Guard.ExpectNode<Number>(Arguments[1], this, Location);
return new Color(((Color) Arguments[0]).RGB, ((Number) Arguments[1]).Value);
}
Guard.ExpectNumArguments(4, Arguments.Count, this, Location);
Guard.ExpectAllNodes<Number>(Arguments, this, Location);
var args = Arguments.Cast<Number>();
var rgb = args.Take(3);
return new Color(rgb, args.ElementAt(3));
}
}
}
|
namespace dotless.Core.Parser.Functions
{
using System.Linq;
using Infrastructure;
using Infrastructure.Nodes;
using Tree;
using Utils;
public class RgbaFunction : Function
{
protected override Node Evaluate(Env env)
{
if (Arguments.Count == 2)
{
var color = Guard.ExpectNode<Color>(Arguments[0], this, Location);
var alpha = Guard.ExpectNode<Number>(Arguments[1], this, Location);
return new Color(color.RGB, alpha.Value);
}
Guard.ExpectNumArguments(4, Arguments.Count, this, Location);
Guard.ExpectAllNodes<Number>(Arguments, this, Location);
var args = Arguments.Cast<Number>();
var rgb = args.Take(3);
return new Color(rgb, args.ElementAt(3));
}
}
}
|
Use new return value of Guard.ExpectNode to refine casting...
|
Use new return value of Guard.ExpectNode to refine casting...
|
C#
|
apache-2.0
|
rytmis/dotless,rytmis/dotless,rytmis/dotless,rytmis/dotless,rytmis/dotless,rytmis/dotless,dotless/dotless,dotless/dotless,rytmis/dotless
|
94792535512270a9bdf17e7c21e36aed9f9d7740
|
src/unBand/App.xaml.cs
|
src/unBand/App.xaml.cs
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace unBand
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
private void Application_Exit(object sender, ExitEventArgs e)
{
unBand.Properties.Settings.Default.Save();
}
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
Telemetry.Client.TrackException(e.Exception);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace unBand
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
private void Application_Exit(object sender, ExitEventArgs e)
{
unBand.Properties.Settings.Default.Save();
}
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
Telemetry.Client.TrackException(e.Exception);
MessageBox.Show("An unhandled exception occurred - sorry about that, we're going to have to crash now :(\n\nYou can open a bug with a copy of this crash: hit Ctrl + C right now and then paste into a new bug at https://github.com/nachmore/unBand/issues.\n\n" + e.Exception.ToString(),
"Imminent Crash", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
}
}
|
Add visual MessageBox when an unhandled crash is encountered
|
Add visual MessageBox when an unhandled crash is encountered
|
C#
|
mit
|
jehy/unBand,nachmore/unBand
|
40fe27db061942d5bb0919f76b33acf363adbd45
|
src/Projects/MyCouch/Responses/Factories/DocumentResponseFactory.cs
|
src/Projects/MyCouch/Responses/Factories/DocumentResponseFactory.cs
|
using System.IO;
using System.Net.Http;
using MyCouch.Extensions;
using MyCouch.Serialization;
namespace MyCouch.Responses.Factories
{
public class DocumentResponseFactory : ResponseFactoryBase
{
public DocumentResponseFactory(SerializationConfiguration serializationConfiguration)
: base(serializationConfiguration) { }
public virtual DocumentResponse Create(HttpResponseMessage httpResponse)
{
return Materialize(new DocumentResponse(), httpResponse, OnSuccessfulResponse, OnFailedResponse);
}
protected virtual void OnSuccessfulResponse(DocumentResponse response, HttpResponseMessage httpResponse)
{
using (var content = httpResponse.Content.ReadAsStream())
{
if (ContentShouldHaveIdAndRev(httpResponse.RequestMessage))
PopulateDocumentHeaderFromResponseStream(response, content);
else
{
PopulateMissingIdFromRequestUri(response, httpResponse);
PopulateMissingRevFromRequestHeaders(response, httpResponse);
}
content.Position = 0;
using (var reader = new StreamReader(content, MyCouchRuntime.DefaultEncoding))
{
response.Content = reader.ReadToEnd();
}
}
}
}
}
|
using System.IO;
using System.Net.Http;
using System.Text;
using MyCouch.Extensions;
using MyCouch.Serialization;
namespace MyCouch.Responses.Factories
{
public class DocumentResponseFactory : ResponseFactoryBase
{
public DocumentResponseFactory(SerializationConfiguration serializationConfiguration)
: base(serializationConfiguration) { }
public virtual DocumentResponse Create(HttpResponseMessage httpResponse)
{
return Materialize(new DocumentResponse(), httpResponse, OnSuccessfulResponse, OnFailedResponse);
}
protected virtual void OnSuccessfulResponse(DocumentResponse response, HttpResponseMessage httpResponse)
{
using (var content = httpResponse.Content.ReadAsStream())
{
if (ContentShouldHaveIdAndRev(httpResponse.RequestMessage))
PopulateDocumentHeaderFromResponseStream(response, content);
else
{
PopulateMissingIdFromRequestUri(response, httpResponse);
PopulateMissingRevFromRequestHeaders(response, httpResponse);
}
content.Position = 0;
var sb = new StringBuilder();
using (var reader = new StreamReader(content, MyCouchRuntime.DefaultEncoding))
{
while (!reader.EndOfStream)
{
sb.Append(reader.ReadLine());
}
}
response.Content = sb.ToString();
sb.Clear();
}
}
}
}
|
Fix issue with trailing whitespace.
|
Fix issue with trailing whitespace.
|
C#
|
mit
|
danielwertheim/mycouch,danielwertheim/mycouch
|
6e71632dcf034bc9a4672ab7fc26d520f8d9dbe8
|
RepoZ.Api.Win/Git/WindowsRepositoryCache.cs
|
RepoZ.Api.Win/Git/WindowsRepositoryCache.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RepoZ.Api.Common;
using RepoZ.Api.Common.Git;
using RepoZ.Api.Git;
namespace RepoZ.Api.Win.Git
{
public class WindowsRepositoryCache : FileRepositoryCache
{
public WindowsRepositoryCache(IErrorHandler errorHandler)
: base(errorHandler)
{
}
public override string GetFileName() => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "RepoZ\\Repositories.cache");
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RepoZ.Api.Common;
using RepoZ.Api.Common.Git;
using RepoZ.Api.Git;
namespace RepoZ.Api.Win.Git
{
public class WindowsRepositoryCache : FileRepositoryCache
{
public WindowsRepositoryCache(IErrorHandler errorHandler)
: base(errorHandler)
{
}
public override string GetFileName() => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RepoZ\\Repositories.cache");
}
}
|
Use the user-specific appdata path for the repository cache
|
Use the user-specific appdata path for the repository cache
|
C#
|
mit
|
awaescher/RepoZ,awaescher/RepoZ
|
c7a6f0668bb44170340d568b2a50f96170957a98
|
src/Pfim.Benchmarks/DdsBenchmark.cs
|
src/Pfim.Benchmarks/DdsBenchmark.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using FreeImageAPI;
using ImageMagick;
using DS = DevILSharp;
namespace Pfim.Benchmarks
{
public class DdsBenchmark
{
[Params("dxt1-simple.dds", "dxt3-simple.dds", "dxt5-simple.dds", "32-bit-uncompressed.dds")]
public string Payload { get; set; }
private byte[] data;
[GlobalSetup]
public void SetupData()
{
data = File.ReadAllBytes(Payload);
DS.Bootstrap.Init();
}
[Benchmark]
public IImage Pfim() => Dds.Create(new MemoryStream(data));
[Benchmark]
public FreeImageBitmap FreeImage() => FreeImageAPI.FreeImageBitmap.FromStream(new MemoryStream(data));
[Benchmark]
public int ImageMagick()
{
var settings = new MagickReadSettings { Format = MagickFormat.Dds };
using (var image = new MagickImage(new MemoryStream(data), settings))
{
return image.Width;
}
}
[Benchmark]
public int DevILSharp()
{
using (var image = DS.Image.Load(data, DS.ImageType.Dds))
{
return image.Width;
}
}
}
}
|
using System.IO;
using BenchmarkDotNet.Attributes;
using FreeImageAPI;
using ImageMagick;
using DS = DevILSharp;
namespace Pfim.Benchmarks
{
public class DdsBenchmark
{
[Params("dxt1-simple.dds", "dxt3-simple.dds", "dxt5-simple.dds", "32-bit-uncompressed.dds")]
public string Payload { get; set; }
private byte[] data;
[GlobalSetup]
public void SetupData()
{
data = File.ReadAllBytes(Payload);
DS.Bootstrap.Init();
}
[Benchmark]
public IImage Pfim() => Dds.Create(new MemoryStream(data));
[Benchmark]
public FreeImageBitmap FreeImage() => FreeImageAPI.FreeImageBitmap.FromStream(new MemoryStream(data));
[Benchmark]
public int ImageMagick()
{
var settings = new MagickReadSettings { Format = MagickFormat.Dds };
using (var image = new MagickImage(new MemoryStream(data), settings))
{
return image.Width;
}
}
[Benchmark]
public int DevILSharp()
{
using (var image = DS.Image.Load(data, DS.ImageType.Dds))
{
return image.Width;
}
}
}
}
|
Remove unused directives from benchmarking
|
Remove unused directives from benchmarking
|
C#
|
mit
|
nickbabcock/Pfim,nickbabcock/Pfim
|
f61ede421e3b67b3bbf82da5fbb7749328e7f862
|
src/Yaclops/GlobalParserSettings.cs
|
src/Yaclops/GlobalParserSettings.cs
|
using System.Collections.Generic;
namespace Yaclops
{
/// <summary>
/// Settings that alter the default behavior of the parser, but do not depend on the command type.
/// </summary>
public class GlobalParserSettings
{
/// <summary>
/// Constructor
/// </summary>
public GlobalParserSettings()
{
HelpVerb = "help";
HelpFlags = new[] { "-h", "--help", "-?" };
}
/// <summary>
/// The verb that indicates help is desired. Defaults to "help".
/// </summary>
public string HelpVerb { get; set; }
/// <summary>
/// List of strings that indicate help is desired. Defaults to -h, -? and --help.
/// </summary>
public IEnumerable<string> HelpFlags { get; set; }
/// <summary>
/// Enable (hidden) internal Yaclops command used for debugging.
/// </summary>
public bool EnableYaclopsCommands { get; set; }
}
}
|
using System.Collections.Generic;
namespace Yaclops
{
/// <summary>
/// Settings that alter the default behavior of the parser, but do not depend on the command type.
/// </summary>
public class GlobalParserSettings
{
/// <summary>
/// Constructor
/// </summary>
public GlobalParserSettings()
{
HelpVerb = "help";
HelpFlags = new[] { "-h", "--help", "-?" };
EnableYaclopsCommands = true;
}
/// <summary>
/// The verb that indicates help is desired. Defaults to "help".
/// </summary>
public string HelpVerb { get; set; }
/// <summary>
/// List of strings that indicate help is desired. Defaults to -h, -? and --help.
/// </summary>
public IEnumerable<string> HelpFlags { get; set; }
/// <summary>
/// Enable (hidden) internal Yaclops command used for debugging.
/// </summary>
public bool EnableYaclopsCommands { get; set; }
}
}
|
Enable yaclops internal commands by default
|
Enable yaclops internal commands by default
|
C#
|
mit
|
dswisher/yaclops
|
208573bb252e8542d2d9fc25421918c94444866f
|
src/Glimpse.Owin.Sample/Startup.cs
|
src/Glimpse.Owin.Sample/Startup.cs
|
using Glimpse.Host.Web.Owin;
using Owin;
namespace Glimpse.Owin.Sample
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.Use<GlimpseMiddleware>();
app.UseWelcomePage();
app.UseErrorPage();
}
}
}
|
using Glimpse.Host.Web.Owin;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.DependencyInjection.Fallback;
using Owin;
using System.Collections.Generic;
namespace Glimpse.Owin.Sample
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
var serviceDescriptors = new List<IServiceDescriptor>();
var serviceProvider = serviceDescriptors.BuildServiceProvider();
app.Use<GlimpseMiddleware>(serviceProvider);
app.UseWelcomePage();
app.UseErrorPage();
}
}
}
|
Update startup of sample to pass in the serviceProvider
|
Update startup of sample to pass in the serviceProvider
|
C#
|
mit
|
pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,pranavkm/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,pranavkm/Glimpse.Prototype,zanetdev/Glimpse.Prototype,pranavkm/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype
|
a5be9a77ba8eef4f0e22fb43fa74fa6bd1d6cd0b
|
Properties/VersionAssemblyInfo.cs
|
Properties/VersionAssemblyInfo.cs
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-02-22 14:39")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-02-28 02:03")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
|
Build script now creates individual zip file packages to align with the NuGet packages and semantic versioning.
|
Build script now creates individual zip file packages to align with the NuGet packages and semantic versioning.
|
C#
|
mit
|
autofac/Autofac.Extras.AggregateService
|
869814580a8bea2e3ad2f8696929cd15f9a69b0a
|
IntegrationEngine.Core/Configuration/IntegrationPointConfigurations.cs
|
IntegrationEngine.Core/Configuration/IntegrationPointConfigurations.cs
|
using System;
using System.Collections.Generic;
namespace IntegrationEngine.Core.Configuration
{
public class IntegrationPointConfigurations
{
public IList<MailConfiguration> Mail { get; set; }
public IList<RabbitMQConfiguration> RabbitMQ { get; set; }
public IList<ElasticsearchConfiguration> Elasticsearch { get; set; }
}
}
|
using System;
using System.Collections.Generic;
namespace IntegrationEngine.Core.Configuration
{
public class IntegrationPointConfigurations
{
public List<MailConfiguration> Mail { get; set; }
public List<RabbitMQConfiguration> RabbitMQ { get; set; }
public List<ElasticsearchConfiguration> Elasticsearch { get; set; }
}
}
|
Use List because IList isn't supported by FX.Configuration
|
Use List because IList isn't supported by FX.Configuration
|
C#
|
mit
|
InEngine-NET/InEngine.NET,InEngine-NET/InEngine.NET,InEngine-NET/InEngine.NET
|
e558fd69d22fcf17dffce8e4b2d90b5c7042a513
|
osu.Game/Tests/Visual/RateAdjustedBeatmapTestScene.cs
|
osu.Game/Tests/Visual/RateAdjustedBeatmapTestScene.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Tests.Visual
{
/// <summary>
/// Test case which adjusts the beatmap's rate to match any speed adjustments in visual tests.
/// </summary>
public abstract class RateAdjustedBeatmapTestScene : ScreenTestScene
{
protected override void Update()
{
base.Update();
if (Beatmap.Value.TrackLoaded && Beatmap.Value.Track != null) // null check... wasn't required until now?
{
// note that this will override any mod rate application
Beatmap.Value.Track.Tempo.Value = Clock.Rate;
}
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Tests.Visual
{
/// <summary>
/// Test case which adjusts the beatmap's rate to match any speed adjustments in visual tests.
/// </summary>
public abstract class RateAdjustedBeatmapTestScene : ScreenTestScene
{
protected override void Update()
{
base.Update();
if (Beatmap.Value.TrackLoaded)
{
// note that this will override any mod rate application
Beatmap.Value.Track.Tempo.Value = Clock.Rate;
}
}
}
}
|
Remove unnecessary null check and associated comment
|
Remove unnecessary null check and associated comment
|
C#
|
mit
|
NeoAdonis/osu,ppy/osu,peppy/osu,ppy/osu,NeoAdonis/osu,ppy/osu,NeoAdonis/osu,peppy/osu,peppy/osu
|
2e3d70650dfd718ccb20a4df4568c4ac305f4123
|
src/Models/Engine.cs
|
src/Models/Engine.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;
namespace Wangkanai.Detection.Models
{
[Flags]
public enum Engine
{
Unknown = 0, // Unknown engine
WebKit = 1, // iOs (Safari, WebViews, Chrome <28)
Blink = 1 << 1, // Google Chrome, Opera v15+
Gecko = 1 << 2, // Firefox, Netscape
Trident = 1 << 3, // IE, Outlook
EdgeHTML = 1 << 4, // Microsoft Edge
KHTML = 1 << 5, // Konqueror
Presto = 1 << 6, //
Goanna = 1 << 7, // Pale Moon
NetSurf = 1 << 8, // NetSurf
NetFront = 1 << 9, // Access NetFront
Prince = 1 << 10, //
Robin = 1 << 11, // The Bat!
Servo = 1 << 12, // Mozilla & Samsung
Tkhtml = 1 << 13, // hv3
Links2 = 1 << 14, // launched with -g
Others = 1 << 15 // Others
}
}
|
// 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;
namespace Wangkanai.Detection.Models
{
[Flags]
public enum Engine
{
Unknown = 0, // Unknown engine
WebKit = 1, // iOs (Safari, WebViews, Chrome <28)
Blink = 1 << 1, // Google Chrome, Opera v15+
Gecko = 1 << 2, // Firefox, Netscape
Trident = 1 << 3, // IE, Outlook
EdgeHTML = 1 << 4, // Microsoft Edge
Servo = 1 << 12, // Mozilla & Samsung
Others = 1 << 15 // Others
}
}
|
Remove not common engine from base
|
Remove not common engine from base
|
C#
|
apache-2.0
|
wangkanai/Detection
|
18c97036945398421a9a94905e80eab607add7d9
|
Battery-Commander.Web/Views/APFT/List.cshtml
|
Battery-Commander.Web/Views/APFT/List.cshtml
|
@model IEnumerable<APFT>
<div class="page-header">
<h1>APFT @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h1>
</div>
<table class="table table-striped" id="dt">
<thead>
<tr>
<th>Soldier</th>
<th>Date</th>
<th>Score</th>
<th>Result</th>
<th>Details</th>
</tr>
</thead>
<tbody>
@foreach (var model in Model)
{
<tr>
<td>@Html.DisplayFor(_ => model.Soldier)</td>
<td>
<a href="@Url.Action("Index", new { date = model.Date })">
@Html.DisplayFor(_ => model.Date)
</a>
</td>
<td>
@Html.DisplayFor(_ => model.TotalScore)
@if(model.IsAlternateAerobicEvent)
{
<span class="label">Alt. Aerobic</span>
}
</td>
<td>
@if (model.IsPassing)
{
<span class="label label-success">Passing</span>
}
else
{
<span class="label label-danger">Failure</span>
}
</td>
<td>@Html.ActionLink("Details", "Details", new { model.Id })</td>
</tr>
}
</tbody>
</table>
|
@model IEnumerable<APFT>
<div class="page-header">
<h1>APFT @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h1>
</div>
<table class="table table-striped" id="dt">
<thead>
<tr>
<th>Soldier</th>
<th>Date</th>
<th>Score</th>
<th>Result</th>
<th>Details</th>
</tr>
</thead>
<tbody>
@foreach (var model in Model)
{
<tr>
<td>@Html.DisplayFor(_ => model.Soldier)</td>
<td>
<a href="@Url.Action("Index", new { date = model.Date })">
@Html.DisplayFor(_ => model.Date)
</a>
</td>
<td data-sort="@model.TotalScore">
@Html.DisplayFor(_ => model.TotalScore)
@if(model.IsAlternateAerobicEvent)
{
<span class="label">Alt. Aerobic</span>
}
</td>
<td>
@if (model.IsPassing)
{
<span class="label label-success">Passing</span>
}
else
{
<span class="label label-danger">Failure</span>
}
</td>
<td>@Html.ActionLink("Details", "Details", new { model.Id })</td>
</tr>
}
</tbody>
</table>
|
Fix APFT list sort by score
|
Fix APFT list sort by score
|
C#
|
mit
|
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
|
42ac0c72eac12ea39415f9bc9926adcc5a1a6ff6
|
osu.Game.Rulesets.Catch/Skinning/CatchSkinColour.cs
|
osu.Game.Rulesets.Catch/Skinning/CatchSkinColour.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Rulesets.Catch.Skinning
{
public enum CatchSkinColour
{
/// <summary>
/// The colour to be used for the catcher while on hyper-dashing state.
/// </summary>
HyperDash,
/// <summary>
/// The colour to be used for hyper-dash fruits.
/// </summary>
HyperDashFruit,
/// <summary>
/// The colour to be used for the "exploding" catcher sprite on beginning of hyper-dashing.
/// </summary>
HyperDashAfterImage,
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Rulesets.Catch.Skinning
{
public enum CatchSkinColour
{
/// <summary>
/// The colour to be used for the catcher while in hyper-dashing state.
/// </summary>
HyperDash,
/// <summary>
/// The colour to be used for fruits that grant the catcher the ability to hyper-dash.
/// </summary>
HyperDashFruit,
/// <summary>
/// The colour to be used for the "exploding" catcher sprite on beginning of hyper-dashing.
/// </summary>
HyperDashAfterImage,
}
}
|
Fix grammer issue and more rewording
|
Fix grammer issue and more rewording
Co-authored-by: Bartłomiej Dach <809709723693c4e7ecc6f5379a3099c830279741@gmail.com>
|
C#
|
mit
|
NeoAdonis/osu,peppy/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu,ppy/osu,smoogipooo/osu,peppy/osu-new,ppy/osu,ppy/osu,NeoAdonis/osu,UselessToucan/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu,NeoAdonis/osu,smoogipoo/osu
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.