我为什么坚持C++ 我一直坚持使用C/C++,是有原因的。其一是历史原因。在我刚接触编程的时候,入门语言是C语言。作为一个在当时连打字都很生疏的我,确实被虐的很惨。但经过一年的死磕,也算是上道了,随后也渐渐熟悉了C语言的编程风格。熟悉了写C语言之后,便开始自学C++了。不过当时对面向对象的概念也是稀里糊涂,不清不楚。所以大多时候C++就是当C来使用了。后来,我在做编程练习的时候也基本都用的C++了。 每当有人跟我聊 2019-09-20 杂文 #随笔 #c++
c++ base 近期又过了一遍c++基础,为了加深印象,暂且罗列了一些比较简单的概念,如有错误之处还望批评指正,因为我也不想误导他人。不得不说,c++有很多值得研究和记录的地方,后续应该会一一道来。 概念 介绍 void类型 说明函数无返回值或指针是无类型的。 const修饰符 定义常量 声明和定义 声明:表明变量的类型和名称。定义:是一种声明,当同时为变量分配了存储空间,并且可以对变量进 2019-09-19 技术笔记 #c++
Full Permutation 从n个不同元素中任取m(m≤n)个元素,按照一定的顺序排列起来,叫做从n个不同元素中取出m个元素的一个排列。当m=n时所有的排列情况叫全排列。 --百度百科baike.baidu.com/item/%E5%85%A8%E6%8E%92%E5%88%97/4022220 从定义上看,全排列就是将一个集合中的n个元素按不同顺序进行排列,每个元素所处位置有n种可能。例如存在集合s={1,2,3}, 那么 2019-08-21 算法 #full permutation
database connection pool(basic) As you know, the database connection is a very scarce resource in the web application. It takes a long time for a request to connect and close database, and it also spends some resources. If there are 2019-07-26 技术笔记 #database #connection pool
sychronize data with lock in Django Recently, I met a problem in our project. We do some hidden operations in server to release user’s hands. And one of them is that we want to create an unique record in database per user. So, in the be 2019-07-25 django #django #lock
customize exception handler in Django REST Framework Sometimes we want to customize the response in DRF. For example, we want to add some fields(such as “status”, “error message” etc.) in the data of response. As known, it’s a horrible thing that we mod 2019-07-16 技术笔记 #exception handler #django
install tensorflow-gpu in docker on RHEL7 0. make sure that you have installed cudaCheck environment Verify you have a CUDA-capable GPU, run the command below and you will see the graphic info1lspci | grep -i nvidia Verify you have a supporte 2019-07-15 技术笔记 #docker #tensorflow-gpu #cuda
PAT Basic 1003 1. 解题分析初看题目时本以为看懂了,再看输入输出样例发现一头雾水。回到题干分析判定条件,才明白什么样的输入是符合要求的。然后你会发现这其实就是一个找规律的问题。那么,如何判定“答案正确”呢?分析如下, 表1.1中每一行显示了从已知正确字符串(根据条件1和2)推导出其它正确字符串(根据条件3)的过程。通过观察字符串a、b、c,我们可以发现一个规律len(c)=len(a)*len(b)。到此,问题 2019-07-03 算法 #PAT
update firewall rules on RHEL7 1. problemHow to update firewall rules on RHEL7? 2. solution1> list rules1sudo firewall-cmd --zone=public --list-ports 2> add port rule1sudo firewall-cmd --zone=public --add-port=your-port/t 2019-07-02 技术笔记 #firewall #linux #RHEL7
python import at runtime 1. problem对于python新手来说,可能常会遇到import找不到module的问题。尤其在使用相对引用时,可能会被这样的错误整的摸不着头脑,如ValueError: attempted relative import with no known parent package。 2. introduction在python中,import分为两种:绝对引用和相对引用。相对引用以前导点(” 2019-06-25 技术笔记 #python