19 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
20 |
21 | Link toNon-frame version.
19 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
20 |
21 | Link toNon-frame version.
The application is completely based on servlets, all HTML is generated by them. Every servlet represents one of the 14 TPC-W bookstore actions.
65 |
66 | Here are the servlets and some supporting classes (TPCW_say_hello, TPCW_promotional_processing) as a class diagramm:
67 |
68 |
69 |
70 | The following class diagram shows all general supporting classes for the servlets.
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBFactory.java:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | * rbe.EBFactory.java
3 | * Timothy Heil
4 | * 10/5/99
5 | *
6 | * Produces EBs.
7 | *
8 | * An abstract class.
9 | *------------------------------------------------------------------------
10 | *
11 | * This is part of the the Java TPC-W distribution,
12 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
13 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
14 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
15 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
16 | *
17 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
18 | * Eric Weglarz, Todd Bezenek.
19 | *
20 | * This source code is distributed "as is" in the hope that it will be
21 | * useful. It comes with no warranty, and no author or distributor
22 | * accepts any responsibility for the consequences of its use.
23 | *
24 | * Everyone is granted permission to copy, modify and redistribute
25 | * this code under the following conditions:
26 | *
27 | * This code is distributed for non-commercial use only.
28 | * Please contact the maintainer for restrictions applying to
29 | * commercial use of these tools.
30 | *
31 | * Permission is granted to anyone to make or distribute copies
32 | * of this code, either as received or modified, in any
33 | * medium, provided that all copyright notices, permission and
34 | * nonwarranty notices are preserved, and that the distributor
35 | * grants the recipient permission for further redistribution as
36 | * permitted by this document.
37 | *
38 | * Permission is granted to distribute this code in compiled
39 | * or executable form under the same conditions that apply for
40 | * source code, provided that either:
41 | *
42 | * A. it is accompanied by the corresponding machine-readable
43 | * source code,
44 | * B. it is accompanied by a written offer, with no time limit,
45 | * to give anyone a machine-readable copy of the corresponding
46 | * source code in return for reimbursement of the cost of
47 | * distribution. This written offer must permit verbatim
48 | * duplication by anyone, or
49 | * C. it is distributed by someone who received only the
50 | * executable form, and is accompanied by a copy of the
51 | * written offer of source code that they received concurrently.
52 | *
53 | * In other words, you are welcome to use, share and improve this codes.
54 | * You are forbidden to forbid anyone else to use, share and improve what
55 | * you give them.
56 | *
57 | ************************************************************************/
58 |
59 | package rbe;
60 |
61 | public abstract class EBFactory {
62 | public abstract EB getEB(RBE rbe);
63 | public int initialize(String [] args, int firstArg) {return(firstArg);};
64 | }
65 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBBInitTrans.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * rbe.EBBInitTrans.java
3 | * Timothy Heil
4 | * 10/26/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * TPC-B Dummy initial transition.
9 | *------------------------------------------------------------------------
10 | *
11 | * This is part of the the Java TPC-W distribution,
12 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
13 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
14 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
15 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
16 | *
17 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
18 | * Eric Weglarz, Todd Bezenek.
19 | *
20 | * This source code is distributed "as is" in the hope that it will be
21 | * useful. It comes with no warranty, and no author or distributor
22 | * accepts any responsibility for the consequences of its use.
23 | *
24 | * Everyone is granted permission to copy, modify and redistribute
25 | * this code under the following conditions:
26 | *
27 | * This code is distributed for non-commercial use only.
28 | * Please contact the maintainer for restrictions applying to
29 | * commercial use of these tools.
30 | *
31 | * Permission is granted to anyone to make or distribute copies
32 | * of this code, either as received or modified, in any
33 | * medium, provided that all copyright notices, permission and
34 | * nonwarranty notices are preserved, and that the distributor
35 | * grants the recipient permission for further redistribution as
36 | * permitted by this document.
37 | *
38 | * Permission is granted to distribute this code in compiled
39 | * or executable form under the same conditions that apply for
40 | * source code, provided that either:
41 | *
42 | * A. it is accompanied by the corresponding machine-readable
43 | * source code,
44 | * B. it is accompanied by a written offer, with no time limit,
45 | * to give anyone a machine-readable copy of the corresponding
46 | * source code in return for reimbursement of the cost of
47 | * distribution. This written offer must permit verbatim
48 | * duplication by anyone, or
49 | * C. it is distributed by someone who received only the
50 | * executable form, and is accompanied by a copy of the
51 | * written offer of source code that they received concurrently.
52 | *
53 | * In other words, you are welcome to use, share and improve this codes.
54 | * You are forbidden to forbid anyone else to use, share and improve what
55 | * you give them.
56 | *
57 | ************************************************************************/
58 |
59 | package rbe;
60 |
61 | public class EBBInitTrans extends EBTransition {
62 |
63 | public String request(EB eb, String html) {
64 | return(RBE.www1 + "tpca/tpca.html");
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBWWWTrans.java:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------------------------
2 | * rbe.EBWWWTrans.java
3 | * Timothy Heil
4 | * 10/5/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * A simple transition that just provides a static URL.
9 | *------------------------------------------------------------------------
10 | *
11 | * This is part of the the Java TPC-W distribution,
12 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
13 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
14 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
15 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
16 | *
17 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
18 | * Eric Weglarz, Todd Bezenek.
19 | *
20 | * This source code is distributed "as is" in the hope that it will be
21 | * useful. It comes with no warranty, and no author or distributor
22 | * accepts any responsibility for the consequences of its use.
23 | *
24 | * Everyone is granted permission to copy, modify and redistribute
25 | * this code under the following conditions:
26 | *
27 | * This code is distributed for non-commercial use only.
28 | * Please contact the maintainer for restrictions applying to
29 | * commercial use of these tools.
30 | *
31 | * Permission is granted to anyone to make or distribute copies
32 | * of this code, either as received or modified, in any
33 | * medium, provided that all copyright notices, permission and
34 | * nonwarranty notices are preserved, and that the distributor
35 | * grants the recipient permission for further redistribution as
36 | * permitted by this document.
37 | *
38 | * Permission is granted to distribute this code in compiled
39 | * or executable form under the same conditions that apply for
40 | * source code, provided that either:
41 | *
42 | * A. it is accompanied by the corresponding machine-readable
43 | * source code,
44 | * B. it is accompanied by a written offer, with no time limit,
45 | * to give anyone a machine-readable copy of the corresponding
46 | * source code in return for reimbursement of the cost of
47 | * distribution. This written offer must permit verbatim
48 | * duplication by anyone, or
49 | * C. it is distributed by someone who received only the
50 | * executable form, and is accompanied by a copy of the
51 | * written offer of source code that they received concurrently.
52 | *
53 | * In other words, you are welcome to use, share and improve this codes.
54 | * You are forbidden to forbid anyone else to use, share and improve what
55 | * you give them.
56 | *
57 | ************************************************************************/
58 |
59 | package rbe;
60 |
61 | public class EBWWWTrans extends EBTransition {
62 |
63 | public String request(EB eb, String html) {
64 | return(RBE.www1);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/docs/api/servlets/allclasses-noframe.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | All Classes
8 |
9 |
10 |
11 |
17 |
18 |
19 | All Classes
20 |
21 |
22 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/tpcw/rbe/args/Arg.java~:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | * rbe.args.Arg
3 | * Timothy Heil
4 | * 10/29/99
5 | *
6 | * Abstract command line argument parsing class.
7 | *------------------------------------------------------------------------*/
8 |
9 | package rbe.args;
10 |
11 | import rbe.util.Pad;
12 |
13 | public abstract class Arg {
14 | private String arg; // Command line -arg name.
15 | private String name; // Descriptive name.
16 | private String desc; // Description.
17 |
18 | protected boolean set; // Whether this argument was set.
19 | protected boolean req; // This argument must be set.
20 | protected boolean def; // This argument has a default value.
21 |
22 | public Arg(String arg, String name, String desc,
23 | boolean req, boolean def, ArgDB db) {
24 | init(arg, name, desc, req, def);
25 | db.add(this);
26 | }
27 |
28 | public Arg(String arg, String name, String desc,
29 | boolean req, boolean def) {
30 | init(arg, name, desc, req, def);
31 | }
32 |
33 | private void init(String arg, String name, String desc,
34 | boolean req, boolean def) {
35 | this.arg = arg.toUpperCase();
36 | this.name = name;
37 | this.desc = desc;
38 | this.req = req;
39 | this.def = def;
40 | set = false;
41 | }
42 |
43 | public final boolean set() { return(set); };
44 | public final boolean required() { return(req); };
45 |
46 | public final int parse(String [] args, int a)
47 | throws Arg.Exception
48 | {
49 | if (arg.equals(args[a].toUpperCase())) {
50 | set = true;
51 | try {
52 | return(parseMatch(args, a+1));
53 | }
54 | catch (Exception e) {
55 | e.start = a;
56 | throw(e);
57 | }
58 | }
59 | else {
60 | return(a);
61 | }
62 | }
63 |
64 | public String toString() {
65 | String v;
66 | if (set) {
67 | v = value();
68 | }
69 | else {
70 | if (req) {
71 | v = "required";
72 | }
73 | else if (def) {
74 | v = value() + " (default)";
75 | }
76 | else {
77 | v = "unset";
78 | }
79 | }
80 | return(Pad.l(8, arg) + " " + Pad.l(25, name) + " " +
81 | Pad.l(20, v) + "\n " + desc);
82 | }
83 |
84 | // Customize to parse arguments.
85 | protected abstract int parseMatch(String [] args, int a)
86 | throws Arg.Exception
87 | ;
88 |
89 | // Customize to produce String describing current value.
90 | protected abstract String value();
91 |
92 |
93 | // Throw one of these (or sub-class) for any parse errors.
94 | public static class Exception extends java.lang.Exception {
95 | public int start, end;
96 |
97 | public Exception(String message, int a) {
98 | super( message);
99 | this.end = a;
100 | }
101 |
102 | public String getMessage() {
103 | return(super.getMessage() +
104 | " arguments(" + (start+1) + " to " + (end+1) + ")");
105 | }
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBWSearchReqTrans.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * rbe.EBWSearchReqTrans.java
3 | * Timothy Heil
4 | * 10/13/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * TPC-W search request transition. Supplies the URL for the page.
9 | *------------------------------------------------------------------------
10 | *
11 | * This is part of the the Java TPC-W distribution,
12 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
13 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
14 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
15 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
16 | *
17 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
18 | * Eric Weglarz, Todd Bezenek.
19 | *
20 | * This source code is distributed "as is" in the hope that it will be
21 | * useful. It comes with no warranty, and no author or distributor
22 | * accepts any responsibility for the consequences of its use.
23 | *
24 | * Everyone is granted permission to copy, modify and redistribute
25 | * this code under the following conditions:
26 | *
27 | * This code is distributed for non-commercial use only.
28 | * Please contact the maintainer for restrictions applying to
29 | * commercial use of these tools.
30 | *
31 | * Permission is granted to anyone to make or distribute copies
32 | * of this code, either as received or modified, in any
33 | * medium, provided that all copyright notices, permission and
34 | * nonwarranty notices are preserved, and that the distributor
35 | * grants the recipient permission for further redistribution as
36 | * permitted by this document.
37 | *
38 | * Permission is granted to distribute this code in compiled
39 | * or executable form under the same conditions that apply for
40 | * source code, provided that either:
41 | *
42 | * A. it is accompanied by the corresponding machine-readable
43 | * source code,
44 | * B. it is accompanied by a written offer, with no time limit,
45 | * to give anyone a machine-readable copy of the corresponding
46 | * source code in return for reimbursement of the cost of
47 | * distribution. This written offer must permit verbatim
48 | * duplication by anyone, or
49 | * C. it is distributed by someone who received only the
50 | * executable form, and is accompanied by a copy of the
51 | * written offer of source code that they received concurrently.
52 | *
53 | * In other words, you are welcome to use, share and improve this codes.
54 | * You are forbidden to forbid anyone else to use, share and improve what
55 | * you give them.
56 | *
57 | ************************************************************************/
58 |
59 | package rbe;
60 |
61 | public class EBWSearchReqTrans extends EBTransition {
62 |
63 | public String request(EB eb, String html) {
64 | RBE rbe = eb.rbe;
65 |
66 | return(eb.addIDs(rbe.searchReqURL));
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBWOrderInqTrans.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * rbe.EBWOrderInqTrans.java
3 | * Timothy Heil
4 | * 10/13/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * TPC-W Order Inquiry transition. Supplies the order inquiry page URL.
9 | *------------------------------------------------------------------------
10 | *
11 | * This is part of the the Java TPC-W distribution,
12 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
13 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
14 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
15 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
16 | *
17 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
18 | * Eric Weglarz, Todd Bezenek.
19 | *
20 | * This source code is distributed "as is" in the hope that it will be
21 | * useful. It comes with no warranty, and no author or distributor
22 | * accepts any responsibility for the consequences of its use.
23 | *
24 | * Everyone is granted permission to copy, modify and redistribute
25 | * this code under the following conditions:
26 | *
27 | * This code is distributed for non-commercial use only.
28 | * Please contact the maintainer for restrictions applying to
29 | * commercial use of these tools.
30 | *
31 | * Permission is granted to anyone to make or distribute copies
32 | * of this code, either as received or modified, in any
33 | * medium, provided that all copyright notices, permission and
34 | * nonwarranty notices are preserved, and that the distributor
35 | * grants the recipient permission for further redistribution as
36 | * permitted by this document.
37 | *
38 | * Permission is granted to distribute this code in compiled
39 | * or executable form under the same conditions that apply for
40 | * source code, provided that either:
41 | *
42 | * A. it is accompanied by the corresponding machine-readable
43 | * source code,
44 | * B. it is accompanied by a written offer, with no time limit,
45 | * to give anyone a machine-readable copy of the corresponding
46 | * source code in return for reimbursement of the cost of
47 | * distribution. This written offer must permit verbatim
48 | * duplication by anyone, or
49 | * C. it is distributed by someone who received only the
50 | * executable form, and is accompanied by a copy of the
51 | * written offer of source code that they received concurrently.
52 | *
53 | * In other words, you are welcome to use, share and improve this codes.
54 | * You are forbidden to forbid anyone else to use, share and improve what
55 | * you give them.
56 | *
57 | ************************************************************************/
58 |
59 | package rbe;
60 |
61 | public class EBWOrderInqTrans extends EBTransition {
62 |
63 | public String request(EB eb, String html) {
64 |
65 | RBE rbe = eb.rbe;
66 |
67 | return(eb.addIDs(rbe.orderInqURL));
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/tpcw/rbe/util/CharSetStrPattern.java~:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | * rbe.util.CharSetStrPattern.java
3 | * Timothy Heil
4 | * 10/5/99
5 | *
6 | * StringPattern matching any set of characters.
7 | *------------------------------------------------------------------------*/
8 |
9 | package rbe.util;
10 |
11 | import rbe.util.Debug;
12 |
13 | public class CharSetStrPattern extends AbCharStrPattern {
14 | public static final CharRangeStrPattern digit =
15 | new CharRangeStrPattern('0', '9');
16 |
17 | public static final CharRangeStrPattern lower =
18 | new CharRangeStrPattern('a', 'z');
19 |
20 | public static final CharRangeStrPattern upper =
21 | new CharRangeStrPattern('A', 'Z');
22 |
23 | public static final CharSetStrPattern notDigit;
24 |
25 | static {
26 | notDigit = new CharSetStrPattern();
27 | notDigit.set((char) 0,(char) 255);
28 | notDigit.clear('0', '9');
29 | }
30 |
31 |
32 | protected byte [] mask = new byte[32];
33 |
34 | public void set(char c) {
35 | int i = c>>3;
36 | int bit = 1<<(c&7);
37 |
38 | mask[i] |= bit;
39 | }
40 |
41 | public void set(char s, char e) {
42 |
43 | Debug.assert(s<=e, "CharSetStrPattern.set: s must be <= to e.");
44 |
45 | int si = s>>3;
46 | int ei = e>>3;
47 |
48 | int b;
49 |
50 | if (si == ei) {
51 | mask[si] |= ((1<<((e&7)-(s&7)+1))-1)<<(s&7);
52 | }
53 | else {
54 | for (b=si+1;b>3;
72 | int bit = 1<<(c&7);
73 |
74 | mask[i] &= (0xff ^ bit);
75 | }
76 |
77 | public void clear(char s, char e) {
78 |
79 | Debug.assert(s<=e, "CharSetStrPattern.clear: s must be <= to e.");
80 | int si = s>>3;
81 | int ei = e>>3;
82 |
83 | int b;
84 |
85 | if (si == ei) {
86 | mask[si] &= 0xff ^ ((1<<((e&7)-(s&7)+1))-1)<<(s&7);
87 | }
88 | else {
89 | for (b=si+1;b>(8-(s&7));
94 | mask[ei] &= 0xfe<<(e&7);
95 | }
96 | }
97 |
98 | public void clear(String c) {
99 | int i;
100 | for (i=0;i>3;
107 | int bit = 1<<(c&7);
108 |
109 | return((mask[i] & bit)!=0);
110 | }
111 | // Does this character match.
112 | protected boolean charMatch(char c)
113 | {
114 | int i = c>>3;
115 | int bit = 1<<(c&7);
116 |
117 | return((mask[i] & bit) != 0);
118 | };
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBWBestSellTrans.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * rbe.EBWBestSellTrans.java
3 | * Timothy Heil
4 | * 11/10/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * TPC-W best-sellers transition from the home page to the best-sellers
9 | * page. subject field set to a random uniform subject string.
10 | * (See rbe.RBE.java).
11 | *------------------------------------------------------------------------
12 | *
13 | * This is part of the the Java TPC-W distribution,
14 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
15 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
16 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
17 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
18 | *
19 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
20 | * Eric Weglarz, Todd Bezenek.
21 | *
22 | * This source code is distributed "as is" in the hope that it will be
23 | * useful. It comes with no warranty, and no author or distributor
24 | * accepts any responsibility for the consequences of its use.
25 | *
26 | * Everyone is granted permission to copy, modify and redistribute
27 | * this code under the following conditions:
28 | *
29 | * This code is distributed for non-commercial use only.
30 | * Please contact the maintainer for restrictions applying to
31 | * commercial use of these tools.
32 | *
33 | * Permission is granted to anyone to make or distribute copies
34 | * of this code, either as received or modified, in any
35 | * medium, provided that all copyright notices, permission and
36 | * nonwarranty notices are preserved, and that the distributor
37 | * grants the recipient permission for further redistribution as
38 | * permitted by this document.
39 | *
40 | * Permission is granted to distribute this code in compiled
41 | * or executable form under the same conditions that apply for
42 | * source code, provided that either:
43 | *
44 | * A. it is accompanied by the corresponding machine-readable
45 | * source code,
46 | * B. it is accompanied by a written offer, with no time limit,
47 | * to give anyone a machine-readable copy of the corresponding
48 | * source code in return for reimbursement of the cost of
49 | * distribution. This written offer must permit verbatim
50 | * duplication by anyone, or
51 | * C. it is distributed by someone who received only the
52 | * executable form, and is accompanied by a copy of the
53 | * written offer of source code that they received concurrently.
54 | *
55 | * In other words, you are welcome to use, share and improve this codes.
56 | * You are forbidden to forbid anyone else to use, share and improve what
57 | * you give them.
58 | *
59 | ************************************************************************/
60 |
61 | package rbe;
62 |
63 | public class EBWBestSellTrans extends EBWNewProdTrans {
64 | protected String baseURL() { return(RBE.bestSellURL); }
65 | }
66 |
--------------------------------------------------------------------------------
/tpcw/ImgGen/gd-1.7.2/gdcache.h:
--------------------------------------------------------------------------------
1 | /*
2 | * gdcache.h
3 | *
4 | * Caches of pointers to user structs in which the least-recently-used
5 | * element is replaced in the event of a cache miss after the cache has
6 | * reached a given size.
7 | *
8 | * John Ellson (ellson@lucent.com) Oct 31, 1997
9 | *
10 | * Test this with:
11 | * gcc -o gdcache -g -Wall -DTEST gdcache.c
12 | *
13 | * The cache is implemented by a singly-linked list of elements
14 | * each containing a pointer to a user struct that is being managed by
15 | * the cache.
16 | *
17 | * The head structure has a pointer to the most-recently-used
18 | * element, and elements are moved to this position in the list each
19 | * time they are used. The head also contains pointers to three
20 | * user defined functions:
21 | * - a function to test if a cached userdata matches some keydata
22 | * - a function to provide a new userdata struct to the cache
23 | * if there has been a cache miss.
24 | * - a function to release a userdata struct when it is
25 | * no longer being managed by the cache
26 | *
27 | * In the event of a cache miss the cache is allowed to grow up to
28 | * a specified maximum size. After the maximum size is reached then
29 | * the least-recently-used element is discarded to make room for the
30 | * new. The most-recently-returned value is always left at the
31 | * beginning of the list after retrieval.
32 | *
33 | * In the current implementation the cache is traversed by a linear
34 | * search from most-recent to least-recent. This linear search
35 | * probably limits the usefulness of this implementation to cache
36 | * sizes of a few tens of elements.
37 | */
38 |
39 | /*********************************************************/
40 | /* header */
41 | /*********************************************************/
42 |
43 | #include
44 | #ifndef NULL
45 | #define NULL (void *)0
46 | #endif
47 |
48 | /* user defined function templates */
49 | typedef int (*gdCacheTestFn_t)(void *userdata, void *keydata);
50 | typedef void *(*gdCacheFetchFn_t)(char **error, void *keydata);
51 | typedef void (*gdCacheReleaseFn_t)(void *userdata);
52 |
53 | /* element structure */
54 | typedef struct gdCache_element_s gdCache_element_t;
55 | struct gdCache_element_s {
56 | gdCache_element_t *next;
57 | void *userdata;
58 | };
59 |
60 | /* head structure */
61 | typedef struct gdCache_head_s gdCache_head_t;
62 | struct gdCache_head_s {
63 | gdCache_element_t *mru;
64 | int size;
65 | char *error;
66 | gdCacheTestFn_t gdCacheTest;
67 | gdCacheFetchFn_t gdCacheFetch;
68 | gdCacheReleaseFn_t gdCacheRelease;
69 | };
70 |
71 | /* function templates */
72 | gdCache_head_t *
73 | gdCacheCreate(
74 | int size,
75 | gdCacheTestFn_t gdCacheTest,
76 | gdCacheFetchFn_t gdCacheFetch,
77 | gdCacheReleaseFn_t gdCacheRelease );
78 |
79 | void
80 | gdCacheDelete( gdCache_head_t *head );
81 |
82 | void *
83 | gdCacheGet( gdCache_head_t *head, void *keydata );
84 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBSimpleTrans.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * rbe.EBTransition.java
3 | * Timothy Heil
4 | * 10/5/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * A simple transition that just provides a static URL.
9 | *------------------------------------------------------------------------
10 | *
11 | * This is part of the the Java TPC-W distribution,
12 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
13 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
14 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
15 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
16 | *
17 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
18 | * Eric Weglarz, Todd Bezenek.
19 | *
20 | * This source code is distributed "as is" in the hope that it will be
21 | * useful. It comes with no warranty, and no author or distributor
22 | * accepts any responsibility for the consequences of its use.
23 | *
24 | * Everyone is granted permission to copy, modify and redistribute
25 | * this code under the following conditions:
26 | *
27 | * This code is distributed for non-commercial use only.
28 | * Please contact the maintainer for restrictions applying to
29 | * commercial use of these tools.
30 | *
31 | * Permission is granted to anyone to make or distribute copies
32 | * of this code, either as received or modified, in any
33 | * medium, provided that all copyright notices, permission and
34 | * nonwarranty notices are preserved, and that the distributor
35 | * grants the recipient permission for further redistribution as
36 | * permitted by this document.
37 | *
38 | * Permission is granted to distribute this code in compiled
39 | * or executable form under the same conditions that apply for
40 | * source code, provided that either:
41 | *
42 | * A. it is accompanied by the corresponding machine-readable
43 | * source code,
44 | * B. it is accompanied by a written offer, with no time limit,
45 | * to give anyone a machine-readable copy of the corresponding
46 | * source code in return for reimbursement of the cost of
47 | * distribution. This written offer must permit verbatim
48 | * duplication by anyone, or
49 | * C. it is distributed by someone who received only the
50 | * executable form, and is accompanied by a copy of the
51 | * written offer of source code that they received concurrently.
52 | *
53 | * In other words, you are welcome to use, share and improve this codes.
54 | * You are forbidden to forbid anyone else to use, share and improve what
55 | * you give them.
56 | *
57 | ************************************************************************/
58 |
59 | package rbe;
60 |
61 | public class EBSimpleTrans extends EBTransition {
62 | private String url;
63 |
64 | EBSimpleTrans(String url)
65 | {
66 | this.url = url;
67 | }
68 |
69 | public String request(EB eb, String html) {
70 | return(url);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/tpcw/rbe/util/CharStrPattern.java:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | * rbe.util.CharStrPattern.java
3 | * Timothy Heil
4 | * 10/5/99
5 | *
6 | * StringPattern matching a single character.
7 | *------------------------------------------------------------------------
8 | *
9 | * This is part of the the Java TPC-W distribution,
10 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
11 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
12 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
13 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
14 | *
15 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
16 | * Eric Weglarz, Todd Bezenek.
17 | *
18 | * This source code is distributed "as is" in the hope that it will be
19 | * useful. It comes with no warranty, and no author or distributor
20 | * accepts any responsibility for the consequences of its use.
21 | *
22 | * Everyone is granted permission to copy, modify and redistribute
23 | * this code under the following conditions:
24 | *
25 | * This code is distributed for non-commercial use only.
26 | * Please contact the maintainer for restrictions applying to
27 | * commercial use of these tools.
28 | *
29 | * Permission is granted to anyone to make or distribute copies
30 | * of this code, either as received or modified, in any
31 | * medium, provided that all copyright notices, permission and
32 | * nonwarranty notices are preserved, and that the distributor
33 | * grants the recipient permission for further redistribution as
34 | * permitted by this document.
35 | *
36 | * Permission is granted to distribute this code in compiled
37 | * or executable form under the same conditions that apply for
38 | * source code, provided that either:
39 | *
40 | * A. it is accompanied by the corresponding machine-readable
41 | * source code,
42 | * B. it is accompanied by a written offer, with no time limit,
43 | * to give anyone a machine-readable copy of the corresponding
44 | * source code in return for reimbursement of the cost of
45 | * distribution. This written offer must permit verbatim
46 | * duplication by anyone, or
47 | * C. it is distributed by someone who received only the
48 | * executable form, and is accompanied by a copy of the
49 | * written offer of source code that they received concurrently.
50 | *
51 | * In other words, you are welcome to use, share and improve this codes.
52 | * You are forbidden to forbid anyone else to use, share and improve what
53 | * you give them.
54 | *
55 | ************************************************************************/
56 |
57 | package rbe.util;
58 |
59 | public class CharStrPattern extends AbCharStrPattern {
60 | protected char p; // The character to find.
61 |
62 | public CharStrPattern(char p) {
63 | this.p = p;
64 | }
65 |
66 | // Does this character match.
67 | protected boolean charMatch(char c) {return(c==p);};
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBWHomeTrans.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * rbe.EBWHomeTrans.java
3 | * Timothy Heil
4 | * 10/13/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * TPC-W home transition. Requests the home page, and sends CID and
9 | * shopping ID if known.
10 | *------------------------------------------------------------------------
11 | *
12 | * This is part of the the Java TPC-W distribution,
13 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
14 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
15 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
16 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
17 | *
18 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
19 | * Eric Weglarz, Todd Bezenek.
20 | *
21 | * This source code is distributed "as is" in the hope that it will be
22 | * useful. It comes with no warranty, and no author or distributor
23 | * accepts any responsibility for the consequences of its use.
24 | *
25 | * Everyone is granted permission to copy, modify and redistribute
26 | * this code under the following conditions:
27 | *
28 | * This code is distributed for non-commercial use only.
29 | * Please contact the maintainer for restrictions applying to
30 | * commercial use of these tools.
31 | *
32 | * Permission is granted to anyone to make or distribute copies
33 | * of this code, either as received or modified, in any
34 | * medium, provided that all copyright notices, permission and
35 | * nonwarranty notices are preserved, and that the distributor
36 | * grants the recipient permission for further redistribution as
37 | * permitted by this document.
38 | *
39 | * Permission is granted to distribute this code in compiled
40 | * or executable form under the same conditions that apply for
41 | * source code, provided that either:
42 | *
43 | * A. it is accompanied by the corresponding machine-readable
44 | * source code,
45 | * B. it is accompanied by a written offer, with no time limit,
46 | * to give anyone a machine-readable copy of the corresponding
47 | * source code in return for reimbursement of the cost of
48 | * distribution. This written offer must permit verbatim
49 | * duplication by anyone, or
50 | * C. it is distributed by someone who received only the
51 | * executable form, and is accompanied by a copy of the
52 | * written offer of source code that they received concurrently.
53 | *
54 | * In other words, you are welcome to use, share and improve this codes.
55 | * You are forbidden to forbid anyone else to use, share and improve what
56 | * you give them.
57 | *
58 | ************************************************************************/
59 |
60 | package rbe;
61 |
62 | public class EBWHomeTrans extends EBTransition {
63 |
64 | public String request(EB eb, String html) {
65 |
66 | RBE rbe = eb.rbe;
67 |
68 | return(eb.addIDs(rbe.homeURL));
69 | }
70 | public boolean toHome() { return(true); };
71 | }
72 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 | TPC-W Java Implementation
16 |
17 |
18 |
19 |
20 |
53 | This is a distribution of the TPC-W Benchmark Java Implementation originated of PHARM at the University of Wisconsin - Madison. It includes some changes to make adapting to different databases and servlet containers easier (see Running TPC-W on Tomcat).
54 | For more background information to understand the TPC-W benchmark have a look at the original TPC-W hompage or other resources listed in the links.
55 |
56 |
57 |
58 |
Description
59 |
60 |
61 |
62 | Basically, this distribution consists of a build.xml for Ant to control building and installing the benchmark. All SQL statements have been extracted into a property file, so they can be changed without messing with the source code. Additionally, all settings for the servlets, RBE and database can be made via properties.
63 | Database generation and image population can also be started with Ant, but an up-to-date checking is missing.
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/tpcw/ImgGen/gd-1.7.2/gd_io_file.c:
--------------------------------------------------------------------------------
1 | /*
2 | * io_file.c
3 | *
4 | * Implements the file interface.
5 | *
6 | * As will all I/O modules, most functions are for local use only (called
7 | * via function pointers in the I/O context).
8 | *
9 | * Most functions are just 'wrappers' for standard file functions.
10 | *
11 | * Written/Modified 1999, Philip Warner.
12 | *
13 | */
14 |
15 | /* For platforms with incomplete ANSI defines. Fortunately,
16 | SEEK_SET is defined to be zero by the standard. */
17 |
18 | #ifndef SEEK_SET
19 | #define SEEK_SET 0
20 | #endif /* SEEK_SET */
21 |
22 | #include
23 | #include
24 | #include
25 | #include "gd.h"
26 |
27 | /* this is used for creating images in main memory*/
28 |
29 | typedef struct fileIOCtx {
30 | gdIOCtx ctx;
31 | FILE *f;
32 | } fileIOCtx;
33 |
34 | struct fileIOCtx *fileIOCtxPtr;
35 |
36 | gdIOCtx* newFileCtx(FILE *f);
37 |
38 | static int fileGetbuf( gdIOCtx*, void *, int );
39 | static int filePutbuf( gdIOCtx*, const void *, int );
40 | static void filePutchar( gdIOCtx*, int );
41 | static int fileGetchar( gdIOCtx* ctx);
42 |
43 | static int fileSeek(struct gdIOCtx*, const int);
44 | static long fileTell(struct gdIOCtx*);
45 | static void freeFileCtx(gdIOCtx *ctx);
46 |
47 | /* return data as a dynamic pointer */
48 | gdIOCtx* gdNewFileCtx (FILE *f) {
49 | fileIOCtx *ctx;
50 |
51 | ctx = (fileIOCtx*) malloc(sizeof(fileIOCtx));
52 | if (ctx == NULL) {
53 | return NULL;
54 | }
55 |
56 | ctx->f = f;
57 |
58 | ctx->ctx.getC = fileGetchar;
59 | ctx->ctx.putC = filePutchar;
60 |
61 | ctx->ctx.getBuf = fileGetbuf;
62 | ctx->ctx.putBuf = filePutbuf;
63 |
64 | ctx->ctx.tell = fileTell;
65 | ctx->ctx.seek = fileSeek;
66 |
67 | ctx->ctx.free = freeFileCtx;
68 |
69 | return (gdIOCtx*)ctx;
70 | }
71 |
72 | static
73 | void freeFileCtx(gdIOCtx *ctx)
74 | {
75 | free(ctx);
76 | }
77 |
78 |
79 | static int
80 | filePutbuf( gdIOCtx* ctx, const void *buf, int size )
81 | {
82 | fileIOCtx *fctx;
83 | fctx = (fileIOCtx*) ctx;
84 |
85 | return fwrite(buf, 1, size, fctx->f);
86 |
87 | }
88 |
89 | static int
90 | fileGetbuf( gdIOCtx* ctx, void *buf, int size )
91 | {
92 | fileIOCtx *fctx;
93 | fctx = (fileIOCtx*) ctx;
94 |
95 | return (fread(buf, 1, size, fctx->f));
96 |
97 | }
98 |
99 | static void
100 | filePutchar( gdIOCtx* ctx, int a )
101 | {
102 | unsigned char b;
103 | fileIOCtx *fctx;
104 | fctx = (fileIOCtx*) ctx;
105 |
106 | b = a;
107 |
108 | putc(b, fctx->f);
109 | }
110 |
111 | static int fileGetchar( gdIOCtx* ctx)
112 | {
113 | fileIOCtx *fctx;
114 | fctx = (fileIOCtx*) ctx;
115 |
116 | return getc(fctx->f);
117 | }
118 |
119 |
120 | static int fileSeek(struct gdIOCtx* ctx, const int pos)
121 | {
122 | fileIOCtx *fctx;
123 | fctx = (fileIOCtx*) ctx;
124 |
125 | return (fseek(fctx->f, pos, SEEK_SET) == 0);
126 | }
127 |
128 | static long fileTell(struct gdIOCtx* ctx)
129 | {
130 | fileIOCtx *fctx;
131 | fctx = (fileIOCtx*) ctx;
132 |
133 | return ftell(fctx->f);
134 | }
135 |
136 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBTransition.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * rbe.EBTransition.java
3 | * Timothy Heil
4 | * 10/5/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * EB transition from one web-page to another. Computes the
9 | * HTTP request.
10 | *
11 | * An abstract class.
12 | *------------------------------------------------------------------------
13 | *
14 | * This is part of the the Java TPC-W distribution,
15 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
16 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
17 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
18 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
19 | *
20 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
21 | * Eric Weglarz, Todd Bezenek.
22 | *
23 | * This source code is distributed "as is" in the hope that it will be
24 | * useful. It comes with no warranty, and no author or distributor
25 | * accepts any responsibility for the consequences of its use.
26 | *
27 | * Everyone is granted permission to copy, modify and redistribute
28 | * this code under the following conditions:
29 | *
30 | * This code is distributed for non-commercial use only.
31 | * Please contact the maintainer for restrictions applying to
32 | * commercial use of these tools.
33 | *
34 | * Permission is granted to anyone to make or distribute copies
35 | * of this code, either as received or modified, in any
36 | * medium, provided that all copyright notices, permission and
37 | * nonwarranty notices are preserved, and that the distributor
38 | * grants the recipient permission for further redistribution as
39 | * permitted by this document.
40 | *
41 | * Permission is granted to distribute this code in compiled
42 | * or executable form under the same conditions that apply for
43 | * source code, provided that either:
44 | *
45 | * A. it is accompanied by the corresponding machine-readable
46 | * source code,
47 | * B. it is accompanied by a written offer, with no time limit,
48 | * to give anyone a machine-readable copy of the corresponding
49 | * source code in return for reimbursement of the cost of
50 | * distribution. This written offer must permit verbatim
51 | * duplication by anyone, or
52 | * C. it is distributed by someone who received only the
53 | * executable form, and is accompanied by a copy of the
54 | * written offer of source code that they received concurrently.
55 | *
56 | * In other words, you are welcome to use, share and improve this codes.
57 | * You are forbidden to forbid anyone else to use, share and improve what
58 | * you give them.
59 | *
60 | ************************************************************************/
61 |
62 | package rbe;
63 |
64 | public abstract class EBTransition {
65 | public abstract String request(EB eb, String html);
66 |
67 | // Post-process received HTML
68 | public void postProcess(EB eb, String html) {};
69 |
70 | // Return true if the transition is to the home page.
71 | public boolean toHome() { return(false); };
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBWProdCURLTrans.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * rbe.EBWProdCURLTrans.java
3 | * Timothy Heil
4 | * 11/10/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * TPC-W transistion to product detail through CURL.
9 | * This simulates the user using the browsers "back" button to
10 | * retrieve the previous (cached) page. Then, the user selects
11 | * another random item.
12 | *
13 | * See TPC-W Spec. Clause 2.14.5.4 and chart in Clause 1.1
14 | *------------------------------------------------------------------------
15 | *
16 | * This is part of the the Java TPC-W distribution,
17 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
18 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
19 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
20 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
21 | *
22 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
23 | * Eric Weglarz, Todd Bezenek.
24 | *
25 | * This source code is distributed "as is" in the hope that it will be
26 | * useful. It comes with no warranty, and no author or distributor
27 | * accepts any responsibility for the consequences of its use.
28 | *
29 | * Everyone is granted permission to copy, modify and redistribute
30 | * this code under the following conditions:
31 | *
32 | * This code is distributed for non-commercial use only.
33 | * Please contact the maintainer for restrictions applying to
34 | * commercial use of these tools.
35 | *
36 | * Permission is granted to anyone to make or distribute copies
37 | * of this code, either as received or modified, in any
38 | * medium, provided that all copyright notices, permission and
39 | * nonwarranty notices are preserved, and that the distributor
40 | * grants the recipient permission for further redistribution as
41 | * permitted by this document.
42 | *
43 | * Permission is granted to distribute this code in compiled
44 | * or executable form under the same conditions that apply for
45 | * source code, provided that either:
46 | *
47 | * A. it is accompanied by the corresponding machine-readable
48 | * source code,
49 | * B. it is accompanied by a written offer, with no time limit,
50 | * to give anyone a machine-readable copy of the corresponding
51 | * source code in return for reimbursement of the cost of
52 | * distribution. This written offer must permit verbatim
53 | * duplication by anyone, or
54 | * C. it is distributed by someone who received only the
55 | * executable form, and is accompanied by a copy of the
56 | * written offer of source code that they received concurrently.
57 | *
58 | * In other words, you are welcome to use, share and improve this codes.
59 | * You are forbidden to forbid anyone else to use, share and improve what
60 | * you give them.
61 | *
62 | ************************************************************************/
63 |
64 | package rbe;
65 |
66 | public class EBWProdCURLTrans extends EBWProdDetTrans {
67 |
68 | public String request(EB eb, String html) {
69 | return (super.request(eb, eb.prevHTML));
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/tpcw/servlets/CartLine.java:
--------------------------------------------------------------------------------
1 | /*
2 | * CartLine.java - Class stores the necessary data for a single item in
3 | * a single shopping cart, corresponding to the
4 | * SHOPPING_CART_LINE table in the DB
5 | *
6 | ************************************************************************
7 | *
8 | * This is part of the the Java TPC-W distribution,
9 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
10 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
11 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
12 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
13 | *
14 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
15 | * Eric Weglarz, Todd Bezenek.
16 | *
17 | * This source code is distributed "as is" in the hope that it will be
18 | * useful. It comes with no warranty, and no author or distributor
19 | * accepts any responsibility for the consequences of its use.
20 | *
21 | * Everyone is granted permission to copy, modify and redistribute
22 | * this code under the following conditions:
23 | *
24 | * This code is distributed for non-commercial use only.
25 | * Please contact the maintainer for restrictions applying to
26 | * commercial use of these tools.
27 | *
28 | * Permission is granted to anyone to make or distribute copies
29 | * of this code, either as received or modified, in any
30 | * medium, provided that all copyright notices, permission and
31 | * nonwarranty notices are preserved, and that the distributor
32 | * grants the recipient permission for further redistribution as
33 | * permitted by this document.
34 | *
35 | * Permission is granted to distribute this code in compiled
36 | * or executable form under the same conditions that apply for
37 | * source code, provided that either:
38 | *
39 | * A. it is accompanied by the corresponding machine-readable
40 | * source code,
41 | * B. it is accompanied by a written offer, with no time limit,
42 | * to give anyone a machine-readable copy of the corresponding
43 | * source code in return for reimbursement of the cost of
44 | * distribution. This written offer must permit verbatim
45 | * duplication by anyone, or
46 | * C. it is distributed by someone who received only the
47 | * executable form, and is accompanied by a copy of the
48 | * written offer of source code that they received concurrently.
49 | *
50 | * In other words, you are welcome to use, share and improve this codes.
51 | * You are forbidden to forbid anyone else to use, share and improve what
52 | * you give them.
53 | *
54 | ************************************************************************/
55 |
56 | public class CartLine{
57 | public String scl_title;
58 | public double scl_cost;
59 | public double scl_srp;
60 | public String scl_backing;
61 | public int scl_qty;
62 | public int scl_i_id;
63 |
64 | public CartLine(String title, double cost, double srp, String backing,
65 | int qty, int id){
66 | scl_title = title;
67 | scl_cost = cost;
68 | scl_srp = srp;
69 | scl_backing = backing;
70 | scl_qty = qty;
71 | scl_i_id = id;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/docs/api/servlets/allclasses-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | All Classes
8 |
9 |
10 |
11 |
17 |
18 |
19 | All Classes
20 |
21 |
22 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBWOrderDispTrans.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * rbe.EBWOrderDispTrans.java
3 | * Timothy Heil
4 | * 10/13/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * TPC-W order display transition. Provides the order display page URL
9 | * along with the CID, SESSIONID, user name and password.
10 | *------------------------------------------------------------------------
11 | *
12 | * This is part of the the Java TPC-W distribution,
13 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
14 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
15 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
16 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
17 | *
18 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
19 | * Eric Weglarz, Todd Bezenek.
20 | *
21 | * This source code is distributed "as is" in the hope that it will be
22 | * useful. It comes with no warranty, and no author or distributor
23 | * accepts any responsibility for the consequences of its use.
24 | *
25 | * Everyone is granted permission to copy, modify and redistribute
26 | * this code under the following conditions:
27 | *
28 | * This code is distributed for non-commercial use only.
29 | * Please contact the maintainer for restrictions applying to
30 | * commercial use of these tools.
31 | *
32 | * Permission is granted to anyone to make or distribute copies
33 | * of this code, either as received or modified, in any
34 | * medium, provided that all copyright notices, permission and
35 | * nonwarranty notices are preserved, and that the distributor
36 | * grants the recipient permission for further redistribution as
37 | * permitted by this document.
38 | *
39 | * Permission is granted to distribute this code in compiled
40 | * or executable form under the same conditions that apply for
41 | * source code, provided that either:
42 | *
43 | * A. it is accompanied by the corresponding machine-readable
44 | * source code,
45 | * B. it is accompanied by a written offer, with no time limit,
46 | * to give anyone a machine-readable copy of the corresponding
47 | * source code in return for reimbursement of the cost of
48 | * distribution. This written offer must permit verbatim
49 | * duplication by anyone, or
50 | * C. it is distributed by someone who received only the
51 | * executable form, and is accompanied by a copy of the
52 | * written offer of source code that they received concurrently.
53 | *
54 | * In other words, you are welcome to use, share and improve this codes.
55 | * You are forbidden to forbid anyone else to use, share and improve what
56 | * you give them.
57 | *
58 | ************************************************************************/
59 |
60 | package rbe;
61 |
62 | public class EBWOrderDispTrans extends EBTransition {
63 | public String request(EB eb, String html) {
64 |
65 | RBE rbe = eb.rbe;
66 |
67 | if (eb.cid == eb.ID_UNKNOWN) {
68 | eb.cid = rbe.NURand(eb.rand, rbe.cidA, 1,rbe.numCustomer);
69 | }
70 |
71 | return(eb.addIDs(rbe.orderDispURL + "?" + rbe.unameAndPass(eb.cid)));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/tpcw/rbe/util/CharRangeStrPattern.java:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | * rbe.util.CharRangeStrPattern.java
3 | * Timothy Heil
4 | * 10/5/99
5 | *
6 | * StringPattern matching any one of a range of characters.
7 | * Range specified is inclusive.
8 | *------------------------------------------------------------------------
9 | *
10 | * This is part of the the Java TPC-W distribution,
11 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
12 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
13 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
14 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
15 | *
16 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
17 | * Eric Weglarz, Todd Bezenek.
18 | *
19 | * This source code is distributed "as is" in the hope that it will be
20 | * useful. It comes with no warranty, and no author or distributor
21 | * accepts any responsibility for the consequences of its use.
22 | *
23 | * Everyone is granted permission to copy, modify and redistribute
24 | * this code under the following conditions:
25 | *
26 | * This code is distributed for non-commercial use only.
27 | * Please contact the maintainer for restrictions applying to
28 | * commercial use of these tools.
29 | *
30 | * Permission is granted to anyone to make or distribute copies
31 | * of this code, either as received or modified, in any
32 | * medium, provided that all copyright notices, permission and
33 | * nonwarranty notices are preserved, and that the distributor
34 | * grants the recipient permission for further redistribution as
35 | * permitted by this document.
36 | *
37 | * Permission is granted to distribute this code in compiled
38 | * or executable form under the same conditions that apply for
39 | * source code, provided that either:
40 | *
41 | * A. it is accompanied by the corresponding machine-readable
42 | * source code,
43 | * B. it is accompanied by a written offer, with no time limit,
44 | * to give anyone a machine-readable copy of the corresponding
45 | * source code in return for reimbursement of the cost of
46 | * distribution. This written offer must permit verbatim
47 | * duplication by anyone, or
48 | * C. it is distributed by someone who received only the
49 | * executable form, and is accompanied by a copy of the
50 | * written offer of source code that they received concurrently.
51 | *
52 | * In other words, you are welcome to use, share and improve this codes.
53 | * You are forbidden to forbid anyone else to use, share and improve what
54 | * you give them.
55 | *
56 | ************************************************************************/
57 |
58 | package rbe.util;
59 |
60 | public class CharRangeStrPattern extends AbCharStrPattern {
61 | protected char first; // The character to find.
62 | protected char last; // The last character to match.
63 |
64 | public CharRangeStrPattern(char first, char last) {
65 | this.first = first;
66 | this.last = last;
67 | }
68 |
69 | // Does this character match.
70 | protected boolean charMatch(char c) {return((c>=first) && (c<=last));};
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/tpcw/rbe/util/TestPattern.java~:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | * rbe.util.TestPattern
3 | * Timothy Heil
4 | * 10/5/99
5 | *
6 | * Testing StringPattern classes.
7 | *------------------------------------------------------------------------*/
8 |
9 | package rbe.util;
10 |
11 | import java.util.Random;
12 |
13 | public class TestPattern {
14 | public static void main(String [] args) {
15 | CharSetStrPattern sp = new CharSetStrPattern();
16 |
17 | int i,c,c2,j;
18 | boolean [] buf = new boolean[256];
19 | Random r = new Random(1);
20 |
21 | for (i=0;i<10000;i++) {
22 | c = Math.abs(r.nextInt()) % 256;
23 | sp.set((char) c);
24 | buf[c] = true;
25 |
26 | testBuf(buf, sp);
27 |
28 | c = Math.abs(r.nextInt()) %256;
29 | sp.clear((char) c);
30 | buf[c] = false;
31 |
32 | testBuf(buf, sp);
33 | }
34 |
35 | System.out.println("Testing ranges.");
36 | for (i=0;i<10000;i++) {
37 | c = Math.abs(r.nextInt()) % 256;
38 | c2 = (Math.abs(r.nextInt()) % (256-c))+c;
39 | // System.out.println("Set " + c + " to " + c2);
40 | sp.set((char) c, (char) c2);
41 | for (j=c;j<=c2;j++) {
42 | buf[j] = true;
43 | }
44 | testBuf(buf, sp);
45 |
46 | c = Math.abs(r.nextInt()) % 256;
47 | c2 = (Math.abs(r.nextInt()) % (256-c))+c;
48 | // System.out.println("Clear " + c + " to " + c2);
49 | sp.clear((char) c, (char) c2);
50 | for (j=c;j<=c2;j++) {
51 | buf[j] = false;
52 | }
53 |
54 | testBuf(buf, sp);
55 | }
56 |
57 |
58 | StringPattern p = new CharStrPattern(args[0].charAt(0));
59 | test(p,args[1]);
60 |
61 | if (args[0].length()>2) {
62 | p = new CharRangeStrPattern(args[0].charAt(0), args[0].charAt(1));
63 | test(p,args[1]);
64 | }
65 |
66 | p = new StrStrPattern(args[0]);
67 | test(p,args[1]);
68 |
69 | sp.clear((char) 0, (char) 255);
70 | sp.set(args[0]);
71 | test(sp,args[1]);
72 | }
73 |
74 | private static void test(StringPattern p, String s)
75 | {
76 | System.out.println("find " + p.find(s) + " end " + p.end());
77 | System.out.println("find(5) " + p.find(s, 5) + " end " + p.end());
78 | System.out.println("find(5,10) " + p.find(s, 5, 10) +
79 | " end " + p.end());
80 |
81 | System.out.println("match " + p.match(s) + " end " + p.end());
82 | System.out.println("match(5) " + p.match(s, 5) + " end " + p.end());
83 | System.out.println("match(5,10) " + p.match(s, 5, 10) +
84 | " end " + p.end());
85 | System.out.println("match(5,5) " + p.match(s, 5, 5) +
86 | " end " + p.end());
87 | System.out.println("matchWithin(5,10) " + p.matchWithin(s, 5, 10) +
88 | " end " + p.end());
89 | }
90 |
91 | private static void testBuf(boolean [] buf, CharSetStrPattern sp)
92 | {
93 | int j;
94 |
95 | for (j=0;j<256;j++) {
96 | if (buf[j]!=sp.get((char) j)) {
97 | System.out.println("Unmatch on " + j);
98 | System.out.println("buf is " + buf[j] + " sp is " + sp.get((char) j));
99 | System.exit(-1);
100 | }
101 | }
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBFactoryArg.java:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | * rbe.EBFactoryArg.java
3 | * Timothy Heil
4 | * 10/29/99
5 | *
6 | * Abstract command line argument parsing class.
7 | *------------------------------------------------------------------------*/
8 |
9 | package rbe;
10 |
11 | import java.util.Vector;
12 | import rbe.args.Arg;
13 | import rbe.args.ArgDB;
14 |
15 | public class EBFactoryArg extends Arg {
16 | public Vector ebs;
17 | public RBE rbe;
18 | public int maxState;
19 | public String className;
20 |
21 | public EBFactoryArg(String arg, String name, String desc,
22 | RBE rbe, Vector ebs) {
23 | super(arg, name, desc, true, false);
24 | this.rbe = rbe;
25 | this.ebs = ebs;
26 | }
27 |
28 | public EBFactoryArg(String arg, String name, String desc,
29 | RBE rbe, Vector ebs, ArgDB db) {
30 | super(arg, name, desc, true, false, db);
31 | this.rbe = rbe;
32 | this.ebs = ebs;
33 | }
34 |
35 | // Customize to parse arguments.
36 | protected int parseMatch(String [] args, int a)
37 | throws Arg.Exception
38 | {
39 | int num;
40 | int p;
41 | int i;
42 |
43 | if (a==args.length) {
44 | throw new Arg.Exception("Missing factory class name.", a);
45 | }
46 |
47 | // Read in factory class.
48 | String factoryClassName = args[a];
49 | className = factoryClassName;
50 | EBFactory factory;
51 | try {
52 | Class factoryClass = Class.forName(factoryClassName);
53 | factory = (EBFactory) factoryClass.newInstance();
54 | }
55 | catch(ClassNotFoundException cnf) {
56 | throw new Arg.Exception("Unable to find factory class " +
57 | factoryClassName + ".", a);
58 | }
59 | catch(InstantiationException ie) {
60 | throw new
61 | Arg.Exception("Unable to instantiate factory class " +
62 | factoryClassName + ".", a);
63 | }
64 | catch(IllegalAccessException iae) {
65 | throw new Arg.Exception("Unable to access constructor " +
66 | "for factory class " +
67 | factoryClassName + ".", a);
68 | }
69 | catch(ClassCastException cce) {
70 | throw new Arg.Exception("Factory class " + factoryClassName +
71 | " is not a subclass of EBFactory.", a);
72 | }
73 |
74 | // Parse number of EBs to create with this factory.
75 | a++;
76 | if (a == args.length) {
77 | throw new Arg.Exception("Missing factory EB count.", a);
78 | }
79 | try {
80 | num = Integer.parseInt(args[a]);
81 | }
82 | catch(NumberFormatException nfe) {
83 | throw new Arg.Exception("Unable to parse number of EBs.", a);
84 | }
85 | a++;
86 | p = factory.initialize(args, a);
87 | if (p==-1) {
88 | // Factory was unable to parse the input args.
89 | throw new Arg.
90 | Exception("Factory class " + factoryClassName +
91 | " unable to parse input arguments.", a);
92 | }
93 | a=p;
94 |
95 | // Create EBs
96 | for (i=0;imaxState) {
99 | maxState = e.states();
100 | }
101 | ebs.addElement(e);
102 | }
103 |
104 | return(a);
105 | }
106 |
107 | public String value() { return("" + ebs.size() + " EBs"); }
108 | }
109 |
--------------------------------------------------------------------------------
/tpcw/ImgGen/ImgFiles/RestFiles/cjpeg.bak:
--------------------------------------------------------------------------------
1 |
2 | #include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
3 | #include "jversion.h" /* for version message */
4 | #include
5 | #include
6 |
7 |
8 | int main (int argc, char **argv)
9 | {
10 | struct jpeg_compress_struct cinfo;
11 | struct jpeg_error_mgr jerr;
12 | int k, dim, i;
13 | FILE * outfile;
14 | char *row_pointer;
15 |
16 | if(argc != 3) {
17 | printf("Usage: %s .jpg\n", argv[0]);
18 | exit(0);
19 | }
20 |
21 | k = atoi(argv[1]);
22 | if(k<0)
23 | k=1;
24 |
25 | /* Create output image. */
26 | dim = (int)sqrt( ((k*1024)-635)/2 );
27 | printf("size ~= %d bytes, dimension = %d\n", k*1024, dim);
28 |
29 | row_pointer = malloc(dim*3*sizeof(char));
30 |
31 | /* Initialize the JPEG compression object with default error handling. */
32 | cinfo.err = jpeg_std_error(&jerr);
33 | jpeg_create_compress(&cinfo);
34 |
35 | /* Specify data destination for compression */
36 | if((outfile = fopen(argv[2], "wb")) == NULL) {
37 | printf("Can't open file...\n");
38 | exit(1);
39 | }
40 | jpeg_stdio_dest(&cinfo, outfile);
41 |
42 | /* Initialize JPEG parameters.
43 | * Much of this may be overridden later.
44 | * In particular, we don't yet know the input file's color space,
45 | * but we need to provide some value for jpeg_set_defaults() to work.
46 | */
47 |
48 | cinfo.in_color_space = JCS_RGB; /* arbitrary guess */
49 | cinfo.image_width = dim;
50 | cinfo.image_height = dim;
51 | cinfo.input_components = 3;
52 | jpeg_set_defaults(&cinfo);
53 | jpeg_set_quality(&cinfo, 9999, TRUE);
54 | srand( (unsigned)time( NULL ) );
55 |
56 |
57 | /* Start compressor */
58 | jpeg_start_compress(&cinfo, TRUE);
59 | /* Process data */
60 | while (cinfo.next_scanline < cinfo.image_height) {
61 | /* randomize the dots */
62 | int position;
63 | for(i=0; ioffset) || (c >= (f->offset + f->nchars))) {
97 | return;
98 | }
99 | fline = (c - f->offset) * f->h * f->w;
100 | for (py = y; (py < (y + f->h)); py++) {
101 | for (px = x; (px < (x + f->w)); px++) {
102 | if (f->data[fline + cy * f->w + cx]) {
103 | gdImageSetPixel(im, px, py, color);
104 | }
105 | cx++;
106 | }
107 | cx = 0;
108 | cy++;
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBWNewProdTrans.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * rbe.EBWNewProdTrans.java
3 | * Timothy Heil
4 | * 11/10/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * TPC-W New-products transition from the home page to the new products
9 | * page. subject field set to a random uniform subject string.
10 | * (See rbe.RBE.java).
11 | *------------------------------------------------------------------------
12 | *
13 | * This is part of the the Java TPC-W distribution,
14 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
15 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
16 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
17 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
18 | *
19 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
20 | * Eric Weglarz, Todd Bezenek.
21 | *
22 | * This source code is distributed "as is" in the hope that it will be
23 | * useful. It comes with no warranty, and no author or distributor
24 | * accepts any responsibility for the consequences of its use.
25 | *
26 | * Everyone is granted permission to copy, modify and redistribute
27 | * this code under the following conditions:
28 | *
29 | * This code is distributed for non-commercial use only.
30 | * Please contact the maintainer for restrictions applying to
31 | * commercial use of these tools.
32 | *
33 | * Permission is granted to anyone to make or distribute copies
34 | * of this code, either as received or modified, in any
35 | * medium, provided that all copyright notices, permission and
36 | * nonwarranty notices are preserved, and that the distributor
37 | * grants the recipient permission for further redistribution as
38 | * permitted by this document.
39 | *
40 | * Permission is granted to distribute this code in compiled
41 | * or executable form under the same conditions that apply for
42 | * source code, provided that either:
43 | *
44 | * A. it is accompanied by the corresponding machine-readable
45 | * source code,
46 | * B. it is accompanied by a written offer, with no time limit,
47 | * to give anyone a machine-readable copy of the corresponding
48 | * source code in return for reimbursement of the cost of
49 | * distribution. This written offer must permit verbatim
50 | * duplication by anyone, or
51 | * C. it is distributed by someone who received only the
52 | * executable form, and is accompanied by a copy of the
53 | * written offer of source code that they received concurrently.
54 | *
55 | * In other words, you are welcome to use, share and improve this codes.
56 | * You are forbidden to forbid anyone else to use, share and improve what
57 | * you give them.
58 | *
59 | ************************************************************************/
60 |
61 | package rbe;
62 |
63 | public class EBWNewProdTrans extends EBTransition {
64 |
65 | public String request(EB eb, String html) {
66 | RBE rbe = eb.rbe;
67 | int srchType = eb.nextInt(3);
68 | String url = baseURL();
69 |
70 | url = url + "?" + rbe.field_subject + "=" + rbe.unifHomeSubject(eb.rand);
71 |
72 | return(eb.addIDs(url));
73 | }
74 |
75 | protected String baseURL() { return(RBE.newProdURL); }
76 | }
77 |
--------------------------------------------------------------------------------
/tpcw/rbe/util/Debug.java:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | * util.Debug.java
3 | * Timothy Heil
4 | * 10/26/98
5 | *
6 | * Why is this class not part of the standard API?
7 | *------------------------------------------------------------------------
8 | *
9 | * This is part of the the Java TPC-W distribution,
10 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
11 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
12 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
13 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
14 | *
15 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
16 | * Eric Weglarz, Todd Bezenek.
17 | *
18 | * This source code is distributed "as is" in the hope that it will be
19 | * useful. It comes with no warranty, and no author or distributor
20 | * accepts any responsibility for the consequences of its use.
21 | *
22 | * Everyone is granted permission to copy, modify and redistribute
23 | * this code under the following conditions:
24 | *
25 | * This code is distributed for non-commercial use only.
26 | * Please contact the maintainer for restrictions applying to
27 | * commercial use of these tools.
28 | *
29 | * Permission is granted to anyone to make or distribute copies
30 | * of this code, either as received or modified, in any
31 | * medium, provided that all copyright notices, permission and
32 | * nonwarranty notices are preserved, and that the distributor
33 | * grants the recipient permission for further redistribution as
34 | * permitted by this document.
35 | *
36 | * Permission is granted to distribute this code in compiled
37 | * or executable form under the same conditions that apply for
38 | * source code, provided that either:
39 | *
40 | * A. it is accompanied by the corresponding machine-readable
41 | * source code,
42 | * B. it is accompanied by a written offer, with no time limit,
43 | * to give anyone a machine-readable copy of the corresponding
44 | * source code in return for reimbursement of the cost of
45 | * distribution. This written offer must permit verbatim
46 | * duplication by anyone, or
47 | * C. it is distributed by someone who received only the
48 | * executable form, and is accompanied by a copy of the
49 | * written offer of source code that they received concurrently.
50 | *
51 | * In other words, you are welcome to use, share and improve this codes.
52 | * You are forbidden to forbid anyone else to use, share and improve what
53 | * you give them.
54 | *
55 | ************************************************************************/
56 |
57 | package rbe.util;
58 |
59 | public class Debug {
60 | public static void assert(boolean assertCond, String message)
61 | {
62 | if (!assertCond) {
63 | throw new DebugError("Assert failed: " + message);
64 | }
65 | }
66 |
67 | public static void fail(String message)
68 | {
69 | throw new DebugError("Assert failed: " + message);
70 | }
71 | }
72 |
73 | class DebugError extends Error {
74 | String message;
75 |
76 | public DebugError(String message)
77 | {
78 | this.message = message;
79 | }
80 |
81 | public String toString()
82 | {
83 | return ("DebugError: " + message);
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/tpcw/ImgGen/ImgFiles/Makefile~:
--------------------------------------------------------------------------------
1 | CC=gcc
2 | .SUFFIXES: .c .o .h
3 | LDLIBS=-lm
4 | VPATH=$(PWD):$(PWD)/../gd-1.7.2
5 | IPATH=-I$(PWD)
6 | #CFLAGS=-O -v -xchip=ultra -xarch=v8plusa $(IPATH) -xCC
7 | CFLAGS=-O -v -xchip=ultra -xarch=v8plusa $(IPATH)
8 | .c.o :
9 | $(CC) $(CFLAGS) -c -o $@ $<
10 |
11 | all : tpcwIMG
12 |
13 | tpcwIMG : cjpeg.o gdfontg.o jcapimin.o jcapistd.o jccoefct.o jccolor.o \
14 | jcdctmgr.o jchuff.o jcinit.o jcmainct.o jcmarker.o jcmaster.o \
15 | jcomapi.o jcparam.o jcphuff.o jcprepct.o jcsample.o jdatadst.o \
16 | jerror.o jfdctflt.o jfdctfst.o jfdctint.o jmemmgr.o jmemnobs.o \
17 | jutils.o
18 | $(CC) -o $@ $? $(LDLIBS)
19 |
20 | clean :
21 | rm -f *.o
22 | rm -f tpcwIMG
23 |
24 | cjpeg.o : cjpeg.c ../gd-1.7.2/gd.h ../gd-1.7.2/gd_io.h \
25 | ../gd-1.7.2/gdfontg.h cderror.h cdjpeg.h jconfig.h jerror.h \
26 | jinclude.h jmorecfg.h jpeglib.h jversion.h
27 |
28 | gdfontg.o : ../gd-1.7.2/gdfontg.c ../gd-1.7.2/gd.h ../gd-1.7.2/gd_io.h \
29 | ../gd-1.7.2/gdfontg.h
30 |
31 | jcapimin.o : jcapimin.c jconfig.h jerror.h jinclude.h jmorecfg.h \
32 | jpegint.h jpeglib.h
33 |
34 | jcapistd.o : jcapistd.c jconfig.h jerror.h jinclude.h jmorecfg.h \
35 | jpegint.h jpeglib.h
36 |
37 | jccoefct.o : jccoefct.c jconfig.h jerror.h jinclude.h jmorecfg.h \
38 | jpegint.h jpeglib.h
39 |
40 | jccolor.o : jccolor.c jconfig.h jerror.h jinclude.h jmorecfg.h \
41 | jpegint.h jpeglib.h
42 |
43 | jcdctmgr.o : jcdctmgr.c jconfig.h jdct.h jerror.h jinclude.h \
44 | jmorecfg.h jpegint.h jpeglib.h
45 |
46 | jchuff.o : jchuff.c jchuff.h jconfig.h jerror.h jinclude.h \
47 | jmorecfg.h jpegint.h jpeglib.h
48 |
49 | jcinit.o : jcinit.c jconfig.h jerror.h jinclude.h jmorecfg.h \
50 | jpegint.h jpeglib.h
51 |
52 | jcmainct.o : jcmainct.c jconfig.h jerror.h jinclude.h jmorecfg.h \
53 | jpegint.h jpeglib.h
54 |
55 | jcmarker.o : jcmarker.c jconfig.h jerror.h jinclude.h jmorecfg.h \
56 | jpegint.h jpeglib.h
57 |
58 | jcmaster.o : jcmaster.c jconfig.h jerror.h jinclude.h jmorecfg.h \
59 | jpegint.h jpeglib.h
60 |
61 | jcomapi.o : jcomapi.c jconfig.h jerror.h jinclude.h jmorecfg.h \
62 | jpegint.h jpeglib.h
63 |
64 | jcparam.o : jcparam.c jconfig.h jerror.h jinclude.h jmorecfg.h \
65 | jpegint.h jpeglib.h
66 |
67 | jcphuff.o : jcphuff.c jchuff.h jconfig.h jerror.h jinclude.h \
68 | jmorecfg.h jpegint.h jpeglib.h
69 |
70 | jcprepct.o : jcprepct.c jconfig.h jerror.h jinclude.h jmorecfg.h \
71 | jpegint.h jpeglib.h
72 |
73 | jcsample.o : jcsample.c jconfig.h jerror.h jinclude.h jmorecfg.h \
74 | jpegint.h jpeglib.h
75 |
76 | jdatadst.o : jdatadst.c jconfig.h jerror.h jinclude.h jmorecfg.h \
77 | jpeglib.h
78 |
79 | jerror.o : jerror.c jconfig.h jerror.h jinclude.h jmorecfg.h \
80 | jpeglib.h jversion.h
81 |
82 | jfdctflt.o : jfdctflt.c jconfig.h jdct.h jerror.h jinclude.h \
83 | jmorecfg.h jpegint.h jpeglib.h
84 |
85 | jfdctfst.o : jfdctfst.c jconfig.h jdct.h jerror.h jinclude.h \
86 | jmorecfg.h jpegint.h jpeglib.h
87 |
88 | jfdctint.o : jfdctint.c jconfig.h jdct.h jerror.h jinclude.h \
89 | jmorecfg.h jpegint.h jpeglib.h
90 |
91 | jmemmgr.o : jmemmgr.c jconfig.h jerror.h jinclude.h jmemsys.h \
92 | jmorecfg.h jpegint.h jpeglib.h
93 |
94 | jmemnobs.o : jmemnobs.c jconfig.h jerror.h jinclude.h jmemsys.h \
95 | jmorecfg.h jpegint.h jpeglib.h
96 |
97 | jutils.o : jutils.c jconfig.h jerror.h jinclude.h jmorecfg.h \
98 | jpegint.h jpeglib.h
99 |
--------------------------------------------------------------------------------
/tpcw/ImgGen/ImgFiles/jmemnobs.c:
--------------------------------------------------------------------------------
1 | /*
2 | * jmemnobs.c
3 | *
4 | * Copyright (C) 1992-1996, Thomas G. Lane.
5 | * This file is part of the Independent JPEG Group's software.
6 | * For conditions of distribution and use, see the accompanying README file.
7 | *
8 | * This file provides a really simple implementation of the system-
9 | * dependent portion of the JPEG memory manager. This implementation
10 | * assumes that no backing-store files are needed: all required space
11 | * can be obtained from malloc().
12 | * This is very portable in the sense that it'll compile on almost anything,
13 | * but you'd better have lots of main memory (or virtual memory) if you want
14 | * to process big images.
15 | * Note that the max_memory_to_use option is ignored by this implementation.
16 | */
17 |
18 | #define JPEG_INTERNALS
19 | #include "jinclude.h"
20 | #include "jpeglib.h"
21 | #include "jmemsys.h" /* import the system-dependent declarations */
22 |
23 | #ifndef HAVE_STDLIB_H /* should declare malloc(),free() */
24 | extern void * malloc JPP((size_t size));
25 | extern void free JPP((void *ptr));
26 | #endif
27 |
28 |
29 | /*
30 | * Memory allocation and freeing are controlled by the regular library
31 | * routines malloc() and free().
32 | */
33 |
34 | GLOBAL(void *)
35 | jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
36 | {
37 | return (void *) malloc(sizeofobject);
38 | }
39 |
40 | GLOBAL(void)
41 | jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
42 | {
43 | free(object);
44 | }
45 |
46 |
47 | /*
48 | * "Large" objects are treated the same as "small" ones.
49 | * NB: although we include FAR keywords in the routine declarations,
50 | * this file won't actually work in 80x86 small/medium model; at least,
51 | * you probably won't be able to process useful-size images in only 64KB.
52 | */
53 |
54 | GLOBAL(void FAR *)
55 | jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
56 | {
57 | return (void FAR *) malloc(sizeofobject);
58 | }
59 |
60 | GLOBAL(void)
61 | jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
62 | {
63 | free(object);
64 | }
65 |
66 |
67 | /*
68 | * This routine computes the total memory space available for allocation.
69 | * Here we always say, "we got all you want bud!"
70 | */
71 |
72 | GLOBAL(long)
73 | jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
74 | long max_bytes_needed, long already_allocated)
75 | {
76 | return max_bytes_needed;
77 | }
78 |
79 |
80 | /*
81 | * Backing store (temporary file) management.
82 | * Since jpeg_mem_available always promised the moon,
83 | * this should never be called and we can just error out.
84 | */
85 |
86 | GLOBAL(void)
87 | jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
88 | long total_bytes_needed)
89 | {
90 | ERREXIT(cinfo, JERR_NO_BACKING_STORE);
91 | }
92 |
93 |
94 | /*
95 | * These routines take care of any system-dependent initialization and
96 | * cleanup required. Here, there isn't any.
97 | */
98 |
99 | GLOBAL(long)
100 | jpeg_mem_init (j_common_ptr cinfo)
101 | {
102 | return 0; /* just set max_memory_to_use to 0 */
103 | }
104 |
105 | GLOBAL(void)
106 | jpeg_mem_term (j_common_ptr cinfo)
107 | {
108 | /* no work */
109 | }
110 |
--------------------------------------------------------------------------------
/tpcw/servlets/OrderLine.java:
--------------------------------------------------------------------------------
1 | /*
2 | * OrderLine.java - Class contains the perninent information for a single
3 | * item in a single order. Corresponds to a row from the
4 | * ORDER_LINE DB table.
5 | *
6 | ************************************************************************
7 | *
8 | * This is part of the the Java TPC-W distribution,
9 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
10 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
11 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
12 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
13 | *
14 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
15 | * Eric Weglarz, Todd Bezenek.
16 | *
17 | * This source code is distributed "as is" in the hope that it will be
18 | * useful. It comes with no warranty, and no author or distributor
19 | * accepts any responsibility for the consequences of its use.
20 | *
21 | * Everyone is granted permission to copy, modify and redistribute
22 | * this code under the following conditions:
23 | *
24 | * This code is distributed for non-commercial use only.
25 | * Please contact the maintainer for restrictions applying to
26 | * commercial use of these tools.
27 | *
28 | * Permission is granted to anyone to make or distribute copies
29 | * of this code, either as received or modified, in any
30 | * medium, provided that all copyright notices, permission and
31 | * nonwarranty notices are preserved, and that the distributor
32 | * grants the recipient permission for further redistribution as
33 | * permitted by this document.
34 | *
35 | * Permission is granted to distribute this code in compiled
36 | * or executable form under the same conditions that apply for
37 | * source code, provided that either:
38 | *
39 | * A. it is accompanied by the corresponding machine-readable
40 | * source code,
41 | * B. it is accompanied by a written offer, with no time limit,
42 | * to give anyone a machine-readable copy of the corresponding
43 | * source code in return for reimbursement of the cost of
44 | * distribution. This written offer must permit verbatim
45 | * duplication by anyone, or
46 | * C. it is distributed by someone who received only the
47 | * executable form, and is accompanied by a copy of the
48 | * written offer of source code that they received concurrently.
49 | *
50 | * In other words, you are welcome to use, share and improve this codes.
51 | * You are forbidden to forbid anyone else to use, share and improve what
52 | * you give them.
53 | *
54 | ************************************************************************/
55 |
56 | import java.sql.*;
57 |
58 | public class OrderLine {
59 | public OrderLine(ResultSet rs) {
60 | try {
61 | ol_i_id = rs.getInt("ol_i_id");
62 | i_title = rs.getString("i_title");
63 | i_publisher = rs.getString("i_publisher");
64 | i_cost = rs.getDouble("i_cost");
65 | ol_qty = rs.getInt("ol_qty");
66 | ol_discount = rs.getDouble("ol_discount");
67 | ol_comments = rs.getString("ol_comments");
68 | } catch (java.lang.Exception ex) {
69 | ex.printStackTrace();
70 | }
71 | }
72 |
73 | public int ol_i_id;
74 | public String i_title;
75 | public String i_publisher;
76 | public double i_cost;
77 | public int ol_qty;
78 | public double ol_discount;
79 | public String ol_comments;
80 | }
81 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBWWWFactory.java:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | * rbe.EBWWWFactory.java
3 | * Timothy Heil
4 | * 10/20/99
5 | *
6 | * Produces TPCW EBs for transistion subset 1.
7 | *------------------------------------------------------------------------
8 | *
9 | * This is part of the the Java TPC-W distribution,
10 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
11 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
12 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
13 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
14 | *
15 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
16 | * Eric Weglarz, Todd Bezenek.
17 | *
18 | * This source code is distributed "as is" in the hope that it will be
19 | * useful. It comes with no warranty, and no author or distributor
20 | * accepts any responsibility for the consequences of its use.
21 | *
22 | * Everyone is granted permission to copy, modify and redistribute
23 | * this code under the following conditions:
24 | *
25 | * This code is distributed for non-commercial use only.
26 | * Please contact the maintainer for restrictions applying to
27 | * commercial use of these tools.
28 | *
29 | * Permission is granted to anyone to make or distribute copies
30 | * of this code, either as received or modified, in any
31 | * medium, provided that all copyright notices, permission and
32 | * nonwarranty notices are preserved, and that the distributor
33 | * grants the recipient permission for further redistribution as
34 | * permitted by this document.
35 | *
36 | * Permission is granted to distribute this code in compiled
37 | * or executable form under the same conditions that apply for
38 | * source code, provided that either:
39 | *
40 | * A. it is accompanied by the corresponding machine-readable
41 | * source code,
42 | * B. it is accompanied by a written offer, with no time limit,
43 | * to give anyone a machine-readable copy of the corresponding
44 | * source code in return for reimbursement of the cost of
45 | * distribution. This written offer must permit verbatim
46 | * duplication by anyone, or
47 | * C. it is distributed by someone who received only the
48 | * executable form, and is accompanied by a copy of the
49 | * written offer of source code that they received concurrently.
50 | *
51 | * In other words, you are welcome to use, share and improve this codes.
52 | * You are forbidden to forbid anyone else to use, share and improve what
53 | * you give them.
54 | *
55 | ************************************************************************/
56 |
57 |
58 |
59 |
60 | package rbe;
61 |
62 | public class EBWWWFactory extends EBFactory {
63 | private static final EBTransition www =
64 | new EBWWWTrans();
65 |
66 | private static final EBTransition [] trans = {
67 | www
68 | };
69 |
70 | private static final int [][] transProb =
71 | {
72 | // WWW
73 | /*WWW */ { 9999 }
74 | };
75 |
76 | private static final EBTransition [][] transArray =
77 | {
78 | // WWW
79 | /*WWW */ { www }
80 | };
81 |
82 | private int count = 1;
83 |
84 | public EB getEB(RBE rbe)
85 | {
86 | return(new EB(rbe, transProb, transArray, -1,
87 | "WWW EB #" + (count++)));
88 | }
89 |
90 | public int initialize(String [] args, int firstArg) {
91 | return(firstArg);
92 | };
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/tpcw/ImgGen/gd-1.7.2/gd_io_ss.c:
--------------------------------------------------------------------------------
1 | /*
2 | * io_ss.c
3 | *
4 | * Implements the Source/Sink interface.
5 | *
6 | * As will all I/O modules, most functions are for local use only (called
7 | * via function pointers in the I/O context).
8 | *
9 | * The Source/Sink model is the primary 'user' interface for alternate data
10 | * sources; the IOCtx interface is intended (at least in version 1.5) to be
11 | * used internally until it settles down a bit.
12 | *
13 | * This module just layers the Source/Sink interface on top of the IOCtx; no
14 | * support is provided for tell/seek, so GD2 writing is not possible, and
15 | * retrieving parts of GD2 files is also not possible.
16 | *
17 | * A new SS context does not need to be created with both a Source and a Sink.
18 | *
19 | * Written/Modified 1999, Philip Warner.
20 | *
21 | */
22 |
23 | #include
24 | #include
25 | #include
26 | #include "gd.h"
27 |
28 | /* this is used for creating images in main memory*/
29 |
30 | typedef struct ssIOCtx {
31 | gdIOCtx ctx;
32 | gdSourcePtr src;
33 | gdSinkPtr snk;
34 | } ssIOCtx;
35 |
36 | typedef struct ssIOCtx *ssIOCtxPtr;
37 |
38 | gdIOCtx* gdNewSSCtx(gdSourcePtr src, gdSinkPtr snk);
39 |
40 | static int sourceGetbuf( gdIOCtx*, void *, int );
41 | static int sourceGetchar( gdIOCtx* ctx);
42 | static int sinkPutbuf( gdIOCtx* ctx, const void *buf, int size );
43 | static void sinkPutchar( gdIOCtx* ctx, int a );
44 | static void freeSsCtx(gdIOCtx *ctx);
45 |
46 | /* return data as a dynamic pointer */
47 | gdIOCtx* gdNewSSCtx (gdSourcePtr src, gdSinkPtr snk) {
48 | ssIOCtxPtr ctx;
49 |
50 | ctx = (ssIOCtxPtr) malloc(sizeof(ssIOCtx));
51 | if (ctx == NULL) {
52 | return NULL;
53 | }
54 |
55 | ctx->src = src;
56 | ctx->snk = snk;
57 |
58 | ctx->ctx.getC = sourceGetchar;
59 | ctx->ctx.getBuf = sourceGetbuf;
60 |
61 | ctx->ctx.putC = sinkPutchar;
62 | ctx->ctx.putBuf = sinkPutbuf;
63 |
64 | ctx->ctx.tell = NULL;
65 | ctx->ctx.seek = NULL;
66 |
67 | ctx->ctx.free = freeSsCtx;
68 |
69 | return (gdIOCtx*)ctx;
70 | }
71 |
72 | static
73 | void freeSsCtx(gdIOCtx *ctx)
74 | {
75 | free(ctx);
76 | }
77 |
78 |
79 | static int
80 | sourceGetbuf( gdIOCtx* ctx, void *buf, int size )
81 | {
82 | ssIOCtx *lctx;
83 | int res;
84 |
85 | lctx = (ssIOCtx*) ctx;
86 |
87 | res = ((lctx->src->source)(lctx->src->context, buf, size));
88 |
89 | /*
90 | ** Translate the return values from the Source object:
91 | ** 0 is EOF, -1 is error
92 | */
93 |
94 | if (res == 0) {
95 | return EOF;
96 | } else if (res < 0) {
97 | return 0;
98 | } else {
99 | return res;
100 | };
101 |
102 | }
103 |
104 | static int sourceGetchar( gdIOCtx* ctx)
105 | {
106 | int res;
107 | unsigned char buf;
108 |
109 | res = sourceGetbuf(ctx, &buf, 1);
110 |
111 | if (res == 1) {
112 | return buf;
113 | } else {
114 | return EOF;
115 | };
116 |
117 | }
118 |
119 | static int
120 | sinkPutbuf( gdIOCtx* ctx, const void *buf, int size )
121 | {
122 | ssIOCtxPtr lctx;
123 | int res;
124 |
125 | lctx = (ssIOCtx*) ctx;
126 |
127 | res = (lctx->snk->sink)(lctx->snk->context, buf, size);
128 |
129 | if (res <= 0) {
130 | return 0;
131 | } else {
132 | return res;
133 | };
134 |
135 | }
136 |
137 | static void
138 | sinkPutchar( gdIOCtx* ctx, int a )
139 | {
140 | unsigned char b;
141 |
142 | b = a;
143 | sinkPutbuf(ctx, &b, 1);
144 |
145 | }
146 |
147 |
148 |
--------------------------------------------------------------------------------
/tpcw/ImgGen/gd-1.7.2/gddemo.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include "gd.h"
3 | #include "gdfontg.h"
4 | #include "gdfonts.h"
5 |
6 | int main(void)
7 | {
8 | /* Input and output files */
9 | FILE *in;
10 | FILE *out;
11 |
12 | /* Input and output images */
13 | gdImagePtr im_in, im_out;
14 |
15 | /* Brush image */
16 | gdImagePtr brush;
17 |
18 | /* Color indexes */
19 | int white;
20 | int blue;
21 | int red;
22 | int green;
23 |
24 | /* Points for polygon */
25 | gdPoint points[3];
26 |
27 | /* Create output image, 128 by 128 pixels. */
28 | im_out = gdImageCreate(128, 128);
29 |
30 | /* First color allocated is background. */
31 | white = gdImageColorAllocate(im_out, 255, 255, 255);
32 |
33 | /* Set transparent color. */
34 | gdImageColorTransparent(im_out, white);
35 |
36 | /* Try to load demoin.png and paste part of it into the
37 | output image. */
38 |
39 | in = fopen("demoin.png", "rb");
40 | if (!in) {
41 | fprintf(stderr, "Can't load source image; this demo\n");
42 | fprintf(stderr, "is much more impressive if demoin.png\n");
43 | fprintf(stderr, "is available.\n");
44 | im_in = 0;
45 | } else {
46 | im_in = gdImageCreateFromPng(in);
47 | fclose(in);
48 | /* Now copy, and magnify as we do so */
49 | gdImageCopyResized(im_out, im_in,
50 | 16, 16, 0, 0, 96, 96, 127, 127);
51 | }
52 | red = gdImageColorAllocate(im_out, 255, 0, 0);
53 | green = gdImageColorAllocate(im_out, 0, 255, 0);
54 | blue = gdImageColorAllocate(im_out, 0, 0, 255);
55 | /* Rectangle */
56 | gdImageLine(im_out, 8, 8, 120, 8, green);
57 | gdImageLine(im_out, 120, 8, 120, 120, green);
58 | gdImageLine(im_out, 120, 120, 8, 120, green);
59 | gdImageLine(im_out, 8, 120, 8, 8, green);
60 | /* Circle */
61 | gdImageArc(im_out, 64, 64, 30, 10, 0, 360, blue);
62 | /* Arc */
63 | gdImageArc(im_out, 64, 64, 20, 20, 45, 135, blue);
64 | /* Flood fill */
65 | gdImageFill(im_out, 4, 4, blue);
66 | /* Polygon */
67 | points[0].x = 32;
68 | points[0].y = 0;
69 | points[1].x = 0;
70 | points[1].y = 64;
71 | points[2].x = 64;
72 | points[2].y = 64;
73 | gdImageFilledPolygon(im_out, points, 3, green);
74 | /* Brush. A fairly wild example also involving a line style! */
75 | if (im_in) {
76 | int style[8];
77 | brush = gdImageCreate(8, 8);
78 | gdImageCopyResized(brush, im_in,
79 | 0, 0, 0, 0,
80 | gdImageSX(brush), gdImageSY(brush),
81 | gdImageSX(im_in), gdImageSY(im_in));
82 | gdImageSetBrush(im_out, brush);
83 | /* With a style, so they won't overprint each other.
84 | Normally, they would, yielding a fat-brush effect. */
85 | style[0] = 0;
86 | style[1] = 0;
87 | style[2] = 0;
88 | style[3] = 0;
89 | style[4] = 0;
90 | style[5] = 0;
91 | style[6] = 0;
92 | style[7] = 1;
93 | gdImageSetStyle(im_out, style, 8);
94 | /* Draw the styled, brushed line */
95 | gdImageLine(im_out, 0, 127, 127, 0, gdStyledBrushed);
96 | }
97 | /* Text */
98 | gdImageString(im_out, gdFontGiant, 16, 16,
99 | (unsigned char *) "hi", red);
100 | gdImageStringUp(im_out, gdFontSmall, 32, 32,
101 | (unsigned char *) "hi", red);
102 | /* Make output image interlaced (allows "fade in" in some viewers,
103 | and in the latest web browsers) */
104 | gdImageInterlace(im_out, 1);
105 | out = fopen("demoout.png", "wb");
106 | /* Write PNG */
107 | gdImagePng(im_out, out);
108 | fclose(out);
109 | gdImageDestroy(im_out);
110 | if (im_in) {
111 | gdImageDestroy(im_in);
112 | }
113 | return 0;
114 | }
115 |
116 |
--------------------------------------------------------------------------------
/tpcw/ImgGen/ImgFiles/Makefile:
--------------------------------------------------------------------------------
1 | CC=gcc
2 | .SUFFIXES: .c .o .h
3 | LDLIBS=-lm
4 | VPATH=$(PWD):$(PWD)/../gd-1.7.2:$(PWD)/tpcw/ImgGen/ImgFiles:$(PWD)/tpcw/ImgGen/gd-1.7.2
5 | IPATH=-I$(PWD)
6 | #CFLAGS=-O -v -xchip=ultra -xarch=v8plusa $(IPATH) -xCC
7 | CFLAGS=-O -v $(IPATH)
8 | .c.o :
9 | $(CC) $(CFLAGS) -c -o $@ $<
10 |
11 | all : tpcwIMG
12 |
13 | tpcwIMG : cjpeg.o gdfontg.o jcapimin.o jcapistd.o jccoefct.o jccolor.o \
14 | jcdctmgr.o jchuff.o jcinit.o jcmainct.o jcmarker.o jcmaster.o \
15 | jcomapi.o jcparam.o jcphuff.o jcprepct.o jcsample.o jdatadst.o \
16 | jerror.o jfdctflt.o jfdctfst.o jfdctint.o jmemmgr.o jmemnobs.o \
17 | jutils.o
18 | $(CC) -o $@ $? $(LDLIBS)
19 |
20 | clean :
21 | rm -f *.o
22 | rm -f tpcwIMG
23 | rm -f tpcwIMG.exe
24 |
25 | cjpeg.o : cjpeg.c ../gd-1.7.2/gd.h ../gd-1.7.2/gd_io.h \
26 | ../gd-1.7.2/gdfontg.h cderror.h cdjpeg.h jconfig.h jerror.h \
27 | jinclude.h jmorecfg.h jpeglib.h jversion.h
28 |
29 | gdfontg.o : ../gd-1.7.2/gdfontg.c ../gd-1.7.2/gd.h ../gd-1.7.2/gd_io.h \
30 | ../gd-1.7.2/gdfontg.h
31 |
32 | jcapimin.o : jcapimin.c jconfig.h jerror.h jinclude.h jmorecfg.h \
33 | jpegint.h jpeglib.h
34 |
35 | jcapistd.o : jcapistd.c jconfig.h jerror.h jinclude.h jmorecfg.h \
36 | jpegint.h jpeglib.h
37 |
38 | jccoefct.o : jccoefct.c jconfig.h jerror.h jinclude.h jmorecfg.h \
39 | jpegint.h jpeglib.h
40 |
41 | jccolor.o : jccolor.c jconfig.h jerror.h jinclude.h jmorecfg.h \
42 | jpegint.h jpeglib.h
43 |
44 | jcdctmgr.o : jcdctmgr.c jconfig.h jdct.h jerror.h jinclude.h \
45 | jmorecfg.h jpegint.h jpeglib.h
46 |
47 | jchuff.o : jchuff.c jchuff.h jconfig.h jerror.h jinclude.h \
48 | jmorecfg.h jpegint.h jpeglib.h
49 |
50 | jcinit.o : jcinit.c jconfig.h jerror.h jinclude.h jmorecfg.h \
51 | jpegint.h jpeglib.h
52 |
53 | jcmainct.o : jcmainct.c jconfig.h jerror.h jinclude.h jmorecfg.h \
54 | jpegint.h jpeglib.h
55 |
56 | jcmarker.o : jcmarker.c jconfig.h jerror.h jinclude.h jmorecfg.h \
57 | jpegint.h jpeglib.h
58 |
59 | jcmaster.o : jcmaster.c jconfig.h jerror.h jinclude.h jmorecfg.h \
60 | jpegint.h jpeglib.h
61 |
62 | jcomapi.o : jcomapi.c jconfig.h jerror.h jinclude.h jmorecfg.h \
63 | jpegint.h jpeglib.h
64 |
65 | jcparam.o : jcparam.c jconfig.h jerror.h jinclude.h jmorecfg.h \
66 | jpegint.h jpeglib.h
67 |
68 | jcphuff.o : jcphuff.c jchuff.h jconfig.h jerror.h jinclude.h \
69 | jmorecfg.h jpegint.h jpeglib.h
70 |
71 | jcprepct.o : jcprepct.c jconfig.h jerror.h jinclude.h jmorecfg.h \
72 | jpegint.h jpeglib.h
73 |
74 | jcsample.o : jcsample.c jconfig.h jerror.h jinclude.h jmorecfg.h \
75 | jpegint.h jpeglib.h
76 |
77 | jdatadst.o : jdatadst.c jconfig.h jerror.h jinclude.h jmorecfg.h \
78 | jpeglib.h
79 |
80 | jerror.o : jerror.c jconfig.h jerror.h jinclude.h jmorecfg.h \
81 | jpeglib.h jversion.h
82 |
83 | jfdctflt.o : jfdctflt.c jconfig.h jdct.h jerror.h jinclude.h \
84 | jmorecfg.h jpegint.h jpeglib.h
85 |
86 | jfdctfst.o : jfdctfst.c jconfig.h jdct.h jerror.h jinclude.h \
87 | jmorecfg.h jpegint.h jpeglib.h
88 |
89 | jfdctint.o : jfdctint.c jconfig.h jdct.h jerror.h jinclude.h \
90 | jmorecfg.h jpegint.h jpeglib.h
91 |
92 | jmemmgr.o : jmemmgr.c jconfig.h jerror.h jinclude.h jmemsys.h \
93 | jmorecfg.h jpegint.h jpeglib.h
94 |
95 | jmemnobs.o : jmemnobs.c jconfig.h jerror.h jinclude.h jmemsys.h \
96 | jmorecfg.h jpegint.h jpeglib.h
97 |
98 | jutils.o : jutils.c jconfig.h jerror.h jinclude.h jmorecfg.h \
99 | jpegint.h jpeglib.h
100 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBBDeltaTrans.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * rbe.EBBDeltaTrans.java
3 | * Timothy Heil
4 | * 10/26/99
5 | *
6 | * ECE902 Fall '99
7 | *
8 | * TPC-B Dummy Delta transition.
9 | *------------------------------------------------------------------------
10 | *
11 | * This is part of the the Java TPC-W distribution,
12 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
13 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
14 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
15 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
16 | *
17 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
18 | * Eric Weglarz, Todd Bezenek.
19 | *
20 | * This source code is distributed "as is" in the hope that it will be
21 | * useful. It comes with no warranty, and no author or distributor
22 | * accepts any responsibility for the consequences of its use.
23 | *
24 | * Everyone is granted permission to copy, modify and redistribute
25 | * this code under the following conditions:
26 | *
27 | * This code is distributed for non-commercial use only.
28 | * Please contact the maintainer for restrictions applying to
29 | * commercial use of these tools.
30 | *
31 | * Permission is granted to anyone to make or distribute copies
32 | * of this code, either as received or modified, in any
33 | * medium, provided that all copyright notices, permission and
34 | * nonwarranty notices are preserved, and that the distributor
35 | * grants the recipient permission for further redistribution as
36 | * permitted by this document.
37 | *
38 | * Permission is granted to distribute this code in compiled
39 | * or executable form under the same conditions that apply for
40 | * source code, provided that either:
41 | *
42 | * A. it is accompanied by the corresponding machine-readable
43 | * source code,
44 | * B. it is accompanied by a written offer, with no time limit,
45 | * to give anyone a machine-readable copy of the corresponding
46 | * source code in return for reimbursement of the cost of
47 | * distribution. This written offer must permit verbatim
48 | * duplication by anyone, or
49 | * C. it is distributed by someone who received only the
50 | * executable form, and is accompanied by a copy of the
51 | * written offer of source code that they received concurrently.
52 | *
53 | * In other words, you are welcome to use, share and improve this codes.
54 | * You are forbidden to forbid anyone else to use, share and improve what
55 | * you give them.
56 | *
57 | ************************************************************************/
58 |
59 |
60 | package rbe;
61 |
62 | public class EBBDeltaTrans extends EBTransition {
63 |
64 | public static final String miscStuff =
65 | "01234567890123456789012345678901234567890123456789" +
66 | "01234567890123456789012345678901234567890123456789";
67 | public String request(EB eb, String html) {
68 | EBB ebb = (EBB) eb;
69 | RBE rbe = ebb.rbe;
70 |
71 | int bid = ebb.nextBID();
72 | int tid = ebb.nextTID();
73 | int aid = ebb.nextAID();
74 | int delta = ebb.nextDelta();
75 |
76 | String req = "?" +
77 | "branch=" + bid + "&" +
78 | "teller=" + tid + "&" +
79 | "account=" + aid + "&" +
80 | "delta=" + delta + "&misc=";
81 |
82 | if (req.length()<100) {
83 | req = req + miscStuff.substring(0,100-req.length());
84 | }
85 |
86 | return(RBE.www1 + "servlet/TPCA_requestHttpServlet" + req);
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/tpcw/rbe/EBTestFactory.java:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | * rbe.EBTestFactory.java
3 | * Timothy Heil
4 | * 10/5/99
5 | *
6 | * Produces Test EBs.
7 | *------------------------------------------------------------------------
8 | *
9 | * This is part of the the Java TPC-W distribution,
10 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
11 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
12 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
13 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
14 | *
15 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
16 | * Eric Weglarz, Todd Bezenek.
17 | *
18 | * This source code is distributed "as is" in the hope that it will be
19 | * useful. It comes with no warranty, and no author or distributor
20 | * accepts any responsibility for the consequences of its use.
21 | *
22 | * Everyone is granted permission to copy, modify and redistribute
23 | * this code under the following conditions:
24 | *
25 | * This code is distributed for non-commercial use only.
26 | * Please contact the maintainer for restrictions applying to
27 | * commercial use of these tools.
28 | *
29 | * Permission is granted to anyone to make or distribute copies
30 | * of this code, either as received or modified, in any
31 | * medium, provided that all copyright notices, permission and
32 | * nonwarranty notices are preserved, and that the distributor
33 | * grants the recipient permission for further redistribution as
34 | * permitted by this document.
35 | *
36 | * Permission is granted to distribute this code in compiled
37 | * or executable form under the same conditions that apply for
38 | * source code, provided that either:
39 | *
40 | * A. it is accompanied by the corresponding machine-readable
41 | * source code,
42 | * B. it is accompanied by a written offer, with no time limit,
43 | * to give anyone a machine-readable copy of the corresponding
44 | * source code in return for reimbursement of the cost of
45 | * distribution. This written offer must permit verbatim
46 | * duplication by anyone, or
47 | * C. it is distributed by someone who received only the
48 | * executable form, and is accompanied by a copy of the
49 | * written offer of source code that they received concurrently.
50 | *
51 | * In other words, you are welcome to use, share and improve this codes.
52 | * You are forbidden to forbid anyone else to use, share and improve what
53 | * you give them.
54 | *
55 | ************************************************************************/
56 |
57 | package rbe;
58 |
59 | public class EBTestFactory extends EBFactory {
60 | private static final EBTransition homeTrans =
61 | new EBSimpleTrans("http://www.cs.wisc.edu/~heil/");
62 | private static final EBTransition resTrans =
63 | new EBSimpleTrans("http://www.cae.wisc.edu/~ecearch/strata/");
64 | private static final EBTransition famTrans =
65 | new EBSimpleTrans("http://www.cs.wisc.edu/~heil/family.html");
66 |
67 | private int count = 1;
68 |
69 | private static final int [][] transProb =
70 | {
71 | { 3000, 6000, 9999 },
72 | { 3000, 6000, 9999 },
73 | { 3000, 6000, 9999 }
74 | };
75 |
76 | private static final EBTransition [][] trans =
77 | {
78 | { homeTrans, resTrans, famTrans },
79 | { homeTrans, resTrans, famTrans },
80 | { homeTrans, resTrans, famTrans }
81 | };
82 |
83 | public EB getEB(RBE rbe)
84 | {
85 | return(new EB(rbe, transProb, trans, 3,
86 | "Test EB #" + (count++)));
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/tpcw/servlets/ShortBook.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ShortBook.java - Class stores a subset of the information related to a
3 | * a single ITEM in the DB.
4 | *
5 | ************************************************************************
6 | *
7 | * This is part of the the Java TPC-W distribution,
8 | * written by Harold Cain, Tim Heil, Milo Martin, Eric Weglarz, and Todd
9 | * Bezenek. University of Wisconsin - Madison, Computer Sciences
10 | * Dept. and Dept. of Electrical and Computer Engineering, as a part of
11 | * Prof. Mikko Lipasti's Fall 1999 ECE 902 course.
12 | *
13 | * Copyright (C) 1999, 2000 by Harold Cain, Timothy Heil, Milo Martin,
14 | * Eric Weglarz, Todd Bezenek.
15 | *
16 | * This source code is distributed "as is" in the hope that it will be
17 | * useful. It comes with no warranty, and no author or distributor
18 | * accepts any responsibility for the consequences of its use.
19 | *
20 | * Everyone is granted permission to copy, modify and redistribute
21 | * this code under the following conditions:
22 | *
23 | * This code is distributed for non-commercial use only.
24 | * Please contact the maintainer for restrictions applying to
25 | * commercial use of these tools.
26 | *
27 | * Permission is granted to anyone to make or distribute copies
28 | * of this code, either as received or modified, in any
29 | * medium, provided that all copyright notices, permission and
30 | * nonwarranty notices are preserved, and that the distributor
31 | * grants the recipient permission for further redistribution as
32 | * permitted by this document.
33 | *
34 | * Permission is granted to distribute this code in compiled
35 | * or executable form under the same conditions that apply for
36 | * source code, provided that either:
37 | *
38 | * A. it is accompanied by the corresponding machine-readable
39 | * source code,
40 | * B. it is accompanied by a written offer, with no time limit,
41 | * to give anyone a machine-readable copy of the corresponding
42 | * source code in return for reimbursement of the cost of
43 | * distribution. This written offer must permit verbatim
44 | * duplication by anyone, or
45 | * C. it is distributed by someone who received only the
46 | * executable form, and is accompanied by a copy of the
47 | * written offer of source code that they received concurrently.
48 | *
49 | * In other words, you are welcome to use, share and improve this codes.
50 | * You are forbidden to forbid anyone else to use, share and improve what
51 | * you give them.
52 | *
53 | ************************************************************************/
54 |
55 | import java.util.Date;
56 | import java.sql.*;
57 |
58 | public class ShortBook {
59 | // Construct a book from a ResultSet
60 | public ShortBook(ResultSet rs) {
61 | // The result set should have all of the fields we expect.
62 | // This relies on using field name access. It might be a bad
63 | // way to break this up since it does not allow us to use the
64 | // more efficient select by index access method. This also
65 | // might be a problem since there is no type checking on the
66 | // result set to make sure it is even a reasonble result set
67 | // to give to this function.
68 |
69 | try {
70 | i_id = rs.getInt("i_id");
71 | i_title = rs.getString("i_title");
72 | a_fname = rs.getString("a_fname");
73 | a_lname = rs.getString("a_lname");
74 | } catch (java.lang.Exception ex) {
75 | ex.printStackTrace();
76 | }
77 | }
78 | // From Item
79 | public int i_id;
80 | public String i_title;
81 | public String a_fname;
82 | public String a_lname;
83 | }
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------