正确的程序如下所示:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from VideoCapture import Device
import time
import sys,pygame
pygame.init()
size = width,height = 620,485
speed = [2,2]
blac...
分类:
编程语言 时间:
2014-06-16 23:10:24
阅读次数:
568
题目
Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn't matter what you leave beyond the new ...
分类:
其他好文 时间:
2014-06-16 23:07:18
阅读次数:
188
??
The UML Is a Language for Documenting
A healthy software organization produces all sorts of artifacts in addition to raw executable code. These artifacts include (but are not limited to)...
分类:
其他好文 时间:
2014-06-16 20:40:42
阅读次数:
164
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
For example:
Given "25525511135",
return ["255.255.11.135", "255.255.111.35"].
(Order do...
分类:
其他好文 时间:
2014-06-16 19:24:42
阅读次数:
248
shell脚本编程之选择控制结构
程序开发语言,分为两种,一种是解释型语言,一种是编译型语言。解释型语言是解释语句,并且能根据流程控制机制让语句按需执行,解释一条语句就返回语句的结果,这种语言需要一个解释器,而linux中的bash就是这样的一个解释器,常见的解释型语言有perl,python,ruby,bash。编译型语言,首先需要编译源程序,并且能够将源程序转换为二进制格式,而后...
分类:
其他好文 时间:
2014-06-16 19:14:23
阅读次数:
325
python的scikit-learn包下有计算tf-idf的api,研究了下做个笔记
1 安装scikit-learn包
sudo pip install scikit-learn
2 中文分词采用的jieba分词,安装jieba分词包
sudo pip install jieba
3 关于jieba分词的使用非常简单,参考这里,关键的语句就是(这里简单试水,不追求效...
分类:
编程语言 时间:
2014-06-16 14:40:05
阅读次数:
437
'''
Created on 2014年6月15日
@author: Yang
'''
import socket
import datetime
# 初始化socket
s = socket.socket()
# 获取主机名, 也可以使用localhost
# host = socket.gethostname()
host = "localhost"
# 默认的http协议端口号
port...
分类:
编程语言 时间:
2014-06-16 14:17:33
阅读次数:
349
作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明。谢谢!简单的‘Hello World!’Python命令行假设你已经安装好了Python, 那么在Linux命令行输入:$python将直接进入python。然后在命令行提示符>>>后面输入...
分类:
编程语言 时间:
2014-06-16 13:55:51
阅读次数:
239
作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明。谢谢!简单的数据类型以及赋值变量不需要声明Python的变量不需要声明,你可以直接输入:>>>a = 10那么你的内存里就有了一个变量a, 它的值是10,它的类型是integer (整数)。...
分类:
编程语言 时间:
2014-06-16 13:46:47
阅读次数:
233