2 Xcq007

尚未进行身份认证

我要认证

暂无相关简介

等级
TA的排名 26w+

应届生该如何找工作?

没有工作经验怎么办呢?还要求要会各种各样的技术。

2019-07-26 08:24:21

搭建MySQL主从

搭建主从#将主服务器的数据备份到从服务器上**#好处:**1.读写分离,2.数据备份,3.负载均衡#配置主从同步的基本步骤:1.在主服务器上,必须开启二进制日志机制和配置一个独立的ip2.在每一个从服务器上,配置一个唯一的id,创建一个用来专门复制主服务器数据的账号3.在开始复制进程之前,在主服务器上记录二进制文件的位置信息4.如果在开始复制之前,数据库中已有数据,就必须创建一个数据...

2018-11-18 11:13:26

有道翻译——爬取

输入英文从有道翻译网址爬取js数据#coding=utf-8import urllibimport urllib2fanyi_url = 'http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule'head = { 'Accept': 'application/json, text/java...

2018-09-19 10:56:08

用户输入关键字,爬取百度贴吧

爬取百度贴吧#coding=utf-8import urllib2import urllibdef loadPage(url, filename): ''' 作用:根据url发送请求, 获取服务器响应文件 url:需要爬取的url地址 filename:处理文件名 ''' head = {'User-Agent': ...

2018-09-18 16:21:42

binary search in Python

binary searchdef binary_search(list_02, item): n = len(list_02) if n >= 1: mid = n // 2 if list_02[mid] == item: return True elif item < list_02[mid...

2018-08-27 16:59:50

merge sort in Python

merge sortdef merge_sort(list_02): n = len(list_02) if n <= 1: return list_02 mid = n // 2 left_li = merge_sort(list_02[:mid]) right_li = merge_sort(list_02[mid:]) ...

2018-08-27 16:19:55

quick sort in Python

quick sortdef quick_sort(list_02, first, last): if first >= last: return mid_val = list_02[first] low = first high = last while low < high: while low <...

2018-08-27 15:06:12

shell sort in Python

shell sortdef shell_sort(list_02): gap = len(list_02) // 2 while gap > 0: for i in range(gap, len(list_02)): while i > 0: if list_02[i] < list_...

2018-08-26 16:57:07

insert sort in Python

insert sortdef insert_sort(list_02): for j in range(1, len(list_02)): for i in range(j, 0, -1): if list_02[i] < list_02[i - 1]: list_02[i], list_02[i - 1...

2018-08-26 16:55:43

Selection sort in Python

Selection sortdef selection_sort(list_02): for j in range(len(list_02) - 1): min_index = j for i in range(j + 1, len(list_02)): if list_02[min_index] > list_02[i...

2018-08-25 14:11:41

Bubble sort in Pyton

Bubble sortdef bubble_sort(list_02): for j in range(len(list_02) - 1, 0, -1): count = 0 for i in range(0, j): if list_02[i] > list_02[i + 1]: lis...

2018-08-25 13:31:31

Queue in Python

Queueclass Queue(): '''Queue''' def __init__(self): self.__list = [] def enqueue(self, item): '''Add an element to the queue''' self.__list.append(item) d...

2018-08-25 10:58:49

Deque in Python

Dequeclass Queue(): '''Queue''' def __init__(self): self.__list = [] def enqueue(self, item): '''Add an element to the queue''' self.__list.append(item) d...

2018-08-25 10:56:23

Stack in Python

Stackclass Stack(): '''stack''' def __init__(self): self.__list = [] def push(self, item): '''add a new element to the top of the stack''' self.__list.append(i...

2018-08-25 10:33:43

Double Link List

Double Link Listclass Node(object): '''this is a node''' def __init__(self, elem): self.elem = elem self.next = None self.prev = Noneclass DoubleLinkList(object):...

2018-08-25 10:07:53

Single Circular Link List in Python

Single Circular Link Listclass Node(object): '''this is a node''' def __init__(self, elem): self.elem = elem self.next = Noneclass SingleCircularLinkList(object): '''...

2018-08-25 10:06:04

Single Link List in Python

Single Link Listclass Node(object): '''this is a node''' def __init__(self, elem): self.elem = elem self.next = Noneclass SingleLinkList(object): '''this is a Singly ...

2018-08-25 10:02:22

Remove duplicate list in Python

Method onedef distinct(list_1): list_2 = set(list_1) list_3 = list(list_2) print(list_3)def main(): list_1 = [1,1,6,3,1,5,2] distinct(list_1)if __name__ == '__main__': m...

2018-08-22 08:34:42

__getattrinute__ in Python

Method of restricting attribute accessclass GetAttribute(): def __init__(self, name): self.name = name def __getattribute__(self, item): print('sss') return o...

2018-08-21 11:02:48

File copy in Python

File copy# Copy data functiondef copyData(old_file, new_file): while True: fileData = old_file.read(1024) if len(fileData) == 0: break new_file.write(fileD...

2018-08-17 21:43:41

查看更多

勋章 我的勋章
    暂无奖章