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 urllib2 | |
| from BeautifulSoup import BeautifulSoup | |
| import httplib | |
| import urlparse | |
| def httpExists(url): | |
| host, path = urlparse.urlsplit(url)[1:3] | |
| found = 0 | |
| try: |
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
| #coding:utf-8 | |
| ''' | |
| 模拟登陆163邮箱并下载邮件内容 | |
| ''' | |
| import urllib | |
| import urllib2 | |
| import cookielib | |
| import re | |
| import time | |
| import json |
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
| #!/usr/bin/env python | |
| #-*- coding:utf-8 -*- | |
| """ | |
| copy the UI of site specified by user | |
| """ | |
| import sys | |
| reload(sys) | |
| sys.setdefaultencoding('utf-8') |
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
| # -*- coding: cp936 -*- | |
| import urllib2 | |
| import md5 | |
| import base64 | |
| import json | |
| import time | |
| from urllib import quote_plus | |
| def httpReady(url,data=None,cookie=None): |
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
| int maxSequenceCount( int a[], int n ) | |
| { | |
| int count[2] = {0}; | |
| for( int i = 0; i < n; i++ ) | |
| { | |
| count[ a[i] ]++; | |
| } | |
| int start = 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
| #include <iostream> | |
| using namespace std; | |
| void change(int*, int); | |
| int main() { | |
| cout << "hello" << endl; | |
| int a[] = {1, -2, 3, -4, -5, -6, -7, 8, 9, 4, 10, 11, 12}; | |
| int len = sizeof(a)/sizeof(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
| void printTriplet(const int a[], int n) | |
| { | |
| for( int x = 0; x < n ; x ++ ) | |
| { | |
| for( int y = 0; y < n; y ++ ) | |
| { | |
| result[x][y] = a[x] + a[y]; | |
| processed[x][y] = false; | |
| } | |
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<stdlib.h> | |
| #include<string.h> | |
| char a[]="0100111"; // string to be inserted | |
| struct node { // tree to be formed | |
| char c; | |
| struct node *left,*right; | |
| }; | |
| typedef struct node node; | |
| void inorder(node *head) |
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
| the gist command test. |
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
| this is the first gist. |