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
#include <iostream> | |
using namespace std; | |
int fac(int n) { | |
if(n<=0) | |
return 1; | |
else | |
return n*fac(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
ph2=Phone.objects.create(person=p1,area_code='770',number='1234567'); |
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
{% include "table_frag.html" %} |
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
typedef std::function<bool(int)> Set; | |
typedef std::function<bool(int)> Predicate; |
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); |
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
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
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
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
hadoop dfs -copyFromLocal texts /user/hduser/texts | |
hadoop dfs -ls /user/hduser/texts |
OlderNewer