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
use criterion::{criterion_group, criterion_main, Criterion}; | |
use kanal::bounded; | |
use ringbuf::traits::{Consumer, Producer, Split}; | |
use ringbuf::{SharedRb, storage::Heap}; | |
use std::sync::Arc; | |
use std::thread; | |
use std::time::Instant; | |
use parking_lot::Mutex as ParkingMutex; | |
const NUM_MESSAGES: usize = 1_000_000; |
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
extern crate anyhow; | |
extern crate cpal; | |
extern crate ringbuf; | |
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; | |
use ringbuf::{ | |
traits::{Consumer, Producer, Split}, | |
HeapRb, | |
}; |
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
// 2nd proposal | |
User = { | |
name: Some<String>, | |
age: Int = 0 // default value | |
} | |
// can be called with User { } | |
User() User { |
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> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Mortgage Repayment Visualization</title> | |
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script> | |
<script src="https://cdn.tailwindcss.com"></script> | |
</head> |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <dlfcn.h> | |
#include <objc/runtime.h> | |
#include <objc/message.h> | |
// gcc -framework AppKit -framework Foundation window.c -o window | |
// Define CGFloat | |
#ifdef __LP64__ |
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
LinkedList<T>: { | |
allocator: Allocator, | |
Node: { | |
value: T, | |
next: Option<Node>, | |
}, |
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
#include <stdio.h> | |
#include <stdlib.h> | |
// #include <opus/opus.h> | |
#include </opt/homebrew/Cellar/opus/1.5.2/include/opus/opus.h> // cbf build path | |
// brew install opus | |
// gcc -O3 -o miniaudio_opus_example miniaudio_opus_example.c -I/opt/homebrew/Cellar/opus/1.5.2/include -L/opt/homebrew/Cellar/opus/1.5.2/lib -lm -lpthread -lopus && ./miniaudio_opus_example | |
#define MINIAUDIO_IMPLEMENTATION | |
#include "miniaudio.h" |
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 AVFoundation | |
import Opus | |
import SwiftUI | |
import Starscream | |
import CoreAudio | |
import CoreAudioTypes | |
import AVFoundation | |
import AudioToolbox | |
import Foundation |
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
use std::future::Future; | |
use std::thread::sleep; | |
use std::time::Duration; | |
use anyhow::{anyhow, Result}; | |
use opus::{Application, Decoder, Encoder}; | |
use rodio::buffer; | |
use rodio::cpal; | |
use rodio::cpal::traits::HostTrait; | |
use rodio::cpal::traits::StreamTrait; |
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> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<script> |
NewerOlder