Skip to content

Instantly share code, notes, and snippets.

View marty1885's full-sized avatar
👨‍💻
Writing code

Martin Chang marty1885

👨‍💻
Writing code
View GitHub Profile
#include <chrono>
#include <iostream>
#include <vector>
#include <random>
#include <cstring>
#include <array>
#include <cblas.h>
#include <rknn_matmul_api.h>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <iostream>
#include <vector>
#include "tiny_dnn/tiny_dnn.h"
using namespace tiny_dnn;
using namespace tiny_dnn::activation;
using namespace tiny_dnn::layers;
int main()
{
#define CNN_USE_AVX //Enable the AVX backend for faster computing
#include "tiny_dnn/tiny_dnn.h"
using namespace tiny_dnn;
using namespace tiny_dnn::activation;
using namespace tiny_dnn::layers;
#include "AudioFile.h"
#include <vector>
#include <random>
#include <string>
#include <vector>
#include <functional>
#include <iostream>
#include <optional>
#include <cassert>
#include <unordered_set>
#include <cppcoro/generator.hpp>
#include <cppcoro/task.hpp>
#include <cppcoro/sync_wait.hpp>
@marty1885
marty1885 / root-realtime-plot.cpp
Last active October 1, 2021 15:52
Spectrum and waveform display using ROOT
// Using SFML as out audio loader and player
#include <SFML/Audio.hpp>
// The standard headers we need
#include <iostream>
#include <thread>
#include <chrono>
#include <stdexcept>
#include <memory>
#include <cassert>
#include <cxxabi.h>
#include <iostream>
void demangle_name(const std::string& mangled_name)
{
std::size_t len = 0;
int status = 0;
auto name = __cxxabiv1::__cxa_demangle(mangled_name.c_str(), nullptr, &len, &status);
if (status == 0)
{
#include <cstddef>
#include <functional>
#include <memory>
#include <utility>
#include <stdexcept>
#include <iostream>
template <typename>
struct shared_function{};
import gym
from etaler import et
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
def running_mean(x, N):
cumsum = np.cumsum(np.insert(x, 0, 0))
return (cumsum[N:] - cumsum[:-N]) / float(N)
@marty1885
marty1885 / crypto.cpp
Created March 15, 2021 00:07
Cryptographic (password hashing) library for Drogon
#include "crypto.hpp"
#include <regex>
#include <bsd/stdlib.h>
#include <botan/argon2.h>
#include <botan/system_rng.h>
static Botan::System_RNG rng;
uint32_t secureRandom(uint32_t lower, uint32_t upper)