Skip to content

Instantly share code, notes, and snippets.

Martin Evans martindevans

Block or report user

Report or block martindevans

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View parsing.lol
i=:read_string_to_parse_to_number o=0 n=1 goto(i=="")*18+(i!="")*2 // Input, setup, check for empty string
a=i---i goto(a=="1")*2+(a=="2")*3+(a=="3")*4+(a=="4")*5+(a=="5")*6+4 // Consume 1 character of input, jump to characters [12345], fall through due to runtime error is string is empty
:result=o goto 20 // SUCCESS, result is stored in `o`
goto(a=="6")*6+(a=="7")*7+(a=="8")*8+(a=="9")*9+(a=="0")*10+5 // Jump to characters [67890], jump to next line for unknown char
goto 19 // FAILURE, unknown char (stored in `a`)
o+=1*n n*=10 goto 2
o+=2*n n*=10 goto 2
o+=3*n n*=10 goto 2
o+=4*n n*=10 goto 2
o+=5*n n*=10 goto 2
View BasicFileStreamingCapture (4).cs
using System;
using System.Collections.Generic;
using System.IO;
using NAudio.Wave;
using UnityEngine;
namespace Dissonance.Audio.Capture
{
public class BasicFileStreamingCapture
: MonoBehaviour, IMicrophoneCapture
View BasicFileStreamingCapture (3).cs
using System;
using System.Collections.Generic;
using NAudio.Wave;
using UnityEngine;
namespace Dissonance.Audio.Capture
{
public class BasicFileStreamingCapture
: MonoBehaviour, IMicrophoneCapture
{
View BasicStreamingCapture (2).cs
using System;
using System.Collections.Generic;
using NAudio.Wave;
using UnityEngine;
namespace Dissonance.Audio.Capture
{
public class SomeNamespace
: MonoBehaviour, IMicrophoneCapture
{
View BasicFileStreamingCapture (1).cs
using System;
using NAudio.Wave;
using UnityEngine;
namespace SomeNamespace
{
public class BasicFileStreamingCapture
: MonoBehaviour, IMicrophoneCapture
{
public bool IsRecording { get; private set; }
View Test.cs
public class Test
: MonoBehaviour
{
void OnEnable()
{
try
{
DissonanceComms.TestDependencies()
}
catch (Exception e)
View Dissonance Latency.md

Note: This was written as a response for a specific Dissonance customer who had applied some tweaks:

  • This is written assuming Tiny Frames (i.e. 10ms), these can only be used in a LAN setting.
  • Jitter buffer delay in Dissonance is normally a minimum of 50ms, that's not taken into account here.

All delays here are worst case, the average case will be about half that!



View equalitywtf.cs
public class Cat
: IEquatable<Cat>
{
public readonly string Name;
public readonly int Age;
public Cat(string name, int age)
{
Name = name;
Age = age;
View cats.cs
public class Demo
{
public static void DemoIt()
{
var cat = new GenericBuilder<TypeFalse, TypeFalse>()
.SetAge(11)
.SetName("Totoro")
.Build();
}
}
View builder.cs
public class Demo
{
public static void DemoIt()
{
var builder = new GenericBuilder<TypeTrue, TypeFalse>();
// builder.Build(); Not valid
var builder2 = new GenericBuilder<TypeTrue, TypeTrue>();
builder2.Build();
}
You can’t perform that action at this time.