2018年1月12日
摘要: 单例模式(Singleton Pattern)是一种常用的软件设计模式,该模式的主要目的是确保某一个类只有一个实例存在。当你希望在整个系统中,某个类只能出现一个实例时,单例对象就能派上用场。 在 Python 中,我们可以用多种方法来实现单例模式: 使用模块 使用 __new__ 使用装饰器(dec 阅读全文
posted @ 2018-01-12 17:58 改改哥 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 观察者模式的定义 :定义了对象之间一对多依赖,当一个对象改变状态时,这个对象的所有依赖者都会收到通知并按照自己的方式进行更新。 按照一个气象站的例子来看观察者模式 从气象站取得数据后要在三个布告牌显示这些数据,这三个布告牌显示的内容都不一样,一块实时显示气象数据,一块显示一段时间的统计数据,一块根据 阅读全文
posted @ 2018-01-12 17:13 改改哥 阅读(288) 评论(0) 推荐(0) 编辑
  2018年1月2日
摘要: 1、说明:创建数据库 CREATE DATABASE database-name 2、说明:删除数据库 drop database dbname 3、说明:备份sql server 创建 备份数据的 device USE master EXEC sp_addumpdevice 'disk', 'te 阅读全文
posted @ 2018-01-02 11:40 改改哥 阅读(498) 评论(0) 推荐(0) 编辑
  2017年12月28日
摘要: 执行 sudo apt-get install libmysqlclient-dev, 然后执行 pip3 install mysqlclient 成功。 阅读全文
posted @ 2017-12-28 11:11 改改哥 阅读(6388) 评论(0) 推荐(3) 编辑
  2017年12月27日
摘要: http://blog.csdn.net/c465869935/article/details/53242126 http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html http://uwsgi-docs- 阅读全文
posted @ 2017-12-27 11:56 改改哥 阅读(218) 评论(0) 推荐(0) 编辑
  2017年12月26日
摘要: sudo apt-get install libpcre3 libpcre3-devsudo pip install uwsgi -I --no-cache-dir 阅读全文
posted @ 2017-12-26 18:58 改改哥 阅读(504) 评论(0) 推荐(0) 编辑
  2017年12月22日
摘要: 例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; FLUSH PRIVILEGES; 阅读全文
posted @ 2017-12-22 17:30 改改哥 阅读(261) 评论(0) 推荐(0) 编辑
  2017年12月20日
摘要: #构造节点类 class Node(object): def __init__(self,data=None,_next=None): ''' self.data:为自定义的数据 self.next:下一个节点的地址(这里为下一个数据建立了一个对象) ''' self.data = data ... 阅读全文
posted @ 2017-12-20 11:43 改改哥 阅读(222) 评论(0) 推荐(0) 编辑
  2017年12月18日
摘要: {2: [2], 3: [3, 3, 3], 5: [5, 5], 4: [4], 6: [6], 7: [7], 0: [0], 8: [8]}[0, 2, 3, 3, 3, 4, 5, 5, 6, 7, 8] 阅读全文
posted @ 2017-12-18 11:35 改改哥 阅读(442) 评论(0) 推荐(0) 编辑
  2017年12月15日
摘要: #方法一:递归 def bubble(lst,i): if i==1: return lst for j in range(i-1): if lst[j] > lst[j+1]: lst[j],lst[j+1]=lst[j+1],lst[j] bubble(lst, i-1) lst=[1,33,22,4... 阅读全文
posted @ 2017-12-15 17:38 改改哥 阅读(212) 评论(0) 推荐(0) 编辑