Simulate streaming API with FastAPI

The server code import asyncio import uvicorn from fastapi import FastAPI from fastapi.responses import StreamingResponse app = FastAPI() async def fake_text_streaming(): for i in range(1000): yield b"Fake text #" + str(i).encode() + b"\n" await asyncio.sleep(1) @app.post("/") @app…

Crab Hunting in Abu Dhabi: Places and Time

As the capital of the United Arab Emirates, Abu Dhabi has a unique geographical environment, with a large number of islands and rich seawater resources. These resources provide a large amount of aquatic products, including a huge number of crabs. So, how do we enjoy crabbing in Abu Dhabi? When and where can we …

Java Image base64 to Spring Boot MultipartFile

Java code: package com.awaimai; import cn.hutool.core.lang.Assert; import lombok.extern.slf4j.Slf4j; import org.apache.tika.mime.MimeTypeException; import org.apache.tika.mime.MimeTypes; import org.springframework.mock.web.MockMultipartFile; import org.springframework.web.multipart.MultipartFile; import java.ut…

How to install OS and connect to NanoPi-R2S (rk3328)

208 记录 Leave a Comment
Official wiki page OS image on Google Drive Install OS Go to google drive, navigate to: 01_Official images/01_SD card images. Download any image, e.g., "rk3328-sd-debian-bullseye-core-5.15-arm64-20230529.img.gz". Unzip it to "rk3328-sd-debian-bullseye-core-5.15-arm64-20230529.img". importat…
Next Page »