• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
孙龙 程序员
少时总觉为人易,华年方知立业难
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 75 下一页
2018年8月14日
多线程
摘要: 开启join后,程序就会hang住(阻塞),不会继续往下执行 上述代码创建了10个“前台”线程,然后控制器就交给了CPU,CPU根据指定算法进行调度,分片执行指令。 更多方法: start 线程准备就绪,等待CPU调度 setName 为线程设置名称 getName 获取线程名称 setDaemon 阅读全文
posted @ 2018-08-14 22:36 孙龙-程序员 阅读(123) 评论(0) 推荐(0)
2018年8月11日
生成器
摘要: #生成器函数,函数里只要有yield关键字 def gen_func(): yield 1 yield 2 yield 3 def fib(index): if index <= 2: return 1 else: return fib(index-1) + fib(index-2) def fib2(index): ... 阅读全文
posted @ 2018-08-11 23:51 孙龙-程序员 阅读(60) 评论(0) 推荐(0)
python Iterable和Iterator
摘要: 判断是不是可以迭代,用Iterable 判断是不是迭代器,用Iterator 所以, 凡是可以for循环的,都是Iterable 凡是可以next()的,都是Iterator 集合数据类型如list,truple,dict,str,都是Itrable不是Iterator,但可以通过iter()函数获 阅读全文
posted @ 2018-08-11 21:45 孙龙-程序员 阅读(145) 评论(0) 推荐(0)
2018年8月8日
元类应用ORM实现
摘要: 首先看下一个简单的例子 上述为属性描述符 元类的应用 执行后结果: bobby28<class '__main__.User.Meta'> 进一步改进代码: 执行结果: bobby28{'db_table': 'user'}{'age': <__main__.IntField object at 0 阅读全文
posted @ 2018-08-08 23:11 孙龙-程序员 阅读(169) 评论(0) 推荐(0)
元类应用ORM实现
摘要: 首先看下一个简单的例子 上述为属性描述符 执行后结果: bobby28<class '__main__.User.Meta'> 进一步改进代码: 执行结果: bobby28{'db_table': 'user'}{'age': <__main__.IntField object at 0x00000 阅读全文
posted @ 2018-08-08 22:54 孙龙-程序员 阅读(150) 评论(0) 推荐(0)
元类
摘要: 执行结果: <class '__main__.create_class.<locals>.User'> 执行结果: <__main__.User object at 0x00000000011BD898> 证明了类是type的实例,类也是对象 执行结果: in new in init 补充 先看一下 阅读全文
posted @ 2018-08-08 22:18 孙龙-程序员 阅读(101) 评论(0) 推荐(0)
2018年8月7日
php中的匿名函数和闭包(closure)
摘要: 一:匿名函数 (在php5.3.0 或以上才能使用) php中的匿名函数(Anonymous functions), 也叫闭包函数(closures), 允许指定一个没有名称的函数。最常用的就是回调函数的参数值。(http://php.net/manual/zh/functions.anonymou 阅读全文
posted @ 2018-08-07 15:58 孙龙-程序员 阅读(83) 评论(0) 推荐(0)
2018年8月5日
二进制安装mysql5.7
摘要: 二进制安装mysql5.7 阅读全文
posted @ 2018-08-05 23:14 孙龙-程序员 阅读(430) 评论(0) 推荐(0)
重启网卡报Job for network.service failed because the control process exited with error code.。。 错误
摘要: [root@mina0 hadoop]# systemctl restart networkJob for network.service failed because the control process exited with error code. See "systemctl status 阅读全文
posted @ 2018-08-05 20:53 孙龙-程序员 阅读(402) 评论(0) 推荐(0)
mysqld_safe启动报错
摘要: mysqld_safe --user=mysql & 报错(如下),但是使用mysqld直接启动没有问题。 50718 00:03:38 mysqld_safe Logging to '/var/log/mysqld.log'. 150718 00:03:38 mysqld_safe The fil 阅读全文
posted @ 2018-08-05 19:45 孙龙-程序员 阅读(544) 评论(0) 推荐(0)
上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 75 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3