【Python】Python编程:从入门到实践读书会(15)
第十五章 生成数据做课后练习的时候发现使用matplotlib的时候,中文字符串会出现乱码,所以我在网上找了方法来保证中文正常显示。import matplotlib.pyplot as plt
#指定默认字体
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['font.family']='sans-serif'
#解决负号'-'...
【Python】Python编程:从入门到实践读书会(16)
第十六章 下载数据16.1 CSV文件格式16.1.1 分析CSV文件头打开文件,获得文件对象调用csv.reader(文件对象),读取文件,得到与文件相关联的阅读器next(阅读器):返回文件的下一行16.1.2 打印文件头及其位置enumerate():获取每个元素的索引及其值16.1.3 提取并读取数据for循环使用阅读器读下一行再用int()将字符串转换成int类型16.1.5 模块dat...
【Python】Python编程:从入门到实践读书会(17)
第十七章 使用API17.1.2 使用API调用请求数据输入网址:https://api.github.com/search/repositories?q=language:python&sort=stars返回GitHub当前托管了多少个python项目,还有有关最受欢迎的python仓库的信息https://api.github.com/:将请求发送到GitHub网站中响应API调用的...
zabbix 无法启动server服务器
zabbix运行过程中突然提示server未启动,重启服务无法启动,检查selinux未开,排除此问题检查日志有如下提示。tailf /var/log/zabbix/zabbix_server.log
1230:20180706:165735.809 [file:dbconfig.c,line:90] zbx_mem_malloc
1020 Tree Traversals (25)
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the cor...
1021 Deepest Root (25)
A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root ...
1022 Digital Library (30)
A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number a...
1026 Table Tennis (30)
A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open when they arrive, they will be assigned to the ava...
1027 Colors in Mars (20)
People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 dig...
1029 Median(25 分)
Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 12, and the median of S2 = { 9, 10, 15, 16, 17 } is...
os.path.join()
python中使用os.path.join() 在使用的过程中,我使用代码: import os
path = 'F:/gts/gtsdate/'
b = os.path.join(path,'/abc') 输出的结果是: 'F:/abc' 并不是 'F:/gts/gtsdate/abc' 原因是在os.path.join()第二个参数'/abc'起始字符是'/'。
python timeit模块
在python,我们有时候需要考虑到自己设计的算法的复杂度,首先在python中提供了一个内置的模块,可以用来检验我们算法的复杂度,接下来来看下这个模块timeit的使用,首先我们导入模块from timeit import Timer,接下来我们需要将我们的苏需要的计算的模块进行封装成函数,再用固定格式 timer=Timer("def","from __main__ import def") 其中def使我们封装好的函数,具体代码如下 from timeit import Timer
de
poj 2176 folding
Description: 就是把一个字符串压尽可能的压缩 1 #include<iostream>
2 #include<cstring>
3 #include<cstdio>
4 using namespace std;
5 const int N = 110, INF = 1e9;
6 struct node{
7 char s[N]; //dp[i][j]的len表示区间i-j压缩后的最小长度 s表示压缩后的字串
8 int len;
10 传输模型与套接字(进阶)
01-传输模型 第一部分 传输模型 1、基本模型 2、层次划分 MAC地址:唯一的地址 TCP可靠、UDP不可靠 3、传输层说明 说明一: 作为Python开发,咱们都是在应用层的HTTP协议之上进行开发的。 说明二: 网络编程,主要是了解我们Python能编写的最低的层次,即传输层的基本情况 说明三: HTTP协议是基于TCP之上的,因此我们需要了解TCP连接的基本过程 第二部分 TCP连接 1、建立连接(三次握手) 为什么三次 因为第一次只是客户端告诉服务端 第二次,客户端才知道服务端收到
MongoDB动态条件之分页查询
一、使用QueryByExampleExecutor 1. 继承MongoRepository public interface StudentRepository extends MongoRepository<Student, String> { } 2. 代码实现 使用ExampleMatcher匹配器-----只支持字符串的模糊查询,其他类型是完全匹配 Example封装实体类和匹配器 使用QueryByExampleExecutor接口中的findAll方法 public P
今日推荐
周排行