{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \n\n"},"old_contents":{"kind":"string","value":"\n\n\n \n \n @ViewBag.Title\n @Styles.Render(\"~/Content/css\")\n @Scripts.Render(\"~/bundles/modernizr\")\n\n\n
\n
\n
\n \n @Html.ActionLink(\"YourFood\", \"Index\", \"Home\", new { area = \"\" }, new { @class = \"navbar-brand\" })\n
\n
\n
    \n
  • @Html.ActionLink(\"Home\", \"Index\", \"Home\", new { area = \"\" }, null)
  • \n
  • @Html.ActionLink(\"API\", \"Index\", \"Help\", new { area = \"\" }, null)
  • \n
\n
\n
\n
\n
\n @RenderBody()\n
\n\n @Scripts.Render(\"~/bundles/jquery\")\n @Scripts.Render(\"~/bundles/bootstrap\")\n @RenderSection(\"scripts\", required: false)\n\n\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671904,"cells":{"commit":{"kind":"string","value":"1565bd4a6a3de9309bdd4ce9f30a40776dc9a348"},"subject":{"kind":"string","value":"use default options"},"repos":{"kind":"string","value":"SimonCropp/NServiceBus.Jil"},"old_file":{"kind":"string","value":"NServiceBus.Jil/JsonMessageSerializer.cs"},"new_file":{"kind":"string","value":"NServiceBus.Jil/JsonMessageSerializer.cs"},"new_contents":{"kind":"string","value":"namespace NServiceBus.Jil\n{\n using System;\n using System.Collections.Generic;\n using System.IO;\n using System.Linq;\n using global::Jil;\n using NServiceBus.Serialization;\n\n /// \n /// JSON message serializer.\n /// \n public class JsonMessageSerializer : IMessageSerializer\n {\n\n /// \n /// Constructor.\n /// \n public JsonMessageSerializer()\n {\n Options = JSON.GetDefaultOptions();\n }\n\n /// \n /// Serializes the given set of messages into the given stream.\n /// \n /// Message to serialize.\n /// Stream for to be serialized into.\n public void Serialize(object message, Stream stream)\n {\n var streamWriter = new StreamWriter(stream);\n JSON.Serialize(message, streamWriter, Options);\n streamWriter.Flush();\n }\n\n /// \n /// Deserializes from the given stream a set of messages.\n /// \n /// Stream that contains messages.\n /// The list of message types to deserialize. If null the types must be inferred from the serialized data.\n /// Deserialized messages.\n public object[] Deserialize(Stream stream, IList messageTypes)\n {\n if (messageTypes.Count > 1)\n {\n throw new Exception(\"Batch messages are not supported. Feel free to send a Pull Request.\");\n }\n var streamReader = new StreamReader(stream);\n return new[]\n {\n JSON.Deserialize(streamReader, messageTypes.First(), Options)\n };\n }\n\n /// \n /// Gets the content type into which this serializer serializes the content to \n /// \n public string ContentType\n {\n get { return ContentTypes.Json; }\n }\n\n public Options Options { get; set; }\n }\n}"},"old_contents":{"kind":"string","value":"namespace NServiceBus.Jil\n{\n using System;\n using System.Collections.Generic;\n using System.IO;\n using System.Linq;\n using global::Jil;\n using NServiceBus.Serialization;\n\n /// \n /// JSON message serializer.\n /// \n public class JsonMessageSerializer : IMessageSerializer\n {\n\n /// \n /// Constructor.\n /// \n public JsonMessageSerializer()\n {\n Options = new Options();\n }\n\n /// \n /// Serializes the given set of messages into the given stream.\n /// \n /// Message to serialize.\n /// Stream for to be serialized into.\n public void Serialize(object message, Stream stream)\n {\n var streamWriter = new StreamWriter(stream);\n JSON.Serialize(message, streamWriter, Options);\n streamWriter.Flush();\n }\n\n /// \n /// Deserializes from the given stream a set of messages.\n /// \n /// Stream that contains messages.\n /// The list of message types to deserialize. If null the types must be inferred from the serialized data.\n /// Deserialized messages.\n public object[] Deserialize(Stream stream, IList messageTypes)\n {\n if (messageTypes.Count > 1)\n {\n throw new Exception(\"Batch messages are not supported. Feel free to send a Pull Request.\");\n }\n var streamReader = new StreamReader(stream);\n return new[]\n {\n JSON.Deserialize(streamReader, messageTypes.First(), Options)\n };\n }\n\n /// \n /// Gets the content type into which this serializer serializes the content to \n /// \n public string ContentType\n {\n get { return ContentTypes.Json; }\n }\n\n public Options Options { get; set; }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671905,"cells":{"commit":{"kind":"string","value":"b3ebd76707f5eda6c7bbcd099b8b9b7c99356c45"},"subject":{"kind":"string","value":"bump version to 2.10.0"},"repos":{"kind":"string","value":"piwik/piwik-dotnet-tracker,piwik/piwik-dotnet-tracker,piwik/piwik-dotnet-tracker"},"old_file":{"kind":"string","value":"Piwik.Tracker/Properties/AssemblyInfo.cs"},"new_file":{"kind":"string","value":"Piwik.Tracker/Properties/AssemblyInfo.cs"},"new_contents":{"kind":"string","value":"using System.Reflection;\r\nusing System.Runtime.InteropServices;\r\n\r\n// General Information about an assembly is controlled through the following \r\n// set of attributes. Change these attribute values to modify the information\r\n// associated with an assembly.\r\n[assembly: AssemblyTitle(\"PiwikTracker\")]\r\n[assembly: AssemblyDescription(\"\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assembly: AssemblyCompany(\"Piwik\")]\r\n[assembly: AssemblyProduct(\"PiwikTracker\")]\r\n[assembly: AssemblyCopyright(\"\")]\r\n[assembly: AssemblyTrademark(\"\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// Setting ComVisible to false makes the types in this assembly not visible \r\n// to COM components. If you need to access a type in this assembly from \r\n// COM, set the ComVisible attribute to true on that type.\r\n[assembly: ComVisible(false)]\r\n\r\n// The following GUID is for the ID of the typelib if this project is exposed to COM\r\n[assembly: Guid(\"8121d06f-a801-42d2-a144-0036a0270bf3\")]\r\n\r\n// Version information for an assembly consists of the following four values:\r\n//\r\n// Major Version\r\n// Minor Version \r\n// Build Number\r\n// Revision\r\n//\r\n// You can specify all the values or you can default the Build and Revision Numbers \r\n// by using the '*' as shown below:\r\n// [assembly: AssemblyVersion(\"1.0.*\")]\r\n[assembly: AssemblyVersion(\"2.10.0\")]\r\n"},"old_contents":{"kind":"string","value":"using System.Reflection;\r\nusing System.Runtime.InteropServices;\r\n\r\n// General Information about an assembly is controlled through the following \r\n// set of attributes. Change these attribute values to modify the information\r\n// associated with an assembly.\r\n[assembly: AssemblyTitle(\"PiwikTracker\")]\r\n[assembly: AssemblyDescription(\"\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assembly: AssemblyCompany(\"Piwik\")]\r\n[assembly: AssemblyProduct(\"PiwikTracker\")]\r\n[assembly: AssemblyCopyright(\"\")]\r\n[assembly: AssemblyTrademark(\"\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// Setting ComVisible to false makes the types in this assembly not visible \r\n// to COM components. If you need to access a type in this assembly from \r\n// COM, set the ComVisible attribute to true on that type.\r\n[assembly: ComVisible(false)]\r\n\r\n// The following GUID is for the ID of the typelib if this project is exposed to COM\r\n[assembly: Guid(\"8121d06f-a801-42d2-a144-0036a0270bf3\")]\r\n\r\n// Version information for an assembly consists of the following four values:\r\n//\r\n// Major Version\r\n// Minor Version \r\n// Build Number\r\n// Revision\r\n//\r\n// You can specify all the values or you can default the Build and Revision Numbers \r\n// by using the '*' as shown below:\r\n// [assembly: AssemblyVersion(\"1.0.*\")]\r\n[assembly: AssemblyVersion(\"2.9.1\")]\r\n"},"license":{"kind":"string","value":"bsd-3-clause"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671906,"cells":{"commit":{"kind":"string","value":"7e2acb7c3153ec45e031f76d7de7fb54448f244c"},"subject":{"kind":"string","value":"use object pointer instead of context reference"},"repos":{"kind":"string","value":"hahoyer/reni.cs,hahoyer/reni.cs,hahoyer/reni.cs"},"old_file":{"kind":"string","value":"src/reni2/Struct/AccessFeature.cs"},"new_file":{"kind":"string","value":"src/reni2/Struct/AccessFeature.cs"},"new_contents":{"kind":"string","value":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing hw.Debug;\r\nusing hw.Helper;\r\nusing Reni.Basics;\r\nusing Reni.Feature;\r\nusing Reni.ReniSyntax;\r\nusing Reni.TokenClasses;\r\nusing Reni.Type;\r\n\r\nnamespace Reni.Struct\r\n{\r\n sealed class AccessFeature\r\n : DumpableObject\r\n , IFeatureImplementation\r\n , ISimpleFeature\r\n {\r\n static int _nextObjectId;\r\n\r\n internal AccessFeature(CompoundView compoundView, int position)\r\n : base(_nextObjectId++)\r\n {\r\n View = compoundView;\r\n Position = position;\r\n FunctionFeature = new ValueCache(ObtainFunctionFeature);\r\n }\r\n\r\n [EnableDump]\r\n public CompoundView View { get; }\r\n [EnableDump]\r\n public int Position { get; }\r\n\r\n ValueCache FunctionFeature { get; }\r\n\r\n IContextMetaFunctionFeature IFeatureImplementation.ContextMeta\r\n => (Statement as FunctionSyntax)?.ContextMetaFunctionFeature(View);\r\n\r\n IMetaFunctionFeature IFeatureImplementation.Meta => (Statement as FunctionSyntax)?.MetaFunctionFeature(View);\r\n\r\n IFunctionFeature IFeatureImplementation.Function => FunctionFeature.Value;\r\n\r\n ISimpleFeature IFeatureImplementation.Simple\r\n {\r\n get\r\n {\r\n var function = FunctionFeature.Value;\r\n if(function != null && function.IsImplicit)\r\n return null;\r\n return this;\r\n }\r\n }\r\n\r\n Result ISimpleFeature.Result(Category category) => View\r\n .AccessViaObjectPointer(category, Position);\r\n\r\n TypeBase ISimpleFeature.TargetType => View.Type;\r\n\r\n CompileSyntax Statement => View\r\n .Compound\r\n .Syntax\r\n .Statements[Position];\r\n\r\n IFunctionFeature ObtainFunctionFeature()\r\n {\r\n var functionSyntax = Statement as FunctionSyntax;\r\n if(functionSyntax != null)\r\n return functionSyntax.FunctionFeature(View);\r\n\r\n return View.ValueType(Position).CheckedFeature?.Function;\r\n }\r\n }\r\n}"},"old_contents":{"kind":"string","value":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing hw.Debug;\r\nusing hw.Helper;\r\nusing Reni.Basics;\r\nusing Reni.Feature;\r\nusing Reni.ReniSyntax;\r\nusing Reni.TokenClasses;\r\nusing Reni.Type;\r\n\r\nnamespace Reni.Struct\r\n{\r\n sealed class AccessFeature\r\n : DumpableObject\r\n , IFeatureImplementation\r\n , ISimpleFeature\r\n {\r\n static int _nextObjectId;\r\n\r\n internal AccessFeature(CompoundView compoundView, int position)\r\n : base(_nextObjectId++)\r\n {\r\n View = compoundView;\r\n Position = position;\r\n FunctionFeature = new ValueCache(ObtainFunctionFeature);\r\n }\r\n\r\n [EnableDump]\r\n public CompoundView View { get; }\r\n [EnableDump]\r\n public int Position { get; }\r\n\r\n ValueCache FunctionFeature { get; }\r\n\r\n IContextMetaFunctionFeature IFeatureImplementation.ContextMeta\r\n => (Statement as FunctionSyntax)?.ContextMetaFunctionFeature(View);\r\n\r\n IMetaFunctionFeature IFeatureImplementation.Meta => (Statement as FunctionSyntax)?.MetaFunctionFeature(View);\r\n\r\n IFunctionFeature IFeatureImplementation.Function => FunctionFeature.Value;\r\n\r\n ISimpleFeature IFeatureImplementation.Simple\r\n {\r\n get\r\n {\r\n var function = FunctionFeature.Value;\r\n if(function != null && function.IsImplicit)\r\n return null;\r\n return this;\r\n }\r\n }\r\n\r\n Result ISimpleFeature.Result(Category category) => View\r\n .AccessViaContext(category, Position);\r\n\r\n TypeBase ISimpleFeature.TargetType => View.Type;\r\n\r\n CompileSyntax Statement => View\r\n .Compound\r\n .Syntax\r\n .Statements[Position];\r\n\r\n IFunctionFeature ObtainFunctionFeature()\r\n {\r\n var functionSyntax = Statement as FunctionSyntax;\r\n if(functionSyntax != null)\r\n return functionSyntax.FunctionFeature(View);\r\n\r\n return View.ValueType(Position).CheckedFeature?.Function;\r\n }\r\n }\r\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671907,"cells":{"commit":{"kind":"string","value":"a218354fadc8860a185319620c6617e041d22704"},"subject":{"kind":"string","value":"Bring assembly version up to date with tag"},"repos":{"kind":"string","value":"sbennett1990/signify.cs"},"old_file":{"kind":"string","value":"SignifyCS/Properties/AssemblyInfo.cs"},"new_file":{"kind":"string","value":"SignifyCS/Properties/AssemblyInfo.cs"},"new_contents":{"kind":"string","value":"using System.Reflection;\r\nusing System.Runtime.CompilerServices;\r\nusing System.Runtime.InteropServices;\r\n\r\n// General Information about an assembly is controlled through the following \r\n// set of attributes. Change these attribute values to modify the information\r\n// associated with an assembly.\r\n[assembly: AssemblyTitle(\"SignifyCS\")]\r\n[assembly: AssemblyDescription(\"Verify messages signed with signify\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assembly: AssemblyCompany(\"\")]\r\n[assembly: AssemblyProduct(\"\")]\r\n[assembly: AssemblyCopyright(\"Copyright (c) 2017 Scott Bennett\")]\r\n[assembly: AssemblyTrademark(\"\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// Setting ComVisible to false makes the types in this assembly not visible \r\n// to COM components. If you need to access a type in this assembly from \r\n// COM, set the ComVisible attribute to true on that type.\r\n[assembly: ComVisible(false)]\r\n\r\n// The following GUID is for the ID of the typelib if this project is exposed to COM\r\n[assembly: Guid(\"0b1df081-3b2e-4c1a-8582-78cf9334883b\")]\r\n\r\n// Version information for an assembly consists of the following four values:\r\n//\r\n// Major Version\r\n// Minor Version \r\n// Build Number\r\n// Revision\r\n//\r\n// You can specify all the values or you can default the Build and Revision Numbers \r\n// by using the '*' as shown below:\r\n// [assembly: AssemblyVersion(\"1.0.*\")]\r\n[assembly: AssemblyVersion(\"0.7.*\")]\r\n[assembly: AssemblyFileVersion(\"0.7.*\")]\r\n"},"old_contents":{"kind":"string","value":"using System.Reflection;\r\nusing System.Runtime.CompilerServices;\r\nusing System.Runtime.InteropServices;\r\n\r\n// General Information about an assembly is controlled through the following \r\n// set of attributes. Change these attribute values to modify the information\r\n// associated with an assembly.\r\n[assembly: AssemblyTitle(\"SignifyCS\")]\r\n[assembly: AssemblyDescription(\"Verify messages signed with signify\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assembly: AssemblyCompany(\"\")]\r\n[assembly: AssemblyProduct(\"\")]\r\n[assembly: AssemblyCopyright(\"Copyright (c) 2017 Scott Bennett\")]\r\n[assembly: AssemblyTrademark(\"\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// Setting ComVisible to false makes the types in this assembly not visible \r\n// to COM components. If you need to access a type in this assembly from \r\n// COM, set the ComVisible attribute to true on that type.\r\n[assembly: ComVisible(false)]\r\n\r\n// The following GUID is for the ID of the typelib if this project is exposed to COM\r\n[assembly: Guid(\"0b1df081-3b2e-4c1a-8582-78cf9334883b\")]\r\n\r\n// Version information for an assembly consists of the following four values:\r\n//\r\n// Major Version\r\n// Minor Version \r\n// Build Number\r\n// Revision\r\n//\r\n// You can specify all the values or you can default the Build and Revision Numbers \r\n// by using the '*' as shown below:\r\n// [assembly: AssemblyVersion(\"1.0.*\")]\r\n[assembly: AssemblyVersion(\"0.5.*\")]\r\n[assembly: AssemblyFileVersion(\"0.5.*\")]\r\n"},"license":{"kind":"string","value":"isc"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671908,"cells":{"commit":{"kind":"string","value":"ff48aa4cd996e138273991e756b20063ff93929d"},"subject":{"kind":"string","value":"make link_domain optional in mock api"},"repos":{"kind":"string","value":"sailthru/sailthru-net-client"},"old_file":{"kind":"string","value":"Sailthru/Sailthru.Tests/Mock/BlastApi.cs"},"new_file":{"kind":"string","value":"Sailthru/Sailthru.Tests/Mock/BlastApi.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing Newtonsoft.Json.Linq;\n\nnamespace Sailthru.Tests.Mock\n{\n public static class BlastApi\n {\n private static int currentId = 1000;\n\n public static object ProcessPost(JObject request)\n {\n int blastId = Interlocked.Increment(ref currentId);\n string name = request[\"name\"].Value();\n string subject = request[\"subject\"].Value();\n string list = request[\"list\"].Value();\n string modifyTime = DateTime.Now.ToLocalTime().ToString(\"ddd, dd MMM yyyy HH:mm:ss zzz\");\n string status = \"created\";\n string linkDomain = (string)request[\"link_domain\"];\n\n if (request.ContainsKey(\"schedule_time\"))\n {\n status = \"scheduled\";\n }\n\n return new Dictionary\n {\n [\"blast_id\"] = blastId,\n [\"name\"] = name,\n [\"subject\"] = subject,\n [\"list\"] = list,\n [\"modify_time\"] = modifyTime,\n [\"link_domain\"] = linkDomain,\n [\"status\"] = status\n };\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing Newtonsoft.Json.Linq;\n\nnamespace Sailthru.Tests.Mock\n{\n public static class BlastApi\n {\n private static int currentId = 1000;\n\n public static object ProcessPost(JObject request)\n {\n int blastId = Interlocked.Increment(ref currentId);\n string name = request[\"name\"].Value();\n string subject = request[\"subject\"].Value();\n string list = request[\"list\"].Value();\n string linkDomain = request[\"link_domain\"].Value();\n string modifyTime = DateTime.Now.ToLocalTime().ToString(\"ddd, dd MMM yyyy HH:mm:ss zzz\");\n string status = \"created\";\n\n if (request.ContainsKey(\"schedule_time\"))\n {\n status = \"scheduled\";\n }\n\n return new Dictionary\n {\n [\"blast_id\"] = blastId,\n [\"name\"] = name,\n [\"subject\"] = subject,\n [\"list\"] = list,\n [\"modify_time\"] = modifyTime,\n [\"link_domain\"] = linkDomain,\n [\"status\"] = status\n };\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671909,"cells":{"commit":{"kind":"string","value":"9a22b9cbbfd26f4b64be530ea43e7eccaf18d912"},"subject":{"kind":"string","value":"correct base controller check"},"repos":{"kind":"string","value":"asadsahi/AspNetCoreSpa,asadsahi/AspNetCoreSpa,asadsahi/AspNetCoreSpa,asadsahi/AspNetCoreSpa"},"old_file":{"kind":"string","value":"Server/Controllers/api/BaseController.cs"},"new_file":{"kind":"string","value":"Server/Controllers/api/BaseController.cs"},"new_contents":{"kind":"string","value":"using AspNetCoreSpa.Server.Entities;\nusing AspNetCoreSpa.Server.Filters;\nusing Microsoft.AspNetCore.Authorization;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace AspNetCoreSpa.Server.Controllers.api\n{\n [Authorize]\n [ServiceFilter(typeof(ApiExceptionFilter))]\n [ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)]\n public class BaseController : Controller\n {\n public BaseController()\n {\n }\n public IActionResult Render(ExternalLoginStatus status = ExternalLoginStatus.Ok)\n {\n if (status == ExternalLoginStatus.Ok)\n {\n return LocalRedirect(\"~/\");\n }\n return LocalRedirect($\"~/?externalLoginStatus={(int)status}\");\n // return RedirectToAction(\"Index\", \"Home\", new { externalLoginStatus = (int)status });\n }\n }\n\n\n}\n"},"old_contents":{"kind":"string","value":"using AspNetCoreSpa.Server.Entities;\nusing AspNetCoreSpa.Server.Filters;\nusing Microsoft.AspNetCore.Authorization;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace AspNetCoreSpa.Server.Controllers.api\n{\n [Authorize]\n [ServiceFilter(typeof(ApiExceptionFilter))]\n [ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)]\n public class BaseController : Controller\n {\n public BaseController()\n {\n }\n public IActionResult Render(ExternalLoginStatus status = ExternalLoginStatus.Ok)\n {\n if (status != ExternalLoginStatus.Ok)\n {\n return LocalRedirect(\"~/\");\n }\n return LocalRedirect($\"~/?externalLoginStatus={(int)status}\");\n // return RedirectToAction(\"Index\", \"Home\", new { externalLoginStatus = (int)status });\n }\n }\n\n\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671910,"cells":{"commit":{"kind":"string","value":"1c5e2d2832b13fd9b60e46c430a77c4084e80357"},"subject":{"kind":"string","value":"Update PerlinNoiseTurbulenceShaderView.xaml.cs"},"repos":{"kind":"string","value":"wieslawsoltes/Draw2D,wieslawsoltes/Draw2D,wieslawsoltes/Draw2D"},"old_file":{"kind":"string","value":"src/Draw2D/Views/Style/Shaders/PerlinNoiseTurbulenceShaderView.xaml.cs"},"new_file":{"kind":"string","value":"src/Draw2D/Views/Style/Shaders/PerlinNoiseTurbulenceShaderView.xaml.cs"},"new_contents":{"kind":"string","value":"// Copyright (c) Wiesław Šoltés. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\nusing Avalonia.Controls;\nusing Avalonia.Markup.Xaml;\n\nnamespace Draw2D.Views.Style.Shaders\n{\n public class PerlinNoiseTurbulenceShaderView : UserControl\n {\n public PerlinNoiseTurbulenceShaderView()\n {\n InitializeComponent();\n }\n\n private void InitializeComponent()\n {\n AvaloniaXamlLoader.Load(this);\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"// Copyright (c) Wiesław Šoltés. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\nusing Avalonia.Controls;\nusing Avalonia.Markup.Xaml;\n\nnamespace Draw2D.Views.Style.Shaders\n{\n public class Path1DPathEffectView : UserControl\n {\n public Path1DPathEffectView()\n {\n InitializeComponent();\n }\n\n private void InitializeComponent()\n {\n AvaloniaXamlLoader.Load(this);\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671911,"cells":{"commit":{"kind":"string","value":"1cdcbd658efcd9771769d3277cf442a482527086"},"subject":{"kind":"string","value":"Remove not needed code"},"repos":{"kind":"string","value":"zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,pranavkm/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,pranavkm/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype"},"old_file":{"kind":"string","value":"src/Glimpse.Agent.Connection.Http/Broker/RemoteHttpMessagePublisher.cs"},"new_file":{"kind":"string","value":"src/Glimpse.Agent.Connection.Http/Broker/RemoteHttpMessagePublisher.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.Net.Http;\nusing System.Net.Http.Headers;\nusing System.Threading.Tasks;\n\nnamespace Glimpse.Agent\n{\n public class RemoteHttpMessagePublisher : IMessagePublisher, IDisposable\n {\n private readonly HttpClient _httpClient;\n private readonly HttpClientHandler _httpHandler;\n\n public RemoteHttpMessagePublisher()\n {\n _httpHandler = new HttpClientHandler();\n _httpClient = new HttpClient(_httpHandler);\n }\n\n public void PublishMessage(IMessage message)\n {\n var content = new StringContent(\"Hello\");\n\n\n // TODO: Try shifting to async and await\n _httpClient.PostAsync(\"http://localhost:15999/Glimpse/Agent\", content)\n .ContinueWith(requestTask =>\n {\n // Get HTTP response from completed task.\n HttpResponseMessage response = requestTask.Result;\n\n // Check that response was successful or throw exception\n response.EnsureSuccessStatusCode();\n\n // Read response asynchronously as JsonValue and write out top facts for each country\n var result = response.Content.ReadAsStringAsync().Result;\n });\n }\n\n public void Dispose()\n {\n _httpClient.Dispose();\n _httpHandler.Dispose();\n }\n }\n}"},"old_contents":{"kind":"string","value":"using System;\nusing System.Net.Http;\nusing System.Net.Http.Headers;\nusing System.Threading.Tasks;\n\nnamespace Glimpse.Agent\n{\n public class RemoteHttpMessagePublisher : IMessagePublisher, IDisposable\n {\n private readonly HttpClient _httpClient;\n private readonly HttpClientHandler _httpHandler;\n\n public RemoteHttpMessagePublisher()\n {\n _httpHandler = new HttpClientHandler();\n _httpClient = new HttpClient(_httpHandler);\n }\n\n public void PublishMessage(IMessage message)\n {\n var content = new StringContent(\"Hello\");\n\n\n // TODO: Try shifting to async and await\n _httpClient.PostAsync(\"http://localhost:15999/Glimpse/Agent\", content)\n .ContinueWith(requestTask =>\n {\n // Get HTTP response from completed task.\n HttpResponseMessage response = requestTask.Result;\n\n // Check that response was successful or throw exception\n response.EnsureSuccessStatusCode();\n\n // Read response asynchronously as JsonValue and write out top facts for each country\n var result = response.Content.ReadAsStringAsync().Result;\n\n /*\n response.Content.ReadAsAsync().ContinueWith(readTask =>\n {\n var result = readTask.Result;\n });\n */\n });\n }\n\n public void Dispose()\n {\n _httpClient.Dispose();\n _httpHandler.Dispose();\n }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671912,"cells":{"commit":{"kind":"string","value":"6439eb0750a7f869d57ab5e9d959fff792afe1ae"},"subject":{"kind":"string","value":"fix typo"},"repos":{"kind":"string","value":"antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4"},"old_file":{"kind":"string","value":"golang/CSharp/GoParserBase.cs"},"new_file":{"kind":"string","value":"golang/CSharp/GoParserBase.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing Antlr4.Runtime;\n\npublic abstract class GoParserBase : Parser\n{\n protected GoParserBase(ITokenStream input)\n : base(input)\n {\n }\n\n protected GoParserBase(ITokenStream input, TextWriter output, TextWriter errorOutput)\n : base(input, output, errorOutput)\n {\n }\n\n\n protected bool closingBracket()\n {\n int la = tokenStream.LA(1);\n return la == GoLexer.R_PAREN || la == GoLexer.R_CURLY;\n }\n\n private ITokenStream tokenStream\n {\n get\n {\n return TokenStream;\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing Antlr4.Runtime;\n\npublic abstract class GoParserBase : Parser\n{\n protected GoParserBase(ITokenStream input)\n : base(input)\n {\n }\n\n protected GoParserBase(ITokenStream input, TextWriter output, TextWriter errorOutput)\n : base(input, output, errorOutput)\n {\n }\n\n\n protected bool closingBrackets()\n {\n int la = tokenStream.LA(1);\n return la == GoLexer.R_PAREN || la == GoLexer.R_CURLY;\n }\n\n private ITokenStream tokenStream\n {\n get\n {\n return TokenStream;\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671913,"cells":{"commit":{"kind":"string","value":"5a34796463f818868bab3acabf8c6e0e968a970a"},"subject":{"kind":"string","value":"Remove reference to UseDefaultHostingConfiguration"},"repos":{"kind":"string","value":"aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore"},"old_file":{"kind":"string","value":"test/WebSites/CorsMiddlewareWebSite/Startup.cs"},"new_file":{"kind":"string","value":"test/WebSites/CorsMiddlewareWebSite/Startup.cs"},"new_contents":{"kind":"string","value":"// Copyright (c) .NET Foundation. All rights reserved.\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace CorsMiddlewareWebSite\n{\n public class Startup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddCors();\n }\n\n public void Configure(IApplicationBuilder app)\n {\n app.UseCors(policy => policy.WithOrigins(\"http://example.com\"));\n app.UseMiddleware();\n }\n public static void Main(string[] args)\n {\n var host = new WebHostBuilder()\n .UseKestrel()\n .UseIISIntegration()\n .UseStartup()\n .Build();\n\n host.Run();\n }\n }\n}"},"old_contents":{"kind":"string","value":"// Copyright (c) .NET Foundation. All rights reserved.\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace CorsMiddlewareWebSite\n{\n public class Startup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddCors();\n }\n\n public void Configure(IApplicationBuilder app)\n {\n app.UseCors(policy => policy.WithOrigins(\"http://example.com\"));\n app.UseMiddleware();\n }\n public static void Main(string[] args)\n {\n var host = new WebHostBuilder()\n .UseDefaultHostingConfiguration(args)\n .UseKestrel()\n .UseIISIntegration()\n .UseStartup()\n .Build();\n\n host.Run();\n }\n }\n}"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671914,"cells":{"commit":{"kind":"string","value":"3684f4367c28988c87fa5aaa4889133dcee811aa"},"subject":{"kind":"string","value":"change version to v3.2.2"},"repos":{"kind":"string","value":"shabtaisharon/ds3_net_sdk,RachelTucker/ds3_net_sdk,SpectraLogic/ds3_net_sdk,SpectraLogic/ds3_net_sdk,shabtaisharon/ds3_net_sdk,RachelTucker/ds3_net_sdk,shabtaisharon/ds3_net_sdk,SpectraLogic/ds3_net_sdk,RachelTucker/ds3_net_sdk"},"old_file":{"kind":"string","value":"VersionInfo.cs"},"new_file":{"kind":"string","value":"VersionInfo.cs"},"new_contents":{"kind":"string","value":"/*\n * ******************************************************************************\n * Copyright 2014-2016 Spectra Logic Corporation. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use\n * this file except in compliance with the License. A copy of the License is located at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * or in the \"license\" file accompanying this file.\n * This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations under the License.\n * ****************************************************************************\n */\n\nusing System.Reflection;\n\n// Version information for an assembly consists of the following four values:\n//\n// Major Version\n// Minor Version \n// Build Number\n// Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n\n[assembly: AssemblyVersion(\"3.3.2.0\")]\n[assembly: AssemblyFileVersion(\"3.3.2.0\")]\n"},"old_contents":{"kind":"string","value":"/*\n * ******************************************************************************\n * Copyright 2014-2016 Spectra Logic Corporation. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use\n * this file except in compliance with the License. A copy of the License is located at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * or in the \"license\" file accompanying this file.\n * This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations under the License.\n * ****************************************************************************\n */\n\nusing System.Reflection;\n\n// Version information for an assembly consists of the following four values:\n//\n// Major Version\n// Minor Version \n// Build Number\n// Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n\n[assembly: AssemblyVersion(\"3.3.1.0\")]\n[assembly: AssemblyFileVersion(\"3.3.1.0\")]\n"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671915,"cells":{"commit":{"kind":"string","value":"ee504002352ff6cf901aa3828ca5672e111ebb87"},"subject":{"kind":"string","value":"Update crefs (#2087)"},"repos":{"kind":"string","value":"JamesNK/Newtonsoft.Json,jkorell/Newtonsoft.Json,TylerBrinkley/Newtonsoft.Json,PKRoma/Newtonsoft.Json,ze-pequeno/Newtonsoft.Json,oxwanawxo/Newtonsoft.Json"},"old_file":{"kind":"string","value":"Src/Newtonsoft.Json/DateParseHandling.cs"},"new_file":{"kind":"string","value":"Src/Newtonsoft.Json/DateParseHandling.cs"},"new_contents":{"kind":"string","value":"#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n /// \n /// Specifies how date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed when reading JSON text.\n /// \n public enum DateParseHandling\n {\n /// \n /// Date formatted strings are not parsed to a date type and are read as strings.\n /// \n None = 0,\n\n /// \n /// Date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed to .\n /// \n DateTime = 1,\n#if HAVE_DATE_TIME_OFFSET\n /// \n /// Date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed to .\n /// \n DateTimeOffset = 2\n#endif\n }\n}\n"},"old_contents":{"kind":"string","value":"#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n /// \n /// Specifies how date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed when reading JSON text.\n /// \n public enum DateParseHandling\n {\n /// \n /// Date formatted strings are not parsed to a date type and are read as strings.\n /// \n None = 0,\n\n /// \n /// Date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed to .\n /// \n DateTime = 1,\n#if HAVE_DATE_TIME_OFFSET\n /// \n /// Date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed to .\n /// \n DateTimeOffset = 2\n#endif\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671916,"cells":{"commit":{"kind":"string","value":"2d0750d480826c24d4cf274f07e6b736bbab1482"},"subject":{"kind":"string","value":"fix docs example with new Akka.IO"},"repos":{"kind":"string","value":"ali-ince/akka.net,amichel/akka.net,heynickc/akka.net,amichel/akka.net,ali-ince/akka.net,simonlaroche/akka.net,heynickc/akka.net,Silv3rcircl3/akka.net,Silv3rcircl3/akka.net,simonlaroche/akka.net"},"old_file":{"kind":"string","value":"docs/examples/DocsExamples/Networking/IO/EchoConnection.cs"},"new_file":{"kind":"string","value":"docs/examples/DocsExamples/Networking/IO/EchoConnection.cs"},"new_contents":{"kind":"string","value":"using Akka.Actor;\nusing Akka.IO;\nusing Akka.Util.Internal;\n\nnamespace DocsExamples.Networking.IO\n{\n public class EchoConnection : UntypedActor\n {\n private readonly IActorRef _connection;\n\n public EchoConnection(IActorRef connection)\n {\n _connection = connection;\n }\n\n protected override void OnReceive(object message)\n {\n if (message is Tcp.Received)\n {\n var received = message as Tcp.Received;\n if (received.Data[0] == 'x')\n Context.Stop(Self);\n else\n _connection.Tell(Tcp.Write.Create(received.Data));\n }\n else Unhandled(message);\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using Akka.Actor;\nusing Akka.IO;\n\nnamespace DocsExamples.Networking.IO\n{\n public class EchoConnection : UntypedActor\n {\n private readonly IActorRef _connection;\n\n public EchoConnection(IActorRef connection)\n {\n _connection = connection;\n }\n\n protected override void OnReceive(object message)\n {\n if (message is Tcp.Received)\n {\n var received = message as Tcp.Received;\n if (received.Data.Head == 'x')\n Context.Stop(Self);\n else\n _connection.Tell(Tcp.Write.Create(received.Data));\n }\n else Unhandled(message);\n }\n }\n}\n"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671917,"cells":{"commit":{"kind":"string","value":"e6e43c0328131dcc56ae404718f3ef539ac945cd"},"subject":{"kind":"string","value":"Add TracingService"},"repos":{"kind":"string","value":"KpdApps/KpdApps.Common.MsCrm2015"},"old_file":{"kind":"string","value":"PluginState.cs"},"new_file":{"kind":"string","value":"PluginState.cs"},"new_contents":{"kind":"string","value":"using System;\nusing Microsoft.Xrm.Sdk;\n\nnamespace KpdApps.Common.MsCrm2015\n{\n public class PluginState\n {\n public virtual IServiceProvider Provider { get; private set; }\n\n private IPluginExecutionContext _context;\n public virtual IPluginExecutionContext Context => _context ?? (_context = (IPluginExecutionContext)Provider.GetService(typeof(IPluginExecutionContext)));\n\n private IOrganizationService _service;\n public virtual IOrganizationService Service\n {\n get\n {\n if (_service != null)\n return _service;\n\n IOrganizationServiceFactory factory = (IOrganizationServiceFactory)Provider.GetService(typeof(IOrganizationServiceFactory));\n _service = factory.CreateOrganizationService(this.Context.UserId);\n return _service;\n }\n }\n\n private ITracingService _tracingService;\n public virtual ITracingService TracingService\n {\n get\n {\n if (_tracingService != null)\n return _tracingService;\n\n _tracingService = (ITracingService)Provider.GetService(typeof(ITracingService));\n return _tracingService;\n }\n }\n\n public PluginState(IServiceProvider provider)\n {\n if (provider == null)\n throw new ArgumentNullException(nameof(provider));\n\n Provider = provider;\n }\n\n public T GetTarget() where T : class\n {\n if (Context.InputParameters.Contains(\"Target\"))\n {\n return (T)Context.InputParameters[\"Target\"];\n }\n\n return default(T); ;\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System;\nusing Microsoft.Xrm.Sdk;\n\nnamespace KpdApps.Common.MsCrm2015\n{\n\tpublic class PluginState\n\t{\n\t\tprivate IOrganizationService _service;\n\n\t\tprivate IPluginExecutionContext _context;\n\n\t\tpublic virtual IServiceProvider Provider { get; private set; }\n\n\t\tpublic virtual IPluginExecutionContext Context => _context ?? (_context = (IPluginExecutionContext)Provider.GetService(typeof(IPluginExecutionContext)));\n\n\t\tpublic virtual IOrganizationService Service\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_service != null)\n\t\t\t\t\treturn _service;\n\n\t\t\t\tIOrganizationServiceFactory factory = (IOrganizationServiceFactory)Provider.GetService(typeof(IOrganizationServiceFactory));\n\t\t\t\t_service = factory.CreateOrganizationService(this.Context.UserId);\n\t\t\t\treturn _service;\n\t\t\t}\n\t\t}\n\n\t\tpublic PluginState(IServiceProvider provider)\n\t\t{\n\t\t\tif (provider == null)\n\t\t\t\tthrow new ArgumentNullException(nameof(provider));\n\n\t\t\tProvider = provider;\n\t\t}\n\n\t\tpublic T GetTarget() where T : class\n\t\t{\n\t\t\tif (Context.InputParameters.Contains(\"Target\"))\n\t\t\t{\n\t\t\t\treturn (T)Context.InputParameters[\"Target\"];\n\t\t\t}\n\n\t\t\treturn default(T); ;\n\t\t}\n\t}\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671918,"cells":{"commit":{"kind":"string","value":"bdab39f5c798005f930514a12f817597b43c39e3"},"subject":{"kind":"string","value":"change player Age type from double to int"},"repos":{"kind":"string","value":"Team-LemonDrop/NBA-Statistics"},"old_file":{"kind":"string","value":"NBAStatistics.Data.FillMongoDB/Models/Player.cs"},"new_file":{"kind":"string","value":"NBAStatistics.Data.FillMongoDB/Models/Player.cs"},"new_contents":{"kind":"string","value":"using MongoDB.Bson;\nusing MongoDB.Bson.Serialization.Attributes;\n\nnamespace NBAStatistics.Data.FillMongoDB.Models\n{\n public class Player : IEntity\n {\n public Player(\n int teamId,\n string season,\n string leagueId,\n string playerName,\n string num,\n string position,\n string height,\n string weight,\n string birthDate,\n int age,\n string exp,\n string school,\n int playerId)\n {\n this.TeamId = teamId;\n this.Season = season;\n this.LeagueId = leagueId;\n this.PlayerName = playerName;\n this.Num = num;\n this.Position = position;\n this.Height = height;\n this.Weight = weight;\n this.BirthDate = birthDate;\n this.Age = age;\n this.Exp = exp;\n this.School = school;\n this.PlayerId = playerId;\n }\n\n [BsonId]\n [BsonRepresentation(BsonType.ObjectId)]\n [BsonIgnoreIfDefault]\n public string Id { get; set; }\n\n [BsonRepresentation(BsonType.Int32)]\n public int TeamId { get; private set; }\n\n public string Season { get; private set; }\n\n public string LeagueId { get; private set; }\n\n public string PlayerName { get; private set; }\n\n public string Num { get; private set; }\n\n public string Position { get; private set; }\n\n public string Height { get; private set; }\n\n public string Weight { get; private set; }\n\n public string BirthDate { get; private set; }\n\n [BsonRepresentation(BsonType.Int32)]\n public int Age { get; private set; }\n\n public string Exp { get; private set; }\n\n public string School { get; private set; }\n\n [BsonRepresentation(BsonType.Int32)]\n public int PlayerId { get; private set; }\n }\n}\n"},"old_contents":{"kind":"string","value":"using MongoDB.Bson;\nusing MongoDB.Bson.Serialization.Attributes;\n\nnamespace NBAStatistics.Data.FillMongoDB.Models\n{\n public class Player : IEntity\n {\n public Player(\n int teamId,\n string season, \n string leagueId, \n string playerName,\n string num,\n string position,\n string height,\n string weight,\n string birthDate,\n double age,\n string exp,\n string school,\n int playerId)\n {\n this.TeamId = teamId;\n this.Season = season;\n this.LeagueId = leagueId;\n this.PlayerName = playerName;\n this.Num = num;\n this.Position = position;\n this.Height = height;\n this.Weight = weight;\n this.BirthDate = birthDate;\n this.Age = age;\n this.Exp = exp;\n this.School = school;\n this.PlayerId = playerId;\n }\n\n [BsonId]\n [BsonRepresentation(BsonType.ObjectId)]\n [BsonIgnoreIfDefault]\n public string Id { get; set; }\n\n [BsonRepresentation(BsonType.Int32)]\n public int TeamId { get; private set; }\n\n public string Season { get; private set; }\n\n public string LeagueId { get; private set; }\n\n public string PlayerName { get; private set; }\n\n public string Num { get; private set; }\n\n public string Position { get; private set; }\n\n public string Height { get; private set; }\n\n public string Weight { get; private set; }\n\n public string BirthDate { get; private set; }\n\n public double Age { get; private set; }\n\n public string Exp { get; private set; }\n\n public string School { get; private set; }\n\n [BsonRepresentation(BsonType.Int32)]\n public int PlayerId { get; private set; }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671919,"cells":{"commit":{"kind":"string","value":"47d35f3ecae397cb51672afd6f2079c8694eb72d"},"subject":{"kind":"string","value":"Update QuadraticBezierSegment.cs"},"repos":{"kind":"string","value":"Core2D/Core2D,Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D"},"old_file":{"kind":"string","value":"src/Core2D/ViewModels/Shapes/Path/Segments/QuadraticBezierSegment.cs"},"new_file":{"kind":"string","value":"src/Core2D/ViewModels/Shapes/Path/Segments/QuadraticBezierSegment.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing Core2D.Shapes;\n\nnamespace Core2D.Path.Segments\n{\n /// \n /// Quadratic bezier path segment.\n /// \n public class QuadraticBezierSegment : PathSegment, IQuadraticBezierSegment\n {\n private IPointShape _point1;\n private IPointShape _point2;\n\n /// \n public IPointShape Point1\n {\n get => _point1;\n set => Update(ref _point1, value);\n }\n\n /// \n public IPointShape Point2\n {\n get => _point2;\n set => Update(ref _point2, value);\n }\n\n /// \n public override IEnumerable GetPoints()\n {\n yield return Point1;\n yield return Point2;\n }\n\n /// \n public override object Copy(IDictionary shared)\n {\n throw new NotImplementedException();\n }\n\n /// \n /// Returns a string that represents the current object.\n /// \n /// A string that represents the current object.\n public override string ToString() => $\"Q{Point1} {Point2}\";\n\n /// \n /// Check whether the property has changed from its default value.\n /// \n /// Returns true if the property has changed; otherwise, returns false.\n public virtual bool ShouldSerializePoint1() => _point1 != null;\n\n /// \n /// Check whether the property has changed from its default value.\n /// \n /// Returns true if the property has changed; otherwise, returns false.\n public virtual bool ShouldSerializePoint2() => _point2 != null;\n }\n}\n"},"old_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing Core2D.Shapes;\n\nnamespace Core2D.Path.Segments\n{\n /// \n /// Quadratic bezier path segment.\n /// \n public class QuadraticBezierSegment : PathSegment, IQuadraticBezierSegment\n {\n private IPointShape _point1;\n private IPointShape _point2;\n\n /// \n public IPointShape Point1\n {\n get => _point1;\n set => Update(ref _point1, value);\n }\n\n /// \n public IPointShape Point2\n {\n get => _point2;\n set => Update(ref _point2, value);\n }\n\n /// \n public override IEnumerable GetPoints()\n {\n yield return Point1;\n yield return Point2;\n }\n\n /// \n public override object Copy(IDictionary shared)\n {\n throw new NotImplementedException();\n }\n\n /// \n /// Returns a string that represents the current object.\n /// \n /// A string that represents the current object.\n public override string ToString() => string.Format(\"Q{1}{0}{2}\", \" \", Point1, Point2);\n\n /// \n /// Check whether the property has changed from its default value.\n /// \n /// Returns true if the property has changed; otherwise, returns false.\n public virtual bool ShouldSerializePoint1() => _point1 != null;\n\n /// \n /// Check whether the property has changed from its default value.\n /// \n /// Returns true if the property has changed; otherwise, returns false.\n public virtual bool ShouldSerializePoint2() => _point2 != null;\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671920,"cells":{"commit":{"kind":"string","value":"a140440196eda89710e44f18b5d884b07476e260"},"subject":{"kind":"string","value":"Add `AssemblyCompany`, `AssemblyCopyright` and `AssemblyProduct` attributes to the assembly."},"repos":{"kind":"string","value":"aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore"},"old_file":{"kind":"string","value":"src/Microsoft.AspNet.Mvc.Razor.Host.VSRC1/Properties/AssemblyInfo.cs"},"new_file":{"kind":"string","value":"src/Microsoft.AspNet.Mvc.Razor.Host.VSRC1/Properties/AssemblyInfo.cs"},"new_contents":{"kind":"string","value":"// Copyright (c) .NET Foundation. All rights reserved.\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\n\n[assembly: AssemblyMetadata(\"Serviceable\", \"True\")]\n[assembly: NeutralResourcesLanguage(\"en-us\")]\n[assembly: AssemblyCompany(\"Microsoft Corporation.\")]\n[assembly: AssemblyCopyright(\"© Microsoft Corporation. All rights reserved.\")]\n[assembly: AssemblyProduct(\"Microsoft ASP.NET Core\")]"},"old_contents":{"kind":"string","value":"// Copyright (c) .NET Foundation. All rights reserved.\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\n\n[assembly: AssemblyMetadata(\"Serviceable\", \"True\")]\n[assembly: NeutralResourcesLanguage(\"en-us\")]"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671921,"cells":{"commit":{"kind":"string","value":"620e503371b4a31974fd438e18e45fc623b823bb"},"subject":{"kind":"string","value":"Replace Xna's Clamp method with our own."},"repos":{"kind":"string","value":"izrik/ChamberLib,izrik/ChamberLib,izrik/ChamberLib"},"old_file":{"kind":"string","value":"ChamberLib/MathHelper.cs"},"new_file":{"kind":"string","value":"ChamberLib/MathHelper.cs"},"new_contents":{"kind":"string","value":"using System;\n\nnamespace ChamberLib\n{\n public static class MathHelper\n {\n public static int RoundToInt(this float x)\n {\n return (int)Math.Round(x);\n }\n\n public static float ToRadians(this float degrees)\n {\n return degrees * 0.01745329251994f; // pi / 180\n }\n\n public static float ToDegrees( this float radians)\n {\n return radians * 57.2957795130823f; // 180 / pi\n }\n\n public static float Clamp(this float value, float min, float max)\n {\n if (value > max)\n return max;\n\n if (value < min)\n return min;\n\n return value;\n }\n }\n}\n\n"},"old_contents":{"kind":"string","value":"using System;\n\nnamespace ChamberLib\n{\n public static class MathHelper\n {\n public static int RoundToInt(this float x)\n {\n return (int)Math.Round(x);\n }\n\n public static float ToRadians(this float degrees)\n {\n return degrees * 0.01745329251994f; // pi / 180\n }\n\n public static float ToDegrees( this float radians)\n {\n return radians * 57.2957795130823f; // 180 / pi\n }\n\n public static float Clamp(this float value, float min, float max)\n {\n return Math.Max(Math.Min(value, max), min);\n }\n }\n}\n\n"},"license":{"kind":"string","value":"lgpl-2.1"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671922,"cells":{"commit":{"kind":"string","value":"8c553b535e6b763ce0d05d8e92844478f066e547"},"subject":{"kind":"string","value":"add transaction to uow"},"repos":{"kind":"string","value":"generik0/Smooth.IoC.Dapper.Repository.UnitOfWork,generik0/Smooth.IoC.Dapper.Repository.UnitOfWork"},"old_file":{"kind":"string","value":"src/Smooth.IoC.Dapper.Repository.UnitOfWork/Repo/RepositoryGetAll.cs"},"new_file":{"kind":"string","value":"src/Smooth.IoC.Dapper.Repository.UnitOfWork/Repo/RepositoryGetAll.cs"},"new_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Dapper;\nusing Dapper.FastCrud;\nusing Smooth.IoC.Dapper.Repository.UnitOfWork.Data;\nusing static Dapper.FastCrud.Sql;\n\nnamespace Smooth.IoC.Dapper.Repository.UnitOfWork.Repo\n{\n public abstract partial class Repository\n where TEntity : class\n {\n public IEnumerable GetAll(ISession session)\n {\n var enumerable = session.Query($\"SELECT * FROM {Table()}\");\n return IsIEntity() ? \n enumerable \n : session.Find();\n }\n public IEnumerable GetAll(IUnitOfWork uow)\n {\n return IsIEntity() ?\n uow.Connection.Query($\"SELECT * FROM {Table()}\", transaction: uow.Transaction)\n : uow.Find();\n }\n\n public IEnumerable GetAll() where TSesssion : class, ISession\n {\n using (var session = Factory.Create())\n {\n return GetAll(session);\n }\n }\n\n public async Task> GetAllAsync(ISession session)\n {\n return IsIEntity() ?\n await session.QueryAsync($\"SELECT * FROM {Table()}\")\n : await session.FindAsync();\n }\n\n public async Task> GetAllAsync(IUnitOfWork uow)\n {\n return IsIEntity() ?\n await uow.Connection.QueryAsync($\"SELECT * FROM {Table()}\",transaction: uow.Transaction) \n : await uow.FindAsync();\n }\n\n public Task> GetAllAsync() where TSesssion : class, ISession\n {\n using (var session = Factory.Create())\n {\n return GetAllAsync(session);\n }\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Dapper;\nusing Dapper.FastCrud;\nusing Smooth.IoC.Dapper.Repository.UnitOfWork.Data;\nusing static Dapper.FastCrud.Sql;\n\nnamespace Smooth.IoC.Dapper.Repository.UnitOfWork.Repo\n{\n public abstract partial class Repository\n where TEntity : class\n {\n public IEnumerable GetAll(ISession session)\n {\n return IsIEntity() ? \n session.Query($\"SELECT * FROM {Table()}\") \n : session.Find();\n }\n public IEnumerable GetAll(IUnitOfWork uow)\n {\n return IsIEntity() ?\n uow.Connection.Query($\"SELECT * FROM {Table()}\", transaction: uow)\n : uow.Find();\n }\n\n public IEnumerable GetAll() where TSesssion : class, ISession\n {\n using (var session = Factory.Create())\n {\n return GetAll(session);\n }\n }\n\n public async Task> GetAllAsync(ISession session)\n {\n return IsIEntity() ?\n await session.QueryAsync($\"SELECT * FROM {Table()}\")\n : await session.FindAsync();\n }\n\n public async Task> GetAllAsync(IUnitOfWork uow)\n {\n return IsIEntity() ?\n await uow.Connection.QueryAsync($\"SELECT * FROM {Table()}\",transaction: uow) \n : await uow.FindAsync();\n }\n\n public Task> GetAllAsync() where TSesssion : class, ISession\n {\n using (var session = Factory.Create())\n {\n return GetAllAsync(session);\n }\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671923,"cells":{"commit":{"kind":"string","value":"833ddbe899a2879e12f06c69c88f71b0bac00626"},"subject":{"kind":"string","value":"Fix broken build (#10541)"},"repos":{"kind":"string","value":"aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore"},"old_file":{"kind":"string","value":"src/Servers/Kestrel/samples/PlaintextApp/Startup.cs"},"new_file":{"kind":"string","value":"src/Servers/Kestrel/samples/PlaintextApp/Startup.cs"},"new_contents":{"kind":"string","value":"// Copyright (c) .NET Foundation. All rights reserved.\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n\nusing System.IO;\nusing System.IO.Pipelines;\nusing System.Net;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\n\nnamespace PlaintextApp\n{\n public class Startup\n {\n private static readonly byte[] _helloWorldBytes = Encoding.UTF8.GetBytes(\"Hello, World!\");\n\n public void Configure(IApplicationBuilder app)\n {\n app.Run((httpContext) =>\n {\n var payload = _helloWorldBytes;\n var response = httpContext.Response;\n\n response.StatusCode = 200;\n response.ContentType = \"text/plain\";\n response.ContentLength = payload.Length;\n\n return response.BodyWriter.WriteAsync(payload).GetAsTask();\n });\n }\n\n public static Task Main(string[] args)\n {\n var host = new WebHostBuilder()\n .UseKestrel(options =>\n {\n options.Listen(IPAddress.Loopback, 5001);\n })\n .UseContentRoot(Directory.GetCurrentDirectory())\n .UseStartup()\n .Build();\n\n return host.RunAsync();\n }\n }\n\n internal static class ValueTaskExtensions\n {\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static Task GetAsTask(this in ValueTask valueTask)\n {\n if (valueTask.IsCompletedSuccessfully)\n {\n // Signal consumption to the IValueTaskSource\n valueTask.GetAwaiter().GetResult();\n return Task.CompletedTask;\n }\n else\n {\n return valueTask.AsTask();\n }\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"// Copyright (c) .NET Foundation. All rights reserved.\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n\nusing System.IO;\nusing System.IO.Pipelines;\nusing System.Net;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\n\nnamespace PlaintextApp\n{\n public class Startup\n {\n private static readonly byte[] _helloWorldBytes = Encoding.UTF8.GetBytes(\"Hello, World!\");\n\n public void Configure(IApplicationBuilder app)\n {\n app.Run((httpContext) =>\n {\n var payload = _helloWorldBytes;\n var response = httpContext.Response;\n\n response.StatusCode = 200;\n response.ContentType = \"text/plain\";\n response.ContentLength = payload.Length;\n\n return response.BodyPipe.WriteAsync(payload).GetAsTask();\n });\n }\n\n public static Task Main(string[] args)\n {\n var host = new WebHostBuilder()\n .UseKestrel(options =>\n {\n options.Listen(IPAddress.Loopback, 5001);\n })\n .UseContentRoot(Directory.GetCurrentDirectory())\n .UseStartup()\n .Build();\n\n return host.RunAsync();\n }\n }\n\n internal static class ValueTaskExtensions\n {\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static Task GetAsTask(this in ValueTask valueTask)\n {\n if (valueTask.IsCompletedSuccessfully)\n {\n // Signal consumption to the IValueTaskSource\n valueTask.GetAwaiter().GetResult();\n return Task.CompletedTask;\n }\n else\n {\n return valueTask.AsTask();\n }\n }\n }\n}\n"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671924,"cells":{"commit":{"kind":"string","value":"a9142409d646957a48c651af3d2923cf44a90a00"},"subject":{"kind":"string","value":"Fix Zap mod dedicated server."},"repos":{"kind":"string","value":"fr1tz/rotc-ethernet-game,fr1tz/rotc-ethernet-game,fr1tz/rotc-ethernet-game,fr1tz/rotc-ethernet-game"},"old_file":{"kind":"string","value":"zap/main.cs"},"new_file":{"kind":"string","value":"zap/main.cs"},"new_contents":{"kind":"string","value":"//------------------------------------------------------------------------------\n// Revenge Of The Cats: Ethernet\n// Copyright (C) 2009, mEthLab Interactive\n//------------------------------------------------------------------------------\n\n//-----------------------------------------------------------------------------\n// Torque Game Engine\n// Copyright (C) GarageGames.com, Inc.\n//-----------------------------------------------------------------------------\n\n//-----------------------------------------------------------------------------\n// Package overrides to initialize the mod.\n\npackage Zap {\n\nfunction displayHelp()\n{\n\tParent::displayHelp();\n}\n\nfunction parseArgs()\n{\n\tParent::parseArgs();\n}\n\nfunction onStart()\n{\n\techo(\"\\n--------- Initializing MOD: Zap ---------\");\n \texec(\"./server.cs\");\n\n\tParent::onStart();\n}\n\nfunction onExit()\n{\n\tParent::onExit();\n}\n\n}; // package Zap\n\nactivatePackage(Zap);\n"},"old_contents":{"kind":"string","value":"//------------------------------------------------------------------------------\n// Revenge Of The Cats: Ethernet\n// Copyright (C) 2009, mEthLab Interactive\n//------------------------------------------------------------------------------\n\n//-----------------------------------------------------------------------------\n// Torque Game Engine\n// Copyright (C) GarageGames.com, Inc.\n//-----------------------------------------------------------------------------\n\n//-----------------------------------------------------------------------------\n// Package overrides to initialize the mod.\n\npackage Zap {\n\nfunction displayHelp()\n{\n\tParent::displayHelp();\n}\n\nfunction parseArgs()\n{\n\tParent::parseArgs();\n}\n\nfunction onStart()\n{\n\tParent::onStart();\n \n\techo(\"\\n--------- Initializing MOD: Zap ---------\");\n \texec(\"./server.cs\");\n}\n\nfunction onExit()\n{\n\tParent::onExit();\n}\n\n}; // package Zap\n\nactivatePackage(Zap);\n"},"license":{"kind":"string","value":"lgpl-2.1"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671925,"cells":{"commit":{"kind":"string","value":"9622beab6001249818fc83d575b927c743f973dd"},"subject":{"kind":"string","value":"Fix compile warnings. (#200)"},"repos":{"kind":"string","value":"mono/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000"},"old_file":{"kind":"string","value":"tests/managed/structs.cs"},"new_file":{"kind":"string","value":"tests/managed/structs.cs"},"new_contents":{"kind":"string","value":"using System;\n\n#pragma warning disable 660 // 'Point' defines operator == or operator != but does not override Object.Equals(object o)\n#pragma warning disable 661 // 'Point' defines operator == or operator != but does not override Object.GetHashCode()\nnamespace Structs {\n\n\tpublic struct Point {\n\n\t\tpublic static readonly Point Zero;\n\n\t\tpublic Point (float x, float y)\n\t\t{\n\t\t\tX = x;\n\t\t\tY = y;\n\t\t}\n\n\t\tpublic float X { get; private set; }\n\n\t\tpublic float Y { get; private set; }\n\n\t\tpublic static bool operator == (Point left, Point right)\n\t\t{\n\t\t\treturn ((left.X == right.X) && (left.Y == right.Y));\n\t\t}\n\n\t\tpublic static bool operator != (Point left, Point right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic static Point operator + (Point left, Point right)\n\t\t{\n\t\t\treturn new Point (left.X + right.X, left.Y + right.Y);\n\t\t}\n\n\t\tpublic static Point operator - (Point left, Point right)\n\t\t{\n\t\t\treturn new Point (left.X - right.X, left.Y - right.Y);\n\t\t}\n\t}\n}\n"},"old_contents":{"kind":"string","value":"using System;\n\nnamespace Structs {\n\n\tpublic struct Point {\n\n\t\tpublic static readonly Point Zero;\n\n\t\tpublic Point (float x, float y)\n\t\t{\n\t\t\tX = x;\n\t\t\tY = y;\n\t\t}\n\n\t\tpublic float X { get; private set; }\n\n\t\tpublic float Y { get; private set; }\n\n\t\tpublic static bool operator == (Point left, Point right)\n\t\t{\n\t\t\treturn ((left.X == right.X) && (left.Y == right.Y));\n\t\t}\n\n\t\tpublic static bool operator != (Point left, Point right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic static Point operator + (Point left, Point right)\n\t\t{\n\t\t\treturn new Point (left.X + right.X, left.Y + right.Y);\n\t\t}\n\n\t\tpublic static Point operator - (Point left, Point right)\n\t\t{\n\t\t\treturn new Point (left.X - right.X, left.Y - right.Y);\n\t\t}\n\t}\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671926,"cells":{"commit":{"kind":"string","value":"f587c58ec4c213d2072257d1d7d4adae242520ec"},"subject":{"kind":"string","value":"Improve keyframe (CssNode)"},"repos":{"kind":"string","value":"FlorianRappl/AngleSharp,zedr0n/AngleSharp.Local,AngleSharp/AngleSharp,FlorianRappl/AngleSharp,AngleSharp/AngleSharp,Livven/AngleSharp,zedr0n/AngleSharp.Local,Livven/AngleSharp,FlorianRappl/AngleSharp,AngleSharp/AngleSharp,Livven/AngleSharp,AngleSharp/AngleSharp,AngleSharp/AngleSharp,FlorianRappl/AngleSharp,zedr0n/AngleSharp.Local"},"old_file":{"kind":"string","value":"AngleSharp/Dom/Css/Selector/KeyframeSelector.cs"},"new_file":{"kind":"string","value":"AngleSharp/Dom/Css/Selector/KeyframeSelector.cs"},"new_contents":{"kind":"string","value":"namespace AngleSharp.Dom.Css\n{\n using AngleSharp.Css;\n using AngleSharp.Css.Values;\n using System;\n using System.Collections.Generic;\n\n /// \n /// Represents the keyframe selector.\n /// \n sealed class KeyframeSelector : CssNode, IKeyframeSelector\n {\n #region Fields\n\n readonly List _stops;\n\n #endregion\n\n #region ctor\n\n public KeyframeSelector(List stops)\n {\n _stops = stops;\n }\n\n #endregion\n\n #region Properties\n\n /// \n /// Gets an enumeration over all stops.\n /// \n public IEnumerable Stops\n {\n get { return _stops; }\n }\n\n /// \n /// Gets the text representation of the keyframe selector.\n /// \n public String Text\n {\n get\n {\n var stops = new String[_stops.Count];\n\n for (int i = 0; i < stops.Length; i++)\n stops[i] = _stops[i].ToString();\n\n return String.Join(\", \", stops);\n }\n }\n\n #endregion\n }\n}\n"},"old_contents":{"kind":"string","value":"namespace AngleSharp.Dom.Css\n{\n using System;\n using System.Collections.Generic;\n using AngleSharp.Css.Values;\n\n /// \n /// Represents the keyframe selector.\n /// \n sealed class KeyframeSelector : IKeyframeSelector\n {\n #region Fields\n\n readonly List _stops;\n\n #endregion\n\n #region ctor\n\n public KeyframeSelector(IEnumerable stops)\n {\n _stops = new List(stops);\n }\n\n #endregion\n\n #region Properties\n\n /// \n /// Gets an enumeration over all stops.\n /// \n public IEnumerable Stops\n {\n get { return _stops; }\n }\n\n /// \n /// Gets the text representation of the keyframe selector.\n /// \n public String Text\n {\n get\n {\n var stops = new String[_stops.Count];\n\n for (int i = 0; i < stops.Length; i++)\n stops[i] = _stops[i].ToString();\n\n return String.Join(\", \", stops);\n }\n }\n\n #endregion\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671927,"cells":{"commit":{"kind":"string","value":"13760f401418a0dd9019c3030d77017fd2c5eccf"},"subject":{"kind":"string","value":"Fix gas tile overlays on shuttles"},"repos":{"kind":"string","value":"space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14"},"old_file":{"kind":"string","value":"Content.Client/Atmos/Overlays/GasTileOverlay.cs"},"new_file":{"kind":"string","value":"Content.Client/Atmos/Overlays/GasTileOverlay.cs"},"new_contents":{"kind":"string","value":"using Content.Client.Atmos.EntitySystems;\nusing Robust.Client.Graphics;\nusing Robust.Shared.Enums;\nusing Robust.Shared.GameObjects;\nusing Robust.Shared.IoC;\nusing Robust.Shared.Map;\nusing Robust.Shared.Maths;\n\nnamespace Content.Client.Atmos.Overlays\n{\n public class GasTileOverlay : Overlay\n {\n private readonly GasTileOverlaySystem _gasTileOverlaySystem;\n\n [Dependency] private readonly IMapManager _mapManager = default!;\n [Dependency] private readonly IEyeManager _eyeManager = default!;\n [Dependency] private readonly IClyde _clyde = default!;\n\n public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;\n\n public GasTileOverlay()\n {\n IoCManager.InjectDependencies(this);\n\n _gasTileOverlaySystem = EntitySystem.Get();\n }\n\n protected override void Draw(in OverlayDrawArgs args)\n {\n var drawHandle = args.WorldHandle;\n\n var mapId = _eyeManager.CurrentMap;\n var eye = _eyeManager.CurrentEye;\n\n var worldBounds = Box2.CenteredAround(eye.Position.Position,\n _clyde.ScreenSize / (float) EyeManager.PixelsPerMeter * eye.Zoom);\n\n foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds))\n {\n if (!_gasTileOverlaySystem.HasData(mapGrid.Index))\n continue;\n\n foreach (var tile in mapGrid.GetTilesIntersecting(worldBounds))\n {\n foreach (var (texture, color) in _gasTileOverlaySystem.GetOverlays(mapGrid.Index, tile.GridIndices))\n {\n drawHandle.DrawTexture(texture, mapGrid.LocalToWorld(new Vector2(tile.X, tile.Y)), color);\n }\n }\n }\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using Content.Client.Atmos.EntitySystems;\nusing Robust.Client.Graphics;\nusing Robust.Shared.Enums;\nusing Robust.Shared.GameObjects;\nusing Robust.Shared.IoC;\nusing Robust.Shared.Map;\nusing Robust.Shared.Maths;\n\nnamespace Content.Client.Atmos.Overlays\n{\n public class GasTileOverlay : Overlay\n {\n private readonly GasTileOverlaySystem _gasTileOverlaySystem;\n\n [Dependency] private readonly IMapManager _mapManager = default!;\n [Dependency] private readonly IEyeManager _eyeManager = default!;\n [Dependency] private readonly IClyde _clyde = default!;\n\n public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;\n\n public GasTileOverlay()\n {\n IoCManager.InjectDependencies(this);\n\n _gasTileOverlaySystem = EntitySystem.Get();\n }\n\n protected override void Draw(in OverlayDrawArgs args)\n {\n var drawHandle = args.WorldHandle;\n\n var mapId = _eyeManager.CurrentMap;\n var eye = _eyeManager.CurrentEye;\n\n var worldBounds = Box2.CenteredAround(eye.Position.Position,\n _clyde.ScreenSize / (float) EyeManager.PixelsPerMeter * eye.Zoom);\n\n foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds))\n {\n if (!_gasTileOverlaySystem.HasData(mapGrid.Index))\n continue;\n\n var gridBounds = new Box2(mapGrid.WorldToLocal(worldBounds.BottomLeft), mapGrid.WorldToLocal(worldBounds.TopRight));\n\n foreach (var tile in mapGrid.GetTilesIntersecting(gridBounds))\n {\n foreach (var (texture, color) in _gasTileOverlaySystem.GetOverlays(mapGrid.Index, tile.GridIndices))\n {\n drawHandle.DrawTexture(texture, mapGrid.LocalToWorld(new Vector2(tile.X, tile.Y)), color);\n }\n }\n }\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671928,"cells":{"commit":{"kind":"string","value":"608513b64312f685ed6255570bdd1c03c64e54a7"},"subject":{"kind":"string","value":"Fix related to #AG231 - Mapper resolution is OK to be transient"},"repos":{"kind":"string","value":"csf-dev/agiil,csf-dev/agiil,csf-dev/agiil,csf-dev/agiil"},"old_file":{"kind":"string","value":"Agiil.Bootstrap/ObjectMaps/AutomapperModule.cs"},"new_file":{"kind":"string","value":"Agiil.Bootstrap/ObjectMaps/AutomapperModule.cs"},"new_contents":{"kind":"string","value":"using System;\nusing Agiil.ObjectMaps;\nusing Autofac;\nusing AutoMapper;\n\nnamespace Agiil.Bootstrap.ObjectMaps\n{\n public class AutomapperModule : Module\n {\n protected override void Load(ContainerBuilder builder)\n {\n builder\n .Register(GetMapperConfiguration)\n .SingleInstance();\n\n builder.Register(GetMapper);\n }\n\n MapperConfiguration GetMapperConfiguration(IComponentContext ctx)\n => ctx.Resolve().GetConfiguration();\n\n IMapper GetMapper(IComponentContext ctx)\n {\n var config = ctx.Resolve();\n var scope = ctx.Resolve();\n\n // Looking at https://github.com/AutoMapper/AutoMapper/blob/v6.0.2/src/AutoMapper/MapperConfiguration.cs#L250\n // we can see that this is a trivially cheap operation, OK to happen as often as we need.\n var mapper = config.CreateMapper(scope.Resolve);\n\n return mapper;\n }\n\n\n }\n}\n"},"old_contents":{"kind":"string","value":"using System;\nusing Agiil.ObjectMaps;\nusing Autofac;\nusing AutoMapper;\n\nnamespace Agiil.Bootstrap.ObjectMaps\n{\n public class AutomapperModule : Module\n {\n protected override void Load(ContainerBuilder builder)\n {\n builder\n .Register(GetMapperConfiguration)\n .SingleInstance();\n builder\n .Register(GetMapper)\n .SingleInstance();\n }\n\n MapperConfiguration GetMapperConfiguration(IComponentContext ctx)\n => ctx.Resolve().GetConfiguration();\n\n IMapper GetMapper(IComponentContext ctx)\n {\n var config = ctx.Resolve();\n var scope = ctx.Resolve();\n var mapper = config.CreateMapper(scope.Resolve);\n\n return mapper;\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671929,"cells":{"commit":{"kind":"string","value":"9f7874c78d40a7e27aaeeaaa1787c0f5d987d51f"},"subject":{"kind":"string","value":"Use DomainCustomization rather than AutoMoqCustomization directly"},"repos":{"kind":"string","value":"appharbor/appharbor-cli"},"old_file":{"kind":"string","value":"src/AppHarbor.Tests/AutoCommandDataAttribute.cs"},"new_file":{"kind":"string","value":"src/AppHarbor.Tests/AutoCommandDataAttribute.cs"},"new_contents":{"kind":"string","value":"using Ploeh.AutoFixture;\nusing Ploeh.AutoFixture.AutoMoq;\nusing Ploeh.AutoFixture.Xunit;\n\nnamespace AppHarbor.Tests\n{\n\tpublic class AutoCommandDataAttribute : AutoDataAttribute\n\t{\n\t\tpublic AutoCommandDataAttribute()\n\t\t\t: base(new Fixture().Customize(new DomainCustomization()))\n\t\t{\n\t\t}\n\t}\n}\n"},"old_contents":{"kind":"string","value":"using Ploeh.AutoFixture;\nusing Ploeh.AutoFixture.AutoMoq;\nusing Ploeh.AutoFixture.Xunit;\n\nnamespace AppHarbor.Tests\n{\n\tpublic class AutoCommandDataAttribute : AutoDataAttribute\n\t{\n\t\tpublic AutoCommandDataAttribute()\n\t\t\t: base(new Fixture().Customize(new AutoMoqCustomization()))\n\t\t{\n\t\t}\n\t}\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671930,"cells":{"commit":{"kind":"string","value":"624f5d1f6a50183e55249cd350e0db11b70f8b33"},"subject":{"kind":"string","value":"Update test"},"repos":{"kind":"string","value":"arkivverket/arkade5,arkivverket/arkade5,arkivverket/arkade5"},"old_file":{"kind":"string","value":"src/Arkivverket.Arkade.Test/Util/XmlUtilTest.cs"},"new_file":{"kind":"string","value":"src/Arkivverket.Arkade.Test/Util/XmlUtilTest.cs"},"new_contents":{"kind":"string","value":"using Arkivverket.Arkade.Test.Tests.Noark5;\nusing Arkivverket.Arkade.Util;\nusing Xunit;\nusing FluentAssertions;\n\nnamespace Arkivverket.Arkade.Test.Util\n{\n public class XmlUtilTest\n {\n\n private string addmlXsd = ResourceUtil.ReadResource(ArkadeConstants.AddmlXsdResource);\n private string addml = TestUtil.ReadFromFileInTestDataDir(\"noark3\\\\addml.xml\");\n\n [Fact]\n public void ShouldNotCreateErrorsIfIfXmlValidateAgainstSchema()\n {\n var validationErrorMessages = XmlUtil.Validate(addml, addmlXsd);\n\n validationErrorMessages.Count.Should().Be(0);\n }\n\n [Fact]\n public void ShouldThrowExceptionIfXmlDoesNotValidateAgainstSchema()\n {\n var invalidAddml = addml.Replace(\"dataset\", \"datasett\");\n\n var validationErrorMessages = XmlUtil.Validate(invalidAddml, addmlXsd);\n\n validationErrorMessages.Should().Contain(m => m.Equals(\n \"Elementet addml i navneområdet http://www.arkivverket.no/standarder/addml\" +\n \" har ugyldig underordnet element datasett i navneområdet http://www.arkivverket.no/standarder/addml.\" +\n \" Forventet liste over mulige elementer: dataset i navneområdet http://www.arkivverket.no/standarder/addml.\")\n );\n }\n\n }\n}\n"},"old_contents":{"kind":"string","value":"using Arkivverket.Arkade.Test.Tests.Noark5;\nusing Arkivverket.Arkade.Util;\nusing Xunit;\nusing FluentAssertions;\nusing System.Xml.Schema;\n\nnamespace Arkivverket.Arkade.Test.Util\n{\n public class XmlUtilTest\n {\n\n private string addmlXsd = ResourceUtil.ReadResource(ArkadeConstants.AddmlXsdResource);\n private string addml = TestUtil.ReadFromFileInTestDataDir(\"noark3\\\\addml.xml\");\n\n [Fact]\n public void ShouldNotThrowExceptionIfXmlValidateAgainstSchema()\n {\n XmlUtil.Validate(addml, addmlXsd);\n }\n\n [Fact]\n public void ShouldThrowExceptionIfXmlDoesNotValidateAgainstSchema()\n {\n var invalidAddml = addml.Replace(\"dataset\", \"datasett\");\n\n var exception = Xunit.Assert.Throws(() => XmlUtil.Validate(invalidAddml, addmlXsd));\n exception.Message.Should().Contain(\"datasett\");\n }\n\n }\n}\n"},"license":{"kind":"string","value":"agpl-3.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671931,"cells":{"commit":{"kind":"string","value":"2976cd1ce4aef0eef6ae17591ec6434dd9d0a013"},"subject":{"kind":"string","value":"Fix SliderTest.SlideHorizontally on Win 10"},"repos":{"kind":"string","value":"JohanLarsson/Gu.Wpf.UiAutomation"},"old_file":{"kind":"string","value":"Gu.Wpf.UiAutomation/AutomationElements/Thumb.cs"},"new_file":{"kind":"string","value":"Gu.Wpf.UiAutomation/AutomationElements/Thumb.cs"},"new_contents":{"kind":"string","value":"namespace Gu.Wpf.UiAutomation\n{\n using System.Windows;\n using System.Windows.Automation;\n\n public class Thumb : UiElement\n {\n private const int DragSpeed = 500;\n\n public Thumb(AutomationElement automationElement)\n : base(automationElement)\n {\n }\n\n public TransformPattern TransformPattern => this.AutomationElement.TransformPattern();\n\n /// \n /// Moves the slider horizontally.\n /// \n /// + for right, - for left.\n public void SlideHorizontally(int distance)\n {\n var cp = this.GetClickablePoint();\n Mouse.Drag(MouseButton.Left, cp, cp + new Vector(distance, 0), DragSpeed);\n Wait.UntilInputIsProcessed();\n }\n\n /// \n /// Moves the slider vertically.\n /// \n /// + for down, - for up.\n public void SlideVertically(int distance)\n {\n var cp = this.GetClickablePoint();\n Mouse.Drag(MouseButton.Left, cp, cp + new Vector(0, distance), DragSpeed);\n Wait.UntilInputIsProcessed();\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"namespace Gu.Wpf.UiAutomation\n{\n using System.Windows.Automation;\n\n public class Thumb : UiElement\n {\n public Thumb(AutomationElement automationElement)\n : base(automationElement)\n {\n }\n\n public TransformPattern TransformPattern => this.AutomationElement.TransformPattern();\n\n /// \n /// Moves the slider horizontally.\n /// \n /// + for right, - for left.\n public void SlideHorizontally(int distance)\n {\n Mouse.DragHorizontally(MouseButton.Left, this.Bounds.Center(), distance);\n }\n\n /// \n /// Moves the slider vertically.\n /// \n /// + for down, - for up.\n public void SlideVertically(int distance)\n {\n Mouse.DragVertically(MouseButton.Left, this.Bounds.Center(), distance);\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671932,"cells":{"commit":{"kind":"string","value":"fd0cd2c948e95eb25d24930f22c65e7a59c385e0"},"subject":{"kind":"string","value":"Use less confusing placeholder icon for YAML"},"repos":{"kind":"string","value":"JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity"},"old_file":{"kind":"string","value":"resharper/resharper-yaml/src/Psi/YamlProjectFileLanguageService.cs"},"new_file":{"kind":"string","value":"resharper/resharper-yaml/src/Psi/YamlProjectFileLanguageService.cs"},"new_contents":{"kind":"string","value":"using JetBrains.Application.UI.Icons.Special.ThemedIcons;\nusing JetBrains.ProjectModel;\nusing JetBrains.ReSharper.Plugins.Yaml.ProjectModel;\nusing JetBrains.ReSharper.Plugins.Yaml.Settings;\nusing JetBrains.ReSharper.Psi;\nusing JetBrains.ReSharper.Psi.Parsing;\nusing JetBrains.Text;\nusing JetBrains.UI.Icons;\n\nnamespace JetBrains.ReSharper.Plugins.Yaml.Psi\n{\n [ProjectFileType(typeof(YamlProjectFileType))]\n public class YamlProjectFileLanguageService : ProjectFileLanguageService\n {\n private readonly YamlSupport myYamlSupport;\n\n public YamlProjectFileLanguageService(YamlSupport yamlSupport)\n : base(YamlProjectFileType.Instance)\n {\n myYamlSupport = yamlSupport;\n }\n\n public override ILexerFactory GetMixedLexerFactory(ISolution solution, IBuffer buffer, IPsiSourceFile sourceFile = null)\n {\n var languageService = YamlLanguage.Instance.LanguageService();\n return languageService?.GetPrimaryLexerFactory();\n }\n\n protected override PsiLanguageType PsiLanguageType\n {\n get\n {\n var yamlLanguage = (PsiLanguageType) YamlLanguage.Instance ?? UnknownLanguage.Instance;\n return myYamlSupport.IsParsingEnabled.Value ? yamlLanguage : UnknownLanguage.Instance;\n }\n }\n\n // TODO: Proper icon!\n public override IconId Icon => SpecialThemedIcons.Placeholder.Id;\n }\n}"},"old_contents":{"kind":"string","value":"using JetBrains.ProjectModel;\nusing JetBrains.ReSharper.Plugins.Yaml.ProjectModel;\nusing JetBrains.ReSharper.Plugins.Yaml.Settings;\nusing JetBrains.ReSharper.Psi;\nusing JetBrains.ReSharper.Psi.CSharp.Resources;\nusing JetBrains.ReSharper.Psi.Parsing;\nusing JetBrains.Text;\nusing JetBrains.UI.Icons;\n\nnamespace JetBrains.ReSharper.Plugins.Yaml.Psi\n{\n [ProjectFileType(typeof(YamlProjectFileType))]\n public class YamlProjectFileLanguageService : ProjectFileLanguageService\n {\n private readonly YamlSupport myYamlSupport;\n\n public YamlProjectFileLanguageService(YamlSupport yamlSupport)\n : base(YamlProjectFileType.Instance)\n {\n myYamlSupport = yamlSupport;\n }\n\n public override ILexerFactory GetMixedLexerFactory(ISolution solution, IBuffer buffer, IPsiSourceFile sourceFile = null)\n {\n var languageService = YamlLanguage.Instance.LanguageService();\n return languageService?.GetPrimaryLexerFactory();\n }\n\n protected override PsiLanguageType PsiLanguageType\n {\n get\n {\n var yamlLanguage = (PsiLanguageType) YamlLanguage.Instance ?? UnknownLanguage.Instance;\n return myYamlSupport.IsParsingEnabled.Value ? yamlLanguage : UnknownLanguage.Instance;\n }\n }\n\n // TODO: Proper icon!\n public override IconId Icon => PsiCSharpThemedIcons.Csharp.Id;\n }\n}"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671933,"cells":{"commit":{"kind":"string","value":"6dc94b92a1502b7b7d9ad17651390d23d110414c"},"subject":{"kind":"string","value":"make AuthorizeResponse public"},"repos":{"kind":"string","value":"jbijlsma/IdentityServer4,MienDev/IdentityServer4,jbijlsma/IdentityServer4,IdentityServer/IdentityServer4,jbijlsma/IdentityServer4,jbijlsma/IdentityServer4,MienDev/IdentityServer4,chrisowhite/IdentityServer4,MienDev/IdentityServer4,siyo-wang/IdentityServer4,MienDev/IdentityServer4,IdentityServer/IdentityServer4,chrisowhite/IdentityServer4,IdentityServer/IdentityServer4,chrisowhite/IdentityServer4,siyo-wang/IdentityServer4,IdentityServer/IdentityServer4,siyo-wang/IdentityServer4"},"old_file":{"kind":"string","value":"src/IdentityServer4/Models/AuthorizeResponse.cs"},"new_file":{"kind":"string","value":"src/IdentityServer4/Models/AuthorizeResponse.cs"},"new_contents":{"kind":"string","value":"// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.\n// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.\n\n\nusing IdentityServer4.Extensions;\nusing IdentityServer4.Validation;\n\nnamespace IdentityServer4.Models\n{\n public class AuthorizeResponse\n {\n public ValidatedAuthorizeRequest Request { get; set; }\n public string RedirectUri => Request?.RedirectUri;\n public string State => Request?.State;\n public string Scope => Request?.ValidatedScopes?.GrantedResources?.ToScopeNames()?.ToSpaceSeparatedString();\n\n public string IdentityToken { get; set; }\n public string AccessToken { get; set; }\n public int AccessTokenLifetime { get; set; }\n public string Code { get; set; }\n public string SessionState { get; set; }\n\n public string Error { get; set; }\n public string ErrorDescription { get; set; }\n public bool IsError => Error.IsPresent();\n }\n}"},"old_contents":{"kind":"string","value":"// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.\n// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.\n\n\nusing IdentityServer4.Extensions;\nusing IdentityServer4.Validation;\n\nnamespace IdentityServer4.Models\n{\n class AuthorizeResponse\n {\n public ValidatedAuthorizeRequest Request { get; set; }\n public string RedirectUri => Request?.RedirectUri;\n public string State => Request?.State;\n public string Scope => Request?.ValidatedScopes?.GrantedResources?.ToScopeNames()?.ToSpaceSeparatedString();\n\n public string IdentityToken { get; set; }\n public string AccessToken { get; set; }\n public int AccessTokenLifetime { get; set; }\n public string Code { get; set; }\n public string SessionState { get; set; }\n\n public string Error { get; set; }\n public string ErrorDescription { get; set; }\n public bool IsError => Error.IsPresent();\n }\n}"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671934,"cells":{"commit":{"kind":"string","value":"53794bf030808426af54082c589057b1e41bcd5e"},"subject":{"kind":"string","value":"make use of the TextBrush"},"repos":{"kind":"string","value":"Ollienator/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,snoopydo/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,willdean/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,hakim89/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,dunderburken/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,larshg/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,larshg/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,willdean/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,jiangzm/Bonobo-Git-Server,willdean/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,larshg/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,willdean/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,lkho/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,crowar/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,lkho/Bonobo-Git-Server,gencer/Bonobo-Git-Server,crowar/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,gencer/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,crowar/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,gencer/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,willdean/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,YelaSeamless/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,larshg/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,crowar/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,gencer/Bonobo-Git-Server,crowar/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,crowar/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,kfarnung/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,jiangzm/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,NipponSysits/IIS.Git-Connector,Acute-sales-ltd/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,KiritoStudio/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,dunderburken/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,lkho/Bonobo-Git-Server,lkho/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server"},"old_file":{"kind":"string","value":"Bonobo.Git.Server/Views/Repository/Blob.cshtml"},"new_file":{"kind":"string","value":"Bonobo.Git.Server/Views/Repository/Blob.cshtml"},"new_contents":{"kind":"string","value":"@using Bonobo.Git.Server.Extensions\n@model RepositoryTreeDetailModel\n@{\n Layout = \"~/Views/Repository/_RepositoryLayout.cshtml\";\n ViewBag.Title = Resources.Repository_Tree_Title;\n}\n@if (Model != null)\n{\n @Html.Partial(\"_BranchSwitcher\")\n @Html.Partial(\"_AddressBar\")\n\n
\n @{\n \n }\n @if (Model.IsImage)\n {\n \"@Model.Name\"\n }\n else if (Model.IsText && Model.IsMarkdown)\n {\n
@Html.MarkdownToHtml(Model.Text)
\n }\n else if (Model.IsText)\n {\n
@Model.Text
\n }\n else\n {\n
@Resources.Repository_Tree_PreviewNotSupported
\n }\n
\n}\n\n@section scripts \n{\n \n}\n"},"old_contents":{"kind":"string","value":"@using Bonobo.Git.Server.Extensions\n@model RepositoryTreeDetailModel\n@{\n Layout = \"~/Views/Repository/_RepositoryLayout.cshtml\";\n ViewBag.Title = Resources.Repository_Tree_Title;\n}\n@if (Model != null)\n{\n @Html.Partial(\"_BranchSwitcher\")\n @Html.Partial(\"_AddressBar\")\n\n
\n @{\n \n }\n @if (Model.IsImage)\n {\n \"@Model.Name\"\n }\n else if (Model.IsText && Model.IsMarkdown)\n {\n
@Html.MarkdownToHtml(Model.Text)
\n }\n else if (Model.IsText)\n {\n
@Model.Text
\n }\n else\n {\n
@Resources.Repository_Tree_PreviewNotSupported
\n }\n
\n}\n\n@section scripts \n{\n \n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671935,"cells":{"commit":{"kind":"string","value":"fbeddd8ec2048f7ec6504267c168a97228c2fb39"},"subject":{"kind":"string","value":"Update CurrencyNotFoundException.cs"},"repos":{"kind":"string","value":"tiksn/TIKSN-Framework"},"old_file":{"kind":"string","value":"TIKSN.Core/Finance/CurrencyNotFoundException.cs"},"new_file":{"kind":"string","value":"TIKSN.Core/Finance/CurrencyNotFoundException.cs"},"new_contents":{"kind":"string","value":"using System;\n\nnamespace TIKSN.Finance\n{\n //[System.Serializable]\n public class CurrencyNotFoundException : Exception\n {\n public CurrencyNotFoundException()\n {\n }\n\n public CurrencyNotFoundException(string message) : base(message)\n {\n }\n\n public CurrencyNotFoundException(string message, Exception inner) : base(message, inner)\n {\n }\n\n //protected CurrencyNotFoundException(\n // System.Runtime.Serialization.SerializationInfo info,\n // System.Runtime.Serialization.StreamingContext context) : base(info, context)\n //{ }\n }\n}\n"},"old_contents":{"kind":"string","value":"namespace TIKSN.Finance\n{\n //[System.Serializable]\n public class CurrencyNotFoundException : System.Exception\n {\n public CurrencyNotFoundException()\n {\n }\n\n public CurrencyNotFoundException(string message) : base(message)\n {\n }\n\n public CurrencyNotFoundException(string message, System.Exception inner) : base(message, inner)\n {\n }\n\n //protected CurrencyNotFoundException(\n // System.Runtime.Serialization.SerializationInfo info,\n // System.Runtime.Serialization.StreamingContext context) : base(info, context)\n //{ }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671936,"cells":{"commit":{"kind":"string","value":"b097f2f3db33ba5f00f4146cdde59d2be37ef97c"},"subject":{"kind":"string","value":"Simplify name."},"repos":{"kind":"string","value":"autofac/Autofac.WebApi.Owin"},"old_file":{"kind":"string","value":"src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs"},"new_file":{"kind":"string","value":"src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs"},"new_contents":{"kind":"string","value":"// Copyright (c) Autofac Project. All rights reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\nusing System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Web.Http;\nusing Autofac.Integration.WebApi.Owin;\n\nnamespace Owin;\n\n/// \n/// Extension methods for configuring the OWIN pipeline.\n/// \n[EditorBrowsable(EditorBrowsableState.Never)]\npublic static class AutofacWebApiAppBuilderExtensions\n{\n /// \n /// Extends the Autofac lifetime scope added from the OWIN pipeline through to the Web API dependency scope.\n /// \n /// The application builder.\n /// The HTTP server configuration.\n /// The application builder for continued configuration.\n /// \n /// Thrown if or is .\n /// \n [SuppressMessage(\"Microsoft.Reliability\", \"CA2000:Dispose objects before losing scope\", Justification = \"The handler created must exist for the entire application lifetime.\")]\n public static IAppBuilder UseAutofacWebApi(this IAppBuilder app, HttpConfiguration configuration)\n {\n if (app == null)\n {\n throw new ArgumentNullException(nameof(app));\n }\n\n if (configuration == null)\n {\n throw new ArgumentNullException(nameof(configuration));\n }\n\n if (!configuration.MessageHandlers.OfType().Any())\n {\n configuration.MessageHandlers.Insert(0, new DependencyScopeHandler());\n }\n\n return app;\n }\n}\n"},"old_contents":{"kind":"string","value":"// Copyright (c) Autofac Project. All rights reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\nusing System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Web.Http;\nusing Autofac.Integration.WebApi.Owin;\n\nnamespace Owin;\n\n/// \n/// Extension methods for configuring the OWIN pipeline.\n/// \n[EditorBrowsable(EditorBrowsableState.Never)]\npublic static class AutofacWebApiAppBuilderExtensions\n{\n /// \n /// Extends the Autofac lifetime scope added from the OWIN pipeline through to the Web API dependency scope.\n /// \n /// The application builder.\n /// The HTTP server configuration.\n /// The application builder for continued configuration.\n /// \n /// Thrown if or is .\n /// \n [SuppressMessage(\"Microsoft.Reliability\", \"CA2000:Dispose objects before losing scope\", Justification = \"The handler created must exist for the entire application lifetime.\")]\n public static IAppBuilder UseAutofacWebApi(this IAppBuilder app, HttpConfiguration configuration)\n {\n if (app == null)\n {\n throw new ArgumentNullException(nameof(app));\n }\n\n if (configuration == null)\n {\n throw new ArgumentNullException(nameof(configuration));\n }\n\n if (!configuration.MessageHandlers.OfType().Any())\n {\n configuration.MessageHandlers.Insert(0, new DependencyScopeHandler());\n }\n\n return app;\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671937,"cells":{"commit":{"kind":"string","value":"e5c12dc7b9605657baa3087ffd0f25532f2c6172"},"subject":{"kind":"string","value":"Use List instead of IList for struct enumeration in unsorted metadata table buffers."},"repos":{"kind":"string","value":"Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver"},"old_file":{"kind":"string","value":"src/AsmResolver.DotNet/Builder/Metadata/Tables/UnsortedMetadataTableBuffer.cs"},"new_file":{"kind":"string","value":"src/AsmResolver.DotNet/Builder/Metadata/Tables/UnsortedMetadataTableBuffer.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing AsmResolver.PE.DotNet.Metadata.Tables;\nusing AsmResolver.PE.DotNet.Metadata.Tables.Rows;\n\nnamespace AsmResolver.DotNet.Builder.Metadata.Tables\n{\n /// \n /// Represents a metadata stream buffer that adds every new row at the end of the table, without any further\n /// processing or reordering of the rows.\n /// \n /// The type of rows to store.\n public class UnsortedMetadataTableBuffer : IMetadataTableBuffer \n where TRow : struct, IMetadataRow\n {\n private readonly List _entries = new List();\n private readonly MetadataTable _table;\n\n /// \n /// Creates a new unsorted metadata table buffer.\n /// \n /// The underlying table to flush to.\n public UnsortedMetadataTableBuffer(MetadataTable table)\n {\n _table = table ?? throw new ArgumentNullException(nameof(table));\n }\n\n /// \n public int Count => _entries.Count;\n\n /// \n public virtual TRow this[uint rid]\n {\n get => _entries[(int) (rid - 1)];\n set => _entries[(int) (rid - 1)] = value;\n }\n\n /// \n public virtual MetadataToken Add(in TRow row, uint originalRid)\n {\n _entries.Add(row);\n return new MetadataToken(_table.TableIndex, (uint) _entries.Count);\n }\n\n /// \n public void FlushToTable()\n {\n foreach (var row in _entries)\n _table.Add(row);\n }\n }\n}"},"old_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing AsmResolver.PE.DotNet.Metadata.Tables;\nusing AsmResolver.PE.DotNet.Metadata.Tables.Rows;\n\nnamespace AsmResolver.DotNet.Builder.Metadata.Tables\n{\n /// \n /// Represents a metadata stream buffer that adds every new row at the end of the table, without any further\n /// processing or reordering of the rows.\n /// \n /// The type of rows to store.\n public class UnsortedMetadataTableBuffer : IMetadataTableBuffer \n where TRow : struct, IMetadataRow\n {\n private readonly IList _entries = new List();\n private readonly MetadataTable _table;\n\n /// \n /// Creates a new unsorted metadata table buffer.\n /// \n /// The underlying table to flush to.\n public UnsortedMetadataTableBuffer(MetadataTable table)\n {\n _table = table ?? throw new ArgumentNullException(nameof(table));\n }\n\n /// \n public int Count => _entries.Count;\n\n /// \n public virtual TRow this[uint rid]\n {\n get => _entries[(int) (rid - 1)];\n set => _entries[(int) (rid - 1)] = value;\n }\n\n /// \n public virtual MetadataToken Add(in TRow row, uint originalRid)\n {\n _entries.Add(row);\n return new MetadataToken(_table.TableIndex, (uint) _entries.Count);\n }\n\n /// \n public void FlushToTable()\n {\n foreach (var row in _entries)\n _table.Add(row);\n }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671938,"cells":{"commit":{"kind":"string","value":"f52b5172ec95fd89ab106348016812087663039a"},"subject":{"kind":"string","value":"Update route name"},"repos":{"kind":"string","value":"dsteinweg/TeacherPouch,dsteinweg/TeacherPouch,dsteinweg/TeacherPouch,dsteinweg/TeacherPouch"},"old_file":{"kind":"string","value":"src/TeacherPouch/Controllers/ErrorController.cs"},"new_file":{"kind":"string","value":"src/TeacherPouch/Controllers/ErrorController.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.Net;\nusing Microsoft.AspNetCore.Mvc;\nusing TeacherPouch.ViewModels;\n\nnamespace TeacherPouch.Controllers\n{\n public class ErrorController : BaseController\n {\n public IActionResult Http404()\n {\n Response.StatusCode = (int)HttpStatusCode.NotFound;\n\n return View(\"Http404\");\n }\n\n [Route(\"Error\")]\n public IActionResult Error(int? httpStatusCode, Exception exception = null)\n {\n var showErrorDetails = User.Identity.IsAuthenticated;\n\n var viewModel = new ErrorViewModel(httpStatusCode, exception, showErrorDetails);\n\n Response.StatusCode = viewModel.StatusCode;\n\n return View(viewModel);\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System;\nusing System.Net;\nusing Microsoft.AspNetCore.Mvc;\nusing TeacherPouch.ViewModels;\n\nnamespace TeacherPouch.Controllers\n{\n public class ErrorController : BaseController\n {\n public IActionResult Http404()\n {\n Response.StatusCode = (int)HttpStatusCode.NotFound;\n\n return View(\"Http404\");\n }\n\n [Route(\"error\")]\n public IActionResult Error(int? httpStatusCode, Exception exception = null)\n {\n var showErrorDetails = User.Identity.IsAuthenticated;\n\n var viewModel = new ErrorViewModel(httpStatusCode, exception, showErrorDetails);\n\n Response.StatusCode = viewModel.StatusCode;\n\n return View(\"Error\", viewModel);\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671939,"cells":{"commit":{"kind":"string","value":"71c603072906823028642dda66f9f0a0afdc76d5"},"subject":{"kind":"string","value":"Add registration options for definition request"},"repos":{"kind":"string","value":"PowerShell/PowerShellEditorServices"},"old_file":{"kind":"string","value":"src/PowerShellEditorServices.Protocol/LanguageServer/Definition.cs"},"new_file":{"kind":"string","value":"src/PowerShellEditorServices.Protocol/LanguageServer/Definition.cs"},"new_contents":{"kind":"string","value":"//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n//\n\nusing Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;\n\nnamespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer\n{\n public class DefinitionRequest\n {\n public static readonly\n RequestType Type =\n RequestType.Create(\"textDocument/definition\");\n }\n}\n\n"},"old_contents":{"kind":"string","value":"//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n//\n\nusing Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;\n\nnamespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer\n{\n public class DefinitionRequest\n {\n public static readonly\n RequestType Type =\n RequestType.Create(\"textDocument/definition\");\n }\n}\n\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671940,"cells":{"commit":{"kind":"string","value":"f93f08752b263cad9bcbe087aa23ba6d0a002df5"},"subject":{"kind":"string","value":"Implement AdapterListCollection.Count"},"repos":{"kind":"string","value":"alesliehughes/monoDX,alesliehughes/monoDX"},"old_file":{"kind":"string","value":"Microsoft.DirectX.Direct3D/Microsoft.DirectX.Direct3D/AdapterListCollection.cs"},"new_file":{"kind":"string","value":"Microsoft.DirectX.Direct3D/Microsoft.DirectX.Direct3D/AdapterListCollection.cs"},"new_contents":{"kind":"string","value":"/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2013 Alistair Leslie-Hughes\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nusing System;\nusing System.Collections;\n\nnamespace Microsoft.DirectX.Direct3D\n{\n\tpublic sealed class AdapterListCollection : IEnumerable, IEnumerator\n\t{\n\t\tinternal int currAdapter;\n\n\t\tpublic AdapterInformation Default {\n\t\t\tget {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic AdapterInformation this [int adapter] {\n\t\t\tget {\n\t\t\t\treturn new AdapterInformation(adapter);\n\t\t\t}\n\t\t}\n\n\t\t//TODO: Returns 1 all the time.\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\tpublic object Current {\n\t\t\tget {\n\t\t\t\treturn new AdapterInformation(this.currAdapter);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Reset ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\t//TODO: Assumes only one Adapter - Should be enough for now.\n\t\tpublic bool MoveNext ()\n\t\t{\n\t\t\tif(currAdapter == 0)\n\t\t\t\treturn false;\n\n\t\t\tcurrAdapter++;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic IEnumerator GetEnumerator ()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override bool Equals (object compare)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tinternal AdapterListCollection ()\n\t\t{\n\t\t\tcurrAdapter = -1;\n\t\t}\n\t}\n}\n"},"old_contents":{"kind":"string","value":"/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2013 Alistair Leslie-Hughes\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nusing System;\nusing System.Collections;\n\nnamespace Microsoft.DirectX.Direct3D\n{\n\tpublic sealed class AdapterListCollection : IEnumerable, IEnumerator\n\t{\n\t\tinternal int currAdapter;\n\n\t\tpublic AdapterInformation Default {\n\t\t\tget {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic AdapterInformation this [int adapter] {\n\t\t\tget {\n\t\t\t\treturn new AdapterInformation(adapter);\n\t\t\t}\n\t\t}\n\n\t\t//TODO: Returns 1 all the time.\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\tpublic object Current {\n\t\t\tget {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic void Reset ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\t//TODO: Assumes only one Adapter - Should be enough for now.\n\t\tpublic bool MoveNext ()\n\t\t{\n\t\t\tif(currAdapter == 0)\n\t\t\t\treturn false;\n\n\t\t\tcurrAdapter++;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic IEnumerator GetEnumerator ()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override bool Equals (object compare)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tinternal AdapterListCollection ()\n\t\t{\n\t\t\tcurrAdapter = -1;\n\t\t}\n\t}\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671941,"cells":{"commit":{"kind":"string","value":"aaa9685cf1508e44e8392a3be285b5d6ba612218"},"subject":{"kind":"string","value":"Fix issues"},"repos":{"kind":"string","value":"seanshpark/corefx,fgreinacher/corefx,Jiayili1/corefx,seanshpark/corefx,ptoonen/corefx,zhenlan/corefx,zhenlan/corefx,ptoonen/corefx,Ermiar/corefx,wtgodbe/corefx,seanshpark/corefx,wtgodbe/corefx,Ermiar/corefx,seanshpark/corefx,mmitche/corefx,axelheer/corefx,ericstj/corefx,ViktorHofer/corefx,shimingsg/corefx,mmitche/corefx,Jiayili1/corefx,ptoonen/corefx,BrennanConroy/corefx,Jiayili1/corefx,axelheer/corefx,ericstj/corefx,fgreinacher/corefx,ravimeda/corefx,parjong/corefx,wtgodbe/corefx,BrennanConroy/corefx,shimingsg/corefx,ViktorHofer/corefx,parjong/corefx,BrennanConroy/corefx,wtgodbe/corefx,shimingsg/corefx,axelheer/corefx,ViktorHofer/corefx,mmitche/corefx,zhenlan/corefx,mmitche/corefx,ericstj/corefx,ericstj/corefx,ptoonen/corefx,Jiayili1/corefx,wtgodbe/corefx,ptoonen/corefx,seanshpark/corefx,ravimeda/corefx,ptoonen/corefx,ericstj/corefx,zhenlan/corefx,Ermiar/corefx,axelheer/corefx,shimingsg/corefx,shimingsg/corefx,zhenlan/corefx,shimingsg/corefx,ravimeda/corefx,Ermiar/corefx,wtgodbe/corefx,ericstj/corefx,ericstj/corefx,shimingsg/corefx,ravimeda/corefx,parjong/corefx,parjong/corefx,mmitche/corefx,parjong/corefx,ViktorHofer/corefx,ViktorHofer/corefx,mmitche/corefx,zhenlan/corefx,Ermiar/corefx,mmitche/corefx,Ermiar/corefx,zhenlan/corefx,seanshpark/corefx,Ermiar/corefx,ViktorHofer/corefx,fgreinacher/corefx,ViktorHofer/corefx,ravimeda/corefx,seanshpark/corefx,Jiayili1/corefx,fgreinacher/corefx,axelheer/corefx,axelheer/corefx,ravimeda/corefx,parjong/corefx,ptoonen/corefx,Jiayili1/corefx,ravimeda/corefx,Jiayili1/corefx,wtgodbe/corefx,parjong/corefx"},"old_file":{"kind":"string","value":"src/System.Diagnostics.PerformanceCounter/src/misc/EnvironmentHelpers.cs"},"new_file":{"kind":"string","value":"src/System.Diagnostics.PerformanceCounter/src/misc/EnvironmentHelpers.cs"},"new_contents":{"kind":"string","value":"// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\nusing System.ComponentModel;\nusing System.Security;\nusing System.Security.Principal;\n\nnamespace System\n{\n internal static class EnvironmentHelpers\n {\n private static volatile bool s_isAppContainerProcess;\n private static volatile bool s_isAppContainerProcessInitalized;\n\n public static bool IsAppContainerProcess\n {\n get\n {\n if(!s_isAppContainerProcessInitalized)\n {\n if(Environment.OSVersion.Version.Major < 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor <= 1))\n {\n // Windows 7 or older.\n s_isAppContainerProcess = false;\n }\n else\n {\n s_isAppContainerProcess = HasAppContainerToken();\n }\n \n s_isAppContainerProcessInitalized = true;\n }\n \n return s_isAppContainerProcess;\n }\n }\n\n private static unsafe bool HasAppContainerToken()\n {\n int* dwIsAppContainerPtr = stackalloc int[1];\n uint dwLength = 0;\n\n using (WindowsIdentity wi = WindowsIdentity.GetCurrent(TokenAccessLevels.Query))\n {\n if (!Interop.Advapi32.GetTokenInformation(wi.Token, (uint)Interop.Advapi32.TOKEN_INFORMATION_CLASS.TokenIsAppContainer, new IntPtr(dwIsAppContainerPtr), sizeof(int), out dwLength))\n {\n throw new Win32Exception();\n }\n }\n\n return (*dwIsAppContainerPtr != 0);\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\nusing System.ComponentModel;\nusing System.Security;\nusing System.Security.Principal;\n\nnamespace System\n{\n internal static class EnvironmentHelpers\n {\n private static volatile bool s_isAppContainerProcess;\n private static volatile bool s_isAppContainerProcessInitalized;\n\n public static bool IsAppContainerProcess\n {\n get\n {\n if(!s_isAppContainerProcessInitalized)\n {\n if(Environment.OSVersion.Version.Major < 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor <= 1))\n {\n // Windows 7 or older.\n s_isAppContainerProcess = false;\n }\n else\n {\n s_isAppContainerProcess = HasAppContainerToken();\n }\n \n s_isAppContainerProcessInitalized = true;\n }\n \n return s_isAppContainerProcess;\n }\n }\n\n private static unsafe bool HasAppContainerToken()\n {\n int* dwIsAppContainerPtr = stackalloc int[1];\n uint dwLength = 0;\n\n using (WindowsIdentity wi = WindowsIdentity.GetCurrent(TokenAccessLevels.Query))\n {\n if (!Interop.Advapi32.GetTokenInformation(wi.Token, Interop.Advapi32.TOKEN_INFORMATION_CLASS.TokenIsAppContainer, new IntPtr(dwIsAppContainerPtr), sizeof(int), out dwLength))\n {\n throw new Win32Exception();\n }\n }\n\n return (*dwIsAppContainerPtr != 0);\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671942,"cells":{"commit":{"kind":"string","value":"b3cdf9479c46bc3fb73ce2548ba6714c40802ed2"},"subject":{"kind":"string","value":"Use common copy of System.Numerics.Hashing.HashHelpers"},"repos":{"kind":"string","value":"poizan42/coreclr,wtgodbe/coreclr,cshung/coreclr,poizan42/coreclr,mmitche/coreclr,krk/coreclr,cshung/coreclr,krk/coreclr,mmitche/coreclr,wtgodbe/coreclr,poizan42/coreclr,wtgodbe/coreclr,cshung/coreclr,krk/coreclr,krk/coreclr,mmitche/coreclr,krk/coreclr,poizan42/coreclr,krk/coreclr,wtgodbe/coreclr,mmitche/coreclr,cshung/coreclr,poizan42/coreclr,mmitche/coreclr,cshung/coreclr,cshung/coreclr,mmitche/coreclr,wtgodbe/coreclr,poizan42/coreclr,wtgodbe/coreclr"},"old_file":{"kind":"string","value":"src/System.Private.CoreLib/shared/System/Numerics/Hashing/HashHelpers.cs"},"new_file":{"kind":"string","value":"src/System.Private.CoreLib/shared/System/Numerics/Hashing/HashHelpers.cs"},"new_contents":{"kind":"string","value":"// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\nnamespace System.Numerics.Hashing\n{\n internal static class HashHelpers\n {\n public static readonly int RandomSeed = new Random().Next(int.MinValue, int.MaxValue);\n\n public static int Combine(int h1, int h2)\n {\n // RyuJIT optimizes this to use the ROL instruction\n // Related GitHub pull request: dotnet/coreclr#1830\n uint rol5 = ((uint)h1 << 5) | ((uint)h1 >> 27);\n return ((int)rol5 + h1) ^ h2;\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\nnamespace System.Numerics.Hashing\n{\n // Please change the corresponding file in corefx if this is changed.\n\n internal static class HashHelpers\n {\n public static readonly int RandomSeed = new Random().Next(int.MinValue, int.MaxValue);\n\n public static int Combine(int h1, int h2)\n {\n // RyuJIT optimizes this to use the ROL instruction\n // Related GitHub pull request: dotnet/coreclr#1830\n uint rol5 = ((uint)h1 << 5) | ((uint)h1 >> 27);\n return ((int)rol5 + h1) ^ h2;\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671943,"cells":{"commit":{"kind":"string","value":"080b4ba9ed5e2dca6755ffb2403272f469fc4dc0"},"subject":{"kind":"string","value":"Fix settings"},"repos":{"kind":"string","value":"nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet"},"old_file":{"kind":"string","value":"WalletWasabi.Gui/Shell/Commands/ToolCommands.cs"},"new_file":{"kind":"string","value":"WalletWasabi.Gui/Shell/Commands/ToolCommands.cs"},"new_contents":{"kind":"string","value":"using AvalonStudio.Commands;\nusing AvalonStudio.Documents;\nusing AvalonStudio.Extensibility;\nusing AvalonStudio.Shell;\nusing ReactiveUI;\nusing System.IO;\nusing System.Linq;\nusing WalletWasabi.Gui.Tabs.WalletManager;\n\nnamespace WalletWasabi.Gui.Shell.Commands\n{\n\tinternal class ToolCommands\n\t{\n\t\tpublic ToolCommands()\n\t\t{\n\t\t\tWalletManagerCommand = new CommandDefinition(\n\t\t\t\t\"Wallet Manager\", null, ReactiveCommand.Create(OnWalletManager));\n\n\t\t\tSettingsCommand = new CommandDefinition(\"I Do Nothing\", null, ReactiveCommand.Create(() => { }));\n\t\t}\n\n\t\tprivate void OnWalletManager()\n\t\t{\n\t\t\tif (Directory.Exists(Global.WalletsDir) && Directory.EnumerateFiles(Global.WalletsDir).Any())\n\t\t\t{\n\t\t\t\t// Load\n\t\t\t\tIShell tabs = IoC.Get();\n\t\t\t\tIDocumentTabViewModel doc = tabs.Documents.FirstOrDefault(x => x is WalletManagerViewModel);\n\t\t\t\tif (doc != default)\n\t\t\t\t{\n\t\t\t\t\tvar document = doc as WalletManagerViewModel;\n\t\t\t\t\ttabs.SelectedDocument = doc;\n\t\t\t\t\tdocument.SelectedCategory = document.Categories.First(x => x is LoadWalletViewModel);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar document = new WalletManagerViewModel();\n\t\t\t\t\ttabs.AddDocument(document);\n\t\t\t\t\tdocument.SelectedCategory = document.Categories.First(x => x is LoadWalletViewModel);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Generate\n\t\t\t\tIShell tabs = IoC.Get();\n\t\t\t\tIDocumentTabViewModel doc = tabs.Documents.FirstOrDefault(x => x is WalletManagerViewModel);\n\t\t\t\tif (doc != default)\n\t\t\t\t{\n\t\t\t\t\tvar document = doc as WalletManagerViewModel;\n\t\t\t\t\ttabs.SelectedDocument = doc;\n\t\t\t\t\tdocument.SelectedCategory = document.Categories.First(x => x is GenerateWalletViewModel);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar document = new WalletManagerViewModel();\n\t\t\t\t\ttabs.AddDocument(document);\n\t\t\t\t\tdocument.SelectedCategory = document.Categories.First(x => x is GenerateWalletViewModel);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[ExportCommandDefinition(\"Tools.WalletManager\")]\n\t\tpublic CommandDefinition WalletManagerCommand { get; }\n\n\t\t[ExportCommandDefinition(\"Tools.Settings\")]\n\t\tpublic CommandDefinition SettingsCommand { get; }\n\t}\n}\n"},"old_contents":{"kind":"string","value":"using AvalonStudio.Commands;\nusing AvalonStudio.Documents;\nusing AvalonStudio.Extensibility;\nusing AvalonStudio.Shell;\nusing ReactiveUI;\nusing System.IO;\nusing System.Linq;\nusing WalletWasabi.Gui.Tabs.WalletManager;\n\nnamespace WalletWasabi.Gui.Shell.Commands\n{\n\tinternal class ToolCommands\n\t{\n\t\tpublic ToolCommands()\n\t\t{\n\t\t\tWalletManagerCommand = new CommandDefinition(\n\t\t\t\t\"Wallet Manager\", null, ReactiveCommand.Create(OnWalletManager));\n\n\t\t\tSettingsCommand = new CommandDefinition(\"Settings\", null, ReactiveCommand.Create(() => { }));\n\t\t}\n\n\t\tprivate void OnWalletManager()\n\t\t{\n\t\t\tif (Directory.Exists(Global.WalletsDir) && Directory.EnumerateFiles(Global.WalletsDir).Any())\n\t\t\t{\n\t\t\t\t// Load\n\t\t\t\tIShell tabs = IoC.Get();\n\t\t\t\tIDocumentTabViewModel doc = tabs.Documents.FirstOrDefault(x => x is WalletManagerViewModel);\n\t\t\t\tif (doc != default)\n\t\t\t\t{\n\t\t\t\t\tvar document = doc as WalletManagerViewModel;\n\t\t\t\t\ttabs.SelectedDocument = doc;\n\t\t\t\t\tdocument.SelectedCategory = document.Categories.First(x => x is LoadWalletViewModel);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar document = new WalletManagerViewModel();\n\t\t\t\t\ttabs.AddDocument(document);\n\t\t\t\t\tdocument.SelectedCategory = document.Categories.First(x => x is LoadWalletViewModel);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Generate\n\t\t\t\tIShell tabs = IoC.Get();\n\t\t\t\tIDocumentTabViewModel doc = tabs.Documents.FirstOrDefault(x => x is WalletManagerViewModel);\n\t\t\t\tif (doc != default)\n\t\t\t\t{\n\t\t\t\t\tvar document = doc as WalletManagerViewModel;\n\t\t\t\t\ttabs.SelectedDocument = doc;\n\t\t\t\t\tdocument.SelectedCategory = document.Categories.First(x => x is GenerateWalletViewModel);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar document = new WalletManagerViewModel();\n\t\t\t\t\ttabs.AddDocument(document);\n\t\t\t\t\tdocument.SelectedCategory = document.Categories.First(x => x is GenerateWalletViewModel);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[ExportCommandDefinition(\"Tools.WalletManager\")]\n\t\tpublic CommandDefinition WalletManagerCommand { get; }\n\n\t\t[ExportCommandDefinition(\"Tools.Settings\")]\n\t\tpublic CommandDefinition SettingsCommand { get; }\n\t}\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671944,"cells":{"commit":{"kind":"string","value":"033ca07d7e8a6a5a948532cc2fe0ca6dcd6ef3a2"},"subject":{"kind":"string","value":"Add tooltips for stickers"},"repos":{"kind":"string","value":"agens-no/iMessageStickerUnity"},"old_file":{"kind":"string","value":"Assets/Stickers/Sticker.cs"},"new_file":{"kind":"string","value":"Assets/Stickers/Sticker.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing UnityEngine;\n\nnamespace Agens.Stickers\n{\n public class Sticker : ScriptableObject\n {\n [Tooltip(\"Name of the sticker\")]\n public string Name;\n [Tooltip(\"Frames per second. Apple recommends 15+ FPS\")]\n public int Fps = 15;\n [Tooltip(\"Number of repetitions (0 being infinite cycles\")]\n public int Repetitions = 0;\n public int Index;\n public bool Sequence;\n public List Frames;\n\n public void CopyFrom(Sticker sticker, int i)\n {\n name = sticker.Name;\n Name = sticker.Name;\n Fps = sticker.Fps;\n Repetitions = sticker.Repetitions;\n Index = i;\n Sequence = sticker.Sequence;\n Frames = sticker.Frames;\n }\n }\n}"},"old_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing UnityEngine;\n\nnamespace Agens.Stickers\n{\n public class Sticker : ScriptableObject\n {\n public string Name;\n public int Fps = 15;\n public int Repetitions = 0;\n public int Index;\n public bool Sequence;\n public List Frames;\n\n public void CopyFrom(Sticker sticker, int i)\n {\n name = sticker.Name;\n Name = sticker.Name;\n Fps = sticker.Fps;\n Repetitions = sticker.Repetitions;\n Index = i;\n Sequence = sticker.Sequence;\n Frames = sticker.Frames;\n }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671945,"cells":{"commit":{"kind":"string","value":"bc77a82ab31004fe8692b6b24012fc574951bcfe"},"subject":{"kind":"string","value":"Update DotNetXmlSerializer.cs"},"repos":{"kind":"string","value":"tiksn/TIKSN-Framework"},"old_file":{"kind":"string","value":"TIKSN.Core/Serialization/DotNetXmlSerializer.cs"},"new_file":{"kind":"string","value":"TIKSN.Core/Serialization/DotNetXmlSerializer.cs"},"new_contents":{"kind":"string","value":"using System.IO;\nusing System.Xml.Serialization;\n\nnamespace TIKSN.Serialization\n{\n public class DotNetXmlSerializer : SerializerBase\n {\n protected override string SerializeInternal(T obj)\n {\n var serializer = new XmlSerializer(obj.GetType());\n var writer = new StringWriter();\n serializer.Serialize(writer, obj);\n\n return writer.ToString();\n }\n }\n}"},"old_contents":{"kind":"string","value":"using System.IO;\nusing System.Xml.Serialization;\n\nnamespace TIKSN.Serialization\n{\n public class DotNetXmlSerializer : SerializerBase\n {\n protected override string SerializeInternal(object obj)\n {\n var serializer = new XmlSerializer(obj.GetType());\n var writer = new StringWriter();\n serializer.Serialize(writer, obj);\n\n return writer.ToString();\n }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671946,"cells":{"commit":{"kind":"string","value":"0adb6997713d587e35853ffafdfb4054bf56605d"},"subject":{"kind":"string","value":"Test passing for dialect supporting SupportsIfExistsBeforeTableName (Postgres)"},"repos":{"kind":"string","value":"ngbrown/nhibernate-core,livioc/nhibernate-core,nkreipke/nhibernate-core,lnu/nhibernate-core,nhibernate/nhibernate-core,alobakov/nhibernate-core,ManufacturingIntelligence/nhibernate-core,livioc/nhibernate-core,ManufacturingIntelligence/nhibernate-core,gliljas/nhibernate-core,alobakov/nhibernate-core,fredericDelaporte/nhibernate-core,nhibernate/nhibernate-core,gliljas/nhibernate-core,lnu/nhibernate-core,RogerKratz/nhibernate-core,RogerKratz/nhibernate-core,RogerKratz/nhibernate-core,nkreipke/nhibernate-core,RogerKratz/nhibernate-core,ManufacturingIntelligence/nhibernate-core,gliljas/nhibernate-core,fredericDelaporte/nhibernate-core,nhibernate/nhibernate-core,nhibernate/nhibernate-core,ngbrown/nhibernate-core,hazzik/nhibernate-core,nkreipke/nhibernate-core,gliljas/nhibernate-core,fredericDelaporte/nhibernate-core,hazzik/nhibernate-core,ngbrown/nhibernate-core,alobakov/nhibernate-core,fredericDelaporte/nhibernate-core,hazzik/nhibernate-core,livioc/nhibernate-core,hazzik/nhibernate-core,lnu/nhibernate-core"},"old_file":{"kind":"string","value":"src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs"},"new_file":{"kind":"string","value":"src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs"},"new_contents":{"kind":"string","value":"using System.Text;\r\nusing NHibernate.Cfg;\r\nusing NHibernate.Tool.hbm2ddl;\r\nusing NUnit.Framework;\r\nusing NUnit.Framework.SyntaxHelpers;\r\n\r\nnamespace NHibernate.Test.NHSpecificTest.NH1443\r\n{\r\n\t[TestFixture]\r\n\tpublic class Fixture\r\n\t{\r\n\t\tprivate static void Bug(Configuration cfg)\r\n\t\t{\r\n\t\t\tvar su = new SchemaExport(cfg);\r\n\t\t\tvar sb = new StringBuilder(500);\r\n\t\t\tsu.Execute(x => sb.AppendLine(x), false, false, true);\r\n\t\t\tstring script = sb.ToString();\r\n\r\n\r\n\t\t\tif (Dialect.Dialect.GetDialect(cfg.Properties).SupportsIfExistsBeforeTableName)\r\n\t\t\t\tAssert.That(script, Text.Contains(\"drop table if exists nhibernate.dbo.Aclass\"));\r\n\t\t\telse\r\n\t\t\t\tAssert.That(script, Text.Contains(\"drop table nhibernate.dbo.Aclass\"));\r\n\r\n\t\t\tAssert.That(script, Text.Contains(\"create table nhibernate.dbo.Aclass\"));\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t[Test]\r\n\t\tpublic void WithDefaultValuesInConfiguration()\r\n\t\t{\r\n\t\t\tConfiguration cfg = TestConfigurationHelper.GetDefaultConfiguration();\r\n\t\t\tcfg.AddResource(\"NHibernate.Test.NHSpecificTest.NH1443.AclassWithNothing.hbm.xml\", GetType().Assembly);\r\n\t\t\tcfg.SetProperty(Environment.DefaultCatalog, \"nhibernate\");\r\n\t\t\tcfg.SetProperty(Environment.DefaultSchema, \"dbo\");\r\n\t\t\tBug(cfg);\r\n\t\t}\r\n\r\n\t\t[Test]\r\n\t\tpublic void WithDefaultValuesInMapping()\r\n\t\t{\r\n\t\t\tConfiguration cfg = TestConfigurationHelper.GetDefaultConfiguration();\r\n\t\t\tcfg.AddResource(\"NHibernate.Test.NHSpecificTest.NH1443.AclassWithDefault.hbm.xml\", GetType().Assembly);\r\n\t\t\tBug(cfg);\r\n\t\t}\r\n\r\n\t\t[Test]\r\n\t\tpublic void WithSpecificValuesInMapping()\r\n\t\t{\r\n\t\t\tConfiguration cfg = TestConfigurationHelper.GetDefaultConfiguration();\r\n\t\t\tcfg.AddResource(\"NHibernate.Test.NHSpecificTest.NH1443.AclassWithSpecific.hbm.xml\", GetType().Assembly);\r\n\t\t\tBug(cfg);\r\n\t\t}\r\n\r\n\t\t[Test]\r\n\t\tpublic void WithDefaultValuesInConfigurationPriorityToMapping()\r\n\t\t{\r\n\t\t\tConfiguration cfg = TestConfigurationHelper.GetDefaultConfiguration();\r\n\t\t\tcfg.AddResource(\"NHibernate.Test.NHSpecificTest.NH1443.AclassWithDefault.hbm.xml\", GetType().Assembly);\r\n\t\t\tcfg.SetProperty(Environment.DefaultCatalog, \"somethingDifferent\");\r\n\t\t\tcfg.SetProperty(Environment.DefaultSchema, \"somethingDifferent\");\r\n\t\t\tBug(cfg);\r\n\t\t}\r\n\t}\r\n\r\n\tpublic class Aclass\r\n\t{\r\n\t\tpublic int Id { get; set; }\r\n\t}\r\n}"},"old_contents":{"kind":"string","value":"using System.Text;\r\nusing NHibernate.Cfg;\r\nusing NHibernate.Tool.hbm2ddl;\r\nusing NUnit.Framework;\r\nusing NUnit.Framework.SyntaxHelpers;\r\n\r\nnamespace NHibernate.Test.NHSpecificTest.NH1443\r\n{\r\n\t[TestFixture]\r\n\tpublic class Fixture\r\n\t{\r\n\t\tprivate static void Bug(Configuration cfg)\r\n\t\t{\r\n\t\t\tvar su = new SchemaExport(cfg);\r\n\t\t\tvar sb = new StringBuilder(500);\r\n\t\t\tsu.Execute(x => sb.AppendLine(x), false, false, true);\r\n\t\t\tstring script = sb.ToString();\r\n\t\t\tAssert.That(script, Text.Contains(\"drop table nhibernate.dbo.Aclass\"));\r\n\t\t\tAssert.That(script, Text.Contains(\"create table nhibernate.dbo.Aclass\"));\r\n\t\t}\r\n\r\n\t\t[Test]\r\n\t\tpublic void WithDefaultValuesInConfiguration()\r\n\t\t{\r\n\t\t\tConfiguration cfg = TestConfigurationHelper.GetDefaultConfiguration();\r\n\t\t\tcfg.AddResource(\"NHibernate.Test.NHSpecificTest.NH1443.AclassWithNothing.hbm.xml\", GetType().Assembly);\r\n\t\t\tcfg.SetProperty(Environment.DefaultCatalog, \"nhibernate\");\r\n\t\t\tcfg.SetProperty(Environment.DefaultSchema, \"dbo\");\r\n\t\t\tBug(cfg);\r\n\t\t}\r\n\r\n\t\t[Test]\r\n\t\tpublic void WithDefaultValuesInMapping()\r\n\t\t{\r\n\t\t\tConfiguration cfg = TestConfigurationHelper.GetDefaultConfiguration();\r\n\t\t\tcfg.AddResource(\"NHibernate.Test.NHSpecificTest.NH1443.AclassWithDefault.hbm.xml\", GetType().Assembly);\r\n\t\t\tBug(cfg);\r\n\t\t}\r\n\r\n\t\t[Test]\r\n\t\tpublic void WithSpecificValuesInMapping()\r\n\t\t{\r\n\t\t\tConfiguration cfg = TestConfigurationHelper.GetDefaultConfiguration();\r\n\t\t\tcfg.AddResource(\"NHibernate.Test.NHSpecificTest.NH1443.AclassWithSpecific.hbm.xml\", GetType().Assembly);\r\n\t\t\tBug(cfg);\r\n\t\t}\r\n\r\n\t\t[Test]\r\n\t\tpublic void WithDefaultValuesInConfigurationPriorityToMapping()\r\n\t\t{\r\n\t\t\tConfiguration cfg = TestConfigurationHelper.GetDefaultConfiguration();\r\n\t\t\tcfg.AddResource(\"NHibernate.Test.NHSpecificTest.NH1443.AclassWithDefault.hbm.xml\", GetType().Assembly);\r\n\t\t\tcfg.SetProperty(Environment.DefaultCatalog, \"somethingDifferent\");\r\n\t\t\tcfg.SetProperty(Environment.DefaultSchema, \"somethingDifferent\");\r\n\t\t\tBug(cfg);\r\n\t\t}\r\n\t}\r\n\r\n\tpublic class Aclass\r\n\t{\r\n\t\tpublic int Id { get; set; }\r\n\t}\r\n}"},"license":{"kind":"string","value":"lgpl-2.1"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671947,"cells":{"commit":{"kind":"string","value":"b9b37dc8cde3a8d28070f3f42a0c2eb51f64a01e"},"subject":{"kind":"string","value":"Refactor code"},"repos":{"kind":"string","value":"Sitecore/Sitecore-Instance-Manager,sergeyshushlyapin/Sitecore-Instance-Manager,dsolovay/Sitecore-Instance-Manager,Brad-Christie/Sitecore-Instance-Manager"},"old_file":{"kind":"string","value":"src/SIM.Core/Common/AbstractInstanceActionCommand.cs"},"new_file":{"kind":"string","value":"src/SIM.Core/Common/AbstractInstanceActionCommand.cs"},"new_contents":{"kind":"string","value":"namespace SIM.Core.Common\n{\n using System;\n using System.Linq;\n using Instances;\n using Sitecore.Diagnostics.Base;\n using Sitecore.Diagnostics.Base.Annotations;\n\n public abstract class AbstractInstanceActionCommand : AbstractCommand\n {\n [CanBeNull]\n public virtual string Name { get; [UsedImplicitly] set; }\n\n protected sealed override void DoExecute(CommandResult result)\n {\n var instance = AbstractInstanceActionCommand.GetInstance(Name);\n \n this.DoExecute(instance, result);\n }\n\n protected abstract void DoExecute(Instance instance, CommandResult result);\n }\n\n public abstract class AbstractInstanceActionCommand : AbstractCommand\n {\n [CanBeNull]\n public virtual string Name { get; [UsedImplicitly] set; }\n\n protected sealed override void DoExecute(CommandResult result)\n {\n var name = Name;\n var instance = GetInstance(name);\n\n this.DoExecute(instance, result);\n }\n\n internal static Instance GetInstance(string name)\n {\n InstanceManager.Initialize();\n Assert.ArgumentNotNullOrEmpty(name, nameof(name));\n\n var instance = InstanceManager.Instances.FirstOrDefault(x => x.Name.Equals(name, StringComparison.OrdinalIgnoreCase));\n Ensure.IsNotNull(instance, \"instance is not found\");\n\n return instance;\n }\n\n protected abstract void DoExecute(Instance instance, CommandResult result);\n }\n}"},"old_contents":{"kind":"string","value":"namespace SIM.Core.Common\n{\n using System;\n using System.Linq;\n using Instances;\n using Sitecore.Diagnostics.Base;\n using Sitecore.Diagnostics.Base.Annotations;\n\n public abstract class AbstractInstanceActionCommand : AbstractCommand\n {\n [CanBeNull]\n public virtual string Name { get; [UsedImplicitly] set; }\n\n protected sealed override void DoExecute(CommandResult result)\n {\n InstanceManager.Initialize();\n var name = Name;\n Assert.ArgumentNotNullOrEmpty(name, nameof(name));\n\n var instance = InstanceManager.Instances.FirstOrDefault(x => x.Name.Equals(name, StringComparison.OrdinalIgnoreCase));\n Ensure.IsNotNull(instance, \"instance is not found\");\n \n this.DoExecute(instance, result);\n }\n\n protected abstract void DoExecute(Instance instance, CommandResult result);\n }\n\n public abstract class AbstractInstanceActionCommand : AbstractCommand\n {\n [CanBeNull]\n public virtual string Name { get; [UsedImplicitly] set; }\n\n protected sealed override void DoExecute(CommandResult result)\n {\n InstanceManager.Initialize();\n var name = Name;\n Assert.ArgumentNotNullOrEmpty(name, nameof(name));\n\n var instance = InstanceManager.Instances.FirstOrDefault(x => x.Name.Equals(name, StringComparison.OrdinalIgnoreCase));\n Ensure.IsNotNull(instance, \"instance is not found\");\n\n this.DoExecute(instance, result);\n }\n\n protected abstract void DoExecute(Instance instance, CommandResult result);\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671948,"cells":{"commit":{"kind":"string","value":"883dee3a84f3a72d9576e4489902849abe4df2ee"},"subject":{"kind":"string","value":"Fix having the wrong Index name in migration CuratedFeedPackageUniqueness.Down()"},"repos":{"kind":"string","value":"KuduApps/NuGetGallery,KuduApps/NuGetGallery,grenade/NuGetGallery_download-count-patch,ScottShingler/NuGetGallery,mtian/SiteExtensionGallery,JetBrains/ReSharperGallery,projectkudu/SiteExtensionGallery,grenade/NuGetGallery_download-count-patch,JetBrains/ReSharperGallery,skbkontur/NuGetGallery,ScottShingler/NuGetGallery,KuduApps/NuGetGallery,mtian/SiteExtensionGallery,projectkudu/SiteExtensionGallery,skbkontur/NuGetGallery,mtian/SiteExtensionGallery,grenade/NuGetGallery_download-count-patch,KuduApps/NuGetGallery,skbkontur/NuGetGallery,JetBrains/ReSharperGallery,KuduApps/NuGetGallery,projectkudu/SiteExtensionGallery,ScottShingler/NuGetGallery"},"old_file":{"kind":"string","value":"Website/Migrations/201304030226233_CuratedFeedPackageUniqueness.cs"},"new_file":{"kind":"string","value":"Website/Migrations/201304030226233_CuratedFeedPackageUniqueness.cs"},"new_contents":{"kind":"string","value":"namespace NuGetGallery.Migrations\n{\n using System.Data.Entity.Migrations;\n \n public partial class CuratedFeedPackageUniqueness : DbMigration\n {\n public override void Up()\n {\n // ADD uniqueness constraint - as an Index, since it seems reasonable to look up curated package entries by their feed + registration\n CreateIndex(\"CuratedPackages\", new[] { \"CuratedFeedKey\", \"PackageRegistrationKey\" }, unique: true, name: \"IX_CuratedFeed_PackageRegistration\");\n }\n\n public override void Down()\n {\n // REMOVE uniqueness constraint\n DropIndex(\"CuratedPackages\", \"IX_CuratedFeed_PackageRegistration\");\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"namespace NuGetGallery.Migrations\n{\n using System.Data.Entity.Migrations;\n \n public partial class CuratedFeedPackageUniqueness : DbMigration\n {\n public override void Up()\n {\n // ADD uniqueness constraint - as an Index, since it seems reasonable to look up curated package entries by their feed + registration\n CreateIndex(\"CuratedPackages\", new[] { \"CuratedFeedKey\", \"PackageRegistrationKey\" }, unique: true, name: \"IX_CuratedFeed_PackageRegistration\");\n }\n\n public override void Down()\n {\n // REMOVE uniqueness constraint\n DropIndex(\"CuratedPackages\", \"IX_CuratedPackage_CuratedFeedAndPackageRegistration\");\n }\n }\n}\n"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671949,"cells":{"commit":{"kind":"string","value":"236e55a107ad752b837841d7696ace5ff479a2dd"},"subject":{"kind":"string","value":"Add an implementation IEqualityComparer to ensure the .Distinct call in the Locate() method works as expected."},"repos":{"kind":"string","value":"SRoddis/Mongo.Migration"},"old_file":{"kind":"string","value":"Mongo.Migration/Migrations/Locators/TypeMigrationDependencyLocator.cs"},"new_file":{"kind":"string","value":"Mongo.Migration/Migrations/Locators/TypeMigrationDependencyLocator.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing Mongo.Migration.Extensions;\nusing Mongo.Migration.Migrations.Adapters;\n\nnamespace Mongo.Migration.Migrations.Locators\n{\n internal class TypeMigrationDependencyLocator : MigrationLocator\n where TMigrationType: class, IMigration\n {\n private class TypeComparer : IEqualityComparer\n {\n public bool Equals(Type x, Type y)\n {\n return x.AssemblyQualifiedName == y.AssemblyQualifiedName;\n }\n\n public int GetHashCode(Type obj)\n {\n return obj.AssemblyQualifiedName.GetHashCode();\n }\n }\n\n private readonly IContainerProvider _containerProvider;\n\n public TypeMigrationDependencyLocator(IContainerProvider containerProvider)\n {\n _containerProvider = containerProvider;\n }\n \n public override void Locate()\n {\n var migrationTypes =\n (from assembly in Assemblies\n from type in assembly.GetTypes()\n where typeof(TMigrationType).IsAssignableFrom(type) && !type.IsAbstract\n select type).Distinct(new TypeComparer());\n\n Migrations = migrationTypes.Select(GetMigrationInstance).ToMigrationDictionary();\n }\n\n private TMigrationType GetMigrationInstance(Type type)\n {\n ConstructorInfo constructor = type.GetConstructors()[0];\n\n if(constructor != null)\n {\n object[] args = constructor\n .GetParameters()\n .Select(o => o.ParameterType)\n .Select(o => _containerProvider.GetInstance(o))\n .ToArray();\n\n return Activator.CreateInstance(type, args) as TMigrationType;\n }\n\n return Activator.CreateInstance(type) as TMigrationType;\n }\n }\n}"},"old_contents":{"kind":"string","value":"using System;\nusing System.Linq;\nusing System.Reflection;\nusing Mongo.Migration.Extensions;\nusing Mongo.Migration.Migrations.Adapters;\n\nnamespace Mongo.Migration.Migrations.Locators\n{\n internal class TypeMigrationDependencyLocator : MigrationLocator\n where TMigrationType: class, IMigration\n {\n private readonly IContainerProvider _containerProvider;\n\n public TypeMigrationDependencyLocator(IContainerProvider containerProvider)\n {\n _containerProvider = containerProvider;\n }\n \n public override void Locate()\n {\n var migrationTypes =\n (from assembly in Assemblies\n from type in assembly.GetTypes()\n where typeof(TMigrationType).IsAssignableFrom(type) && !type.IsAbstract\n select type).Distinct();\n\n Migrations = migrationTypes.Select(GetMigrationInstance).ToMigrationDictionary();\n }\n\n private TMigrationType GetMigrationInstance(Type type)\n {\n ConstructorInfo constructor = type.GetConstructors()[0];\n\n if(constructor != null)\n {\n object[] args = constructor\n .GetParameters()\n .Select(o => o.ParameterType)\n .Select(o => _containerProvider.GetInstance(o))\n .ToArray();\n\n return Activator.CreateInstance(type, args) as TMigrationType;\n }\n\n return Activator.CreateInstance(type) as TMigrationType;\n }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671950,"cells":{"commit":{"kind":"string","value":"1fca171d58298a2ff65b9b0c95729cb49c35ceb6"},"subject":{"kind":"string","value":"Add default and rename variable"},"repos":{"kind":"string","value":"BenPhegan/NuGet.Extensions"},"old_file":{"kind":"string","value":"NuGet.Extensions.Tests/ReferenceAnalysers/ProjectReferenceTestData.cs"},"new_file":{"kind":"string","value":"NuGet.Extensions.Tests/ReferenceAnalysers/ProjectReferenceTestData.cs"},"new_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing Moq;\nusing NuGet.Extensions.MSBuild;\nusing NuGet.Extensions.Tests.Mocks;\n\nnamespace NuGet.Extensions.Tests.ReferenceAnalysers\n{\n public class ProjectReferenceTestData {\n private const string AssemblyInPackageRepository = \"Assembly11.dll\";\n public const string PackageInRepository = \"Test1\";\n\n public static Mock ConstructMockProject(IBinaryReference[] binaryReferences = null)\n {\n var project = new Mock();\n project.Setup(proj => proj.GetBinaryReferences()).Returns(binaryReferences ?? new IBinaryReference[0]);\n return project;\n }\n\n public static Mock ConstructMockDependency(string includeName = null, string includeVersion = null)\n {\n includeName = includeName ?? AssemblyInPackageRepository;\n\n var dependency = new Mock();\n dependency.SetupGet(d => d.IncludeName).Returns(includeName);\n dependency.SetupGet(d => d.IncludeVersion).Returns(includeVersion ?? \"0.0.0.0\");\n dependency.Setup(d => d.IsForAssembly(It.IsAny())).Returns(true);\n\n string anydependencyHintpath = includeName;\n dependency.Setup(d => d.TryGetHintPath(out anydependencyHintpath)).Returns(true);\n\n return dependency;\n }\n\n public static MockPackageRepository CreateMockRepository()\n {\n var mockRepo = new MockPackageRepository();\n mockRepo.AddPackage(PackageUtility.CreatePackage(PackageInRepository, isLatest: true, assemblyReferences: new List { AssemblyInPackageRepository, \"Assembly12.dll\" }, dependencies: new List()));\n mockRepo.AddPackage(PackageUtility.CreatePackage(\"Test2\", isLatest: true, assemblyReferences: new List { \"Assembly21.dll\", \"Assembly22.dll\" }, dependencies: new List { new PackageDependency(PackageInRepository) }));\n return mockRepo;\n }\n }\n}"},"old_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing Moq;\nusing NuGet.Extensions.MSBuild;\nusing NuGet.Extensions.Tests.Mocks;\n\nnamespace NuGet.Extensions.Tests.ReferenceAnalysers\n{\n public class ProjectReferenceTestData {\n private const string AssemblyInPackageRepository = \"Assembly11.dll\";\n public const string PackageInRepository = \"Test1\";\n\n public static Mock ConstructMockProject(IBinaryReference[] binaryReferences)\n {\n var projectWithSingleDependency = new Mock();\n projectWithSingleDependency.Setup(proj => proj.GetBinaryReferences()).Returns(binaryReferences);\n return projectWithSingleDependency;\n }\n\n public static Mock ConstructMockDependency(string includeName = null, string includeVersion = null)\n {\n includeName = includeName ?? AssemblyInPackageRepository;\n\n var dependency = new Mock();\n dependency.SetupGet(d => d.IncludeName).Returns(includeName);\n dependency.SetupGet(d => d.IncludeVersion).Returns(includeVersion ?? \"0.0.0.0\");\n dependency.Setup(d => d.IsForAssembly(It.IsAny())).Returns(true);\n\n string anydependencyHintpath = includeName;\n dependency.Setup(d => d.TryGetHintPath(out anydependencyHintpath)).Returns(true);\n\n return dependency;\n }\n\n public static MockPackageRepository CreateMockRepository()\n {\n var mockRepo = new MockPackageRepository();\n mockRepo.AddPackage(PackageUtility.CreatePackage(PackageInRepository, isLatest: true, assemblyReferences: new List { AssemblyInPackageRepository, \"Assembly12.dll\" }, dependencies: new List()));\n mockRepo.AddPackage(PackageUtility.CreatePackage(\"Test2\", isLatest: true, assemblyReferences: new List { \"Assembly21.dll\", \"Assembly22.dll\" }, dependencies: new List { new PackageDependency(PackageInRepository) }));\n return mockRepo;\n }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671951,"cells":{"commit":{"kind":"string","value":"052ae794746a6a23fd02c414f5f9bf8c4e5a9b6b"},"subject":{"kind":"string","value":"Update RegularTestFixture.cs"},"repos":{"kind":"string","value":"MelleKoning/OpenCover.UI,OpenCoverUI/OpenCover.UI"},"old_file":{"kind":"string","value":"OpenCover.UI.TestDiscoverer.TestResources/Xunit/RegularTestFixture.cs"},"new_file":{"kind":"string","value":"OpenCover.UI.TestDiscoverer.TestResources/Xunit/RegularTestFixture.cs"},"new_contents":{"kind":"string","value":"using Xunit;\n\nnamespace OpenCover.UI.TestDiscoverer.TestResources.Xunit\n{ \n\tpublic class RegularFacts\n\t{\n\t\t[Fact]\n\t\tpublic void RegularTestMethod()\n\t\t{\n\t\t}\n\n public class SubTestClass\n {\n [Fact]\n public void RegularSubTestClassMethod()\n {\n }\n\n public class Sub2NdTestClass\n {\n [Fact]\n public void RegularSub2NdTestClassMethod()\n {\n }\n }\n\n\n }\n\n }\n}\n"},"old_contents":{"kind":"string","value":"using Xunit;\n\nnamespace OpenCover.UI.TestDiscoverer.TestResources.Xunit\n{ \n\tpublic class RegularFacts\n\t{\n\t\t[Fact]\n\t\tpublic void RegularTestMethod()\n\t\t{\n\t\t}\n\t}\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671952,"cells":{"commit":{"kind":"string","value":"58e535ead38d00cf32154b020d3da4572d856e12"},"subject":{"kind":"string","value":"Fix bug where prop was not serialized"},"repos":{"kind":"string","value":"openstardrive/server,openstardrive/server,openstardrive/server"},"old_file":{"kind":"string","value":"OpenStardriveServer/Domain/Systems/Propulsion/Engines/EnginesState.cs"},"new_file":{"kind":"string","value":"OpenStardriveServer/Domain/Systems/Propulsion/Engines/EnginesState.cs"},"new_contents":{"kind":"string","value":"using System;\nusing OpenStardriveServer.Domain.Systems.Standard;\n\nnamespace OpenStardriveServer.Domain.Systems.Propulsion.Engines;\n\npublic record EnginesState : StandardSystemBaseState\n{\n public int CurrentSpeed { get; init; }\n public EngineSpeedConfig SpeedConfig { get; init; }\n public int CurrentHeat { get; init; }\n public EngineHeatConfig HeatConfig { get; init; }\n public SpeedPowerRequirement[] SpeedPowerRequirements { get; init; } = Array.Empty();\n}\n\npublic record EngineSpeedConfig\n{\n public int MaxSpeed { get; init; }\n public int CruisingSpeed { get; init; }\n}\n\npublic record EngineHeatConfig\n{\n public int PoweredHeat { get; init; }\n public int CruisingHeat { get; init; }\n public int MaxHeat { get; init; }\n public int MinutesAtMaxSpeed { get; init; }\n public int MinutesToCoolDown { get; init; }\n}\n\npublic record SpeedPowerRequirement\n{\n public int Speed { get; init; }\n public int PowerNeeded { get; init; }\n}"},"old_contents":{"kind":"string","value":"using System;\nusing OpenStardriveServer.Domain.Systems.Standard;\n\nnamespace OpenStardriveServer.Domain.Systems.Propulsion.Engines;\n\npublic record EnginesState : StandardSystemBaseState\n{\n public int CurrentSpeed { get; init; }\n public EngineSpeedConfig SpeedConfig { get; init; }\n public int CurrentHeat { get; init; }\n public EngineHeatConfig HeatConfig { get; init; }\n public SpeedPowerRequirement[] SpeedPowerRequirements = Array.Empty();\n}\n\npublic record EngineSpeedConfig\n{\n public int MaxSpeed { get; init; }\n public int CruisingSpeed { get; init; }\n}\n\npublic record EngineHeatConfig\n{\n public int PoweredHeat { get; init; }\n public int CruisingHeat { get; init; }\n public int MaxHeat { get; init; }\n public int MinutesAtMaxSpeed { get; init; }\n public int MinutesToCoolDown { get; init; }\n}\n\npublic record SpeedPowerRequirement\n{\n public int Speed { get; init; }\n public int PowerNeeded { get; init; }\n}"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671953,"cells":{"commit":{"kind":"string","value":"78d624e22453dc635426345900f2d81f528469a0"},"subject":{"kind":"string","value":"Fix a comment (#129)"},"repos":{"kind":"string","value":"ForNeVeR/wpf-math"},"old_file":{"kind":"string","value":"src/WpfMath/CharSymbol.cs"},"new_file":{"kind":"string","value":"src/WpfMath/CharSymbol.cs"},"new_contents":{"kind":"string","value":"using WpfMath.Utils;\r\n\r\nnamespace WpfMath\r\n{\r\n // Atom representing single character that can be marked as text symbol.\r\n internal abstract class CharSymbol : Atom\r\n {\r\n protected CharSymbol(SourceSpan source, TexAtomType type = TexAtomType.Ordinary)\r\n : base(source, type)\r\n {\r\n this.IsTextSymbol = false;\r\n }\r\n\r\n public bool IsTextSymbol { get; }\r\n\r\n /// Returns the preferred font to render this character.\r\n public virtual ITeXFont GetStyledFont(TexEnvironment environment) => environment.MathFont;\r\n\r\n /// Returns a for this character.\r\n protected abstract Result GetCharInfo(ITeXFont font, TexStyle style);\r\n\r\n protected sealed override Box CreateBoxCore(TexEnvironment environment)\r\n {\r\n var font = this.GetStyledFont(environment);\r\n var charInfo = this.GetCharInfo(font, environment.Style);\r\n return new CharBox(environment, charInfo.Value);\r\n }\r\n\r\n /// Checks if the symbol can be rendered by font.\r\n public bool IsSupportedByFont(ITeXFont font, TexStyle style) =>\r\n this.GetCharInfo(font, style).IsSuccess;\r\n\r\n /// Returns the symbol rendered by font.\r\n public abstract Result GetCharFont(ITeXFont texFont);\r\n }\r\n}\r\n"},"old_contents":{"kind":"string","value":"using WpfMath.Utils;\r\n\r\nnamespace WpfMath\r\n{\r\n // Atom representing single character that can be marked as text symbol.\r\n internal abstract class CharSymbol : Atom\r\n {\r\n protected CharSymbol(SourceSpan source, TexAtomType type = TexAtomType.Ordinary)\r\n : base(source, type)\r\n {\r\n this.IsTextSymbol = false;\r\n }\r\n\r\n public bool IsTextSymbol { get; }\r\n\r\n /// Returns the preferred font to render this character.\r\n public virtual ITeXFont GetStyledFont(TexEnvironment environment) => environment.MathFont;\r\n\r\n /// Returns a for this character.\r\n protected abstract Result GetCharInfo(ITeXFont font, TexStyle style);\r\n\r\n protected sealed override Box CreateBoxCore(TexEnvironment environment)\r\n {\r\n var font = this.GetStyledFont(environment);\r\n var charInfo = this.GetCharInfo(font, environment.Style);\r\n return new CharBox(environment, charInfo.Value);\r\n }\r\n\r\n /// Checks if the symbol can be rendered by font.\r\n public bool IsSupportedByFont(ITeXFont font, TexStyle style) =>\r\n this.GetCharInfo(font, style).IsSuccess;\r\n\r\n /// \r\n /// Returns the symbol rendered by font. Throws an exception if the symbol is not supported by font. Always\r\n /// succeed if .\r\n /// \r\n public abstract Result GetCharFont(ITeXFont texFont);\r\n }\r\n}\r\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671954,"cells":{"commit":{"kind":"string","value":"4ed30b3619954cb7f4ce2e334a6db99ee67a5818"},"subject":{"kind":"string","value":"Add WindowsUtils.CreateSingleTickTimer"},"repos":{"kind":"string","value":"chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck"},"old_file":{"kind":"string","value":"Core/Utils/WindowsUtils.cs"},"new_file":{"kind":"string","value":"Core/Utils/WindowsUtils.cs"},"new_contents":{"kind":"string","value":"using System.Diagnostics;\nusing System.IO;\nusing System.Windows.Forms;\n\nnamespace TweetDck.Core.Utils{\n static class WindowsUtils{\n public static bool CheckFolderWritePermission(string path){\n string testFile = Path.Combine(path, \".test\");\n\n try{\n Directory.CreateDirectory(path);\n\n using(File.Create(testFile)){}\n File.Delete(testFile);\n return true;\n }catch{\n return false;\n }\n }\n\n public static Process StartProcess(string file, string arguments, bool runElevated){\n ProcessStartInfo processInfo = new ProcessStartInfo{\n FileName = file,\n Arguments = arguments\n };\n\n if (runElevated){\n processInfo.Verb = \"runas\";\n }\n\n return Process.Start(processInfo);\n }\n\n public static Timer CreateSingleTickTimer(int timeout){\n Timer timer = new Timer{\n Interval = timeout\n };\n\n timer.Tick += (sender, args) => timer.Stop();\n return timer;\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System.Diagnostics;\nusing System.IO;\n\nnamespace TweetDck.Core.Utils{\n static class WindowsUtils{\n public static bool CheckFolderWritePermission(string path){\n string testFile = Path.Combine(path, \".test\");\n\n try{\n Directory.CreateDirectory(path);\n\n using(File.Create(testFile)){}\n File.Delete(testFile);\n return true;\n }catch{\n return false;\n }\n }\n\n public static Process StartProcess(string file, string arguments, bool runElevated){\n ProcessStartInfo processInfo = new ProcessStartInfo{\n FileName = file,\n Arguments = arguments\n };\n\n if (runElevated){\n processInfo.Verb = \"runas\";\n }\n\n return Process.Start(processInfo);\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671955,"cells":{"commit":{"kind":"string","value":"b197e6d4fc108e4e31dfe2de6a950ee485bd2879"},"subject":{"kind":"string","value":"Update TestSerilogLoggingSetup.cs"},"repos":{"kind":"string","value":"tiksn/TIKSN-Framework"},"old_file":{"kind":"string","value":"TIKSN.UnitTests.Shared/DependencyInjection/TestSerilogLoggingSetup.cs"},"new_file":{"kind":"string","value":"TIKSN.UnitTests.Shared/DependencyInjection/TestSerilogLoggingSetup.cs"},"new_contents":{"kind":"string","value":"using Serilog;\nusing TIKSN.Analytics.Logging.Serilog;\nusing Xunit.Abstractions;\n\nnamespace TIKSN.DependencyInjection.Tests\n{\n public class TestSerilogLoggingSetup : SerilogLoggingSetupBase\n {\n private readonly ITestOutputHelper _testOutputHelper;\n\n public TestSerilogLoggingSetup(ITestOutputHelper testOutputHelper) : base()\n {\n _testOutputHelper = testOutputHelper;\n }\n\n protected override void SetupSerilog()\n {\n base.SetupSerilog();\n\n _loggerConfiguration.WriteTo.TestOutput(_testOutputHelper);\n }\n }\n}"},"old_contents":{"kind":"string","value":"using Microsoft.Extensions.Logging;\nusing Serilog;\nusing TIKSN.Analytics.Logging.Serilog;\nusing Xunit.Abstractions;\n\nnamespace TIKSN.DependencyInjection.Tests\n{\n public class TestSerilogLoggingSetup : SerilogLoggingSetupBase\n {\n private readonly ITestOutputHelper _testOutputHelper;\n\n public TestSerilogLoggingSetup(ITestOutputHelper testOutputHelper, ILoggerFactory loggerFactory) : base(loggerFactory)\n {\n _testOutputHelper = testOutputHelper;\n }\n\n protected override void SetupSerilog()\n {\n base.SetupSerilog();\n\n _loggerConfiguration.WriteTo.TestOutput(_testOutputHelper);\n }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671956,"cells":{"commit":{"kind":"string","value":"30600e6c3be70b0f7834796828d0109ffcf72ae5"},"subject":{"kind":"string","value":"Remove unused using."},"repos":{"kind":"string","value":"FacilityApi/Facility"},"old_file":{"kind":"string","value":"src/Facility.CodeGen.Console/CommonArgs.cs"},"new_file":{"kind":"string","value":"src/Facility.CodeGen.Console/CommonArgs.cs"},"new_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing System.Globalization;\nusing ArgsReading;\n\nnamespace Facility.CodeGen.Console\n{\n\tinternal static class CommonArgs\n\t{\n\t\tpublic static bool ReadCleanFlag(this ArgsReader args) => args.ReadFlag(\"clean\");\n\n\t\tpublic static bool ReadDryRunFlag(this ArgsReader args) => args.ReadFlag(\"dryrun\");\n\n\t\tpublic static bool ReadHelpFlag(this ArgsReader args) => args.ReadFlag(\"help|h|?\");\n\n\t\tpublic static bool ReadQuietFlag(this ArgsReader args) => args.ReadFlag(\"quiet\");\n\n\t\tpublic static bool ReadVerifyFlag(this ArgsReader args) => args.ReadFlag(\"verify\");\n\n\t\tpublic static string ReadIndentOption(this ArgsReader args)\n\t\t{\n\t\t\tstring value = args.ReadOption(\"indent\");\n\t\t\tif (value == null)\n\t\t\t\treturn null;\n\n\t\t\tif (value == \"tab\")\n\t\t\t\treturn \"\\t\";\n\n\t\t\tif (int.TryParse(value, NumberStyles.None, CultureInfo.InvariantCulture, out int spaceCount) && spaceCount >= 1 && spaceCount <= 8)\n\t\t\t\treturn new string(' ', spaceCount);\n\n\t\t\tthrow new ArgsReaderException($\"Invalid indent '{value}'. (Should be 'tab' or the number of spaces.)\");\n\t\t}\n\n\t\tpublic static string ReadNewLineOption(this ArgsReader args)\n\t\t{\n\t\t\tstring value = args.ReadOption(\"newline\");\n\t\t\tif (value == null)\n\t\t\t\treturn null;\n\n\t\t\tswitch (value)\n\t\t\t{\n\t\t\tcase \"auto\":\n\t\t\t\treturn null;\n\t\t\tcase \"lf\":\n\t\t\t\treturn \"\\n\";\n\t\t\tcase \"crlf\":\n\t\t\t\treturn \"\\r\\n\";\n\t\t\tdefault:\n\t\t\t\tthrow new ArgsReaderException($\"Invalid new line '{value}'. (Should be 'auto', 'lf', or 'crlf'.)\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static IReadOnlyList ReadExcludeTagOptions(this ArgsReader args)\n\t\t{\n\t\t\tvar values = new List();\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tstring value = args.ReadOption(\"excludeTag\");\n\t\t\t\tif (value == null)\n\t\t\t\t\tbreak;\n\t\t\t\tvalues.Add(value);\n\t\t\t}\n\n\t\t\treturn values;\n\t\t}\n\t}\n}\n"},"old_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing System.Globalization;\nusing ArgsReading;\nusing Facility.Definition;\n\nnamespace Facility.CodeGen.Console\n{\n\tinternal static class CommonArgs\n\t{\n\t\tpublic static bool ReadCleanFlag(this ArgsReader args) => args.ReadFlag(\"clean\");\n\n\t\tpublic static bool ReadDryRunFlag(this ArgsReader args) => args.ReadFlag(\"dryrun\");\n\n\t\tpublic static bool ReadHelpFlag(this ArgsReader args) => args.ReadFlag(\"help|h|?\");\n\n\t\tpublic static bool ReadQuietFlag(this ArgsReader args) => args.ReadFlag(\"quiet\");\n\n\t\tpublic static bool ReadVerifyFlag(this ArgsReader args) => args.ReadFlag(\"verify\");\n\n\t\tpublic static string ReadIndentOption(this ArgsReader args)\n\t\t{\n\t\t\tstring value = args.ReadOption(\"indent\");\n\t\t\tif (value == null)\n\t\t\t\treturn null;\n\n\t\t\tif (value == \"tab\")\n\t\t\t\treturn \"\\t\";\n\n\t\t\tif (int.TryParse(value, NumberStyles.None, CultureInfo.InvariantCulture, out int spaceCount) && spaceCount >= 1 && spaceCount <= 8)\n\t\t\t\treturn new string(' ', spaceCount);\n\n\t\t\tthrow new ArgsReaderException($\"Invalid indent '{value}'. (Should be 'tab' or the number of spaces.)\");\n\t\t}\n\n\t\tpublic static string ReadNewLineOption(this ArgsReader args)\n\t\t{\n\t\t\tstring value = args.ReadOption(\"newline\");\n\t\t\tif (value == null)\n\t\t\t\treturn null;\n\n\t\t\tswitch (value)\n\t\t\t{\n\t\t\tcase \"auto\":\n\t\t\t\treturn null;\n\t\t\tcase \"lf\":\n\t\t\t\treturn \"\\n\";\n\t\t\tcase \"crlf\":\n\t\t\t\treturn \"\\r\\n\";\n\t\t\tdefault:\n\t\t\t\tthrow new ArgsReaderException($\"Invalid new line '{value}'. (Should be 'auto', 'lf', or 'crlf'.)\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static IReadOnlyList ReadExcludeTagOptions(this ArgsReader args)\n\t\t{\n\t\t\tvar values = new List();\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tstring value = args.ReadOption(\"excludeTag\");\n\t\t\t\tif (value == null)\n\t\t\t\t\tbreak;\n\t\t\t\tvalues.Add(value);\n\t\t\t}\n\n\t\t\treturn values;\n\t\t}\n\t}\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671957,"cells":{"commit":{"kind":"string","value":"218a35eb76ebeba3db01b39006d031ef6f1f05d6"},"subject":{"kind":"string","value":"Update MichaelRidland.cs"},"repos":{"kind":"string","value":"MabroukENG/planetxamarin,stvansolano/planetxamarin,beraybentesen/planetxamarin,MabroukENG/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,stvansolano/planetxamarin,beraybentesen/planetxamarin,planetxamarin/planetxamarin,MabroukENG/planetxamarin,beraybentesen/planetxamarin,planetxamarin/planetxamarin,stvansolano/planetxamarin"},"old_file":{"kind":"string","value":"src/Firehose.Web/Authors/MichaelRidland.cs"},"new_file":{"kind":"string","value":"src/Firehose.Web/Authors/MichaelRidland.cs"},"new_contents":{"kind":"string","value":"using Firehose.Web.Infrastructure;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Firehose.Web.Authors\n{\n public class MichaelRidland : IAmAXamarinMVP\n {\n public string FirstName => \"Michael\";\n\n public string LastName => \"Ridland\";\n\n public string StateOrRegion => \"Sydney, Australia\";\n\n public string EmailAddress => \"michael@xam-consulting.com\";\n\n public string Title => \"director of an Xamarin consultancy\";\n\n public Uri WebSite => new Uri(\"http://www.michaelridland.com\");\n\n public IEnumerable FeedUris\n {\n get { yield return new Uri(\"http://www.michaelridland.com/feed/\"); }\n }\n\n public string TwitterHandle => \"rid00z\";\n\n public DateTime FirstAwarded => new DateTime(2015, 4, 1);\n\n public string GravatarHash => \"\";\n }\n}\n"},"old_contents":{"kind":"string","value":"using Firehose.Web.Infrastructure;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Firehose.Web.Authors\n{\n public class MichaelRidland : IAmAXamarinMVP\n {\n public string FirstName => \"Michael\";\n\n public string LastName => \"Ridland\";\n\n public string StateOrRegion => \"Sydney, Australia\";\n\n public string EmailAddress => \"michael@xam-consulting.com\";\n\n public string Title => \"director of a Xamarin consultancy\";\n\n public Uri WebSite => new Uri(\"http://www.michaelridland.com\");\n\n public IEnumerable FeedUris\n {\n get { yield return new Uri(\"http://www.michaelridland.com/feed/\"); }\n }\n\n public string TwitterHandle => \"rid00z\";\n\n public DateTime FirstAwarded => new DateTime(2015, 4, 1);\n\n public string GravatarHash => \"\";\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671958,"cells":{"commit":{"kind":"string","value":"bd5ea192ec0f7d121778c1f709dd8c517e197b94"},"subject":{"kind":"string","value":"add ScheduleId to TaskInfo"},"repos":{"kind":"string","value":"grcodemonkey/iron_dotnet"},"old_file":{"kind":"string","value":"src/IronSharp.IronWorker/Tasks/TaskInfo.cs"},"new_file":{"kind":"string","value":"src/IronSharp.IronWorker/Tasks/TaskInfo.cs"},"new_contents":{"kind":"string","value":"using System;\nusing IronSharp.Core;\nusing Newtonsoft.Json;\n\nnamespace IronSharp.IronWorker\n{\n public class TaskInfo : IMsg, IInspectable\n {\n [JsonProperty(\"code_id\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public string CodeId { get; set; }\n\n [JsonProperty(\"code_name\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public string CodeName { get; set; }\n\n [JsonProperty(\"created_at\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public DateTime? CreatedAt { get; set; }\n\n [JsonProperty(\"duration\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public int? Duration { get; set; }\n\n [JsonProperty(\"end_time\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public DateTime? EndTime { get; set; }\n\n [JsonProperty(\"id\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public string Id { get; set; }\n\n [JsonProperty(\"schedule_id\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public string ScheduleId { get; set; }\n\n [JsonProperty(\"msg\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public string Message { get; set; }\n\n [JsonProperty(\"percent\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public int? Percent { get; set; }\n\n [JsonProperty(\"project_id\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public string ProjectId { get; set; }\n\n [JsonProperty(\"run_times\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public int? RunTimes { get; set; }\n\n [JsonProperty(\"start_time\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public DateTime? StartTime { get; set; }\n\n [JsonIgnore]\n public TaskStates Status {\n get { return StatusValue.As(); }\n set { StatusValue = Convert.ToString(value).ToLower(); }\n }\n\n [JsonProperty(\"timeout\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public int? Timeout { get; set; }\n\n [JsonProperty(\"updated_at\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public DateTime? UpdatedAt { get; set; }\n\n [JsonProperty(\"status\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n protected string StatusValue { get; set; }\n }\n}"},"old_contents":{"kind":"string","value":"using System;\nusing IronSharp.Core;\nusing Newtonsoft.Json;\n\nnamespace IronSharp.IronWorker\n{\n public class TaskInfo : IMsg, IInspectable\n {\n [JsonProperty(\"code_id\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public string CodeId { get; set; }\n\n [JsonProperty(\"code_name\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public string CodeName { get; set; }\n\n [JsonProperty(\"created_at\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public DateTime? CreatedAt { get; set; }\n\n [JsonProperty(\"duration\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public int? Duration { get; set; }\n\n [JsonProperty(\"end_time\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public DateTime? EndTime { get; set; }\n\n [JsonProperty(\"id\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public string Id { get; set; }\n\n [JsonProperty(\"msg\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public string Message { get; set; }\n\n [JsonProperty(\"percent\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public int? Percent { get; set; }\n\n [JsonProperty(\"project_id\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public string ProjectId { get; set; }\n\n [JsonProperty(\"run_times\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public int? RunTimes { get; set; }\n\n [JsonProperty(\"start_time\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public DateTime? StartTime { get; set; }\n\n [JsonIgnore]\n public TaskStates Status {\n get { return StatusValue.As(); }\n set { StatusValue = Convert.ToString(value).ToLower(); }\n }\n\n [JsonProperty(\"timeout\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public int? Timeout { get; set; }\n\n [JsonProperty(\"updated_at\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n public DateTime? UpdatedAt { get; set; }\n\n [JsonProperty(\"status\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n protected string StatusValue { get; set; }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671959,"cells":{"commit":{"kind":"string","value":"e5cfa8d3556f3e8173fde2d2993e36a746fe27ee"},"subject":{"kind":"string","value":"Simplify namespace handling"},"repos":{"kind":"string","value":"mkoscielniak/SSMScripter"},"old_file":{"kind":"string","value":"SSMScripter/Scripter/Smo/SmoCreatableObject.cs"},"new_file":{"kind":"string","value":"SSMScripter/Scripter/Smo/SmoCreatableObject.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.Collections.Specialized;\nusing MSmo = Microsoft.SqlServer.Management.Smo;\n\nnamespace SSMScripter.Scripter.Smo\n{\n public class SmoCreatableObject : SmoScriptableObject\n {\n public SmoCreatableObject(Microsoft.SqlServer.Management.Smo.SqlSmoObject obj)\n : base(obj)\n {\n }\n \n\n public override StringCollection Script(SmoScriptingContext context)\n {\n var scripter = new MSmo.Scripter(context.Server);\n scripter.Options.IncludeDatabaseContext = context.ScriptDatabaseContext;\n \n StringCollection scriptingResult = scripter.Script(new[] {ScriptedObject}); \n\n var result = new StringCollection();\n \n AddDatabaseContextIfNeeded(context, result, scriptingResult);\n\n foreach (string scriptedBatch in scriptingResult)\n {\n result.Add(scriptedBatch);\n AddLineEnding(result);\n AddLineEnding(result);\n }\n\n return result;\n }\n \n private void AddDatabaseContextIfNeeded(SmoScriptingContext context, StringCollection output, StringCollection scriptingResult)\n {\n if (scriptingResult.Count == 0)\n return;\n\n string firstLine = scriptingResult[0];\n\n if (String.IsNullOrEmpty(firstLine))\n return;\n\n if (firstLine.StartsWith(\"USE\", StringComparison.InvariantCultureIgnoreCase))\n return;\n\n AddDatabaseContext(output, context);\n AddLineEnding(output);\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System;\nusing System.Collections.Specialized;\n\nnamespace SSMScripter.Scripter.Smo\n{\n public class SmoCreatableObject : SmoScriptableObject\n {\n public SmoCreatableObject(Microsoft.SqlServer.Management.Smo.SqlSmoObject obj)\n : base(obj)\n {\n }\n \n\n public override StringCollection Script(SmoScriptingContext context)\n {\n var scripter = new Microsoft.SqlServer.Management.Smo.Scripter(context.Server);\n Microsoft.SqlServer.Management.Smo.ScriptingOptions options = scripter.Options;\n\n options.IncludeDatabaseContext = context.ScriptDatabaseContext;\n \n StringCollection scriptingResult = scripter.Script(new[] {ScriptedObject}); \n\n var result = new StringCollection();\n \n AddDatabaseContextIfNeeded(context, result, scriptingResult);\n\n foreach (string scriptedBatch in scriptingResult)\n {\n result.Add(scriptedBatch);\n AddLineEnding(result);\n AddLineEnding(result);\n }\n\n return result;\n }\n \n private void AddDatabaseContextIfNeeded(SmoScriptingContext context, StringCollection output, StringCollection scriptingResult)\n {\n if (scriptingResult.Count == 0)\n return;\n\n string firstLine = scriptingResult[0];\n\n if (String.IsNullOrEmpty(firstLine))\n return;\n\n if (firstLine.StartsWith(\"USE\", StringComparison.InvariantCultureIgnoreCase))\n return;\n\n AddDatabaseContext(output, context);\n AddLineEnding(output);\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671960,"cells":{"commit":{"kind":"string","value":"c84d05076a30141278c23d99f9286c2c8e7c4b53"},"subject":{"kind":"string","value":"Add overloads to exception to take in the Reason"},"repos":{"kind":"string","value":"rapidcore/rapidcore,rapidcore/rapidcore"},"old_file":{"kind":"string","value":"src/Locking/DistributedAppLockException.cs"},"new_file":{"kind":"string","value":"src/Locking/DistributedAppLockException.cs"},"new_contents":{"kind":"string","value":"using System;\n\nnamespace RapidCore.Locking\n{\n public class DistributedAppLockException : Exception\n {\n public DistributedAppLockException()\n {\n }\n\n public DistributedAppLockException(string message)\n : base(message)\n {\n }\n\n public DistributedAppLockException(string message, DistributedAppLockExceptionReason reason)\n : base(message)\n {\n Reason = reason;\n }\n\n public DistributedAppLockException(string message, Exception inner)\n : base(message, inner)\n {\n }\n\n public DistributedAppLockException(string message, Exception inner, DistributedAppLockExceptionReason reason)\n : base(message, inner)\n {\n Reason = reason;\n }\n\n public DistributedAppLockExceptionReason Reason { get; set; }\n }\n}"},"old_contents":{"kind":"string","value":"using System;\n\nnamespace RapidCore.Locking\n{\n public class DistributedAppLockException : Exception\n {\n public DistributedAppLockException()\n {\n }\n\n public DistributedAppLockException(string message)\n : base(message)\n {\n }\n\n public DistributedAppLockException(string message, Exception inner)\n : base(message, inner)\n {\n }\n\n public DistributedAppLockExceptionReason Reason { get; set; }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671961,"cells":{"commit":{"kind":"string","value":"d22703b27496b0e1c5eaadc0a0985f7346599b26"},"subject":{"kind":"string","value":"Fix for closing window."},"repos":{"kind":"string","value":"cube-soft/Cube.Net,cube-soft/Cube.Net,cube-soft/Cube.Net"},"old_file":{"kind":"string","value":"Applications/Rss/Reader/Xui/Triggers/CloseTrigger.cs"},"new_file":{"kind":"string","value":"Applications/Rss/Reader/Xui/Triggers/CloseTrigger.cs"},"new_contents":{"kind":"string","value":"/* ------------------------------------------------------------------------- */\n//\n// Copyright (c) 2010 CubeSoft, Inc.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n/* ------------------------------------------------------------------------- */\nusing System.Windows;\nusing System.Windows.Interactivity;\n\nnamespace Cube.Xui.Triggers\n{\n /* --------------------------------------------------------------------- */\n ///\n /// CloseMessage\n ///\n /// \n /// ウィンドウを閉じることを示すメッセージクラスです。\n /// \n /// \n /* --------------------------------------------------------------------- */\n public class CloseMessage { }\n\n /* --------------------------------------------------------------------- */\n ///\n /// CloseTrigger\n ///\n /// \n /// Messenger オブジェクト経由でウィンドウを閉じるための\n /// Trigger クラスです。\n /// \n /// \n /* --------------------------------------------------------------------- */\n public class CloseTrigger : MessengerTrigger { }\n\n /* --------------------------------------------------------------------- */\n ///\n /// CloseAction\n ///\n /// \n /// Window を閉じる TriggerAction です。\n /// \n /// \n /* --------------------------------------------------------------------- */\n public class CloseAction : TriggerAction\n {\n /* ----------------------------------------------------------------- */\n ///\n /// Invoke\n /// \n /// \n /// 処理を実行します。\n /// \n /// \n /* ----------------------------------------------------------------- */\n protected override void Invoke(object notused)\n {\n if (AssociatedObject is Window w)\n {\n w.DataContext = null;\n w.Close();\n }\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"/* ------------------------------------------------------------------------- */\n//\n// Copyright (c) 2010 CubeSoft, Inc.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n/* ------------------------------------------------------------------------- */\nusing System.Windows;\nusing System.Windows.Interactivity;\n\nnamespace Cube.Xui.Triggers\n{\n /* --------------------------------------------------------------------- */\n ///\n /// CloseMessage\n ///\n /// \n /// ウィンドウを閉じることを示すメッセージクラスです。\n /// \n /// \n /* --------------------------------------------------------------------- */\n public class CloseMessage { }\n\n /* --------------------------------------------------------------------- */\n ///\n /// CloseTrigger\n ///\n /// \n /// Messenger オブジェクト経由でウィンドウを閉じるための\n /// Trigger クラスです。\n /// \n /// \n /* --------------------------------------------------------------------- */\n public class CloseTrigger : MessengerTrigger { }\n\n /* --------------------------------------------------------------------- */\n ///\n /// CloseAction\n ///\n /// \n /// Window を閉じる TriggerAction です。\n /// \n /// \n /* --------------------------------------------------------------------- */\n public class CloseAction : TriggerAction\n {\n /* ----------------------------------------------------------------- */\n ///\n /// Invoke\n /// \n /// \n /// 処理を実行します。\n /// \n /// \n /* ----------------------------------------------------------------- */\n protected override void Invoke(object notused)\n {\n if (AssociatedObject is Window w) w.Close();\n }\n }\n}\n"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671962,"cells":{"commit":{"kind":"string","value":"da90cb0c045ed2ad5f32b63e98b5cdb13ed0232f"},"subject":{"kind":"string","value":"resolve again"},"repos":{"kind":"string","value":"IvoAtanasov/TableTennisChampionship,IvoAtanasov/TableTennisChampionship,IvoAtanasov/TableTennisChampionship"},"old_file":{"kind":"string","value":"TableTennisChampionship/TableTennisChampionshipMain/ViewModels/TournamentPlayerInfo.cs"},"new_file":{"kind":"string","value":"TableTennisChampionship/TableTennisChampionshipMain/ViewModels/TournamentPlayerInfo.cs"},"new_contents":{"kind":"string","value":"namespace TableTennisChampionshipMain.ViewModels\n{\n using System;\n using System.Collections.Generic;\n using System.Linq;\n using System.Web;\n using TableTennisChampionshipMain.Infrastructure;\n using TableTennisChampionship.Model.DataBaseModel;\n using System.ComponentModel.DataAnnotations;\n public class TournamentPlayerInfo : IMapFrom ,IHaveCustomMappings\n {\n \n public int TournamentPlayerID { get; set; }\n [Required]\n public int TournamentID { get; set; }\n [Required]\n public int PlayerID { get; set; }\n public string PlayerFullName { get; set; }\n public int Rank { get; set; }\n public int Points { get; set; }\n\n #region IHaveCustomMappings Members\n public void CreateMappings(AutoMapper.IConfiguration configuration)\n {\n configuration.CreateMap()\n .ForMember(m => m.PlayerFullName, opt => opt.MapFrom(x => x.Player.FirstName + \" \" + x.Player.LastName));\n }\n #endregion\n }\n}"},"old_contents":{"kind":"string","value":"\n\nnamespace TableTennisChampionshipMain.ViewModels\n{\n using System;\n using System.Collections.Generic;\n using System.Linq;\n using System.Web;\n using TableTennisChampionshipMain.Infrastructure;\n using TableTennisChampionship.Model.DataBaseModel;\n using System.ComponentModel.DataAnnotations;\n public class TournamentPlayerInfo : IMapFrom ,IHaveCustomMappings\n {\n \n public int TournamentPlayerID { get; set; }\n [Required]\n public int TournamentID { get; set; }\n [Required]\n public int PlayerID { get; set; }\n public string PlayerFullName { get; set; }\n public int Rank { get; set; }\n public int Points { get; set; }\n\n #region IHaveCustomMappings Members\n public void CreateMappings(AutoMapper.IConfiguration configuration)\n {\n configuration.CreateMap()\n .ForMember(m => m.PlayerFullName, opt => opt.MapFrom(x => x.Player.FirstName + \" \" + x.Player.LastName));\n }\n #endregion\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671963,"cells":{"commit":{"kind":"string","value":"ef57b8eec49ca310ba9b6e2c6ace521ccc8443bf"},"subject":{"kind":"string","value":"make identity case insensitive"},"repos":{"kind":"string","value":"Soluto/tweek,Soluto/tweek,Soluto/tweek,Soluto/tweek,Soluto/tweek,Soluto/tweek"},"old_file":{"kind":"string","value":"core/Engine/Engine.DataTypes/Identity.cs"},"new_file":{"kind":"string","value":"core/Engine/Engine.DataTypes/Identity.cs"},"new_contents":{"kind":"string","value":"using System;\n\nnamespace Engine.DataTypes\n{\n public class Identity: Tuple\n {\n public string Type => Item1;\n public string Id => Item2;\n\n public Identity(string type, string id)\n : base(type.ToLower(), id.ToLower())\n {\n }\n\n public const string GlobalIdentityType = \"@global\";\n public static readonly Identity GlobalIdentity = new Identity(GlobalIdentityType, \"\");\n }\n}"},"old_contents":{"kind":"string","value":"using System;\n\nnamespace Engine.DataTypes\n{\n public class Identity: Tuple\n {\n public string Type => Item1;\n public string Id => Item2;\n\n public Identity(string type, string id)\n : base(type, id)\n {\n }\n\n public const string GlobalIdentityType = \"@global\";\n public static readonly Identity GlobalIdentity = new Identity(GlobalIdentityType, \"\");\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671964,"cells":{"commit":{"kind":"string","value":"49b1c52df5e8d2bf03768dc35ba6575e88277bc7"},"subject":{"kind":"string","value":"Add `Unmanaged` calling convention (#852)"},"repos":{"kind":"string","value":"jbevain/cecil"},"old_file":{"kind":"string","value":"Mono.Cecil/MethodCallingConvention.cs"},"new_file":{"kind":"string","value":"Mono.Cecil/MethodCallingConvention.cs"},"new_contents":{"kind":"string","value":"//\n// Author:\n// Jb Evain (jbevain@gmail.com)\n//\n// Copyright (c) 2008 - 2015 Jb Evain\n// Copyright (c) 2008 - 2011 Novell, Inc.\n//\n// Licensed under the MIT/X11 license.\n//\n\nnamespace Mono.Cecil {\n\n\tpublic enum MethodCallingConvention : byte {\n\t\tDefault\t\t= 0x0,\n\t\tC\t\t\t= 0x1,\n\t\tStdCall\t\t= 0x2,\n\t\tThisCall\t= 0x3,\n\t\tFastCall\t= 0x4,\n\t\tVarArg\t\t= 0x5,\n\t\tUnmanaged\t= 0x9,\n\t\tGeneric\t\t= 0x10,\n\t}\n}\n"},"old_contents":{"kind":"string","value":"//\n// Author:\n// Jb Evain (jbevain@gmail.com)\n//\n// Copyright (c) 2008 - 2015 Jb Evain\n// Copyright (c) 2008 - 2011 Novell, Inc.\n//\n// Licensed under the MIT/X11 license.\n//\n\nnamespace Mono.Cecil {\n\n\tpublic enum MethodCallingConvention : byte {\n\t\tDefault\t\t= 0x0,\n\t\tC\t\t\t= 0x1,\n\t\tStdCall\t\t= 0x2,\n\t\tThisCall\t= 0x3,\n\t\tFastCall\t= 0x4,\n\t\tVarArg\t\t= 0x5,\n\t\tGeneric\t\t= 0x10,\n\t}\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671965,"cells":{"commit":{"kind":"string","value":"afd4740c609eafd48ab4cd6a539db47a3ba3778e"},"subject":{"kind":"string","value":"Use floats across the camera calculations /2 > 0.5f"},"repos":{"kind":"string","value":"paseb/HoloToolkit-Unity,HoloFan/HoloToolkit-Unity,ForrestTrepte/HoloToolkit-Unity,out-of-pixel/HoloToolkit-Unity,NeerajW/HoloToolkit-Unity,willcong/HoloToolkit-Unity,HattMarris1/HoloToolkit-Unity,dbastienMS/HoloToolkit-Unity,paseb/MixedRealityToolkit-Unity"},"old_file":{"kind":"string","value":"Assets/HoloToolkit/Utilities/Scripts/Extensions/CameraExtensions.cs"},"new_file":{"kind":"string","value":"Assets/HoloToolkit/Utilities/Scripts/Extensions/CameraExtensions.cs"},"new_contents":{"kind":"string","value":"using UnityEngine;\n\nnamespace HoloToolkit.Unity\n{\n public static class CameraExtensions\n {\n /// \n /// Get the horizontal FOV from the stereo camera\n /// \n /// \n public static float GetHorizontalFieldOfViewRadians(this Camera camera)\n {\n float horizontalFovRadians = 2f * Mathf.Atan(Mathf.Tan(camera.fieldOfView * Mathf.Deg2Rad * 0.5f) * camera.aspect);\n return horizontalFovRadians;\n }\n\n /// \n /// Returns if a point will be rendered on the screen in either eye\n /// \n /// \n /// \n public static bool IsInFOV(this Camera camera, Vector3 position)\n {\n float verticalFovHalf = camera.fieldOfView * 0.5f;\n float horizontalFovHalf = camera.GetHorizontalFieldOfViewRadians() * Mathf.Rad2Deg * 0.5f;\n\n Vector3 deltaPos = position - camera.transform.position;\n Vector3 headDeltaPos = MathUtils.TransformDirectionFromTo(null, camera.transform, deltaPos).normalized;\n\n float yaw = Mathf.Asin(headDeltaPos.x) * Mathf.Rad2Deg;\n float pitch = Mathf.Asin(headDeltaPos.y) * Mathf.Rad2Deg;\n\n return (Mathf.Abs(yaw) < horizontalFovHalf && Mathf.Abs(pitch) < verticalFovHalf);\n }\n }\n}"},"old_contents":{"kind":"string","value":"using UnityEngine;\n\nnamespace HoloToolkit.Unity\n{\n public static class CameraExtensions\n {\n /// \n /// Get the horizontal FOV from the stereo camera\n /// \n /// \n public static float GetHorizontalFieldOfViewRadians(this Camera camera)\n {\n float horizontalFovRadians = 2 * Mathf.Atan(Mathf.Tan((camera.fieldOfView * Mathf.Deg2Rad) / 2) * camera.aspect);\n return horizontalFovRadians;\n }\n\n /// \n /// Returns if a point will be rendered on the screen in either eye\n /// \n /// \n /// \n public static bool IsInFOV(this Camera camera, Vector3 position)\n {\n float verticalFovHalf = camera.fieldOfView / 2;\n float horizontalFovHalf = camera.GetHorizontalFieldOfViewRadians() * Mathf.Rad2Deg / 2;\n\n Vector3 deltaPos = position - camera.transform.position;\n Vector3 headDeltaPos = MathUtils.TransformDirectionFromTo(null, camera.transform, deltaPos).normalized;\n\n float yaw = Mathf.Asin(headDeltaPos.x) * Mathf.Rad2Deg;\n float pitch = Mathf.Asin(headDeltaPos.y) * Mathf.Rad2Deg;\n\n return (Mathf.Abs(yaw) < horizontalFovHalf && Mathf.Abs(pitch) < verticalFovHalf);\n }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671966,"cells":{"commit":{"kind":"string","value":"a046af0229646421e7c4e2274c8d069b105f9f71"},"subject":{"kind":"string","value":"Clean up."},"repos":{"kind":"string","value":"nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet"},"old_file":{"kind":"string","value":"WalletWasabi/Tor/Socks5/Models/Fields/ByteArrayFields/UNameField.cs"},"new_file":{"kind":"string","value":"WalletWasabi/Tor/Socks5/Models/Fields/ByteArrayFields/UNameField.cs"},"new_contents":{"kind":"string","value":"using System.Text;\nusing WalletWasabi.Helpers;\nusing WalletWasabi.Tor.Socks5.Models.Bases;\n\nnamespace WalletWasabi.Tor.Socks5.Models.Fields.ByteArrayFields\n{\n\tpublic class UNameField : ByteArraySerializableBase\n\t{\n\t\tpublic UNameField(byte[] bytes)\n\t\t{\n\t\t\tBytes = Guard.NotNullOrEmpty(nameof(bytes), bytes);\n\t\t}\n\n\t\tpublic UNameField(string uName)\n\t\t\t: this(Encoding.UTF8.GetBytes(uName))\n\t\t{\n\t\t}\n\n\t\tprivate byte[] Bytes { get; }\n\n\t\tpublic override byte[] ToBytes() => Bytes;\n\t}\n}\n"},"old_contents":{"kind":"string","value":"using System.Text;\nusing WalletWasabi.Helpers;\nusing WalletWasabi.Tor.Socks5.Models.Bases;\n\nnamespace WalletWasabi.Tor.Socks5.Models.Fields.ByteArrayFields\n{\n\tpublic class UNameField : ByteArraySerializableBase\n\t{\n\t\t#region Constructors\n\n\t\tpublic UNameField(byte[] bytes)\n\t\t{\n\t\t\tBytes = Guard.NotNullOrEmpty(nameof(bytes), bytes);\n\t\t}\n\n\t\tpublic UNameField(string uName)\n\t\t\t: this(Encoding.UTF8.GetBytes(uName))\n\t\t{\n\t\t}\n\n\t\t#endregion Constructors\n\n\t\t#region PropertiesAndMembers\n\n\t\tprivate byte[] Bytes { get; }\n\n\t\tpublic string UName => Encoding.UTF8.GetString(Bytes); // Tor accepts UTF8 encoded passwd\n\n\t\t#endregion PropertiesAndMembers\n\n\t\t#region Serialization\n\n\t\tpublic override byte[] ToBytes() => Bytes;\n\n\t\t#endregion Serialization\n\t}\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671967,"cells":{"commit":{"kind":"string","value":"10c9b3d971757d12f265e18fcf6c86c4c9d959e4"},"subject":{"kind":"string","value":"Fix Dictionary type to be more useful"},"repos":{"kind":"string","value":"ilovepi/Compiler,ilovepi/Compiler"},"old_file":{"kind":"string","value":"compiler/middleend/ir/ParseResult.cs"},"new_file":{"kind":"string","value":"compiler/middleend/ir/ParseResult.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace compiler.middleend.ir\n{\n class ParseResult\n {\n public Operand Operand { get; set; }\n public List Instructions { get; set; }\n\n public Dictionary VarTable { get; set; }\n\n public ParseResult()\n {\n Operand = null;\n Instructions = null;\n VarTable = new Dictionary();\n }\n\n public ParseResult(Dictionary symTble )\n {\n Operand = null;\n Instructions = null;\n VarTable = new Dictionary(symTble);\n }\n\n public ParseResult(Operand pOperand, List pInstructions, Dictionary pSymTble)\n {\n Operand = pOperand;\n Instructions = new List(pInstructions);\n VarTable = new Dictionary(pSymTble);\n }\n\n\n }\n}\n"},"old_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace compiler.middleend.ir\n{\n class ParseResult\n {\n public Operand Operand { get; set; }\n public List Instructions { get; set; }\n\n public Dictionary VarTable { get; set; }\n\n public ParseResult()\n {\n Operand = null;\n Instructions = null;\n VarTable = new Dictionary();\n }\n\n public ParseResult(Dictionary symTble )\n {\n Operand = null;\n Instructions = null;\n VarTable = new Dictionary(symTble);\n }\n\n public ParseResult(Operand pOperand, List pInstructions, Dictionary pSymTble)\n {\n Operand = pOperand;\n Instructions = new List(pInstructions);\n VarTable = new Dictionary(pSymTble);\n }\n\n\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671968,"cells":{"commit":{"kind":"string","value":"59de17dfb20252c87b83b3f52e738816a8f71315"},"subject":{"kind":"string","value":"Change list to observablecollection"},"repos":{"kind":"string","value":"grantcolley/authorisationmanager,grantcolley/authorisationmanager,grantcolley/authorisationmanager,grantcolley/authorisationmanager"},"old_file":{"kind":"string","value":"UI/WPF/Model/UserNode.cs"},"new_file":{"kind":"string","value":"UI/WPF/Model/UserNode.cs"},"new_contents":{"kind":"string","value":"using System.Collections.ObjectModel;\nusing DevelopmentInProgress.DipSecure;\n\nnamespace DevelopmentInProgress.AuthorisationManager.WPF.Model\n{\n public class UserNode : EntityBase\n {\n public UserNode(UserAuthorisation userAuthorisation)\n {\n UserAuthorisation = userAuthorisation;\n\n Roles = new ObservableCollection();\n }\n\n public ObservableCollection Roles { get; set; }\n\n public UserAuthorisation UserAuthorisation { get; private set; }\n\n public override int Id\n {\n get { return UserAuthorisation.Id; }\n set\n {\n UserAuthorisation.Id = value;\n OnPropertyChanged(\"Id\");\n }\n }\n\n public override string Text\n {\n get { return UserAuthorisation.UserName; }\n set\n {\n UserAuthorisation.UserName = value;\n OnPropertyChanged(\"Text\");\n }\n }\n\n public override string Description\n {\n get { return UserAuthorisation.DisplayName; }\n set\n {\n UserAuthorisation.DisplayName = value;\n OnPropertyChanged(\"Description\");\n }\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing DevelopmentInProgress.DipSecure;\n\nnamespace DevelopmentInProgress.AuthorisationManager.WPF.Model\n{\n public class UserNode : EntityBase\n {\n public UserNode(UserAuthorisation userAuthorisation)\n {\n UserAuthorisation = userAuthorisation;\n\n Roles = new List();\n }\n\n public List Roles { get; set; }\n\n public UserAuthorisation UserAuthorisation { get; private set; }\n\n public override int Id\n {\n get { return UserAuthorisation.Id; }\n set\n {\n UserAuthorisation.Id = value;\n OnPropertyChanged(\"Id\");\n }\n }\n\n public override string Text\n {\n get { return UserAuthorisation.UserName; }\n set\n {\n UserAuthorisation.UserName = value;\n OnPropertyChanged(\"Text\");\n }\n }\n\n public override string Description\n {\n get { return UserAuthorisation.DisplayName; }\n set\n {\n UserAuthorisation.DisplayName = value;\n OnPropertyChanged(\"Description\");\n }\n }\n }\n}\n"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671969,"cells":{"commit":{"kind":"string","value":"507b383e5955a7de27905d8093162d6be86c4a13"},"subject":{"kind":"string","value":"Update Bootstrap package in v4 test pages to v4.6.2"},"repos":{"kind":"string","value":"atata-framework/atata-bootstrap,atata-framework/atata-bootstrap"},"old_file":{"kind":"string","value":"test/Atata.Bootstrap.TestApp/Pages/v4/_Layout.cshtml"},"new_file":{"kind":"string","value":"test/Atata.Bootstrap.TestApp/Pages/v4/_Layout.cshtml"},"new_contents":{"kind":"string","value":"\n\n\n \n @ViewBag.Title - Atata.Bootstrap.TestApp v4\n\n \n @RenderSection(\"styles\", false)\n\n\n
\n

@ViewBag.Title

\n @RenderBody()\n
\n\n \n \n @RenderSection(\"scripts\", false)\n\n\n"},"old_contents":{"kind":"string","value":"\n\n\n \n @ViewBag.Title\n\n \n @RenderSection(\"styles\", false)\n\n\n
\n

@ViewBag.Title

\n @RenderBody()\n
\n\n \n \n @RenderSection(\"scripts\", false)\n\n\n"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671970,"cells":{"commit":{"kind":"string","value":"a6f5d3580a8add0633de58571b229715347b8239"},"subject":{"kind":"string","value":"Fix warnings."},"repos":{"kind":"string","value":"sshnet/SSH.NET"},"old_file":{"kind":"string","value":"src/Renci.SshNet.Tests/Classes/ClientAuthenticationTest.cs"},"new_file":{"kind":"string","value":"src/Renci.SshNet.Tests/Classes/ClientAuthenticationTest.cs"},"new_contents":{"kind":"string","value":"using System;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing Moq;\n\nnamespace Renci.SshNet.Tests.Classes\n{\n [TestClass]\n public class ClientAuthenticationTest\n {\n private ClientAuthentication _clientAuthentication;\n\n [TestInitialize]\n public void Init()\n {\n _clientAuthentication = new ClientAuthentication();\n }\n\n [TestMethod]\n public void AuthenticateShouldThrowArgumentNullExceptionWhenConnectionInfoIsNull()\n {\n const IConnectionInfoInternal connectionInfo = null;\n var session = new Mock(MockBehavior.Strict).Object;\n\n try\n {\n _clientAuthentication.Authenticate(connectionInfo, session);\n Assert.Fail();\n }\n catch (ArgumentNullException ex)\n {\n Assert.IsNull(ex.InnerException);\n Assert.AreEqual(\"connectionInfo\", ex.ParamName);\n }\n }\n\n [TestMethod]\n public void AuthenticateShouldThrowArgumentNullExceptionWhenSessionIsNull()\n {\n var connectionInfo = new Mock(MockBehavior.Strict).Object;\n const ISession session = null;\n\n try\n {\n _clientAuthentication.Authenticate(connectionInfo, session);\n Assert.Fail();\n }\n catch (ArgumentNullException ex)\n {\n Assert.IsNull(ex.InnerException);\n Assert.AreEqual(\"session\", ex.ParamName);\n }\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing Moq;\n\nnamespace Renci.SshNet.Tests.Classes\n{\n [TestClass]\n public class ClientAuthenticationTest\n {\n private ClientAuthentication _clientAuthentication;\n\n [TestInitialize]\n public void Init()\n {\n _clientAuthentication = new ClientAuthentication();\n }\n\n [TestMethod]\n public void AuthenticateShouldThrowArgumentNullExceptionWhenConnectionInfoIsNull()\n {\n IConnectionInfoInternal connectionInfo = null;\n var session = new Mock(MockBehavior.Strict).Object;\n\n try\n {\n _clientAuthentication.Authenticate(connectionInfo, session);\n Assert.Fail();\n }\n catch (ArgumentNullException ex)\n {\n Assert.IsNull(ex.InnerException);\n Assert.AreEqual(\"connectionInfo\", ex.ParamName);\n }\n }\n\n [TestMethod]\n public void AuthenticateShouldThrowArgumentNullExceptionWhenSessionIsNull()\n {\n var connectionInfo = new Mock(MockBehavior.Strict).Object;\n ISession session = null;\n\n try\n {\n _clientAuthentication.Authenticate(connectionInfo, session);\n Assert.Fail();\n }\n catch (ArgumentNullException ex)\n {\n Assert.IsNull(ex.InnerException);\n Assert.AreEqual(\"session\", ex.ParamName);\n }\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671971,"cells":{"commit":{"kind":"string","value":"5cc73aa5225de32dbbc4f4a8c8c43be78e00dca9"},"subject":{"kind":"string","value":"Rename \"ConstructBuilder\" to \"FindRequestHandler\" as \"ConstructBuilder\" is a weak name that no longer accurately describes what this does Also more detail in the error message"},"repos":{"kind":"string","value":"danhaller/SevenDigital.Api.Wrapper,bnathyuw/SevenDigital.Api.Wrapper,emashliles/SevenDigital.Api.Wrapper,AnthonySteele/SevenDigital.Api.Wrapper,bettiolo/SevenDigital.Api.Wrapper,gregsochanik/SevenDigital.Api.Wrapper,luiseduardohdbackup/SevenDigital.Api.Wrapper,mattgray/SevenDigital.Api.Wrapper,minkaotic/SevenDigital.Api.Wrapper,danbadge/SevenDigital.Api.Wrapper"},"old_file":{"kind":"string","value":"src/SevenDigital.Api.Wrapper/EndpointResolution/RequestCoordinator.cs"},"new_file":{"kind":"string","value":"src/SevenDigital.Api.Wrapper/EndpointResolution/RequestCoordinator.cs"},"new_contents":{"kind":"string","value":"using System;\r\nusing System.Collections.Generic;\r\nusing SevenDigital.Api.Wrapper.EndpointResolution.RequestHandlers;\r\nusing SevenDigital.Api.Wrapper.Http;\r\n\r\nnamespace SevenDigital.Api.Wrapper.EndpointResolution\r\n{\r\n\tpublic class RequestCoordinator : IRequestCoordinator\r\n\t{\r\n\t\tprivate readonly IEnumerable _requestHandlers;\r\n\r\n\t\tpublic IHttpClient HttpClient { get; set; }\r\n\r\n\t\tpublic RequestCoordinator(IHttpClient httpClient, IEnumerable requestHandlers)\r\n\t\t{\r\n\t\t\tHttpClient = httpClient;\r\n\t\t\t_requestHandlers = requestHandlers;\r\n\t\t}\r\n\r\n\t\tpublic string ConstructEndpoint(RequestData requestData)\r\n\t\t{\r\n\t\t\tvar requestHandler = FindRequestHandler(requestData.HttpMethod);\r\n\t\t\treturn requestHandler.ConstructEndpoint(requestData);\r\n\t\t}\r\n\r\n\t\tprivate RequestHandler FindRequestHandler(string httpMethod)\r\n\t\t{\r\n\t\t\tvar upperHttpMethodName = httpMethod.ToUpperInvariant();\r\n\t\t\tforeach (var requestHandler in _requestHandlers)\r\n\t\t\t{\r\n\t\t\t\tif (requestHandler.HandlesMethod(upperHttpMethodName))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn requestHandler;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tstring errorMessage = string.Format(\"No RequestHandler supplied for method '{0}'\", upperHttpMethodName);\r\n\t\t\tthrow new NotImplementedException(errorMessage);\r\n\t\t}\r\n\r\n\t\tpublic virtual Response HitEndpoint(RequestData requestData)\r\n\t\t{\r\n\t\t\tvar requestHandler = FindRequestHandler(requestData.HttpMethod);\r\n\t\t\trequestHandler.HttpClient = HttpClient;\r\n\t\t\treturn requestHandler.HitEndpoint(requestData);\r\n\t\t}\r\n\r\n\t\tpublic virtual void HitEndpointAsync(RequestData requestData, Action callback)\r\n\t\t{\r\n\t\t\tvar requestHandler = FindRequestHandler(requestData.HttpMethod);\r\n\t\t\trequestHandler.HttpClient = HttpClient;\r\n\t\t\trequestHandler.HitEndpointAsync(requestData, callback);\r\n\t\t}\r\n\t}\r\n}"},"old_contents":{"kind":"string","value":"using System;\r\nusing System.Collections.Generic;\r\nusing SevenDigital.Api.Wrapper.EndpointResolution.RequestHandlers;\r\nusing SevenDigital.Api.Wrapper.Http;\r\n\r\nnamespace SevenDigital.Api.Wrapper.EndpointResolution\r\n{\r\n\tpublic class RequestCoordinator : IRequestCoordinator\r\n\t{\r\n\t\tprivate readonly IEnumerable _requestHandlers;\r\n\r\n\t\tpublic IHttpClient HttpClient { get; set; }\r\n\r\n\t\tpublic RequestCoordinator(IHttpClient httpClient, IEnumerable requestHandlers)\r\n\t\t{\r\n\t\t\tHttpClient = httpClient;\r\n\t\t\t_requestHandlers = requestHandlers;\r\n\t\t}\r\n\r\n\t\tpublic string ConstructEndpoint(RequestData requestData)\r\n\t\t{\r\n\t\t\treturn ConstructBuilder(requestData).ConstructEndpoint(requestData);\r\n\t\t}\r\n\r\n\t\tprivate RequestHandler ConstructBuilder(RequestData requestData)\r\n\t\t{\r\n\t\t\tvar upperInvariant = requestData.HttpMethod.ToUpperInvariant();\r\n\t\t\tforeach (var requestHandler in _requestHandlers)\r\n\t\t\t{\r\n\t\t\t\tif (requestHandler.HandlesMethod(upperInvariant))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn requestHandler;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthrow new NotImplementedException(\"No RequestHandlers supplied that can deal with this method\");\r\n\t\t}\r\n\r\n\t\tpublic virtual Response HitEndpoint(RequestData requestData)\r\n\t\t{\r\n\t\t\tvar builder = ConstructBuilder(requestData);\r\n\t\t\tbuilder.HttpClient = HttpClient;\r\n\t\t\treturn builder.HitEndpoint(requestData);\r\n\t\t}\r\n\r\n\t\tpublic virtual void HitEndpointAsync(RequestData requestData, Action callback)\r\n\t\t{\r\n\t\t\tvar builder = ConstructBuilder(requestData);\r\n\t\t\tbuilder.HttpClient = HttpClient;\r\n\t\t\tbuilder.HitEndpointAsync(requestData, callback);\r\n\t\t}\r\n\t}\r\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671972,"cells":{"commit":{"kind":"string","value":"29c7a8df70ea0143ffaa243fa1ff997fd5bb23b8"},"subject":{"kind":"string","value":"fix bug in fal copy. (#1052)"},"repos":{"kind":"string","value":"superyyrrzz/docfx,hellosnow/docfx,pascalberger/docfx,superyyrrzz/docfx,DuncanmaMSFT/docfx,dotnet/docfx,928PJY/docfx,pascalberger/docfx,928PJY/docfx,928PJY/docfx,hellosnow/docfx,hellosnow/docfx,superyyrrzz/docfx,DuncanmaMSFT/docfx,dotnet/docfx,LordZoltan/docfx,dotnet/docfx,LordZoltan/docfx,LordZoltan/docfx,pascalberger/docfx,LordZoltan/docfx"},"old_file":{"kind":"string","value":"src/Microsoft.DocAsCode.Common/FileAbstractLayer/RealFileWriter.cs"},"new_file":{"kind":"string","value":"src/Microsoft.DocAsCode.Common/FileAbstractLayer/RealFileWriter.cs"},"new_contents":{"kind":"string","value":"// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nnamespace Microsoft.DocAsCode.Common\n{\n using System;\n using System.Collections.Immutable;\n using System.IO;\n\n public class RealFileWriter : FileWriterBase\n {\n public RealFileWriter(string outputFolder)\n : base(outputFolder) { }\n\n #region Overrides\n\n public override void Copy(PathMapping sourceFileName, RelativePath destFileName)\n {\n var f = Path.Combine(ExpandedOutputFolder, destFileName.RemoveWorkingFolder());\n Directory.CreateDirectory(Path.GetDirectoryName(f));\n File.Copy(Environment.ExpandEnvironmentVariables(sourceFileName.PhysicalPath), f, true);\n File.SetAttributes(f, FileAttributes.Normal);\n }\n\n public override Stream Create(RelativePath file)\n {\n var f = Path.Combine(ExpandedOutputFolder, file.RemoveWorkingFolder());\n Directory.CreateDirectory(Path.GetDirectoryName(f));\n return File.Create(f);\n }\n\n public override IFileReader CreateReader()\n {\n return new RealFileReader(OutputFolder, ImmutableDictionary.Empty);\n }\n\n #endregion\n }\n}\n"},"old_contents":{"kind":"string","value":"// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nnamespace Microsoft.DocAsCode.Common\n{\n using System;\n using System.Collections.Immutable;\n using System.IO;\n\n public class RealFileWriter : FileWriterBase\n {\n public RealFileWriter(string outputFolder)\n : base(outputFolder) { }\n\n #region Overrides\n\n public override void Copy(PathMapping sourceFileName, RelativePath destFileName)\n {\n var f = Path.Combine(ExpandedOutputFolder, destFileName.RemoveWorkingFolder());\n Directory.CreateDirectory(Path.GetDirectoryName(f));\n File.Copy(Environment.ExpandEnvironmentVariables(sourceFileName.PhysicalPath), f);\n File.SetAttributes(f, FileAttributes.Normal);\n }\n\n public override Stream Create(RelativePath file)\n {\n var f = Path.Combine(ExpandedOutputFolder, file.RemoveWorkingFolder());\n Directory.CreateDirectory(Path.GetDirectoryName(f));\n return File.Create(f);\n }\n\n public override IFileReader CreateReader()\n {\n return new RealFileReader(OutputFolder, ImmutableDictionary.Empty);\n }\n\n #endregion\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671973,"cells":{"commit":{"kind":"string","value":"549c76bf53e332658be1965834a8832bdc565fae"},"subject":{"kind":"string","value":"Fix type of p4"},"repos":{"kind":"string","value":"setchi/Unity-LineSegmentsIntersection"},"old_file":{"kind":"string","value":"Assets/LineSegmentIntersection/Scripts/Math2d.cs"},"new_file":{"kind":"string","value":"Assets/LineSegmentIntersection/Scripts/Math2d.cs"},"new_contents":{"kind":"string","value":"using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\nnamespace LineSegmentsIntersection\n{\n public static class Math2d\n {\n public static bool LineSegmentsIntersection(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, out Vector2 intersection)\n {\n intersection = Vector2.zero;\n\n var d = (p2.x - p1.x) * (p4.y - p3.y) - (p2.y - p1.y) * (p4.x - p3.x);\n\n if (d == 0.0f)\n {\n return false;\n }\n\n var u = ((p3.x - p1.x) * (p4.y - p3.y) - (p3.y - p1.y) * (p4.x - p3.x)) / d;\n var v = ((p3.x - p1.x) * (p2.y - p1.y) - (p3.y - p1.y) * (p2.x - p1.x)) / d;\n\n if (u < 0.0f || u > 1.0f || v < 0.0f || v > 1.0f)\n {\n return false;\n }\n\n intersection.x = p1.x + u * (p2.x - p1.x);\n intersection.y = p1.y + u * (p2.y - p1.y);\n\n return true;\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\nnamespace LineSegmentsIntersection\n{\n public static class Math2d\n {\n public static bool LineSegmentsIntersection(Vector2 p1, Vector2 p2, Vector2 p3, Vector3 p4, out Vector2 intersection)\n {\n intersection = Vector2.zero;\n\n var d = (p2.x - p1.x) * (p4.y - p3.y) - (p2.y - p1.y) * (p4.x - p3.x);\n\n if (d == 0.0f)\n {\n return false;\n }\n\n var u = ((p3.x - p1.x) * (p4.y - p3.y) - (p3.y - p1.y) * (p4.x - p3.x)) / d;\n var v = ((p3.x - p1.x) * (p2.y - p1.y) - (p3.y - p1.y) * (p2.x - p1.x)) / d;\n\n if (u < 0.0f || u > 1.0f || v < 0.0f || v > 1.0f)\n {\n return false;\n }\n\n intersection.x = p1.x + u * (p2.x - p1.x);\n intersection.y = p1.y + u * (p2.y - p1.y);\n\n return true;\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671974,"cells":{"commit":{"kind":"string","value":"f1f7f47ce0f653842644e3dfda41c84c22b62b0e"},"subject":{"kind":"string","value":"Fix calculation for Room.top & Room.bottom"},"repos":{"kind":"string","value":"Saduras/DungeonGenerator"},"old_file":{"kind":"string","value":"Assets/SourceCode/Room.cs"},"new_file":{"kind":"string","value":"Assets/SourceCode/Room.cs"},"new_contents":{"kind":"string","value":"using UnityEngine;\n\npublic class Room : MonoBehaviour \n{\n\tpublic float width { get { return transform.localScale.x; } }\n\tpublic float length { get { return transform.localScale.z; } }\n\n\tpublic float top \n\t{ \n\t\tget { \n\t\t\treturn transform.localPosition.z + length / 2;\n\t\t}\n\t}\n\tpublic float bottom \n\t{ \n\t\tget { \n\t\t\treturn transform.localPosition.z - length / 2;\n\t\t}\n\t}\n\tpublic float left\n\t{ \n\t\tget { \n\t\t\treturn transform.localPosition.x - width / 2;\n\t\t}\n\t}\n\tpublic float right\n\t{ \n\t\tget { \n\t\t\treturn transform.localPosition.x + width / 2;\n\t\t}\n\t}\n\n\tpublic void Init(int width, int length)\n\t{\n\t\ttransform.localScale = new Vector3 (width, 1f, length);\n\t}\n}\n"},"old_contents":{"kind":"string","value":"using UnityEngine;\n\npublic class Room : MonoBehaviour \n{\n\tpublic float width { get { return transform.localScale.x; } }\n\tpublic float length { get { return transform.localScale.z; } }\n\n\tpublic float top \n\t{ \n\t\tget { \n\t\t\treturn transform.localPosition.z + width / 2;\n\t\t}\n\t}\n\tpublic float bottom \n\t{ \n\t\tget { \n\t\t\treturn transform.localPosition.z - width / 2;\n\t\t}\n\t}\n\tpublic float left\n\t{ \n\t\tget { \n\t\t\treturn transform.localPosition.x - width / 2;\n\t\t}\n\t}\n\tpublic float right\n\t{ \n\t\tget { \n\t\t\treturn transform.localPosition.x + width / 2;\n\t\t}\n\t}\n\n\tpublic void Init(int width, int length)\n\t{\n\t\ttransform.localScale = new Vector3 (width, 1f, length);\n\t}\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671975,"cells":{"commit":{"kind":"string","value":"abffd8293bec00982d72d40cd986a950d13122fe"},"subject":{"kind":"string","value":"Fix fat-finger made before the previous commit"},"repos":{"kind":"string","value":"Lunch-box/SimpleOrderRouting"},"old_file":{"kind":"string","value":"CSharp/SimpleOrderRouting.Journey1/ExecutionState.cs"},"new_file":{"kind":"string","value":"CSharp/SimpleOrderRouting.Journey1/ExecutionState.cs"},"new_contents":{"kind":"string","value":"namespace SimpleOrderRouting.Journey1\n{\n public class ExecutionState\n {\n public ExecutionState(InvestorInstruction investorInstruction)\n {\n this.Quantity = investorInstruction.Quantity;\n this.Price = investorInstruction.Price;\n this.Way = investorInstruction.Way;\n this.AllowPartialExecution = investorInstruction.AllowPartialExecution;\n }\n\n public int Quantity { get; set; }\n\n public decimal Price { get; set; }\n\n public Way Way { get; set; }\n\n public bool AllowPartialExecution { get; set; }\n \n public void Executed(int quantity)\n {\n this.Quantity -= quantity;\n }\n }\n}"},"old_contents":{"kind":"string","value":"namespace SimpleOrderRouting.Journey1\n{\n public class ExecutionState\n {\n public ExecutionState(InvestorInstruction investorInstruction)\n {\n this.Quantity = investorInstruction.Quantity;\n this.Price = investorInstruction.Price;\n this.Way = investorInstruction.Way;\n this.AllowPartialExecution = investorInstruction.AllowPartialExecution;\n }\n\n public int Quantity { get; set; }\n\n public decimal Price { get; set; }\n\n public Way Way { get; set; }\n\n public bool AllowPartialExecution { get; set; }\n\n {\n this.Quantity -= quantity;\n }\n }\n}"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671976,"cells":{"commit":{"kind":"string","value":"984f9a550bdbcc5e6c293fa62244b22dc605582f"},"subject":{"kind":"string","value":"Fix random power use when cooldown"},"repos":{"kind":"string","value":"solfen/Rogue_Cadet"},"old_file":{"kind":"string","value":"Assets/Scripts/SpecialPowers/PowerRandom.cs"},"new_file":{"kind":"string","value":"Assets/Scripts/SpecialPowers/PowerRandom.cs"},"new_contents":{"kind":"string","value":"using UnityEngine;\nusing System.Collections;\nusing System.Collections.Generic;\n\npublic class PowerRandom : BaseSpecialPower {\n\n [SerializeField] private List powers;\n private BaseSpecialPower activePower = null;\n\n protected override void Start() {\n base.Start();\n activePower = Instantiate(powers[Random.Range(0, powers.Count)], transform.parent, false) as BaseSpecialPower;\n }\n\n protected override void Activate() {\n if(activePower.coolDownTimer <= 0)\n StartCoroutine(WaitForDestroy());\n }\n\n protected override void Update() {\n if(activePower.mana > 0) {\n base.Update();\n }\n }\n\n\n IEnumerator WaitForDestroy() {\n yield return null;\n while(activePower.coolDownTimer > 0) {\n yield return null;\n }\n\n float currentMana = activePower.mana;\n Debug.Log(currentMana);\n DestroyImmediate(activePower.gameObject);\n activePower = Instantiate(powers[Random.Range(0, powers.Count)], transform.parent, false) as BaseSpecialPower;\n yield return null;\n activePower.mana = currentMana;\n yield return null;\n EventDispatcher.DispatchEvent(Events.SPECIAL_POWER_USED, activePower); //to activate the UI\n }\n}\n"},"old_contents":{"kind":"string","value":"using UnityEngine;\nusing System.Collections;\nusing System.Collections.Generic;\n\npublic class PowerRandom : BaseSpecialPower {\n\n [SerializeField] private List powers;\n private BaseSpecialPower activePower = null;\n\n protected override void Start() {\n base.Start();\n activePower = Instantiate(powers[Random.Range(0, powers.Count)], transform.parent, false) as BaseSpecialPower;\n }\n\n protected override void Activate() {\n StartCoroutine(WaitForDestroy());\n }\n\n protected override void Update() {\n if(activePower.mana > 0) {\n base.Update();\n }\n }\n\n\n IEnumerator WaitForDestroy() {\n yield return null;\n while(activePower.coolDownTimer > 0) {\n yield return null;\n }\n\n float currentMana = activePower.mana;\n DestroyImmediate(activePower.gameObject);\n activePower = Instantiate(powers[Random.Range(0, powers.Count)], transform.parent, false) as BaseSpecialPower;\n yield return null;\n activePower.mana = currentMana;\n yield return null;\n EventDispatcher.DispatchEvent(Events.SPECIAL_POWER_USED, activePower); //to activate the UI\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671977,"cells":{"commit":{"kind":"string","value":"167d3b1a6a156463a68513ed6f18cac64a1c4fab"},"subject":{"kind":"string","value":"Update WindowsRegistrySettingsServiceOptions.cs"},"repos":{"kind":"string","value":"tiksn/TIKSN-Framework"},"old_file":{"kind":"string","value":"TIKSN.Framework.Core/Settings/WindowsRegistrySettingsServiceOptions.cs"},"new_file":{"kind":"string","value":"TIKSN.Framework.Core/Settings/WindowsRegistrySettingsServiceOptions.cs"},"new_contents":{"kind":"string","value":"using Microsoft.Win32;\n\nnamespace TIKSN.Settings\n{\n public class WindowsRegistrySettingsServiceOptions\n {\n public WindowsRegistrySettingsServiceOptions() => this.RegistryView = RegistryView.Default;\n\n public RegistryView RegistryView { get; set; }\n\n public string SubKey { get; set; }\n }\n}\n"},"old_contents":{"kind":"string","value":"using Microsoft.Win32;\n\nnamespace TIKSN.Settings\n{\n public class WindowsRegistrySettingsServiceOptions\n {\n public WindowsRegistrySettingsServiceOptions()\n {\n RegistryView = RegistryView.Default;\n }\n\n public RegistryView RegistryView { get; set; }\n\n public string SubKey { get; set; }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671978,"cells":{"commit":{"kind":"string","value":"afb15950afb313a4f26bfdbb39d0666f6500485d"},"subject":{"kind":"string","value":"Improve ToString when Id is null"},"repos":{"kind":"string","value":"drewnoakes/dasher"},"old_file":{"kind":"string","value":"Dasher.Schemata/Schema.cs"},"new_file":{"kind":"string","value":"Dasher.Schemata/Schema.cs"},"new_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing System.Xml.Linq;\nusing JetBrains.Annotations;\n\nnamespace Dasher.Schemata\n{\n public interface IWriteSchema\n {\n /// \n /// Creates a deep copy of this schema within .\n /// \n /// \n /// \n IWriteSchema CopyTo(SchemaCollection collection);\n }\n\n public interface IReadSchema\n {\n bool CanReadFrom(IWriteSchema writeSchema, bool strict);\n\n /// \n /// Creates a deep copy of this schema within .\n /// \n /// \n /// \n IReadSchema CopyTo(SchemaCollection collection);\n }\n\n public abstract class Schema\n {\n internal abstract IEnumerable Children { get; }\n\n public override bool Equals(object obj)\n {\n var other = obj as Schema;\n return other != null && Equals(other);\n }\n\n public abstract bool Equals(Schema other);\n\n public override int GetHashCode() => ComputeHashCode();\n\n protected abstract int ComputeHashCode();\n }\n\n /// For complex, union and enum.\n public abstract class ByRefSchema : Schema\n {\n [CanBeNull]\n internal string Id { get; set; }\n internal abstract XElement ToXml();\n public override string ToString() => Id ?? GetType().Name;\n }\n\n /// For primitive, nullable, list, dictionary, tuple, empty.\n public abstract class ByValueSchema : Schema\n {\n internal abstract string MarkupValue { get; }\n public override string ToString() => MarkupValue;\n }\n}"},"old_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing System.Xml.Linq;\nusing JetBrains.Annotations;\n\nnamespace Dasher.Schemata\n{\n public interface IWriteSchema\n {\n /// \n /// Creates a deep copy of this schema within .\n /// \n /// \n /// \n IWriteSchema CopyTo(SchemaCollection collection);\n }\n\n public interface IReadSchema\n {\n bool CanReadFrom(IWriteSchema writeSchema, bool strict);\n\n /// \n /// Creates a deep copy of this schema within .\n /// \n /// \n /// \n IReadSchema CopyTo(SchemaCollection collection);\n }\n\n public abstract class Schema\n {\n internal abstract IEnumerable Children { get; }\n\n public override bool Equals(object obj)\n {\n var other = obj as Schema;\n return other != null && Equals(other);\n }\n\n public abstract bool Equals(Schema other);\n\n public override int GetHashCode() => ComputeHashCode();\n\n protected abstract int ComputeHashCode();\n }\n\n /// For complex, union and enum.\n public abstract class ByRefSchema : Schema\n {\n [CanBeNull]\n internal string Id { get; set; }\n internal abstract XElement ToXml();\n public override string ToString() => Id;\n }\n\n /// For primitive, nullable, list, dictionary, tuple, empty.\n public abstract class ByValueSchema : Schema\n {\n internal abstract string MarkupValue { get; }\n public override string ToString() => MarkupValue;\n }\n}"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671979,"cells":{"commit":{"kind":"string","value":"f3dd77c8eb02a7212495eb29692d22f50156aff7"},"subject":{"kind":"string","value":"Use HashSet to ensure no duplicate collidingObjects"},"repos":{"kind":"string","value":"JScott/ViveGrip"},"old_file":{"kind":"string","value":"Assets/ViveGrip/Scripts/Internal/ViveGrip_TouchDetection.cs"},"new_file":{"kind":"string","value":"Assets/ViveGrip/Scripts/Internal/ViveGrip_TouchDetection.cs"},"new_contents":{"kind":"string","value":"using UnityEngine;\nusing System.Collections.Generic;\n\npublic class ViveGrip_TouchDetection : MonoBehaviour {\n private HashSet collidingObjects = new HashSet();\n\n void Start () {\n GetComponent().isTrigger = true;\n }\n\n void OnTriggerEnter(Collider other) {\n ViveGrip_Object component = ActiveComponent(other.gameObject);\n if (component == null) { return; }\n collidingObjects.Add(component);\n }\n\n void OnTriggerExit(Collider other) {\n ViveGrip_Object component = ActiveComponent(other.gameObject);\n if (component == null) { return; }\n collidingObjects.Remove(component);\n }\n\n public GameObject NearestObject() {\n float closestDistance = Mathf.Infinity;\n GameObject touchedObject = null;\n foreach (ViveGrip_Object component in collidingObjects) {\n float distance = Vector3.Distance(transform.position, component.transform.position);\n if (distance < closestDistance) {\n touchedObject = component.gameObject;\n closestDistance = distance;\n }\n }\n return touchedObject;\n }\n\n ViveGrip_Object ActiveComponent(GameObject gameObject) {\n if (gameObject == null) { return null; } // Happens with Destroy() sometimes\n ViveGrip_Object component = ValidComponent(gameObject.transform);\n if (component == null) {\n component = ValidComponent(gameObject.transform.parent);\n }\n if (component != null) {\n return component;\n }\n return null;\n }\n\n ViveGrip_Object ValidComponent(Transform transform) {\n if (transform == null) { return null; }\n ViveGrip_Object component = transform.GetComponent();\n if (component != null && component.enabled) { return component; }\n return null;\n }\n}\n"},"old_contents":{"kind":"string","value":"using UnityEngine;\nusing System.Collections.Generic;\n\npublic class ViveGrip_TouchDetection : MonoBehaviour {\n private List collidingObjects = new List();\n\n void Start () {\n GetComponent().isTrigger = true;\n }\n\n void OnTriggerEnter(Collider other) {\n ViveGrip_Object component = ActiveComponent(other.gameObject);\n if (component == null) { return; }\n collidingObjects.Add(component);\n }\n\n void OnTriggerExit(Collider other) {\n ViveGrip_Object component = ActiveComponent(other.gameObject);\n if (component == null) { return; }\n collidingObjects.Remove(component);\n }\n\n public GameObject NearestObject() {\n float closestDistance = Mathf.Infinity;\n GameObject touchedObject = null;\n foreach (ViveGrip_Object component in collidingObjects) {\n float distance = Vector3.Distance(transform.position, component.transform.position);\n if (distance < closestDistance) {\n touchedObject = component.gameObject;\n closestDistance = distance;\n }\n }\n return touchedObject;\n }\n\n ViveGrip_Object ActiveComponent(GameObject gameObject) {\n if (gameObject == null) { return null; } // Happens with Destroy() sometimes\n ViveGrip_Object component = ValidComponent(gameObject.transform);\n if (component == null) {\n component = ValidComponent(gameObject.transform.parent);\n }\n if (component != null) {\n return component;\n }\n return null;\n }\n\n ViveGrip_Object ValidComponent(Transform transform) {\n if (transform == null) { return null; }\n ViveGrip_Object component = transform.GetComponent();\n if (component != null && component.enabled) { return component; }\n return null;\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671980,"cells":{"commit":{"kind":"string","value":"740a6d9bb52fd9ea8894de60df87f585a91db7d8"},"subject":{"kind":"string","value":"Support full range of comparison operators instead of IndexOf"},"repos":{"kind":"string","value":"adoprog/Sitecore-Mobile-Device-Detector"},"old_file":{"kind":"string","value":"MobileDeviceDetector/Rules/Conditions/UserAgentCondition.cs"},"new_file":{"kind":"string","value":"MobileDeviceDetector/Rules/Conditions/UserAgentCondition.cs"},"new_contents":{"kind":"string","value":"namespace Sitecore.SharedSource.MobileDeviceDetector.Rules.Conditions\n{\n using System;\n using System.Web;\n using Sitecore.Diagnostics;\n using Sitecore.Rules;\n using Sitecore.Rules.Conditions;\n\n /// \n /// UserAgentCondition\n /// \n /// \n public class UserAgentCondition : StringOperatorCondition where T : RuleContext\n {\n /// \n /// Gets or sets the value.\n /// \n /// The value.\n public string Value { get; set; }\n\n /// \n /// Executes the specified rule context.\n /// \n /// The rule context.\n /// Returns value indicating whether Device UserAgent matches Value or not\n protected override bool Execute(T ruleContext)\n {\n Assert.ArgumentNotNull(ruleContext, \"ruleContext\");\n string str = this.Value ?? string.Empty;\n var userAgent = HttpContext.Current.Request.UserAgent;\n if (!string.IsNullOrEmpty(userAgent))\n {\n return Compare(str, userAgent);\n }\n\n return false;\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"namespace Sitecore.SharedSource.MobileDeviceDetector.Rules.Conditions\n{\n using System;\n using System.Web;\n using Sitecore.Diagnostics;\n using Sitecore.Rules;\n using Sitecore.Rules.Conditions;\n\n /// \n /// UserAgentCondition\n /// \n /// \n public class UserAgentCondition : StringOperatorCondition where T : RuleContext\n {\n /// \n /// Gets or sets the value.\n /// \n /// The value.\n public string Value { get; set; }\n\n /// \n /// Executes the specified rule context.\n /// \n /// The rule context.\n /// Returns value indicating whether Device UserAgent matches Value or not\n protected override bool Execute(T ruleContext)\n {\n Assert.ArgumentNotNull(ruleContext, \"ruleContext\");\n string str = this.Value ?? string.Empty;\n var userAgent = HttpContext.Current.Request.UserAgent;\n if (!string.IsNullOrEmpty(userAgent))\n {\n return userAgent.IndexOf(str, StringComparison.OrdinalIgnoreCase) >= 0;\n }\n\n return false;\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671981,"cells":{"commit":{"kind":"string","value":"795d109e9dfeab2eb1c3bbf1c893a0f6399edf7c"},"subject":{"kind":"string","value":"Fix twitter issue"},"repos":{"kind":"string","value":"libertyernie/WeasylSync"},"old_file":{"kind":"string","value":"CrosspostSharp3/Program.cs"},"new_file":{"kind":"string","value":"CrosspostSharp3/Program.cs"},"new_contents":{"kind":"string","value":"using ISchemm.WinFormsOAuth;\nusing Newtonsoft.Json;\nusing SourceWrappers;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\nusing Tweetinvi;\nusing Tweetinvi.Logic.JsonConverters;\nusing Tweetinvi.Models;\n\nnamespace CrosspostSharp3 {\n\tpublic class CustomJsonLanguageConverter : JsonLanguageConverter {\n\t\tpublic override object ReadJson(JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) {\n\t\t\treturn reader.Value != null\n\t\t\t\t? base.ReadJson(reader, objectType, existingValue, serializer)\n\t\t\t\t: Language.English;\n\t\t}\n\t}\n\n\tpublic static class Program {\n\t\t/// \n\t\t/// The main entry point for the application.\n\t\t/// \n\t\t[STAThread]\n\t\tstatic void Main(string[] args) {\n\t\t\tExceptionHandler.SwallowWebExceptions = false;\n\t\t\tTweetinviConfig.CurrentThreadSettings.TweetMode = TweetMode.Extended;\n\n\t\t\tIECookiePersist.Suppress(true);\n\t\t\tIECompatibility.SetForCurrentProcess();\n\n\t\t\tJsonPropertyConverterRepository.JsonConverters.Remove(typeof(Language));\n\t\t\tJsonPropertyConverterRepository.JsonConverters.Add(typeof(Language), new CustomJsonLanguageConverter());\n\n\t\t\t// Force current directory (if a file or folder was dragged onto CrosspostSharp3.exe)\n\t\t\tEnvironment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;\n\n\t\t\tApplication.EnableVisualStyles();\n\t\t\tApplication.SetCompatibleTextRenderingDefault(false);\n\t\t\tif (args.Length == 1) {\n\t\t\t\ttry {\n\t\t\t\t\tvar artwork = SavedPhotoPost.FromFile(args[0]);\n\t\t\t\t\tif (artwork.data == null) {\n\t\t\t\t\t\tthrow new Exception(\"This file does not contain a base-64 encoded \\\"data\\\" field.\");\n\t\t\t\t\t}\n\t\t\t\t\tApplication.Run(new ArtworkForm(artwork));\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tMessageBox.Show(ex.Message, ex.GetType().Name, MessageBoxButtons.OK, MessageBoxIcon.Error);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tApplication.Run(new MainForm());\n\t\t\t}\n\t\t}\n\t}\n}\n"},"old_contents":{"kind":"string","value":"using ISchemm.WinFormsOAuth;\nusing SourceWrappers;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\nusing Tweetinvi;\n\nnamespace CrosspostSharp3 {\n\tstatic class Program {\n\t\t/// \n\t\t/// The main entry point for the application.\n\t\t/// \n\t\t[STAThread]\n\t\tstatic void Main(string[] args) {\n\t\t\tExceptionHandler.SwallowWebExceptions = false;\n\t\t\tTweetinviConfig.CurrentThreadSettings.TweetMode = TweetMode.Extended;\n\n\t\t\tIECookiePersist.Suppress(true);\n\t\t\tIECompatibility.SetForCurrentProcess();\n\n\t\t\t// Force current directory (if a file or folder was dragged onto CrosspostSharp3.exe)\n\t\t\tEnvironment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;\n\n\t\t\tApplication.EnableVisualStyles();\n\t\t\tApplication.SetCompatibleTextRenderingDefault(false);\n\t\t\tif (args.Length == 1) {\n\t\t\t\ttry {\n\t\t\t\t\tvar artwork = SavedPhotoPost.FromFile(args[0]);\n\t\t\t\t\tif (artwork.data == null) {\n\t\t\t\t\t\tthrow new Exception(\"This file does not contain a base-64 encoded \\\"data\\\" field.\");\n\t\t\t\t\t}\n\t\t\t\t\tApplication.Run(new ArtworkForm(artwork));\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tMessageBox.Show(ex.Message, ex.GetType().Name, MessageBoxButtons.OK, MessageBoxIcon.Error);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tApplication.Run(new MainForm());\n\t\t\t}\n\t\t}\n\t}\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671982,"cells":{"commit":{"kind":"string","value":"d5e9c87364684e0d63525cb50ea72fe251f29d69"},"subject":{"kind":"string","value":"Update AssemblyInfo.cs"},"repos":{"kind":"string","value":"mattyway/Hangfire.Autofac,HangfireIO/Hangfire.Autofac"},"old_file":{"kind":"string","value":"HangFire.Autofac/Properties/AssemblyInfo.cs"},"new_file":{"kind":"string","value":"HangFire.Autofac/Properties/AssemblyInfo.cs"},"new_contents":{"kind":"string","value":"using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HangFire.Autofac\")]\n[assembly: AssemblyDescription(\"Autofac IoC Container support for HangFire (background job system for ASP.NET applications).\")]\n[assembly: AssemblyProduct(\"HangFire\")]\n[assembly: AssemblyCopyright(\"Copyright © 2014 Sergey Odinokov\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components. If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"c38d8acf-7b2c-4d7f-84ad-c477879ade3f\")]\n\n[assembly: AssemblyVersion(\"0.1.2.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"},"old_contents":{"kind":"string","value":"using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"HangFire.Autofac\")]\n[assembly: AssemblyDescription(\"Autofac IoC Container support for HangFire (background job system for ASP.NET applications).\")]\n[assembly: AssemblyProduct(\"HangFire\")]\n[assembly: AssemblyCopyright(\"Copyright © 2014 Sergey Odinokov\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components. If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"c38d8acf-7b2c-4d7f-84ad-c477879ade3f\")]\n\n[assembly: AssemblyVersion(\"0.1.1.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671983,"cells":{"commit":{"kind":"string","value":"a906a002cc2f94ffd724e4b46d1ee81a0d17f529"},"subject":{"kind":"string","value":"Remove empty navigation list in anydiff module (invalid HTML)."},"repos":{"kind":"string","value":"dokipen/trac,dafrito/trac-mirror,exocad/exotrac,exocad/exotrac,exocad/exotrac,moreati/trac-gitsvn,moreati/trac-gitsvn,moreati/trac-gitsvn,moreati/trac-gitsvn,dafrito/trac-mirror,dokipen/trac,exocad/exotrac,dokipen/trac,dafrito/trac-mirror,dafrito/trac-mirror"},"old_file":{"kind":"string","value":"templates/anydiff.cs"},"new_file":{"kind":"string","value":"templates/anydiff.cs"},"new_contents":{"kind":"string","value":"\n\n
\n\n
\n
\n

Select Base and Target for Diff:

\n
\n\n
\n
\" method=\"get\">\n \n \n \n \n \n \n \n \n \n
\n \" size=\"44\" />\n \n \" size=\"4\" />\n
\n \" size=\"44\" />\n \n \" size=\"4\" />\n
\n
\n \n
\n
\n
\n
\n Note: See /TracChangeset#ExaminingArbitraryDifferences\">TracChangeset for help on using the arbitrary diff feature.\n
\n
\n\n\n"},"old_contents":{"kind":"string","value":"\n\n
\n

Navigation

\n
    \n
\n
\n\n
\n
\n

Select Base and Target for Diff:

\n
\n\n
\n
\" method=\"get\">\n \n \n \n \n \n \n \n \n \n
\n \" size=\"44\" />\n \n \" size=\"4\" />\n
\n \" size=\"44\" />\n \n \" size=\"4\" />\n
\n
\n \n
\n
\n
\n
\n Note: See /TracChangeset#ExaminingArbitraryDifferences\">TracChangeset for help on using the arbitrary diff feature.\n
\n
\n\n\n"},"license":{"kind":"string","value":"bsd-3-clause"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671984,"cells":{"commit":{"kind":"string","value":"f3f165efa8806d490f87820ab4e72257d25bf72c"},"subject":{"kind":"string","value":"fix compression mode message"},"repos":{"kind":"string","value":"SignalGo/SignalGo-full-net"},"old_file":{"kind":"string","value":"SignalGo.Shared/IO/Compressions/CompressionHelper.cs"},"new_file":{"kind":"string","value":"SignalGo.Shared/IO/Compressions/CompressionHelper.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace SignalGo.Shared.IO.Compressions\n{\n public static class CompressionHelper\n {\n public static ICompression GetCompression(CompressMode compressMode, Func getCustomCompression)\n {\n if (compressMode == CompressMode.None)\n return new NoCompression();\n if (getCustomCompression != null)\n return getCustomCompression();\n throw new NotSupportedException($\"Compression mode of {compressMode} not supported!\");\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace SignalGo.Shared.IO.Compressions\n{\n public static class CompressionHelper\n {\n public static ICompression GetCompression(CompressMode compressMode, Func getCustomCompression)\n {\n if (compressMode == CompressMode.None)\n return new NoCompression();\n if (getCustomCompression != null)\n return getCustomCompression();\n throw new NotSupportedException();\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671985,"cells":{"commit":{"kind":"string","value":"ef59521848f3dd54abd3acc986f711af4617d2c4"},"subject":{"kind":"string","value":"Update String-Reversal.cs"},"repos":{"kind":"string","value":"DeanCabral/Code-Snippets"},"old_file":{"kind":"string","value":"Console/String-Reversal.cs"},"new_file":{"kind":"string","value":"Console/String-Reversal.cs"},"new_contents":{"kind":"string","value":"class StringReversal\n {\n static void Main(string[] args)\n {\n GetUserInput();\n }\n\n static void GetUserInput()\n {\n string input = \"\";\n\n Console.Write(\"Enter a word: \");\n input = Console.ReadLine();\n\n Console.WriteLine(\"The reverse word of the string '{0}' is: {1}\", input, ReverseString(input));\n\n GetUserInput();\n }\n\n static string ReverseString(string input)\n {\n string reversed = \"\";\n\n for (int i = input.Length - 1; i >= 0; i--)\n {\n reversed += input[i];\n }\n \n return reversed;\n }\n }\n"},"old_contents":{"kind":"string","value":"class StringReversal\n {\n static void Main(string[] args)\n {\n GetUserInput();\n }\n\n static void GetUserInput()\n {\n string input = \"\";\n\n Console.Write(\"Enter a word: \");\n input = Console.ReadLine();\n\n Console.WriteLine(\"The reverse word of the string '{0}' is: {1}\", input, ReverseString(input));\n\n GetUserInput();\n }\n\n static string ReverseString(string input)\n {\n string reversed = \"\";\n\n for (int i = input.Length - 1; i >= 0; i--)\n {\n reversed += input[i];\n }\n\n return reversed;\n }\n }\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671986,"cells":{"commit":{"kind":"string","value":"176b9b16e8bde46d31f4d7e3bb490727233dc3cd"},"subject":{"kind":"string","value":"Write files without BOM"},"repos":{"kind":"string","value":"paulroho/ConvertToUtf8"},"old_file":{"kind":"string","value":"ConvertToUtf8/Converter.cs"},"new_file":{"kind":"string","value":"ConvertToUtf8/Converter.cs"},"new_contents":{"kind":"string","value":"using System;\nusing System.IO;\nusing System.Text;\n\nnamespace ConvertToUtf8\n{\n public interface IConverter\n {\n void ConvertFile(string inputFile, string outputFile);\n void ConvertFiles(string folder);\n }\n\n public class Converter : IConverter\n {\n public void ConvertFile(string inputFile, string outputFile)\n {\n Console.Write($\"Converting {inputFile}...\");\n using (var reader = new StreamReader(inputFile, Encoding.Unicode))\n {\n var utf8EncodingWithoutBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);\n using (var writer = new StreamWriter(outputFile, false, utf8EncodingWithoutBOM))\n {\n CopyContents(reader, writer);\n }\n }\n Console.WriteLine(\"(done)\");\n }\n\n public void ConvertFiles(string folder)\n {\n foreach (var file in Directory.EnumerateFiles(folder))\n {\n var tempTargetFile = file + \".tmptgt\";\n ConvertFile(file, tempTargetFile);\n File.Copy(tempTargetFile, file, overwrite:true);\n File.Delete(tempTargetFile);\n }\n }\n\n private void CopyContents(TextReader input, TextWriter output)\n {\n var buffer = new char[8192];\n int len;\n while ((len = input.Read(buffer, 0, buffer.Length)) != 0)\n {\n output.Write(buffer, 0, len);\n }\n }\n }\n}"},"old_contents":{"kind":"string","value":"using System;\nusing System.IO;\nusing System.Text;\n\nnamespace ConvertToUtf8\n{\n public interface IConverter\n {\n void ConvertFile(string inputFile, string outputFile);\n void ConvertFiles(string folder);\n }\n\n public class Converter : IConverter\n {\n public void ConvertFile(string inputFile, string outputFile)\n {\n using (var reader = new StreamReader(inputFile, Encoding.Unicode))\n {\n using (var writer = new StreamWriter(outputFile, false, Encoding.UTF8))\n {\n CopyContents(reader, writer);\n }\n }\n }\n\n public void ConvertFiles(string folder)\n {\n foreach (var file in Directory.EnumerateFiles(folder))\n {\n var tempTargetFile = file + \".tmptgt\";\n ConvertFile(file, tempTargetFile);\n File.Copy(tempTargetFile, file, overwrite:true);\n File.Delete(tempTargetFile);\n }\n }\n\n private void CopyContents(TextReader input, TextWriter output)\n {\n var buffer = new char[8192];\n int len;\n while ((len = input.Read(buffer, 0, buffer.Length)) != 0)\n {\n output.Write(buffer, 0, len);\n }\n }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671987,"cells":{"commit":{"kind":"string","value":"57b0821e19d6d54ca7c83e7ffb74f43605846e8b"},"subject":{"kind":"string","value":"Revert \"Rewrite folder write permission check to hopefully make it more reliable\""},"repos":{"kind":"string","value":"chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck"},"old_file":{"kind":"string","value":"Core/Utils/WindowsUtils.cs"},"new_file":{"kind":"string","value":"Core/Utils/WindowsUtils.cs"},"new_contents":{"kind":"string","value":"using System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Security.AccessControl;\nusing System.Security.Principal;\n\nnamespace TweetDck.Core.Utils{\n static class WindowsUtils{\n public static bool CheckFolderPermission(string path, FileSystemRights right){\n try{\n AuthorizationRuleCollection rules = Directory.GetAccessControl(path).GetAccessRules(true, true, typeof(SecurityIdentifier));\n WindowsIdentity identity = WindowsIdentity.GetCurrent();\n\n if (identity.Groups == null){\n return false;\n }\n\n bool accessAllow = false, accessDeny = false;\n\n foreach(FileSystemAccessRule rule in rules.Cast().Where(rule => identity.Groups.Contains(rule.IdentityReference) && (right & rule.FileSystemRights) == right)){\n switch(rule.AccessControlType){\n case AccessControlType.Allow: accessAllow = true; break;\n case AccessControlType.Deny: accessDeny = true; break;\n }\n }\n\n return accessAllow && !accessDeny;\n }\n catch{\n return false;\n }\n }\n\n public static Process StartProcess(string file, string arguments, bool runElevated){\n ProcessStartInfo processInfo = new ProcessStartInfo{\n FileName = file,\n Arguments = arguments\n };\n\n if (runElevated){\n processInfo.Verb = \"runas\";\n }\n\n return Process.Start(processInfo);\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System.Diagnostics;\nusing System.IO;\nusing System.Security.AccessControl;\nusing System.Security.Principal;\n\nnamespace TweetDck.Core.Utils{\n static class WindowsUtils{\n public static bool CheckFolderPermission(string path, FileSystemRights right){\n try{\n AuthorizationRuleCollection collection = Directory.GetAccessControl(path).GetAccessRules(true, true, typeof(NTAccount));\n\n foreach(FileSystemAccessRule rule in collection){\n if ((rule.FileSystemRights & right) == right){\n return true;\n }\n }\n\n return false;\n }\n catch{\n return false;\n }\n }\n\n public static Process StartProcess(string file, string arguments, bool runElevated){\n ProcessStartInfo processInfo = new ProcessStartInfo{\n FileName = file,\n Arguments = arguments\n };\n\n if (runElevated){\n processInfo.Verb = \"runas\";\n }\n\n return Process.Start(processInfo);\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671988,"cells":{"commit":{"kind":"string","value":"952d46f58f6a5159ab10c90b148fcbd2b566b63c"},"subject":{"kind":"string","value":"Add Positions body param to PlaylistRemoveItemsRequest, #501"},"repos":{"kind":"string","value":"JohnnyCrazy/SpotifyAPI-NET,JohnnyCrazy/SpotifyAPI-NET,JohnnyCrazy/SpotifyAPI-NET,JohnnyCrazy/SpotifyAPI-NET"},"old_file":{"kind":"string","value":"SpotifyAPI.Web/Models/Request/PlaylistRemoveItemsRequest.cs"},"new_file":{"kind":"string","value":"SpotifyAPI.Web/Models/Request/PlaylistRemoveItemsRequest.cs"},"new_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace SpotifyAPI.Web\n{\n public class PlaylistRemoveItemsRequest : RequestParams\n {\n /// \n /// An array of objects containing Spotify URIs of the tracks or episodes to remove.\n /// For example: { \"tracks\": [{ \"uri\": \"spotify:track:4iV5W9uYEdYUVa79Axb7Rh\" },\n /// { \"uri\": \"spotify:track:1301WleyT98MSxVHPZCA6M\" }] }.\n /// A maximum of 100 objects can be sent at once.\n /// \n /// \n [BodyParam(\"tracks\")]\n public IList? Tracks { get; set; }\n\n /// \n /// An array of positions to delete. This also supports local tracks.\n /// SnapshotId MUST be supplied when using this parameter\n /// \n /// \n [BodyParam(\"positions\")]\n public IList? Positions { get; set; }\n\n /// \n /// The playlist’s snapshot ID against which you want to make the changes.\n /// The API will validate that the specified items exist and in the specified positions and make the changes,\n /// even if more recent changes have been made to the playlist.\n /// \n /// \n [BodyParam(\"snapshot_id\")]\n public string? SnapshotId { get; set; }\n\n [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1034\")]\n public class Item\n {\n [JsonProperty(\"uri\", NullValueHandling = NullValueHandling.Ignore)]\n public string? Uri { get; set; }\n\n [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \"CA2227\")]\n [JsonProperty(\"positions\", NullValueHandling = NullValueHandling.Ignore)]\n public List? Positions { get; set; }\n }\n }\n}\n\n"},"old_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace SpotifyAPI.Web\n{\n public class PlaylistRemoveItemsRequest : RequestParams\n {\n /// \n ///\n /// \n /// \n /// An array of objects containing Spotify URIs of the tracks or episodes to remove.\n /// For example: { \"tracks\": [{ \"uri\": \"spotify:track:4iV5W9uYEdYUVa79Axb7Rh\" },\n /// { \"uri\": \"spotify:track:1301WleyT98MSxVHPZCA6M\" }] }.\n /// A maximum of 100 objects can be sent at once.\n /// \n public PlaylistRemoveItemsRequest(IList tracks)\n {\n Ensure.ArgumentNotNullOrEmptyList(tracks, nameof(tracks));\n\n Tracks = tracks;\n }\n\n /// \n /// An array of objects containing Spotify URIs of the tracks or episodes to remove.\n /// For example: { \"tracks\": [{ \"uri\": \"spotify:track:4iV5W9uYEdYUVa79Axb7Rh\" },\n /// { \"uri\": \"spotify:track:1301WleyT98MSxVHPZCA6M\" }] }.\n /// A maximum of 100 objects can be sent at once.\n /// \n /// \n [BodyParam(\"tracks\")]\n public IList Tracks { get; }\n\n /// \n /// The playlist’s snapshot ID against which you want to make the changes.\n /// The API will validate that the specified items exist and in the specified positions and make the changes,\n /// even if more recent changes have been made to the playlist.\n /// \n /// \n [BodyParam(\"snapshot_id\")]\n public string? SnapshotId { get; set; }\n\n [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1034\")]\n public class Item\n {\n [JsonProperty(\"uri\", NullValueHandling = NullValueHandling.Ignore)]\n public string? Uri { get; set; }\n\n [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \"CA2227\")]\n [JsonProperty(\"positions\", NullValueHandling = NullValueHandling.Ignore)]\n public List? Positions { get; set; }\n }\n }\n}\n\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671989,"cells":{"commit":{"kind":"string","value":"b8e1d50d0dc82932579020b832a1603920bce1a9"},"subject":{"kind":"string","value":"Add Timeout"},"repos":{"kind":"string","value":"maxpiva/Nancy.Rest.Annotations"},"old_file":{"kind":"string","value":"Atributes/Rest.cs"},"new_file":{"kind":"string","value":"Atributes/Rest.cs"},"new_contents":{"kind":"string","value":"using System;\nusing Nancy.Rest.Annotations.Enums;\n\nnamespace Nancy.Rest.Annotations.Atributes\n{\n [AttributeUsage(AttributeTargets.Method)]\n public class Rest : Attribute\n {\n public Verbs Verb { get; set; }\n public string Route { get; set; }\n public string ResponseContentType { get; set; }\n public int TimeOutSeconds { get; set; }\n\n public Rest(string route, Verbs verb, string contentype = null, int timeOutSeconds = 0)\n {\n Verb = verb;\n Route = route;\n ResponseContentType = contentype;\n TimeOutSeconds = timeOutSeconds;\n }\n }\n}\n"},"old_contents":{"kind":"string","value":"using System;\nusing Nancy.Rest.Annotations.Enums;\n\nnamespace Nancy.Rest.Annotations.Atributes\n{\n [AttributeUsage(AttributeTargets.Method)]\n public class Rest : Attribute\n {\n public Verbs Verb { get; set; }\n public string Route { get; set; }\n public string ResponseContentType { get; set; }\n\n public Rest(string route, Verbs verb, string contentype = null)\n {\n Verb = verb;\n Route = route;\n ResponseContentType = contentype;\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671990,"cells":{"commit":{"kind":"string","value":"39cfe75b9c2857f54b67fbb2aee1971bdece8cd3"},"subject":{"kind":"string","value":"Fix typo in OnboardingRead and add SettlementsRead"},"repos":{"kind":"string","value":"Viincenttt/MollieApi,Viincenttt/MollieApi"},"old_file":{"kind":"string","value":"Mollie.Api/Models/Connect/AppPermissions.cs"},"new_file":{"kind":"string","value":"Mollie.Api/Models/Connect/AppPermissions.cs"},"new_contents":{"kind":"string","value":"namespace Mollie.Api.Models.Connect {\n public static class AppPermissions {\n public const string PaymentsRead = \"payments.read\";\n public const string PaymentsWrite = \"payments.write\";\n public const string RefundsRead = \"refunds.read\";\n public const string RefundsWrite = \"refunds.write\";\n public const string CustomersRead = \"customers.read\";\n public const string CustomersWrite = \"customers.write\";\n public const string MandatesRead = \"mandates.read\";\n public const string MandatesWrite = \"mandates.write\";\n public const string SubscriptionsRead = \"subscriptions.read\";\n public const string SubscriptionsWrite = \"subscriptions.write\";\n public const string ProfilesRead = \"profiles.read\";\n public const string ProfilesWrite = \"profiles.write\";\n public const string InvoicesRead = \"invoices.read\";\n public const string OrdersRead = \"orders.read\";\n public const string OrdersWrite = \"orders.write\";\n public const string ShipmentsRead = \"shipments.read\";\n public const string ShipmentsWrite = \"shipments.write\";\n public const string OrganizationRead = \"organizations.read\";\n public const string OrganizationWrite = \"organizations.write\";\n public const string OnboardingRead = \"onboarding.read\";\n public const string OnboardingWrite = \"onboarding.write\";\n public const string SettlementsRead = \"settlements.read\";\n }\n}\n"},"old_contents":{"kind":"string","value":"namespace Mollie.Api.Models.Connect {\n public static class AppPermissions {\n public const string PaymentsRead = \"payments.read\";\n public const string PaymentsWrite = \"payments.write\";\n public const string RefundsRead = \"refunds.read\";\n public const string RefundsWrite = \"refunds.write\";\n public const string CustomersRead = \"customers.read\";\n public const string CustomersWrite = \"customers.write\";\n public const string MandatesRead = \"mandates.read\";\n public const string MandatesWrite = \"mandates.write\";\n public const string SubscriptionsRead = \"subscriptions.read\";\n public const string SubscriptionsWrite = \"subscriptions.write\";\n public const string ProfilesRead = \"profiles.read\";\n public const string ProfilesWrite = \"profiles.write\";\n public const string InvoicesRead = \"invoices.read\";\n public const string OrdersRead = \"orders.read\";\n public const string OrdersWrite = \"orders.write\";\n public const string ShipmentsRead = \"shipments.read\";\n public const string ShipmentsWrite = \"shipments.write\";\n public const string OrganizationRead = \"organizations.read\";\n public const string OrganizationWrite = \"organizations.write\";\n public const string OnboardingRead = \"onboarding.write\";\n public const string OnboardingWrite = \"onboarding.write\";\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671991,"cells":{"commit":{"kind":"string","value":"c14923f50b7de89b77ff324e85966542bc39e64b"},"subject":{"kind":"string","value":"add top script section in layout"},"repos":{"kind":"string","value":"mruhul/workshop-carsales-web-mvc,mruhul/workshop-carsales-web-mvc"},"old_file":{"kind":"string","value":"Src/Carsales.Web/Features/Shared/Views/_Layout.cshtml"},"new_file":{"kind":"string","value":"Src/Carsales.Web/Features/Shared/Views/_Layout.cshtml"},"new_contents":{"kind":"string","value":"@{\n Layout = \"~/Features/Shared/Views/_LayoutBasic.cshtml\";\n}\n@if (IsSectionDefined(\"Head\"))\n{\n @RenderSection(\"Head\")\n}\n@if (IsSectionDefined(\"Styles\"))\n{\n @RenderSection(\"Styles\")\n}\n@if (IsSectionDefined(\"TopScripts\"))\n{\n @RenderSection(\"TopScripts\")\n}\n@{\n Html.RenderPartial(\"_Header\");\n}\n
\n @RenderBody()\n
\n@{\n Html.RenderPartial(\"_Footer\");\n}\n@if (IsSectionDefined(\"BottomScript\"))\n{\n @RenderSection(\"BottomScript\")\n}"},"old_contents":{"kind":"string","value":"@{\n Layout = \"~/Features/Shared/Views/_LayoutBasic.cshtml\";\n}\n@if (IsSectionDefined(\"Head\"))\n{\n @RenderSection(\"Head\")\n}\n@if (IsSectionDefined(\"Styles\"))\n{\n @RenderSection(\"Styles\")\n}\n@{\n Html.RenderPartial(\"_Header\");\n}\n
\n @RenderBody()\n
\n@{\n Html.RenderPartial(\"_Footer\");\n}\n@if (IsSectionDefined(\"BottomScript\"))\n{\n @RenderSection(\"BottomScript\")\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671992,"cells":{"commit":{"kind":"string","value":"ed7382495a1b6608b108eb60c9507e2f6eec70b0"},"subject":{"kind":"string","value":"Use BinaryReferenceAdapter"},"repos":{"kind":"string","value":"BenPhegan/NuGet.Extensions"},"old_file":{"kind":"string","value":"NuGet.Extensions/Commands/ProjectAdapter.cs"},"new_file":{"kind":"string","value":"NuGet.Extensions/Commands/ProjectAdapter.cs"},"new_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Microsoft.Build.Evaluation;\n\nnamespace NuGet.Extensions.Commands\n{\n public class ProjectAdapter : IProjectAdapter\n {\n private readonly Project _project;\n private readonly string _packagesConfigFilename;\n\n public ProjectAdapter(Project project, string packagesConfigFilename)\n {\n _project = project;\n _packagesConfigFilename = packagesConfigFilename;\n }\n\n public ICollection GetBinaryReferences()\n {\n return _project.GetItems(\"Reference\");\n }\n\n public string GetAssemblyName()\n {\n return _project.GetPropertyValue(\"AssemblyName\");\n }\n\n public void Save()\n {\n _project.Save();\n }\n\n public void AddPackagesConfig()\n { //Add the packages.config to the project content, otherwise later versions of the VSIX fail...\n if (!HasPackagesConfig())\n {\n _project.Xml.AddItemGroup().AddItem(\"None\", _packagesConfigFilename);\n Save();\n }\n }\n\n private bool HasPackagesConfig()\n {\n return _project.GetItems(\"None\").Any(i => i.UnevaluatedInclude.Equals(_packagesConfigFilename));\n }\n\n public static List GetReferencedAssemblies(ICollection references)\n {\n var referenceFiles = new List();\n\n foreach (var reference in references.Select(r => new BinaryReferenceAdapter(r)))\n {\n //TODO deal with GAC assemblies that we want to replace as well....\n if (reference.HasHintPath())\n {\n var hintPath = reference.GetHintPath();\n referenceFiles.Add(Path.GetFileName(hintPath));\n }\n }\n return referenceFiles;\n }\n }\n}"},"old_contents":{"kind":"string","value":"using System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Microsoft.Build.Evaluation;\n\nnamespace NuGet.Extensions.Commands\n{\n public class ProjectAdapter : IProjectAdapter\n {\n private readonly Project _project;\n private readonly string _packagesConfigFilename;\n\n public ProjectAdapter(Project project, string packagesConfigFilename)\n {\n _project = project;\n _packagesConfigFilename = packagesConfigFilename;\n }\n\n public ICollection GetBinaryReferences()\n {\n return _project.GetItems(\"Reference\");\n }\n\n public string GetAssemblyName()\n {\n return _project.GetPropertyValue(\"AssemblyName\");\n }\n\n public void Save()\n {\n _project.Save();\n }\n\n public void AddPackagesConfig()\n { //Add the packages.config to the project content, otherwise later versions of the VSIX fail...\n if (!HasPackagesConfig())\n {\n _project.Xml.AddItemGroup().AddItem(\"None\", _packagesConfigFilename);\n Save();\n }\n }\n\n private bool HasPackagesConfig()\n {\n return _project.GetItems(\"None\").Any(i => i.UnevaluatedInclude.Equals(_packagesConfigFilename));\n }\n\n public static List GetReferencedAssemblies(IEnumerable references)\n {\n var referenceFiles = new List();\n\n foreach (ProjectItem reference in references)\n {\n //TODO deal with GAC assemblies that we want to replace as well....\n if (reference.HasMetadata(\"HintPath\"))\n {\n var hintPath = reference.GetMetadataValue(\"HintPath\");\n referenceFiles.Add(Path.GetFileName(hintPath));\n }\n }\n return referenceFiles;\n }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671993,"cells":{"commit":{"kind":"string","value":"c420f373a5ddc8050a2d3f419282feb2c41326fa"},"subject":{"kind":"string","value":"Add warning message to ensure user is running the Azure Emulator"},"repos":{"kind":"string","value":"endjin/Endjin.Cancelable,endjin/Endjin.Cancelable"},"old_file":{"kind":"string","value":"Solutions/Endjin.Cancelable.Demo/Program.cs"},"new_file":{"kind":"string","value":"Solutions/Endjin.Cancelable.Demo/Program.cs"},"new_contents":{"kind":"string","value":"namespace Endjin.Cancelable.Demo\n{\n #region Using Directives\n\n using System;\n using System.Threading;\n using System.Threading.Tasks;\n\n using Endjin.Contracts;\n using Endjin.Core.Composition;\n using Endjin.Core.Container;\n\n #endregion\n\n public class Program\n {\n public static void Main(string[] args)\n {\n Console.BackgroundColor = ConsoleColor.Red;\n Console.WriteLine(\"Ensure you are running the Azure Storage Emulator!\");\n Console.ResetColor();\n\n ApplicationServiceLocator.InitializeAsync(new Container(), new DesktopBootstrapper()).Wait();\n\n var cancelable = ApplicationServiceLocator.Container.Resolve();\n var cancellationToken = \"E75FF4F5-755E-4FB9-ABE0-24BD81F4D045\";\n\n cancelable.CreateToken(cancellationToken);\n cancelable.RunUntilCompleteOrCancelledAsync(DoSomethingLongRunningAsync, cancellationToken).Wait();\n\n Console.WriteLine(\"Press Any Key to Exit!\");\n Console.ReadKey();\n }\n\n private static async Task DoSomethingLongRunningAsync(CancellationToken cancellationToken)\n {\n int counter = 0;\n\n while (!cancellationToken.IsCancellationRequested)\n {\n Console.WriteLine(\"Doing something {0}\", DateTime.Now.ToString(\"T\"));\n \n await Task.Delay(TimeSpan.FromSeconds(1));\n counter++;\n\n if (counter == 15)\n {\n Console.WriteLine(\"Long Running Process Ran to Completion!\");\n break;\n }\n }\n\n if (cancellationToken.IsCancellationRequested)\n {\n Console.WriteLine(\"Long Running Process was Cancelled!\");\n }\n }\n }\n}"},"old_contents":{"kind":"string","value":"namespace Endjin.Cancelable.Demo\n{\n #region Using Directives\n\n using System;\n using System.Threading;\n using System.Threading.Tasks;\n\n using Endjin.Contracts;\n using Endjin.Core.Composition;\n using Endjin.Core.Container;\n\n #endregion\n\n public class Program\n {\n public static void Main(string[] args)\n {\n ApplicationServiceLocator.InitializeAsync(new Container(), new DesktopBootstrapper()).Wait();\n\n var cancelable = ApplicationServiceLocator.Container.Resolve();\n var cancellationToken = \"E75FF4F5-755E-4FB9-ABE0-24BD81F4D045\";\n\n cancelable.CreateToken(cancellationToken);\n\n cancelable.RunUntilCompleteOrCancelledAsync(DoSomethingLongRunningAsync, cancellationToken).Wait();\n\n Console.WriteLine(\"Press Any Key to Exit!\");\n Console.ReadKey();\n }\n\n private static async Task DoSomethingLongRunningAsync(CancellationToken cancellationToken)\n {\n int counter = 0;\n while (!cancellationToken.IsCancellationRequested)\n {\n Console.WriteLine(\"Doing something {0}\", DateTime.Now.ToString(\"T\"));\n \n await Task.Delay(TimeSpan.FromSeconds(1));\n counter++;\n\n if (counter == 15)\n {\n Console.WriteLine(\"Long Running Process Ran to Completion!\");\n break;\n }\n }\n\n if (cancellationToken.IsCancellationRequested)\n {\n Console.WriteLine(\"Long Running Process was Cancelled!\");\n }\n }\n }\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671994,"cells":{"commit":{"kind":"string","value":"9fff029b1be5ab035306d41c31026ba402e17735"},"subject":{"kind":"string","value":"Fix formating"},"repos":{"kind":"string","value":"wojtpl2/ExtendedXmlSerializer,wojtpl2/ExtendedXmlSerializer"},"old_file":{"kind":"string","value":"test/ExtendedXmlSerializer.Tests.Performance/LegacyExtendedXmlSerializerTest.cs"},"new_file":{"kind":"string","value":"test/ExtendedXmlSerializer.Tests.Performance/LegacyExtendedXmlSerializerTest.cs"},"new_contents":{"kind":"string","value":"// MIT License\n//\n// Copyright (c) 2016-2018 Wojciech Nagórski\n// Michael DeMond\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nusing BenchmarkDotNet.Attributes;\nusing ExtendedXmlSerializer.Tests.Performance.Model;\n\nnamespace ExtendedXmlSerializer.Tests.Performance\n{\n [ShortRunJob]\n [MemoryDiagnoser]\n\tpublic class LegacyExtendedXmlSerializerTest\n\t{\n\t\treadonly TestClassOtherClass _obj = new TestClassOtherClass();\n\t\treadonly string _xml;\n#pragma warning disable 618\n\t\treadonly ExtendedXmlSerialization.IExtendedXmlSerializer _serializer =\n\t\t\tnew ExtendedXmlSerialization.ExtendedXmlSerializer();\n#pragma warning restore 618\n\n\t\tpublic LegacyExtendedXmlSerializerTest()\n\t\t{\n\t\t\t_obj.Init();\n\t\t\t_xml = SerializationClassWithPrimitive();\n\t\t\tDeserializationClassWithPrimitive();\n\t\t}\n\n\t\t[Benchmark]\n\t\tpublic string SerializationClassWithPrimitive() => _serializer.Serialize(_obj);\n\n\t\t[Benchmark]\n\t\tpublic TestClassOtherClass DeserializationClassWithPrimitive() => _serializer.Deserialize(_xml);\n\t}\n}"},"old_contents":{"kind":"string","value":"// MIT License\n//\n// Copyright (c) 2016-2018 Wojciech Nagórski\n// Michael DeMond\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nusing BenchmarkDotNet.Attributes;\nusing ExtendedXmlSerializer.Tests.Performance.Model;\n\nnamespace ExtendedXmlSerializer.Tests.Performance\n{\n\t[ShortRunJob]\n [MemoryDiagnoser]\n\tpublic class LegacyExtendedXmlSerializerTest\n\t{\n\t\treadonly TestClassOtherClass _obj = new TestClassOtherClass();\n\t\treadonly string _xml;\n#pragma warning disable 618\n\t\treadonly ExtendedXmlSerialization.IExtendedXmlSerializer _serializer =\n\t\t\tnew ExtendedXmlSerialization.ExtendedXmlSerializer();\n#pragma warning restore 618\n\n\t\tpublic LegacyExtendedXmlSerializerTest()\n\t\t{\n\t\t\t_obj.Init();\n\t\t\t_xml = SerializationClassWithPrimitive();\n\t\t\tDeserializationClassWithPrimitive();\n\t\t}\n\n\t\t[Benchmark]\n\t\tpublic string SerializationClassWithPrimitive() => _serializer.Serialize(_obj);\n\n\t\t[Benchmark]\n\t\tpublic TestClassOtherClass DeserializationClassWithPrimitive() => _serializer.Deserialize(_xml);\n\t}\n}"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671995,"cells":{"commit":{"kind":"string","value":"c564dbfee18223c073e2394751f61392253a0805"},"subject":{"kind":"string","value":"Update Account.cs"},"repos":{"kind":"string","value":"minhjemmesiden/Wakfusharp"},"old_file":{"kind":"string","value":"Database/Models/Account.cs"},"new_file":{"kind":"string","value":"Database/Models/Account.cs"},"new_contents":{"kind":"string","value":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\n\r\nusing MySql.Data.MySqlClient;\r\n\r\nnamespace WakSharp.Database.Models\r\n{\r\n public class Account : Interfaces.IIdentificable\r\n {\r\n public int ID { get; set; }\r\n public string Username { get; set; }\r\n public string Password { get; set; }\r\n public string Pseudo { get; set; }\r\n public int Rank { get; set; }\r\n public string SecretQuestion { get; set; }\r\n public string SecretAnswer { get; set; }\r\n\r\n public static Account FindOne(string username)\r\n {\r\n Account account = null;\r\n var command = new MySqlCommand(\"SELECT * FROM accounts WHERE username=@username\", DatabaseManager.Connection);\r\n command.Parameters.Add(new MySqlParameter(\"@username\", username));\r\n var reader = command.ExecuteReader();\r\n if (reader.Read())\r\n {\r\n account = new Account()\r\n {\r\n ID = Int32.Parse(\"10\"),\r\n Username = \"admin\",\r\n Password = \"admin\",\r\n Pseudo = \"\",\r\n Rank = Int32.Parse(\"1\"),\r\n SecretQuestion = \"lol\",\r\n SecretAnswer = \"lol\",\r\n /*ID = reader.GetInt32(\"id\"),\r\n Username = reader.GetString(\"username\"),\r\n Password = reader.GetString(\"password\"),\r\n Pseudo = reader.GetString(\"pseudo\"),\r\n Rank = reader.GetInt32(\"rank\"),\r\n SecretQuestion = reader.GetString(\"secret_question\"),\r\n SecretAnswer = reader.GetString(\"secret_answer\"),*/\r\n\r\n\r\n };\r\n }\r\n reader.Close();\r\n return account;\r\n }\r\n\r\n public bool IsOp()\r\n {\r\n return this.Rank > 0;\r\n }\r\n }\r\n}\r\n"},"old_contents":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nusing MySql.Data.MySqlClient;\n\nnamespace WakSharp.Database.Models\n{\n public class Account : Interfaces.IIdentificable\n {\n public int ID { get; set; }\n public string Username { get; set; }\n public string Password { get; set; }\n public string Pseudo { get; set; }\n public int Rank { get; set; }\n public string SecretQuestion { get; set; }\n public string SecretAnswer { get; set; }\n\n public static Account FindOne(string username)\n {\n Account account = null;\n var command = new MySqlCommand(\"SELECT * FROM accounts WHERE username=@username\", DatabaseManager.Connection);\n command.Parameters.Add(new MySqlParameter(\"@username\", username));\n var reader = command.ExecuteReader();\n if (reader.Read())\n {\n account = new Account()\n {\n ID = Int32.Parse(\"10\"),\r\n Username = \"spil778\",\r\n Password = \"czu26ueh\",\r\n Pseudo = \"\",\r\n Rank = Int32.Parse(\"1\"),\r\n SecretQuestion = \"lol\",\r\n SecretAnswer = \"lol\",\r\n /*ID = reader.GetInt32(\"id\"),\r\n Username = reader.GetString(\"username\"),\r\n Password = reader.GetString(\"password\"),\r\n Pseudo = reader.GetString(\"pseudo\"),\r\n Rank = reader.GetInt32(\"rank\"),\r\n SecretQuestion = reader.GetString(\"secret_question\"),\r\n SecretAnswer = reader.GetString(\"secret_answer\"),*/\r\n\r\n\r\n };\n }\n reader.Close();\n return account;\n }\n\n public bool IsOp()\n {\n return this.Rank > 0;\n }\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671996,"cells":{"commit":{"kind":"string","value":"9c13ce4f12dc74684255551f3041a5e7d57d32ea"},"subject":{"kind":"string","value":"Add script to rotate camera"},"repos":{"kind":"string","value":"LucasBocanegra/unit-maze"},"old_file":{"kind":"string","value":"Assets/Scripts/CameraController.cs"},"new_file":{"kind":"string","value":"Assets/Scripts/CameraController.cs"},"new_contents":{"kind":"string","value":"using UnityEngine;\nusing System.Collections;\n\npublic class CameraController : MonoBehaviour\n{\n\tpublic GameObject player;\n\tfloat speed = 10f;\n\tprivate Vector3 offset;\n\n\tvoid Start()\n\t{\n\t\ttransform.rotation = Quaternion.Euler(0, 0, 0);\n\t\tplayer.transform.rotation = Quaternion.Euler(0, (180), 0);\n\n\t\toffset = transform.position - player.transform.position;\n\t}\n\n\tvoid LateUpdate()\n\t{\n\n\t\ttransform.position = player.transform.position;\n\t\tif (Input.GetKey(KeyCode.Q))\n\t\t{\n\t\t\tfloat my_y = transform.rotation.eulerAngles.y;\n\t\t\ttransform.rotation = Quaternion.Euler(0, (my_y - 5), 0);\n\t\t\tplayer.transform.rotation = Quaternion.Euler(0, (my_y - 5), 0);\n\t\t}\n\n\t\tif (Input.GetKey(KeyCode.E))\n\t\t{\n\t\t\tfloat my_y = transform.rotation.eulerAngles.y;\n\t\t\ttransform.rotation = Quaternion.Euler(0, (my_y + 5), 0);\n\t\t\tplayer.transform.rotation = Quaternion.Euler(0, (my_y - 5), 0);\n\n\t\t}\n\n\t}\n}\n\n"},"old_contents":{"kind":"string","value":"using UnityEngine;\nusing System.Collections;\n\npublic class CameraController : MonoBehaviour\n{\n\n\tpublic GameObject player;\n float speed = 2f; //10f;\n\tprivate Vector3 offset;\n\n\tvoid Start()\n\t{\n\t\toffset = transform.position - player.transform.position;\n }\n\n //private float speed = 2.0f;\n /* void Update()\n {\n\n if (Input.GetKey(KeyCode.RightArrow))\n {\n transform.position += Vector3.right * speed * Time.deltaTime;\n }\n if (Input.GetKey(KeyCode.LeftArrow))\n {\n transform.position += Vector3.left * speed * Time.deltaTime;\n }\n if (Input.GetKey(KeyCode.UpArrow))\n {\n transform.position += Vector3.forward * speed * Time.deltaTime;\n }\n if (Input.GetKey(KeyCode.DownArrow))\n {\n transform.position += Vector3.back * speed * Time.deltaTime;\n }\n }*/\n\n public float minX = -360.0f;\n public float maxX = 360.0f;\n\n public float minY = -45.0f;\n public float maxY = 45.0f;\n\n public float sensX = 500.0f;\n public float sensY = 500.0f;\n\n float rotationY = 0.0f;\n float rotationX = 0.0f;\n\n void LateUpdate()\n\t{\n transform.position = player.transform.position;\n\n /*\n // Andar com a camera (independente do objeto) \n if (Input.GetKey(KeyCode.RightArrow))\n {\n transform.position += Vector3.right * speed * Time.deltaTime;\n }\n if (Input.GetKey(KeyCode.LeftArrow))\n {\n transform.position += Vector3.left * speed * Time.deltaTime;\n }\n if (Input.GetKey(KeyCode.UpArrow))\n {\n transform.position += Vector3.forward * speed * Time.deltaTime;\n }\n if (Input.GetKey(KeyCode.DownArrow))\n {\n transform.position += Vector3.back * speed * Time.deltaTime;\n }\n\n // Girar a camera\n if (Input.GetMouseButton(0))\n {\n rotationX += Input.GetAxis(\"Mouse X\") * sensX * Time.deltaTime;\n rotationY += Input.GetAxis(\"Mouse Y\") * sensY * Time.deltaTime;\n rotationY = Mathf.Clamp(rotationY, minY, maxY);\n transform.localEulerAngles = new Vector3(-rotationY, rotationX, 0);\n }*/\n }\n}\n\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671997,"cells":{"commit":{"kind":"string","value":"db23c75a04eb6433f06485e0330150a9f5313f14"},"subject":{"kind":"string","value":"Fix Climb -> Ladder"},"repos":{"kind":"string","value":"bunashibu/kikan"},"old_file":{"kind":"string","value":"Assets/Scripts/SyncBattlePlayer.cs"},"new_file":{"kind":"string","value":"Assets/Scripts/SyncBattlePlayer.cs"},"new_contents":{"kind":"string","value":"using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\nnamespace Bunashibu.Kikan {\n public class SyncBattlePlayer : MonoBehaviour {\n void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) {\n if (stream.isWriting) {\n stream.SendNext(_renderer.flipX);\n stream.SendNext(_anim.GetBool(\"Idle\" ));\n stream.SendNext(_anim.GetBool(\"Fall\" ));\n stream.SendNext(_anim.GetBool(\"Walk\" ));\n stream.SendNext(_anim.GetBool(\"Ladder\" ));\n stream.SendNext(_anim.GetBool(\"LieDown\" ));\n stream.SendNext(_anim.GetBool(\"GroundJump\" ));\n stream.SendNext(_anim.GetBool(\"LadderJump\" ));\n stream.SendNext(_anim.GetBool(\"Skill\" ));\n stream.SendNext(_anim.GetBool(\"Die\" ));\n } else {\n _renderer.flipX = (bool)stream.ReceiveNext();\n _anim.SetBool(\"Idle\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"Fall\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"Walk\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"Ladder\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"LieDown\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"GroundJump\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"LadderJump\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"Skill\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"Die\" , (bool)stream.ReceiveNext());\n }\n }\n\n [SerializeField] private SpriteRenderer _renderer;\n [SerializeField] private Animator _anim;\n }\n}\n\n"},"old_contents":{"kind":"string","value":"using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\nnamespace Bunashibu.Kikan {\n public class SyncBattlePlayer : MonoBehaviour {\n void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) {\n if (stream.isWriting) {\n stream.SendNext(_renderer.flipX);\n stream.SendNext(_anim.GetBool(\"Idle\" ));\n stream.SendNext(_anim.GetBool(\"Fall\" ));\n stream.SendNext(_anim.GetBool(\"Walk\" ));\n stream.SendNext(_anim.GetBool(\"Climb\" ));\n stream.SendNext(_anim.GetBool(\"LieDown\" ));\n stream.SendNext(_anim.GetBool(\"GroundJump\" ));\n stream.SendNext(_anim.GetBool(\"ClimbJump\" ));\n stream.SendNext(_anim.GetBool(\"Skill\" ));\n stream.SendNext(_anim.GetBool(\"Die\" ));\n } else {\n _renderer.flipX = (bool)stream.ReceiveNext();\n _anim.SetBool(\"Idle\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"Fall\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"Walk\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"Climb\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"LieDown\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"GroundJump\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"ClimbJump\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"Skill\" , (bool)stream.ReceiveNext());\n _anim.SetBool(\"Die\" , (bool)stream.ReceiveNext());\n }\n }\n\n [SerializeField] private SpriteRenderer _renderer;\n [SerializeField] private Animator _anim;\n }\n}\n\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671998,"cells":{"commit":{"kind":"string","value":"d131cf24f0be5eb9c79c7eaa7e390b78a9303b7c"},"subject":{"kind":"string","value":"Add input param. logger and get test string from cmd line"},"repos":{"kind":"string","value":"davidebbo/OutgoingHttpRequestWebJobsExtension"},"old_file":{"kind":"string","value":"ExtensionSample/Program.cs"},"new_file":{"kind":"string","value":"ExtensionSample/Program.cs"},"new_contents":{"kind":"string","value":"// Copyright (c) .NET Foundation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n\nusing System.Collections.Generic;\nusing System.IO;\nusing Microsoft.Azure.WebJobs;\nusing OutgoingHttpRequestWebJobsExtension;\n\nnamespace ExtensionsSample\n{\n public static class Program\n {\n public static void Main(string[] args)\n {\n string inputString = args.Length > 0 ? args[0] : \"Some test string\";\n\n var config = new JobHostConfiguration();\n\n config.UseDevelopmentSettings();\n\n config.UseOutgoingHttpRequests();\n\n var host = new JobHost(config);\n var method = typeof(Program).GetMethod(\"MyCoolMethod\");\n host.Call(method, new Dictionary\n {\n {\"input\", inputString }\n });\n }\n\n public static void MyCoolMethod(\n string input,\n [OutgoingHttpRequest(@\"http://requestb.in/19xvbmc1\")] TextWriter writer,\n TextWriter logger)\n {\n logger.Write(input);\n writer.Write(input);\n }\n }\n}"},"old_contents":{"kind":"string","value":"// Copyright (c) .NET Foundation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n\nusing System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Net.Mail;\nusing Microsoft.Azure.WebJobs;\nusing Microsoft.Azure.WebJobs.Extensions;\nusing Microsoft.Azure.WebJobs.Host;\nusing OutgoingHttpRequestWebJobsExtension;\n\nnamespace ExtensionsSample\n{\n public static class Program\n {\n public static void Main(string[] args)\n {\n var config = new JobHostConfiguration();\n\n config.UseDevelopmentSettings();\n\n config.UseOutgoingHttpRequests();\n\n var host = new JobHost(config);\n var method = typeof(Program).GetMethod(\"MyCoolMethod\");\n host.Call(method);\n }\n\n public static void MyCoolMethod(\n [OutgoingHttpRequest(@\"http://requestb.in/19xvbmc1\")] TextWriter writer)\n {\n writer.Write(\"Test sring sent to OutgoingHttpRequest!\");\n }\n }\n}"},"license":{"kind":"string","value":"apache-2.0"},"lang":{"kind":"string","value":"C#"}}},{"rowIdx":2671999,"cells":{"commit":{"kind":"string","value":"855e6642449e261f8484ab40b4af28790328c082"},"subject":{"kind":"string","value":"Add IEquatable"},"repos":{"kind":"string","value":"peppy/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,peppy/osu-framework"},"old_file":{"kind":"string","value":"osu.Framework/Graphics/Colour/Colour4.cs"},"new_file":{"kind":"string","value":"osu.Framework/Graphics/Colour/Colour4.cs"},"new_contents":{"kind":"string","value":"// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.\n// See the LICENCE file in the repository root for full licence text.\n\nusing System;\n\nnamespace osu.Framework.Graphics.Colour\n{\n public readonly struct Colour4 : IEquatable\n {\n /// \n /// Represents the red component of the linear RGBA colour in the 0-1 range.\n /// \n public readonly float R;\n\n /// \n /// Represents the green component of the linear RGBA colour in the 0-1 range.\n /// \n public readonly float G;\n\n /// \n /// Represents the blue component of the linear RGBA colour in the 0-1 range.\n /// \n public readonly float B;\n\n /// \n /// Represents the alpha component of the RGBA colour in the 0-1 range.\n /// \n public readonly float A;\n\n #region Constructors\n\n public Colour4(float r, float g, float b, float a)\n {\n R = r;\n G = g;\n B = b;\n A = a;\n }\n\n public Colour4(byte r, byte g, byte b, byte a)\n {\n R = r / (float)byte.MaxValue;\n G = g / (float)byte.MaxValue;\n B = b / (float)byte.MaxValue;\n A = a / (float)byte.MaxValue;\n }\n\n #endregion\n\n #region Operator Overloads\n\n public static Colour4 operator *(Colour4 first, Colour4 second) =>\n new Colour4(first.R * second.R, first.G * second.G, first.B * second.B, first.A * second.A);\n\n public static Colour4 operator +(Colour4 first, Colour4 second) =>\n new Colour4(first.R + second.R, first.G + second.G, first.B + second.B, first.A + second.A);\n\n public static Colour4 operator *(Colour4 first, float second) =>\n new Colour4(first.R * second, first.G * second, first.B * second, first.A * second);\n\n public static Colour4 operator /(Colour4 first, float second) => first * (1 / second);\n\n #endregion\n\n #region Equality\n\n public bool Equals(Colour4 other) =>\n R.Equals(other.R) && G.Equals(other.G) && B.Equals(other.B) && A.Equals(other.A);\n\n public override bool Equals(object obj) =>\n obj is Colour4 other && Equals(other);\n\n public override int GetHashCode() => HashCode.Combine(R, G, B, A);\n\n #endregion\n\n public override string ToString() => $\"(R, G, B, A) = ({R:F}, {G:F}, {B:F}, {A:F})\";\n }\n}\n"},"old_contents":{"kind":"string","value":"// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.\n// See the LICENCE file in the repository root for full licence text.\n\nnamespace osu.Framework.Graphics.Colour\n{\n public readonly struct Colour4\n {\n /// \n /// Represents the red component of the linear RGBA colour in the 0-1 range.\n /// \n public readonly float R;\n\n /// \n /// Represents the green component of the linear RGBA colour in the 0-1 range.\n /// \n public readonly float G;\n\n /// \n /// Represents the blue component of the linear RGBA colour in the 0-1 range.\n /// \n public readonly float B;\n\n /// \n /// Represents the alpha component of the RGBA colour in the 0-1 range.\n /// \n public readonly float A;\n\n #region Constructors\n\n public Colour4(float r, float g, float b, float a)\n {\n R = r;\n G = g;\n B = b;\n A = a;\n }\n\n public Colour4(byte r, byte g, byte b, byte a)\n {\n R = r / (float)byte.MaxValue;\n G = g / (float)byte.MaxValue;\n B = b / (float)byte.MaxValue;\n A = a / (float)byte.MaxValue;\n }\n\n #endregion\n\n #region Operator Overloads\n\n public static Colour4 operator *(Colour4 first, Colour4 second) =>\n new Colour4(first.R * second.R, first.G * second.G, first.B * second.B, first.A * second.A);\n\n public static Colour4 operator +(Colour4 first, Colour4 second) =>\n new Colour4(first.R + second.R, first.G + second.G, first.B + second.B, first.A + second.A);\n\n public static Colour4 operator *(Colour4 first, float second) =>\n new Colour4(first.R * second, first.G * second, first.B * second, first.A * second);\n\n public static Colour4 operator /(Colour4 first, float second) => first * (1 / second);\n\n #endregion\n }\n}\n"},"license":{"kind":"string","value":"mit"},"lang":{"kind":"string","value":"C#"}}}],"truncated":false,"partial":false},"paginationData":{"pageIndex":26719,"numItemsPerPage":100,"numTotalItems":2673685,"offset":2671900,"length":100}},"jwt":"eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sImlhdCI6MTc1NjExMDcxNiwic3ViIjoiL2RhdGFzZXRzL2JpZ2NvZGUvY29tbWl0cy1jb2RlZ2VleCIsImV4cCI6MTc1NjExNDMxNiwiaXNzIjoiaHR0cHM6Ly9odWdnaW5nZmFjZS5jbyJ9.wlOuF4cDsDxA-dJhLT5YwYeXbRQae9MTEs0ca1VkP2SEJeDboe54H2k1nkFOMeb8Ob3oviUIaTHjh8i70gSmCg","displayUrls":true},"discussionsStats":{"closed":0,"open":0,"total":0},"fullWidth":true,"hasGatedAccess":true,"hasFullAccess":true,"isEmbedded":false,"savedQueries":{"community":[],"user":[]}}">
commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
b838d008875bdd4f50d706d57d79a27d885ca4ba
Change the AssemblyFileVersion for Ver 2.0 release.
xo-energy/dockpanelsuite,thijse/dockpanelsuite,compborg/dockpanelsuite,jorik041/dockpanelsuite,15070217668/dockpanelsuite,modulexcite/O2_Fork_dockpanelsuite,dockpanelsuite/dockpanelsuite,elnomade/dockpanelsuite,ArsenShnurkov/dockpanelsuite,transistor1/dockpanelsuite,Romout/dockpanelsuite,joelbyren/dockpanelsuite,15070217668/dockpanelsuite,shintadono/dockpanelsuite,RadarNyan/dockpanelsuite,rohitlodha/dockpanelsuite,angelapper/dockpanelsuite
WinFormsUI/Properties/AssemblyInfo.cs
WinFormsUI/Properties/AssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Diagnostics.CodeAnalysis; [assembly: AssemblyTitle("DockPanel Suite for .Net 2.0")] [assembly: AssemblyDescription(".Net Docking Library for Windows Forms")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Weifen Luo")] [assembly: AssemblyProduct("DockPanel Suite")] [assembly: AssemblyCopyright("Copyright © Weifen Luo 2007")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] [assembly: Guid("9d690ef9-ce19-4c69-874c-e24d8eb36aff")] [assembly: AssemblyVersion("2.0.*")] [assembly: AssemblyFileVersion("2.0.2.0")] [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Weifen")] [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Luo")] [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Weifen")] [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Luo")] [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Dockable")]
using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Diagnostics.CodeAnalysis; [assembly: AssemblyTitle("DockPanel Suite for .Net 2.0")] [assembly: AssemblyDescription(".Net Docking Library for Windows Forms")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Weifen Luo")] [assembly: AssemblyProduct("DockPanel Suite")] [assembly: AssemblyCopyright("Copyright © Weifen Luo 2007")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] [assembly: Guid("9d690ef9-ce19-4c69-874c-e24d8eb36aff")] [assembly: AssemblyVersion("2.0.*")] [assembly: AssemblyFileVersion("2.0.1.0")] [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Weifen")] [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Luo")] [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Weifen")] [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Luo")] [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Dockable")]
mit
C#
93f93ef9bb217b389076e5f10b8560cb63a4fbc9
Update build.cake (#958)
xamarin/XamarinComponents,xamarin/XamarinComponents,xamarin/XamarinComponents,xamarin/XamarinComponents,xamarin/XamarinComponents,xamarin/XamarinComponents
XPlat/ExposureNotification/build.cake
XPlat/ExposureNotification/build.cake
var TARGET = Argument("t", Argument("target", "ci")); var OUTPUT_PATH = (DirectoryPath)"./output/"; var NUGET_VERSION = "0.13.0-preview"; Task("nuget") .Does(() => { MSBuild($"./source/Xamarin.ExposureNotification/Xamarin.ExposureNotification.csproj", c => c .SetConfiguration("Release") .WithRestore() .WithTarget("Build") .WithTarget("Pack") .WithProperty("PackageVersion", NUGET_VERSION) .WithProperty("PackageOutputPath", MakeAbsolute(OUTPUT_PATH).FullPath)); }); Task("ci") .IsDependentOn("nuget"); RunTarget(TARGET);
var TARGET = Argument("t", Argument("target", "ci")); var OUTPUT_PATH = (DirectoryPath)"./output/"; var NUGET_VERSION = "0.12.0-preview"; Task("nuget") .Does(() => { MSBuild($"./source/Xamarin.ExposureNotification/Xamarin.ExposureNotification.csproj", c => c .SetConfiguration("Release") .WithRestore() .WithTarget("Build") .WithTarget("Pack") .WithProperty("PackageVersion", NUGET_VERSION) .WithProperty("PackageOutputPath", MakeAbsolute(OUTPUT_PATH).FullPath)); }); Task("ci") .IsDependentOn("nuget"); RunTarget(TARGET);
mit
C#
f7c11009278fd1766cb2b422349ea166100d9881
add loop using label
DasAllFolks/SharpGraphs
Graph/Graph.cs
Graph/Graph.cs
using System; using System.Collections.Generic; namespace Graph { public class Vertex { private bool hasLabel; private string label; public Vertex () { this.hasLabel = false; } public Vertex (string label) { this.Label = label; } // XXXX: Remind self how to link to private field? public bool HasLabel { get; set; } public string Label { get { if (!this.hasLabel) { throw NoLabelFoundException("This vertex is unlabeled."); } return this.label; } set { this.label = value; this.hasLabel = true; } } public void ClearLabel () { this.hasLabel = false; } public class NoLabelFoundException : Exception { } } public class Edge { // All Edge objects correspond to a directed (unidirectional) graph edge. // // An undirected edge should be represented using a pair of such (directed) // Edges. // // Under this system, loops and multigraphs are also automatically supported. // // Edges are Immutable after creation. private Vertex tail; private Vertex head; public Edge (Vertex tail, Vertex head) { this.tail = tail; this.head = head; } public Vertex Tail { get; } public Vertex Head { get; } } public class Graph { private HashSet<Graph.Vertex> vertices; private HashSet<Graph.Edge> edges; public Graph () { } // Use 0-based labeling by default for vertices added without an explicit label. // // If the auto-generated label is already in use, keep searching upward until we find the first integer // not taken for this purpose. public void AddVertex () { } public void AddVertex (int label) { this.vertices.Add (new Graph.Vertex((string) label)); } public void AddVertex (string label) { } // Add an edge using labels of existing vertices. public void AddDirectedEdge(string tailLabel, string headLabel) { } // Add an edge using two Vertex objects. public void AddUndirectedEdge(string label1, string label2) { this.AddDirectedEdge (label1, label2); this.AddDirectedEdge (label2, label1); } public void AddLoop(string label) { this.AddDirectedEdge (label, label); } }
using System; using System.Collections.Generic; namespace Graph { public class Vertex { private bool hasLabel; private string label; public Vertex () { this.hasLabel = false; } public Vertex (string label) { this.Label = label; } // XXXX: Remind self how to link to private field? public bool HasLabel { get; set; } public string Label { get { if (!this.hasLabel) { throw NoLabelFoundException("This vertex is unlabeled."); } return this.label; } set { this.label = value; this.hasLabel = true; } } public void ClearLabel () { this.hasLabel = false; } public class NoLabelFoundException : Exception { } } public class Edge { // All Edge objects correspond to a directed (unidirectional) graph edge. // // An undirected edge should be represented using a pair of such (directed) // Edges. // // Under this system, loops and multigraphs are also automatically supported. // // Edges are Immutable after creation. private Vertex tail; private Vertex head; public Edge (Vertex tail, Vertex head) { this.tail = tail; this.head = head; } public Vertex Tail { get; } public Vertex Head { get; } } public class Graph { private HashSet<Graph.Vertex> vertices; private HashSet<Graph.Edge> edges; public Graph () { } // Use 0-based labeling by default for vertices added without an explicit label. // // If the auto-generated label is already in use, keep searching upward until we find the first integer // not taken for this purpose. public void AddVertex () { } public void AddVertex (int label) { this.vertices.Add (new Graph.Vertex((string) label)); } public void AddVertex (string label) { } // Add an edge using labels of existing vertices. public void AddDirectedEdge(string tailLabel, string headLabel) { } // Add an edge using two Vertex objects. public void AddUndirectedEdge(string label1, string label2) { this.AddDirectedEdge (label1, label2); this.AddDirectedEdge (label2, label1); } }
apache-2.0
C#
f7ec23f7caaf09d710a9cc731baf71621166ea49
Update _Layout.cshtml
Telerik-Hackathon-2014/YourFood-WebAPI,Telerik-Hackathon-2014/YourFood-WebAPI
YourFood.Services/Views/Shared/_Layout.cshtml
YourFood.Services/Views/Shared/_Layout.cshtml
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("YourFood", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home", new { area = "" }, null)</li> <li><a href="https://github.com/Telerik-Hackathon-2014/YourFood-WebAPI/wiki/Routes" target="_blank">API</a></li> </ul> </div> </div> </div> <div class="container body-content"> @RenderBody() </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("YourFood", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home", new { area = "" }, null)</li> <li>@Html.ActionLink("API", "Index", "Help", new { area = "" }, null)</li> </ul> </div> </div> </div> <div class="container body-content"> @RenderBody() </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body> </html>
mit
C#
1565bd4a6a3de9309bdd4ce9f30a40776dc9a348
use default options
SimonCropp/NServiceBus.Jil
NServiceBus.Jil/JsonMessageSerializer.cs
NServiceBus.Jil/JsonMessageSerializer.cs
namespace NServiceBus.Jil { using System; using System.Collections.Generic; using System.IO; using System.Linq; using global::Jil; using NServiceBus.Serialization; /// <summary> /// JSON message serializer. /// </summary> public class JsonMessageSerializer : IMessageSerializer { /// <summary> /// Constructor. /// </summary> public JsonMessageSerializer() { Options = JSON.GetDefaultOptions(); } /// <summary> /// Serializes the given set of messages into the given stream. /// </summary> /// <param name="message">Message to serialize.</param> /// <param name="stream">Stream for <paramref name="message"/> to be serialized into.</param> public void Serialize(object message, Stream stream) { var streamWriter = new StreamWriter(stream); JSON.Serialize(message, streamWriter, Options); streamWriter.Flush(); } /// <summary> /// Deserializes from the given stream a set of messages. /// </summary> /// <param name="stream">Stream that contains messages.</param> /// <param name="messageTypes">The list of message types to deserialize. If null the types must be inferred from the serialized data.</param> /// <returns>Deserialized messages.</returns> public object[] Deserialize(Stream stream, IList<Type> messageTypes) { if (messageTypes.Count > 1) { throw new Exception("Batch messages are not supported. Feel free to send a Pull Request."); } var streamReader = new StreamReader(stream); return new[] { JSON.Deserialize(streamReader, messageTypes.First(), Options) }; } /// <summary> /// Gets the content type into which this serializer serializes the content to /// </summary> public string ContentType { get { return ContentTypes.Json; } } public Options Options { get; set; } } }
namespace NServiceBus.Jil { using System; using System.Collections.Generic; using System.IO; using System.Linq; using global::Jil; using NServiceBus.Serialization; /// <summary> /// JSON message serializer. /// </summary> public class JsonMessageSerializer : IMessageSerializer { /// <summary> /// Constructor. /// </summary> public JsonMessageSerializer() { Options = new Options(); } /// <summary> /// Serializes the given set of messages into the given stream. /// </summary> /// <param name="message">Message to serialize.</param> /// <param name="stream">Stream for <paramref name="message"/> to be serialized into.</param> public void Serialize(object message, Stream stream) { var streamWriter = new StreamWriter(stream); JSON.Serialize(message, streamWriter, Options); streamWriter.Flush(); } /// <summary> /// Deserializes from the given stream a set of messages. /// </summary> /// <param name="stream">Stream that contains messages.</param> /// <param name="messageTypes">The list of message types to deserialize. If null the types must be inferred from the serialized data.</param> /// <returns>Deserialized messages.</returns> public object[] Deserialize(Stream stream, IList<Type> messageTypes) { if (messageTypes.Count > 1) { throw new Exception("Batch messages are not supported. Feel free to send a Pull Request."); } var streamReader = new StreamReader(stream); return new[] { JSON.Deserialize(streamReader, messageTypes.First(), Options) }; } /// <summary> /// Gets the content type into which this serializer serializes the content to /// </summary> public string ContentType { get { return ContentTypes.Json; } } public Options Options { get; set; } } }
mit
C#
b3ebd76707f5eda6c7bbcd099b8b9b7c99356c45
bump version to 2.10.0
piwik/piwik-dotnet-tracker,piwik/piwik-dotnet-tracker,piwik/piwik-dotnet-tracker
Piwik.Tracker/Properties/AssemblyInfo.cs
Piwik.Tracker/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("PiwikTracker")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Piwik")] [assembly: AssemblyProduct("PiwikTracker")] [assembly: AssemblyCopyright("")] [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("8121d06f-a801-42d2-a144-0036a0270bf3")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.10.0")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("PiwikTracker")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Piwik")] [assembly: AssemblyProduct("PiwikTracker")] [assembly: AssemblyCopyright("")] [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("8121d06f-a801-42d2-a144-0036a0270bf3")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.9.1")]
bsd-3-clause
C#
7e2acb7c3153ec45e031f76d7de7fb54448f244c
use object pointer instead of context reference
hahoyer/reni.cs,hahoyer/reni.cs,hahoyer/reni.cs
src/reni2/Struct/AccessFeature.cs
src/reni2/Struct/AccessFeature.cs
using System; using System.Collections.Generic; using System.Linq; using hw.Debug; using hw.Helper; using Reni.Basics; using Reni.Feature; using Reni.ReniSyntax; using Reni.TokenClasses; using Reni.Type; namespace Reni.Struct { sealed class AccessFeature : DumpableObject , IFeatureImplementation , ISimpleFeature { static int _nextObjectId; internal AccessFeature(CompoundView compoundView, int position) : base(_nextObjectId++) { View = compoundView; Position = position; FunctionFeature = new ValueCache<IFunctionFeature>(ObtainFunctionFeature); } [EnableDump] public CompoundView View { get; } [EnableDump] public int Position { get; } ValueCache<IFunctionFeature> FunctionFeature { get; } IContextMetaFunctionFeature IFeatureImplementation.ContextMeta => (Statement as FunctionSyntax)?.ContextMetaFunctionFeature(View); IMetaFunctionFeature IFeatureImplementation.Meta => (Statement as FunctionSyntax)?.MetaFunctionFeature(View); IFunctionFeature IFeatureImplementation.Function => FunctionFeature.Value; ISimpleFeature IFeatureImplementation.Simple { get { var function = FunctionFeature.Value; if(function != null && function.IsImplicit) return null; return this; } } Result ISimpleFeature.Result(Category category) => View .AccessViaObjectPointer(category, Position); TypeBase ISimpleFeature.TargetType => View.Type; CompileSyntax Statement => View .Compound .Syntax .Statements[Position]; IFunctionFeature ObtainFunctionFeature() { var functionSyntax = Statement as FunctionSyntax; if(functionSyntax != null) return functionSyntax.FunctionFeature(View); return View.ValueType(Position).CheckedFeature?.Function; } } }
using System; using System.Collections.Generic; using System.Linq; using hw.Debug; using hw.Helper; using Reni.Basics; using Reni.Feature; using Reni.ReniSyntax; using Reni.TokenClasses; using Reni.Type; namespace Reni.Struct { sealed class AccessFeature : DumpableObject , IFeatureImplementation , ISimpleFeature { static int _nextObjectId; internal AccessFeature(CompoundView compoundView, int position) : base(_nextObjectId++) { View = compoundView; Position = position; FunctionFeature = new ValueCache<IFunctionFeature>(ObtainFunctionFeature); } [EnableDump] public CompoundView View { get; } [EnableDump] public int Position { get; } ValueCache<IFunctionFeature> FunctionFeature { get; } IContextMetaFunctionFeature IFeatureImplementation.ContextMeta => (Statement as FunctionSyntax)?.ContextMetaFunctionFeature(View); IMetaFunctionFeature IFeatureImplementation.Meta => (Statement as FunctionSyntax)?.MetaFunctionFeature(View); IFunctionFeature IFeatureImplementation.Function => FunctionFeature.Value; ISimpleFeature IFeatureImplementation.Simple { get { var function = FunctionFeature.Value; if(function != null && function.IsImplicit) return null; return this; } } Result ISimpleFeature.Result(Category category) => View .AccessViaContext(category, Position); TypeBase ISimpleFeature.TargetType => View.Type; CompileSyntax Statement => View .Compound .Syntax .Statements[Position]; IFunctionFeature ObtainFunctionFeature() { var functionSyntax = Statement as FunctionSyntax; if(functionSyntax != null) return functionSyntax.FunctionFeature(View); return View.ValueType(Position).CheckedFeature?.Function; } } }
mit
C#
a218354fadc8860a185319620c6617e041d22704
Bring assembly version up to date with tag
sbennett1990/signify.cs
SignifyCS/Properties/AssemblyInfo.cs
SignifyCS/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("SignifyCS")] [assembly: AssemblyDescription("Verify messages signed with signify")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("Copyright (c) 2017 Scott Bennett")] [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("0b1df081-3b2e-4c1a-8582-78cf9334883b")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.7.*")] [assembly: AssemblyFileVersion("0.7.*")]
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("SignifyCS")] [assembly: AssemblyDescription("Verify messages signed with signify")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("Copyright (c) 2017 Scott Bennett")] [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("0b1df081-3b2e-4c1a-8582-78cf9334883b")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.5.*")] [assembly: AssemblyFileVersion("0.5.*")]
isc
C#
ff48aa4cd996e138273991e756b20063ff93929d
make link_domain optional in mock api
sailthru/sailthru-net-client
Sailthru/Sailthru.Tests/Mock/BlastApi.cs
Sailthru/Sailthru.Tests/Mock/BlastApi.cs
using System; using System.Collections.Generic; using System.Threading; using Newtonsoft.Json.Linq; namespace Sailthru.Tests.Mock { public static class BlastApi { private static int currentId = 1000; public static object ProcessPost(JObject request) { int blastId = Interlocked.Increment(ref currentId); string name = request["name"].Value<string>(); string subject = request["subject"].Value<string>(); string list = request["list"].Value<string>(); string modifyTime = DateTime.Now.ToLocalTime().ToString("ddd, dd MMM yyyy HH:mm:ss zzz"); string status = "created"; string linkDomain = (string)request["link_domain"]; if (request.ContainsKey("schedule_time")) { status = "scheduled"; } return new Dictionary<string, object> { ["blast_id"] = blastId, ["name"] = name, ["subject"] = subject, ["list"] = list, ["modify_time"] = modifyTime, ["link_domain"] = linkDomain, ["status"] = status }; } } }
using System; using System.Collections.Generic; using System.Threading; using Newtonsoft.Json.Linq; namespace Sailthru.Tests.Mock { public static class BlastApi { private static int currentId = 1000; public static object ProcessPost(JObject request) { int blastId = Interlocked.Increment(ref currentId); string name = request["name"].Value<string>(); string subject = request["subject"].Value<string>(); string list = request["list"].Value<string>(); string linkDomain = request["link_domain"].Value<string>(); string modifyTime = DateTime.Now.ToLocalTime().ToString("ddd, dd MMM yyyy HH:mm:ss zzz"); string status = "created"; if (request.ContainsKey("schedule_time")) { status = "scheduled"; } return new Dictionary<string, object> { ["blast_id"] = blastId, ["name"] = name, ["subject"] = subject, ["list"] = list, ["modify_time"] = modifyTime, ["link_domain"] = linkDomain, ["status"] = status }; } } }
mit
C#
9a22b9cbbfd26f4b64be530ea43e7eccaf18d912
correct base controller check
asadsahi/AspNetCoreSpa,asadsahi/AspNetCoreSpa,asadsahi/AspNetCoreSpa,asadsahi/AspNetCoreSpa
Server/Controllers/api/BaseController.cs
Server/Controllers/api/BaseController.cs
using AspNetCoreSpa.Server.Entities; using AspNetCoreSpa.Server.Filters; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; namespace AspNetCoreSpa.Server.Controllers.api { [Authorize] [ServiceFilter(typeof(ApiExceptionFilter))] [ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)] public class BaseController : Controller { public BaseController() { } public IActionResult Render(ExternalLoginStatus status = ExternalLoginStatus.Ok) { if (status == ExternalLoginStatus.Ok) { return LocalRedirect("~/"); } return LocalRedirect($"~/?externalLoginStatus={(int)status}"); // return RedirectToAction("Index", "Home", new { externalLoginStatus = (int)status }); } } }
using AspNetCoreSpa.Server.Entities; using AspNetCoreSpa.Server.Filters; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; namespace AspNetCoreSpa.Server.Controllers.api { [Authorize] [ServiceFilter(typeof(ApiExceptionFilter))] [ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)] public class BaseController : Controller { public BaseController() { } public IActionResult Render(ExternalLoginStatus status = ExternalLoginStatus.Ok) { if (status != ExternalLoginStatus.Ok) { return LocalRedirect("~/"); } return LocalRedirect($"~/?externalLoginStatus={(int)status}"); // return RedirectToAction("Index", "Home", new { externalLoginStatus = (int)status }); } } }
mit
C#
1c5e2d2832b13fd9b60e46c430a77c4084e80357
Update PerlinNoiseTurbulenceShaderView.xaml.cs
wieslawsoltes/Draw2D,wieslawsoltes/Draw2D,wieslawsoltes/Draw2D
src/Draw2D/Views/Style/Shaders/PerlinNoiseTurbulenceShaderView.xaml.cs
src/Draw2D/Views/Style/Shaders/PerlinNoiseTurbulenceShaderView.xaml.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Avalonia.Controls; using Avalonia.Markup.Xaml; namespace Draw2D.Views.Style.Shaders { public class PerlinNoiseTurbulenceShaderView : UserControl { public PerlinNoiseTurbulenceShaderView() { InitializeComponent(); } private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } } }
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Avalonia.Controls; using Avalonia.Markup.Xaml; namespace Draw2D.Views.Style.Shaders { public class Path1DPathEffectView : UserControl { public Path1DPathEffectView() { InitializeComponent(); } private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } } }
mit
C#
1cdcbd658efcd9771769d3277cf442a482527086
Remove not needed code
zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,pranavkm/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,pranavkm/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype
src/Glimpse.Agent.Connection.Http/Broker/RemoteHttpMessagePublisher.cs
src/Glimpse.Agent.Connection.Http/Broker/RemoteHttpMessagePublisher.cs
using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; namespace Glimpse.Agent { public class RemoteHttpMessagePublisher : IMessagePublisher, IDisposable { private readonly HttpClient _httpClient; private readonly HttpClientHandler _httpHandler; public RemoteHttpMessagePublisher() { _httpHandler = new HttpClientHandler(); _httpClient = new HttpClient(_httpHandler); } public void PublishMessage(IMessage message) { var content = new StringContent("Hello"); // TODO: Try shifting to async and await _httpClient.PostAsync("http://localhost:15999/Glimpse/Agent", content) .ContinueWith(requestTask => { // Get HTTP response from completed task. HttpResponseMessage response = requestTask.Result; // Check that response was successful or throw exception response.EnsureSuccessStatusCode(); // Read response asynchronously as JsonValue and write out top facts for each country var result = response.Content.ReadAsStringAsync().Result; }); } public void Dispose() { _httpClient.Dispose(); _httpHandler.Dispose(); } } }
using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; namespace Glimpse.Agent { public class RemoteHttpMessagePublisher : IMessagePublisher, IDisposable { private readonly HttpClient _httpClient; private readonly HttpClientHandler _httpHandler; public RemoteHttpMessagePublisher() { _httpHandler = new HttpClientHandler(); _httpClient = new HttpClient(_httpHandler); } public void PublishMessage(IMessage message) { var content = new StringContent("Hello"); // TODO: Try shifting to async and await _httpClient.PostAsync("http://localhost:15999/Glimpse/Agent", content) .ContinueWith(requestTask => { // Get HTTP response from completed task. HttpResponseMessage response = requestTask.Result; // Check that response was successful or throw exception response.EnsureSuccessStatusCode(); // Read response asynchronously as JsonValue and write out top facts for each country var result = response.Content.ReadAsStringAsync().Result; /* response.Content.ReadAsAsync<string>().ContinueWith(readTask => { var result = readTask.Result; }); */ }); } public void Dispose() { _httpClient.Dispose(); _httpHandler.Dispose(); } } }
mit
C#
6439eb0750a7f869d57ab5e9d959fff792afe1ae
fix typo
antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4
golang/CSharp/GoParserBase.cs
golang/CSharp/GoParserBase.cs
using System; using System.Collections.Generic; using System.IO; using Antlr4.Runtime; public abstract class GoParserBase : Parser { protected GoParserBase(ITokenStream input) : base(input) { } protected GoParserBase(ITokenStream input, TextWriter output, TextWriter errorOutput) : base(input, output, errorOutput) { } protected bool closingBracket() { int la = tokenStream.LA(1); return la == GoLexer.R_PAREN || la == GoLexer.R_CURLY; } private ITokenStream tokenStream { get { return TokenStream; } } }
using System; using System.Collections.Generic; using System.IO; using Antlr4.Runtime; public abstract class GoParserBase : Parser { protected GoParserBase(ITokenStream input) : base(input) { } protected GoParserBase(ITokenStream input, TextWriter output, TextWriter errorOutput) : base(input, output, errorOutput) { } protected bool closingBrackets() { int la = tokenStream.LA(1); return la == GoLexer.R_PAREN || la == GoLexer.R_CURLY; } private ITokenStream tokenStream { get { return TokenStream; } } }
mit
C#
5a34796463f818868bab3acabf8c6e0e968a970a
Remove reference to UseDefaultHostingConfiguration
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
test/WebSites/CorsMiddlewareWebSite/Startup.cs
test/WebSites/CorsMiddlewareWebSite/Startup.cs
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; namespace CorsMiddlewareWebSite { public class Startup { public void ConfigureServices(IServiceCollection services) { services.AddCors(); } public void Configure(IApplicationBuilder app) { app.UseCors(policy => policy.WithOrigins("http://example.com")); app.UseMiddleware<EchoMiddleware>(); } public static void Main(string[] args) { var host = new WebHostBuilder() .UseKestrel() .UseIISIntegration() .UseStartup<Startup>() .Build(); host.Run(); } } }
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; namespace CorsMiddlewareWebSite { public class Startup { public void ConfigureServices(IServiceCollection services) { services.AddCors(); } public void Configure(IApplicationBuilder app) { app.UseCors(policy => policy.WithOrigins("http://example.com")); app.UseMiddleware<EchoMiddleware>(); } public static void Main(string[] args) { var host = new WebHostBuilder() .UseDefaultHostingConfiguration(args) .UseKestrel() .UseIISIntegration() .UseStartup<Startup>() .Build(); host.Run(); } } }
apache-2.0
C#
3684f4367c28988c87fa5aaa4889133dcee811aa
change version to v3.2.2
shabtaisharon/ds3_net_sdk,RachelTucker/ds3_net_sdk,SpectraLogic/ds3_net_sdk,SpectraLogic/ds3_net_sdk,shabtaisharon/ds3_net_sdk,RachelTucker/ds3_net_sdk,shabtaisharon/ds3_net_sdk,SpectraLogic/ds3_net_sdk,RachelTucker/ds3_net_sdk
VersionInfo.cs
VersionInfo.cs
/* * ****************************************************************************** * Copyright 2014-2016 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0 * * or in the "license" file accompanying this file. * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * **************************************************************************** */ using System.Reflection; // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.3.2.0")] [assembly: AssemblyFileVersion("3.3.2.0")]
/* * ****************************************************************************** * Copyright 2014-2016 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0 * * or in the "license" file accompanying this file. * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * **************************************************************************** */ using System.Reflection; // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.3.1.0")] [assembly: AssemblyFileVersion("3.3.1.0")]
apache-2.0
C#
ee504002352ff6cf901aa3828ca5672e111ebb87
Update crefs (#2087)
JamesNK/Newtonsoft.Json,jkorell/Newtonsoft.Json,TylerBrinkley/Newtonsoft.Json,PKRoma/Newtonsoft.Json,ze-pequeno/Newtonsoft.Json,oxwanawxo/Newtonsoft.Json
Src/Newtonsoft.Json/DateParseHandling.cs
Src/Newtonsoft.Json/DateParseHandling.cs
#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json { /// <summary> /// Specifies how date formatted strings, e.g. <c>"\/Date(1198908717056)\/"</c> and <c>"2012-03-21T05:40Z"</c>, are parsed when reading JSON text. /// </summary> public enum DateParseHandling { /// <summary> /// Date formatted strings are not parsed to a date type and are read as strings. /// </summary> None = 0, /// <summary> /// Date formatted strings, e.g. <c>"\/Date(1198908717056)\/"</c> and <c>"2012-03-21T05:40Z"</c>, are parsed to <see cref="System.DateTime"/>. /// </summary> DateTime = 1, #if HAVE_DATE_TIME_OFFSET /// <summary> /// Date formatted strings, e.g. <c>"\/Date(1198908717056)\/"</c> and <c>"2012-03-21T05:40Z"</c>, are parsed to <see cref="System.DateTimeOffset"/>. /// </summary> DateTimeOffset = 2 #endif } }
#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json { /// <summary> /// Specifies how date formatted strings, e.g. <c>"\/Date(1198908717056)\/"</c> and <c>"2012-03-21T05:40Z"</c>, are parsed when reading JSON text. /// </summary> public enum DateParseHandling { /// <summary> /// Date formatted strings are not parsed to a date type and are read as strings. /// </summary> None = 0, /// <summary> /// Date formatted strings, e.g. <c>"\/Date(1198908717056)\/"</c> and <c>"2012-03-21T05:40Z"</c>, are parsed to <see cref="DateTime"/>. /// </summary> DateTime = 1, #if HAVE_DATE_TIME_OFFSET /// <summary> /// Date formatted strings, e.g. <c>"\/Date(1198908717056)\/"</c> and <c>"2012-03-21T05:40Z"</c>, are parsed to <see cref="DateTimeOffset"/>. /// </summary> DateTimeOffset = 2 #endif } }
mit
C#
2d0750d480826c24d4cf274f07e6b736bbab1482
fix docs example with new Akka.IO
ali-ince/akka.net,amichel/akka.net,heynickc/akka.net,amichel/akka.net,ali-ince/akka.net,simonlaroche/akka.net,heynickc/akka.net,Silv3rcircl3/akka.net,Silv3rcircl3/akka.net,simonlaroche/akka.net
docs/examples/DocsExamples/Networking/IO/EchoConnection.cs
docs/examples/DocsExamples/Networking/IO/EchoConnection.cs
using Akka.Actor; using Akka.IO; using Akka.Util.Internal; namespace DocsExamples.Networking.IO { public class EchoConnection : UntypedActor { private readonly IActorRef _connection; public EchoConnection(IActorRef connection) { _connection = connection; } protected override void OnReceive(object message) { if (message is Tcp.Received) { var received = message as Tcp.Received; if (received.Data[0] == 'x') Context.Stop(Self); else _connection.Tell(Tcp.Write.Create(received.Data)); } else Unhandled(message); } } }
using Akka.Actor; using Akka.IO; namespace DocsExamples.Networking.IO { public class EchoConnection : UntypedActor { private readonly IActorRef _connection; public EchoConnection(IActorRef connection) { _connection = connection; } protected override void OnReceive(object message) { if (message is Tcp.Received) { var received = message as Tcp.Received; if (received.Data.Head == 'x') Context.Stop(Self); else _connection.Tell(Tcp.Write.Create(received.Data)); } else Unhandled(message); } } }
apache-2.0
C#
e6e43c0328131dcc56ae404718f3ef539ac945cd
Add TracingService
KpdApps/KpdApps.Common.MsCrm2015
PluginState.cs
PluginState.cs
using System; using Microsoft.Xrm.Sdk; namespace KpdApps.Common.MsCrm2015 { public class PluginState { public virtual IServiceProvider Provider { get; private set; } private IPluginExecutionContext _context; public virtual IPluginExecutionContext Context => _context ?? (_context = (IPluginExecutionContext)Provider.GetService(typeof(IPluginExecutionContext))); private IOrganizationService _service; public virtual IOrganizationService Service { get { if (_service != null) return _service; IOrganizationServiceFactory factory = (IOrganizationServiceFactory)Provider.GetService(typeof(IOrganizationServiceFactory)); _service = factory.CreateOrganizationService(this.Context.UserId); return _service; } } private ITracingService _tracingService; public virtual ITracingService TracingService { get { if (_tracingService != null) return _tracingService; _tracingService = (ITracingService)Provider.GetService(typeof(ITracingService)); return _tracingService; } } public PluginState(IServiceProvider provider) { if (provider == null) throw new ArgumentNullException(nameof(provider)); Provider = provider; } public T GetTarget<T>() where T : class { if (Context.InputParameters.Contains("Target")) { return (T)Context.InputParameters["Target"]; } return default(T); ; } } }
using System; using Microsoft.Xrm.Sdk; namespace KpdApps.Common.MsCrm2015 { public class PluginState { private IOrganizationService _service; private IPluginExecutionContext _context; public virtual IServiceProvider Provider { get; private set; } public virtual IPluginExecutionContext Context => _context ?? (_context = (IPluginExecutionContext)Provider.GetService(typeof(IPluginExecutionContext))); public virtual IOrganizationService Service { get { if (_service != null) return _service; IOrganizationServiceFactory factory = (IOrganizationServiceFactory)Provider.GetService(typeof(IOrganizationServiceFactory)); _service = factory.CreateOrganizationService(this.Context.UserId); return _service; } } public PluginState(IServiceProvider provider) { if (provider == null) throw new ArgumentNullException(nameof(provider)); Provider = provider; } public T GetTarget<T>() where T : class { if (Context.InputParameters.Contains("Target")) { return (T)Context.InputParameters["Target"]; } return default(T); ; } } }
mit
C#
bdab39f5c798005f930514a12f817597b43c39e3
change player Age type from double to int
Team-LemonDrop/NBA-Statistics
NBAStatistics.Data.FillMongoDB/Models/Player.cs
NBAStatistics.Data.FillMongoDB/Models/Player.cs
using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; namespace NBAStatistics.Data.FillMongoDB.Models { public class Player : IEntity { public Player( int teamId, string season, string leagueId, string playerName, string num, string position, string height, string weight, string birthDate, int age, string exp, string school, int playerId) { this.TeamId = teamId; this.Season = season; this.LeagueId = leagueId; this.PlayerName = playerName; this.Num = num; this.Position = position; this.Height = height; this.Weight = weight; this.BirthDate = birthDate; this.Age = age; this.Exp = exp; this.School = school; this.PlayerId = playerId; } [BsonId] [BsonRepresentation(BsonType.ObjectId)] [BsonIgnoreIfDefault] public string Id { get; set; } [BsonRepresentation(BsonType.Int32)] public int TeamId { get; private set; } public string Season { get; private set; } public string LeagueId { get; private set; } public string PlayerName { get; private set; } public string Num { get; private set; } public string Position { get; private set; } public string Height { get; private set; } public string Weight { get; private set; } public string BirthDate { get; private set; } [BsonRepresentation(BsonType.Int32)] public int Age { get; private set; } public string Exp { get; private set; } public string School { get; private set; } [BsonRepresentation(BsonType.Int32)] public int PlayerId { get; private set; } } }
using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; namespace NBAStatistics.Data.FillMongoDB.Models { public class Player : IEntity { public Player( int teamId, string season, string leagueId, string playerName, string num, string position, string height, string weight, string birthDate, double age, string exp, string school, int playerId) { this.TeamId = teamId; this.Season = season; this.LeagueId = leagueId; this.PlayerName = playerName; this.Num = num; this.Position = position; this.Height = height; this.Weight = weight; this.BirthDate = birthDate; this.Age = age; this.Exp = exp; this.School = school; this.PlayerId = playerId; } [BsonId] [BsonRepresentation(BsonType.ObjectId)] [BsonIgnoreIfDefault] public string Id { get; set; } [BsonRepresentation(BsonType.Int32)] public int TeamId { get; private set; } public string Season { get; private set; } public string LeagueId { get; private set; } public string PlayerName { get; private set; } public string Num { get; private set; } public string Position { get; private set; } public string Height { get; private set; } public string Weight { get; private set; } public string BirthDate { get; private set; } public double Age { get; private set; } public string Exp { get; private set; } public string School { get; private set; } [BsonRepresentation(BsonType.Int32)] public int PlayerId { get; private set; } } }
mit
C#
47d35f3ecae397cb51672afd6f2079c8694eb72d
Update QuadraticBezierSegment.cs
Core2D/Core2D,Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D
src/Core2D/ViewModels/Shapes/Path/Segments/QuadraticBezierSegment.cs
src/Core2D/ViewModels/Shapes/Path/Segments/QuadraticBezierSegment.cs
using System; using System.Collections.Generic; using Core2D.Shapes; namespace Core2D.Path.Segments { /// <summary> /// Quadratic bezier path segment. /// </summary> public class QuadraticBezierSegment : PathSegment, IQuadraticBezierSegment { private IPointShape _point1; private IPointShape _point2; /// <inheritdoc/> public IPointShape Point1 { get => _point1; set => Update(ref _point1, value); } /// <inheritdoc/> public IPointShape Point2 { get => _point2; set => Update(ref _point2, value); } /// <inheritdoc/> public override IEnumerable<IPointShape> GetPoints() { yield return Point1; yield return Point2; } /// <inheritdoc/> public override object Copy(IDictionary<object, object> shared) { throw new NotImplementedException(); } /// <summary> /// Returns a string that represents the current object. /// </summary> /// <returns>A string that represents the current object.</returns> public override string ToString() => $"Q{Point1} {Point2}"; /// <summary> /// Check whether the <see cref="Point1"/> property has changed from its default value. /// </summary> /// <returns>Returns true if the property has changed; otherwise, returns false.</returns> public virtual bool ShouldSerializePoint1() => _point1 != null; /// <summary> /// Check whether the <see cref="Point2"/> property has changed from its default value. /// </summary> /// <returns>Returns true if the property has changed; otherwise, returns false.</returns> public virtual bool ShouldSerializePoint2() => _point2 != null; } }
using System; using System.Collections.Generic; using Core2D.Shapes; namespace Core2D.Path.Segments { /// <summary> /// Quadratic bezier path segment. /// </summary> public class QuadraticBezierSegment : PathSegment, IQuadraticBezierSegment { private IPointShape _point1; private IPointShape _point2; /// <inheritdoc/> public IPointShape Point1 { get => _point1; set => Update(ref _point1, value); } /// <inheritdoc/> public IPointShape Point2 { get => _point2; set => Update(ref _point2, value); } /// <inheritdoc/> public override IEnumerable<IPointShape> GetPoints() { yield return Point1; yield return Point2; } /// <inheritdoc/> public override object Copy(IDictionary<object, object> shared) { throw new NotImplementedException(); } /// <summary> /// Returns a string that represents the current object. /// </summary> /// <returns>A string that represents the current object.</returns> public override string ToString() => string.Format("Q{1}{0}{2}", " ", Point1, Point2); /// <summary> /// Check whether the <see cref="Point1"/> property has changed from its default value. /// </summary> /// <returns>Returns true if the property has changed; otherwise, returns false.</returns> public virtual bool ShouldSerializePoint1() => _point1 != null; /// <summary> /// Check whether the <see cref="Point2"/> property has changed from its default value. /// </summary> /// <returns>Returns true if the property has changed; otherwise, returns false.</returns> public virtual bool ShouldSerializePoint2() => _point2 != null; } }
mit
C#
a140440196eda89710e44f18b5d884b07476e260
Add `AssemblyCompany`, `AssemblyCopyright` and `AssemblyProduct` attributes to the assembly.
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
src/Microsoft.AspNet.Mvc.Razor.Host.VSRC1/Properties/AssemblyInfo.cs
src/Microsoft.AspNet.Mvc.Razor.Host.VSRC1/Properties/AssemblyInfo.cs
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: NeutralResourcesLanguage("en-us")] [assembly: AssemblyCompany("Microsoft Corporation.")] [assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] [assembly: AssemblyProduct("Microsoft ASP.NET Core")]
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: NeutralResourcesLanguage("en-us")]
apache-2.0
C#
620e503371b4a31974fd438e18e45fc623b823bb
Replace Xna's Clamp method with our own.
izrik/ChamberLib,izrik/ChamberLib,izrik/ChamberLib
ChamberLib/MathHelper.cs
ChamberLib/MathHelper.cs
using System; namespace ChamberLib { public static class MathHelper { public static int RoundToInt(this float x) { return (int)Math.Round(x); } public static float ToRadians(this float degrees) { return degrees * 0.01745329251994f; // pi / 180 } public static float ToDegrees( this float radians) { return radians * 57.2957795130823f; // 180 / pi } public static float Clamp(this float value, float min, float max) { if (value > max) return max; if (value < min) return min; return value; } } }
using System; namespace ChamberLib { public static class MathHelper { public static int RoundToInt(this float x) { return (int)Math.Round(x); } public static float ToRadians(this float degrees) { return degrees * 0.01745329251994f; // pi / 180 } public static float ToDegrees( this float radians) { return radians * 57.2957795130823f; // 180 / pi } public static float Clamp(this float value, float min, float max) { return Math.Max(Math.Min(value, max), min); } } }
lgpl-2.1
C#
8c553b535e6b763ce0d05d8e92844478f066e547
add transaction to uow
generik0/Smooth.IoC.Dapper.Repository.UnitOfWork,generik0/Smooth.IoC.Dapper.Repository.UnitOfWork
src/Smooth.IoC.Dapper.Repository.UnitOfWork/Repo/RepositoryGetAll.cs
src/Smooth.IoC.Dapper.Repository.UnitOfWork/Repo/RepositoryGetAll.cs
using System.Collections.Generic; using System.Threading.Tasks; using Dapper; using Dapper.FastCrud; using Smooth.IoC.Dapper.Repository.UnitOfWork.Data; using static Dapper.FastCrud.Sql; namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Repo { public abstract partial class Repository<TEntity, TPk> where TEntity : class { public IEnumerable<TEntity> GetAll(ISession session) { var enumerable = session.Query<TEntity>($"SELECT * FROM {Table<TEntity>()}"); return IsIEntity() ? enumerable : session.Find<TEntity>(); } public IEnumerable<TEntity> GetAll(IUnitOfWork uow) { return IsIEntity() ? uow.Connection.Query<TEntity>($"SELECT * FROM {Table<TEntity>()}", transaction: uow.Transaction) : uow.Find<TEntity>(); } public IEnumerable<TEntity> GetAll<TSesssion>() where TSesssion : class, ISession { using (var session = Factory.Create<TSesssion>()) { return GetAll(session); } } public async Task<IEnumerable<TEntity>> GetAllAsync(ISession session) { return IsIEntity() ? await session.QueryAsync<TEntity>($"SELECT * FROM {Table<TEntity>()}") : await session.FindAsync<TEntity>(); } public async Task<IEnumerable<TEntity>> GetAllAsync(IUnitOfWork uow) { return IsIEntity() ? await uow.Connection.QueryAsync<TEntity>($"SELECT * FROM {Table<TEntity>()}",transaction: uow.Transaction) : await uow.FindAsync<TEntity>(); } public Task<IEnumerable<TEntity>> GetAllAsync<TSesssion>() where TSesssion : class, ISession { using (var session = Factory.Create<TSesssion>()) { return GetAllAsync(session); } } } }
using System.Collections.Generic; using System.Threading.Tasks; using Dapper; using Dapper.FastCrud; using Smooth.IoC.Dapper.Repository.UnitOfWork.Data; using static Dapper.FastCrud.Sql; namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Repo { public abstract partial class Repository<TEntity, TPk> where TEntity : class { public IEnumerable<TEntity> GetAll(ISession session) { return IsIEntity() ? session.Query<TEntity>($"SELECT * FROM {Table<TEntity>()}") : session.Find<TEntity>(); } public IEnumerable<TEntity> GetAll(IUnitOfWork uow) { return IsIEntity() ? uow.Connection.Query<TEntity>($"SELECT * FROM {Table<TEntity>()}", transaction: uow) : uow.Find<TEntity>(); } public IEnumerable<TEntity> GetAll<TSesssion>() where TSesssion : class, ISession { using (var session = Factory.Create<TSesssion>()) { return GetAll(session); } } public async Task<IEnumerable<TEntity>> GetAllAsync(ISession session) { return IsIEntity() ? await session.QueryAsync<TEntity>($"SELECT * FROM {Table<TEntity>()}") : await session.FindAsync<TEntity>(); } public async Task<IEnumerable<TEntity>> GetAllAsync(IUnitOfWork uow) { return IsIEntity() ? await uow.Connection.QueryAsync<TEntity>($"SELECT * FROM {Table<TEntity>()}",transaction: uow) : await uow.FindAsync<TEntity>(); } public Task<IEnumerable<TEntity>> GetAllAsync<TSesssion>() where TSesssion : class, ISession { using (var session = Factory.Create<TSesssion>()) { return GetAllAsync(session); } } } }
mit
C#
833ddbe899a2879e12f06c69c88f71b0bac00626
Fix broken build (#10541)
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
src/Servers/Kestrel/samples/PlaintextApp/Startup.cs
src/Servers/Kestrel/samples/PlaintextApp/Startup.cs
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; using System.IO.Pipelines; using System.Net; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; namespace PlaintextApp { public class Startup { private static readonly byte[] _helloWorldBytes = Encoding.UTF8.GetBytes("Hello, World!"); public void Configure(IApplicationBuilder app) { app.Run((httpContext) => { var payload = _helloWorldBytes; var response = httpContext.Response; response.StatusCode = 200; response.ContentType = "text/plain"; response.ContentLength = payload.Length; return response.BodyWriter.WriteAsync(payload).GetAsTask(); }); } public static Task Main(string[] args) { var host = new WebHostBuilder() .UseKestrel(options => { options.Listen(IPAddress.Loopback, 5001); }) .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup<Startup>() .Build(); return host.RunAsync(); } } internal static class ValueTaskExtensions { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) { if (valueTask.IsCompletedSuccessfully) { // Signal consumption to the IValueTaskSource valueTask.GetAwaiter().GetResult(); return Task.CompletedTask; } else { return valueTask.AsTask(); } } } }
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; using System.IO.Pipelines; using System.Net; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; namespace PlaintextApp { public class Startup { private static readonly byte[] _helloWorldBytes = Encoding.UTF8.GetBytes("Hello, World!"); public void Configure(IApplicationBuilder app) { app.Run((httpContext) => { var payload = _helloWorldBytes; var response = httpContext.Response; response.StatusCode = 200; response.ContentType = "text/plain"; response.ContentLength = payload.Length; return response.BodyPipe.WriteAsync(payload).GetAsTask(); }); } public static Task Main(string[] args) { var host = new WebHostBuilder() .UseKestrel(options => { options.Listen(IPAddress.Loopback, 5001); }) .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup<Startup>() .Build(); return host.RunAsync(); } } internal static class ValueTaskExtensions { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) { if (valueTask.IsCompletedSuccessfully) { // Signal consumption to the IValueTaskSource valueTask.GetAwaiter().GetResult(); return Task.CompletedTask; } else { return valueTask.AsTask(); } } } }
apache-2.0
C#
a9142409d646957a48c651af3d2923cf44a90a00
Fix Zap mod dedicated server.
fr1tz/rotc-ethernet-game,fr1tz/rotc-ethernet-game,fr1tz/rotc-ethernet-game,fr1tz/rotc-ethernet-game
zap/main.cs
zap/main.cs
//------------------------------------------------------------------------------ // Revenge Of The Cats: Ethernet // Copyright (C) 2009, mEthLab Interactive //------------------------------------------------------------------------------ //----------------------------------------------------------------------------- // Torque Game Engine // Copyright (C) GarageGames.com, Inc. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // Package overrides to initialize the mod. package Zap { function displayHelp() { Parent::displayHelp(); } function parseArgs() { Parent::parseArgs(); } function onStart() { echo("\n--------- Initializing MOD: Zap ---------"); exec("./server.cs"); Parent::onStart(); } function onExit() { Parent::onExit(); } }; // package Zap activatePackage(Zap);
//------------------------------------------------------------------------------ // Revenge Of The Cats: Ethernet // Copyright (C) 2009, mEthLab Interactive //------------------------------------------------------------------------------ //----------------------------------------------------------------------------- // Torque Game Engine // Copyright (C) GarageGames.com, Inc. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // Package overrides to initialize the mod. package Zap { function displayHelp() { Parent::displayHelp(); } function parseArgs() { Parent::parseArgs(); } function onStart() { Parent::onStart(); echo("\n--------- Initializing MOD: Zap ---------"); exec("./server.cs"); } function onExit() { Parent::onExit(); } }; // package Zap activatePackage(Zap);
lgpl-2.1
C#
9622beab6001249818fc83d575b927c743f973dd
Fix compile warnings. (#200)
mono/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000
tests/managed/structs.cs
tests/managed/structs.cs
using System; #pragma warning disable 660 // 'Point' defines operator == or operator != but does not override Object.Equals(object o) #pragma warning disable 661 // 'Point' defines operator == or operator != but does not override Object.GetHashCode() namespace Structs { public struct Point { public static readonly Point Zero; public Point (float x, float y) { X = x; Y = y; } public float X { get; private set; } public float Y { get; private set; } public static bool operator == (Point left, Point right) { return ((left.X == right.X) && (left.Y == right.Y)); } public static bool operator != (Point left, Point right) { return !(left == right); } public static Point operator + (Point left, Point right) { return new Point (left.X + right.X, left.Y + right.Y); } public static Point operator - (Point left, Point right) { return new Point (left.X - right.X, left.Y - right.Y); } } }
using System; namespace Structs { public struct Point { public static readonly Point Zero; public Point (float x, float y) { X = x; Y = y; } public float X { get; private set; } public float Y { get; private set; } public static bool operator == (Point left, Point right) { return ((left.X == right.X) && (left.Y == right.Y)); } public static bool operator != (Point left, Point right) { return !(left == right); } public static Point operator + (Point left, Point right) { return new Point (left.X + right.X, left.Y + right.Y); } public static Point operator - (Point left, Point right) { return new Point (left.X - right.X, left.Y - right.Y); } } }
mit
C#
f587c58ec4c213d2072257d1d7d4adae242520ec
Improve keyframe (CssNode)
FlorianRappl/AngleSharp,zedr0n/AngleSharp.Local,AngleSharp/AngleSharp,FlorianRappl/AngleSharp,AngleSharp/AngleSharp,Livven/AngleSharp,zedr0n/AngleSharp.Local,Livven/AngleSharp,FlorianRappl/AngleSharp,AngleSharp/AngleSharp,Livven/AngleSharp,AngleSharp/AngleSharp,AngleSharp/AngleSharp,FlorianRappl/AngleSharp,zedr0n/AngleSharp.Local
AngleSharp/Dom/Css/Selector/KeyframeSelector.cs
AngleSharp/Dom/Css/Selector/KeyframeSelector.cs
namespace AngleSharp.Dom.Css { using AngleSharp.Css; using AngleSharp.Css.Values; using System; using System.Collections.Generic; /// <summary> /// Represents the keyframe selector. /// </summary> sealed class KeyframeSelector : CssNode, IKeyframeSelector { #region Fields readonly List<Percent> _stops; #endregion #region ctor public KeyframeSelector(List<Percent> stops) { _stops = stops; } #endregion #region Properties /// <summary> /// Gets an enumeration over all stops. /// </summary> public IEnumerable<Percent> Stops { get { return _stops; } } /// <summary> /// Gets the text representation of the keyframe selector. /// </summary> public String Text { get { var stops = new String[_stops.Count]; for (int i = 0; i < stops.Length; i++) stops[i] = _stops[i].ToString(); return String.Join(", ", stops); } } #endregion } }
namespace AngleSharp.Dom.Css { using System; using System.Collections.Generic; using AngleSharp.Css.Values; /// <summary> /// Represents the keyframe selector. /// </summary> sealed class KeyframeSelector : IKeyframeSelector { #region Fields readonly List<Percent> _stops; #endregion #region ctor public KeyframeSelector(IEnumerable<Percent> stops) { _stops = new List<Percent>(stops); } #endregion #region Properties /// <summary> /// Gets an enumeration over all stops. /// </summary> public IEnumerable<Percent> Stops { get { return _stops; } } /// <summary> /// Gets the text representation of the keyframe selector. /// </summary> public String Text { get { var stops = new String[_stops.Count]; for (int i = 0; i < stops.Length; i++) stops[i] = _stops[i].ToString(); return String.Join(", ", stops); } } #endregion } }
mit
C#
13760f401418a0dd9019c3030d77017fd2c5eccf
Fix gas tile overlays on shuttles
space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14
Content.Client/Atmos/Overlays/GasTileOverlay.cs
Content.Client/Atmos/Overlays/GasTileOverlay.cs
using Content.Client.Atmos.EntitySystems; using Robust.Client.Graphics; using Robust.Shared.Enums; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; namespace Content.Client.Atmos.Overlays { public class GasTileOverlay : Overlay { private readonly GasTileOverlaySystem _gasTileOverlaySystem; [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IEyeManager _eyeManager = default!; [Dependency] private readonly IClyde _clyde = default!; public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV; public GasTileOverlay() { IoCManager.InjectDependencies(this); _gasTileOverlaySystem = EntitySystem.Get<GasTileOverlaySystem>(); } protected override void Draw(in OverlayDrawArgs args) { var drawHandle = args.WorldHandle; var mapId = _eyeManager.CurrentMap; var eye = _eyeManager.CurrentEye; var worldBounds = Box2.CenteredAround(eye.Position.Position, _clyde.ScreenSize / (float) EyeManager.PixelsPerMeter * eye.Zoom); foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds)) { if (!_gasTileOverlaySystem.HasData(mapGrid.Index)) continue; foreach (var tile in mapGrid.GetTilesIntersecting(worldBounds)) { foreach (var (texture, color) in _gasTileOverlaySystem.GetOverlays(mapGrid.Index, tile.GridIndices)) { drawHandle.DrawTexture(texture, mapGrid.LocalToWorld(new Vector2(tile.X, tile.Y)), color); } } } } } }
using Content.Client.Atmos.EntitySystems; using Robust.Client.Graphics; using Robust.Shared.Enums; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; namespace Content.Client.Atmos.Overlays { public class GasTileOverlay : Overlay { private readonly GasTileOverlaySystem _gasTileOverlaySystem; [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IEyeManager _eyeManager = default!; [Dependency] private readonly IClyde _clyde = default!; public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV; public GasTileOverlay() { IoCManager.InjectDependencies(this); _gasTileOverlaySystem = EntitySystem.Get<GasTileOverlaySystem>(); } protected override void Draw(in OverlayDrawArgs args) { var drawHandle = args.WorldHandle; var mapId = _eyeManager.CurrentMap; var eye = _eyeManager.CurrentEye; var worldBounds = Box2.CenteredAround(eye.Position.Position, _clyde.ScreenSize / (float) EyeManager.PixelsPerMeter * eye.Zoom); foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds)) { if (!_gasTileOverlaySystem.HasData(mapGrid.Index)) continue; var gridBounds = new Box2(mapGrid.WorldToLocal(worldBounds.BottomLeft), mapGrid.WorldToLocal(worldBounds.TopRight)); foreach (var tile in mapGrid.GetTilesIntersecting(gridBounds)) { foreach (var (texture, color) in _gasTileOverlaySystem.GetOverlays(mapGrid.Index, tile.GridIndices)) { drawHandle.DrawTexture(texture, mapGrid.LocalToWorld(new Vector2(tile.X, tile.Y)), color); } } } } } }
mit
C#
608513b64312f685ed6255570bdd1c03c64e54a7
Fix related to #AG231 - Mapper resolution is OK to be transient
csf-dev/agiil,csf-dev/agiil,csf-dev/agiil,csf-dev/agiil
Agiil.Bootstrap/ObjectMaps/AutomapperModule.cs
Agiil.Bootstrap/ObjectMaps/AutomapperModule.cs
using System; using Agiil.ObjectMaps; using Autofac; using AutoMapper; namespace Agiil.Bootstrap.ObjectMaps { public class AutomapperModule : Module { protected override void Load(ContainerBuilder builder) { builder .Register(GetMapperConfiguration) .SingleInstance(); builder.Register(GetMapper); } MapperConfiguration GetMapperConfiguration(IComponentContext ctx) => ctx.Resolve<IMapperConfigurationFactory>().GetConfiguration(); IMapper GetMapper(IComponentContext ctx) { var config = ctx.Resolve<MapperConfiguration>(); var scope = ctx.Resolve<ILifetimeScope>(); // Looking at https://github.com/AutoMapper/AutoMapper/blob/v6.0.2/src/AutoMapper/MapperConfiguration.cs#L250 // we can see that this is a trivially cheap operation, OK to happen as often as we need. var mapper = config.CreateMapper(scope.Resolve); return mapper; } } }
using System; using Agiil.ObjectMaps; using Autofac; using AutoMapper; namespace Agiil.Bootstrap.ObjectMaps { public class AutomapperModule : Module { protected override void Load(ContainerBuilder builder) { builder .Register(GetMapperConfiguration) .SingleInstance(); builder .Register(GetMapper) .SingleInstance(); } MapperConfiguration GetMapperConfiguration(IComponentContext ctx) => ctx.Resolve<IMapperConfigurationFactory>().GetConfiguration(); IMapper GetMapper(IComponentContext ctx) { var config = ctx.Resolve<MapperConfiguration>(); var scope = ctx.Resolve<ILifetimeScope>(); var mapper = config.CreateMapper(scope.Resolve); return mapper; } } }
mit
C#
9f7874c78d40a7e27aaeeaaa1787c0f5d987d51f
Use DomainCustomization rather than AutoMoqCustomization directly
appharbor/appharbor-cli
src/AppHarbor.Tests/AutoCommandDataAttribute.cs
src/AppHarbor.Tests/AutoCommandDataAttribute.cs
using Ploeh.AutoFixture; using Ploeh.AutoFixture.AutoMoq; using Ploeh.AutoFixture.Xunit; namespace AppHarbor.Tests { public class AutoCommandDataAttribute : AutoDataAttribute { public AutoCommandDataAttribute() : base(new Fixture().Customize(new DomainCustomization())) { } } }
using Ploeh.AutoFixture; using Ploeh.AutoFixture.AutoMoq; using Ploeh.AutoFixture.Xunit; namespace AppHarbor.Tests { public class AutoCommandDataAttribute : AutoDataAttribute { public AutoCommandDataAttribute() : base(new Fixture().Customize(new AutoMoqCustomization())) { } } }
mit
C#
624f5d1f6a50183e55249cd350e0db11b70f8b33
Update test
arkivverket/arkade5,arkivverket/arkade5,arkivverket/arkade5
src/Arkivverket.Arkade.Test/Util/XmlUtilTest.cs
src/Arkivverket.Arkade.Test/Util/XmlUtilTest.cs
using Arkivverket.Arkade.Test.Tests.Noark5; using Arkivverket.Arkade.Util; using Xunit; using FluentAssertions; namespace Arkivverket.Arkade.Test.Util { public class XmlUtilTest { private string addmlXsd = ResourceUtil.ReadResource(ArkadeConstants.AddmlXsdResource); private string addml = TestUtil.ReadFromFileInTestDataDir("noark3\\addml.xml"); [Fact] public void ShouldNotCreateErrorsIfIfXmlValidateAgainstSchema() { var validationErrorMessages = XmlUtil.Validate(addml, addmlXsd); validationErrorMessages.Count.Should().Be(0); } [Fact] public void ShouldThrowExceptionIfXmlDoesNotValidateAgainstSchema() { var invalidAddml = addml.Replace("dataset", "datasett"); var validationErrorMessages = XmlUtil.Validate(invalidAddml, addmlXsd); validationErrorMessages.Should().Contain(m => m.Equals( "Elementet addml i navneområdet http://www.arkivverket.no/standarder/addml" + " har ugyldig underordnet element datasett i navneområdet http://www.arkivverket.no/standarder/addml." + " Forventet liste over mulige elementer: dataset i navneområdet http://www.arkivverket.no/standarder/addml.") ); } } }
using Arkivverket.Arkade.Test.Tests.Noark5; using Arkivverket.Arkade.Util; using Xunit; using FluentAssertions; using System.Xml.Schema; namespace Arkivverket.Arkade.Test.Util { public class XmlUtilTest { private string addmlXsd = ResourceUtil.ReadResource(ArkadeConstants.AddmlXsdResource); private string addml = TestUtil.ReadFromFileInTestDataDir("noark3\\addml.xml"); [Fact] public void ShouldNotThrowExceptionIfXmlValidateAgainstSchema() { XmlUtil.Validate(addml, addmlXsd); } [Fact] public void ShouldThrowExceptionIfXmlDoesNotValidateAgainstSchema() { var invalidAddml = addml.Replace("dataset", "datasett"); var exception = Xunit.Assert.Throws<XmlSchemaValidationException>(() => XmlUtil.Validate(invalidAddml, addmlXsd)); exception.Message.Should().Contain("datasett"); } } }
agpl-3.0
C#
2976cd1ce4aef0eef6ae17591ec6434dd9d0a013
Fix SliderTest.SlideHorizontally on Win 10
JohanLarsson/Gu.Wpf.UiAutomation
Gu.Wpf.UiAutomation/AutomationElements/Thumb.cs
Gu.Wpf.UiAutomation/AutomationElements/Thumb.cs
namespace Gu.Wpf.UiAutomation { using System.Windows; using System.Windows.Automation; public class Thumb : UiElement { private const int DragSpeed = 500; public Thumb(AutomationElement automationElement) : base(automationElement) { } public TransformPattern TransformPattern => this.AutomationElement.TransformPattern(); /// <summary> /// Moves the slider horizontally. /// </summary> /// <param name="distance">+ for right, - for left.</param> public void SlideHorizontally(int distance) { var cp = this.GetClickablePoint(); Mouse.Drag(MouseButton.Left, cp, cp + new Vector(distance, 0), DragSpeed); Wait.UntilInputIsProcessed(); } /// <summary> /// Moves the slider vertically. /// </summary> /// <param name="distance">+ for down, - for up.</param> public void SlideVertically(int distance) { var cp = this.GetClickablePoint(); Mouse.Drag(MouseButton.Left, cp, cp + new Vector(0, distance), DragSpeed); Wait.UntilInputIsProcessed(); } } }
namespace Gu.Wpf.UiAutomation { using System.Windows.Automation; public class Thumb : UiElement { public Thumb(AutomationElement automationElement) : base(automationElement) { } public TransformPattern TransformPattern => this.AutomationElement.TransformPattern(); /// <summary> /// Moves the slider horizontally. /// </summary> /// <param name="distance">+ for right, - for left.</param> public void SlideHorizontally(int distance) { Mouse.DragHorizontally(MouseButton.Left, this.Bounds.Center(), distance); } /// <summary> /// Moves the slider vertically. /// </summary> /// <param name="distance">+ for down, - for up.</param> public void SlideVertically(int distance) { Mouse.DragVertically(MouseButton.Left, this.Bounds.Center(), distance); } } }
mit
C#
fd0cd2c948e95eb25d24930f22c65e7a59c385e0
Use less confusing placeholder icon for YAML
JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity
resharper/resharper-yaml/src/Psi/YamlProjectFileLanguageService.cs
resharper/resharper-yaml/src/Psi/YamlProjectFileLanguageService.cs
using JetBrains.Application.UI.Icons.Special.ThemedIcons; using JetBrains.ProjectModel; using JetBrains.ReSharper.Plugins.Yaml.ProjectModel; using JetBrains.ReSharper.Plugins.Yaml.Settings; using JetBrains.ReSharper.Psi; using JetBrains.ReSharper.Psi.Parsing; using JetBrains.Text; using JetBrains.UI.Icons; namespace JetBrains.ReSharper.Plugins.Yaml.Psi { [ProjectFileType(typeof(YamlProjectFileType))] public class YamlProjectFileLanguageService : ProjectFileLanguageService { private readonly YamlSupport myYamlSupport; public YamlProjectFileLanguageService(YamlSupport yamlSupport) : base(YamlProjectFileType.Instance) { myYamlSupport = yamlSupport; } public override ILexerFactory GetMixedLexerFactory(ISolution solution, IBuffer buffer, IPsiSourceFile sourceFile = null) { var languageService = YamlLanguage.Instance.LanguageService(); return languageService?.GetPrimaryLexerFactory(); } protected override PsiLanguageType PsiLanguageType { get { var yamlLanguage = (PsiLanguageType) YamlLanguage.Instance ?? UnknownLanguage.Instance; return myYamlSupport.IsParsingEnabled.Value ? yamlLanguage : UnknownLanguage.Instance; } } // TODO: Proper icon! public override IconId Icon => SpecialThemedIcons.Placeholder.Id; } }
using JetBrains.ProjectModel; using JetBrains.ReSharper.Plugins.Yaml.ProjectModel; using JetBrains.ReSharper.Plugins.Yaml.Settings; using JetBrains.ReSharper.Psi; using JetBrains.ReSharper.Psi.CSharp.Resources; using JetBrains.ReSharper.Psi.Parsing; using JetBrains.Text; using JetBrains.UI.Icons; namespace JetBrains.ReSharper.Plugins.Yaml.Psi { [ProjectFileType(typeof(YamlProjectFileType))] public class YamlProjectFileLanguageService : ProjectFileLanguageService { private readonly YamlSupport myYamlSupport; public YamlProjectFileLanguageService(YamlSupport yamlSupport) : base(YamlProjectFileType.Instance) { myYamlSupport = yamlSupport; } public override ILexerFactory GetMixedLexerFactory(ISolution solution, IBuffer buffer, IPsiSourceFile sourceFile = null) { var languageService = YamlLanguage.Instance.LanguageService(); return languageService?.GetPrimaryLexerFactory(); } protected override PsiLanguageType PsiLanguageType { get { var yamlLanguage = (PsiLanguageType) YamlLanguage.Instance ?? UnknownLanguage.Instance; return myYamlSupport.IsParsingEnabled.Value ? yamlLanguage : UnknownLanguage.Instance; } } // TODO: Proper icon! public override IconId Icon => PsiCSharpThemedIcons.Csharp.Id; } }
apache-2.0
C#
6dc94b92a1502b7b7d9ad17651390d23d110414c
make AuthorizeResponse public
jbijlsma/IdentityServer4,MienDev/IdentityServer4,jbijlsma/IdentityServer4,IdentityServer/IdentityServer4,jbijlsma/IdentityServer4,jbijlsma/IdentityServer4,MienDev/IdentityServer4,chrisowhite/IdentityServer4,MienDev/IdentityServer4,siyo-wang/IdentityServer4,MienDev/IdentityServer4,IdentityServer/IdentityServer4,chrisowhite/IdentityServer4,IdentityServer/IdentityServer4,chrisowhite/IdentityServer4,siyo-wang/IdentityServer4,IdentityServer/IdentityServer4,siyo-wang/IdentityServer4
src/IdentityServer4/Models/AuthorizeResponse.cs
src/IdentityServer4/Models/AuthorizeResponse.cs
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityServer4.Extensions; using IdentityServer4.Validation; namespace IdentityServer4.Models { public class AuthorizeResponse { public ValidatedAuthorizeRequest Request { get; set; } public string RedirectUri => Request?.RedirectUri; public string State => Request?.State; public string Scope => Request?.ValidatedScopes?.GrantedResources?.ToScopeNames()?.ToSpaceSeparatedString(); public string IdentityToken { get; set; } public string AccessToken { get; set; } public int AccessTokenLifetime { get; set; } public string Code { get; set; } public string SessionState { get; set; } public string Error { get; set; } public string ErrorDescription { get; set; } public bool IsError => Error.IsPresent(); } }
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityServer4.Extensions; using IdentityServer4.Validation; namespace IdentityServer4.Models { class AuthorizeResponse { public ValidatedAuthorizeRequest Request { get; set; } public string RedirectUri => Request?.RedirectUri; public string State => Request?.State; public string Scope => Request?.ValidatedScopes?.GrantedResources?.ToScopeNames()?.ToSpaceSeparatedString(); public string IdentityToken { get; set; } public string AccessToken { get; set; } public int AccessTokenLifetime { get; set; } public string Code { get; set; } public string SessionState { get; set; } public string Error { get; set; } public string ErrorDescription { get; set; } public bool IsError => Error.IsPresent(); } }
apache-2.0
C#
53794bf030808426af54082c589057b1e41bcd5e
make use of the TextBrush
Ollienator/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,snoopydo/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,willdean/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,hakim89/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,dunderburken/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,larshg/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,larshg/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,willdean/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,jiangzm/Bonobo-Git-Server,willdean/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,larshg/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,willdean/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,lkho/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,crowar/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,lkho/Bonobo-Git-Server,gencer/Bonobo-Git-Server,crowar/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,gencer/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,crowar/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,gencer/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,willdean/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,YelaSeamless/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,larshg/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,crowar/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,gencer/Bonobo-Git-Server,crowar/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,crowar/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,kfarnung/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,jiangzm/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,NipponSysits/IIS.Git-Connector,Acute-sales-ltd/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,KiritoStudio/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,dunderburken/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,lkho/Bonobo-Git-Server,lkho/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server
Bonobo.Git.Server/Views/Repository/Blob.cshtml
Bonobo.Git.Server/Views/Repository/Blob.cshtml
@using Bonobo.Git.Server.Extensions @model RepositoryTreeDetailModel @{ Layout = "~/Views/Repository/_RepositoryLayout.cshtml"; ViewBag.Title = Resources.Repository_Tree_Title; } @if (Model != null) { @Html.Partial("_BranchSwitcher") @Html.Partial("_AddressBar") <div class="blob"> @{ <div class="controls"> <a href="@Url.Action("Raw", new { encodedPath = PathEncoder.Encode(Model.Path, allowSlash: true) })"><i class="fa fa-download"></i> @Resources.Repository_Tree_Download</a> <a href="@Url.Action("Raw", new { encodedPath = PathEncoder.Encode(Model.Path, allowSlash: true), display = true })"><i class="fa fa-file-text"></i> @Resources.Repository_Tree_RawDisplay</a> <a href="@Url.Action("History", new { encodedPath = PathEncoder.Encode(Model.Path, allowSlash: true)})"><i class="fa fa-history"></i> @Resources.Repository_Tree_History</a> <a href="@Url.Action("Blame", new { encodedPath = PathEncoder.Encode(Model.Path, allowSlash: true)})">@Resources.Repository_Tree_Blame</a> </div> } @if (Model.IsImage) { <img class="fileImage" alt="@Model.Name" src="@Url.Action("Raw", new { encodedPath = PathEncoder.Encode(Model.Path, allowSlash: true) })" /> } else if (Model.IsText && Model.IsMarkdown) { <div class="markdown">@Html.MarkdownToHtml(Model.Text)</div> } else if (Model.IsText) { <pre><code class="@Model.TextBrush">@Model.Text</code></pre> } else { <pre><code>@Resources.Repository_Tree_PreviewNotSupported</code></pre> } </div> } @section scripts { <script>hljs.configure({tabReplace:' '});hljs.initHighlightingOnLoad();</script> }
@using Bonobo.Git.Server.Extensions @model RepositoryTreeDetailModel @{ Layout = "~/Views/Repository/_RepositoryLayout.cshtml"; ViewBag.Title = Resources.Repository_Tree_Title; } @if (Model != null) { @Html.Partial("_BranchSwitcher") @Html.Partial("_AddressBar") <div class="blob"> @{ <div class="controls"> <a href="@Url.Action("Raw", new { encodedPath = PathEncoder.Encode(Model.Path, allowSlash: true) })"><i class="fa fa-download"></i> @Resources.Repository_Tree_Download</a> <a href="@Url.Action("Raw", new { encodedPath = PathEncoder.Encode(Model.Path, allowSlash: true), display = true })"><i class="fa fa-file-text"></i> @Resources.Repository_Tree_RawDisplay</a> <a href="@Url.Action("History", new { encodedPath = PathEncoder.Encode(Model.Path, allowSlash: true)})"><i class="fa fa-history"></i> @Resources.Repository_Tree_History</a> <a href="@Url.Action("Blame", new { encodedPath = PathEncoder.Encode(Model.Path, allowSlash: true)})">@Resources.Repository_Tree_Blame</a> </div> } @if (Model.IsImage) { <img class="fileImage" alt="@Model.Name" src="@Url.Action("Raw", new { encodedPath = PathEncoder.Encode(Model.Path, allowSlash: true) })" /> } else if (Model.IsText && Model.IsMarkdown) { <div class="markdown">@Html.MarkdownToHtml(Model.Text)</div> } else if (Model.IsText) { <pre><code>@Model.Text</code></pre> } else { <pre><code>@Resources.Repository_Tree_PreviewNotSupported</code></pre> } </div> } @section scripts { <script>hljs.configure({tabReplace:' '});hljs.initHighlightingOnLoad();</script> }
mit
C#
fbeddd8ec2048f7ec6504267c168a97228c2fb39
Update CurrencyNotFoundException.cs
tiksn/TIKSN-Framework
TIKSN.Core/Finance/CurrencyNotFoundException.cs
TIKSN.Core/Finance/CurrencyNotFoundException.cs
using System; namespace TIKSN.Finance { //[System.Serializable] public class CurrencyNotFoundException : Exception { public CurrencyNotFoundException() { } public CurrencyNotFoundException(string message) : base(message) { } public CurrencyNotFoundException(string message, Exception inner) : base(message, inner) { } //protected CurrencyNotFoundException( // System.Runtime.Serialization.SerializationInfo info, // System.Runtime.Serialization.StreamingContext context) : base(info, context) //{ } } }
namespace TIKSN.Finance { //[System.Serializable] public class CurrencyNotFoundException : System.Exception { public CurrencyNotFoundException() { } public CurrencyNotFoundException(string message) : base(message) { } public CurrencyNotFoundException(string message, System.Exception inner) : base(message, inner) { } //protected CurrencyNotFoundException( // System.Runtime.Serialization.SerializationInfo info, // System.Runtime.Serialization.StreamingContext context) : base(info, context) //{ } } }
mit
C#
b097f2f3db33ba5f00f4146cdde59d2be37ef97c
Simplify name.
autofac/Autofac.WebApi.Owin
src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs
src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs
// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Web.Http; using Autofac.Integration.WebApi.Owin; namespace Owin; /// <summary> /// Extension methods for configuring the OWIN pipeline. /// </summary> [EditorBrowsable(EditorBrowsableState.Never)] public static class AutofacWebApiAppBuilderExtensions { /// <summary> /// Extends the Autofac lifetime scope added from the OWIN pipeline through to the Web API dependency scope. /// </summary> /// <param name="app">The application builder.</param> /// <param name="configuration">The HTTP server configuration.</param> /// <returns>The application builder for continued configuration.</returns> /// <exception cref="ArgumentNullException"> /// Thrown if <paramref name="app" /> or <paramref name="configuration" /> is <see langword="null" />. /// </exception> [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The handler created must exist for the entire application lifetime.")] public static IAppBuilder UseAutofacWebApi(this IAppBuilder app, HttpConfiguration configuration) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } if (!configuration.MessageHandlers.OfType<DependencyScopeHandler>().Any()) { configuration.MessageHandlers.Insert(0, new DependencyScopeHandler()); } return app; } }
// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Web.Http; using Autofac.Integration.WebApi.Owin; namespace Owin; /// <summary> /// Extension methods for configuring the OWIN pipeline. /// </summary> [EditorBrowsable(EditorBrowsableState.Never)] public static class AutofacWebApiAppBuilderExtensions { /// <summary> /// Extends the Autofac lifetime scope added from the OWIN pipeline through to the Web API dependency scope. /// </summary> /// <param name="app">The application builder.</param> /// <param name="configuration">The HTTP server configuration.</param> /// <returns>The application builder for continued configuration.</returns> /// <exception cref="System.ArgumentNullException"> /// Thrown if <paramref name="app" /> or <paramref name="configuration" /> is <see langword="null" />. /// </exception> [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The handler created must exist for the entire application lifetime.")] public static IAppBuilder UseAutofacWebApi(this IAppBuilder app, HttpConfiguration configuration) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } if (!configuration.MessageHandlers.OfType<DependencyScopeHandler>().Any()) { configuration.MessageHandlers.Insert(0, new DependencyScopeHandler()); } return app; } }
mit
C#
e5c12dc7b9605657baa3087ffd0f25532f2c6172
Use List<T> instead of IList<T> for struct enumeration in unsorted metadata table buffers.
Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver
src/AsmResolver.DotNet/Builder/Metadata/Tables/UnsortedMetadataTableBuffer.cs
src/AsmResolver.DotNet/Builder/Metadata/Tables/UnsortedMetadataTableBuffer.cs
using System; using System.Collections.Generic; using AsmResolver.PE.DotNet.Metadata.Tables; using AsmResolver.PE.DotNet.Metadata.Tables.Rows; namespace AsmResolver.DotNet.Builder.Metadata.Tables { /// <summary> /// Represents a metadata stream buffer that adds every new row at the end of the table, without any further /// processing or reordering of the rows. /// </summary> /// <typeparam name="TRow">The type of rows to store.</typeparam> public class UnsortedMetadataTableBuffer<TRow> : IMetadataTableBuffer<TRow> where TRow : struct, IMetadataRow { private readonly List<TRow> _entries = new List<TRow>(); private readonly MetadataTable<TRow> _table; /// <summary> /// Creates a new unsorted metadata table buffer. /// </summary> /// <param name="table">The underlying table to flush to.</param> public UnsortedMetadataTableBuffer(MetadataTable<TRow> table) { _table = table ?? throw new ArgumentNullException(nameof(table)); } /// <inheritdoc /> public int Count => _entries.Count; /// <inheritdoc /> public virtual TRow this[uint rid] { get => _entries[(int) (rid - 1)]; set => _entries[(int) (rid - 1)] = value; } /// <inheritdoc /> public virtual MetadataToken Add(in TRow row, uint originalRid) { _entries.Add(row); return new MetadataToken(_table.TableIndex, (uint) _entries.Count); } /// <inheritdoc /> public void FlushToTable() { foreach (var row in _entries) _table.Add(row); } } }
using System; using System.Collections.Generic; using AsmResolver.PE.DotNet.Metadata.Tables; using AsmResolver.PE.DotNet.Metadata.Tables.Rows; namespace AsmResolver.DotNet.Builder.Metadata.Tables { /// <summary> /// Represents a metadata stream buffer that adds every new row at the end of the table, without any further /// processing or reordering of the rows. /// </summary> /// <typeparam name="TRow">The type of rows to store.</typeparam> public class UnsortedMetadataTableBuffer<TRow> : IMetadataTableBuffer<TRow> where TRow : struct, IMetadataRow { private readonly IList<TRow> _entries = new List<TRow>(); private readonly MetadataTable<TRow> _table; /// <summary> /// Creates a new unsorted metadata table buffer. /// </summary> /// <param name="table">The underlying table to flush to.</param> public UnsortedMetadataTableBuffer(MetadataTable<TRow> table) { _table = table ?? throw new ArgumentNullException(nameof(table)); } /// <inheritdoc /> public int Count => _entries.Count; /// <inheritdoc /> public virtual TRow this[uint rid] { get => _entries[(int) (rid - 1)]; set => _entries[(int) (rid - 1)] = value; } /// <inheritdoc /> public virtual MetadataToken Add(in TRow row, uint originalRid) { _entries.Add(row); return new MetadataToken(_table.TableIndex, (uint) _entries.Count); } /// <inheritdoc /> public void FlushToTable() { foreach (var row in _entries) _table.Add(row); } } }
mit
C#
f52b5172ec95fd89ab106348016812087663039a
Update route name
dsteinweg/TeacherPouch,dsteinweg/TeacherPouch,dsteinweg/TeacherPouch,dsteinweg/TeacherPouch
src/TeacherPouch/Controllers/ErrorController.cs
src/TeacherPouch/Controllers/ErrorController.cs
using System; using System.Net; using Microsoft.AspNetCore.Mvc; using TeacherPouch.ViewModels; namespace TeacherPouch.Controllers { public class ErrorController : BaseController { public IActionResult Http404() { Response.StatusCode = (int)HttpStatusCode.NotFound; return View("Http404"); } [Route("Error")] public IActionResult Error(int? httpStatusCode, Exception exception = null) { var showErrorDetails = User.Identity.IsAuthenticated; var viewModel = new ErrorViewModel(httpStatusCode, exception, showErrorDetails); Response.StatusCode = viewModel.StatusCode; return View(viewModel); } } }
using System; using System.Net; using Microsoft.AspNetCore.Mvc; using TeacherPouch.ViewModels; namespace TeacherPouch.Controllers { public class ErrorController : BaseController { public IActionResult Http404() { Response.StatusCode = (int)HttpStatusCode.NotFound; return View("Http404"); } [Route("error")] public IActionResult Error(int? httpStatusCode, Exception exception = null) { var showErrorDetails = User.Identity.IsAuthenticated; var viewModel = new ErrorViewModel(httpStatusCode, exception, showErrorDetails); Response.StatusCode = viewModel.StatusCode; return View("Error", viewModel); } } }
mit
C#
71c603072906823028642dda66f9f0a0afdc76d5
Add registration options for definition request
PowerShell/PowerShellEditorServices
src/PowerShellEditorServices.Protocol/LanguageServer/Definition.cs
src/PowerShellEditorServices.Protocol/LanguageServer/Definition.cs
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer { public class DefinitionRequest { public static readonly RequestType<TextDocumentPosition, Location[], object, TextDocumentRegistrationOptions> Type = RequestType<TextDocumentPosition, Location[], object, TextDocumentRegistrationOptions>.Create("textDocument/definition"); } }
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer { public class DefinitionRequest { public static readonly RequestType<TextDocumentPosition, Location[], object, object> Type = RequestType<TextDocumentPosition, Location[], object, object>.Create("textDocument/definition"); } }
mit
C#
f93f08752b263cad9bcbe087aa23ba6d0a002df5
Implement AdapterListCollection.Count
alesliehughes/monoDX,alesliehughes/monoDX
Microsoft.DirectX.Direct3D/Microsoft.DirectX.Direct3D/AdapterListCollection.cs
Microsoft.DirectX.Direct3D/Microsoft.DirectX.Direct3D/AdapterListCollection.cs
/* * The MIT License (MIT) * * Copyright (c) 2013 Alistair Leslie-Hughes * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections; namespace Microsoft.DirectX.Direct3D { public sealed class AdapterListCollection : IEnumerable, IEnumerator { internal int currAdapter; public AdapterInformation Default { get { throw new NotImplementedException (); } } public AdapterInformation this [int adapter] { get { return new AdapterInformation(adapter); } } //TODO: Returns 1 all the time. public int Count { get { return 1; } } public object Current { get { return new AdapterInformation(this.currAdapter); } } public void Reset () { throw new NotImplementedException (); } //TODO: Assumes only one Adapter - Should be enough for now. public bool MoveNext () { if(currAdapter == 0) return false; currAdapter++; return true; } public IEnumerator GetEnumerator () { return this; } public override bool Equals (object compare) { throw new NotImplementedException (); } public override int GetHashCode () { throw new NotImplementedException (); } internal AdapterListCollection () { currAdapter = -1; } } }
/* * The MIT License (MIT) * * Copyright (c) 2013 Alistair Leslie-Hughes * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections; namespace Microsoft.DirectX.Direct3D { public sealed class AdapterListCollection : IEnumerable, IEnumerator { internal int currAdapter; public AdapterInformation Default { get { throw new NotImplementedException (); } } public AdapterInformation this [int adapter] { get { return new AdapterInformation(adapter); } } //TODO: Returns 1 all the time. public int Count { get { return 1; } } public object Current { get { throw new NotImplementedException (); } } public void Reset () { throw new NotImplementedException (); } //TODO: Assumes only one Adapter - Should be enough for now. public bool MoveNext () { if(currAdapter == 0) return false; currAdapter++; return true; } public IEnumerator GetEnumerator () { return this; } public override bool Equals (object compare) { throw new NotImplementedException (); } public override int GetHashCode () { throw new NotImplementedException (); } internal AdapterListCollection () { currAdapter = -1; } } }
mit
C#
aaa9685cf1508e44e8392a3be285b5d6ba612218
Fix issues
seanshpark/corefx,fgreinacher/corefx,Jiayili1/corefx,seanshpark/corefx,ptoonen/corefx,zhenlan/corefx,zhenlan/corefx,ptoonen/corefx,Ermiar/corefx,wtgodbe/corefx,seanshpark/corefx,wtgodbe/corefx,Ermiar/corefx,seanshpark/corefx,mmitche/corefx,axelheer/corefx,ericstj/corefx,ViktorHofer/corefx,shimingsg/corefx,mmitche/corefx,Jiayili1/corefx,ptoonen/corefx,BrennanConroy/corefx,Jiayili1/corefx,axelheer/corefx,ericstj/corefx,fgreinacher/corefx,ravimeda/corefx,parjong/corefx,wtgodbe/corefx,BrennanConroy/corefx,shimingsg/corefx,ViktorHofer/corefx,parjong/corefx,BrennanConroy/corefx,wtgodbe/corefx,shimingsg/corefx,axelheer/corefx,ViktorHofer/corefx,mmitche/corefx,zhenlan/corefx,mmitche/corefx,ericstj/corefx,ericstj/corefx,ptoonen/corefx,Jiayili1/corefx,wtgodbe/corefx,ptoonen/corefx,seanshpark/corefx,ravimeda/corefx,ptoonen/corefx,ericstj/corefx,zhenlan/corefx,Ermiar/corefx,axelheer/corefx,shimingsg/corefx,shimingsg/corefx,zhenlan/corefx,shimingsg/corefx,ravimeda/corefx,Ermiar/corefx,wtgodbe/corefx,ericstj/corefx,ericstj/corefx,shimingsg/corefx,ravimeda/corefx,parjong/corefx,parjong/corefx,mmitche/corefx,parjong/corefx,ViktorHofer/corefx,ViktorHofer/corefx,mmitche/corefx,zhenlan/corefx,Ermiar/corefx,mmitche/corefx,Ermiar/corefx,zhenlan/corefx,seanshpark/corefx,Ermiar/corefx,ViktorHofer/corefx,fgreinacher/corefx,ViktorHofer/corefx,ravimeda/corefx,seanshpark/corefx,Jiayili1/corefx,fgreinacher/corefx,axelheer/corefx,axelheer/corefx,ravimeda/corefx,parjong/corefx,ptoonen/corefx,Jiayili1/corefx,ravimeda/corefx,Jiayili1/corefx,wtgodbe/corefx,parjong/corefx
src/System.Diagnostics.PerformanceCounter/src/misc/EnvironmentHelpers.cs
src/System.Diagnostics.PerformanceCounter/src/misc/EnvironmentHelpers.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. using System.ComponentModel; using System.Security; using System.Security.Principal; namespace System { internal static class EnvironmentHelpers { private static volatile bool s_isAppContainerProcess; private static volatile bool s_isAppContainerProcessInitalized; public static bool IsAppContainerProcess { get { if(!s_isAppContainerProcessInitalized) { if(Environment.OSVersion.Version.Major < 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor <= 1)) { // Windows 7 or older. s_isAppContainerProcess = false; } else { s_isAppContainerProcess = HasAppContainerToken(); } s_isAppContainerProcessInitalized = true; } return s_isAppContainerProcess; } } private static unsafe bool HasAppContainerToken() { int* dwIsAppContainerPtr = stackalloc int[1]; uint dwLength = 0; using (WindowsIdentity wi = WindowsIdentity.GetCurrent(TokenAccessLevels.Query)) { if (!Interop.Advapi32.GetTokenInformation(wi.Token, (uint)Interop.Advapi32.TOKEN_INFORMATION_CLASS.TokenIsAppContainer, new IntPtr(dwIsAppContainerPtr), sizeof(int), out dwLength)) { throw new Win32Exception(); } } return (*dwIsAppContainerPtr != 0); } } }
// 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. using System.ComponentModel; using System.Security; using System.Security.Principal; namespace System { internal static class EnvironmentHelpers { private static volatile bool s_isAppContainerProcess; private static volatile bool s_isAppContainerProcessInitalized; public static bool IsAppContainerProcess { get { if(!s_isAppContainerProcessInitalized) { if(Environment.OSVersion.Version.Major < 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor <= 1)) { // Windows 7 or older. s_isAppContainerProcess = false; } else { s_isAppContainerProcess = HasAppContainerToken(); } s_isAppContainerProcessInitalized = true; } return s_isAppContainerProcess; } } private static unsafe bool HasAppContainerToken() { int* dwIsAppContainerPtr = stackalloc int[1]; uint dwLength = 0; using (WindowsIdentity wi = WindowsIdentity.GetCurrent(TokenAccessLevels.Query)) { if (!Interop.Advapi32.GetTokenInformation(wi.Token, Interop.Advapi32.TOKEN_INFORMATION_CLASS.TokenIsAppContainer, new IntPtr(dwIsAppContainerPtr), sizeof(int), out dwLength)) { throw new Win32Exception(); } } return (*dwIsAppContainerPtr != 0); } } }
mit
C#
b3cdf9479c46bc3fb73ce2548ba6714c40802ed2
Use common copy of System.Numerics.Hashing.HashHelpers
poizan42/coreclr,wtgodbe/coreclr,cshung/coreclr,poizan42/coreclr,mmitche/coreclr,krk/coreclr,cshung/coreclr,krk/coreclr,mmitche/coreclr,wtgodbe/coreclr,poizan42/coreclr,wtgodbe/coreclr,cshung/coreclr,krk/coreclr,krk/coreclr,mmitche/coreclr,krk/coreclr,poizan42/coreclr,krk/coreclr,wtgodbe/coreclr,mmitche/coreclr,cshung/coreclr,poizan42/coreclr,mmitche/coreclr,cshung/coreclr,cshung/coreclr,mmitche/coreclr,wtgodbe/coreclr,poizan42/coreclr,wtgodbe/coreclr
src/System.Private.CoreLib/shared/System/Numerics/Hashing/HashHelpers.cs
src/System.Private.CoreLib/shared/System/Numerics/Hashing/HashHelpers.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. namespace System.Numerics.Hashing { internal static class HashHelpers { public static readonly int RandomSeed = new Random().Next(int.MinValue, int.MaxValue); public static int Combine(int h1, int h2) { // RyuJIT optimizes this to use the ROL instruction // Related GitHub pull request: dotnet/coreclr#1830 uint rol5 = ((uint)h1 << 5) | ((uint)h1 >> 27); return ((int)rol5 + h1) ^ h2; } } }
// 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. namespace System.Numerics.Hashing { // Please change the corresponding file in corefx if this is changed. internal static class HashHelpers { public static readonly int RandomSeed = new Random().Next(int.MinValue, int.MaxValue); public static int Combine(int h1, int h2) { // RyuJIT optimizes this to use the ROL instruction // Related GitHub pull request: dotnet/coreclr#1830 uint rol5 = ((uint)h1 << 5) | ((uint)h1 >> 27); return ((int)rol5 + h1) ^ h2; } } }
mit
C#
080b4ba9ed5e2dca6755ffb2403272f469fc4dc0
Fix settings
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Gui/Shell/Commands/ToolCommands.cs
WalletWasabi.Gui/Shell/Commands/ToolCommands.cs
using AvalonStudio.Commands; using AvalonStudio.Documents; using AvalonStudio.Extensibility; using AvalonStudio.Shell; using ReactiveUI; using System.IO; using System.Linq; using WalletWasabi.Gui.Tabs.WalletManager; namespace WalletWasabi.Gui.Shell.Commands { internal class ToolCommands { public ToolCommands() { WalletManagerCommand = new CommandDefinition( "Wallet Manager", null, ReactiveCommand.Create(OnWalletManager)); SettingsCommand = new CommandDefinition("I Do Nothing", null, ReactiveCommand.Create(() => { })); } private void OnWalletManager() { if (Directory.Exists(Global.WalletsDir) && Directory.EnumerateFiles(Global.WalletsDir).Any()) { // Load IShell tabs = IoC.Get<IShell>(); IDocumentTabViewModel doc = tabs.Documents.FirstOrDefault(x => x is WalletManagerViewModel); if (doc != default) { var document = doc as WalletManagerViewModel; tabs.SelectedDocument = doc; document.SelectedCategory = document.Categories.First(x => x is LoadWalletViewModel); } else { var document = new WalletManagerViewModel(); tabs.AddDocument(document); document.SelectedCategory = document.Categories.First(x => x is LoadWalletViewModel); } } else { // Generate IShell tabs = IoC.Get<IShell>(); IDocumentTabViewModel doc = tabs.Documents.FirstOrDefault(x => x is WalletManagerViewModel); if (doc != default) { var document = doc as WalletManagerViewModel; tabs.SelectedDocument = doc; document.SelectedCategory = document.Categories.First(x => x is GenerateWalletViewModel); } else { var document = new WalletManagerViewModel(); tabs.AddDocument(document); document.SelectedCategory = document.Categories.First(x => x is GenerateWalletViewModel); } } } [ExportCommandDefinition("Tools.WalletManager")] public CommandDefinition WalletManagerCommand { get; } [ExportCommandDefinition("Tools.Settings")] public CommandDefinition SettingsCommand { get; } } }
using AvalonStudio.Commands; using AvalonStudio.Documents; using AvalonStudio.Extensibility; using AvalonStudio.Shell; using ReactiveUI; using System.IO; using System.Linq; using WalletWasabi.Gui.Tabs.WalletManager; namespace WalletWasabi.Gui.Shell.Commands { internal class ToolCommands { public ToolCommands() { WalletManagerCommand = new CommandDefinition( "Wallet Manager", null, ReactiveCommand.Create(OnWalletManager)); SettingsCommand = new CommandDefinition("Settings", null, ReactiveCommand.Create(() => { })); } private void OnWalletManager() { if (Directory.Exists(Global.WalletsDir) && Directory.EnumerateFiles(Global.WalletsDir).Any()) { // Load IShell tabs = IoC.Get<IShell>(); IDocumentTabViewModel doc = tabs.Documents.FirstOrDefault(x => x is WalletManagerViewModel); if (doc != default) { var document = doc as WalletManagerViewModel; tabs.SelectedDocument = doc; document.SelectedCategory = document.Categories.First(x => x is LoadWalletViewModel); } else { var document = new WalletManagerViewModel(); tabs.AddDocument(document); document.SelectedCategory = document.Categories.First(x => x is LoadWalletViewModel); } } else { // Generate IShell tabs = IoC.Get<IShell>(); IDocumentTabViewModel doc = tabs.Documents.FirstOrDefault(x => x is WalletManagerViewModel); if (doc != default) { var document = doc as WalletManagerViewModel; tabs.SelectedDocument = doc; document.SelectedCategory = document.Categories.First(x => x is GenerateWalletViewModel); } else { var document = new WalletManagerViewModel(); tabs.AddDocument(document); document.SelectedCategory = document.Categories.First(x => x is GenerateWalletViewModel); } } } [ExportCommandDefinition("Tools.WalletManager")] public CommandDefinition WalletManagerCommand { get; } [ExportCommandDefinition("Tools.Settings")] public CommandDefinition SettingsCommand { get; } } }
mit
C#
033ca07d7e8a6a5a948532cc2fe0ca6dcd6ef3a2
Add tooltips for stickers
agens-no/iMessageStickerUnity
Assets/Stickers/Sticker.cs
Assets/Stickers/Sticker.cs
using System; using System.Collections.Generic; using UnityEngine; namespace Agens.Stickers { public class Sticker : ScriptableObject { [Tooltip("Name of the sticker")] public string Name; [Tooltip("Frames per second. Apple recommends 15+ FPS")] public int Fps = 15; [Tooltip("Number of repetitions (0 being infinite cycles")] public int Repetitions = 0; public int Index; public bool Sequence; public List<Texture2D> Frames; public void CopyFrom(Sticker sticker, int i) { name = sticker.Name; Name = sticker.Name; Fps = sticker.Fps; Repetitions = sticker.Repetitions; Index = i; Sequence = sticker.Sequence; Frames = sticker.Frames; } } }
using System; using System.Collections.Generic; using UnityEngine; namespace Agens.Stickers { public class Sticker : ScriptableObject { public string Name; public int Fps = 15; public int Repetitions = 0; public int Index; public bool Sequence; public List<Texture2D> Frames; public void CopyFrom(Sticker sticker, int i) { name = sticker.Name; Name = sticker.Name; Fps = sticker.Fps; Repetitions = sticker.Repetitions; Index = i; Sequence = sticker.Sequence; Frames = sticker.Frames; } } }
mit
C#
bc77a82ab31004fe8692b6b24012fc574951bcfe
Update DotNetXmlSerializer.cs
tiksn/TIKSN-Framework
TIKSN.Core/Serialization/DotNetXmlSerializer.cs
TIKSN.Core/Serialization/DotNetXmlSerializer.cs
using System.IO; using System.Xml.Serialization; namespace TIKSN.Serialization { public class DotNetXmlSerializer : SerializerBase<string> { protected override string SerializeInternal<T>(T obj) { var serializer = new XmlSerializer(obj.GetType()); var writer = new StringWriter(); serializer.Serialize(writer, obj); return writer.ToString(); } } }
using System.IO; using System.Xml.Serialization; namespace TIKSN.Serialization { public class DotNetXmlSerializer : SerializerBase<string> { protected override string SerializeInternal(object obj) { var serializer = new XmlSerializer(obj.GetType()); var writer = new StringWriter(); serializer.Serialize(writer, obj); return writer.ToString(); } } }
mit
C#
0adb6997713d587e35853ffafdfb4054bf56605d
Test passing for dialect supporting SupportsIfExistsBeforeTableName (Postgres)
ngbrown/nhibernate-core,livioc/nhibernate-core,nkreipke/nhibernate-core,lnu/nhibernate-core,nhibernate/nhibernate-core,alobakov/nhibernate-core,ManufacturingIntelligence/nhibernate-core,livioc/nhibernate-core,ManufacturingIntelligence/nhibernate-core,gliljas/nhibernate-core,alobakov/nhibernate-core,fredericDelaporte/nhibernate-core,nhibernate/nhibernate-core,gliljas/nhibernate-core,lnu/nhibernate-core,RogerKratz/nhibernate-core,RogerKratz/nhibernate-core,RogerKratz/nhibernate-core,nkreipke/nhibernate-core,RogerKratz/nhibernate-core,ManufacturingIntelligence/nhibernate-core,gliljas/nhibernate-core,fredericDelaporte/nhibernate-core,nhibernate/nhibernate-core,nhibernate/nhibernate-core,ngbrown/nhibernate-core,hazzik/nhibernate-core,nkreipke/nhibernate-core,gliljas/nhibernate-core,fredericDelaporte/nhibernate-core,hazzik/nhibernate-core,ngbrown/nhibernate-core,alobakov/nhibernate-core,fredericDelaporte/nhibernate-core,hazzik/nhibernate-core,livioc/nhibernate-core,hazzik/nhibernate-core,lnu/nhibernate-core
src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs
src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs
using System.Text; using NHibernate.Cfg; using NHibernate.Tool.hbm2ddl; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1443 { [TestFixture] public class Fixture { private static void Bug(Configuration cfg) { var su = new SchemaExport(cfg); var sb = new StringBuilder(500); su.Execute(x => sb.AppendLine(x), false, false, true); string script = sb.ToString(); if (Dialect.Dialect.GetDialect(cfg.Properties).SupportsIfExistsBeforeTableName) Assert.That(script, Text.Contains("drop table if exists nhibernate.dbo.Aclass")); else Assert.That(script, Text.Contains("drop table nhibernate.dbo.Aclass")); Assert.That(script, Text.Contains("create table nhibernate.dbo.Aclass")); } [Test] public void WithDefaultValuesInConfiguration() { Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddResource("NHibernate.Test.NHSpecificTest.NH1443.AclassWithNothing.hbm.xml", GetType().Assembly); cfg.SetProperty(Environment.DefaultCatalog, "nhibernate"); cfg.SetProperty(Environment.DefaultSchema, "dbo"); Bug(cfg); } [Test] public void WithDefaultValuesInMapping() { Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddResource("NHibernate.Test.NHSpecificTest.NH1443.AclassWithDefault.hbm.xml", GetType().Assembly); Bug(cfg); } [Test] public void WithSpecificValuesInMapping() { Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddResource("NHibernate.Test.NHSpecificTest.NH1443.AclassWithSpecific.hbm.xml", GetType().Assembly); Bug(cfg); } [Test] public void WithDefaultValuesInConfigurationPriorityToMapping() { Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddResource("NHibernate.Test.NHSpecificTest.NH1443.AclassWithDefault.hbm.xml", GetType().Assembly); cfg.SetProperty(Environment.DefaultCatalog, "somethingDifferent"); cfg.SetProperty(Environment.DefaultSchema, "somethingDifferent"); Bug(cfg); } } public class Aclass { public int Id { get; set; } } }
using System.Text; using NHibernate.Cfg; using NHibernate.Tool.hbm2ddl; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1443 { [TestFixture] public class Fixture { private static void Bug(Configuration cfg) { var su = new SchemaExport(cfg); var sb = new StringBuilder(500); su.Execute(x => sb.AppendLine(x), false, false, true); string script = sb.ToString(); Assert.That(script, Text.Contains("drop table nhibernate.dbo.Aclass")); Assert.That(script, Text.Contains("create table nhibernate.dbo.Aclass")); } [Test] public void WithDefaultValuesInConfiguration() { Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddResource("NHibernate.Test.NHSpecificTest.NH1443.AclassWithNothing.hbm.xml", GetType().Assembly); cfg.SetProperty(Environment.DefaultCatalog, "nhibernate"); cfg.SetProperty(Environment.DefaultSchema, "dbo"); Bug(cfg); } [Test] public void WithDefaultValuesInMapping() { Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddResource("NHibernate.Test.NHSpecificTest.NH1443.AclassWithDefault.hbm.xml", GetType().Assembly); Bug(cfg); } [Test] public void WithSpecificValuesInMapping() { Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddResource("NHibernate.Test.NHSpecificTest.NH1443.AclassWithSpecific.hbm.xml", GetType().Assembly); Bug(cfg); } [Test] public void WithDefaultValuesInConfigurationPriorityToMapping() { Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddResource("NHibernate.Test.NHSpecificTest.NH1443.AclassWithDefault.hbm.xml", GetType().Assembly); cfg.SetProperty(Environment.DefaultCatalog, "somethingDifferent"); cfg.SetProperty(Environment.DefaultSchema, "somethingDifferent"); Bug(cfg); } } public class Aclass { public int Id { get; set; } } }
lgpl-2.1
C#
b9b37dc8cde3a8d28070f3f42a0c2eb51f64a01e
Refactor code
Sitecore/Sitecore-Instance-Manager,sergeyshushlyapin/Sitecore-Instance-Manager,dsolovay/Sitecore-Instance-Manager,Brad-Christie/Sitecore-Instance-Manager
src/SIM.Core/Common/AbstractInstanceActionCommand.cs
src/SIM.Core/Common/AbstractInstanceActionCommand.cs
namespace SIM.Core.Common { using System; using System.Linq; using Instances; using Sitecore.Diagnostics.Base; using Sitecore.Diagnostics.Base.Annotations; public abstract class AbstractInstanceActionCommand<T> : AbstractCommand<T> { [CanBeNull] public virtual string Name { get; [UsedImplicitly] set; } protected sealed override void DoExecute(CommandResult<T> result) { var instance = AbstractInstanceActionCommand.GetInstance(Name); this.DoExecute(instance, result); } protected abstract void DoExecute(Instance instance, CommandResult<T> result); } public abstract class AbstractInstanceActionCommand : AbstractCommand { [CanBeNull] public virtual string Name { get; [UsedImplicitly] set; } protected sealed override void DoExecute(CommandResult result) { var name = Name; var instance = GetInstance(name); this.DoExecute(instance, result); } internal static Instance GetInstance(string name) { InstanceManager.Initialize(); Assert.ArgumentNotNullOrEmpty(name, nameof(name)); var instance = InstanceManager.Instances.FirstOrDefault(x => x.Name.Equals(name, StringComparison.OrdinalIgnoreCase)); Ensure.IsNotNull(instance, "instance is not found"); return instance; } protected abstract void DoExecute(Instance instance, CommandResult result); } }
namespace SIM.Core.Common { using System; using System.Linq; using Instances; using Sitecore.Diagnostics.Base; using Sitecore.Diagnostics.Base.Annotations; public abstract class AbstractInstanceActionCommand<T> : AbstractCommand<T> { [CanBeNull] public virtual string Name { get; [UsedImplicitly] set; } protected sealed override void DoExecute(CommandResult<T> result) { InstanceManager.Initialize(); var name = Name; Assert.ArgumentNotNullOrEmpty(name, nameof(name)); var instance = InstanceManager.Instances.FirstOrDefault(x => x.Name.Equals(name, StringComparison.OrdinalIgnoreCase)); Ensure.IsNotNull(instance, "instance is not found"); this.DoExecute(instance, result); } protected abstract void DoExecute(Instance instance, CommandResult<T> result); } public abstract class AbstractInstanceActionCommand : AbstractCommand { [CanBeNull] public virtual string Name { get; [UsedImplicitly] set; } protected sealed override void DoExecute(CommandResult result) { InstanceManager.Initialize(); var name = Name; Assert.ArgumentNotNullOrEmpty(name, nameof(name)); var instance = InstanceManager.Instances.FirstOrDefault(x => x.Name.Equals(name, StringComparison.OrdinalIgnoreCase)); Ensure.IsNotNull(instance, "instance is not found"); this.DoExecute(instance, result); } protected abstract void DoExecute(Instance instance, CommandResult result); } }
mit
C#
883dee3a84f3a72d9576e4489902849abe4df2ee
Fix having the wrong Index name in migration CuratedFeedPackageUniqueness.Down()
KuduApps/NuGetGallery,KuduApps/NuGetGallery,grenade/NuGetGallery_download-count-patch,ScottShingler/NuGetGallery,mtian/SiteExtensionGallery,JetBrains/ReSharperGallery,projectkudu/SiteExtensionGallery,grenade/NuGetGallery_download-count-patch,JetBrains/ReSharperGallery,skbkontur/NuGetGallery,ScottShingler/NuGetGallery,KuduApps/NuGetGallery,mtian/SiteExtensionGallery,projectkudu/SiteExtensionGallery,skbkontur/NuGetGallery,mtian/SiteExtensionGallery,grenade/NuGetGallery_download-count-patch,KuduApps/NuGetGallery,skbkontur/NuGetGallery,JetBrains/ReSharperGallery,KuduApps/NuGetGallery,projectkudu/SiteExtensionGallery,ScottShingler/NuGetGallery
Website/Migrations/201304030226233_CuratedFeedPackageUniqueness.cs
Website/Migrations/201304030226233_CuratedFeedPackageUniqueness.cs
namespace NuGetGallery.Migrations { using System.Data.Entity.Migrations; public partial class CuratedFeedPackageUniqueness : DbMigration { public override void Up() { // ADD uniqueness constraint - as an Index, since it seems reasonable to look up curated package entries by their feed + registration CreateIndex("CuratedPackages", new[] { "CuratedFeedKey", "PackageRegistrationKey" }, unique: true, name: "IX_CuratedFeed_PackageRegistration"); } public override void Down() { // REMOVE uniqueness constraint DropIndex("CuratedPackages", "IX_CuratedFeed_PackageRegistration"); } } }
namespace NuGetGallery.Migrations { using System.Data.Entity.Migrations; public partial class CuratedFeedPackageUniqueness : DbMigration { public override void Up() { // ADD uniqueness constraint - as an Index, since it seems reasonable to look up curated package entries by their feed + registration CreateIndex("CuratedPackages", new[] { "CuratedFeedKey", "PackageRegistrationKey" }, unique: true, name: "IX_CuratedFeed_PackageRegistration"); } public override void Down() { // REMOVE uniqueness constraint DropIndex("CuratedPackages", "IX_CuratedPackage_CuratedFeedAndPackageRegistration"); } } }
apache-2.0
C#
236e55a107ad752b837841d7696ace5ff479a2dd
Add an implementation IEqualityComparer<Type> to ensure the .Distinct call in the Locate() method works as expected.
SRoddis/Mongo.Migration
Mongo.Migration/Migrations/Locators/TypeMigrationDependencyLocator.cs
Mongo.Migration/Migrations/Locators/TypeMigrationDependencyLocator.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Mongo.Migration.Extensions; using Mongo.Migration.Migrations.Adapters; namespace Mongo.Migration.Migrations.Locators { internal class TypeMigrationDependencyLocator<TMigrationType> : MigrationLocator<TMigrationType> where TMigrationType: class, IMigration { private class TypeComparer : IEqualityComparer<Type> { public bool Equals(Type x, Type y) { return x.AssemblyQualifiedName == y.AssemblyQualifiedName; } public int GetHashCode(Type obj) { return obj.AssemblyQualifiedName.GetHashCode(); } } private readonly IContainerProvider _containerProvider; public TypeMigrationDependencyLocator(IContainerProvider containerProvider) { _containerProvider = containerProvider; } public override void Locate() { var migrationTypes = (from assembly in Assemblies from type in assembly.GetTypes() where typeof(TMigrationType).IsAssignableFrom(type) && !type.IsAbstract select type).Distinct(new TypeComparer()); Migrations = migrationTypes.Select(GetMigrationInstance).ToMigrationDictionary(); } private TMigrationType GetMigrationInstance(Type type) { ConstructorInfo constructor = type.GetConstructors()[0]; if(constructor != null) { object[] args = constructor .GetParameters() .Select(o => o.ParameterType) .Select(o => _containerProvider.GetInstance(o)) .ToArray(); return Activator.CreateInstance(type, args) as TMigrationType; } return Activator.CreateInstance(type) as TMigrationType; } } }
using System; using System.Linq; using System.Reflection; using Mongo.Migration.Extensions; using Mongo.Migration.Migrations.Adapters; namespace Mongo.Migration.Migrations.Locators { internal class TypeMigrationDependencyLocator<TMigrationType> : MigrationLocator<TMigrationType> where TMigrationType: class, IMigration { private readonly IContainerProvider _containerProvider; public TypeMigrationDependencyLocator(IContainerProvider containerProvider) { _containerProvider = containerProvider; } public override void Locate() { var migrationTypes = (from assembly in Assemblies from type in assembly.GetTypes() where typeof(TMigrationType).IsAssignableFrom(type) && !type.IsAbstract select type).Distinct(); Migrations = migrationTypes.Select(GetMigrationInstance).ToMigrationDictionary(); } private TMigrationType GetMigrationInstance(Type type) { ConstructorInfo constructor = type.GetConstructors()[0]; if(constructor != null) { object[] args = constructor .GetParameters() .Select(o => o.ParameterType) .Select(o => _containerProvider.GetInstance(o)) .ToArray(); return Activator.CreateInstance(type, args) as TMigrationType; } return Activator.CreateInstance(type) as TMigrationType; } } }
mit
C#
1fca171d58298a2ff65b9b0c95729cb49c35ceb6
Add default and rename variable
BenPhegan/NuGet.Extensions
NuGet.Extensions.Tests/ReferenceAnalysers/ProjectReferenceTestData.cs
NuGet.Extensions.Tests/ReferenceAnalysers/ProjectReferenceTestData.cs
using System.Collections.Generic; using Moq; using NuGet.Extensions.MSBuild; using NuGet.Extensions.Tests.Mocks; namespace NuGet.Extensions.Tests.ReferenceAnalysers { public class ProjectReferenceTestData { private const string AssemblyInPackageRepository = "Assembly11.dll"; public const string PackageInRepository = "Test1"; public static Mock<IVsProject> ConstructMockProject(IBinaryReference[] binaryReferences = null) { var project = new Mock<IVsProject>(); project.Setup(proj => proj.GetBinaryReferences()).Returns(binaryReferences ?? new IBinaryReference[0]); return project; } public static Mock<IBinaryReference> ConstructMockDependency(string includeName = null, string includeVersion = null) { includeName = includeName ?? AssemblyInPackageRepository; var dependency = new Mock<IBinaryReference>(); dependency.SetupGet(d => d.IncludeName).Returns(includeName); dependency.SetupGet(d => d.IncludeVersion).Returns(includeVersion ?? "0.0.0.0"); dependency.Setup(d => d.IsForAssembly(It.IsAny<string>())).Returns(true); string anydependencyHintpath = includeName; dependency.Setup(d => d.TryGetHintPath(out anydependencyHintpath)).Returns(true); return dependency; } public static MockPackageRepository CreateMockRepository() { var mockRepo = new MockPackageRepository(); mockRepo.AddPackage(PackageUtility.CreatePackage(PackageInRepository, isLatest: true, assemblyReferences: new List<string> { AssemblyInPackageRepository, "Assembly12.dll" }, dependencies: new List<PackageDependency>())); mockRepo.AddPackage(PackageUtility.CreatePackage("Test2", isLatest: true, assemblyReferences: new List<string> { "Assembly21.dll", "Assembly22.dll" }, dependencies: new List<PackageDependency> { new PackageDependency(PackageInRepository) })); return mockRepo; } } }
using System.Collections.Generic; using Moq; using NuGet.Extensions.MSBuild; using NuGet.Extensions.Tests.Mocks; namespace NuGet.Extensions.Tests.ReferenceAnalysers { public class ProjectReferenceTestData { private const string AssemblyInPackageRepository = "Assembly11.dll"; public const string PackageInRepository = "Test1"; public static Mock<IVsProject> ConstructMockProject(IBinaryReference[] binaryReferences) { var projectWithSingleDependency = new Mock<IVsProject>(); projectWithSingleDependency.Setup(proj => proj.GetBinaryReferences()).Returns(binaryReferences); return projectWithSingleDependency; } public static Mock<IBinaryReference> ConstructMockDependency(string includeName = null, string includeVersion = null) { includeName = includeName ?? AssemblyInPackageRepository; var dependency = new Mock<IBinaryReference>(); dependency.SetupGet(d => d.IncludeName).Returns(includeName); dependency.SetupGet(d => d.IncludeVersion).Returns(includeVersion ?? "0.0.0.0"); dependency.Setup(d => d.IsForAssembly(It.IsAny<string>())).Returns(true); string anydependencyHintpath = includeName; dependency.Setup(d => d.TryGetHintPath(out anydependencyHintpath)).Returns(true); return dependency; } public static MockPackageRepository CreateMockRepository() { var mockRepo = new MockPackageRepository(); mockRepo.AddPackage(PackageUtility.CreatePackage(PackageInRepository, isLatest: true, assemblyReferences: new List<string> { AssemblyInPackageRepository, "Assembly12.dll" }, dependencies: new List<PackageDependency>())); mockRepo.AddPackage(PackageUtility.CreatePackage("Test2", isLatest: true, assemblyReferences: new List<string> { "Assembly21.dll", "Assembly22.dll" }, dependencies: new List<PackageDependency> { new PackageDependency(PackageInRepository) })); return mockRepo; } } }
mit
C#
052ae794746a6a23fd02c414f5f9bf8c4e5a9b6b
Update RegularTestFixture.cs
MelleKoning/OpenCover.UI,OpenCoverUI/OpenCover.UI
OpenCover.UI.TestDiscoverer.TestResources/Xunit/RegularTestFixture.cs
OpenCover.UI.TestDiscoverer.TestResources/Xunit/RegularTestFixture.cs
using Xunit; namespace OpenCover.UI.TestDiscoverer.TestResources.Xunit { public class RegularFacts { [Fact] public void RegularTestMethod() { } public class SubTestClass { [Fact] public void RegularSubTestClassMethod() { } public class Sub2NdTestClass { [Fact] public void RegularSub2NdTestClassMethod() { } } } } }
using Xunit; namespace OpenCover.UI.TestDiscoverer.TestResources.Xunit { public class RegularFacts { [Fact] public void RegularTestMethod() { } } }
mit
C#
58e535ead38d00cf32154b020d3da4572d856e12
Fix bug where prop was not serialized
openstardrive/server,openstardrive/server,openstardrive/server
OpenStardriveServer/Domain/Systems/Propulsion/Engines/EnginesState.cs
OpenStardriveServer/Domain/Systems/Propulsion/Engines/EnginesState.cs
using System; using OpenStardriveServer.Domain.Systems.Standard; namespace OpenStardriveServer.Domain.Systems.Propulsion.Engines; public record EnginesState : StandardSystemBaseState { public int CurrentSpeed { get; init; } public EngineSpeedConfig SpeedConfig { get; init; } public int CurrentHeat { get; init; } public EngineHeatConfig HeatConfig { get; init; } public SpeedPowerRequirement[] SpeedPowerRequirements { get; init; } = Array.Empty<SpeedPowerRequirement>(); } public record EngineSpeedConfig { public int MaxSpeed { get; init; } public int CruisingSpeed { get; init; } } public record EngineHeatConfig { public int PoweredHeat { get; init; } public int CruisingHeat { get; init; } public int MaxHeat { get; init; } public int MinutesAtMaxSpeed { get; init; } public int MinutesToCoolDown { get; init; } } public record SpeedPowerRequirement { public int Speed { get; init; } public int PowerNeeded { get; init; } }
using System; using OpenStardriveServer.Domain.Systems.Standard; namespace OpenStardriveServer.Domain.Systems.Propulsion.Engines; public record EnginesState : StandardSystemBaseState { public int CurrentSpeed { get; init; } public EngineSpeedConfig SpeedConfig { get; init; } public int CurrentHeat { get; init; } public EngineHeatConfig HeatConfig { get; init; } public SpeedPowerRequirement[] SpeedPowerRequirements = Array.Empty<SpeedPowerRequirement>(); } public record EngineSpeedConfig { public int MaxSpeed { get; init; } public int CruisingSpeed { get; init; } } public record EngineHeatConfig { public int PoweredHeat { get; init; } public int CruisingHeat { get; init; } public int MaxHeat { get; init; } public int MinutesAtMaxSpeed { get; init; } public int MinutesToCoolDown { get; init; } } public record SpeedPowerRequirement { public int Speed { get; init; } public int PowerNeeded { get; init; } }
apache-2.0
C#
78d624e22453dc635426345900f2d81f528469a0
Fix a comment (#129)
ForNeVeR/wpf-math
src/WpfMath/CharSymbol.cs
src/WpfMath/CharSymbol.cs
using WpfMath.Utils; namespace WpfMath { // Atom representing single character that can be marked as text symbol. internal abstract class CharSymbol : Atom { protected CharSymbol(SourceSpan source, TexAtomType type = TexAtomType.Ordinary) : base(source, type) { this.IsTextSymbol = false; } public bool IsTextSymbol { get; } /// <summary>Returns the preferred font to render this character.</summary> public virtual ITeXFont GetStyledFont(TexEnvironment environment) => environment.MathFont; /// <summary>Returns a <see cref="CharInfo"/> for this character.</summary> protected abstract Result<CharInfo> GetCharInfo(ITeXFont font, TexStyle style); protected sealed override Box CreateBoxCore(TexEnvironment environment) { var font = this.GetStyledFont(environment); var charInfo = this.GetCharInfo(font, environment.Style); return new CharBox(environment, charInfo.Value); } /// <summary>Checks if the symbol can be rendered by font.</summary> public bool IsSupportedByFont(ITeXFont font, TexStyle style) => this.GetCharInfo(font, style).IsSuccess; /// <summary>Returns the symbol rendered by font.</summary> public abstract Result<CharFont> GetCharFont(ITeXFont texFont); } }
using WpfMath.Utils; namespace WpfMath { // Atom representing single character that can be marked as text symbol. internal abstract class CharSymbol : Atom { protected CharSymbol(SourceSpan source, TexAtomType type = TexAtomType.Ordinary) : base(source, type) { this.IsTextSymbol = false; } public bool IsTextSymbol { get; } /// <summary>Returns the preferred font to render this character.</summary> public virtual ITeXFont GetStyledFont(TexEnvironment environment) => environment.MathFont; /// <summary>Returns a <see cref="CharInfo"/> for this character.</summary> protected abstract Result<CharInfo> GetCharInfo(ITeXFont font, TexStyle style); protected sealed override Box CreateBoxCore(TexEnvironment environment) { var font = this.GetStyledFont(environment); var charInfo = this.GetCharInfo(font, environment.Style); return new CharBox(environment, charInfo.Value); } /// <summary>Checks if the symbol can be rendered by font.</summary> public bool IsSupportedByFont(ITeXFont font, TexStyle style) => this.GetCharInfo(font, style).IsSuccess; /// <summary> /// Returns the symbol rendered by font. Throws an exception if the symbol is not supported by font. Always /// succeed if <see cref="IsSupportedByFont"/>. /// </summary> public abstract Result<CharFont> GetCharFont(ITeXFont texFont); } }
mit
C#
4ed30b3619954cb7f4ce2e334a6db99ee67a5818
Add WindowsUtils.CreateSingleTickTimer
chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck
Core/Utils/WindowsUtils.cs
Core/Utils/WindowsUtils.cs
using System.Diagnostics; using System.IO; using System.Windows.Forms; namespace TweetDck.Core.Utils{ static class WindowsUtils{ public static bool CheckFolderWritePermission(string path){ string testFile = Path.Combine(path, ".test"); try{ Directory.CreateDirectory(path); using(File.Create(testFile)){} File.Delete(testFile); return true; }catch{ return false; } } public static Process StartProcess(string file, string arguments, bool runElevated){ ProcessStartInfo processInfo = new ProcessStartInfo{ FileName = file, Arguments = arguments }; if (runElevated){ processInfo.Verb = "runas"; } return Process.Start(processInfo); } public static Timer CreateSingleTickTimer(int timeout){ Timer timer = new Timer{ Interval = timeout }; timer.Tick += (sender, args) => timer.Stop(); return timer; } } }
using System.Diagnostics; using System.IO; namespace TweetDck.Core.Utils{ static class WindowsUtils{ public static bool CheckFolderWritePermission(string path){ string testFile = Path.Combine(path, ".test"); try{ Directory.CreateDirectory(path); using(File.Create(testFile)){} File.Delete(testFile); return true; }catch{ return false; } } public static Process StartProcess(string file, string arguments, bool runElevated){ ProcessStartInfo processInfo = new ProcessStartInfo{ FileName = file, Arguments = arguments }; if (runElevated){ processInfo.Verb = "runas"; } return Process.Start(processInfo); } } }
mit
C#
b197e6d4fc108e4e31dfe2de6a950ee485bd2879
Update TestSerilogLoggingSetup.cs
tiksn/TIKSN-Framework
TIKSN.UnitTests.Shared/DependencyInjection/TestSerilogLoggingSetup.cs
TIKSN.UnitTests.Shared/DependencyInjection/TestSerilogLoggingSetup.cs
using Serilog; using TIKSN.Analytics.Logging.Serilog; using Xunit.Abstractions; namespace TIKSN.DependencyInjection.Tests { public class TestSerilogLoggingSetup : SerilogLoggingSetupBase { private readonly ITestOutputHelper _testOutputHelper; public TestSerilogLoggingSetup(ITestOutputHelper testOutputHelper) : base() { _testOutputHelper = testOutputHelper; } protected override void SetupSerilog() { base.SetupSerilog(); _loggerConfiguration.WriteTo.TestOutput(_testOutputHelper); } } }
using Microsoft.Extensions.Logging; using Serilog; using TIKSN.Analytics.Logging.Serilog; using Xunit.Abstractions; namespace TIKSN.DependencyInjection.Tests { public class TestSerilogLoggingSetup : SerilogLoggingSetupBase { private readonly ITestOutputHelper _testOutputHelper; public TestSerilogLoggingSetup(ITestOutputHelper testOutputHelper, ILoggerFactory loggerFactory) : base(loggerFactory) { _testOutputHelper = testOutputHelper; } protected override void SetupSerilog() { base.SetupSerilog(); _loggerConfiguration.WriteTo.TestOutput(_testOutputHelper); } } }
mit
C#
30600e6c3be70b0f7834796828d0109ffcf72ae5
Remove unused using.
FacilityApi/Facility
src/Facility.CodeGen.Console/CommonArgs.cs
src/Facility.CodeGen.Console/CommonArgs.cs
using System.Collections.Generic; using System.Globalization; using ArgsReading; namespace Facility.CodeGen.Console { internal static class CommonArgs { public static bool ReadCleanFlag(this ArgsReader args) => args.ReadFlag("clean"); public static bool ReadDryRunFlag(this ArgsReader args) => args.ReadFlag("dryrun"); public static bool ReadHelpFlag(this ArgsReader args) => args.ReadFlag("help|h|?"); public static bool ReadQuietFlag(this ArgsReader args) => args.ReadFlag("quiet"); public static bool ReadVerifyFlag(this ArgsReader args) => args.ReadFlag("verify"); public static string ReadIndentOption(this ArgsReader args) { string value = args.ReadOption("indent"); if (value == null) return null; if (value == "tab") return "\t"; if (int.TryParse(value, NumberStyles.None, CultureInfo.InvariantCulture, out int spaceCount) && spaceCount >= 1 && spaceCount <= 8) return new string(' ', spaceCount); throw new ArgsReaderException($"Invalid indent '{value}'. (Should be 'tab' or the number of spaces.)"); } public static string ReadNewLineOption(this ArgsReader args) { string value = args.ReadOption("newline"); if (value == null) return null; switch (value) { case "auto": return null; case "lf": return "\n"; case "crlf": return "\r\n"; default: throw new ArgsReaderException($"Invalid new line '{value}'. (Should be 'auto', 'lf', or 'crlf'.)"); } } public static IReadOnlyList<string> ReadExcludeTagOptions(this ArgsReader args) { var values = new List<string>(); while (true) { string value = args.ReadOption("excludeTag"); if (value == null) break; values.Add(value); } return values; } } }
using System.Collections.Generic; using System.Globalization; using ArgsReading; using Facility.Definition; namespace Facility.CodeGen.Console { internal static class CommonArgs { public static bool ReadCleanFlag(this ArgsReader args) => args.ReadFlag("clean"); public static bool ReadDryRunFlag(this ArgsReader args) => args.ReadFlag("dryrun"); public static bool ReadHelpFlag(this ArgsReader args) => args.ReadFlag("help|h|?"); public static bool ReadQuietFlag(this ArgsReader args) => args.ReadFlag("quiet"); public static bool ReadVerifyFlag(this ArgsReader args) => args.ReadFlag("verify"); public static string ReadIndentOption(this ArgsReader args) { string value = args.ReadOption("indent"); if (value == null) return null; if (value == "tab") return "\t"; if (int.TryParse(value, NumberStyles.None, CultureInfo.InvariantCulture, out int spaceCount) && spaceCount >= 1 && spaceCount <= 8) return new string(' ', spaceCount); throw new ArgsReaderException($"Invalid indent '{value}'. (Should be 'tab' or the number of spaces.)"); } public static string ReadNewLineOption(this ArgsReader args) { string value = args.ReadOption("newline"); if (value == null) return null; switch (value) { case "auto": return null; case "lf": return "\n"; case "crlf": return "\r\n"; default: throw new ArgsReaderException($"Invalid new line '{value}'. (Should be 'auto', 'lf', or 'crlf'.)"); } } public static IReadOnlyList<string> ReadExcludeTagOptions(this ArgsReader args) { var values = new List<string>(); while (true) { string value = args.ReadOption("excludeTag"); if (value == null) break; values.Add(value); } return values; } } }
mit
C#
218a35eb76ebeba3db01b39006d031ef6f1f05d6
Update MichaelRidland.cs
MabroukENG/planetxamarin,stvansolano/planetxamarin,beraybentesen/planetxamarin,MabroukENG/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,stvansolano/planetxamarin,beraybentesen/planetxamarin,planetxamarin/planetxamarin,MabroukENG/planetxamarin,beraybentesen/planetxamarin,planetxamarin/planetxamarin,stvansolano/planetxamarin
src/Firehose.Web/Authors/MichaelRidland.cs
src/Firehose.Web/Authors/MichaelRidland.cs
using Firehose.Web.Infrastructure; using System; using System.Collections.Generic; namespace Firehose.Web.Authors { public class MichaelRidland : IAmAXamarinMVP { public string FirstName => "Michael"; public string LastName => "Ridland"; public string StateOrRegion => "Sydney, Australia"; public string EmailAddress => "[email protected]"; public string Title => "director of an Xamarin consultancy"; public Uri WebSite => new Uri("http://www.michaelridland.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://www.michaelridland.com/feed/"); } } public string TwitterHandle => "rid00z"; public DateTime FirstAwarded => new DateTime(2015, 4, 1); public string GravatarHash => ""; } }
using Firehose.Web.Infrastructure; using System; using System.Collections.Generic; namespace Firehose.Web.Authors { public class MichaelRidland : IAmAXamarinMVP { public string FirstName => "Michael"; public string LastName => "Ridland"; public string StateOrRegion => "Sydney, Australia"; public string EmailAddress => "[email protected]"; public string Title => "director of a Xamarin consultancy"; public Uri WebSite => new Uri("http://www.michaelridland.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://www.michaelridland.com/feed/"); } } public string TwitterHandle => "rid00z"; public DateTime FirstAwarded => new DateTime(2015, 4, 1); public string GravatarHash => ""; } }
mit
C#
bd5ea192ec0f7d121778c1f709dd8c517e197b94
add ScheduleId to TaskInfo
grcodemonkey/iron_dotnet
src/IronSharp.IronWorker/Tasks/TaskInfo.cs
src/IronSharp.IronWorker/Tasks/TaskInfo.cs
using System; using IronSharp.Core; using Newtonsoft.Json; namespace IronSharp.IronWorker { public class TaskInfo : IMsg, IInspectable { [JsonProperty("code_id", DefaultValueHandling = DefaultValueHandling.Ignore)] public string CodeId { get; set; } [JsonProperty("code_name", DefaultValueHandling = DefaultValueHandling.Ignore)] public string CodeName { get; set; } [JsonProperty("created_at", DefaultValueHandling = DefaultValueHandling.Ignore)] public DateTime? CreatedAt { get; set; } [JsonProperty("duration", DefaultValueHandling = DefaultValueHandling.Ignore)] public int? Duration { get; set; } [JsonProperty("end_time", DefaultValueHandling = DefaultValueHandling.Ignore)] public DateTime? EndTime { get; set; } [JsonProperty("id", DefaultValueHandling = DefaultValueHandling.Ignore)] public string Id { get; set; } [JsonProperty("schedule_id", DefaultValueHandling = DefaultValueHandling.Ignore)] public string ScheduleId { get; set; } [JsonProperty("msg", DefaultValueHandling = DefaultValueHandling.Ignore)] public string Message { get; set; } [JsonProperty("percent", DefaultValueHandling = DefaultValueHandling.Ignore)] public int? Percent { get; set; } [JsonProperty("project_id", DefaultValueHandling = DefaultValueHandling.Ignore)] public string ProjectId { get; set; } [JsonProperty("run_times", DefaultValueHandling = DefaultValueHandling.Ignore)] public int? RunTimes { get; set; } [JsonProperty("start_time", DefaultValueHandling = DefaultValueHandling.Ignore)] public DateTime? StartTime { get; set; } [JsonIgnore] public TaskStates Status { get { return StatusValue.As<TaskStates>(); } set { StatusValue = Convert.ToString(value).ToLower(); } } [JsonProperty("timeout", DefaultValueHandling = DefaultValueHandling.Ignore)] public int? Timeout { get; set; } [JsonProperty("updated_at", DefaultValueHandling = DefaultValueHandling.Ignore)] public DateTime? UpdatedAt { get; set; } [JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)] protected string StatusValue { get; set; } } }
using System; using IronSharp.Core; using Newtonsoft.Json; namespace IronSharp.IronWorker { public class TaskInfo : IMsg, IInspectable { [JsonProperty("code_id", DefaultValueHandling = DefaultValueHandling.Ignore)] public string CodeId { get; set; } [JsonProperty("code_name", DefaultValueHandling = DefaultValueHandling.Ignore)] public string CodeName { get; set; } [JsonProperty("created_at", DefaultValueHandling = DefaultValueHandling.Ignore)] public DateTime? CreatedAt { get; set; } [JsonProperty("duration", DefaultValueHandling = DefaultValueHandling.Ignore)] public int? Duration { get; set; } [JsonProperty("end_time", DefaultValueHandling = DefaultValueHandling.Ignore)] public DateTime? EndTime { get; set; } [JsonProperty("id", DefaultValueHandling = DefaultValueHandling.Ignore)] public string Id { get; set; } [JsonProperty("msg", DefaultValueHandling = DefaultValueHandling.Ignore)] public string Message { get; set; } [JsonProperty("percent", DefaultValueHandling = DefaultValueHandling.Ignore)] public int? Percent { get; set; } [JsonProperty("project_id", DefaultValueHandling = DefaultValueHandling.Ignore)] public string ProjectId { get; set; } [JsonProperty("run_times", DefaultValueHandling = DefaultValueHandling.Ignore)] public int? RunTimes { get; set; } [JsonProperty("start_time", DefaultValueHandling = DefaultValueHandling.Ignore)] public DateTime? StartTime { get; set; } [JsonIgnore] public TaskStates Status { get { return StatusValue.As<TaskStates>(); } set { StatusValue = Convert.ToString(value).ToLower(); } } [JsonProperty("timeout", DefaultValueHandling = DefaultValueHandling.Ignore)] public int? Timeout { get; set; } [JsonProperty("updated_at", DefaultValueHandling = DefaultValueHandling.Ignore)] public DateTime? UpdatedAt { get; set; } [JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)] protected string StatusValue { get; set; } } }
mit
C#
e5cfa8d3556f3e8173fde2d2993e36a746fe27ee
Simplify namespace handling
mkoscielniak/SSMScripter
SSMScripter/Scripter/Smo/SmoCreatableObject.cs
SSMScripter/Scripter/Smo/SmoCreatableObject.cs
using System; using System.Collections.Specialized; using MSmo = Microsoft.SqlServer.Management.Smo; namespace SSMScripter.Scripter.Smo { public class SmoCreatableObject : SmoScriptableObject { public SmoCreatableObject(Microsoft.SqlServer.Management.Smo.SqlSmoObject obj) : base(obj) { } public override StringCollection Script(SmoScriptingContext context) { var scripter = new MSmo.Scripter(context.Server); scripter.Options.IncludeDatabaseContext = context.ScriptDatabaseContext; StringCollection scriptingResult = scripter.Script(new[] {ScriptedObject}); var result = new StringCollection(); AddDatabaseContextIfNeeded(context, result, scriptingResult); foreach (string scriptedBatch in scriptingResult) { result.Add(scriptedBatch); AddLineEnding(result); AddLineEnding(result); } return result; } private void AddDatabaseContextIfNeeded(SmoScriptingContext context, StringCollection output, StringCollection scriptingResult) { if (scriptingResult.Count == 0) return; string firstLine = scriptingResult[0]; if (String.IsNullOrEmpty(firstLine)) return; if (firstLine.StartsWith("USE", StringComparison.InvariantCultureIgnoreCase)) return; AddDatabaseContext(output, context); AddLineEnding(output); } } }
using System; using System.Collections.Specialized; namespace SSMScripter.Scripter.Smo { public class SmoCreatableObject : SmoScriptableObject { public SmoCreatableObject(Microsoft.SqlServer.Management.Smo.SqlSmoObject obj) : base(obj) { } public override StringCollection Script(SmoScriptingContext context) { var scripter = new Microsoft.SqlServer.Management.Smo.Scripter(context.Server); Microsoft.SqlServer.Management.Smo.ScriptingOptions options = scripter.Options; options.IncludeDatabaseContext = context.ScriptDatabaseContext; StringCollection scriptingResult = scripter.Script(new[] {ScriptedObject}); var result = new StringCollection(); AddDatabaseContextIfNeeded(context, result, scriptingResult); foreach (string scriptedBatch in scriptingResult) { result.Add(scriptedBatch); AddLineEnding(result); AddLineEnding(result); } return result; } private void AddDatabaseContextIfNeeded(SmoScriptingContext context, StringCollection output, StringCollection scriptingResult) { if (scriptingResult.Count == 0) return; string firstLine = scriptingResult[0]; if (String.IsNullOrEmpty(firstLine)) return; if (firstLine.StartsWith("USE", StringComparison.InvariantCultureIgnoreCase)) return; AddDatabaseContext(output, context); AddLineEnding(output); } } }
mit
C#
c84d05076a30141278c23d99f9286c2c8e7c4b53
Add overloads to exception to take in the Reason
rapidcore/rapidcore,rapidcore/rapidcore
src/Locking/DistributedAppLockException.cs
src/Locking/DistributedAppLockException.cs
using System; namespace RapidCore.Locking { public class DistributedAppLockException : Exception { public DistributedAppLockException() { } public DistributedAppLockException(string message) : base(message) { } public DistributedAppLockException(string message, DistributedAppLockExceptionReason reason) : base(message) { Reason = reason; } public DistributedAppLockException(string message, Exception inner) : base(message, inner) { } public DistributedAppLockException(string message, Exception inner, DistributedAppLockExceptionReason reason) : base(message, inner) { Reason = reason; } public DistributedAppLockExceptionReason Reason { get; set; } } }
using System; namespace RapidCore.Locking { public class DistributedAppLockException : Exception { public DistributedAppLockException() { } public DistributedAppLockException(string message) : base(message) { } public DistributedAppLockException(string message, Exception inner) : base(message, inner) { } public DistributedAppLockExceptionReason Reason { get; set; } } }
mit
C#
d22703b27496b0e1c5eaadc0a0985f7346599b26
Fix for closing window.
cube-soft/Cube.Net,cube-soft/Cube.Net,cube-soft/Cube.Net
Applications/Rss/Reader/Xui/Triggers/CloseTrigger.cs
Applications/Rss/Reader/Xui/Triggers/CloseTrigger.cs
/* ------------------------------------------------------------------------- */ // // Copyright (c) 2010 CubeSoft, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /* ------------------------------------------------------------------------- */ using System.Windows; using System.Windows.Interactivity; namespace Cube.Xui.Triggers { /* --------------------------------------------------------------------- */ /// /// CloseMessage /// /// <summary> /// ウィンドウを閉じることを示すメッセージクラスです。 /// </summary> /// /* --------------------------------------------------------------------- */ public class CloseMessage { } /* --------------------------------------------------------------------- */ /// /// CloseTrigger /// /// <summary> /// Messenger オブジェクト経由でウィンドウを閉じるための /// Trigger クラスです。 /// </summary> /// /* --------------------------------------------------------------------- */ public class CloseTrigger : MessengerTrigger<CloseMessage> { } /* --------------------------------------------------------------------- */ /// /// CloseAction /// /// <summary> /// Window を閉じる TriggerAction です。 /// </summary> /// /* --------------------------------------------------------------------- */ public class CloseAction : TriggerAction<DependencyObject> { /* ----------------------------------------------------------------- */ /// /// Invoke /// /// <summary> /// 処理を実行します。 /// </summary> /// /* ----------------------------------------------------------------- */ protected override void Invoke(object notused) { if (AssociatedObject is Window w) { w.DataContext = null; w.Close(); } } } }
/* ------------------------------------------------------------------------- */ // // Copyright (c) 2010 CubeSoft, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /* ------------------------------------------------------------------------- */ using System.Windows; using System.Windows.Interactivity; namespace Cube.Xui.Triggers { /* --------------------------------------------------------------------- */ /// /// CloseMessage /// /// <summary> /// ウィンドウを閉じることを示すメッセージクラスです。 /// </summary> /// /* --------------------------------------------------------------------- */ public class CloseMessage { } /* --------------------------------------------------------------------- */ /// /// CloseTrigger /// /// <summary> /// Messenger オブジェクト経由でウィンドウを閉じるための /// Trigger クラスです。 /// </summary> /// /* --------------------------------------------------------------------- */ public class CloseTrigger : MessengerTrigger<CloseMessage> { } /* --------------------------------------------------------------------- */ /// /// CloseAction /// /// <summary> /// Window を閉じる TriggerAction です。 /// </summary> /// /* --------------------------------------------------------------------- */ public class CloseAction : TriggerAction<DependencyObject> { /* ----------------------------------------------------------------- */ /// /// Invoke /// /// <summary> /// 処理を実行します。 /// </summary> /// /* ----------------------------------------------------------------- */ protected override void Invoke(object notused) { if (AssociatedObject is Window w) w.Close(); } } }
apache-2.0
C#
da90cb0c045ed2ad5f32b63e98b5cdb13ed0232f
resolve again
IvoAtanasov/TableTennisChampionship,IvoAtanasov/TableTennisChampionship,IvoAtanasov/TableTennisChampionship
TableTennisChampionship/TableTennisChampionshipMain/ViewModels/TournamentPlayerInfo.cs
TableTennisChampionship/TableTennisChampionshipMain/ViewModels/TournamentPlayerInfo.cs
namespace TableTennisChampionshipMain.ViewModels { using System; using System.Collections.Generic; using System.Linq; using System.Web; using TableTennisChampionshipMain.Infrastructure; using TableTennisChampionship.Model.DataBaseModel; using System.ComponentModel.DataAnnotations; public class TournamentPlayerInfo : IMapFrom<TournamentPlayer> ,IHaveCustomMappings { public int TournamentPlayerID { get; set; } [Required] public int TournamentID { get; set; } [Required] public int PlayerID { get; set; } public string PlayerFullName { get; set; } public int Rank { get; set; } public int Points { get; set; } #region IHaveCustomMappings Members public void CreateMappings(AutoMapper.IConfiguration configuration) { configuration.CreateMap<TournamentPlayer, TournamentPlayerInfo>() .ForMember(m => m.PlayerFullName, opt => opt.MapFrom(x => x.Player.FirstName + " " + x.Player.LastName)); } #endregion } }
 namespace TableTennisChampionshipMain.ViewModels { using System; using System.Collections.Generic; using System.Linq; using System.Web; using TableTennisChampionshipMain.Infrastructure; using TableTennisChampionship.Model.DataBaseModel; using System.ComponentModel.DataAnnotations; public class TournamentPlayerInfo : IMapFrom<TournamentPlayer> ,IHaveCustomMappings { public int TournamentPlayerID { get; set; } [Required] public int TournamentID { get; set; } [Required] public int PlayerID { get; set; } public string PlayerFullName { get; set; } public int Rank { get; set; } public int Points { get; set; } #region IHaveCustomMappings Members public void CreateMappings(AutoMapper.IConfiguration configuration) { configuration.CreateMap<TournamentPlayer, TournamentPlayerInfo>() .ForMember(m => m.PlayerFullName, opt => opt.MapFrom(x => x.Player.FirstName + " " + x.Player.LastName)); } #endregion } }
mit
C#
ef57b8eec49ca310ba9b6e2c6ace521ccc8443bf
make identity case insensitive
Soluto/tweek,Soluto/tweek,Soluto/tweek,Soluto/tweek,Soluto/tweek,Soluto/tweek
core/Engine/Engine.DataTypes/Identity.cs
core/Engine/Engine.DataTypes/Identity.cs
using System; namespace Engine.DataTypes { public class Identity: Tuple<string, string> { public string Type => Item1; public string Id => Item2; public Identity(string type, string id) : base(type.ToLower(), id.ToLower()) { } public const string GlobalIdentityType = "@global"; public static readonly Identity GlobalIdentity = new Identity(GlobalIdentityType, ""); } }
using System; namespace Engine.DataTypes { public class Identity: Tuple<string, string> { public string Type => Item1; public string Id => Item2; public Identity(string type, string id) : base(type, id) { } public const string GlobalIdentityType = "@global"; public static readonly Identity GlobalIdentity = new Identity(GlobalIdentityType, ""); } }
mit
C#
49b1c52df5e8d2bf03768dc35ba6575e88277bc7
Add `Unmanaged` calling convention (#852)
jbevain/cecil
Mono.Cecil/MethodCallingConvention.cs
Mono.Cecil/MethodCallingConvention.cs
// // Author: // Jb Evain ([email protected]) // // Copyright (c) 2008 - 2015 Jb Evain // Copyright (c) 2008 - 2011 Novell, Inc. // // Licensed under the MIT/X11 license. // namespace Mono.Cecil { public enum MethodCallingConvention : byte { Default = 0x0, C = 0x1, StdCall = 0x2, ThisCall = 0x3, FastCall = 0x4, VarArg = 0x5, Unmanaged = 0x9, Generic = 0x10, } }
// // Author: // Jb Evain ([email protected]) // // Copyright (c) 2008 - 2015 Jb Evain // Copyright (c) 2008 - 2011 Novell, Inc. // // Licensed under the MIT/X11 license. // namespace Mono.Cecil { public enum MethodCallingConvention : byte { Default = 0x0, C = 0x1, StdCall = 0x2, ThisCall = 0x3, FastCall = 0x4, VarArg = 0x5, Generic = 0x10, } }
mit
C#
afd4740c609eafd48ab4cd6a539db47a3ba3778e
Use floats across the camera calculations /2 > 0.5f
paseb/HoloToolkit-Unity,HoloFan/HoloToolkit-Unity,ForrestTrepte/HoloToolkit-Unity,out-of-pixel/HoloToolkit-Unity,NeerajW/HoloToolkit-Unity,willcong/HoloToolkit-Unity,HattMarris1/HoloToolkit-Unity,dbastienMS/HoloToolkit-Unity,paseb/MixedRealityToolkit-Unity
Assets/HoloToolkit/Utilities/Scripts/Extensions/CameraExtensions.cs
Assets/HoloToolkit/Utilities/Scripts/Extensions/CameraExtensions.cs
using UnityEngine; namespace HoloToolkit.Unity { public static class CameraExtensions { /// <summary> /// Get the horizontal FOV from the stereo camera /// </summary> /// <returns></returns> public static float GetHorizontalFieldOfViewRadians(this Camera camera) { float horizontalFovRadians = 2f * Mathf.Atan(Mathf.Tan(camera.fieldOfView * Mathf.Deg2Rad * 0.5f) * camera.aspect); return horizontalFovRadians; } /// <summary> /// Returns if a point will be rendered on the screen in either eye /// </summary> /// <param name="position"></param> /// <returns></returns> public static bool IsInFOV(this Camera camera, Vector3 position) { float verticalFovHalf = camera.fieldOfView * 0.5f; float horizontalFovHalf = camera.GetHorizontalFieldOfViewRadians() * Mathf.Rad2Deg * 0.5f; Vector3 deltaPos = position - camera.transform.position; Vector3 headDeltaPos = MathUtils.TransformDirectionFromTo(null, camera.transform, deltaPos).normalized; float yaw = Mathf.Asin(headDeltaPos.x) * Mathf.Rad2Deg; float pitch = Mathf.Asin(headDeltaPos.y) * Mathf.Rad2Deg; return (Mathf.Abs(yaw) < horizontalFovHalf && Mathf.Abs(pitch) < verticalFovHalf); } } }
using UnityEngine; namespace HoloToolkit.Unity { public static class CameraExtensions { /// <summary> /// Get the horizontal FOV from the stereo camera /// </summary> /// <returns></returns> public static float GetHorizontalFieldOfViewRadians(this Camera camera) { float horizontalFovRadians = 2 * Mathf.Atan(Mathf.Tan((camera.fieldOfView * Mathf.Deg2Rad) / 2) * camera.aspect); return horizontalFovRadians; } /// <summary> /// Returns if a point will be rendered on the screen in either eye /// </summary> /// <param name="position"></param> /// <returns></returns> public static bool IsInFOV(this Camera camera, Vector3 position) { float verticalFovHalf = camera.fieldOfView / 2; float horizontalFovHalf = camera.GetHorizontalFieldOfViewRadians() * Mathf.Rad2Deg / 2; Vector3 deltaPos = position - camera.transform.position; Vector3 headDeltaPos = MathUtils.TransformDirectionFromTo(null, camera.transform, deltaPos).normalized; float yaw = Mathf.Asin(headDeltaPos.x) * Mathf.Rad2Deg; float pitch = Mathf.Asin(headDeltaPos.y) * Mathf.Rad2Deg; return (Mathf.Abs(yaw) < horizontalFovHalf && Mathf.Abs(pitch) < verticalFovHalf); } } }
mit
C#
a046af0229646421e7c4e2274c8d069b105f9f71
Clean up.
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi/Tor/Socks5/Models/Fields/ByteArrayFields/UNameField.cs
WalletWasabi/Tor/Socks5/Models/Fields/ByteArrayFields/UNameField.cs
using System.Text; using WalletWasabi.Helpers; using WalletWasabi.Tor.Socks5.Models.Bases; namespace WalletWasabi.Tor.Socks5.Models.Fields.ByteArrayFields { public class UNameField : ByteArraySerializableBase { public UNameField(byte[] bytes) { Bytes = Guard.NotNullOrEmpty(nameof(bytes), bytes); } public UNameField(string uName) : this(Encoding.UTF8.GetBytes(uName)) { } private byte[] Bytes { get; } public override byte[] ToBytes() => Bytes; } }
using System.Text; using WalletWasabi.Helpers; using WalletWasabi.Tor.Socks5.Models.Bases; namespace WalletWasabi.Tor.Socks5.Models.Fields.ByteArrayFields { public class UNameField : ByteArraySerializableBase { #region Constructors public UNameField(byte[] bytes) { Bytes = Guard.NotNullOrEmpty(nameof(bytes), bytes); } public UNameField(string uName) : this(Encoding.UTF8.GetBytes(uName)) { } #endregion Constructors #region PropertiesAndMembers private byte[] Bytes { get; } public string UName => Encoding.UTF8.GetString(Bytes); // Tor accepts UTF8 encoded passwd #endregion PropertiesAndMembers #region Serialization public override byte[] ToBytes() => Bytes; #endregion Serialization } }
mit
C#
10c9b3d971757d12f265e18fcf6c86c4c9d959e4
Fix Dictionary type to be more useful
ilovepi/Compiler,ilovepi/Compiler
compiler/middleend/ir/ParseResult.cs
compiler/middleend/ir/ParseResult.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace compiler.middleend.ir { class ParseResult { public Operand Operand { get; set; } public List<Instruction> Instructions { get; set; } public Dictionary<int, SsaVariable> VarTable { get; set; } public ParseResult() { Operand = null; Instructions = null; VarTable = new Dictionary<int, SsaVariable>(); } public ParseResult(Dictionary<int, SsaVariable> symTble ) { Operand = null; Instructions = null; VarTable = new Dictionary<int, SsaVariable>(symTble); } public ParseResult(Operand pOperand, List<Instruction> pInstructions, Dictionary<int, SsaVariable> pSymTble) { Operand = pOperand; Instructions = new List<Instruction>(pInstructions); VarTable = new Dictionary<int, SsaVariable>(pSymTble); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace compiler.middleend.ir { class ParseResult { public Operand Operand { get; set; } public List<Instruction> Instructions { get; set; } public Dictionary<SsaVariable, Instruction> VarTable { get; set; } public ParseResult() { Operand = null; Instructions = null; VarTable = new Dictionary<SsaVariable, Instruction>(); } public ParseResult(Dictionary<SsaVariable, Instruction> symTble ) { Operand = null; Instructions = null; VarTable = new Dictionary<SsaVariable, Instruction>(symTble); } public ParseResult(Operand pOperand, List<Instruction> pInstructions, Dictionary<SsaVariable, Instruction> pSymTble) { Operand = pOperand; Instructions = new List<Instruction>(pInstructions); VarTable = new Dictionary<SsaVariable, Instruction>(pSymTble); } } }
mit
C#
59de17dfb20252c87b83b3f52e738816a8f71315
Change list to observablecollection
grantcolley/authorisationmanager,grantcolley/authorisationmanager,grantcolley/authorisationmanager,grantcolley/authorisationmanager
UI/WPF/Model/UserNode.cs
UI/WPF/Model/UserNode.cs
using System.Collections.ObjectModel; using DevelopmentInProgress.DipSecure; namespace DevelopmentInProgress.AuthorisationManager.WPF.Model { public class UserNode : EntityBase { public UserNode(UserAuthorisation userAuthorisation) { UserAuthorisation = userAuthorisation; Roles = new ObservableCollection<RoleNode>(); } public ObservableCollection<RoleNode> Roles { get; set; } public UserAuthorisation UserAuthorisation { get; private set; } public override int Id { get { return UserAuthorisation.Id; } set { UserAuthorisation.Id = value; OnPropertyChanged("Id"); } } public override string Text { get { return UserAuthorisation.UserName; } set { UserAuthorisation.UserName = value; OnPropertyChanged("Text"); } } public override string Description { get { return UserAuthorisation.DisplayName; } set { UserAuthorisation.DisplayName = value; OnPropertyChanged("Description"); } } } }
using System.Collections.Generic; using DevelopmentInProgress.DipSecure; namespace DevelopmentInProgress.AuthorisationManager.WPF.Model { public class UserNode : EntityBase { public UserNode(UserAuthorisation userAuthorisation) { UserAuthorisation = userAuthorisation; Roles = new List<RoleNode>(); } public List<RoleNode> Roles { get; set; } public UserAuthorisation UserAuthorisation { get; private set; } public override int Id { get { return UserAuthorisation.Id; } set { UserAuthorisation.Id = value; OnPropertyChanged("Id"); } } public override string Text { get { return UserAuthorisation.UserName; } set { UserAuthorisation.UserName = value; OnPropertyChanged("Text"); } } public override string Description { get { return UserAuthorisation.DisplayName; } set { UserAuthorisation.DisplayName = value; OnPropertyChanged("Description"); } } } }
apache-2.0
C#
507b383e5955a7de27905d8093162d6be86c4a13
Update Bootstrap package in v4 test pages to v4.6.2
atata-framework/atata-bootstrap,atata-framework/atata-bootstrap
test/Atata.Bootstrap.TestApp/Pages/v4/_Layout.cshtml
test/Atata.Bootstrap.TestApp/Pages/v4/_Layout.cshtml
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>@ViewBag.Title - Atata.Bootstrap.TestApp v4</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous"> @RenderSection("styles", false) </head> <body> <div class="container"> <h1 class="text-center">@ViewBag.Title</h1> @RenderBody() </div> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script> @RenderSection("scripts", false) </body> </html>
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>@ViewBag.Title</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous"> @RenderSection("styles", false) </head> <body> <div class="container"> <h1 class="text-center">@ViewBag.Title</h1> @RenderBody() </div> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script> @RenderSection("scripts", false) </body> </html>
apache-2.0
C#
a6f5d3580a8add0633de58571b229715347b8239
Fix warnings.
sshnet/SSH.NET
src/Renci.SshNet.Tests/Classes/ClientAuthenticationTest.cs
src/Renci.SshNet.Tests/Classes/ClientAuthenticationTest.cs
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; namespace Renci.SshNet.Tests.Classes { [TestClass] public class ClientAuthenticationTest { private ClientAuthentication _clientAuthentication; [TestInitialize] public void Init() { _clientAuthentication = new ClientAuthentication(); } [TestMethod] public void AuthenticateShouldThrowArgumentNullExceptionWhenConnectionInfoIsNull() { const IConnectionInfoInternal connectionInfo = null; var session = new Mock<ISession>(MockBehavior.Strict).Object; try { _clientAuthentication.Authenticate(connectionInfo, session); Assert.Fail(); } catch (ArgumentNullException ex) { Assert.IsNull(ex.InnerException); Assert.AreEqual("connectionInfo", ex.ParamName); } } [TestMethod] public void AuthenticateShouldThrowArgumentNullExceptionWhenSessionIsNull() { var connectionInfo = new Mock<IConnectionInfoInternal>(MockBehavior.Strict).Object; const ISession session = null; try { _clientAuthentication.Authenticate(connectionInfo, session); Assert.Fail(); } catch (ArgumentNullException ex) { Assert.IsNull(ex.InnerException); Assert.AreEqual("session", ex.ParamName); } } } }
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; namespace Renci.SshNet.Tests.Classes { [TestClass] public class ClientAuthenticationTest { private ClientAuthentication _clientAuthentication; [TestInitialize] public void Init() { _clientAuthentication = new ClientAuthentication(); } [TestMethod] public void AuthenticateShouldThrowArgumentNullExceptionWhenConnectionInfoIsNull() { IConnectionInfoInternal connectionInfo = null; var session = new Mock<ISession>(MockBehavior.Strict).Object; try { _clientAuthentication.Authenticate(connectionInfo, session); Assert.Fail(); } catch (ArgumentNullException ex) { Assert.IsNull(ex.InnerException); Assert.AreEqual("connectionInfo", ex.ParamName); } } [TestMethod] public void AuthenticateShouldThrowArgumentNullExceptionWhenSessionIsNull() { var connectionInfo = new Mock<IConnectionInfoInternal>(MockBehavior.Strict).Object; ISession session = null; try { _clientAuthentication.Authenticate(connectionInfo, session); Assert.Fail(); } catch (ArgumentNullException ex) { Assert.IsNull(ex.InnerException); Assert.AreEqual("session", ex.ParamName); } } } }
mit
C#
5cc73aa5225de32dbbc4f4a8c8c43be78e00dca9
Rename "ConstructBuilder" to "FindRequestHandler" as "ConstructBuilder" is a weak name that no longer accurately describes what this does Also more detail in the error message
danhaller/SevenDigital.Api.Wrapper,bnathyuw/SevenDigital.Api.Wrapper,emashliles/SevenDigital.Api.Wrapper,AnthonySteele/SevenDigital.Api.Wrapper,bettiolo/SevenDigital.Api.Wrapper,gregsochanik/SevenDigital.Api.Wrapper,luiseduardohdbackup/SevenDigital.Api.Wrapper,mattgray/SevenDigital.Api.Wrapper,minkaotic/SevenDigital.Api.Wrapper,danbadge/SevenDigital.Api.Wrapper
src/SevenDigital.Api.Wrapper/EndpointResolution/RequestCoordinator.cs
src/SevenDigital.Api.Wrapper/EndpointResolution/RequestCoordinator.cs
using System; using System.Collections.Generic; using SevenDigital.Api.Wrapper.EndpointResolution.RequestHandlers; using SevenDigital.Api.Wrapper.Http; namespace SevenDigital.Api.Wrapper.EndpointResolution { public class RequestCoordinator : IRequestCoordinator { private readonly IEnumerable<RequestHandler> _requestHandlers; public IHttpClient HttpClient { get; set; } public RequestCoordinator(IHttpClient httpClient, IEnumerable<RequestHandler> requestHandlers) { HttpClient = httpClient; _requestHandlers = requestHandlers; } public string ConstructEndpoint(RequestData requestData) { var requestHandler = FindRequestHandler(requestData.HttpMethod); return requestHandler.ConstructEndpoint(requestData); } private RequestHandler FindRequestHandler(string httpMethod) { var upperHttpMethodName = httpMethod.ToUpperInvariant(); foreach (var requestHandler in _requestHandlers) { if (requestHandler.HandlesMethod(upperHttpMethodName)) { return requestHandler; } } string errorMessage = string.Format("No RequestHandler supplied for method '{0}'", upperHttpMethodName); throw new NotImplementedException(errorMessage); } public virtual Response HitEndpoint(RequestData requestData) { var requestHandler = FindRequestHandler(requestData.HttpMethod); requestHandler.HttpClient = HttpClient; return requestHandler.HitEndpoint(requestData); } public virtual void HitEndpointAsync(RequestData requestData, Action<Response> callback) { var requestHandler = FindRequestHandler(requestData.HttpMethod); requestHandler.HttpClient = HttpClient; requestHandler.HitEndpointAsync(requestData, callback); } } }
using System; using System.Collections.Generic; using SevenDigital.Api.Wrapper.EndpointResolution.RequestHandlers; using SevenDigital.Api.Wrapper.Http; namespace SevenDigital.Api.Wrapper.EndpointResolution { public class RequestCoordinator : IRequestCoordinator { private readonly IEnumerable<RequestHandler> _requestHandlers; public IHttpClient HttpClient { get; set; } public RequestCoordinator(IHttpClient httpClient, IEnumerable<RequestHandler> requestHandlers) { HttpClient = httpClient; _requestHandlers = requestHandlers; } public string ConstructEndpoint(RequestData requestData) { return ConstructBuilder(requestData).ConstructEndpoint(requestData); } private RequestHandler ConstructBuilder(RequestData requestData) { var upperInvariant = requestData.HttpMethod.ToUpperInvariant(); foreach (var requestHandler in _requestHandlers) { if (requestHandler.HandlesMethod(upperInvariant)) { return requestHandler; } } throw new NotImplementedException("No RequestHandlers supplied that can deal with this method"); } public virtual Response HitEndpoint(RequestData requestData) { var builder = ConstructBuilder(requestData); builder.HttpClient = HttpClient; return builder.HitEndpoint(requestData); } public virtual void HitEndpointAsync(RequestData requestData, Action<Response> callback) { var builder = ConstructBuilder(requestData); builder.HttpClient = HttpClient; builder.HitEndpointAsync(requestData, callback); } } }
mit
C#
29c7a8df70ea0143ffaa243fa1ff997fd5bb23b8
fix bug in fal copy. (#1052)
superyyrrzz/docfx,hellosnow/docfx,pascalberger/docfx,superyyrrzz/docfx,DuncanmaMSFT/docfx,dotnet/docfx,928PJY/docfx,pascalberger/docfx,928PJY/docfx,928PJY/docfx,hellosnow/docfx,hellosnow/docfx,superyyrrzz/docfx,DuncanmaMSFT/docfx,dotnet/docfx,LordZoltan/docfx,dotnet/docfx,LordZoltan/docfx,LordZoltan/docfx,pascalberger/docfx,LordZoltan/docfx
src/Microsoft.DocAsCode.Common/FileAbstractLayer/RealFileWriter.cs
src/Microsoft.DocAsCode.Common/FileAbstractLayer/RealFileWriter.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.DocAsCode.Common { using System; using System.Collections.Immutable; using System.IO; public class RealFileWriter : FileWriterBase { public RealFileWriter(string outputFolder) : base(outputFolder) { } #region Overrides public override void Copy(PathMapping sourceFileName, RelativePath destFileName) { var f = Path.Combine(ExpandedOutputFolder, destFileName.RemoveWorkingFolder()); Directory.CreateDirectory(Path.GetDirectoryName(f)); File.Copy(Environment.ExpandEnvironmentVariables(sourceFileName.PhysicalPath), f, true); File.SetAttributes(f, FileAttributes.Normal); } public override Stream Create(RelativePath file) { var f = Path.Combine(ExpandedOutputFolder, file.RemoveWorkingFolder()); Directory.CreateDirectory(Path.GetDirectoryName(f)); return File.Create(f); } public override IFileReader CreateReader() { return new RealFileReader(OutputFolder, ImmutableDictionary<string, string>.Empty); } #endregion } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.DocAsCode.Common { using System; using System.Collections.Immutable; using System.IO; public class RealFileWriter : FileWriterBase { public RealFileWriter(string outputFolder) : base(outputFolder) { } #region Overrides public override void Copy(PathMapping sourceFileName, RelativePath destFileName) { var f = Path.Combine(ExpandedOutputFolder, destFileName.RemoveWorkingFolder()); Directory.CreateDirectory(Path.GetDirectoryName(f)); File.Copy(Environment.ExpandEnvironmentVariables(sourceFileName.PhysicalPath), f); File.SetAttributes(f, FileAttributes.Normal); } public override Stream Create(RelativePath file) { var f = Path.Combine(ExpandedOutputFolder, file.RemoveWorkingFolder()); Directory.CreateDirectory(Path.GetDirectoryName(f)); return File.Create(f); } public override IFileReader CreateReader() { return new RealFileReader(OutputFolder, ImmutableDictionary<string, string>.Empty); } #endregion } }
mit
C#
549c76bf53e332658be1965834a8832bdc565fae
Fix type of p4
setchi/Unity-LineSegmentsIntersection
Assets/LineSegmentIntersection/Scripts/Math2d.cs
Assets/LineSegmentIntersection/Scripts/Math2d.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace LineSegmentsIntersection { public static class Math2d { public static bool LineSegmentsIntersection(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, out Vector2 intersection) { intersection = Vector2.zero; var d = (p2.x - p1.x) * (p4.y - p3.y) - (p2.y - p1.y) * (p4.x - p3.x); if (d == 0.0f) { return false; } var u = ((p3.x - p1.x) * (p4.y - p3.y) - (p3.y - p1.y) * (p4.x - p3.x)) / d; var v = ((p3.x - p1.x) * (p2.y - p1.y) - (p3.y - p1.y) * (p2.x - p1.x)) / d; if (u < 0.0f || u > 1.0f || v < 0.0f || v > 1.0f) { return false; } intersection.x = p1.x + u * (p2.x - p1.x); intersection.y = p1.y + u * (p2.y - p1.y); return true; } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace LineSegmentsIntersection { public static class Math2d { public static bool LineSegmentsIntersection(Vector2 p1, Vector2 p2, Vector2 p3, Vector3 p4, out Vector2 intersection) { intersection = Vector2.zero; var d = (p2.x - p1.x) * (p4.y - p3.y) - (p2.y - p1.y) * (p4.x - p3.x); if (d == 0.0f) { return false; } var u = ((p3.x - p1.x) * (p4.y - p3.y) - (p3.y - p1.y) * (p4.x - p3.x)) / d; var v = ((p3.x - p1.x) * (p2.y - p1.y) - (p3.y - p1.y) * (p2.x - p1.x)) / d; if (u < 0.0f || u > 1.0f || v < 0.0f || v > 1.0f) { return false; } intersection.x = p1.x + u * (p2.x - p1.x); intersection.y = p1.y + u * (p2.y - p1.y); return true; } } }
mit
C#
f1f7f47ce0f653842644e3dfda41c84c22b62b0e
Fix calculation for Room.top & Room.bottom
Saduras/DungeonGenerator
Assets/SourceCode/Room.cs
Assets/SourceCode/Room.cs
using UnityEngine; public class Room : MonoBehaviour { public float width { get { return transform.localScale.x; } } public float length { get { return transform.localScale.z; } } public float top { get { return transform.localPosition.z + length / 2; } } public float bottom { get { return transform.localPosition.z - length / 2; } } public float left { get { return transform.localPosition.x - width / 2; } } public float right { get { return transform.localPosition.x + width / 2; } } public void Init(int width, int length) { transform.localScale = new Vector3 (width, 1f, length); } }
using UnityEngine; public class Room : MonoBehaviour { public float width { get { return transform.localScale.x; } } public float length { get { return transform.localScale.z; } } public float top { get { return transform.localPosition.z + width / 2; } } public float bottom { get { return transform.localPosition.z - width / 2; } } public float left { get { return transform.localPosition.x - width / 2; } } public float right { get { return transform.localPosition.x + width / 2; } } public void Init(int width, int length) { transform.localScale = new Vector3 (width, 1f, length); } }
mit
C#
abffd8293bec00982d72d40cd986a950d13122fe
Fix fat-finger made before the previous commit
Lunch-box/SimpleOrderRouting
CSharp/SimpleOrderRouting.Journey1/ExecutionState.cs
CSharp/SimpleOrderRouting.Journey1/ExecutionState.cs
namespace SimpleOrderRouting.Journey1 { public class ExecutionState { public ExecutionState(InvestorInstruction investorInstruction) { this.Quantity = investorInstruction.Quantity; this.Price = investorInstruction.Price; this.Way = investorInstruction.Way; this.AllowPartialExecution = investorInstruction.AllowPartialExecution; } public int Quantity { get; set; } public decimal Price { get; set; } public Way Way { get; set; } public bool AllowPartialExecution { get; set; } public void Executed(int quantity) { this.Quantity -= quantity; } } }
namespace SimpleOrderRouting.Journey1 { public class ExecutionState { public ExecutionState(InvestorInstruction investorInstruction) { this.Quantity = investorInstruction.Quantity; this.Price = investorInstruction.Price; this.Way = investorInstruction.Way; this.AllowPartialExecution = investorInstruction.AllowPartialExecution; } public int Quantity { get; set; } public decimal Price { get; set; } public Way Way { get; set; } public bool AllowPartialExecution { get; set; } { this.Quantity -= quantity; } } }
apache-2.0
C#
984f9a550bdbcc5e6c293fa62244b22dc605582f
Fix random power use when cooldown
solfen/Rogue_Cadet
Assets/Scripts/SpecialPowers/PowerRandom.cs
Assets/Scripts/SpecialPowers/PowerRandom.cs
using UnityEngine; using System.Collections; using System.Collections.Generic; public class PowerRandom : BaseSpecialPower { [SerializeField] private List<BaseSpecialPower> powers; private BaseSpecialPower activePower = null; protected override void Start() { base.Start(); activePower = Instantiate(powers[Random.Range(0, powers.Count)], transform.parent, false) as BaseSpecialPower; } protected override void Activate() { if(activePower.coolDownTimer <= 0) StartCoroutine(WaitForDestroy()); } protected override void Update() { if(activePower.mana > 0) { base.Update(); } } IEnumerator WaitForDestroy() { yield return null; while(activePower.coolDownTimer > 0) { yield return null; } float currentMana = activePower.mana; Debug.Log(currentMana); DestroyImmediate(activePower.gameObject); activePower = Instantiate(powers[Random.Range(0, powers.Count)], transform.parent, false) as BaseSpecialPower; yield return null; activePower.mana = currentMana; yield return null; EventDispatcher.DispatchEvent(Events.SPECIAL_POWER_USED, activePower); //to activate the UI } }
using UnityEngine; using System.Collections; using System.Collections.Generic; public class PowerRandom : BaseSpecialPower { [SerializeField] private List<BaseSpecialPower> powers; private BaseSpecialPower activePower = null; protected override void Start() { base.Start(); activePower = Instantiate(powers[Random.Range(0, powers.Count)], transform.parent, false) as BaseSpecialPower; } protected override void Activate() { StartCoroutine(WaitForDestroy()); } protected override void Update() { if(activePower.mana > 0) { base.Update(); } } IEnumerator WaitForDestroy() { yield return null; while(activePower.coolDownTimer > 0) { yield return null; } float currentMana = activePower.mana; DestroyImmediate(activePower.gameObject); activePower = Instantiate(powers[Random.Range(0, powers.Count)], transform.parent, false) as BaseSpecialPower; yield return null; activePower.mana = currentMana; yield return null; EventDispatcher.DispatchEvent(Events.SPECIAL_POWER_USED, activePower); //to activate the UI } }
mit
C#
167d3b1a6a156463a68513ed6f18cac64a1c4fab
Update WindowsRegistrySettingsServiceOptions.cs
tiksn/TIKSN-Framework
TIKSN.Framework.Core/Settings/WindowsRegistrySettingsServiceOptions.cs
TIKSN.Framework.Core/Settings/WindowsRegistrySettingsServiceOptions.cs
using Microsoft.Win32; namespace TIKSN.Settings { public class WindowsRegistrySettingsServiceOptions { public WindowsRegistrySettingsServiceOptions() => this.RegistryView = RegistryView.Default; public RegistryView RegistryView { get; set; } public string SubKey { get; set; } } }
using Microsoft.Win32; namespace TIKSN.Settings { public class WindowsRegistrySettingsServiceOptions { public WindowsRegistrySettingsServiceOptions() { RegistryView = RegistryView.Default; } public RegistryView RegistryView { get; set; } public string SubKey { get; set; } } }
mit
C#
afb15950afb313a4f26bfdbb39d0666f6500485d
Improve ToString when Id is null
drewnoakes/dasher
Dasher.Schemata/Schema.cs
Dasher.Schemata/Schema.cs
using System.Collections.Generic; using System.Xml.Linq; using JetBrains.Annotations; namespace Dasher.Schemata { public interface IWriteSchema { /// <summary> /// Creates a deep copy of this schema within <paramref name="collection"/>. /// </summary> /// <param name="collection"></param> /// <returns></returns> IWriteSchema CopyTo(SchemaCollection collection); } public interface IReadSchema { bool CanReadFrom(IWriteSchema writeSchema, bool strict); /// <summary> /// Creates a deep copy of this schema within <paramref name="collection"/>. /// </summary> /// <param name="collection"></param> /// <returns></returns> IReadSchema CopyTo(SchemaCollection collection); } public abstract class Schema { internal abstract IEnumerable<Schema> Children { get; } public override bool Equals(object obj) { var other = obj as Schema; return other != null && Equals(other); } public abstract bool Equals(Schema other); public override int GetHashCode() => ComputeHashCode(); protected abstract int ComputeHashCode(); } /// <summary>For complex, union and enum.</summary> public abstract class ByRefSchema : Schema { [CanBeNull] internal string Id { get; set; } internal abstract XElement ToXml(); public override string ToString() => Id ?? GetType().Name; } /// <summary>For primitive, nullable, list, dictionary, tuple, empty.</summary> public abstract class ByValueSchema : Schema { internal abstract string MarkupValue { get; } public override string ToString() => MarkupValue; } }
using System.Collections.Generic; using System.Xml.Linq; using JetBrains.Annotations; namespace Dasher.Schemata { public interface IWriteSchema { /// <summary> /// Creates a deep copy of this schema within <paramref name="collection"/>. /// </summary> /// <param name="collection"></param> /// <returns></returns> IWriteSchema CopyTo(SchemaCollection collection); } public interface IReadSchema { bool CanReadFrom(IWriteSchema writeSchema, bool strict); /// <summary> /// Creates a deep copy of this schema within <paramref name="collection"/>. /// </summary> /// <param name="collection"></param> /// <returns></returns> IReadSchema CopyTo(SchemaCollection collection); } public abstract class Schema { internal abstract IEnumerable<Schema> Children { get; } public override bool Equals(object obj) { var other = obj as Schema; return other != null && Equals(other); } public abstract bool Equals(Schema other); public override int GetHashCode() => ComputeHashCode(); protected abstract int ComputeHashCode(); } /// <summary>For complex, union and enum.</summary> public abstract class ByRefSchema : Schema { [CanBeNull] internal string Id { get; set; } internal abstract XElement ToXml(); public override string ToString() => Id; } /// <summary>For primitive, nullable, list, dictionary, tuple, empty.</summary> public abstract class ByValueSchema : Schema { internal abstract string MarkupValue { get; } public override string ToString() => MarkupValue; } }
apache-2.0
C#
f3dd77c8eb02a7212495eb29692d22f50156aff7
Use HashSet to ensure no duplicate collidingObjects
JScott/ViveGrip
Assets/ViveGrip/Scripts/Internal/ViveGrip_TouchDetection.cs
Assets/ViveGrip/Scripts/Internal/ViveGrip_TouchDetection.cs
using UnityEngine; using System.Collections.Generic; public class ViveGrip_TouchDetection : MonoBehaviour { private HashSet<ViveGrip_Object> collidingObjects = new HashSet<ViveGrip_Object>(); void Start () { GetComponent<SphereCollider>().isTrigger = true; } void OnTriggerEnter(Collider other) { ViveGrip_Object component = ActiveComponent(other.gameObject); if (component == null) { return; } collidingObjects.Add(component); } void OnTriggerExit(Collider other) { ViveGrip_Object component = ActiveComponent(other.gameObject); if (component == null) { return; } collidingObjects.Remove(component); } public GameObject NearestObject() { float closestDistance = Mathf.Infinity; GameObject touchedObject = null; foreach (ViveGrip_Object component in collidingObjects) { float distance = Vector3.Distance(transform.position, component.transform.position); if (distance < closestDistance) { touchedObject = component.gameObject; closestDistance = distance; } } return touchedObject; } ViveGrip_Object ActiveComponent(GameObject gameObject) { if (gameObject == null) { return null; } // Happens with Destroy() sometimes ViveGrip_Object component = ValidComponent(gameObject.transform); if (component == null) { component = ValidComponent(gameObject.transform.parent); } if (component != null) { return component; } return null; } ViveGrip_Object ValidComponent(Transform transform) { if (transform == null) { return null; } ViveGrip_Object component = transform.GetComponent<ViveGrip_Object>(); if (component != null && component.enabled) { return component; } return null; } }
using UnityEngine; using System.Collections.Generic; public class ViveGrip_TouchDetection : MonoBehaviour { private List<ViveGrip_Object> collidingObjects = new List<ViveGrip_Object>(); void Start () { GetComponent<SphereCollider>().isTrigger = true; } void OnTriggerEnter(Collider other) { ViveGrip_Object component = ActiveComponent(other.gameObject); if (component == null) { return; } collidingObjects.Add(component); } void OnTriggerExit(Collider other) { ViveGrip_Object component = ActiveComponent(other.gameObject); if (component == null) { return; } collidingObjects.Remove(component); } public GameObject NearestObject() { float closestDistance = Mathf.Infinity; GameObject touchedObject = null; foreach (ViveGrip_Object component in collidingObjects) { float distance = Vector3.Distance(transform.position, component.transform.position); if (distance < closestDistance) { touchedObject = component.gameObject; closestDistance = distance; } } return touchedObject; } ViveGrip_Object ActiveComponent(GameObject gameObject) { if (gameObject == null) { return null; } // Happens with Destroy() sometimes ViveGrip_Object component = ValidComponent(gameObject.transform); if (component == null) { component = ValidComponent(gameObject.transform.parent); } if (component != null) { return component; } return null; } ViveGrip_Object ValidComponent(Transform transform) { if (transform == null) { return null; } ViveGrip_Object component = transform.GetComponent<ViveGrip_Object>(); if (component != null && component.enabled) { return component; } return null; } }
mit
C#
740a6d9bb52fd9ea8894de60df87f585a91db7d8
Support full range of comparison operators instead of IndexOf
adoprog/Sitecore-Mobile-Device-Detector
MobileDeviceDetector/Rules/Conditions/UserAgentCondition.cs
MobileDeviceDetector/Rules/Conditions/UserAgentCondition.cs
namespace Sitecore.SharedSource.MobileDeviceDetector.Rules.Conditions { using System; using System.Web; using Sitecore.Diagnostics; using Sitecore.Rules; using Sitecore.Rules.Conditions; /// <summary> /// UserAgentCondition /// </summary> /// <typeparam name="T"></typeparam> public class UserAgentCondition<T> : StringOperatorCondition<T> where T : RuleContext { /// <summary> /// Gets or sets the value. /// </summary> /// <value>The value.</value> public string Value { get; set; } /// <summary> /// Executes the specified rule context. /// </summary> /// <param name="ruleContext">The rule context.</param> /// <returns>Returns value indicating whether Device UserAgent matches Value or not</returns> protected override bool Execute(T ruleContext) { Assert.ArgumentNotNull(ruleContext, "ruleContext"); string str = this.Value ?? string.Empty; var userAgent = HttpContext.Current.Request.UserAgent; if (!string.IsNullOrEmpty(userAgent)) { return Compare(str, userAgent); } return false; } } }
namespace Sitecore.SharedSource.MobileDeviceDetector.Rules.Conditions { using System; using System.Web; using Sitecore.Diagnostics; using Sitecore.Rules; using Sitecore.Rules.Conditions; /// <summary> /// UserAgentCondition /// </summary> /// <typeparam name="T"></typeparam> public class UserAgentCondition<T> : StringOperatorCondition<T> where T : RuleContext { /// <summary> /// Gets or sets the value. /// </summary> /// <value>The value.</value> public string Value { get; set; } /// <summary> /// Executes the specified rule context. /// </summary> /// <param name="ruleContext">The rule context.</param> /// <returns>Returns value indicating whether Device UserAgent matches Value or not</returns> protected override bool Execute(T ruleContext) { Assert.ArgumentNotNull(ruleContext, "ruleContext"); string str = this.Value ?? string.Empty; var userAgent = HttpContext.Current.Request.UserAgent; if (!string.IsNullOrEmpty(userAgent)) { return userAgent.IndexOf(str, StringComparison.OrdinalIgnoreCase) >= 0; } return false; } } }
mit
C#
795d109e9dfeab2eb1c3bbf1c893a0f6399edf7c
Fix twitter issue
libertyernie/WeasylSync
CrosspostSharp3/Program.cs
CrosspostSharp3/Program.cs
using ISchemm.WinFormsOAuth; using Newtonsoft.Json; using SourceWrappers; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using Tweetinvi; using Tweetinvi.Logic.JsonConverters; using Tweetinvi.Models; namespace CrosspostSharp3 { public class CustomJsonLanguageConverter : JsonLanguageConverter { public override object ReadJson(JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) { return reader.Value != null ? base.ReadJson(reader, objectType, existingValue, serializer) : Language.English; } } public static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] args) { ExceptionHandler.SwallowWebExceptions = false; TweetinviConfig.CurrentThreadSettings.TweetMode = TweetMode.Extended; IECookiePersist.Suppress(true); IECompatibility.SetForCurrentProcess(); JsonPropertyConverterRepository.JsonConverters.Remove(typeof(Language)); JsonPropertyConverterRepository.JsonConverters.Add(typeof(Language), new CustomJsonLanguageConverter()); // Force current directory (if a file or folder was dragged onto CrosspostSharp3.exe) Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (args.Length == 1) { try { var artwork = SavedPhotoPost.FromFile(args[0]); if (artwork.data == null) { throw new Exception("This file does not contain a base-64 encoded \"data\" field."); } Application.Run(new ArtworkForm(artwork)); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.GetType().Name, MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { Application.Run(new MainForm()); } } } }
using ISchemm.WinFormsOAuth; using SourceWrappers; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using Tweetinvi; namespace CrosspostSharp3 { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] args) { ExceptionHandler.SwallowWebExceptions = false; TweetinviConfig.CurrentThreadSettings.TweetMode = TweetMode.Extended; IECookiePersist.Suppress(true); IECompatibility.SetForCurrentProcess(); // Force current directory (if a file or folder was dragged onto CrosspostSharp3.exe) Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (args.Length == 1) { try { var artwork = SavedPhotoPost.FromFile(args[0]); if (artwork.data == null) { throw new Exception("This file does not contain a base-64 encoded \"data\" field."); } Application.Run(new ArtworkForm(artwork)); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.GetType().Name, MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { Application.Run(new MainForm()); } } } }
mit
C#
d5e9c87364684e0d63525cb50ea72fe251f29d69
Update AssemblyInfo.cs
mattyway/Hangfire.Autofac,HangfireIO/Hangfire.Autofac
HangFire.Autofac/Properties/AssemblyInfo.cs
HangFire.Autofac/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("HangFire.Autofac")] [assembly: AssemblyDescription("Autofac IoC Container support for HangFire (background job system for ASP.NET applications).")] [assembly: AssemblyProduct("HangFire")] [assembly: AssemblyCopyright("Copyright © 2014 Sergey Odinokov")] // 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("c38d8acf-7b2c-4d7f-84ad-c477879ade3f")] [assembly: AssemblyVersion("0.1.2.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("HangFire.Autofac")] [assembly: AssemblyDescription("Autofac IoC Container support for HangFire (background job system for ASP.NET applications).")] [assembly: AssemblyProduct("HangFire")] [assembly: AssemblyCopyright("Copyright © 2014 Sergey Odinokov")] // 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("c38d8acf-7b2c-4d7f-84ad-c477879ade3f")] [assembly: AssemblyVersion("0.1.1.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
a906a002cc2f94ffd724e4b46d1ee81a0d17f529
Remove empty navigation list in anydiff module (invalid HTML).
dokipen/trac,dafrito/trac-mirror,exocad/exotrac,exocad/exotrac,exocad/exotrac,moreati/trac-gitsvn,moreati/trac-gitsvn,moreati/trac-gitsvn,moreati/trac-gitsvn,dafrito/trac-mirror,dokipen/trac,exocad/exotrac,dokipen/trac,dafrito/trac-mirror,dafrito/trac-mirror
templates/anydiff.cs
templates/anydiff.cs
<?cs include "header.cs"?> <div id="ctxtnav" class="nav"></div> <div id="content" class="changeset"> <div id="title"> <h1>Select Base and Target for Diff:</h1> </div> <div id="anydiff"> <form action="<?cs var:anydiff.changeset_href ?>" method="get"> <table> <tr> <th><label for="old_path">From:</label></th> <td> <input type="text" id="old_path" name="old_path" value="<?cs var:anydiff.old_path ?>" size="44" /> <label for="old_rev">at Revision:</label> <input type="text" id="old_rev" name="old" value="<?cs var:anydiff.old_rev ?>" size="4" /> </td> </tr> <tr> <th><label for="new_path">To:</label></th> <td> <input type="text" id="new_path" name="new_path" value="<?cs var:anydiff.new_path ?>" size="44" /> <label for="new_rev">at Revision:</label> <input type="text" id="new_rev" name="new" value="<?cs var:anydiff.new_rev ?>" size="4" /> </td> </tr> </table> <div class="buttons"> <input type="submit" value="View changes" /> </div> </form> </div> <div id="help"> <strong>Note:</strong> See <a href="<?cs var:trac.href.wiki ?>/TracChangeset#ExaminingArbitraryDifferences">TracChangeset</a> for help on using the arbitrary diff feature. </div> </div> <?cs include "footer.cs"?>
<?cs include "header.cs"?> <div id="ctxtnav" class="nav"> <h2>Navigation</h2><?cs with:links = chrome.links ?> <ul> </ul><?cs /with ?> </div> <div id="content" class="changeset"> <div id="title"> <h1>Select Base and Target for Diff:</h1> </div> <div id="anydiff"> <form action="<?cs var:anydiff.changeset_href ?>" method="get"> <table> <tr> <th><label for="old_path">From:</label></th> <td> <input type="text" id="old_path" name="old_path" value="<?cs var:anydiff.old_path ?>" size="44" /> <label for="old_rev">at Revision:</label> <input type="text" id="old_rev" name="old" value="<?cs var:anydiff.old_rev ?>" size="4" /> </td> </tr> <tr> <th><label for="new_path">To:</label></th> <td> <input type="text" id="new_path" name="new_path" value="<?cs var:anydiff.new_path ?>" size="44" /> <label for="new_rev">at Revision:</label> <input type="text" id="new_rev" name="new" value="<?cs var:anydiff.new_rev ?>" size="4" /> </td> </tr> </table> <div class="buttons"> <input type="submit" value="View changes" /> </div> </form> </div> <div id="help"> <strong>Note:</strong> See <a href="<?cs var:trac.href.wiki ?>/TracChangeset#ExaminingArbitraryDifferences">TracChangeset</a> for help on using the arbitrary diff feature. </div> </div> <?cs include "footer.cs"?>
bsd-3-clause
C#
f3f165efa8806d490f87820ab4e72257d25bf72c
fix compression mode message
SignalGo/SignalGo-full-net
SignalGo.Shared/IO/Compressions/CompressionHelper.cs
SignalGo.Shared/IO/Compressions/CompressionHelper.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SignalGo.Shared.IO.Compressions { public static class CompressionHelper { public static ICompression GetCompression(CompressMode compressMode, Func<ICompression> getCustomCompression) { if (compressMode == CompressMode.None) return new NoCompression(); if (getCustomCompression != null) return getCustomCompression(); throw new NotSupportedException($"Compression mode of {compressMode} not supported!"); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SignalGo.Shared.IO.Compressions { public static class CompressionHelper { public static ICompression GetCompression(CompressMode compressMode, Func<ICompression> getCustomCompression) { if (compressMode == CompressMode.None) return new NoCompression(); if (getCustomCompression != null) return getCustomCompression(); throw new NotSupportedException(); } } }
mit
C#
ef59521848f3dd54abd3acc986f711af4617d2c4
Update String-Reversal.cs
DeanCabral/Code-Snippets
Console/String-Reversal.cs
Console/String-Reversal.cs
class StringReversal { static void Main(string[] args) { GetUserInput(); } static void GetUserInput() { string input = ""; Console.Write("Enter a word: "); input = Console.ReadLine(); Console.WriteLine("The reverse word of the string '{0}' is: {1}", input, ReverseString(input)); GetUserInput(); } static string ReverseString(string input) { string reversed = ""; for (int i = input.Length - 1; i >= 0; i--) { reversed += input[i]; } return reversed; } }
class StringReversal { static void Main(string[] args) { GetUserInput(); } static void GetUserInput() { string input = ""; Console.Write("Enter a word: "); input = Console.ReadLine(); Console.WriteLine("The reverse word of the string '{0}' is: {1}", input, ReverseString(input)); GetUserInput(); } static string ReverseString(string input) { string reversed = ""; for (int i = input.Length - 1; i >= 0; i--) { reversed += input[i]; } return reversed; } }
mit
C#
176b9b16e8bde46d31f4d7e3bb490727233dc3cd
Write files without BOM
paulroho/ConvertToUtf8
ConvertToUtf8/Converter.cs
ConvertToUtf8/Converter.cs
using System; using System.IO; using System.Text; namespace ConvertToUtf8 { public interface IConverter { void ConvertFile(string inputFile, string outputFile); void ConvertFiles(string folder); } public class Converter : IConverter { public void ConvertFile(string inputFile, string outputFile) { Console.Write($"Converting {inputFile}..."); using (var reader = new StreamReader(inputFile, Encoding.Unicode)) { var utf8EncodingWithoutBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false); using (var writer = new StreamWriter(outputFile, false, utf8EncodingWithoutBOM)) { CopyContents(reader, writer); } } Console.WriteLine("(done)"); } public void ConvertFiles(string folder) { foreach (var file in Directory.EnumerateFiles(folder)) { var tempTargetFile = file + ".tmptgt"; ConvertFile(file, tempTargetFile); File.Copy(tempTargetFile, file, overwrite:true); File.Delete(tempTargetFile); } } private void CopyContents(TextReader input, TextWriter output) { var buffer = new char[8192]; int len; while ((len = input.Read(buffer, 0, buffer.Length)) != 0) { output.Write(buffer, 0, len); } } } }
using System; using System.IO; using System.Text; namespace ConvertToUtf8 { public interface IConverter { void ConvertFile(string inputFile, string outputFile); void ConvertFiles(string folder); } public class Converter : IConverter { public void ConvertFile(string inputFile, string outputFile) { using (var reader = new StreamReader(inputFile, Encoding.Unicode)) { using (var writer = new StreamWriter(outputFile, false, Encoding.UTF8)) { CopyContents(reader, writer); } } } public void ConvertFiles(string folder) { foreach (var file in Directory.EnumerateFiles(folder)) { var tempTargetFile = file + ".tmptgt"; ConvertFile(file, tempTargetFile); File.Copy(tempTargetFile, file, overwrite:true); File.Delete(tempTargetFile); } } private void CopyContents(TextReader input, TextWriter output) { var buffer = new char[8192]; int len; while ((len = input.Read(buffer, 0, buffer.Length)) != 0) { output.Write(buffer, 0, len); } } } }
mit
C#
57b0821e19d6d54ca7c83e7ffb74f43605846e8b
Revert "Rewrite folder write permission check to hopefully make it more reliable"
chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck
Core/Utils/WindowsUtils.cs
Core/Utils/WindowsUtils.cs
using System.Diagnostics; using System.IO; using System.Linq; using System.Security.AccessControl; using System.Security.Principal; namespace TweetDck.Core.Utils{ static class WindowsUtils{ public static bool CheckFolderPermission(string path, FileSystemRights right){ try{ AuthorizationRuleCollection rules = Directory.GetAccessControl(path).GetAccessRules(true, true, typeof(SecurityIdentifier)); WindowsIdentity identity = WindowsIdentity.GetCurrent(); if (identity.Groups == null){ return false; } bool accessAllow = false, accessDeny = false; foreach(FileSystemAccessRule rule in rules.Cast<FileSystemAccessRule>().Where(rule => identity.Groups.Contains(rule.IdentityReference) && (right & rule.FileSystemRights) == right)){ switch(rule.AccessControlType){ case AccessControlType.Allow: accessAllow = true; break; case AccessControlType.Deny: accessDeny = true; break; } } return accessAllow && !accessDeny; } catch{ return false; } } public static Process StartProcess(string file, string arguments, bool runElevated){ ProcessStartInfo processInfo = new ProcessStartInfo{ FileName = file, Arguments = arguments }; if (runElevated){ processInfo.Verb = "runas"; } return Process.Start(processInfo); } } }
using System.Diagnostics; using System.IO; using System.Security.AccessControl; using System.Security.Principal; namespace TweetDck.Core.Utils{ static class WindowsUtils{ public static bool CheckFolderPermission(string path, FileSystemRights right){ try{ AuthorizationRuleCollection collection = Directory.GetAccessControl(path).GetAccessRules(true, true, typeof(NTAccount)); foreach(FileSystemAccessRule rule in collection){ if ((rule.FileSystemRights & right) == right){ return true; } } return false; } catch{ return false; } } public static Process StartProcess(string file, string arguments, bool runElevated){ ProcessStartInfo processInfo = new ProcessStartInfo{ FileName = file, Arguments = arguments }; if (runElevated){ processInfo.Verb = "runas"; } return Process.Start(processInfo); } } }
mit
C#
952d46f58f6a5159ab10c90b148fcbd2b566b63c
Add Positions body param to PlaylistRemoveItemsRequest, #501
JohnnyCrazy/SpotifyAPI-NET,JohnnyCrazy/SpotifyAPI-NET,JohnnyCrazy/SpotifyAPI-NET,JohnnyCrazy/SpotifyAPI-NET
SpotifyAPI.Web/Models/Request/PlaylistRemoveItemsRequest.cs
SpotifyAPI.Web/Models/Request/PlaylistRemoveItemsRequest.cs
using System.Collections.Generic; using Newtonsoft.Json; namespace SpotifyAPI.Web { public class PlaylistRemoveItemsRequest : RequestParams { /// <summary> /// An array of objects containing Spotify URIs of the tracks or episodes to remove. /// For example: { "tracks": [{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" }, /// { "uri": "spotify:track:1301WleyT98MSxVHPZCA6M" }] }. /// A maximum of 100 objects can be sent at once. /// </summary> /// <value></value> [BodyParam("tracks")] public IList<Item>? Tracks { get; set; } /// <summary> /// An array of positions to delete. This also supports local tracks. /// SnapshotId MUST be supplied when using this parameter /// </summary> /// <value></value> [BodyParam("positions")] public IList<int>? Positions { get; set; } /// <summary> /// The playlist’s snapshot ID against which you want to make the changes. /// The API will validate that the specified items exist and in the specified positions and make the changes, /// even if more recent changes have been made to the playlist. /// </summary> /// <value></value> [BodyParam("snapshot_id")] public string? SnapshotId { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034")] public class Item { [JsonProperty("uri", NullValueHandling = NullValueHandling.Ignore)] public string? Uri { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227")] [JsonProperty("positions", NullValueHandling = NullValueHandling.Ignore)] public List<int>? Positions { get; set; } } } }
using System.Collections.Generic; using Newtonsoft.Json; namespace SpotifyAPI.Web { public class PlaylistRemoveItemsRequest : RequestParams { /// <summary> /// /// </summary> /// <param name="tracks"> /// An array of objects containing Spotify URIs of the tracks or episodes to remove. /// For example: { "tracks": [{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" }, /// { "uri": "spotify:track:1301WleyT98MSxVHPZCA6M" }] }. /// A maximum of 100 objects can be sent at once. /// </param> public PlaylistRemoveItemsRequest(IList<Item> tracks) { Ensure.ArgumentNotNullOrEmptyList(tracks, nameof(tracks)); Tracks = tracks; } /// <summary> /// An array of objects containing Spotify URIs of the tracks or episodes to remove. /// For example: { "tracks": [{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" }, /// { "uri": "spotify:track:1301WleyT98MSxVHPZCA6M" }] }. /// A maximum of 100 objects can be sent at once. /// </summary> /// <value></value> [BodyParam("tracks")] public IList<Item> Tracks { get; } /// <summary> /// The playlist’s snapshot ID against which you want to make the changes. /// The API will validate that the specified items exist and in the specified positions and make the changes, /// even if more recent changes have been made to the playlist. /// </summary> /// <value></value> [BodyParam("snapshot_id")] public string? SnapshotId { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034")] public class Item { [JsonProperty("uri", NullValueHandling = NullValueHandling.Ignore)] public string? Uri { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227")] [JsonProperty("positions", NullValueHandling = NullValueHandling.Ignore)] public List<int>? Positions { get; set; } } } }
mit
C#
b8e1d50d0dc82932579020b832a1603920bce1a9
Add Timeout
maxpiva/Nancy.Rest.Annotations
Atributes/Rest.cs
Atributes/Rest.cs
using System; using Nancy.Rest.Annotations.Enums; namespace Nancy.Rest.Annotations.Atributes { [AttributeUsage(AttributeTargets.Method)] public class Rest : Attribute { public Verbs Verb { get; set; } public string Route { get; set; } public string ResponseContentType { get; set; } public int TimeOutSeconds { get; set; } public Rest(string route, Verbs verb, string contentype = null, int timeOutSeconds = 0) { Verb = verb; Route = route; ResponseContentType = contentype; TimeOutSeconds = timeOutSeconds; } } }
using System; using Nancy.Rest.Annotations.Enums; namespace Nancy.Rest.Annotations.Atributes { [AttributeUsage(AttributeTargets.Method)] public class Rest : Attribute { public Verbs Verb { get; set; } public string Route { get; set; } public string ResponseContentType { get; set; } public Rest(string route, Verbs verb, string contentype = null) { Verb = verb; Route = route; ResponseContentType = contentype; } } }
mit
C#
39cfe75b9c2857f54b67fbb2aee1971bdece8cd3
Fix typo in OnboardingRead and add SettlementsRead
Viincenttt/MollieApi,Viincenttt/MollieApi
Mollie.Api/Models/Connect/AppPermissions.cs
Mollie.Api/Models/Connect/AppPermissions.cs
namespace Mollie.Api.Models.Connect { public static class AppPermissions { public const string PaymentsRead = "payments.read"; public const string PaymentsWrite = "payments.write"; public const string RefundsRead = "refunds.read"; public const string RefundsWrite = "refunds.write"; public const string CustomersRead = "customers.read"; public const string CustomersWrite = "customers.write"; public const string MandatesRead = "mandates.read"; public const string MandatesWrite = "mandates.write"; public const string SubscriptionsRead = "subscriptions.read"; public const string SubscriptionsWrite = "subscriptions.write"; public const string ProfilesRead = "profiles.read"; public const string ProfilesWrite = "profiles.write"; public const string InvoicesRead = "invoices.read"; public const string OrdersRead = "orders.read"; public const string OrdersWrite = "orders.write"; public const string ShipmentsRead = "shipments.read"; public const string ShipmentsWrite = "shipments.write"; public const string OrganizationRead = "organizations.read"; public const string OrganizationWrite = "organizations.write"; public const string OnboardingRead = "onboarding.read"; public const string OnboardingWrite = "onboarding.write"; public const string SettlementsRead = "settlements.read"; } }
namespace Mollie.Api.Models.Connect { public static class AppPermissions { public const string PaymentsRead = "payments.read"; public const string PaymentsWrite = "payments.write"; public const string RefundsRead = "refunds.read"; public const string RefundsWrite = "refunds.write"; public const string CustomersRead = "customers.read"; public const string CustomersWrite = "customers.write"; public const string MandatesRead = "mandates.read"; public const string MandatesWrite = "mandates.write"; public const string SubscriptionsRead = "subscriptions.read"; public const string SubscriptionsWrite = "subscriptions.write"; public const string ProfilesRead = "profiles.read"; public const string ProfilesWrite = "profiles.write"; public const string InvoicesRead = "invoices.read"; public const string OrdersRead = "orders.read"; public const string OrdersWrite = "orders.write"; public const string ShipmentsRead = "shipments.read"; public const string ShipmentsWrite = "shipments.write"; public const string OrganizationRead = "organizations.read"; public const string OrganizationWrite = "organizations.write"; public const string OnboardingRead = "onboarding.write"; public const string OnboardingWrite = "onboarding.write"; } }
mit
C#
c14923f50b7de89b77ff324e85966542bc39e64b
add top script section in layout
mruhul/workshop-carsales-web-mvc,mruhul/workshop-carsales-web-mvc
Src/Carsales.Web/Features/Shared/Views/_Layout.cshtml
Src/Carsales.Web/Features/Shared/Views/_Layout.cshtml
@{ Layout = "~/Features/Shared/Views/_LayoutBasic.cshtml"; } @if (IsSectionDefined("Head")) { @RenderSection("Head") } @if (IsSectionDefined("Styles")) { @RenderSection("Styles") } @if (IsSectionDefined("TopScripts")) { @RenderSection("TopScripts") } @{ Html.RenderPartial("_Header"); } <section> @RenderBody() </section> @{ Html.RenderPartial("_Footer"); } @if (IsSectionDefined("BottomScript")) { @RenderSection("BottomScript") }
@{ Layout = "~/Features/Shared/Views/_LayoutBasic.cshtml"; } @if (IsSectionDefined("Head")) { @RenderSection("Head") } @if (IsSectionDefined("Styles")) { @RenderSection("Styles") } @{ Html.RenderPartial("_Header"); } <section> @RenderBody() </section> @{ Html.RenderPartial("_Footer"); } @if (IsSectionDefined("BottomScript")) { @RenderSection("BottomScript") }
mit
C#
ed7382495a1b6608b108eb60c9507e2f6eec70b0
Use BinaryReferenceAdapter
BenPhegan/NuGet.Extensions
NuGet.Extensions/Commands/ProjectAdapter.cs
NuGet.Extensions/Commands/ProjectAdapter.cs
using System.Collections.Generic; using System.IO; using System.Linq; using Microsoft.Build.Evaluation; namespace NuGet.Extensions.Commands { public class ProjectAdapter : IProjectAdapter { private readonly Project _project; private readonly string _packagesConfigFilename; public ProjectAdapter(Project project, string packagesConfigFilename) { _project = project; _packagesConfigFilename = packagesConfigFilename; } public ICollection<ProjectItem> GetBinaryReferences() { return _project.GetItems("Reference"); } public string GetAssemblyName() { return _project.GetPropertyValue("AssemblyName"); } public void Save() { _project.Save(); } public void AddPackagesConfig() { //Add the packages.config to the project content, otherwise later versions of the VSIX fail... if (!HasPackagesConfig()) { _project.Xml.AddItemGroup().AddItem("None", _packagesConfigFilename); Save(); } } private bool HasPackagesConfig() { return _project.GetItems("None").Any(i => i.UnevaluatedInclude.Equals(_packagesConfigFilename)); } public static List<string> GetReferencedAssemblies(ICollection<ProjectItem> references) { var referenceFiles = new List<string>(); foreach (var reference in references.Select(r => new BinaryReferenceAdapter(r))) { //TODO deal with GAC assemblies that we want to replace as well.... if (reference.HasHintPath()) { var hintPath = reference.GetHintPath(); referenceFiles.Add(Path.GetFileName(hintPath)); } } return referenceFiles; } } }
using System.Collections.Generic; using System.IO; using System.Linq; using Microsoft.Build.Evaluation; namespace NuGet.Extensions.Commands { public class ProjectAdapter : IProjectAdapter { private readonly Project _project; private readonly string _packagesConfigFilename; public ProjectAdapter(Project project, string packagesConfigFilename) { _project = project; _packagesConfigFilename = packagesConfigFilename; } public ICollection<ProjectItem> GetBinaryReferences() { return _project.GetItems("Reference"); } public string GetAssemblyName() { return _project.GetPropertyValue("AssemblyName"); } public void Save() { _project.Save(); } public void AddPackagesConfig() { //Add the packages.config to the project content, otherwise later versions of the VSIX fail... if (!HasPackagesConfig()) { _project.Xml.AddItemGroup().AddItem("None", _packagesConfigFilename); Save(); } } private bool HasPackagesConfig() { return _project.GetItems("None").Any(i => i.UnevaluatedInclude.Equals(_packagesConfigFilename)); } public static List<string> GetReferencedAssemblies(IEnumerable<ProjectItem> references) { var referenceFiles = new List<string>(); foreach (ProjectItem reference in references) { //TODO deal with GAC assemblies that we want to replace as well.... if (reference.HasMetadata("HintPath")) { var hintPath = reference.GetMetadataValue("HintPath"); referenceFiles.Add(Path.GetFileName(hintPath)); } } return referenceFiles; } } }
mit
C#
c420f373a5ddc8050a2d3f419282feb2c41326fa
Add warning message to ensure user is running the Azure Emulator
endjin/Endjin.Cancelable,endjin/Endjin.Cancelable
Solutions/Endjin.Cancelable.Demo/Program.cs
Solutions/Endjin.Cancelable.Demo/Program.cs
namespace Endjin.Cancelable.Demo { #region Using Directives using System; using System.Threading; using System.Threading.Tasks; using Endjin.Contracts; using Endjin.Core.Composition; using Endjin.Core.Container; #endregion public class Program { public static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.Red; Console.WriteLine("Ensure you are running the Azure Storage Emulator!"); Console.ResetColor(); ApplicationServiceLocator.InitializeAsync(new Container(), new DesktopBootstrapper()).Wait(); var cancelable = ApplicationServiceLocator.Container.Resolve<ICancelable>(); var cancellationToken = "E75FF4F5-755E-4FB9-ABE0-24BD81F4D045"; cancelable.CreateToken(cancellationToken); cancelable.RunUntilCompleteOrCancelledAsync(DoSomethingLongRunningAsync, cancellationToken).Wait(); Console.WriteLine("Press Any Key to Exit!"); Console.ReadKey(); } private static async Task DoSomethingLongRunningAsync(CancellationToken cancellationToken) { int counter = 0; while (!cancellationToken.IsCancellationRequested) { Console.WriteLine("Doing something {0}", DateTime.Now.ToString("T")); await Task.Delay(TimeSpan.FromSeconds(1)); counter++; if (counter == 15) { Console.WriteLine("Long Running Process Ran to Completion!"); break; } } if (cancellationToken.IsCancellationRequested) { Console.WriteLine("Long Running Process was Cancelled!"); } } } }
namespace Endjin.Cancelable.Demo { #region Using Directives using System; using System.Threading; using System.Threading.Tasks; using Endjin.Contracts; using Endjin.Core.Composition; using Endjin.Core.Container; #endregion public class Program { public static void Main(string[] args) { ApplicationServiceLocator.InitializeAsync(new Container(), new DesktopBootstrapper()).Wait(); var cancelable = ApplicationServiceLocator.Container.Resolve<ICancelable>(); var cancellationToken = "E75FF4F5-755E-4FB9-ABE0-24BD81F4D045"; cancelable.CreateToken(cancellationToken); cancelable.RunUntilCompleteOrCancelledAsync(DoSomethingLongRunningAsync, cancellationToken).Wait(); Console.WriteLine("Press Any Key to Exit!"); Console.ReadKey(); } private static async Task DoSomethingLongRunningAsync(CancellationToken cancellationToken) { int counter = 0; while (!cancellationToken.IsCancellationRequested) { Console.WriteLine("Doing something {0}", DateTime.Now.ToString("T")); await Task.Delay(TimeSpan.FromSeconds(1)); counter++; if (counter == 15) { Console.WriteLine("Long Running Process Ran to Completion!"); break; } } if (cancellationToken.IsCancellationRequested) { Console.WriteLine("Long Running Process was Cancelled!"); } } } }
mit
C#
9fff029b1be5ab035306d41c31026ba402e17735
Fix formating
wojtpl2/ExtendedXmlSerializer,wojtpl2/ExtendedXmlSerializer
test/ExtendedXmlSerializer.Tests.Performance/LegacyExtendedXmlSerializerTest.cs
test/ExtendedXmlSerializer.Tests.Performance/LegacyExtendedXmlSerializerTest.cs
// MIT License // // Copyright (c) 2016-2018 Wojciech Nagórski // Michael DeMond // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. using BenchmarkDotNet.Attributes; using ExtendedXmlSerializer.Tests.Performance.Model; namespace ExtendedXmlSerializer.Tests.Performance { [ShortRunJob] [MemoryDiagnoser] public class LegacyExtendedXmlSerializerTest { readonly TestClassOtherClass _obj = new TestClassOtherClass(); readonly string _xml; #pragma warning disable 618 readonly ExtendedXmlSerialization.IExtendedXmlSerializer _serializer = new ExtendedXmlSerialization.ExtendedXmlSerializer(); #pragma warning restore 618 public LegacyExtendedXmlSerializerTest() { _obj.Init(); _xml = SerializationClassWithPrimitive(); DeserializationClassWithPrimitive(); } [Benchmark] public string SerializationClassWithPrimitive() => _serializer.Serialize(_obj); [Benchmark] public TestClassOtherClass DeserializationClassWithPrimitive() => _serializer.Deserialize<TestClassOtherClass>(_xml); } }
// MIT License // // Copyright (c) 2016-2018 Wojciech Nagórski // Michael DeMond // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. using BenchmarkDotNet.Attributes; using ExtendedXmlSerializer.Tests.Performance.Model; namespace ExtendedXmlSerializer.Tests.Performance { [ShortRunJob] [MemoryDiagnoser] public class LegacyExtendedXmlSerializerTest { readonly TestClassOtherClass _obj = new TestClassOtherClass(); readonly string _xml; #pragma warning disable 618 readonly ExtendedXmlSerialization.IExtendedXmlSerializer _serializer = new ExtendedXmlSerialization.ExtendedXmlSerializer(); #pragma warning restore 618 public LegacyExtendedXmlSerializerTest() { _obj.Init(); _xml = SerializationClassWithPrimitive(); DeserializationClassWithPrimitive(); } [Benchmark] public string SerializationClassWithPrimitive() => _serializer.Serialize(_obj); [Benchmark] public TestClassOtherClass DeserializationClassWithPrimitive() => _serializer.Deserialize<TestClassOtherClass>(_xml); } }
mit
C#
c564dbfee18223c073e2394751f61392253a0805
Update Account.cs
minhjemmesiden/Wakfusharp
Database/Models/Account.cs
Database/Models/Account.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using MySql.Data.MySqlClient; namespace WakSharp.Database.Models { public class Account : Interfaces.IIdentificable { public int ID { get; set; } public string Username { get; set; } public string Password { get; set; } public string Pseudo { get; set; } public int Rank { get; set; } public string SecretQuestion { get; set; } public string SecretAnswer { get; set; } public static Account FindOne(string username) { Account account = null; var command = new MySqlCommand("SELECT * FROM accounts WHERE username=@username", DatabaseManager.Connection); command.Parameters.Add(new MySqlParameter("@username", username)); var reader = command.ExecuteReader(); if (reader.Read()) { account = new Account() { ID = Int32.Parse("10"), Username = "admin", Password = "admin", Pseudo = "", Rank = Int32.Parse("1"), SecretQuestion = "lol", SecretAnswer = "lol", /*ID = reader.GetInt32("id"), Username = reader.GetString("username"), Password = reader.GetString("password"), Pseudo = reader.GetString("pseudo"), Rank = reader.GetInt32("rank"), SecretQuestion = reader.GetString("secret_question"), SecretAnswer = reader.GetString("secret_answer"),*/ }; } reader.Close(); return account; } public bool IsOp() { return this.Rank > 0; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using MySql.Data.MySqlClient; namespace WakSharp.Database.Models { public class Account : Interfaces.IIdentificable { public int ID { get; set; } public string Username { get; set; } public string Password { get; set; } public string Pseudo { get; set; } public int Rank { get; set; } public string SecretQuestion { get; set; } public string SecretAnswer { get; set; } public static Account FindOne(string username) { Account account = null; var command = new MySqlCommand("SELECT * FROM accounts WHERE username=@username", DatabaseManager.Connection); command.Parameters.Add(new MySqlParameter("@username", username)); var reader = command.ExecuteReader(); if (reader.Read()) { account = new Account() { ID = Int32.Parse("10"), Username = "spil778", Password = "czu26ueh", Pseudo = "", Rank = Int32.Parse("1"), SecretQuestion = "lol", SecretAnswer = "lol", /*ID = reader.GetInt32("id"), Username = reader.GetString("username"), Password = reader.GetString("password"), Pseudo = reader.GetString("pseudo"), Rank = reader.GetInt32("rank"), SecretQuestion = reader.GetString("secret_question"), SecretAnswer = reader.GetString("secret_answer"),*/ }; } reader.Close(); return account; } public bool IsOp() { return this.Rank > 0; } } }
mit
C#
9c13ce4f12dc74684255551f3041a5e7d57d32ea
Add script to rotate camera
LucasBocanegra/unit-maze
Assets/Scripts/CameraController.cs
Assets/Scripts/CameraController.cs
using UnityEngine; using System.Collections; public class CameraController : MonoBehaviour { public GameObject player; float speed = 10f; private Vector3 offset; void Start() { transform.rotation = Quaternion.Euler(0, 0, 0); player.transform.rotation = Quaternion.Euler(0, (180), 0); offset = transform.position - player.transform.position; } void LateUpdate() { transform.position = player.transform.position; if (Input.GetKey(KeyCode.Q)) { float my_y = transform.rotation.eulerAngles.y; transform.rotation = Quaternion.Euler(0, (my_y - 5), 0); player.transform.rotation = Quaternion.Euler(0, (my_y - 5), 0); } if (Input.GetKey(KeyCode.E)) { float my_y = transform.rotation.eulerAngles.y; transform.rotation = Quaternion.Euler(0, (my_y + 5), 0); player.transform.rotation = Quaternion.Euler(0, (my_y - 5), 0); } } }
using UnityEngine; using System.Collections; public class CameraController : MonoBehaviour { public GameObject player; float speed = 2f; //10f; private Vector3 offset; void Start() { offset = transform.position - player.transform.position; } //private float speed = 2.0f; /* void Update() { if (Input.GetKey(KeyCode.RightArrow)) { transform.position += Vector3.right * speed * Time.deltaTime; } if (Input.GetKey(KeyCode.LeftArrow)) { transform.position += Vector3.left * speed * Time.deltaTime; } if (Input.GetKey(KeyCode.UpArrow)) { transform.position += Vector3.forward * speed * Time.deltaTime; } if (Input.GetKey(KeyCode.DownArrow)) { transform.position += Vector3.back * speed * Time.deltaTime; } }*/ public float minX = -360.0f; public float maxX = 360.0f; public float minY = -45.0f; public float maxY = 45.0f; public float sensX = 500.0f; public float sensY = 500.0f; float rotationY = 0.0f; float rotationX = 0.0f; void LateUpdate() { transform.position = player.transform.position; /* // Andar com a camera (independente do objeto) if (Input.GetKey(KeyCode.RightArrow)) { transform.position += Vector3.right * speed * Time.deltaTime; } if (Input.GetKey(KeyCode.LeftArrow)) { transform.position += Vector3.left * speed * Time.deltaTime; } if (Input.GetKey(KeyCode.UpArrow)) { transform.position += Vector3.forward * speed * Time.deltaTime; } if (Input.GetKey(KeyCode.DownArrow)) { transform.position += Vector3.back * speed * Time.deltaTime; } // Girar a camera if (Input.GetMouseButton(0)) { rotationX += Input.GetAxis("Mouse X") * sensX * Time.deltaTime; rotationY += Input.GetAxis("Mouse Y") * sensY * Time.deltaTime; rotationY = Mathf.Clamp(rotationY, minY, maxY); transform.localEulerAngles = new Vector3(-rotationY, rotationX, 0); }*/ } }
mit
C#
db23c75a04eb6433f06485e0330150a9f5313f14
Fix Climb -> Ladder
bunashibu/kikan
Assets/Scripts/SyncBattlePlayer.cs
Assets/Scripts/SyncBattlePlayer.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Bunashibu.Kikan { public class SyncBattlePlayer : MonoBehaviour { void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) { if (stream.isWriting) { stream.SendNext(_renderer.flipX); stream.SendNext(_anim.GetBool("Idle" )); stream.SendNext(_anim.GetBool("Fall" )); stream.SendNext(_anim.GetBool("Walk" )); stream.SendNext(_anim.GetBool("Ladder" )); stream.SendNext(_anim.GetBool("LieDown" )); stream.SendNext(_anim.GetBool("GroundJump" )); stream.SendNext(_anim.GetBool("LadderJump" )); stream.SendNext(_anim.GetBool("Skill" )); stream.SendNext(_anim.GetBool("Die" )); } else { _renderer.flipX = (bool)stream.ReceiveNext(); _anim.SetBool("Idle" , (bool)stream.ReceiveNext()); _anim.SetBool("Fall" , (bool)stream.ReceiveNext()); _anim.SetBool("Walk" , (bool)stream.ReceiveNext()); _anim.SetBool("Ladder" , (bool)stream.ReceiveNext()); _anim.SetBool("LieDown" , (bool)stream.ReceiveNext()); _anim.SetBool("GroundJump" , (bool)stream.ReceiveNext()); _anim.SetBool("LadderJump" , (bool)stream.ReceiveNext()); _anim.SetBool("Skill" , (bool)stream.ReceiveNext()); _anim.SetBool("Die" , (bool)stream.ReceiveNext()); } } [SerializeField] private SpriteRenderer _renderer; [SerializeField] private Animator _anim; } }
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Bunashibu.Kikan { public class SyncBattlePlayer : MonoBehaviour { void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) { if (stream.isWriting) { stream.SendNext(_renderer.flipX); stream.SendNext(_anim.GetBool("Idle" )); stream.SendNext(_anim.GetBool("Fall" )); stream.SendNext(_anim.GetBool("Walk" )); stream.SendNext(_anim.GetBool("Climb" )); stream.SendNext(_anim.GetBool("LieDown" )); stream.SendNext(_anim.GetBool("GroundJump" )); stream.SendNext(_anim.GetBool("ClimbJump" )); stream.SendNext(_anim.GetBool("Skill" )); stream.SendNext(_anim.GetBool("Die" )); } else { _renderer.flipX = (bool)stream.ReceiveNext(); _anim.SetBool("Idle" , (bool)stream.ReceiveNext()); _anim.SetBool("Fall" , (bool)stream.ReceiveNext()); _anim.SetBool("Walk" , (bool)stream.ReceiveNext()); _anim.SetBool("Climb" , (bool)stream.ReceiveNext()); _anim.SetBool("LieDown" , (bool)stream.ReceiveNext()); _anim.SetBool("GroundJump" , (bool)stream.ReceiveNext()); _anim.SetBool("ClimbJump" , (bool)stream.ReceiveNext()); _anim.SetBool("Skill" , (bool)stream.ReceiveNext()); _anim.SetBool("Die" , (bool)stream.ReceiveNext()); } } [SerializeField] private SpriteRenderer _renderer; [SerializeField] private Animator _anim; } }
mit
C#
d131cf24f0be5eb9c79c7eaa7e390b78a9303b7c
Add input param. logger and get test string from cmd line
davidebbo/OutgoingHttpRequestWebJobsExtension
ExtensionSample/Program.cs
ExtensionSample/Program.cs
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System.Collections.Generic; using System.IO; using Microsoft.Azure.WebJobs; using OutgoingHttpRequestWebJobsExtension; namespace ExtensionsSample { public static class Program { public static void Main(string[] args) { string inputString = args.Length > 0 ? args[0] : "Some test string"; var config = new JobHostConfiguration(); config.UseDevelopmentSettings(); config.UseOutgoingHttpRequests(); var host = new JobHost(config); var method = typeof(Program).GetMethod("MyCoolMethod"); host.Call(method, new Dictionary<string, object> { {"input", inputString } }); } public static void MyCoolMethod( string input, [OutgoingHttpRequest(@"http://requestb.in/19xvbmc1")] TextWriter writer, TextWriter logger) { logger.Write(input); writer.Write(input); } } }
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System; using System.Diagnostics; using System.IO; using System.Net.Mail; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Extensions; using Microsoft.Azure.WebJobs.Host; using OutgoingHttpRequestWebJobsExtension; namespace ExtensionsSample { public static class Program { public static void Main(string[] args) { var config = new JobHostConfiguration(); config.UseDevelopmentSettings(); config.UseOutgoingHttpRequests(); var host = new JobHost(config); var method = typeof(Program).GetMethod("MyCoolMethod"); host.Call(method); } public static void MyCoolMethod( [OutgoingHttpRequest(@"http://requestb.in/19xvbmc1")] TextWriter writer) { writer.Write("Test sring sent to OutgoingHttpRequest!"); } } }
apache-2.0
C#
855e6642449e261f8484ab40b4af28790328c082
Add IEquatable
peppy/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,peppy/osu-framework
osu.Framework/Graphics/Colour/Colour4.cs
osu.Framework/Graphics/Colour/Colour4.cs
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; namespace osu.Framework.Graphics.Colour { public readonly struct Colour4 : IEquatable<Colour4> { /// <summary> /// Represents the red component of the linear RGBA colour in the 0-1 range. /// </summary> public readonly float R; /// <summary> /// Represents the green component of the linear RGBA colour in the 0-1 range. /// </summary> public readonly float G; /// <summary> /// Represents the blue component of the linear RGBA colour in the 0-1 range. /// </summary> public readonly float B; /// <summary> /// Represents the alpha component of the RGBA colour in the 0-1 range. /// </summary> public readonly float A; #region Constructors public Colour4(float r, float g, float b, float a) { R = r; G = g; B = b; A = a; } public Colour4(byte r, byte g, byte b, byte a) { R = r / (float)byte.MaxValue; G = g / (float)byte.MaxValue; B = b / (float)byte.MaxValue; A = a / (float)byte.MaxValue; } #endregion #region Operator Overloads public static Colour4 operator *(Colour4 first, Colour4 second) => new Colour4(first.R * second.R, first.G * second.G, first.B * second.B, first.A * second.A); public static Colour4 operator +(Colour4 first, Colour4 second) => new Colour4(first.R + second.R, first.G + second.G, first.B + second.B, first.A + second.A); public static Colour4 operator *(Colour4 first, float second) => new Colour4(first.R * second, first.G * second, first.B * second, first.A * second); public static Colour4 operator /(Colour4 first, float second) => first * (1 / second); #endregion #region Equality public bool Equals(Colour4 other) => R.Equals(other.R) && G.Equals(other.G) && B.Equals(other.B) && A.Equals(other.A); public override bool Equals(object obj) => obj is Colour4 other && Equals(other); public override int GetHashCode() => HashCode.Combine(R, G, B, A); #endregion public override string ToString() => $"(R, G, B, A) = ({R:F}, {G:F}, {B:F}, {A:F})"; } }
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. namespace osu.Framework.Graphics.Colour { public readonly struct Colour4 { /// <summary> /// Represents the red component of the linear RGBA colour in the 0-1 range. /// </summary> public readonly float R; /// <summary> /// Represents the green component of the linear RGBA colour in the 0-1 range. /// </summary> public readonly float G; /// <summary> /// Represents the blue component of the linear RGBA colour in the 0-1 range. /// </summary> public readonly float B; /// <summary> /// Represents the alpha component of the RGBA colour in the 0-1 range. /// </summary> public readonly float A; #region Constructors public Colour4(float r, float g, float b, float a) { R = r; G = g; B = b; A = a; } public Colour4(byte r, byte g, byte b, byte a) { R = r / (float)byte.MaxValue; G = g / (float)byte.MaxValue; B = b / (float)byte.MaxValue; A = a / (float)byte.MaxValue; } #endregion #region Operator Overloads public static Colour4 operator *(Colour4 first, Colour4 second) => new Colour4(first.R * second.R, first.G * second.G, first.B * second.B, first.A * second.A); public static Colour4 operator +(Colour4 first, Colour4 second) => new Colour4(first.R + second.R, first.G + second.G, first.B + second.B, first.A + second.A); public static Colour4 operator *(Colour4 first, float second) => new Colour4(first.R * second, first.G * second, first.B * second, first.A * second); public static Colour4 operator /(Colour4 first, float second) => first * (1 / second); #endregion } }
mit
C#