JERRYLSU

Concurrent http requests using asyncio and aiohttp
by Jerry Su, post on Jul 13, 2023

import aiohttp
import asyncio
from typing import Dict
async def async_post_request(url: str, data: Dict) -> Dict:
    """async post.
    """
    async with aiohttp.ClientSession() as session:
        async with session.post(url, json=data) as resp:
            response = await resp.json()
    return response
model_url_dict={
    "scene1": "http://0.0.0.0:8781/classify/utcx",
    "scene2 …

Read in 1 mins
Python docx using lxml
by Jerry Su, post on Sep 25, 2022

Reason is the light and the light of life.

Read in 9 mins
Multiprocessing in FastAPI
by Jerry Su, post on Jul 28, 2022

Reason is the light and the light of life.

Read in 1 mins
asyncio get_event_loop vs get_running_loop
by Jerry Su, post on Jul 28, 2022

Reason is the light and the light of life.

Read in 1 mins
FastAPI for CPU-Bound Task
by Jerry Su, post on Jul 19, 2022

Reason is the light and the light of life.

Read in 1 mins
Base64-encode-decode
by Jerry Su, post on May 09, 2022

Reason is the light and the light of life.

Read in 1 mins
Joblib parallel
by Jerry Su, post on Mar 23, 2022

Reason is the light and the light of life.

Read in 2 mins
Pandas-regex
by Jerry Su, post on Nov 02, 2021

Reason is the light and the light of life.

Read in 1 mins
Pandas-list-mapping
by Jerry Su, post on Nov 01, 2021

Reason is the light and the light of life.

Read in 1 mins
Docker Python Mysql
by Jerry Su, post on Sep 16, 2021

docker pull mysql:5.7

docker run -itd -p 8070:3306 -v /hadoop-data/work/sl/project/mysql/data:/var/lib/mysql -v /hadoop-data/work/sl/project/mysql/conf.d:/etc/mysql/conf.d --name=qa_mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7

mysql -h host_ip -P port -u root -p123456

show …

Read in 1 mins