Skip to content

Instantly share code, notes, and snippets.

@xenop
xenop / gist:4133852
Created November 23, 2012 03:09
hoge
before:
list.append('<div class="one-fourth" style="margin-top:15px;"><a href="'+h+'" '+s.attr+' title="'+photo['title']+'" target="_blank"><img src="'+t+'" alt="'+photo['title']+'" /></a></div>');
after:
var element = $('<div class="one-fourth" style="margin-top:15px;"><a href="'+h+'" '+s.attr+' title="'+photo['title']+'" target="_blank"><img src="'+t+'" alt="'+photo['title']+'" /></a></div>');
if(i % 4 === 0){
element.addClass('column-first');
}else if(i % 4 === 3){
element.addClass('column-last');
}
@xenop
xenop / gist:4594398
Created January 22, 2013 12:46
korakora
- (void)viewDidLoad{
[super viewDidLoad];
tabBarController_ = [[UITabBarController alloc] init];
tabBarController_.delegate = self;
tabBarController_.viewControllers = [NSArray arrayWithObjects:a, b, c, nil];
tabBarController_.selectedViewController = a;
tabBarController_.view.frame = self.view.bounds;
[self.view addSubview:tabBarController_.view];
}
@xenop
xenop / gist:6863614
Created October 7, 2013 07:06
cell sample
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
CustomeCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSDictionary *d = _dataSource[indexPath.row];
if ([d[@"count"] intValue] == 0) {
cell.nameLabel.hidden = YES;
}else{
cell.nameLabel.hidden = NO;
}
return cell;
class Test{
public static void main(String args[]){
int n[][] = {{1, 2, 3, 4}, {10, 11, 12, 13}};
System.out.println(n[0].length);
int m[] = n[0];
System.out.println(m.length); // n[0].lengthと一緒
}
}