Skip to content

Instantly share code, notes, and snippets.

View jason810496's full-sized avatar
:copilot:
Focusing

Jason(Zhe-You) Liu jason810496

:copilot:
Focusing
View GitHub Profile
#!/bin/bash
# Function to display usage information
show_help() {
echo "Usage: $(basename $0) -r REPOSITORY -u USERNAME [-s START_DATE] [-e END_DATE]"
echo
echo "Examples:"
echo " $(basename $0) -r owner/repo -u username"
echo " $(basename $0) -r owner/repo -u username -s 2025-01-01 -e 2025-01-31"
echo
@jason810496
jason810496 / timer.sh
Created February 15, 2025 10:54
Simple script for benchmarking.
#!/bin/bash
if [ "$#" -eq 0 ]; then
echo "Usage: $0 <command>"
exit 1
fi
TOTAL_TIME=0
NUM_RUNS=5
from minio import Minio
from io import BytesIO
def get_minio_content_as_binaryio(minio_client: Minio, bucket_name: str, object_name: str):
# Fetch the object from MinIO
response = minio_client.get_object(bucket_name, object_name)
# Read the content into a BytesIO object
content = BytesIO(response.read())
import os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
from typing import List, BinaryIO
def send_mail_with_pdf(subject: str, recipients: List[str], attachments: List[BinaryIO], body: str, subtype: str = 'plain'):
+----+-------+-------+-------+
| -1 | 24000 | 14000 | 26000 |
+----+-------+-------+-------+
| -1 | -1 | 6000 | 12000 |
+----+-------+-------+-------+
| -1 | -1 | -1 | 9000 |
+----+-------+-------+-------+
| -1 | -1 | -1 | -1 |
+----+-------+-------+-------+
Optimal BST Cost: 31
e:(expected cost)
+---+---+---+---+---+
| 0 | 0 | 0 | 0 | 0 |
+---+---+---+---+---+
| 0 | 2 | 9 | 21| 31|
+---+---+---+---+---+
| 0 | 0 | 3 | 14| 21|
+---+---+---+---+---+
| 0 | 0 | 0 | 4 | 11|
38
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| 0 | 0 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| 0 | 0 | 8 | 8 | 8 | 14| 14| 14| 14| 14| 14| 14| 14| 14| 14| 14| 14|
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| 0 | 0 | 8 | 8 | 8 | 15| 15| 23| 23| 23| 29| 29| 29| 29| 29| 29| 29|
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#define ll long long
#define OAO cin.tie(0);ios_base::sync_with_stdio(0);
#define F first
#define S second
#define PB push_back
@jason810496
jason810496 / LongestIncreasingSubsequence
Created May 19, 2024 10:12
Longest Increasing Subsequence (Dynamic Programming) in C++
3
+---+---+---+---+---+---+
| 0 | 0 | 0 | 0 | 0 | 0 |
+---+---+---+---+---+---+
| 0 | 1 | 1 | 1 | 1 | 1 |
+---+---+---+---+---+---+
| 0 | 1 | 2 | 2 | 2 | 2 |
+---+---+---+---+---+---+
| 0 | 1 | 2 | 2 | 3 | 3 |
+---+---+---+---+---+---+
@jason810496
jason810496 / MatrixChainMultiplication
Last active May 19, 2024 10:09
Matrix Chain Multiplication (Dynamic Programming) in C++
26000
30
6000
4500
82