Quantcast
Browsing all 9596 articles
Browse latest View live

PEP 308 and why I still hate Python

I’m not a python guy, but it seems that every job I’ve had has slowly pushed me into doing more and more Python until I end up doing nothing but Python all day. And I hate doing Python all day. To be...

View Article


Py3Cache 1.0 Beta1 发布,Python 两级缓存框架

Py3Cache 1.0 Beta1 版本发布了,该版本废弃了beaker 作为一级缓存,改用 pylru 实现简单的一级缓存,并增加了之前 0.1 版本中缺失的缓存失效时的事件广播功能。 开发者可以通过在 config.ini 中定义不同缓存 region 的对象大小和有效时间,示例:...

View Article


Image may be NSFW.
Clik here to view.

很全的 Python 面试题(一)

很全的 python 面试题(一) 一点号书圈3小时前 php?url=0FpbJwHlbv" alt="很全的 Python 面试题(一)" />1 Python的函数参数传递看两个例子: Python 所有的变量都可以理解是内存中一个对象的“引用”,或者,也可以看似c中void*的感觉。...

View Article

Image may be NSFW.
Clik here to view.

模拟生命

做过蒙特卡洛试验的朋友会有感悟:决定一个系统走势是多因素构成,而非单一因素决定。 例如癌症,医生常说抽烟致癌,不要抽烟,但实际生活中抽烟长寿的人不少,我的姨婆九十多岁了,每日抽烟喝酒,身体也不错。决定癌症的因素很多,例如遗传,饮食,起居时间,居住环境,化工污染等等。下图转自一份医学研究,说明没有任何食物百分之百致癌或抑制癌症。...

View Article

利用Python Fabric配置主机间SSH互信和添加公钥

本文主要讲述如何利用python的Fabric模块编写一个脚本用于配置多个主机间SSH互信以及如何将管理员自己的公钥批量添加到多个主机中。 脚本说明...

View Article


Peter Bengtsson: Don't forget your sets in Python!

I had this piece of code: new_all_ids = set( x for x in all_ids if x not in to_process_ids ) The all_ids is a list object of 1.1 million IDs. Some repeated. And to_process_ids is a list sample of 1,000...

View Article

Oil-dev is Alive!

I created theoil-dev@oilshell.org mailing list in November, and there are now afew threads. Subscribe if you're interested! What Are We Doing? I summarized the state of the project in myreview of...

View Article

机器学习:Python实现最小均方算法(lms)

lms算法跟Rosenblatt感知器相比,主要区别就是权值修正方法不一样。lms采用的是批量修正算法,Rosenblatt感知器使用的 是单样本修正算法。两种算法都是单层感知器,也只适用于线性可分的情况。 详细代码及说明如下: ''' 算法:最小均方算法(lms) 均方误差:样本预测输出值与实际输出值之差平方的期望值,记为MES 设:observed...

View Article


Image may be NSFW.
Clik here to view.

面试 | Python 面试问答 Top 25

面试 | python 面试问答 Top 25 一点号书圈5小时前 博士和局长上厕所,故事很短,意味深长! 普通本科出身的名校研究生:我们为何沦为学渣? 本、硕、博区别的“兔子理论” 耶鲁大学校长:如果学生从大学毕业后拥有了某种专业的知识和技能,这将是耶鲁教育最大的失败! php?url=0FpsuuHlbv" alt="面试 | Python 面试问答 Top 25" />Python...

View Article


Three remote workshops: regex in Python, scipy.optimize, and building Web sites

We're running three half-day workshops for your remote viewing pleasure! All three will be live-streamed via YouTube (well, Hangouts on Air). Today 2/17, at 9:15am PT, Tiffany Timbers (Simon Fraser U.)...

View Article

调用tf.softmax_cross_entropy_with_logits函数出错解决

运行一个程序时提示出错如下: Traceback (most recent call last): File "/MNIST/softmax.py", line 12, in <module> cross_entropy2=tf.reduce_sum(tf.nn.softmax_cross_entropy_with_logits(logits, y_))#dont forget...

View Article

Detecting Bots in Apache & Nginx Logs using Python

As browser plugins that block javascript-based tracking beacons now enjoy a 9-figure user base, web traffic logs can be a good place to get a better feel for how many people are visiting your website....

View Article

Python nonlocal 与 global 关键字解析

nonlocal 首先,要明确 nonlocal 关键字是定义在闭包里面的。请看以下代码: x = 0 def outer(): x = 1 def inner(): x = 2 print("inner:", x) inner() print("outer:", x) outer() print("global:", x) 结果 # inner: 2 # outer: 1 # global: 0...

View Article


Image may be NSFW.
Clik here to view.

Developers wanted: Quantum computing, Python, and Jupyter Notebooks

Lev Bishop andAndrew Cross are IBM Researchers with the Theory of Quantum Computing Group at the IBM TJ Watson Research Center in Yorktown Heights, USA, and contributors to theQISKit open source...

View Article

我心中的 tornado 最佳实践

最新开发新项目一直在学习tornado的知识,在前人的基础上找了些最佳实践,记录如下,备查。 tornado 新人一枚,欢迎大神拍砖~ 项目目录结构 import tornado.ioloop import tornado.web ## 业务处理层 classMainHandler(tornado.web.RequestHandler): defget(self):...

View Article


Image may be NSFW.
Clik here to view.

PyBites: Flask API part 2 - Building a Deep Work Logger with Flask, Slack and...

AfterSimple API - part 1 a more practical app in this part 2 tutorial: a Deep Work logger integrating Google docs and Slack, including deployment of the app to Heroku. Sometimes you come across an...

View Article

Image may be NSFW.
Clik here to view.

Neural Networks with Raw Python and NumPy

I’ve been brushing up on my python programming language skills. One thing I like to do with any language is implement a simple feed-forward neural network. The code to create a neural network uses all...

View Article


The tensorflow python module - part 001.

TensorFlow is an open source software library for numerical computation using data flow graphs. I used Fedora 25 distro and python version 2.7. The base of this installation was the official website ....

View Article

Ruby like Python

I did python.. awhile back, it was like ruby in some ways and in some ways not. So I picked one, I went full blown into Ruby. Recently I’ve seen lots of job postings for Python so I figured I’d give it...

View Article

Development environment

While it can be an avenue for procrastination, searching for a proper development environment often pays off with greatly improved productivity in the long term. I had some finicky requirements. I...

View Article
Browsing all 9596 articles
Browse latest View live