This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clone_table(old_table_name, new_table_name, split_keys=nil) | |
admin = HBaseAdmin.new(HBaseConfiguration.new()) | |
td = admin.getTableDescriptor(old_table_name.to_java_bytes) | |
td.setName(new_table_name.to_java_bytes) | |
if split_keys.nil? | |
admin.createTable(td) | |
else | |
new_keys = Java::byte[][split_keys.size].new | |
split_keys.each_index {|i| new_keys[i] = split_keys[i].to_java_bytes} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface NSArray (EnumerableStuff) | |
/** | |
* similar to a map | |
*/ | |
- (NSArray *) objectsTransformedByBlock:(id (^)(id, NSUInteger, BOOL *))block; | |
/** | |
* filter the array | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface NSArray (EnumerableExtras) | |
/** | |
* similar to a map | |
*/ | |
- (NSArray *) objectsTransformedByBlock:(id (^)(id obj, NSUInteger idx, BOOL *stop))block; | |
/** | |
* filter the array | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "NSIndexPath+RowSectinCache.h" | |
@interface PairIndexPath : NSObject { | |
@private | |
NSUInteger indexes[2]; | |
} | |
- (NSUInteger)length; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import redis | |
from cStringIO import StringIO | |
import weakref | |
import contextlib | |
from collections import deque | |
def main(): | |
c = PipesClient('localhost') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CCBlockTableViewDataSource.h | |
// | |
// Created by Tristan O'Tierney on 1/24/11. | |
// | |
#import <UIKit/UIKit.h> | |
@interface CCBlockTableViewDataSource : NSObject <UITableViewDataSource, UITableViewDelegate> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
sphinx.domains.objc | |
~~~~~~~~~~~~~~~~~~~ | |
The Objective C domain. | |
""" | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PGGeometry.hh | |
// PonyGrid | |
// | |
// Created by Mike Lewis on 9/23/11. | |
// Copyright (c) 2011 Square, Inc. All rights reserved. | |
// | |
#ifndef PonyGrid_PGGeometry_hh | |
#define PonyGrid_PGGeometry_hh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//line simplegram.y:2 | |
package main | |
//line simplegram.y:6 | |
type yySymType struct { | |
yys int | |
core_yystype core_YYSTYPE | |
/* these fields must match core_YYSTYPE: */ | |
ival int | |
str string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop schema if exists foo cascade; | |
create schema foo; | |
CREATE TABLE foo.object ( | |
id uuid primary key, | |
version int4 not null | |
); | |
CREATE TABLE foo.items_base ( |