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 | |
""" | |
grspider.py ----- A spider to get gnma remic prospectuses list | |
author: Leslie Zhu | |
email: pythonisland@gmail.com | |
In GNMA Agency webiste http://www.ginniemae.gov/, there are some remic prospectuses published by month. | |
Like url : | |
http://www.ginniemae.gov/doing_business_with_ginniemae/investor_resources/prospectuses/Pages/remic_prospectuses.aspx |
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 bash | |
# dumpftp.sh ---- download ftp website files | |
# | |
# author: Leslie Zhu <[email protected]> | |
# date: 2014/11/11 | |
# | |
# Get each href element in each html page, if it's a plain file, then download it; | |
# else if it's a dir, then get its href element and download them. | |
# |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<rss version="2.0"> | |
<channel> | |
<title>博客名字</title> | |
<link>博客网址</link> | |
<description> | |
<![CDATA[ 博客简介]]> | |
</description> |
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 -*- | |
import os,sys,re,time | |
_rss_ = "http://lesliezhu.github.com/rss.xml" | |
_dirs_ = ["Notes"] # only RSS Feed 'Notes' | |
def gen_url(dir=""): |
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
%option noyywrap | |
%{ | |
int ch_c = 0; | |
int word_c = 0; | |
int line_c = 0; | |
%} | |
fix [\ \,\;\.\}\{\)\(\n\:\#\%\-\+\*\&\^\$\!\~\`\=] |
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
%option noyywrap | |
types auto|enum|unsigned|void|float|short|volatile|char|signed|const|int|double|long | |
control break|return|case|for|while|goto|continue|if|do|switch|else | |
other extern|sizeof|static|default|struct|typedef|register|union | |
keywords {types}|{control}|{other} | |
prefix [ \,\;\{\}\(\)\t\n\#] | |
suffix [ \,\;\{\}\(\)\t\n\:\*] |
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
%option noyywrap | |
%% | |
"/*" ECHO;{ | |
register int c,prev_c; | |
for ( ; ; ){ | |
while ( (c = input()) != '*' && c != EOF ){ | |
printf("%c",toupper(c)); |
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
%option noyywrap | |
%{ | |
/* a Lex program that adds line numbers | |
to lines of text, printing the new text | |
to the standard output | |
*/ | |
#include <stdio.h> | |
int lineno = 1; | |
%} |
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 -*- | |
""" | |
upper-keyword.py ------- Change C source keyword which not in comment to UPPER. | |
Author: Leslie Zhu | |
Email: pythonisland@gmail.com | |
Version: 1.0 |
NewerOlder