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
retry_times(5,lambda{ || return 1/0;}) |
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 TTTViewController : UIViewController { | |
UIImage* imgs[2]; | |
} | |
@property IBOutletCollection(UIButton) NSArray*board; | |
@property IBOutlet UIImageView* currentPlayerView; | |
@property int currentPlayer; | |
@property boolean_t playing; | |
-(IBAction)cellPressed:(id)sender; | |
-(IBAction)restartGame:(id)sender; |
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 <UIKit/UIKit.h> | |
@interface TempViewController : UIViewController | |
@property(weak,nonatomic) IBOutlet UITextField* fahrenheit; | |
@property(weak,nonatomic) IBOutlet UILabel* celsius; | |
-(IBAction) convertToCelsius:(id)sender; | |
@end |
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 <UIKit/UIKit.h> | |
@interface ViewController : UIViewController | |
@property IBOutlet UIImageView* imgView; | |
@property NSArray* images; | |
-(IBAction)propertyAnimation:(id)sender; | |
-(IBAction)cellAnimation:(id)sender; |
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
hadoop dfs -copyFromLocal texts /user/hduser/texts | |
hadoop dfs -ls /user/hduser/texts |
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
unsigned factorial(unsigned n) | |
{ | |
if(n==0) | |
return 1; | |
else | |
return n*factorial(n-1); | |
} | |
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
protected void AddBlog_Click(object sender, EventArgs e) | |
{ | |
SimpleBlogDataContext ctx = new SimpleBlogDataContext(); | |
Blog b = new Blog(); | |
b.Title = BlogTitle.Text; | |
ctx.Blogs.InsertOnSubmit(b); | |
try | |
{ | |
ctx.SubmitChanges(); | |
} |
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 feedparser | |
f=open('blogroll.html','w') | |
f.write("<html>\n<head>\n<title>Blogroll</title>\n</head>\n<body>"); | |
blogs=["http://programminggenin.blogspot.com/feeds/posts/default","http://djangolearner.blogspot.com/feeds/posts/default"]; | |
for blog in blogs : | |
feed=feedparser.parse(blog) | |
f.write('<a href="%s">%s</a>\n'% (feed.feed.link,feed.feed.title)); | |
f.write('<ul>\n'); | |
for e in feed.entries: |
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
conn=boto.connect_dynamodb() # if set in ~/.boto | |
# or | |
conn = boto.connect_dynamodb(aws_access_key_id='...',aws_secret_access_key='...') |
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
template<typename T> | |
struct ConsNode { | |
public: | |
ConsNode(T car=T(), ConsList<T> cdr=ConsList<T>()):_car(car),_cdr(cdr) {} | |
private: | |
T _car; | |
ConsList<T> _cdr; | |
friend T car<>(const ConsList<T> &l); | |
friend const ConsList<T>& cdr<>(const ConsList<T> &l); |