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
version: '2.2' | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.1 | |
container_name: elasticsearch | |
environment: | |
- cluster.name=docker-cluster | |
- bootstrap.memory_lock=true | |
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" | |
ulimits: |
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 NAudio.Wave; | |
using NAudio.Wave.SampleProviders; | |
namespace FireAndForgetAudioSample | |
{ | |
class AudioPlaybackEngine : IDisposable | |
{ | |
private readonly IWavePlayer outputDevice; | |
private readonly MixingSampleProvider mixer; |
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
// Define other methods and classes here | |
/// <summary> | |
/// Sample Provider to allow fading in and out | |
/// </summary> | |
public class DelayFadeOutSampleProvider : ISampleProvider | |
{ | |
enum FadeState | |
{ | |
Silence, | |
FadingIn, |
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
string[] SizeSuffixes = { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" }; | |
string SizeSuffix(long value, int decimalPlaces = 0) | |
{ | |
if (value < 0) | |
{ | |
throw new ArgumentException("Bytes should not be negative", "value"); | |
} | |
var mag = (int)Math.Max(0, Math.Log(value, 1024)); | |
var adjustedSize = Math.Round(value / Math.Pow(1024, mag), decimalPlaces); | |
return $"{adjustedSize} {SizeSuffixes[mag]}"; |
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
@echo off | |
cls | |
if not exist ".\.nuget" mkdir ".\.nuget" | |
if not exist ".\.nuget\nuget.exe" powershell -Command "Invoke-WebRequest https://www.nuget.org/nuget.exe -OutFile .\.nuget\nuget.exe" | |
".nuget\NuGet.exe" "Install" "FAKE" "-OutputDirectory" "packages" "-ExcludeVersion" | |
"packages\FAKE\tools\Fake.exe" build.fsx %* | |
pause |
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
<Window x:Class="WpfButtonStyles.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="WPF Example Button Styles" Height="350" Width="525"> | |
<Window.Resources> | |
<Style | |
TargetType="Button" x:Key="NewGameButtonStyle"> | |
<Setter Property="FontFamily" Value="Resources/teen bd.ttf#Teen" /> | |
<Setter Property="FontSize" Value="18" /> | |
<Setter Property="Template"> |
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
<Query Kind="Statements"> | |
<Namespace>System.Collections.Concurrent</Namespace> | |
<Namespace>System.Threading.Tasks</Namespace> | |
<Namespace>System.Threading.Tasks.Dataflow</Namespace> | |
</Query> | |
var produceSpeed = TimeSpan.FromSeconds(0.5); | |
var produceCount = 20; | |
var consumeSpeed = TimeSpan.FromSeconds(2); | |
var maxParallelConsume = 4; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title></title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="style.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div class="container"> |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Simple JQuery Quiz</title> | |
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" /> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script> |
NewerOlder