This file contains hidden or 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
echo "base64 decode" | |
node benchmark/buffers/buffer-base64-decode.js | |
./out/Release/node benchmark/buffers/buffer-base64-decode.js | |
#echo "base64 encode" | |
#node benchmark/buffers/buffer-base64-encode.js | |
#./out/Release/node benchmark/buffers/buffer-base64-encode.js | |
echo "base64url decode" | |
node benchmark/buffers/buffer-base64url-decode.js |
This file contains hidden or 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
public unsafe static byte* GetPointerToFirstInvalidByteSse(byte* pInputBuffer, int inputLength) | |
{ | |
int processedLength = 0; | |
if (pInputBuffer == null || inputLength <= 0) | |
{ | |
return pInputBuffer; | |
} | |
if (inputLength > 128) |
This file contains hidden or 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
Vector128<byte> shuf1 = Vector128.Create(TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, | |
TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG, | |
TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS, | |
TOO_SHORT | OVERLONG_2, | |
TOO_SHORT, | |
TOO_SHORT | OVERLONG_3 | SURROGATE, | |
TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4); | |
Vector128<byte> shuf2 = Vector128.Create(CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4, |
This file contains hidden or 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
// See https://twitter.com/pdimov2/status/1462802234761170949 | |
#include <array> | |
#include <string_view> | |
#include <string> | |
#include <iostream> | |
// For now experimental/reflect is not available generally, but | |
// it should be standardized for C++ 26 ???? Still, we have | |
// access to it with the very latest llvm. | |
#include <experimental/reflect> |
This file contains hidden or 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
################# | |
# This starts a web server listening on port 8001, with debugging turned n. | |
# This should not be be used to run the chatbot on a public website: it is meant | |
# for testing purposes only. | |
################# | |
from flask import Flask, request, jsonify | |
from flask import Flask, render_template, request, url_for | |
from langchain.chat_models import ChatOpenAI | |
from langchain.docstore.document import Document |
This file contains hidden or 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
############### | |
# You should basically never use this program. It is only for generating the embeddings for your ChatBot. | |
# If you want to run the ChatBot, see web_app.py | |
############### | |
import os | |
from openai.embeddings_utils import get_embedding, cosine_similarity | |
import pandas | |
import openai | |
import glob | |
import time |
This file contains hidden or 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
// cc test.c -lcurl -o testcurl && ./testcurl | |
#include <curl/curl.h> | |
#include <stdio.h> | |
int main() { | |
CURLU *url = curl_url(); | |
CURLUcode rc = curl_url_set( | |
url, CURLUPART_URL, "https://www.7‑Eleven.com/Home/Privacy/Montréal", 0); | |
// Returns a CURLUcode error value, which is (0) if everything went fine. | |
if (rc == 0) { | |
char *buffer; |
This file contains hidden or 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 "simdjson.h" | |
#include <fstream> | |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
using namespace simdjson; | |
std::string read_file(const std::string &filename) { | |
std::ifstream file(filename); |
This file contains hidden or 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 strict"; | |
import { bench, run } from "mitata"; | |
import { existsSync, createWriteStream, readFileSync, mkdirSync } from "node:fs"; | |
import path from "node:path"; | |
import axios from "axios"; | |
const fixturesFolderPath = new URL('fixtures', import.meta.url).pathname; | |
const urls = [ | |
"https://github.com/ada-url/url-various-datasets/blob/main/files/isaacs_files.txt", |