MySQL命令行工具_mycli中文乱码解决

mycli

BlackLivesMatter

We value the diversity of our community. We strive to amplify the voices of the oppressed to eradicate racism and xenophobia. We ask our community to stand together in support of the Black community.

MyCLI is a command line interface for MySQL, MariaDB, and Percona with auto-completion and syntax highlighting.

  • Source: https://github.com/dbcli/mycli
  • Bug tracker: https://github.com/dbcli/mycli/issues
ppExzFJ.png

(注意, 可以直接输入密码)

mycli, 一款支持自动补全代码的命令工具, 支持ssh, 以及更多细节的优化, 如大量结果不会一次全部返回, 危险操作提示等.

阅读全文 »

MySQL_联合索引-分页检索

本文是作为MySQL使用指南一文的进一步细节延申和补充.

  • 分页查询
  • 联合索引
  • 回表

(由于Typora的字数超过2万速度会明显下降, 4万字已经出现卡顿, 这里将更多内容拆出来讨论).

# 创建测试的表
drop table if exists test_w;
create table test_w (
	id int UNSIGNED not null PRIMARY key auto_increment,
	grade float UNSIGNED not null,
	birth_date date not null,
	s_name varCHAR(15) not null,
	address varchar(16) not null
);
阅读全文 »

Pandas翻译系列-Indexing and selecting data

简化, 并不是逐句翻译, 只关注重点部分, 部分内容加入了自己的理解.

索引和数据选取.

The axis labeling information in pandas objects serves many purposes:

轴标签信息在pandas对象中有多个用途:

  • Identifies data (i.e. provides metadata) using known indicators, important for analysis, visualization, and interactive console display.
  • 数据的识别交互, 这非常重要在数据分析和可视化中.
  • Enables automatic and explicit data alignment.
  • 能够让数据可以显式自动对齐.
  • Allows intuitive getting and setting of subsets of the data set.
  • 能够直观明了的设置或者获取数据集中的子集.

In this section, we will focus on the final point: namely, how to slice, dice, and generally get and set subsets of pandas objects. The primary focus will be on Series and DataFrame as they have received more development attention in this area.

在这部分中, 将着重讨论最后一点, 如何对pandas的对象进行切片获取其中的部分数据(即读写操作). 这是pandas的开发优先关注的.

阅读全文 »

Pandas翻译系列-SettingWithCopyWarning - 视图 OR 副本

一. 问题的起源

在使用pandas进行处理数据时, 时不时会出现一个异常的警告(注意这不是错误)

C:\Users\Lian\AppData\Local\Temp/ipykernel_15272/2330773252.py:4: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy tmp['c'] = tmp['a'] + tmp['b']

阅读全文 »

Toml文件使用指南

一. 前言

TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics. TOML is designed to map unambiguously to a hash table. TOML should be easy to parse into data structures in a wide variety of languages.

toml-lang/toml

在了解这个文件格式前, 需要了解以下配置文件的常见格式.

  • json, json格式可以说是互联网中最重要的数据交换载体, 简洁明了, 轻量, 但是唯一遗憾的是不支持注释.
  • ini, 作为一种非常简单易用的格式, 但是不支持复杂的配置, 不支持数字(仅限于字符串), 支持注释, windows上相对流行.
  • xml, 一个逐步退出历史舞台的文件格式, 过于臃肿.
  • yaml, 支持复杂的配置(号称json的扩展版), 但是可阅读性较差?书写规条较多?.

简而言之, 作为一个好用的配置文件, 既需要数据易于存储/读取(同时需要有效数据密度高), 同时也需要有较好的阅读体验. 以json为例, 假如不进行格式化, 将难以阅读其内容.

Toml就号称满足上述要求:

TOML 旨在成为一个语义明显且易于阅读的最小化配置文件格式.TOML 被设计成可以无歧义地映射为哈希表.TOML 应该能很容易地被解析成各种语言中的数据结构.

目前主流的语言多已支持这种文件格式, 详情见v1.0.0 compliant

阅读全文 »

Git(简单)使用指南

一. 前言

picv

Git, 分布式版本管理系统(Distributed Version Control System)的一种.

突然有新的想法, 准备使用新的思路来写代码, 但是担心写不去, 需要在写之前预留一个副本. 避免写不下去时可以返回初始的状态.

多个需求或者多个方案, 代码存在多个分支, 方便维护.

多人同时对一项目作业, 不同部分的协作.

简而言之, 可以归结为以下三大功能:

  • 版本控制
  • 协同工作
  • 代码管理.
阅读全文 »