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
import com.google.common.base.Preconditions; | |
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.OutputStreamWriter; |
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 Concentus.Structs; | |
using NAudio.Wave; | |
using System; | |
using System.Threading.Tasks; | |
namespace AudioGen | |
{ | |
public class BufferedSampleProvider : ISampleProvider | |
{ | |
private float[] Buffer { get; } |
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
public static string GenerateId(int length) | |
{ | |
const string symbols = "abcdefghijklmnopqrstuvwxyz0123456789"; | |
byte[] buffer = null; | |
try | |
{ | |
buffer = ArrayPool<byte>.Shared.Rent(length); |
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
import java.io.File | |
import java.util.* | |
// https://rosettacode.org/wiki/Combinations#Kotlin | |
inline fun <reified T> combinations(arr: List<T>, m: Int) = sequence { | |
val n = arr.size | |
val result = Array(m) { arr[0] } | |
val stack = LinkedList<Int>() | |
stack.push(0) | |
while (stack.isNotEmpty()) { |