Skip to content

Instantly share code, notes, and snippets.

@wangyangkobe
wangyangkobe / fibonacci.go
Created November 16, 2014 08:31
Go语言的“斐波纳契闭包”
import "fmt"
// fibonacci 函数会返回一个返回 int 的函数。
func fibonacci() func() int {
a := -1
b := 1
return func() int {
a, b = b, a+b
return b
}
@wangyangkobe
wangyangkobe / copyfile.py
Created November 7, 2014 09:03
对SBG的source code打包。
#!/bin/python
import os
import sys
import shutil
import multiprocessing
'''os.system("cleartool setview elqstux_ki_ppb")'''
ftPath = "/vobs/mgwblade/PPB/SBG_HSD10196_1/test/auto"
sgcPath = "/vobs/mgwblade/SGC/SGC_CSA10105_4/SGC_CRA1190962"
@wangyangkobe
wangyangkobe / UIView+UITableViewCell
Created August 12, 2014 13:57
根据UITableViewCell的元素来获取UITableViewCell.(兼容ios7和ios6).
@implementation UIView (KLCPopupExample)
- (UITableViewCell*)parentCell {
// Iterate over superviews until you find a UITableViewCell
UIView* view = self;
while (view != nil) {
if ([view isKindOfClass:[UITableViewCell class]]) {
return (UITableViewCell*)view;
} else {
- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillHide:)
//
// ContentViewController.m
//
// Created by Johnnie Walker on 07/06/2013.
//
#import "ContentViewController.h"
@interface ContentViewController () <UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, weak) UITableView *tableView;