Skip to content

Instantly share code, notes, and snippets.

View hyoban's full-sized avatar
🏠
Working from home

Stephen Zhou hyoban

🏠
Working from home
View GitHub Profile

使用虚拟环境来进行 python 开发

macOS 中默认安装了 python, 但是是 2.x 的版本, 通常我们需要手动安装 python3. 安装之后, 我们需要使用 python3 和 pip3 对应的命令. 而且把包全安装到系统环境下,好像也不是很优雅. 所以我们使用虚拟环境.

ubuntu 安装最新的 python

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.10

sudo apt install python3.10-venv

windows 开发环境配置

本机

关于代理

需要注意的是,通常我们只需要设置 idea 的代理即可。如果需要终端中运行,也只需要代理终端。

$Env:http_proxy="http://127.0.0.1:7890";$Env:https_proxy="http://127.0.0.1:7890"
@hyoban
hyoban / mnist.ipynb
Last active March 1, 2022 06:30
机器学习作业三-mnist手写数字识别.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
. $env:USERPROFILE\.config\powershell\user_profile.ps1
export JAVA_HOME=~/app/java-se-8u41-ri
@hyoban
hyoban / class.py
Created November 28, 2021 04:39
课程开设统计
import imgkit
import pandas as pd
import requests
from bs4 import BeautifulSoup
def get_request_by_get(link):
r = requests.get(link)
r.encoding = 'GBK'
return r.text
@hyoban
hyoban / csv.py
Last active March 1, 2022 06:31
数据科学大作业
import pandas as pd
files = [
'2601L20011-20191030230000-20191030235959.csv',
'2601L20011-20191031230000-20191031235959.csv',
'2601L20022-20191030230000-20191030235959.csv'
]
floder_name = '/Users/hyoban/Downloads/期末考察任务_1/数据科学大作业仿真数据/2组仿真数据/'

Jetpack Compose 动画基础

Transition

动画的过渡效果, 主要有 fade, slide, scale, expand(shrink).

EnterTransition Example

AnimationSpec

import androidx.compose.animation.Crossfade
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Button
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember