If you want to download multiple problems
- Install gettc
- Select your desired subset of problems from here and download the html files.
- Say list*.html saves the list of problems. The following steps extract the problem ID's from the html files.-  grep -o 'pm=[0-9]*' list*.html > tmp.txt 
- Edit tmp.txt using vim and keep only the problem ID's.
-  cat tmp.txt | sort -u > list.txt 
 
 
 
 
 Now the file list.txt contains unique problem ID's.
-  
- Download the problems from Topcoder using the following command.
for num in `cat list.txt`; do gettc $num; done
To create an ebook for reading in Kindle
- Create a dir called 'tmp'
- Run the following command
-  Change to tmp, and generate index.html using the following scriptsecho "<ul>" > index.html find . | grep html | sort > tmplist.txt for file in `cat tmplist.txt`; do name=`echo $file | awk -F/ '{print $2}'` echo "<li><a href=\"$file\">$name</a></li>" >> index.html done echo "</ul>" >> index.html rm tmplist.txt
- Zip the directory 'tmp' and feed it to Calibre.
for dir in `ls`; do mkdir tmp/$dir; cp -a $dir/prob tmp/$dir/; done
 
1 comment:
Can u please tell this for windows also.
Post a Comment