自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(33)
  • 收藏
  • 关注

原创 MAC添加SSH到GitHub

GitHub官方文档:https://docs.github.com/cn/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent1. 在MAC本地生成SSH打开终端,输入以下命令生成ssh-keygen -t ed25519 -C "your_email@example.com"其中 your_email@

2021-07-22 11:31:12 446

原创 Python数组分成两堆

1. 问题描述把一个数组分成两堆,列举所有可能性。2. 解决方案class node: def __init__(self, value, ind, nex = None): self.value = value self.ind = ind self.nex = nex def set_next(self,nex): self.nex = nex def get_next(self): r

2021-06-15 12:54:45 792 3

原创 How to research a Python package

1. BackgroundFor programmers, we always need to use other's packages. And we need to understand thembefore using them. This article is to show how to research a Python package.2. SolutionsHere, I list some common sources to find solutions.Google .

2021-05-12 02:47:02 161

原创 git revert doesn‘t solve conflicts

1. ProblemWhen I triedto revert to a certain commit which was several commits behind, I failed and showed conflicts. I was wondering why there were conflicts for the revert. I mean there definitely should be some conflicts because that's why I used git .

2021-05-05 14:52:40 156

转载 贪吃蛇js手动版

1. 问题背景晚上睡不着觉,打算玩一会儿贪吃蛇。上网找了贪吃蛇代码,但是它老是输,于是自己动手升级了版本。2. 代码原版:https://www.educative.io/blog/javascript-snake-game-tutorial修改版:<!DOCTYPE html><html> <head> <title>Snake Game</title> </head> <body&g

2021-04-23 14:40:51 130

转载 SQL ORDER BY空值放到后面

1. 问题背景用ORDER BY排序的时候,NULL值在前面,但是有时候我们最想看到的值不是NULL,那么我们就要把NULL值放到后面。2. 解决方案https://learnsql.com/blog/how-to-order-rows-with-nulls/#:~:text=If%20you%20sort%20a%20column,the%20NULLs%20will%20come%20first.&text=Alternatively%2C%20if%20you%20add%20a,

2021-04-21 02:10:54 1574

翻译 Python字符串格式化

https://mkaz.blog/code/python-string-format-cookbook/

2021-04-20 04:44:44 330

原创 “findfont: Font family [‘Tw Cen MT‘] not found. Falling back to DejaVu Sans.“ solved on mac

1. error infoI was working on Mac and coding on Jupyter. I hit this issue when I played with matplotlib.import matplotlib as mplmpl.rc('font',family='Tw Cen MT', size = 14)I modified the font for matplotlib. But when I plotted using mpl, the error

2021-04-01 06:34:32 183

原创 数据库第一范式(图解)

1. 定义:每一个数据只包含一个数据 每一行数据必须唯一存在表中2. 反面示例:表1 姓名 年龄 早餐 数量 张三 12 鸡蛋 1 张三 12 鸡蛋 1 王五 41 豆浆 1 表1不符合第一范式,因为前两个数据重复。一般来说解决办法就是设置PRIMARY KEY或者UNIQUE属性。表2 姓名 年龄 早餐 数量 张三 12 鸡蛋,包子 1,1 李四 3

2021-03-30 03:45:05 6661 1

转载 常用插值算法

1. 最近邻插值 (Nearest-neighbor interpolation)2. 线性插值 (Linearinterpolation)3. 拉格朗日多项式插值 (Lagrange polynomial interpolation)https://www.cnblogs.com/ECJTUACM-873284962/p/6833391.html4. 牛顿多项式插值 (Newton polynomial interpolation)https://blog.csdn....

2021-03-22 02:42:16 854

原创 VirtualBox ‘Failed to Acquire the VirtualBox COM Object’ 报错解决

Windows 10系统今天启动VirtualBox 出现Failed to Acquire the VirtualBox COM Object报错。解决方案:打开任务管理器,结束所有有关VirtualBox的进程,然后重启即可。

2021-03-21 22:46:15 783

原创 ftp over ipv6

To connect to an FTP server over ipv6, here is an example:$ ftp fe80::a00:27ff:fe60:5885%eth0 2121Connected to fe80::a00:27ff:fe60:5885%eth0ftpis the protocol.fe80::a00:27ff:fe60:5885is the ipv6 address.eth0 after %is the interface. This is b...

2021-03-19 06:08:10 328

原创 Unidentified Netwtork

