树状数组+离散化的题目,一直在思考为什么结果不一样,后来才发现花开了就是开了不会再谢了。 1 /* 4325 */ 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 #def...
分类:
其他好文 时间:
2015-01-05 23:05:47
阅读次数:
265
偶尔用脚本写点东西也是不错的
效果图
代码
from tkinter import *
reset=True
def buttonCallBack(event):
global label
global reset
num=event.widget['text']
if num=='C':
label['text']="0"
...
分类:
编程语言 时间:
2015-01-05 20:35:15
阅读次数:
299
占位 1 #!/usr/bin/python 2 #coding=utf-8 3 4 import urllib 5 import urllib2 6 import json 7 8 def post(url, data): 9 req = urllib2.Request(url)10 ...
分类:
编程语言 时间:
2015-01-05 18:11:06
阅读次数:
254
Python中的lambda关键字可以理解为:其功能类似于函数指针。
lambda的官方翻译是匿名函数,这是相对与正常的函数来说的,举例说明:
定义一个正常的函数,实现增1运算:
def plus1(x):
return x+1
上面的语句实现了:
1. 定义了一个函数,函数名叫:plus1
2. 此函数有一个参数
对应的匿名函数语句写作:
lambda...
分类:
编程语言 时间:
2015-01-05 13:00:15
阅读次数:
143
#coding=utf-8import timeimport urllib2import Queueimport threadingimport xml.dom.minidomimport MySQLdb#获取数据def get_appstop_data(url): myurl = url ...
分类:
移动开发 时间:
2015-01-05 01:50:49
阅读次数:
425
tree.def 中第0x3d个元素是
DEFTREECODE (CALL_EXPR, "call_expr", "e", 3)
下面是debug_tree()函数的结果,可以看出expand_expr()函数到gen_rtx()函数的调用过程!
expand_expr code = 3d
type
size
align 3...
分类:
其他好文 时间:
2015-01-04 23:06:23
阅读次数:
306
先从最简单的实现冒泡排序:
# -*- coding: UTF-8 -*-
intarray=[3,4,5,1,2,7,2,9,0]
def bubble(array):
for i in range(1,len(array)):
for j in range(i):
if array[j] > array[i]:
array[j],array[i]...
分类:
编程语言 时间:
2015-01-04 23:05:51
阅读次数:
245
1 var x = 0 2 3 def IncreaseOne(): Int = { 4 x += 1 5 x 6 } 7 8 def IncreaseOne() = { 9 x += 110 x11 }12 13 def IncreaseOne = {14 x += 11...
分类:
其他好文 时间:
2015-01-04 22:38:35
阅读次数:
295
importsysfromPyQt4importQtGui,QtCoreimporttimeimportrandomclassMyThread(QtCore.QThread):trigger=QtCore.pyqtSignal(int)def__init__(self,parent=None):su...
分类:
编程语言 时间:
2015-01-04 18:49:11
阅读次数:
213
import scala.io.Source def widthOfLength(s: String) = s.length.toString.length//计算字符串长度的位数,比如长度为:136,则位数为:3(三位数)
if (args.length > 0) { val lines = So...
分类:
其他好文 时间:
2015-01-04 18:46:49
阅读次数:
179