Skip to content

Instantly share code, notes, and snippets.

@v
v / test_sqlite.py
Created July 26, 2024 19:22
trying to break sqlite3 concurrency on my laptop
import asyncio
import sqlite3
async def check_and_insert(db, key, value):
try:
# Check if the key exists
cursor = db.execute("SELECT value FROM cache WHERE key = ?", (key,))
result = cursor.fetchone()
if result is None:
segment_id labeling_type queue_tag start_stage end_stage is_partial is_test is_mvp taxonomy_subset requesting_user project_tag metric_tag metric_tag metric_tag track track cameras_object cameras_surround camera param_tag param_tag priority_tag seconds_delay max_num_frames segment_type report_type recipients cruise_commit taxonomy_version sampling_request_id frame_rate instructions relabeling_job_type Note
5G21A6P04L4100140:1630371295:1630371314 no_checks automsl publish_auto_labeling publish_auto_labeling FALSE FALSE TRUE AV Tracked Objects [email protected] automsl automsl_roman
@v
v / video2gif
Created November 12, 2021 19:14
#!/bin/bash
FILE="$1"
OUTPUT="${FILE%%.*}.gif"
echo $OUTPUT
ffmpeg -i "$FILE" -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "$OUTPUT"
segment_id queue_tag start_stage end_stage is_partial is_test is_mvp taxonomy_subset labeling_type requesting_user project_tag metric_tag metric_tag metric_tag track track cameras_object cameras_surround camera param_tag param_tag priority_tag seconds_delay max_num_frames chassis_roi_radius segment_type report_type recipients cruise_commit taxonomy_version sampling_request_id instructions frame_rate relabeling_job_type Note
5G21A6P06L4100169:1582742992:1582743012 asdf lidar_box_labeling lidar_box_labeling TRUE MSL track_3 [email protected]
@v
v / beam.go
Created February 25, 2021 23:47
package main
import (
"context"
"fmt"
"log"
"reflect"
"strconv"
"strings"
@v
v / strings.py
Created February 5, 2019 06:42
Examples of string formatting
command = "SELECT * FROM whatever"
print(command)
fieldname = "age"
command = "SELECT " + fieldname + " from whatever"
print(command)
fieldname = 'age'
fieldname2 = 16
command = "SELECT %s from whatever WHERE %s=%d" % (fieldname, fieldname, fieldname2)
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link href="styles.css" rel="stylesheet" />
</head>
<body>
<div class="mask">
<div id = "blast"><img src="https://media.tenor.co/images/513e803a0af2bfe18a9a43a46917118d/tenor.gif"></div>
<img src="http://vignette1.wikia.nocookie.net/town-of-salem/images/4/4d/Yuan_Itor.png/revision/latest?cb=20160826042531" id="logo">
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link href="styles.css" rel="stylesheet" />
</head>
<body>
<div class="mask">
<div id = "blast"><img src="https://media.tenor.co/images/513e803a0af2bfe18a9a43a46917118d/tenor.gif"></div>
<img src="http://vignette1.wikia.nocookie.net/town-of-salem/images/4/4d/Yuan_Itor.png/revision/latest?cb=20160826042531" id="logo">
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link href="styles.css" rel="stylesheet" />
</head>
<body>
<div class="mask">
<div id = "blast"><img src="https://media.tenor.co/images/513e803a0af2bfe18a9a43a46917118d/tenor.gif"></div>
<img src="http://vignette1.wikia.nocookie.net/town-of-salem/images/4/4d/Yuan_Itor.png/revision/latest?cb=20160826042531" id="logo">