#!/usr/bin/envpython
stack=[]
defpushit():
stack.append(raw_input(‘EnterNewstring:‘).strip())
defpopit():
iflen(stack)==0:
print"Cannotpopfromanemptystack!"
else:
r=stack.pop()
print"Removed[%s]"%r
defviewstatck():
printstack
CMDs={‘u‘:pushit,‘o‘:popi..
分类:
编程语言 时间:
2015-07-15 15:18:26
阅读次数:
156
根据浏览器同源策略,如果iframe中是一个跨域的页面,那么在父页面中无法监听到iframe页面中的所有行为。
最近在看论坛,发现了一个变通的办法——监听鼠标停留在iframe上这个动作,顺便记录下来:
$('iframe').hover(
function () {
alert('AD frame!');
);
顺藤摸瓜,就发现了腾讯团队写的《iframe跨...
分类:
其他好文 时间:
2015-07-15 15:08:07
阅读次数:
162
Stack的三种含义作者:阮一峰日期:2013年11月29日学习编程的时候,经常会看到stack这个词,它的中文名字叫做"栈"。理解这个概念,对于理解程序的运行至关重要。容易混淆的是,这个词其实有三种含义,适用于不同的场合,必须加以区分。含义一:数据结构stack的第一种含义是一组数据的存放方式,特...
分类:
其他好文 时间:
2015-07-15 15:00:54
阅读次数:
100
头文件:StackTP.h
#ifndef __STACKTP_H__
#define __STACKTP_H__
template
class Stack
{
public:
Stack();
bool IsFull();
bool IsEmpty();
bool Push(const T &x);
bool Pop(T &x);
int Lenth();
void Show(...
分类:
编程语言 时间:
2015-07-15 11:13:28
阅读次数:
127
- (void)drawRect:(CGRect)rect { CGFloat lineWidth = 2; CGRect borderRect = CGRectMake(self.frame.size.width/2, self.frame.size.height - 20, 10....
看下面的表格 #+PLOT: title:"HDFS文件增长" ind:1 type:2d
#+tblname: hdfs-data
#+ATTR_HTML: :border 2 :rules all :frame border
| 月份 | HDFS大小(字节) |
| 1 | 6209725342916516 |
| 2 | 6425522492839058...
分类:
系统相关 时间:
2015-07-14 22:38:37
阅读次数:
216
1.栈:Stack,先进后出,一个一个赋值,一个一个取值,按顺序。.count 取集合内元素的个数.push() 将元素一个一个推入集合中//stack集合存入用.push().pop() 将元素一个个弹出集合.clear() 清空集合 Stack s = new Stack();//先存入的后取出...
分类:
其他好文 时间:
2015-07-14 19:50:49
阅读次数:
106
我们在使用UILabel的时候,往往估计一个frame,然后根据这个估计的frame来定义内容
然而情况往往并不总是这么如意,很多情况下,我们需要根据文字的大小多少来定义label的长度和宽度,怎么办呢
下面依次讲一下长度和宽度的自适应
宽度自适应:
这里往往是根据文字多少来定义的label的长度,假设我们只需要显示一行字,但是这一行又希望是根据文字大小来定...
分类:
其他好文 时间:
2015-07-14 18:17:13
阅读次数:
81
Refusedtodisplay'http://www.***.com/login/doLogin.html'inaframebecauseitset'X-Frame-Options'to'SAMEORIGIN'.触发原因:页面的返回头被设置X-Frame-Options SAMEORIGIN ,只...
分类:
其他好文 时间:
2015-07-14 17:31:43
阅读次数:
175
题目链接:https://leetcode.com/problems/valid-parentheses/
Given a string containing just the characters '(', ')','{', '}', '[' and ']',
determine if the input string is valid.
The brackets m...
分类:
其他好文 时间:
2015-07-14 15:37:03
阅读次数:
109