- 博客(136)
- 收藏
- 关注
原创 python 网络编程 openurl [errno 10060]
《python 基础教程 第二版》 学习网络编程, 按照书本介绍,只是读取网页数据,简明的做法,但尝试失败错误提示:[Errno socket error] [errno 10060]导致错误原因:1.url 方 限制了访问次数,防止过快2.自己的网络有问题。 1)断网情况 2)使用的网络访问外网受限 解决方法,改用更高级点的
2016-04-06 16:27:48
10204
1
原创 python 异常 try-except句型
1.句型try: 表达式 1(如果表达式,可以成功执行,则执行,跳到 finally 语句)except ExpectErrorType, Argument: (表达式1 没有做成功,且正好是 ExpectErrorType 的错误情况,则执行) 表达式2 (如何处理这种异常情况)else: (try succ && 上
2016-04-06 15:30:14
34516
原创 vector pair sort
bool strict_weak_ordering(const std::pair a, const std::pair b) { return a.first < b.first; } int main() { using namespace std; vect
2016-01-15 21:20:42
923
原创 文件权限问题 unix
查看权限语句:ls –l xxfile权限位数:10位:类型[1位] user(属主)[3位] group[3位] other[3位]权限字符意义:r/4:readw/2:writex/1:可被执行-/0:相应位未被授予 -rw------- (600) 只有所有者才有读和
2016-01-12 11:33:52
748
原创 虚拟继承
1.为什么要引入虚拟继承虚拟继承是多重继承中特有的概念。虚拟基类是为解决多重继承而出现的。如:类D继承自类B1、B2,而类B1、B2都继承自类A,因此在类D中两次出现类A中的变量和函数。为了节省内存空间,可以将B1、B2对A的继承定义为虚拟继承,而A就成了虚拟基类。实现的代码如下:class Aclass B1:public virtual A;class B2:p
2016-01-06 21:22:30
409
转载 Endian
在各种计算机体系结构中,对于字节、字等的存储机制有所不同,因而引发了计算机通信领 域中一个很重要的问题,即通信双方交流的信息单元(比特、字节、字、双字等等)应该以什么样的顺序进行传送。如果不达成一致的规则,通信双方将无法进行正 确的编/译码从而导致通信失败。目前在各种体系的计算机中通常采用的字节存储机制主要有两种:Big-Endian和Little-Endian,下面先 从字节序说起。
2016-01-06 11:54:51
796
转载 android TextView 属性
android:cursorVisible设定光标为显示/隐藏,默认显示。android:digits设置允许输入哪些字符。如“1234567890.+-*/% ()”android:drawableBottom在text的下方输出一个drawable,如图片。如果指定一个颜色的话会text的背景设为该颜色,并且同时和background使用时覆盖后者。android:drawable
2015-11-07 19:52:18
477
转载 Android Studio 学习笔记
常用功能在Studio菜单栏的右边有这样几个常用的功能,如图分别是 Gradle同步、AVD Manager、SDK Manager、DDMSGradle同步 在你项目运行或者更改Gradle配置的时候都要点击下这个按钮,会下载相应的依赖AVD Manager 模拟器管理SDK Manager 就是管理你的SDK版本DDMS 即 Dalvik Debug Monitor S
2015-11-04 15:49:06
382
转载 python 中文编码问题
转载http://my.oschina.net/leejun2005/blog/74430总结:1)前缀“u”表示“后面这个字符串“是一个Unicode字符串”,这仅仅是一个声明,并不表示这个字符串就真的是Unicode了;就好比某正太声称自己已满18岁,但实际上他的真实年龄并不确定,现在体育界年龄造假可不稀罕幺! 那么声明成u有什么作用呢?对于Python来说,只要你
2015-08-31 17:04:52
465
转载 C语言各种数据类型在系统中占的字节和取值范围
C语言各种数据类型在系统中占的字节和取值范围基本类型包括字节型(char)、整型(int)和浮点型(float/double)。定义基本类型变量时,可以使用符号属性signed、unsigned(对于char、int),和长度属性short、long(对于int、double)对变量的取值区间和精度进行说明。 下面列举了Dev-C++下基本类型所占位数和取值范围:
2015-08-26 17:38:23
1213
原创 unix ls 命令
ls 命令选项详解 ls 命令可以说是Linux下最常用的命令之一。它有众多的选项,其中有很多是很有用的,你是否熟悉呢?下面列出了 ls 命令的绝大多数选项。 -a 列出目录下的所有文件,包括以 . 开头的隐含文件。 -b 把文件名中不可输出的字符用反斜杠加字符编号(就象在C语言里一样)的形式列出。 -c 输出文件的 i 节点的修改时间,并以此排序。 -d
2015-08-18 21:02:08
3716
转载 计算二进制的1的个数
转载 http://www.cnblogs.com/graphics/archive/2010/06/21/1752421.html点击打开链接very good!
2015-03-17 21:13:52
470
转载 操作系统 IPC
转载:http://blog.chinaunix.net/uid-26833883-id-3230564.html一、IPC(Inter-Process Communication,进程间通信)对象的介绍System V 的IPC对象有共享内存、消息队列、信号灯。注意:在IPC的通信模式下,不管是使用消息队列还是共享内存,甚至是信号灯,每个IPC的对象都有唯
2015-03-16 11:12:40
2223
原创 街区最短路径问题 规律题
街区最短路径问题原题链接: 点击打开链接时间限制:3000 ms | 内存限制:65535 KB难度:4描述 一个街区有很多住户,街区的街道只能为东西、南北两种方向。住户只可以沿着街道行走。各个街道之间的间隔相等。用(x,y)来表示住户坐在的街区。例如(4,20),表示用户在东西方向第4个街道,南北方向第20个街道。现在要建一
2015-02-01 09:58:28
884
原创 hdu 5164 Matching on Array AC自动机
Matching on ArrayTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 257 Accepted Submission(s): 61Problem DescriptionAlice has a seq
2015-01-27 19:32:05
665
原创 hdu 3389 Game 博弈
GameTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 398 Accepted Submission(s): 263Problem DescriptionBob and Alice are playing a
2014-12-01 20:57:38
592
原创 hdu 5115 Dire Wolf 区间DP
Dire WolfTime Limit: 5000/5000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 86 Accepted Submission(s): 50Problem DescriptionDire wolves, also know
2014-11-30 14:41:56
533
原创 hdu 2149 Public Sale 基础博弈
Public SaleTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4545 Accepted Submission(s): 2748Problem Description虽然不想,但是现实总归是现实,Lel
2014-11-21 17:24:41
451
原创 hdu 2147 kiki's game 博弈基础题
kiki's gameTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 40000/1000 K (Java/Others)Total Submission(s): 6963 Accepted Submission(s): 4165Problem DescriptionRecently kiki has n
2014-11-21 16:26:00
488
原创 Sweet Child Makes Trouble 错排
Sweet Child Makes TroubleInput: standard inputOutput: standard outputTime Limit: 8 secondsChildren are always sweet but they can sometimes make you feel bitter. In this problem, you will see h
2014-11-18 20:16:44
1056
原创 Tmutarakan Exams 简单的容斥定理
Tmutarakan ExamsTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionUniversity of New Tmutarakan trains the first-class s
2014-11-17 23:04:54
646
原创 poj 2356 Find a multiple 抽屉原理
Find a multipleTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6263 Accepted: 2734 Special JudgeDescriptionThe input contains N natural (i.e. positive
2014-11-17 16:08:07
522
原创 炮兵阵地 压缩DP
炮兵阵地时间限制:2000 ms | 内存限制:65535 KB难度:6描述 司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示:
2014-11-17 15:07:33
460
原创 B. Appleman and Tree 树状DP
B. Appleman and Treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAppleman has a tree with n vertices. Some of the
2014-10-30 23:48:58
679
原创 hdu5037 Frog 贪心
FrogTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 754 Accepted Submission(s): 185Problem DescriptionOnce upon a time, there i
2014-09-22 20:23:25
966
原创 hdu 4266 The Worm in the Apple 三维凸包
The Worm in the AppleTime Limit: 50000/20000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 540 Accepted Submission(s): 248Problem DescriptionWilly th
2014-09-20 17:42:45
710
原创 hdu 4939 Stupid Tower Defense DP
Stupid Tower DefenseTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1181 Accepted Submission(s): 346Problem DescriptionFSF is
2014-08-13 23:06:30
499
原创 hdu 4937 Lucky Number 数学
Lucky NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 229 Accepted Submission(s): 61Problem Description“Ladies and Gentle
2014-08-12 19:58:50
593
原创 CF problem-56-E. Domino Principle 维护栈
E. Domino Principletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya is interested in arranging dominoes. He is
2014-08-10 13:57:09
758
原创 HDU 2289 Cup 二分
CupTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4292 Accepted Submission(s): 1351Problem DescriptionThe WHU ACM Team has a big
2014-08-10 13:46:47
481
原创 hdu 4923 Room and Moor
#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;const double eps=1e-9;int n;int a[100010];struct node{ int cnt; int a
2014-08-07 23:37:57
464
原创 CF A. Trains
outputstandard outputVasya the programmer lives in the middle of the Programming subway branch. He has two girlfriends: Dasha and Masha, who live at the different ends of the branch, each one
2014-08-04 23:56:57
609
原创 UVA 11489 搜索
#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;char a[1010];int v[1010];bool vis[1010];int len,sum;int de
2014-08-04 23:54:38
424
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人