Python打印不换行方法一、可以用print i,即在后面加逗号,但是这还是有一个不好的地方,就是会产生空格,print 1,print 2,则会输出:1 2方法二、import syssys.stdout.write("abc")sys.stdout.write("def")链表:一个链表类,一...
分类:
编程语言 时间:
2014-09-05 22:22:32
阅读次数:
188
http://blog.csdn.net/oopsoom/article/details/23447317def/:[B](z:B)(op:(B,A)=>B):B=foldLeft(z)(op)def:\[B](z:B)(op:(A,B)=>B):B=foldRight(z)(op)
分类:
其他好文 时间:
2014-09-05 19:49:11
阅读次数:
302
1 #coding=utf-8 2 from pymongo import MongoClient 3 4 def get_all_ids(collection): 5 for each in collection.find(): 6 yield each['_id'] ...
分类:
数据库 时间:
2014-09-04 23:39:00
阅读次数:
576
不多解释,预防普通锁不正规的获取与释放#!/usr/bin/env python# -*- coding: utf-8 -*-import threadingimport timeclass MyThread(threading.Thread): def run(self): g...
分类:
编程语言 时间:
2014-09-04 19:00:19
阅读次数:
201
#虚拟网络拓扑的json数据 def topodata #@vnic = Vnic.all #flash.now[:notice] = 'Message sent!' #flash.now[:alert] = 'Message sent!' simple_json = { nodes:...
分类:
Web程序 时间:
2014-09-04 16:42:29
阅读次数:
299
def maximizeFishing(A): for i in range(len(A)): for j in range(len(A[0,:])): A[i][j] += max(0 if i < 1 else A[i - 1][j], 0 if j <...
分类:
其他好文 时间:
2014-09-04 07:21:07
阅读次数:
250
分享一个Python Tkinter基础控件用法的入门例子,包括窗口的显示、显示内置图片、弹出窗口、菜单等.例子,Python Tkinter基础控件的用法# -*- coding: utf-8 -*-from Tkinter import *def btn_click():b2['text'] =...
分类:
编程语言 时间:
2014-09-04 06:18:57
阅读次数:
395
#虚拟网络拓扑json数据 def topodata #@vnic = Vnic.all #flash.now[:notice] = 'Message sent!' #flash.now[:alert] = 'Message sent!' @vnic = { nodes: [{ name...
分类:
Web程序 时间:
2014-09-04 01:32:07
阅读次数:
240
有时候像这种题,没有明显的思路,感觉像规律题。那么先暴力打表,再找规律就很快了。
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3798
先上我的暴力打表,这种肯定是TLE的,只用它发现规律就好了。
#include
#include
#include
#define INF 0x3f3f3f3f
#def...
分类:
其他好文 时间:
2014-09-03 22:48:57
阅读次数:
287
冒泡排序,顾名思义,按照一定的规则,把数据一直排下去直接上代码 1 import random 2 3 def bubblesort(data): 4 change=True 5 for i in range(len(data)-1,1,-1): 6 for j i...
分类:
编程语言 时间:
2014-09-03 12:54:46
阅读次数:
184