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
// Used in https://jina.ai/tokenizer (Aug. 14th version) | |
// Define variables for magic numbers | |
const MAX_HEADING_LENGTH = 6; | |
const MAX_HEADING_CONTENT_LENGTH = 200; | |
const MAX_HEADING_UNDERLINE_LENGTH = 200; | |
const MAX_HTML_HEADING_ATTRIBUTES_LENGTH = 100; | |
const MAX_LIST_ITEM_LENGTH = 200; | |
const MAX_NESTED_LIST_ITEMS = 5; | |
const MAX_LIST_INDENT_SPACES = 7; | |
const MAX_BLOCKQUOTE_LINE_LENGTH = 200; |
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 <chrono> | |
#include <iostream> | |
#include <vector> | |
#include <random> | |
#include <cstring> | |
#include <array> | |
#include <cblas.h> | |
#include <rknn_matmul_api.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
#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> |
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 <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) | |
{ |
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 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) |
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 "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) |
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 <drogon/drogon.h> | |
#include <exception> | |
#include <coroutine> | |
#include <stdexcept> | |
using namespace drogon; | |
int main() | |
{ | |
app().createDbClient("postgresql", "localhost", 5432, "test", "test", "some legit password 191561", 16) |
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
==> Making package: root 6.22.06-1 (Mon 07 Dec 2020 02:32:35 PM CST) | |
==> Checking runtime dependencies... | |
==> Checking buildtime dependencies... | |
==> Retrieving sources... | |
-> Found ROOFIT_LICENSE | |
-> Found root.xml | |
-> Found root.pc.tpl | |
-> Found settings.cmake | |
-> Found jupyter_notebook_config.py | |
-> Found nbman-for-arch.patch |
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
// To compile: (Tested on Arch Linux) | |
// c++ sdl_gl.cpp -o sdl_gl `pkg-config sdl2 --cflags --libs` -lwayland-egl -lwayland-egl -lGL -lEGL -lX11 && ./sdl_gl | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <assert.h> | |
#include <SDL2/SDL.h> | |
#include <SDL2/SDL_opengl.h> | |
#include "SDL2/SDL_syswm.h" | |
#include <GL/gl.h> |
NewerOlder