- 博客(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
2019-04-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人