2011年6月28日
摘要: # http://open.weibo.com/wiki/index.php/SDK# 下载sinatpy解压放到py安装目录下的Libs就好用了# -*- coding:utf-8 -*-import unittestfrom weibopy.auth import OAuthHandlerfrom weibopy.api import API## 你注册应用获取的key and secretconsumer_key = 'xxx' consumer_secret = 'xxx'## url = auth.get_authorization_url() ## 阅读全文
posted @ 2011-06-28 18:08 eth0 阅读(163) 评论(0) 推荐(0) 编辑
2011年6月25日
摘要: #include <QApplication>#include <QLabel>#include <QPushButton>#include <QSpinBox>#include <QSlider>#include <QHBoxLayout>int main(int argc,char* argv[]){ QApplication app(argc,argv); //QLabel* label = new QLabel("<h2><i>xxx</i>""&l 阅读全文
posted @ 2011-06-25 20:54 eth0 阅读(374) 评论(0) 推荐(0) 编辑
摘要: #include <QApplication>#include <QLabel>int main(int argc,char* argv[]){ QApplication app(argc,argv); QLabel* label = new QLabel("<h2><i>xxx</i>""<font color=red>xxx</font></h2>"); label->show(); return app.exec();}#include <Q 阅读全文
posted @ 2011-06-25 19:51 eth0 阅读(178) 评论(0) 推荐(0) 编辑
2011年6月24日
摘要: #-*- coding:utf-8 -*-from Tkinter import *import urllibclass window(object): def __init__(self,root): self.rr = root self.entry = Entry(self.rr) self.entry.place(x=5,y=15) self.button = Button(self.rr,text='website',command=self.solve) self.button.place(x=100,y=15) self.edit = Text(self.rr,h 阅读全文
posted @ 2011-06-24 10:48 eth0 阅读(159) 评论(0) 推荐(0) 编辑
2011年6月21日
摘要: import urllibdef hook(a,b,c): #回调函数 tem = 100.0 * a * b / c if tem>100: tem=100 print '%.2f%%' % temurl = "http://192.168.102.42/www/"path = "d:\\1.txt"urllib.urlretrieve(url, path, hook) # 下载htmlf = urllib.urlopen("xxx") print f.read() # 类似于文件操作 readlines, r 阅读全文
posted @ 2011-06-21 20:05 eth0 阅读(151) 评论(0) 推荐(0) 编辑
2011年6月14日
摘要: import Tkinterroot = Tkinter.Tk()root.mainloop()显示一个tk窗口 阅读全文
posted @ 2011-06-14 20:20 eth0 阅读(199) 评论(0) 推荐(0) 编辑
2011年5月30日
摘要: 1 // 判断一个数是否为2的n次幂 2 return !(a & (a-1)) 3 // 简单移位操作 4 a<<1 == a*2 5 a>>1 == a/2 6 // 异或操作<相同取反> 7 a^a==0 a^0==a 8 // 把右数第k位变成1 9 a | (1<<(k-1))10 // 把右数第k位变成011 a & (!(1<<(k-1)))12 // 第k位取反13 a ^ (1<<(k-1))判断一个数二进制中1的个数是奇数还是偶数:x = x ^ (x>>1); x = x 阅读全文
posted @ 2011-05-30 16:15 eth0 阅读(150) 评论(0) 推荐(0) 编辑
2011年5月28日
摘要: ~\Desktop\1947.cpp.html 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <vector> 5 using namespace std; 6 #define inf 10000000 7 int s[160],p[160],v[160],dp[160][160],n,m; 8 void check(int root) 9 {10 for(int i=0;i<=m;i++) dp[root][i] = inf;11 dp[ 阅读全文
posted @ 2011-05-28 20:01 eth0 阅读(146) 评论(0) 推荐(0) 编辑
2011年5月23日
摘要: // 类似 2411 状态压缩 1 Source Code 2 3 Problem: 1185 User: eth1 4 Memory: 3452K Time: 297MS 5 Language: C++ Result: Accepted 6 Source Code 7 #include <iostream> 8 #include <cstring> 9 using namespace std;10 11 const int N = 1<<11;12 int dp[101][90][90];13 int graph[110];14 struct node15 阅读全文
posted @ 2011-05-23 22:11 eth0 阅读(181) 评论(0) 推荐(0) 编辑
2011年5月20日
摘要: // 这题坑爹啊 , 米有看清这已经是topsort() 的了, 害我浪费20多分钟写了那么长还爆内存....Source CodeProblem: 1949 User: eth1Memory: 292K Time: 1500MSLanguage: C++ Result: AcceptedSource Code#include <iostream>#include <algorithm>#include <cmath>#include <cstring>using namespace std;//bool vis[10001][10001];in 阅读全文
posted @ 2011-05-20 22:24 eth0 阅读(145) 评论(0) 推荐(0) 编辑