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
use std::ops; | |
use std::fmt; | |
use rust_decimal::prelude::*; | |
use std::cmp::Ordering; | |
use rust_decimal; | |
use crate::currencies::Currency as Currency; | |
use crate::percent::Percent as Percent; | |
use crate::currency_rate::CurrencyRate as CurrencyRate; | |
use crate::rounding::RoundStrategy as RoundStrategy; |
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 <stdint.h> | |
#include <stdio.h> | |
#include <sys/mman.h> | |
#include <stdlib.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <inttypes.h> | |
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 <stdint.h> | |
#include <stdio.h> | |
#include <sys/mman.h> | |
#include <stdlib.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
typedef struct { |
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
void delay1(volatile uint32_t delay) { | |
while (delay--); | |
} | |
int main(void) { | |
rcc_init(); | |
// LED - PD13 | |
RCC->AHB1ENR |=RCC_AHB1ENR_GPIODEN; |
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
class Logger | |
{ | |
private static volatile Logger instance; | |
private EventLog _evLog; | |
private static object lockObject = new object(); | |
public Logger(string logApp, string source) | |
{ | |
if (!EventLog.SourceExists(source)) | |
EventLog.CreateEventSource(source, logApp); |
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 ChannelPool | |
{ | |
private readonly IConnection _connection; | |
private readonly int _size; | |
private readonly ChannelReader<PublishMessage> _chan; | |
public ChannelPool(IConnection connection, int size, ChannelReader<PublishMessage> chan) | |
{ | |
_size = size; | |
_connection = connection; | |
_chan = chan; |
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
class NonBlockingReplicator: INonBlockingReplicator | |
{ | |
public event EventHandler Replicated; | |
private readonly IHttpReplicator _httpReplicator; | |
public NonBlockingReplicator(IHttpReplicator httpReplicator) => _httpReplicator = httpReplicator; | |
public void Replicate(Guid id, string serialized, bool notify = true) => | |
Task.Run(() => _httpReplicator.Replicate(serialized)) | |
.ContinueWith((replicated) => |
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 Name | |
{ | |
public Name(Optional<string> fullName, Optional<string> firstName, Optional<string> lastName) | |
{ | |
FirstName = firstName; | |
LastName = lastName; | |
FullName = fullName; | |
} | |
public Optional<string> FullName {get; set;} |
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 Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Serilog; | |
using Serilog.Filters; | |
using Serilog.Events; |
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
FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build | |
WORKDIR /app | |
COPY *.csproj ./ | |
RUN dotnet restore | |
COPY . ./ | |
RUN dotnet publish -c Release | |
# Add root certificates |
NewerOlder