blob: 9ec52da665ffbd95a2ba375e2f7bdaf9e89edd2a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#! /bin/bash
FULLPATH=$(readlink -f $0)
DST=${FULLPATH%/*}/algs4
mkdir -p $DST
pushd $DST
mkdir bin
wget http://algs4.cs.princeton.edu/code/stdlib.jar
wget http://algs4.cs.princeton.edu/code/algs4.jar
wget http://algs4.cs.princeton.edu/linux/checkstyle.zip
wget http://algs4.cs.princeton.edu/linux/findbugs.zip
unzip checkstyle.zip
rm checkstyle.zip
unzip findbugs.zip
rm findbugs.zip
wget http://algs4.cs.princeton.edu/linux/checkstyle.xml
wget http://algs4.cs.princeton.edu/linux/findbugs.xml
wget http://algs4.cs.princeton.edu/linux/checkstyle
wget http://algs4.cs.princeton.edu/linux/findbugs
wget http://algs4.cs.princeton.edu/linux/config.sh
chmod 700 checkstyle findbugs config.sh
mv checkstyle findbugs config.sh bin
mv checkstyle.xml checkstyle-5.5
mv findbugs.xml findbugs-2.0.1
sed -i "s'INSTALL=.*$'INSTALL=$DST'" $DST/bin/checkstyle
sed -i "s'INSTALL=.*$'INSTALL=$DST'" $DST/bin/findbugs
sed -i "s'\(if \[.*$\)'\1\n\n\tDST=$DST'" $DST/bin/config.sh
sed -i "s'HOME\/algs4'DST'g" $DST/bin/config.sh
popd
(cat << EOF
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
EOF
) > HelloWorld.java && javac HelloWorld.java && java -cp . HelloWorld
$DST/bin/checkstyle HelloWorld.java
$DST/bin/findbugs HelloWorld.class
rm HelloWorld.java HelloWorld.class
echo "now point to:"
echo " http://algs4.cs.princeton.edu/code/"
echo " http://algs4.cs.princeton.edu/home/"
echo " https://class.coursera.org/algs4partI-002/class/index"
echo " http://coursera.cs.princeton.edu/algs4/testing/percolation/"
echo " http://coursera.cs.princeton.edu/algs4/testing/collinear/"
echo " http://coursera.cs.princeton.edu/algs4/testing/8puzzle/"
echo " http://coursera.cs.princeton.edu/algs4/testing/kdtree/"
|