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", |
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
| using System; | |
| using System.Runtime.Intrinsics; | |
| using System.Runtime.Intrinsics.X86; | |
| using System.Runtime.Intrinsics.Arm; | |
| using System.Runtime.CompilerServices; | |
| using System.Runtime.InteropServices; | |
| // Ideally, we would want to implement something that looks like | |
| // https://learn.microsoft.com/en-us/dotnet/api/system.text.asciiencoding?view=net-7.0 |
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
| 52791.000000 164108.000000 353080.000000 | |
| 43083.000000 134047.000000 342931.000000 | |
| 42750.000000 132955.000000 342934.000000 | |
| 42792.000000 133068.000000 342947.000000 | |
| 42625.000000 132742.000000 342930.000000 | |
| 42667.000000 132701.000000 342934.000000 | |
| 42541.000000 132560.000000 342938.000000 | |
| 42583.000000 132513.000000 342930.000000 | |
| 42667.000000 132687.000000 342938.000000 | |
| 42583.000000 132509.000000 342938.000000 |
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 <iostream> | |
| using namespace simdjson; // optional | |
| int main() { | |
| padded_string json = R"( {"exports": {}} )"_padded; | |
| ondemand::parser parser; | |
| ondemand::document doc = parser.iterate(json); | |
| ondemand::object obj; | |
| auto err = doc.get_object().get(obj); |
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
| const Benchmark = require('benchmark'); | |
| const { TypedFastBitSet } = require('typedfastbitset'); | |
| const { RoaringBitmap32 } = require('roaring/RoaringBitmap32'); | |
| // Set utils | |
| function union(set1, set2) { | |
| return new Set([...set1, ...set2]); | |
| } | |
| function difference(set1, set2) { |