Skip to content

Instantly share code, notes, and snippets.

View dalang's full-sized avatar

大浪 dalang

  • Dada Group
  • Shanghai
View GitHub Profile
@dalang
dalang / get_baidu_poi.pl
Created May 11, 2013 17:18
parse data from baidu map, parse for "苍南合作银行" sites info and output these info into a file
#! /usr/bin/perl
use HTML::Element;
use HTML::TreeBuilder;
use Encode;
#binmode DATA, "utf8";
#$tree->parse_file(\*DATA);
#print Dumper($tree), "\n";
@dalang
dalang / get_full_teamname.pl
Created May 11, 2013 17:15
get nba full teamname from an html file, parse it and print in "key(abb teamname) : value(full teamname)" format get nba teamname from html code from espn.com
#!/usr/bin/perl
open(IFILE, "<fullteamname.html");
open(FILE, ">_ftn.txt");
while(<IFILE>) {
chomp();
if ($_ =~ /<h4>(\w+?)<\/h4>/) {
$sec = $1;
print $sec;
@dalang
dalang / contact_excel.pl
Created May 11, 2013 17:12
edit excel file and save as a new file with ParseExcel Package parse crscy contact excel file and output contact info in xml format
#! /usr/bin/perl
use strict;
use Spreadsheet::ParseExcel;
use Spreadsheet::ParseExcel::FmtUnicode; #◊÷∑˚±‡¬Î
open(FILE, '>_ftn.txt');
syswrite(FILE, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n
<list>\n");
@dalang
dalang / add_extension_name.pl
Created May 11, 2013 17:09
##file operation## delete tmp bakup files under windows(file name end with '~') add extension name to all file under dir .
#! usr/bin/perl
@files = <*>;
if (!$_[0]) {
$extension = '.png';
} else {
$extension = $_[0];
}
foreach $file (@files) {
@dalang
dalang / copy.pl
Created May 11, 2013 17:07
copy data from one file to another file line for line
#!/usr/bin/perl
open(IFILE, "<index.html");
open(FILE, ">_tmpfile.txt");
while(<IFILE>) {
chomp();
syswrite(FILE, $_);
syswrite(FILE, "\n");
}
@dalang
dalang / build_teamlogo_css.pl
Created May 11, 2013 17:00
load data from a array, ouput css code into a file
#!/usr/bin/perl
@NBAABB = ('atl', 'bos', 'bkn', 'cha', 'chi', 'cle', 'dal', 'den', 'det', 'gsw', 'hou', 'ind', 'lac', 'lal', 'mem', 'mia', 'mil', 'min', 'nor', 'nyk', 'okc', 'orl', 'phi', 'pho', 'por', 'sac', 'sas', 'tor', 'uth', 'was');
open(FILE, ">_1tmpfile.txt");
foreach (@NBAABB) {
chomp;
#syswrite(FILE, '.' .$_. "-theme {\n");
@dalang
dalang / helloworld
Created May 8, 2013 03:18
farbox markdown syntax showing code block
# Hello World
This is your first post!
:::python
import this
print 'life is short, we need python!'
...
@dalang
dalang / AndroidManifest.xml
Created September 28, 2012 08:10
For Android basic knowledge training in CRSCY
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.dalang.hello"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"