Skip to content

Instantly share code, notes, and snippets.

@frankbryce
frankbryce / minecrafthud.ipynb
Last active May 3, 2020 19:03
MinecraftHUD20200502.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@frankbryce
frankbryce / datalabeler.ipynb
Last active May 3, 2020 19:03
DataLabeler20200502.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// compute probability of landing on tile after certain number of steps of brownian
package main
import (
"flag"
"fmt"
"math/big"
"math/rand"
"os"
"time"
<!DOCTYPE html>
<html>
<head><title>SOUND</title></head>
<body>
<div>Frequence: <span id="frequency"></span></div>
<script type="text/javascript">
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var oscillatorNode = audioCtx.createOscillator();
var gainNode = audioCtx.createGain();
@frankbryce
frankbryce / concurrentqueue.go
Last active March 15, 2018 15:31
An simple interface and implementation for concurrent queue in go
// Can be any backing type, even 'interface{}' if desired.
// See stackoverflow.com/q/11403050/3960399 for type conversion instructions.
type IntConcurrentQueue interface {
// Inserts the int into the queue
Enqueue(int)
// Will return error if there is nothing in the queue or if Close() was already called
DequeueNonBlocking() (int, error)
// Will block until there is a value in the queue to return.
// Will error if Close() was already called.
DequeueBlocking() (int, error)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WampSharp.V2;
using WampSharp.V2.Client;
using WampSharp.V2.Core.Contracts;
namespace HubUSA.LPR.CameraService
{
public class DoublyLinkedList<T> : ICloneable, IEnumerable where T : ICloneable
{
private class Node<U>
{
public U Value;
public Node<U> Next;
public Node<U> Prev;
public Node(U value, Node<U> next, Node<U> prev)
{
public class DoublyLinkedListNode<T>
{
private T element;
private DoublyLinkedListNode<T> next;
private DoublyLinkedListNode<T> previous;
public DoublyLinkedListNode(T element)
{
this.element = element;
this.next = null;
@frankbryce
frankbryce / Timebox.cs
Last active January 5, 2016 16:53
Timebox Class
using System;
using System.Threading.Tasks;
public class Timebox
{
private readonly TimeSpan _ts;
public Timebox(TimeSpan ts)
{
_ts = ts;
@frankbryce
frankbryce / TypeSyntaxFactory.cs
Last active January 28, 2024 06:25
This is a factory to create a TypeSyntax Roslyn Model object from simple strings. Enjoy!
using System.Linq;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace StackOverflow.Roslyn
{
public static class TypeSyntaxFactory
{
/// <summary>
/// Used to generate a type without generic arguments