Skip to content

Instantly share code, notes, and snippets.

View ryankert01's full-sized avatar
🌖
Moon Later

Ryan Huang ryankert01

🌖
Moon Later
View GitHub Profile
@ryankert01
ryankert01 / youtube_thumbnail_crawling.py
Created April 17, 2022 06:48
downlaod youtube tumbnails image in the folder you like
import re
import requests
import os
#urls to id
url = "YouTube URL"
exp = "^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*"
s = re.findall(exp,url)[0][-1]
thumbnail = f"https://i.ytimg.com/vi/{s}/maxresdefault.jpg"
// HugeInteger test program.
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
using std::ostream;
#include <iomanip>
using std::setw;
using std::setfill;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ryan</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
@ryankert01
ryankert01 / fix-USB-showing-up-as-two-partitions.md
Created March 17, 2024 03:01 — forked from krisbolton/fix-USB-showing-up-as-two-partitions.md
How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows

How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows:

  1. Hold the Windows key and press X, select PowerShell (Admin), select Yes to the pop-up. You can also use Command Prompt.
  2. In the Powershell interface type diskpart to enter the disk partition tool.
  3. Type list disk to see all disks listed.
  4. Select the USB drive by typing select disk [NUMBER]. Be careful to select the correct drive.
  5. Type clean. An error will occur if you have the drive folder open, close the window and repeat the command if this happens.
  6. Type create partition primary.
  7. Type format fs=ntfs quick to format the drive (you can also choose to set fs=fat32).
  8. Type active.
@ryankert01
ryankert01 / etfs_backtrack.py
Created February 2, 2025 10:40
Backtrack Leverage ETF strategy
# ETF Portfolio Strategy:
# 1. Initial Investment: $10,000 base investment
# 2. Periodic Investment: Additional $10,000 contribution every year on February 15th
# 3. Asset Allocation: 50/50 allocation between VOO and QQQ
# 4. Rebalancing: Annual rebalancing on February 15th (same day as contribution)
# 5. Leveraged Option: 1.25x leverage on the base portfolio with 3% annual borrowing cost
#
# Key Features:
# - Historical data analysis from 2015 to present
# - Comparison between base and leveraged portfolio performance
#include <iostream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <omp.h>
#include <chrono>
using namespace std;

專案提案:重現論文《Textualize Visual Prompt for Image Editing via Diffusion Bridge》

專案目標 (Project Goal):

本專案旨在重現論文《Textualize Visual Prompt for Image Editing via Diffusion Bridge》的核心功能。我們將開發一個系統,能夠接收一對「編輯前」與「編輯後」的圖片作為一種視覺提示 (visual prompt),從中學習其轉換規則,並將這個規則應用到全新的圖片上。此專案的核心挑戰在於解決那些難以單純用文字描述的、複雜且抽象的圖像轉換任務。

source code?

經調查,雖然論文提供了一個專案頁面,但截至目前,作者並未釋出官方的開源實作程式碼。因此,本專案的重現工作不僅是一項學習挑戰,其最終產出的程式碼也將對社群具有參考價值。

conda remove --all -n ray-python -y
conda create -c conda-forge python=3.10 -n ray-python -y
conda activate ray-python
cd ~/github/ray
# For example, for Python 3.10:
pip install -U https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-3.0.0.dev0-cp310-cp310-manylinux2014_x86_64.whl
# This links all folders except "_private" and "dashboard" without user prompt.
python python/ray/setup-dev.py -y --skip _private dashboard