【Python】Python编程:从入门到实践读书会(15)

第十五章 生成数据做课后练习的时候发现使用matplotlib的时候,中文字符串会出现乱码,所以我在网上找了方法来保证中文正常显示。import matplotlib.pyplot as plt #指定默认字体 plt.rcParams['font.sans-serif'] = ['SimHei'] plt.rcParams['font.family']='sans-serif' #解决负号'-'...
分类: 其他 发布时间: 07-06 23:49 阅读次数: 0

【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...
分类: 其他 发布时间: 07-06 23:49 阅读次数: 0

【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调用的...
分类: 其他 发布时间: 07-06 23:48 阅读次数: 0

zabbix 无法启动server服务器

zabbix运行过程中突然提示server未启动,重启服务无法启动,检查selinux未开,排除此问题检查日志有如下提示。tailf /var/log/zabbix/zabbix_server.log    1230:20180706:165735.809 [file:dbconfig.c,line:90] zbx_mem_malloc
分类: 企业开发 发布时间: 07-06 23:48 阅读次数: 0

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...
分类: 其他 发布时间: 07-06 23:48 阅读次数: 0

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 ...
分类: 其他 发布时间: 07-06 23:47 阅读次数: 0

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...
分类: 其他 发布时间: 07-06 23:47 阅读次数: 0

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...
分类: 其他 发布时间: 07-06 23:46 阅读次数: 0

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...
分类: 其他 发布时间: 07-06 23:46 阅读次数: 0

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...
分类: 其他 发布时间: 07-06 23:45 阅读次数: 0

PHP基础(一)

PHP语言基础 PHP文件格式 PHP文件格式非常简单,本质上而言就是一个文本文件。其保存成后缀为“.php”的文件。 一个完整的PHP文件由以下元素构成: (1)HTML标记;(2)PHP标记;(3)PHP代码;(4)注释;(5)空格 PHP标记 由于PHP嵌入在HTML中,因此要标记对来区分。可以用下四种区分方式标记PHP代码 (1) //例如,以下为一个简单PHP程序代码。 &...
分类: 其他 发布时间: 07-06 23:45 阅读次数: 0

PHP基础(二)

五、PHP流程控制语句 理论证明,无论多么复杂的逻辑结构,最终都可以简化为三种逻辑的组合。这三种逻辑就是顺序逻辑、选择逻辑和循环逻辑。所以在面向过程的结构化程序设计语言中,都有专门的程序语法来构成这三种结构。 顺序结构程序设计 顺序结构是最简单的程序结构,就是按照程序书写的顺序逐条语句的执行。 选择结构 选择程序结构用于判断给定的条件,根据判断的结果来控制程序的流程。使用选择结构语句时,...
分类: 其他 发布时间: 07-06 23:44 阅读次数: 0

PHP基础(三)

八、PHP日期和时间函数 获取日期和时间 在PHP中,要获取当前的日期和时间非常简单,只需使用date()函数即可。date()函数的语法格式如下:String date(string $format [,int $timestamp]) 返回按照指定格式显示的时间字符串。其中参数format为显示格式,而参数timestamp为时间戳。如果没有给出时间戳则使用本地当前时间。timesta...
分类: 其他 发布时间: 07-06 23:44 阅读次数: 0

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'起始字符是'/'。
分类: 其他 发布时间: 07-06 23:44 阅读次数: 0

python timeit模块

在python,我们有时候需要考虑到自己设计的算法的复杂度,首先在python中提供了一个内置的模块,可以用来检验我们算法的复杂度,接下来来看下这个模块timeit的使用,首先我们导入模块from timeit import Timer,接下来我们需要将我们的苏需要的计算的模块进行封装成函数,再用固定格式 timer=Timer("def","from __main__ import def") 其中def使我们封装好的函数,具体代码如下 from timeit import Timer de
分类: 其他 发布时间: 07-06 23:44 阅读次数: 0

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;
分类: 其他 发布时间: 07-06 23:44 阅读次数: 0

ajax介绍

Ajax偷偷向后台发请求: 1. 下载引入jQuery 2. $.ajax({ url: '/add_classes.html', type: 'POST', data: {'username':'root','password': '123'}, success:function(arg){ // 回调函数,arg是服务端返回的数据 } }) 1. Python序列化 字符串 = json.dumps(对象) 对象->字符串 对象 = json.loads(字符串) 字符串->对象 Java
分类: 其他 发布时间: 07-06 23:44 阅读次数: 0

刷题计划(暑假)

暂定每天更新。 7.7 1. P1378 油滴扩展 2. P1306 斐波那契公约数 3. Bugs Integrated, Inc.(加深理解三进制dp) 4. UVa12206 Stammering Aliens(复习字符串hash) 5. P2921 [USACO08DEC]在农场万圣节Trick or Treat on the Farm
分类: 其他 发布时间: 07-06 23:44 阅读次数: 0

10 传输模型与套接字(进阶)

01-传输模型 第一部分 传输模型 1、基本模型 2、层次划分 MAC地址:唯一的地址 TCP可靠、UDP不可靠 3、传输层说明 说明一: 作为Python开发,咱们都是在应用层的HTTP协议之上进行开发的。 说明二: 网络编程,主要是了解我们Python能编写的最低的层次,即传输层的基本情况 说明三: HTTP协议是基于TCP之上的,因此我们需要了解TCP连接的基本过程 第二部分 TCP连接 1、建立连接(三次握手) 为什么三次 因为第一次只是客户端告诉服务端 第二次,客户端才知道服务端收到
分类: 其他 发布时间: 07-06 23:44 阅读次数: 0

MongoDB动态条件之分页查询

一、使用QueryByExampleExecutor 1. 继承MongoRepository public interface StudentRepository extends MongoRepository<Student, String> { } 2. 代码实现 使用ExampleMatcher匹配器-----只支持字符串的模糊查询,其他类型是完全匹配 Example封装实体类和匹配器 使用QueryByExampleExecutor接口中的findAll方法 public P
分类: 其他 发布时间: 07-06 23:44 阅读次数: 0