This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using iText.Kernel.Pdf; | |
using iText.Kernel.Pdf.Canvas.Parser; | |
using iText.Kernel.Pdf.Canvas.Parser.Listener; | |
using Net.Code.Csv; | |
using System.Globalization; | |
using System.Text.RegularExpressions; | |
var folder = args[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var output = $"FOO {nameof(R)} BAR " + $" {f(nameof(R))} BAZ "; | |
Console.WriteLine(output); | |
string f(string s) => s; | |
public class R | |
{ | |
} | |
// when compiled as a net6 console app in VS2022 preview 3.1, the above code produces an unexpected result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
namespace System.Collections.Immutable | |
{ | |
public class ImmutableListWithValueSemantics<T> : IImmutableList<T>, IEquatable<IImmutableList<T>> | |
{ | |
IImmutableList<T> _list; | |
public ImmutableListWithValueSemantics(IImmutableList<T> list) => _list = list; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
namespace CodeQuiz | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
ulong sharedValue = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Copyright (C) 2013 DvdKhl | |
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.Common; | |
using System.Linq; | |
using System.Reflection; | |
namespace Tools | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
namespace Tools.Infrastructure | |
{ | |
class Logger | |
{ | |
static object _lock = new object(); | |
public static void Info(string message) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"traceId": "[snip]", | |
"traceEntries": { | |
"inbound": [ | |
{ | |
"source": "api-inspector", | |
"timestamp": "2015-11-23T14:38:14.3755947Z", | |
"elapsed": "00:00:00.0980973", | |
"data": { | |
"request": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
// Factory methods provided in non-generic abstract base class | |
public abstract class Builder | |
{ | |
public static Builder<T> For<T>() where T : new() | |
{ | |
return new Builder<T>(() => new T()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Helper class to manage a (part of) an array of T (similar to the BCL's ArraySegment, but actually providing some useful functionality) | |
/// </summary> | |
public class ArraySegment<T> : IEnumerable<T> | |
{ | |
private readonly T[] _rawArray; | |
private readonly int _offset; | |
private readonly int _length; | |
public ArraySegment(T[] rawArray, int offset, int length) |
NewerOlder