描述:不使用 * / % 完成除法操作。O(n)复杂度会超时,需要O(lg(n))复杂度。代码: 1 class Solution: 2 # @return an integer 3 def dividePositive(self, dividend, divisor): 4 ...
分类:
其他好文 时间:
2014-07-16 19:18:00
阅读次数:
298
NSString *stringClass = NSStringFromClass([(UINavigationController *)self.window.rootViewController topViewController].class);
分类:
移动开发 时间:
2014-07-16 19:00:17
阅读次数:
245
```pythonimport win32con,win32guiclass MyWindow(): def __init__(self): #注册一个窗口类 wc = win32gui.WNDCLASS() wc.lpszClassName = 'M...
先写下这个问题的模式
def preorderTraversal(self, root):
if root == None: return []
re = []
insert root to stack s
while s not empty:
cur_root = top of stack s
s.pop()
how to handle cur_root
how to ...
分类:
其他好文 时间:
2014-07-15 10:17:43
阅读次数:
274
#import [self.content.layer setBackgroundColor:[[UIColor whiteColor] CGColor]];[self.content.layer setBorderColor:[[UIColor grayColor] CGColor]];[self...
分类:
其他好文 时间:
2014-07-14 21:59:15
阅读次数:
201
// 网络变化消息 [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(checkNetwork) name: kReachabilityChangedNotification object: nil...
分类:
Web程序 时间:
2014-07-14 21:50:23
阅读次数:
212
自定义相机的时候,调用系统的相机,由于相机的分辨率,会出现短小的矩形框,总会出现黑色边框,如下图:
如果想实现全屏相机的话,这样做就可以了:
CALayer *viewLayer = self.imagePickerController.view.layer;
[viewLayer setBounds:CGRectMake(0.0, 0....
分类:
移动开发 时间:
2014-07-14 20:45:01
阅读次数:
290
{loop subcat(0,0,0,$siteid) $r}{/loop}
/**
* 获取子栏目
* @param $parentid 父级id
* @param $type 栏目类型
* @param $self 是否包含本身 0为不包含
* @param $siteid 站点id
*/
function subcat($parentid = NULL, $...
分类:
Web程序 时间:
2014-07-14 20:30:49
阅读次数:
522
G - Self Numbers(2.2.1)
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
In 1949 the Indian mathematician D.R. Kaprekar discovered...
分类:
其他好文 时间:
2014-07-14 16:18:29
阅读次数:
194
@interface MoveView : UIView{ CGPoint startPoint;}#import "MoveView.h"@implementation MoveView- (id)initWithFrame:(CGRect)frame{ self = [super i...
分类:
其他好文 时间:
2014-07-14 15:42:42
阅读次数:
157