This file contains hidden or 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 main() | |
{ | |
try | |
{ | |
throw(1); | |
int a = 1 / 0; |
This file contains hidden or 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 os | |
import sys | |
import zipfile | |
print "Processing File " + sys.argv[1] | |
file=zipfile.ZipFile(sys.argv[1],"r"); | |
for name in file.namelist(): | |
utf8name=name.decode('gbk') | |
print "Extracting " + utf8name |
This file contains hidden or 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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
struct link_list | |
{ | |
int key; | |
struct link_list *next; | |
}; |
This file contains hidden or 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
function [maxtab, mintab]=peakdet(v, delta, x) | |
%PEAKDET Detect peaks in a vector | |
% [MAXTAB, MINTAB] = PEAKDET(V, DELTA) finds the local | |
% maxima and minima ("peaks") in the vector V. | |
% MAXTAB and MINTAB consists of two columns. Column 1 | |
% contains indices in V, and column 2 the found values. | |
% | |
% With [MAXTAB, MINTAB] = PEAKDET(V, DELTA, X) the indices | |
% in MAXTAB and MINTAB are replaced with the corresponding | |
% X-values. |
This file contains hidden or 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 listparser as lp | |
d = lp.parse('subscriptions.xml') | |
n = len(d.feeds) | |
print("Total Feeds =", n) | |
for i in range(0, n): | |
print(d.feeds[i].url) | |
#print(d.feeds[100].url) |
This file contains hidden or 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 <vector> | |
#include <list> | |
#include <map> | |
#include <set> | |
#include <deque> | |
#include <stack> | |
#include <bitset> | |
#include <algorithm> | |
#include <functional> | |
#include <numeric> |
This file contains hidden or 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 <vector> | |
#include <list> | |
#include <map> | |
#include <set> | |
#include <deque> | |
#include <stack> | |
#include <bitset> | |
#include <algorithm> | |
#include <functional> | |
#include <numeric> |
This file contains hidden or 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 <stdlib.h> | |
#include <stdio.h> | |
/* Create a lambda function. Note: unlike lambdas in functional | |
languages, this lambda does not capture the containing | |
environment. Thus, if you access the enclosing environment, you | |
must ensure that the lifetime of this lambda is bound by the | |
lifetime of the enclosing environment (i.e., until the enclosing | |
function returns). This means that if you access local |
This file contains hidden or 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 <stdio.h> | |
#include <math.h> | |
#define clear 1;if(c>=11){c=0;sscanf(_,"%lf%c",&r,&c);while(*++_-c);}\ | |
else if(argc>=4&&!main(4-(*_++=='('),argv))_++;g:c+= | |
#define puts(d,e) return 0;}{double a;int b;char c=(argc<4?d)&15;\ | |
b=(*_%__LINE__+7)%9*(3*e>>c&1);c+= | |
#define I(d) (r);if(argc<4&&*#d==*_){a=r;r=usage?r*a:r+a;goto g;}c=c | |
#define return if(argc==2)printf("%f\n",r);return argc>=4+ | |
#define usage main(4-__LINE__/26,argv) | |
#define calculator *_*(int) |
This file contains hidden or 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
const int dx[4] = {0, 0, 1, -1}; | |
const int dy[4] = {1, -1, 0, 0}; | |
class Solution { | |
public: | |
void solve(vector< vector<char> > &board); | |
}; | |
void Solution::solve(vector< vector<char> > &board) { | |
int n = board.size(); |