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
private float AnalyzeSound() | |
{ | |
float[] samples = new float[1024]; | |
this.audioSource.GetOutputData(samples, 0); // fill array with samples | |
float sum = 0; | |
for (int i = 0; i < 1024; i++) | |
{ | |
sum += samples[i] * samples[i]; // sum squared samples | |
} | |
return Mathf.Sqrt(sum / 1024); // rms = square root of average |
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
namespace VSOBugReporter | |
{ | |
public class Functions | |
{ | |
/// <summary> | |
/// Sends an email using sendgrid | |
/// </summary> | |
/// <param name="message">message body</param> | |
private void SendMail(string message) |
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
namespace VSOBugReporter | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
var config = new JobHostConfiguration(); | |
// Enabling detailed tracing | |
config.Tracing.ConsoleLevel = TraceLevel.Verbose; |
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
{ | |
"Type": "FunctionCompleted", <- Web Job Status | |
"EndTime": "2016-02-18T05:22:24.8783464+00:00", <- Time when web job ended | |
"ParameterLogs": {}, | |
"FunctionInstanceId": " d463f402-04bd-48d4-bcad-ce7bafcb858a", <- The instance ID of the function being bound to. This unique is of GUID datatype | |
"Function": { | |
"Id": "testjob.Functions.ProcessSomething", <- Name of the function executed by the WebJob. Format - namespace.class.functionname | |
"FullName": "testjob.Functions.ProcessSomething", | |
"ShortName": "Functions.ProcessSomething", | |
"Parameters": [ |
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
{ | |
"Type": "HostStarted", <- Status of the Web Job execution | |
"Functions": [ | |
{ | |
"Id": "testjob.Functions.ProcessSomething", <- Name of the function executed by the WebJob. Format - namespace.class.functionname | |
"FullName": "testjob.Functions.ProcessSomething", | |
"ShortName": "Functions.ProcessSomething", | |
"Parameters": [ | |
{ | |
"Type": "ParameterDescriptor", |
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
namespace testjob | |
{ | |
public class Functions | |
{ | |
[NoAutomaticTriggerAttribute] | |
public static async Task ProcessSomething(TextWriter log) | |
{ | |
Thread.Sleep(7000); | |
log.WriteLine("Process Something called at : " + DateTime.Now.ToShortDateString() + " , " + DateTime.Now.ToShortTimeString()); |