Zip files

Data Mining
CS 510 (DM)
Winter,2004
home | news | site map
review | project | subject | group
weka | mining | gawk | bash
modeling | reference | pods
Display: big | small

Why all the scripting?
 copyleft() { cat<<-EOF
zips: build a zip of all files mentioned in all files
Copyright (C) 2004 Tim Menzies

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. EOF}

[TOP]


Usage

 usage() {
        cat<<-EOF
        Usage: zips [FILE]
        Generate zip files for all files refernces in sitemap.sh.
        If the optional FILE parameter is given, then just generate a zip
        for FILE.
        EOF
 }

Installation

First, install the files tool: http://www.cs.pdx.edu/~timm/dm/files.html.

Second, copy the following files to your own directory from http://www.cs.pdx.edu/~timm/dm/zips.zip: http://www.cs.pdx.edu/~timm/dm/zips; and http://www.cs.pdx.edu/~timm/dm/config; and http://www.cs.pdx.edu/~timm/dm/sitemap.sh.

Make zips and config executable:

 chmod +x zips config

Edit your this file and config. The first line of this file should point to your local bash shell. and you'll need to check at least the #paths sectionin config

[TOP]


Source code

Settings

Paths:

 ##config
 #paths
 pkgs="/pkgs/gnu/bin"
 gnuplot="$pkgs/gnuplot-3.7"
 export PAGER="/pkgs/gnu/bin/less"
 export AWKPATH="$HOME/public_html/dm"
 wget="$pkgs/wget"
 gawk="$pkgs/gawk"
 less="$pkgs/less"
 tmp="/tmp/$$"
 zip="/usr/local/bin/zip -q "
 java="/pkgs/jdk1.4.2/bin/java"
 jar="/pkgs/jdk1.4.2/bin/jar"
 #data sets
 data="/u/timm/public_html/dm/data"
 discretes="$data/somediscretedatasets.dat"
 numerics="$data/somenumericdatasets.dat"
 #weka stuff 
 wekajar="/pkgs/weka/weka-3-2-3/weka.jar"
 oner="weka.classifiers.OneR -B 6"
 j48="weka.classifiers.j48.J48 -C 0.25 -M 2"
 bayes="weka.classifiers.NaiveBayes"
 bayeske="weka.classifiers.NaiveBayes -k"
 modeltree="weka.classifiers.m5.M5Prime -O m -F 2.0 -V 0"
 lsr="weka.classifiers.m5.M5Prime -O l -F 2.0 -V 0"
 regressionTree="weka.classifiers.m5.M5Prime -O r -F 2.0 -V 0"
 nways="weka.filters.SplitDatasetFilter"
 . config

Get sitemap

 . sitemap.sh

Main

This code loads the sitemap.sh file, then redefines the head(), section() and pod() commands. Now, when sitemap is called, zips are created for all the first arguments passed to pod.

 next()    { true; }
 section() { true; }
 pod() { 
          [ -n "$goal" ] && [ "$goal" != "$1" ] && return 0
          stem=${1%.*}
          zipfile=$stem.zip
          echo "$1 ==> $zipfile"
          files2zip=`files $1`
          if [ -f "$stem.zip" ]
          then rm $stem.zip
          fi
          $zip $stem.zip $files2zip
          chmod a+r $stem.zip
 }

Start-up

 [ -n "$1" ] && goal="$1"
 sitemap

[TOP]


Credits

Author

Tim Menzies , tim@menzies.us, http://menzies.us

Software

This page generated by Site: see http://www.cs.pdx.edu/~timm/dm/site.html

Acknowledgements

This site is built using PerlPod.

Style sheet switching method taken from Eddie Traversa's excellent and simple-to-apply tutorial: http://dhtmlnirvana.com/content/styleswitch/styleswitch1.html.

Search engine powered by ATOMZ http://www.atomz.com/search/. Note, the indexes to this site are only updated weekly (heh, its a free service- what more ja want?).

Icons on this site come from http://www.sql-news.de/rubriken/olap.asp and http://www.ifnet.it/webif/centrodi/eng/toolbar.htm.

The JAVA machine learners used at this site come from the extensive data mining libraries found in the University of Waikato's Environment for Knowledge Analysis (the WEKA) http://www.cs.waikato.ac.nz/ml/weka/

[TOP]


Legal

Copyright

Copyright (C) Tim Menzies 2004

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2; see http://www.gnu.org/copyleft/gpl.html. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Disclaimer

The content from or through this web page are provided 'as is' and the author makes no warranties or representations regarding the accuracy or completeness of the information. Your use of this web page and information is at your own risk. You assume full responsibility and risk of loss resulting from the use of this web page or information. If your use of materials from this page results in the need for servicing, repair or correction of equipment, you assume any costs thereof. Follow all external links at your own risk and liability.

[TOP]