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
<html> | |
<body> | |
<div id="app"></div> | |
<script type="importmap"> | |
{ | |
"imports": { | |
"preact": "https://unpkg.com/[email protected]/dist/preact.module.js", | |
"preact/hooks": "https://unpkg.com/[email protected]/hooks/dist/hooks.module.js" | |
} | |
} |
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 getpass | |
import json | |
import re | |
import sys | |
import requests | |
GROUP_URL_PATTERN = "https://hypothes.is/groups/([^/]+)/.*" | |
api_token = getpass.getpass( |
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
# Analysis of Hypothesis Python app routes as part of | |
# https://github.com/hypothesis/playbook/issues/1797#issuecomment-2397242000. | |
import os | |
import ast | |
import sys | |
def find_py_files(root_dir): | |
excluded_dirs = ["node_modules", "build", "test", "tests", "third_party"] |
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
# Script to fetch and print the transcript for a YouTube video using the | |
# YouTube Data API v3. | |
# | |
# 1. Create a project in the Google API Console | |
# 2. Enable the YouTube Data API v3 for the new project | |
# 3. Create credentials for a "Desktop" OAuth client. Download the JSON file | |
# containing the credentials at the end of the setup process. | |
# 4. Create a new virtualenv and install dependencies with: | |
# | |
# ``` |
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 <chrono> | |
#include <iostream> | |
#include <iterator> | |
#include <random> | |
#include <vector> | |
#include <Accelerate/Accelerate.h> | |
#include <cblas.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
import cv2 | |
import numpy as np | |
import argparse | |
def warp_quadrilateral( | |
input_path: str, | |
src_points: list[tuple[int, int]], | |
output_path: str, | |
output_size: tuple[int, int], |
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
use ndarray::{Array, Array2, ArrayView, Dim, Dimension, Ix, StrideShape}; | |
use rten_tensor::prelude::*; | |
use rten_tensor::{NdTensor, NdTensorView}; | |
/// Convert an N-dimensional ndarray view to an [NdTensorView]. | |
/// | |
/// Returns `None` if the view is not in the standard layout (see | |
/// [ArrayView::is_standard_layout]). | |
fn as_ndtensor_view<'a, T, const N: usize>( |
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
# At entry params are: | |
# | |
# tile_ptr (rdi) | |
# tile_row_stride (rsi) | |
# a (rdx, rcx) | |
# b (r8, r9) | |
# depth (stack) | |
# alpha (xmm0) | |
# beta (xmm1) | |
.section __TEXT,__text,regular,pure_instructions |
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
//! Port of https://github.com/danieldk/gemm-benchmark/ for comparison of | |
//! matrix multiplication performance against other popular libraries. | |
use std::time::Duration; | |
use wasnn::gemm; | |
use wasnn_tensor::prelude::*; | |
use wasnn_tensor::NdTensor; | |
use rayon::iter::IntoParallelIterator; |
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 os | |
import requests | |
search_after = "" | |
page_size = 200 | |
group = os.environ["HYPOTHESIS_GROUP"] | |
access_token = os.environ["HYPOTHESIS_ACCESS_TOKEN"] | |
max_to_fetch = 10_000 # Max annotations to fetch before we stop |
NewerOlder