This file contains hidden or 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; | |
using System.Linq; | |
using System.Text; | |
public static class StringBuilderAggregateLinqExtension { | |
public static string Concatenate(this IEnumerable<string> strings) | |
=> strings.Concatenate((builder, nextValue) => builder.Append(nextValue)); | |
public static string ConcatenateLines(this IEnumerable<string> strings) |
This file contains hidden or 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; | |
using System.Linq; | |
namespace KattisPhoneList | |
{ | |
internal static class Program | |
{ | |
public static void Main() | |
{ |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <zconf.h> | |
static const int MAX_INPUT_LENGTH = 30; | |
static const int MAX_CIRCLE_COUNT = 3; | |
struct Point { | |
long x; | |
long y; |
This file contains hidden or 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
public class Example | |
{ | |
public static void main(String[] args) | |
{ | |
double twoFiftyInTheAfternoonUTC = 14.5d; | |
double acstTimeZoneOffset = 9.3; | |
double twoFiftyInTheAfternoonUTCInACST = add(twoFiftyInTheAfternoonUTC, acstTimeZoneOffset); | |
System.out.print(twoFiftyInTheAfternoonUTCInACST); | |
} |
This file contains hidden or 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.Diagnostics; | |
using Xunit; | |
using Xunit.Abstractions; | |
namespace Tests | |
{ | |
public sealed class CalculatorTests | |
{ | |
private readonly ITestOutputHelper _testOutputHelper; |
This file contains hidden or 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.Immutable; | |
using System.Diagnostics; | |
using System.Diagnostics.CodeAnalysis; | |
using System.Linq; | |
using Xunit; | |
using Xunit.Abstractions; | |
namespace JoeEncoder | |
{ |
This file contains hidden or 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
public class JavaFiddle | |
{ | |
public static void main(String[] args) | |
{ | |
BoulderMenu menu = new BoulderMenu(2, 4); | |
menu.showMenu(); | |
System.out.println("now...."); | |
This file contains hidden or 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
.idea | |
.dockerignore | |
Dockerfile | |
**/obj/ | |
**/bin/ |
This file contains hidden or 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.Concurrent; | |
using System.Text.Json; | |
using System.Text.Json.Serialization; | |
var messageService = new MessageService(); | |
var noisyThings = new NoisyThings(messageService); | |
var cancellationTokenSource = new CancellationTokenSource(Constants.RunSimulationFor); | |
var runningTasks = noisyThings | |
.GetNoisyThings() |
This file contains hidden or 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
const int countOfWorkersToRunInParallel = 3; | |
const int countOfWorkersToRunConcurrently = 12; | |
var cancellationTokenSource = new CancellationTokenSource(); | |
var cancellationToken = cancellationTokenSource.Token; | |
var semaphore = new SemaphoreSlim(countOfWorkersToRunInParallel); | |
_ = Task.Run(async () => | |
{ | |
await Console.In.ReadLineAsync(cancellationToken); |
OlderNewer