Skip to content

Instantly share code, notes, and snippets.

# ===============================
# ✅ 安装依赖
# ===============================
!pip install fastapi uvicorn pyngrok python-multipart nest_asyncio
# ===============================
# ✅ 加载库
# ===============================
import nest_asyncio
nest_asyncio.apply()
@watermelo2
watermelo2 / pom.xml
Created November 7, 2024 09:42
POM配置仓库
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<modules>
</modules>
@watermelo2
watermelo2 / settings-ybb.xml
Last active November 11, 2024 03:19
Maven配置
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
#lang sicp
(define (make-account balance)
(define (withdraw amount)
(if (>= balance amount)
(begin (set! balance (- balance amount))
balance)
"Insufficient funds"))
(define (deposit amount)
(set! balance (+ balance amount))
(define (make-withdraw balance)
(lambda(amount)
(if (>= balance amount)
(begin (set! balance (- balance amount))
balance)
"Insufficient funds")))
(define W1 (make-withdraw 100))
(W1 50)
@Override
public ListenableFuture<List<AttributeKvEntry>> find(TenantId tenantId, EntityId entityId, String scope, Collection<String> attributeKeys) {
validate(entityId, scope);
attributeKeys.forEach(attributeKey -> Validator.validateString(attributeKey, "Incorrect attribute key " + attributeKey));
Map<String, TbCacheValueWrapper<AttributeKvEntry>> wrappedCachedAttributes = findCachedAttributes(entityId, scope, attributeKeys);
List<AttributeKvEntry> cachedAttributes = wrappedCachedAttributes.values().stream()
.map(TbCacheValueWrapper::get)
.filter(Objects::nonNull)
SELECT
info.*,
IF(
crc.certificate_status = 1
OR (
crc.valid_date_long_flag = 0
AND crc.valid_date_end
< now()
) ,
0,
@watermelo2
watermelo2 / Test.java
Created November 18, 2022 05:40
看看输出10还是20
public class Test {
public static void main(String[] args) {
class Parent {
Parent() {
print();
}
void print() {
@watermelo2
watermelo2 / dfs.html
Last active November 17, 2022 10:30
凑数算法
<!DOCTYPE html>
<!-- saved from url=(0039)https://maggch97.github.io/dfs/dfs.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<script>
@watermelo2
watermelo2 / LocalDiskCacheSessionDAO.java
Created September 27, 2022 02:12
缺陷: Session和JSON String相互转换问题 NIO只能存一个Session问题(需要控制offset才能同时存多个)
package com.aek.system.config.shiro;
import cn.hutool.json.JSONUtil;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;