1. 问题描述今天重启电脑后,突然出现Unidentified Netwtork,连不到网络。电脑通过网线连到路由器,WIFI手机也能用。2. 解决方案ping 192.168.1.1 ping不通以后,重启路由器,问题解决!

2021-03-17 09:34:11 599

原创 How to connect to AWS DynamoDB with Python

1. BackgroundI need to insert 20 billion rows of data into SQL server, but the limit for Express SQL version is only 10 GB. So I tried AWS DynamoDB, which is a NoSQL database.2. PrerequisitesA DynamoDB table on AWS, which can be done on the website.

2021-03-15 13:42:55 221

原创 SQL主键不能为NULL,消除重复数据问题

1. 问题背景今天在创表的时候,打算把几个字段设置为主键,但是实际情况是有些字段为NULL,搜索之后发现主键不能为NULL,于是研究发现要用UNIQUE才能为NULL。于是我顺便讲一下一些关于数据库重复数据的知识点。2. PRIMARY KEY主键主键关键字是PRIMARY KEY,在创表的时候可以设置一个主键,主键不能为NULL,如下:CREATE TABLE Persons ( ID int PRIMARY KEY, LastName varchar(255),

2021-03-13 13:23:50 3267

转载 python matplotlib set tick sizes

plt.xticks(fontsize= ) ax.set_xticklabels(xlabels, fontsize= ) plt.setp(ax.get_xticklabels(), fontsize=) ax.tick_params(axis='x', labelsize= ) https://www.delftstack.com/howto/matplotlib/how-to-set-tick-labels-font-size-in-matplotlib/#pl..

2021-02-23 03:57:30 1112

原创 我的博客风格

我最近开始写博客了,写了一些以后,开始思考我到底该如何写文章。我们大家在平时开发的时候,遇到报错和不理解的知识比比皆是。为了变得更强,我们要坚持不断地学习。但是学习我大致分为两个状态:一是系统地学习,二是只学习一个知识点。我们作为初学者开始学习的时候,比如操作系统,数据库,JAVA各类知识都有一个大的框架。作为初学者学一门科目或者技术,一开始系统的学习一遍是很有必要的,这样子有助于建立我们的知识框架。但是在学习的过程中我们发现无论如何学习,我们都不可能学会所有的知识点。就比如说学习JAVA,了解了基

2021-02-16 11:43:02 220 1

原创 Anaconda使用bloomberg API的No module named ‘blpapi‘报错解决

1. 问题背景用python在使用bloomberg API的时候,出现了如下报错>>> import pdblpTraceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\scum\anaconda3\lib\site-packages\pdblp\__init__.py", line 1, in <module>

2021-01-31 05:45:00 2246

原创 Understand the official definition of NP problems

1. BackgroundTo continue the P problems, this article talks about the NP problems. It'll focus on the meaning ofmathematical symbols.The official definition is: The class NP of languages by the condition that a language L over is in NP iff there is k.

2021-01-21 08:39:13 94

原创 SQL Server创表权限

1. 背景最近老板让我给SQL数据库中插入数据,但是我创表语句一直无法通过,由此引发了我对SQL Server授权机制的研究。在我查阅了官方文档和很多资料后,再次做一个总结。其中涉及到模式(schema)和角色(role)的概念。首先,老板拥有管理员权限,我使用一个账号登录。2. 解决方案在管理员权限下,给用户授权创表,如下,没有报错1> GRANT CREATE TABLE TO [test_login]2> go1>普通用户尝试创表报错,如下1>

2021-01-18 11:43:28 2119

原创 Understand the official definition of P problems

1. BackgroundTo understand The P versus NP problem, we need to understand P problems first. This article is to help understand the official definition of Pproblems from the Clay Mathematics Institute:https://www.claymath.org/sites/default/files/pvsnp.p..

2021-01-15 11:12:05 123

原创 “Could not allocate space for object ... because the ‘PRIMARY‘ filegroup is full“ 报错解决

1. 问题描述最近我在大量给SQL Server大量插入数据的时候发生了如下报错。Msg 1105, Level 17, State 2, Server DESKTOP-VBKHGJS\SQLEXPRESS, Line 7Could not allocate space for object 'dbo.test5' in database 'TestData' because the 'PRIMARY' filegroup is full. Create disk space by deleti

2021-01-07 08:55:26 4685

转载 Move files below certain size in Linux

1. ProblemIn Linux, sometimes, we need to process files. But the performance depends on the storage size of files. So we need to separate files based on size.2. Solutionmkdir tempfind . -maxdepth 1 -type f -size -4c -exec mv {} temp/ \;3. Explana

2021-01-03 08:32:56 135

转载 生产数据库、开发数据库、测试数据库中的数据的区分

在我们理解了数据库的概念以后,我们在实际应用的过程中还会听到到生产数据库这样子的名词,那门多了生产两个字到底是什么意思呢?其实这些都是依据数据库的作用不同人们起的不同的名字罢了。底层的原理是一样的。可以这样简单理解:生产数据库:业务实际使用的数据库。简称生产库查询库:也有查询库这样子的叫法,这是给程序调用或者人工查询数据使用的,和生产库在内容上不会有差异。唯一不同就是访问的DG镜像库。生产库是主库。这样做是可以分散单数据库的访问压力,提高效率,同时本身也是很好的防灾手段。开发数据库:供系

2021-01-03 04:07:02 4204

转载 How to fix Git always asking for user credentials

Solution:https://www.freecodecamp.org/news/how-to-fix-git-always-asking-for-user-credentials/

2021-01-02 01:21:27 98

转载 “Unable to correct problems, you have held broken packages” 报错解决

1. 问题描述最近我在Ubuntu上安装包的时候遇到如下报错The following packages have unmet dependencies: mssql-tools : Depends: msodbcsql17 (>= 17.3.0.0) but it is not going to be installed unixodbc-dev : Depends: unixodbc (= 2.3.7) Depends: odbcinst1debian

2020-12-31 11:33:22 6392

转载 How to find your database IP address and SQL port

First, make sure that you are on the server computer. You can check by searching for "SQL server management studio" in windows. If it shows up then you're on the server.How to find internal IP address (local network connection).1.Hold the window...

2020-12-28 14:23:40 239

原创 连接SQL Server的三种方式

1. 问题背景最近老板在AWS上创建了一个Microsoft SQL Server,给我分配一个用户名和密码让我处理数据。然而我以前一直用的是MYSQL,对新数据库突然有些手足无措。在研究了一段时间后,我总结了三种连接到SQL Server的方式,分别是:Python利用sqlalchemy包来连接 SSMS (MicrosoftSQL Server Management Studio) sqlcmd一般SQL Server指的就是Microsoft SQL Server。2. 连接SQ.

2020-12-27 15:18:22 7624 1

原创 linux文件大小查看

一. 问题背景当我们在管理Linux文件系统的时候,我们需要查看每个文件的大小。本文介绍如何使用 du去查看文件大小,如何使用sort 排序,以及如何使用 more控制输出二. dudu -sh用于显示当前目录文件大小。-h的意思是要给输出加单位,也就是human-readable。-s的意思是只显示当前目录,不显示子文件夹。$ du -sh876M .输出的意思是当前目录下文件总大小。如果我们想看特定文件的大小,我们需要 du -sh file1 file2 .....

2020-12-17 08:07:34 773

原创 linux命令行特殊符号语法入门介绍

一. 问题背景在linux中,所有的操作都可以用终端命令来操作。我们遇到不懂的命令的时候,我们就会去搜索引擎去搜索相关的语法。但是我们经常会看到一些特殊符号,比如 -*[]|,这些符号常常叫人摸不着头脑。有些符号有些很深刻的含义,而有些却不太重要。在这篇文章里,我总结了这些符号在命令行里的一起常用含义和用法。本文读者需了解一些基本命令如:ls, cd二. 基本符号介绍1. 无符号任何一个命令都是由一个不带空格的单词构成的,一个命令的最简单用法就是直接输入这个命令并执行。比如ls$

2020-12-17 06:27:54 1558

原创 Keep processes running in the background and even after SSH session disconnects

I started running a computation-intensivepython script on aSSH session. But the session kept disconnecting and I lost all my results all the time. The solution was to run the script in the background without interrupting.Linux nohup Command worksperfe...

2020-12-13 18:43:07 371

转载 git clone is not working for a private repo

I tried to git clone some private. Then the following errorpopped up:remote: Repository not found.fatal: repository 'https://github.com/tottoramen/data_mining_project.git/' not foundIt turned out that I had an old session state:Open Control Panel f.

2020-12-10 02:05:25 133

转载 INSERT IGNORE to avoid Violation of PRIMARY KEY

Until pandas include the option of INSERT IGNORE in the default pd.DataFrame.to_sql class, here is the best solution:from sqlalchemy.ext.compiler import compilesfrom sqlalchemy.sql.expression import Insert# adds the word IGNORE after INSERT in sqlalc

2020-11-27 02:09:52 657

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除