自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 python获取上一级与上上一级目录的写法

import osprint('***获取当前目录***')print(os.getcwd())print(os.path.abspath(os.path.dirname(__file__)))print('***获取上级目录***')print(os.path.abspath(os.path.dirname(os.path.dirname(...

2018-08-30 09:50:00 14629

转载 python总结:部分知识点

1.字典排序按照value值大小排序>>> d = {'75': '8', '12': '9', '14': '3', '88': '14', '60': '14', '61': '13', '62': '8', '63': '9', '64': '10', '65': '9', '7': '13', '9': '11', '8': '11'}>>>...

2018-08-29 16:34:00 73

原创 llinux命令行如何实现传递参数

实现在命令行里执行python3 my_times.py 80 这个命令,可以使其把函数结果返回80是80分钟,应得到 1小时 20分钟:代码如下:#!/usr/bin/python3import sysmin = int(sys.argv[1])def my_time(min): if min > 60:...

2018-08-23 19:26:00 2094

转载 秒杀活动问题处理

秒杀活动通常是这样定义:活动方在有限的时间段内(通常是M分钟到H小时不等的时间)给出指定数量O个P商品的大减价抢购名额。这类秒杀活动一般都会出现如下情况↓↓第一、在某一时间内QPS超过系统负载;第二、架构不合理导致系统的其它与秒杀活动不相关的模块变得异常缓慢;第三、少数用户重复抢到名额;第四、最终抢到的名额数量超过库存数量;第五、服务器宕机后恢复迟缓导致大量用户流入竞争对手...

2018-08-06 20:19:00 412

原创 ubuntu 16.04系统完美解决pip不能升级的问题

问题:使用提示命令pip install –upgrade pip也无法解决升级** 解决方法:源码安装pip-9.0.1**1 从pip官网下载压缩包pip-9.0.1.tar.gz这里写图片描述2 解压安装这里写图片描述这里写图片描述3 查看pip版本,发现使用的是9.0.1版本这里写图片描...

2018-08-03 00:40:00 1554

原创 session会话保持原理

1. 什么是会话保持?会话保持是负载均衡最常见的问题之一,也是一个相对比较复杂的问题。会话保持有时候又叫做粘滞会话(Sticky Sessions)。会话保持是指在负载均衡器上的一种机制,可以识别客户端与服务器之间交互过程的关连性,在作负载均衡的同时还保证一系列相关连的访问请求会保持分配到一台服务器上。2. 什么时候需要会话保持?在讨论这个问题前,我...

2018-08-02 10:30:00 373

算法导论_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关注的人

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