J Leaves's Blog

Thinking will not overcome fear but action will.

Apple Pay 交通卡一览

Apple Pay Transit Cards in China

城市 名称 最低 iOS 版本 上线日期 开卡最低金额 充值最低金额 北京 北京一卡通*^ 11.3 2018-03-30 5 1   京津冀互联互通卡^ ...

为 Git 添加代理

Proxy for Git

在某些网络环境下,如果直接使用 Git 连接到 GitHub,会发现速度非常慢。如何为 Git 设置代理呢? Git 目前支持的三种协议 git://、ssh:// 和 http://,其代理配置各不相同:core.gitproxy 用于 git:// 协议,http.proxy 用于 http:// 协议,ssh:// 协议的代理需要配置 ssh 的 ProxyCommand 参数。 ...

Conda 配置文件 .condarc 解析

Conda Config File .condarc

.condarc 路径 位于 ~/.condarc 比如,Windows 系统下位于 C:\Users\<UserName>\.condarc .condarc 格式 采用 YAML 格式 .condarc 配置 关于源的设置 .condarc 的源由以下参数决定 1. channels 参数:决定采用哪些 channel,默认值 1 2 channels: ...

Python 中的路径

Paths in Python

如何在 Python 中像 HTML 和 C 那样使用简单的 ../../path/to/file 来表示相对位置呢? Pathlib 内置库 使用 Python 3.4 起自带的 Pathlib 库,可以跨平台 (Unix/Windows)表示相对位置。 假设我们的文件树如下: 1 2 3 4 5 6 . ├── assets │   └── moto.txt └── path ...

Python 疑难杂症合集

A Collection of Python Troubleshooting

在安装一些 Python 工具包时,可能遇到各种问题。 问题1:Command not found 例如缺少 zip / unzip 的可执行程序 ‘unzip’ 不是内部或外部命令,也不是可运行的程序 或批处理文件。 则需要按下载 zip.exe / unzip.exe,并将放入目录添加到环境变量 PATH 中。 资源链接: unzip.exe MD5...

Linux 常见命令

A Collection of Linux Commands

文件与文件夹 遍历当前文件夹 (其中 -l 显示权限信息,-a 显示隐藏文件) 1 ls -l -a 新建文件夹 1 mkdir <foldername> 更改权限 1 chmod 777 /path/to/file 复制 1 cp /path/of/source /path/of/destination 移动(重命名) 1 mv /path/of/...

在 WSL 中使用 Jupyter Notebook

Using Jupyter Notebook in Windows Subsystem for Linux

创建 WSL (参见 少数派文章 前半部分) 1. 打开 WSL 功能,从微软商店下载 Ubuntu,设置好用户名和密码。 2. 更换软件源 在当前命令行下面输入: 1 sudo -i 提权后输入密码,使用 root 权限登录。然后接下来备份当前源,输入以下命令: 1 cp /etc/apt/sources.list /etc/apt/sources.list.old 不...

Jupyter Notebook 中使用 conda 虚拟环境

Using Conda Virtual Enviroments in Jupyter Notebook

创建 Conda 有一个基环境 base,是安装 Anaconda 时自带的。而一些项目需要用到特定的开发环境,一般为了不破坏基环境,会创建一个虚拟环境。 创建虚拟环境(环境名为 myenv) 1 conda create -n myenv 若需要指定安装特定的包 1 conda create -n myenv numpy scipy tensorflow 若需要指定 Pyt...

Python 输出的高级格式化

Advanced Output Formatting in Python

Python 中的动态输出 动态输出,即随着程序的运行不断更新输出的内容,常见的应用场景为提示正在加载、显示任务进度等。那么如何在 Python 中动态输出呢? 1. 简单的 Loading 条 只需要在 print 中加上 end 参数,即可以假乱真 1 2 3 4 5 import time print("Loading", end="") for i in range(6):...

Numpy 笔记:用法集锦

Numpy Note: A Collection of How-Tos

(按字母排序) np.linspace np.newaxis np.tile & np.repeat