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
// Set your data context to no connection by default and then use this | |
// bind IDbConnection to this provider. It has to be a provider of | |
// IDbConnection or else it will try to use the string overload. | |
// | |
// Where you register your services, you'll add the following line in your scope of choice: | |
// kernel.Bind<IDbConnection>().ToProvider<ProfiledDbConnectionProvider>(); | |
internal class ProfiledDbConnectionProvider : Provider<IDbConnection> | |
{ | |
const string ConnectionStringName = @"connection string name"; |
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 class IdHelper | |
{ | |
private static int CurrentId = 0; | |
public static int NextId() | |
{ | |
var newId = Interlocked.Increment(ref CurrentId); | |
return newId; | |
} | |
} |
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>Teleprompter</title> | |
<style type="text/css"> | |
html, body { | |
height: 100%; | |
min-height: 100%; | |
} | |
#teleprompter { |
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
async Task Main() | |
{ | |
//Environment.Version.Dump(); | |
Util.CreateSynchronizationContext(); | |
// 3ms to 35ms | |
var times = Enumerable.Range(0, 1_000) | |
.Select(m => | |
{ | |
var randNorm = RandomNormal(10d, 10d); | |
return Math.Max(randNorm, 3d); |
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
# inspiration from https://github.com/devicehive/devicehive-audio-analysis | |
import sys | |
import pyaudio | |
import numpy as np | |
import wave | |
import os | |
import tensorflow as tf | |
import vggish_input |