自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 资源 (1)
  • 收藏
  • 关注

原创 Ubuntu使用教程:E: 无法获得锁 /var/lib/apt/lists/lock - open (11 资源临时不可用)

今天使用Ubuntu16.04安装软件执行apt-get update时出现如下错误: E: 无法获得锁 /var/lib/apt/lists/lock - open (11: 资源暂时不可用) E: 无法对目录 /var/lib/apt/lists/ 加锁 解决方法一: 执行一下 :sudo dpkg --configure -a 解决方法二: sudo...

2018-07-25 14:36:00 496

原创 CSRF & CORS

CSRF & CORS 下面转的两篇文章分别说明了以下两个概念和一些解决方法: 1. CSRF - Cross-Site Request Forgery - 跨站请求伪造 2. CORS - Cross Origin Resourse-Sharing - 跨站资源共享 (1. CSRF)转自:http://www.h3c.com.cn/About_...

2018-07-19 20:21:00 303

原创 Mixin

Mixin 在FBV中,如果希望为视图的访问加上限制的话可以直接使用装饰器,但在CBV中就不能直接使用装饰器了。 比如说django auth提供的默认的login_required装饰器和permission_required装饰器,在CBV中则为LoginRequiredMixin以及PermissionRequiredMixin。 这两个Mixin都...

2018-07-19 20:21:00 147

原创 django的cbv

FBV FBV(function base views) 就是在视图里使用函数处理请求。 在之前django的学习中,我们一直使用的是这种方式,所以不再赘述。 CBV CBV(class base views) 就是在视图里使用类处理请求。 Python是一个面向对象的编程语言,如果只用函数来开发,有很多面向对象的优点就错失了(继承、封装、多态)。所以Dj...

2018-07-13 11:29:00 69

原创 Django路由说明

1. 路由定义位置 Django的主要路由信息定义在工程同名目录下的urls.py文件中,该文件是Django解析路由的入口。 每个子应用为了保持相对独立,可以在各个子应用中定义属于自己的urls.py来保存该应用的路由。然后用主路由文件包含各应用的子路由数据。 除了上述方式外,也可将工程的全部路由信息都定义在主路由文件中,子应用不再设置urls.py。如...

2018-07-05 11:28:00 70

原创 蓝图(blueprint)

Blueprint 一. 什么是蓝图 当你的项目有很多模块时,放在一起的话,既不方便查看,耦合度又太高。所以Flask提供了蓝图(Blueprint)功能。蓝图使用起来就像应用当中的子应用一样,可以有自己的模板,静态目录,有自己的视图函数和URL规则,蓝图之间互相不影响。但是它们又属于应用中,可以共享应用的配置。对于大型应用来说,我们可以通过添加蓝图来扩展...

2018-07-03 21:41:00 507

原创 Redis作用

Redis数据库 Redis 是一个高性能的key-value数据库。 主要用Redis实现缓存数据的存储,可以设置过期时间.对于一些高频读写、临时存储的数据特别适合. 性能极高 – Redis能读的速度是110000次/s,写的速度是81000次/s 。 NoSQL:一类新出现的数据库(not only sql) 泛指非关系型的数据库 不支持SQL语法 ...

2018-07-03 21:40:00 329

算法导论_ver3.pdf

This section will lead readers to start thinking about the design and analysis of algorithms, briefly introducing the expression of algorithms, some of the design strategies to be used in this book, and many of the basic ideas used in algorithm analysis. The rest of this book is based on this basic knowledge.Chapter 1 is an overview of algorithms and their place in modern computing systems. This chapter gives the definition of algorithm and some examples of algorithm. In addition, this chapter demonstrates that algorithms are a technology, as are fast hardware, graphical user interfaces, object-oriented systems, and networks.In chapter 2, we present the first algorithms in the book, which solve the problem of sorting n Numbers. These algorithms are presented in a form of pseudocode that, although not directly translated into any regular programming language, expresses the structure of the algorithm clearly enough for any competent programmer to implement the algorithm in the language of his choice. The sorting algorithm we analyzed is insertion sort, which takes an incremental approach;It also analyzes merge sort, which USES a recursive technique called divide-and-conquer. Although the running time required by both algorithms increases with the value of n, the rate of increase is different. In chapter 2, we analyze the running time of these two algorithms and give a useful representation to express these running times.Chapter 3 gives an exact definition of this representation, called asymptotic representation. At the beginning of chapter 3, several asymptotic symbols are defined, which are mainly used to represent the upper and lower bounds of algorithm running time. The rest of chapter 3 mainly presents some mathematical representation methods. The purpose of this section is more to ensure that the reader's notation matches the book's notation system than to teach it

2019-04-12

空空如也

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

TA关注的人

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