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 wave | |
import numpy as np | |
import numpy.typing as npt | |
def read_wav(filename: str) -> tuple[npt.NDArray[np.float32], int]: | |
""" | |
Read PCM wav file | |
Support PCM_U8, PCM_16, PCM_24 and PCM_32 formats. |
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 onnx | |
import gigaam | |
from gigaam.onnx_utils import VOCAB | |
onnx_dir = "gigaam-onnx" | |
model_type = "v2_ctc" | |
model = gigaam.load_model( | |
model_type, | |
fp16_encoder=False, # only fp32 tensors |
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 <vector> | |
#include <span> | |
#include <complex> | |
#include <cmath> | |
#include <numbers> | |
#include <fftw3.h> | |
using std::complex; | |
using std::span; |
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 numpy as np | |
import numpy.typing as npt | |
class OnlineStft: | |
n_freq: int | |
def __init__(self, n_fft: int, n_hop: int, n_channels: int): | |
self._hop = n_hop | |
self.n_freq = n_fft // 2 + 1 | |
self._win_a = np.hamming(n_fft + 1)[:-1] |
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
using System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
using System.Drawing.Imaging; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Windows.Forms; |
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 { Component, Input, ViewChild, AfterViewInit, ElementRef } from '@angular/core'; | |
import { Router } from '@angular/router'; | |
import { markdown } from 'markdown'; | |
@Component({ | |
selector: 'markdown', | |
template: `<div [innerHtml]="html" #root></div>` | |
}) | |
export class MarkdownComponent implements AfterViewInit { | |
@ViewChild('root') root: ElementRef; |
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
using System; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
using System.Threading.Tasks; | |
using Microsoft.CodeAnalysis.CSharp.Scripting; | |
using Microsoft.CodeAnalysis.Scripting; | |
namespace AutomaticDifferentiation | |
{ | |
public struct DualNumber |
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 <algorithm> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <map> | |
using namespace std; | |
pair<int, int> get_next_prime(int k) | |
{ | |
for (int i = 2; i < k; i++) |
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 <iostream> | |
#include <string> | |
#include <iomanip> | |
using namespace std; | |
int main() | |
{ | |
std::string a; | |
getline(std::cin, a); |
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
using System.Collections.Frozen; | |
using System.Text; | |
var text = Console.ReadLine()!; | |
using var reader = new StringReader(text); | |
var parser = new Parser(); | |
var tokens = parser.Tokenize(reader).ToList(); | |
Console.WriteLine(string.Join("\n", tokens)); |
NewerOlder