Mini-project description - Rock-paper-scissors-lizard-Spock Rock-paper-scissors is a hand game that is played by two people. The players count to three in unison and simultaneously "throw" one of three hand signals that correspond to rock, paper…
这是在coursera上面的一门学习pyhton的基础课程,由RICE的四位老师主讲.生动有趣,一共是9周的课程,每一周都会有一个小游戏,经历一遍,对编程会产生很大的兴趣. 所有的程序全部在老师开发的在线平台进行测试,并且还有"VIZ mode",可以通过可视化的模式,理解程序的进程. This class is nine weeks long. For most weeks, you will watch two sets of videos (part a and part b)…
Mini-project description - Rock-paper-scissors-lizard-Spock Rock-paper-scissors is a hand game that is played by two people. The players count to three in unison and simultaneously "throw" one of three hand signals that correspond to rock, paper…
#Practice Exercises for Logic and Conditionals # Solve each of the practice exercises below. # 1.Write a Python function is_even that takes as input the parameter number (an integer) and # returns True if number is even and False if number is odd. #…
# Practice Exercises for Functions # Solve each of the practice exercises below. # 1.Write a Python function miles_to_feet that takes a parameter miles and # returns the number of feet in miles miles. def miles_to_feet(miles): feet = miles * 5280 ret…
This is a note for https://class.coursera.org/interactivepython-005 In week two, I have learned: 1.event-drvien programing 4 event types: Input: button, textbox Keyborad: key up, key down Mouse: click, drag Timer example: # Example of a simple event-…
 Question 8 We can use loops to simulate natural processes over time. Write a program that calculates the populations of two kinds of "wumpuses" over time. At the beginning of year 1, there are 1000 slow wumpuses and 1 fast wumpus. This one fa…
 Question 7 Convert the following English description into code. Initialize n to be 1000. Initialize numbers to be a list of numbers from 2 to n, but not including n. With results starting as the empty list, repeat the following as long as numbers …
 First, complete the following class definition: class BankAccount: def __init__(self, initial_balance): """Creates an account with the given balance.""" - def deposit(self, amount): """Deposits the amount in…
Mini-project #4 - "Pong" In this project, we will build a version of Pong, one of the first arcade video games (1972). While Pong is not particularly exciting compared to today's video games, Pong is relatively simple to build and provides a nic…
Book Imformation : <Pratical Programming : An Introduction to Computer Science Using Python 3> 2nd Edtion Author : Paul Gries,Jennifer Campbell,Jason Montojo Page : Chapter 2.3 to Chapter 2.5 1.A type consists of two things: (1).a set of values (2).…
Book Imformation : <Pratical Programming : An Introduction to Computer Science Using Python 3> 2nd Edtion Author : Paul Gries,Jennifer Campbell,Jason Montojo Page : Chapter 1 and Chapter 2.1-2.2 1.every computer runs operating system,which it's the…
Introduction to OOC Programming Language 文/akisann @ cnblogs.com / zhaihj @ github.com 本文同时发布在github上:https://github.com/zhaihj/intro-ooc 本文遵循CC-BY-NC. 我想试一门新语言……但: 我希望这门语言能简洁易懂 —— 排除了Perl/Rust... 我不想自己管理内存 —— 排除了C/C++/Object Pascal... 最好它能跟C差不多快 ——…
4.1. Introduction to Object-Oriented ProgrammingObject-oriented programming, or OOP for short, is the dominant programming paradigm these days, having replaced the "structured," procedural programming techniques that were developed in the 1970s.…
Introduction to Data Visualization with Python | DataCamp https://www.datacamp.com/courses/introduction-to-data-visualization-with-python This course extends Intermediate Python for Data Science to provide a stronger foundation in data visualization…
ESTIMATED TIME TO COMPLETE: 18 minutes We can use the idea of bisection search to determine if a character is in a string, so long as the string is sorted in alphabetical order. First, test the middle character of a string against the character you'r…
Assume s is a string of lower case characters. Write a program that prints the longest substring of s in which the letters occur in alphabetical order. For example, if s = 'azcbobobegghakl', then your program should print Longest substring in alphabe…
Introduction Computer Network: hosts, routers, communication channels Hosts run applications Routers forward information Packets: sequence of bytes contain control information e.g. destination host Protocolis an agreement: meaning of packets structur…
Lock-free programming is a challenge, not just because of the complexity of the task itself, but because of how difficult it can be to penetrate the subject in the first place. I was fortunate in that my first introduction to lock-free (also known as…
ALSA stands for the Advanced Linux Sound Architecture. It consists of a set of kernel drivers, an application programming interface (API) library and utility programs for supporting sound under Linux. In this article, I present a brief overview of th…
PyQt5 PyQt5是一个基于强大的图形程式框架Qt5的python接口, 主要包含以下几个大类: ● QtCore ● QtGui ● QtWidgets ● QtMultimedia ● QtBluetooth ● QtNetwork ● QtPositioning ● Enginio ● QtWebSockets ● QtWebKit ● QtWebKitWidgets ● QtXml ● QtSvg ● QtSql ● QtTest QtCore模块涵盖了包的核心的非GUI功能,此模块…
第1章 面向对象思想 第2章 抽象 第3章 面向对象设计 第4章 类和方法 第5章 消息,实例和初始化 第6章 案例研究: 八皇后问题 第7章 研究研究: 台球游戏 第8章 继承与替换 第9章 案例研究: 纸牌游戏 第10章 子类和子类型 第11章 静态行为和动态行为 第12章 替换的本质 第13章 多重继承 第14章 多态及软件复用 第15章 重载 第16章 改写 第17章 多态变量 第18章 泛型 第19章 容器类 第20章 案例研究: 标准模板库 第21章 框架 第22章 框架实例: AW…
老实说笔者学习 Go 的时间并不长,积淀也不深厚,这次因缘巧合,同组的同事以前是上海大学的开源社区推动者之一,同时我们也抱着部分宣传公司和技术分享的意图,更进一步的,也是对所学做一个总结,所以拟定了这次分享.另外与会的同学大多都是大二大三的"萌新",考虑到受众水平和技术分享的性质,所以实际上这次分享涉及到的知识点都相对基础,当然为了寓教于乐,本人也十分讨厌着重介绍基础语法时可能引起的枯燥,所以加了少少的私货,并且也针对 1.11 及之前版本中或优雅,或局限的特性做了发散性的讲解. 总而…
Static and non-Static :  非静态方法(不带static)可以访问静态变量和方法(带static),但是反过来就不行. 类的静态成员(变量和方法)属于类本身,在类加载的时候就会分配内存,可以通过类名直接去访问. 非静态成员(变量和方法)属于类的对象,只有在类的对象产生(创建实例)的时候才会分配内存,然后通过类的对象去访问. 在一个类的静态成员中去访问非静态成员之所以会出错是因为在类的非静态成员不存在的时候静态成员就已经存在了,访问一个内存中不存在的东西会出错. 静态变量和方…
并发编程,在哪个语言里都属于高端应用,一定得会了才好意思说懂了这门语言. 在工作中用得并不是很多,忘了一些内容,就慢慢看,慢慢补上. 今天一天看了近三分之一(我看外文越来越快了??:)), 实践一下多线程的threading模块. #coding: utf-8 import logging, threading from Queue import Queue logger = logging.getLogger() logger.setLevel(logging.DEBUG) formatter…
https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-251j-introduction-to-mathematical-programming-fall-2009/readings/MIT6_251JF09_SDP.pdf 关于半正定规划,这篇讲得非常细致. 今天读了<凸优化>,以及CS 8292 ,发现凸优化是一种表述问题,把问题转化成凸优化的思维和经验的传递. 对于一个问题,可以尝试多种描述,可…
python 入门学习(一) 入门学习(二) 入门学习(三) 入门学习(四) 入门学习(五) 入门学习(六) 入门学习(七) 入门学习(八) 入门学习(九) 入门学习(十) Head First Python(五) An Introduction to Interactive Programming in Python(week two)…
前言:数据科学越来越火了,网页是数据很大的一个来源.最近很多人问怎么抓网页数据,据我所知,常见的编程语言(C++,java,python)都可以实现抓网页数据,甚至很多统计\计算的语言(R,Matlab)都有可以实现和网站交互的包.本人试过用java,python,R抓网页,感觉语法各有差异,逻辑上是一样的.我准备用python来大概讲讲抓网页是什么概念,具体的内容要自己看手册或者google别人的博客,这里算是抛砖引玉了.水平有限,出现错误或者有更好的办法,欢迎讨论.. more info o…
根据他人的博客,可以发现pip也是可以离线安装已经下载好的包的,具体请参考<pip常用命令>.由于现在还没进展到那个程度,所以本次博客先记录一下我已经学会的东西. 1.pip基本用法 (1)以下载numpy为例,看如何使用pip下载第三方包 只需要打开cmd,然后输入: pip install numpy 如果你的机子现在是联网的,那么就可以下载numpy并且给你安装上. (2)以numpy为例,看如何使用pip卸载第三方包 一样是打开cmd,然后输入: pip uninstall numpy…
1.廖雪峰的官方网站 http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/001386818214042e9c46552422e42d8a00f019e088506ce000 2.An Introduction to Interactive Programming in Python https://www.coursera.org/learn/interactive-python-…