├── tpcw ├── matlab │ ├── test.m │ ├── wi_init.m │ ├── wi_admc.m │ ├── wi_admr.m │ ├── wi_bess.m │ ├── wi_buyc.m │ ├── wi_buyr.m │ ├── wi_creg.m │ ├── wi_home.m │ ├── wi_newp.m │ ├── wi_ordd.m │ ├── wi_ordi.m │ ├── wi_prod.m │ ├── wi_shop.m │ ├── wi_sreq.m │ ├── wi_sres.m │ ├── statProb.m │ ├── ishort.m │ ├── wirtcon.m │ ├── think.m │ ├── printwi.m │ ├── wirt.m │ ├── iname.m │ ├── wirtvsthr.m │ ├── wips.m │ ├── tran.m │ └── wirti.m ├── ImgGen │ ├── README │ ├── gd-1.7.2 │ │ ├── demoin.png │ │ ├── demoout.png │ │ ├── gdtestttf.c │ │ ├── test │ │ │ ├── gdtest.gd2 │ │ │ ├── gdtest.png │ │ │ ├── gdtest_merge.png │ │ │ └── gdtest_200_300_150_100.png │ │ ├── gdfontmb.h │ │ ├── gdfonts.h │ │ ├── gdfontt.h │ │ ├── gdfontg.h │ │ ├── gdfontl.h │ │ ├── gd_ss.c │ │ ├── gdtopng.c │ │ ├── pngtogd.c │ │ ├── gd2topng.c │ │ ├── mathmake.c │ │ ├── gd_io.h │ │ ├── pngtogd2.c │ │ ├── gdparttopng.c │ │ ├── gd2time.c │ │ ├── gd2copypal.c │ │ ├── COPYING │ │ ├── gdcache.h │ │ ├── gd_io_file.c │ │ ├── gd_io_ss.c │ │ └── gddemo.c │ └── ImgFiles │ │ ├── RestFiles │ │ ├── release │ │ │ └── last.exe │ │ ├── font.cpp │ │ ├── last.dsw │ │ ├── rdgif.c │ │ └── cjpeg.bak │ │ ├── jversion.h │ │ ├── README.COMPILE │ │ ├── jconfig.h │ │ ├── jchuff.h │ │ ├── jcinit.c │ │ ├── Makefile~ │ │ ├── jmemnobs.c │ │ └── Makefile ├── images │ ├── add_B.gif │ ├── home_B.gif │ ├── search_B.gif │ ├── submit_B.gif │ ├── tpclogo.gif │ ├── update_B.gif │ ├── checkout_B.gif │ ├── refresh_B.gif │ ├── whats_new.gif │ ├── best_sellers.gif │ ├── order_status_B.gif │ ├── shopping_cart_B.gif │ └── display_last_order_B.gif ├── rbe │ ├── args │ │ ├── Arg.class │ │ ├── ArgDB.class │ │ ├── IntArg.class │ │ ├── DateArg.class │ │ ├── DoubleArg.class │ │ ├── StringArg.class │ │ ├── BooleanArg.class │ │ ├── Arg$Exception.class │ │ ├── PrintStreamArg.class │ │ ├── StringArg.java~ │ │ ├── PrintStreamArg.java~ │ │ ├── IntArg.java~ │ │ ├── DoubleArg.java~ │ │ ├── ArgDB.java~ │ │ ├── BooleanArg.java~ │ │ ├── DateArg.java~ │ │ └── Arg.java~ │ ├── util │ │ ├── Pad.class │ │ ├── Debug.class │ │ ├── Histogram.class │ │ ├── DebugError.class │ │ ├── CharStrPattern.class │ │ ├── StrStrPattern.class │ │ ├── StringPattern.class │ │ ├── AbCharStrPattern.class │ │ ├── CharRangeStrPattern.class │ │ ├── CharSetStrPattern.class │ │ ├── CharStrPattern.java~ │ │ ├── CharRangeStrPattern.java~ │ │ ├── Debug.java~ │ │ ├── AbCharStrPattern.java~ │ │ ├── StrStrPattern.java~ │ │ ├── StringPattern.java~ │ │ ├── CharSetStrPattern.java~ │ │ ├── CharStrPattern.java │ │ ├── CharRangeStrPattern.java │ │ ├── TestPattern.java~ │ │ └── Debug.java │ ├── EBWCustRegTrans.java │ ├── README_TPCA │ ├── EBB.java~ │ ├── EBFactory.java │ ├── EBBInitTrans.java │ ├── EBWWWTrans.java │ ├── EBWSearchReqTrans.java │ ├── EBWOrderInqTrans.java │ ├── EBWBestSellTrans.java │ ├── EBSimpleTrans.java │ ├── EBWHomeTrans.java │ ├── EBTransition.java │ ├── EBWProdCURLTrans.java │ ├── EBWOrderDispTrans.java │ ├── EBFactoryArg.java │ ├── EBWNewProdTrans.java │ ├── EBWWWFactory.java │ ├── EBBDeltaTrans.java │ └── EBTestFactory.java ├── populate │ ├── Makefile │ └── populate_images ├── runtpcw ├── COPYRIGHT └── servlets │ ├── Address.java │ ├── BuyConfirmResult.java │ ├── CartLine.java │ ├── OrderLine.java │ └── ShortBook.java ├── docs ├── api │ ├── rbe │ │ ├── package-list │ │ ├── index.html │ │ ├── packages.html │ │ └── stylesheet.css │ └── servlets │ │ ├── package-list │ │ ├── index.html │ │ ├── packages.html │ │ ├── stylesheet.css │ │ ├── allclasses-noframe.html │ │ └── allclasses-frame.html ├── tpcw-classes.png ├── tpcw-servlets.png ├── page.css ├── doc.html └── index.html ├── README.md ├── tpcw.properties ├── main.properties └── rbe.sh /tpcw/matlab/test.m: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/api/rbe/package-list: -------------------------------------------------------------------------------- 1 | rbe 2 | -------------------------------------------------------------------------------- /docs/api/servlets/package-list: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tpcw/ImgGen/README: -------------------------------------------------------------------------------- 1 | Please read the file ImgFiles/README.COMPILE before proceeding. 2 | -------------------------------------------------------------------------------- /docs/tpcw-classes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/docs/tpcw-classes.png -------------------------------------------------------------------------------- /tpcw/images/add_B.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/add_B.gif -------------------------------------------------------------------------------- /docs/tpcw-servlets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/docs/tpcw-servlets.png -------------------------------------------------------------------------------- /tpcw/images/home_B.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/home_B.gif -------------------------------------------------------------------------------- /tpcw/images/search_B.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/search_B.gif -------------------------------------------------------------------------------- /tpcw/images/submit_B.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/submit_B.gif -------------------------------------------------------------------------------- /tpcw/images/tpclogo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/tpclogo.gif -------------------------------------------------------------------------------- /tpcw/images/update_B.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/update_B.gif -------------------------------------------------------------------------------- /tpcw/rbe/args/Arg.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/args/Arg.class -------------------------------------------------------------------------------- /tpcw/rbe/util/Pad.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/util/Pad.class -------------------------------------------------------------------------------- /tpcw/images/checkout_B.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/checkout_B.gif -------------------------------------------------------------------------------- /tpcw/images/refresh_B.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/refresh_B.gif -------------------------------------------------------------------------------- /tpcw/images/whats_new.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/whats_new.gif -------------------------------------------------------------------------------- /tpcw/rbe/args/ArgDB.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/args/ArgDB.class -------------------------------------------------------------------------------- /tpcw/rbe/args/IntArg.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/args/IntArg.class -------------------------------------------------------------------------------- /tpcw/rbe/util/Debug.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/util/Debug.class -------------------------------------------------------------------------------- /tpcw/images/best_sellers.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/best_sellers.gif -------------------------------------------------------------------------------- /tpcw/rbe/args/DateArg.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/args/DateArg.class -------------------------------------------------------------------------------- /tpcw/rbe/args/DoubleArg.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/args/DoubleArg.class -------------------------------------------------------------------------------- /tpcw/rbe/args/StringArg.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/args/StringArg.class -------------------------------------------------------------------------------- /tpcw/rbe/util/Histogram.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/util/Histogram.class -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/demoin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/ImgGen/gd-1.7.2/demoin.png -------------------------------------------------------------------------------- /tpcw/images/order_status_B.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/order_status_B.gif -------------------------------------------------------------------------------- /tpcw/images/shopping_cart_B.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/shopping_cart_B.gif -------------------------------------------------------------------------------- /tpcw/rbe/args/BooleanArg.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/args/BooleanArg.class -------------------------------------------------------------------------------- /tpcw/rbe/util/DebugError.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/util/DebugError.class -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/demoout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/ImgGen/gd-1.7.2/demoout.png -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gdtestttf.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/ImgGen/gd-1.7.2/gdtestttf.c -------------------------------------------------------------------------------- /tpcw/rbe/args/Arg$Exception.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/args/Arg$Exception.class -------------------------------------------------------------------------------- /tpcw/rbe/args/PrintStreamArg.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/args/PrintStreamArg.class -------------------------------------------------------------------------------- /tpcw/rbe/util/CharStrPattern.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/util/CharStrPattern.class -------------------------------------------------------------------------------- /tpcw/rbe/util/StrStrPattern.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/util/StrStrPattern.class -------------------------------------------------------------------------------- /tpcw/rbe/util/StringPattern.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/util/StringPattern.class -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/test/gdtest.gd2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/ImgGen/gd-1.7.2/test/gdtest.gd2 -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/test/gdtest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/ImgGen/gd-1.7.2/test/gdtest.png -------------------------------------------------------------------------------- /tpcw/images/display_last_order_B.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/images/display_last_order_B.gif -------------------------------------------------------------------------------- /tpcw/rbe/util/AbCharStrPattern.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/util/AbCharStrPattern.class -------------------------------------------------------------------------------- /tpcw/rbe/util/CharRangeStrPattern.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/util/CharRangeStrPattern.class -------------------------------------------------------------------------------- /tpcw/rbe/util/CharSetStrPattern.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/rbe/util/CharSetStrPattern.class -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/test/gdtest_merge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/ImgGen/gd-1.7.2/test/gdtest_merge.png -------------------------------------------------------------------------------- /tpcw/ImgGen/ImgFiles/RestFiles/release/last.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/ImgGen/ImgFiles/RestFiles/release/last.exe -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/test/gdtest_200_300_150_100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jopereira/java-tpcw/HEAD/tpcw/ImgGen/gd-1.7.2/test/gdtest_200_300_150_100.png -------------------------------------------------------------------------------- /tpcw/populate/Makefile: -------------------------------------------------------------------------------- 1 | JAVAC=javac 2 | 3 | all: TPCW_Populate.class 4 | 5 | TPCW_Populate.class: TPCW_Populate.java 6 | $(JAVAC) TPCW_Populate.java 7 | 8 | clean: 9 | rm TPCW_Populate.class 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_init.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_init() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_init() 4 | % 5 | % Returns the interaction number of the init interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 1; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_admc.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_admc() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_admc() 4 | % 5 | % Returns the interaction number of the admc interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 2; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_admr.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_admr() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_admr() 4 | % 5 | % Returns the interaction number of the admr interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 3; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_bess.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_bess() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_bess() 4 | % 5 | % Returns the interaction number of the bess interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 4; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_buyc.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_buyc() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_buyc() 4 | % 5 | % Returns the interaction number of the buyc interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 5; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_buyr.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_buyr() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_buyr() 4 | % 5 | % Returns the interaction number of the buyr interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 6; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_creg.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_creg() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_creg() 4 | % 5 | % Returns the interaction number of the creg interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 7; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_home.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_home() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_home() 4 | % 5 | % Returns the interaction number of the home interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 8; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_newp.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_newp() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_newp() 4 | % 5 | % Returns the interaction number of the newp interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 9; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_ordd.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_ordd() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_ordd() 4 | % 5 | % Returns the interaction number of the ordd interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 10; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_ordi.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_ordi() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_ordi() 4 | % 5 | % Returns the interaction number of the ordi interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 11; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_prod.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_prod() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_prod() 4 | % 5 | % Returns the interaction number of the prod interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 12; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_shop.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_shop() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_shop() 4 | % 5 | % Returns the interaction number of the shop interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 15; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_sreq.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_sreq() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_sreq() 4 | % 5 | % Returns the interaction number of the sreq interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 13; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/wi_sres.m: -------------------------------------------------------------------------------- 1 | function [n] = wi_sres() 2 | %------------------------------------------------------------------------- 3 | % function [n] = wi_sres() 4 | % 5 | % Returns the interaction number of the sres interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = 14; 9 | 10 | -------------------------------------------------------------------------------- /tpcw/matlab/statProb.m: -------------------------------------------------------------------------------- 1 | function [s] = statProb(t) 2 | %------------------------------------------------------------------------- 3 | % function [s] = statProb(t) 4 | % 5 | % Finds the steady-state probabilites for a state transition table. 6 | % Assumes the original transition table, t, is ergodic. 7 | %------------------------------------------------------------------------- 8 | s = [1,zeros(1,14)]; 9 | 10 | for i=1:29 11 | s = s*t; 12 | end 13 | 14 | -------------------------------------------------------------------------------- /tpcw/ImgGen/ImgFiles/jversion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jversion.h 3 | * 4 | * Copyright (C) 1991-1998, 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 contains software version identification. 9 | */ 10 | 11 | 12 | #define JVERSION "6b 27-Mar-1998" 13 | 14 | #define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane" 15 | -------------------------------------------------------------------------------- /tpcw/matlab/ishort.m: -------------------------------------------------------------------------------- 1 | function [n] = ishort(i) 2 | %------------------------------------------------------------------------- 3 | % function [n] = ishort(i) 4 | % 5 | % Returns the four letter string name of an interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = { 'init', 'admc', 'admr', 'bess', 'buyc', 'buyr', 'creg', 'home', 'newp', 'ordd', 'ordi', 'prod', 'sreq', 'sres', 'shop' }; 9 | 10 | n = n{i}; 11 | 12 | -------------------------------------------------------------------------------- /tpcw/matlab/wirtcon.m: -------------------------------------------------------------------------------- 1 | function [n] = wirtcon(i) 2 | %------------------------------------------------------------------------- 3 | % function [n] = wirtcon(i) 4 | % 5 | % Returns the 90% WIRT contraint for a given interaction number. 6 | %------------------------------------------------------------------------- 7 | 8 | % Official TPC-W Spec 9 | % n = [1 20 1 5 5 1 2 1 5 2 1 1 1 10 1]; 10 | 11 | % Ours. 12 | n = [5 20 5 5 5 5 2 5 5 2 5 5 5 10 5]; 13 | 14 | n = n(i); 15 | 16 | -------------------------------------------------------------------------------- /tpcw/matlab/think.m: -------------------------------------------------------------------------------- 1 | function [w] = think(dat) 2 | %------------------------------------------------------------------------ 3 | % function [] = think(dat) 4 | % 5 | % Plots a distribution of think time over all transactions. 6 | %------------------------------------------------------------------------ 7 | 8 | clf; 9 | hold on; 10 | l = plot(dat.tt.h(:,1)/1000, dat.tt.h(:,2)); 11 | 12 | title({'Think Time Histogram', sprintf('Avg = %9.2f', dat.tt.avg/1000)}); 13 | ylabel('Interactions'); 14 | xlabel('Think Time (s)'); 15 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gdfontmb.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _GDFONTMB_H_ 3 | #define _GDFONTMB_H_ 1 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | /* 10 | This is a header file for gd font, generated using 11 | bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz 12 | from bdf font 13 | -misc-fixed-bold-r-normal-sans-13-94-100-100-c-70-iso8859-2 14 | at Thu Jan 8 13:54:57 1998. 15 | No copyright info was found in the original bdf. 16 | */ 17 | 18 | 19 | #include "gd.h" 20 | 21 | extern gdFontPtr gdFontMediumBold; 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gdfonts.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _GDFONTS_H_ 3 | #define _GDFONTS_H_ 1 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | /* 10 | This is a header file for gd font, generated using 11 | bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz 12 | from bdf font 13 | -misc-fixed-medium-r-semicondensed-sans-12-116-75-75-c-60-iso8859-2 14 | at Thu Jan 8 14:13:20 1998. 15 | No copyright info was found in the original bdf. 16 | */ 17 | 18 | 19 | #include "gd.h" 20 | 21 | extern gdFontPtr gdFontSmall; 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /tpcw/ImgGen/ImgFiles/RestFiles/font.cpp: -------------------------------------------------------------------------------- 1 | void gdImageChar(gdImagePtr im, gdFontPtr f, int x, int y, 2 | int c, int color) 3 | { 4 | int cx, cy; 5 | int px, py; 6 | int fline; 7 | cx = 0; 8 | cy = 0; 9 | if ((c < f->offset) || (c >= (f->offset + f->nchars))) { 10 | return; 11 | } 12 | fline = (c - f->offset) * f->h * f->w; 13 | for (py = y; (py < (y + f->h)); py++) { 14 | for (px = x; (px < (x + f->w)); px++) { 15 | if (f->data[fline + cy * f->w + cx]) { 16 | gdImageSetPixel(im, px, py, color); 17 | } 18 | cx++; 19 | } 20 | cx = 0; 21 | cy++; 22 | } 23 | } -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gdfontt.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _GDFONTT_H_ 3 | #define _GDFONTT_H_ 1 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | /* 10 | This is a header file for gd font, generated using 11 | bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz 12 | from bdf font 13 | -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-2 14 | at Thu Jan 8 13:49:54 1998. 15 | The original bdf was holding following copyright: 16 | "Libor Skarvada, libor@informatics.muni.cz" 17 | */ 18 | 19 | 20 | #include "gd.h" 21 | 22 | extern gdFontPtr gdFontTiny; 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gdfontg.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _GDFONTG_H_ 3 | #define _GDFONTG_H_ 1 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | /* 10 | This is a header file for gd font, generated using 11 | bdftogd version 0.51 by Jan Pazdziora, adelton@fi.muni.cz 12 | from bdf font 13 | -Misc-Fixed-Bold-R-Normal-Sans-15-140-75-75-C-90-ISO8859-2 14 | at Mon Jan 26 14:45:58 1998. 15 | The original bdf was holding following copyright: 16 | "Libor Skarvada, libor@informatics.muni.cz" 17 | */ 18 | 19 | 20 | #include "gd.h" 21 | 22 | extern gdFontPtr gdFontGiant; 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /tpcw/rbe/EBWCustRegTrans.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------ 2 | * rbe.EBWCustRegTrans.java 3 | * Timothy Heil 4 | * 10/13/99 5 | * 6 | * ECE902 Fall '99 7 | * 8 | * TPC-W customer registeration transition to the customer registration 9 | * page from the shopping cart page. 10 | *------------------------------------------------------------------------*/ 11 | 12 | package rbe; 13 | 14 | public class EBWCustRegTrans extends EBTransition { 15 | 16 | public String request(EB eb, String html) { 17 | 18 | RBE rbe = eb.rbe; 19 | 20 | return(eb.addIDs(rbe.custRegURL)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gdfontl.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _GDFONTL_H_ 3 | #define _GDFONTL_H_ 1 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | /* 10 | This is a header file for gd font, generated using 11 | bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz 12 | from bdf font 13 | -misc-fixed-medium-r-normal--16-140-75-75-c-80-iso8859-2 14 | at Tue Jan 6 19:39:27 1998. 15 | 16 | The original bdf was holding following copyright: 17 | "Libor Skarvada, libor@informatics.muni.cz" 18 | */ 19 | 20 | 21 | #include "gd.h" 22 | 23 | extern gdFontPtr gdFontLarge; 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /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 | package rbe.util; 10 | 11 | public class CharStrPattern extends AbCharStrPattern { 12 | protected char p; // The character to find. 13 | 14 | public CharStrPattern(char p) { 15 | this.p = p; 16 | } 17 | 18 | // Does this character match. 19 | protected boolean charMatch(char c) {return(c==p);}; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | Working copy of Java TPC-W implementation used at U. Minho. This version 3 | was put together in http://gorda.di.uminho.pt and http://red.lsd.di.uminho.pt 4 | projects by R. Vilaça, M. Araujo, and others. The master branch includes only 5 | minor fixes. See branch uminho for an updated build system. 6 | 7 | Installer and customization from: http://tpcw.deadpixel.de/ 8 | PostgreSQL changes from: http://pharm.ece.wisc.edu/tpcw/tpcw-postgresql.html 9 | Original available at: http://pharm.ece.wisc.edu/tpcw.shtml 10 | 11 | For installation and usage instructions see http://tpcw.deadpixel.de/ 12 | Alternative results analysis using Python at: https://gist.github.com/4086237 13 | 14 | -------------------------------------------------------------------------------- /tpcw/ImgGen/ImgFiles/RestFiles/last.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "last"=.\last.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /tpcw/matlab/printwi.m: -------------------------------------------------------------------------------- 1 | function [] = printwi(dat) 2 | %------------------------------------------------------------------------- 3 | % function [] = printwi(dat) 4 | % 5 | % Print a vector of values (dat) in order of TPC-W Spec. 5.2.1. 6 | % Useful for looking at mixes. 7 | %------------------------------------------------------------------------- 8 | 9 | i1 = [wi_home, wi_newp, wi_bess, wi_prod, wi_sreq, wi_sres]; 10 | i2 = [wi_shop, wi_creg, wi_buyr, wi_buyc, wi_ordi, wi_ordd, wi_admr, wi_admc]; 11 | 12 | fprintf(1, 'BROWSE\n'); 13 | prl(dat, i1); 14 | 15 | fprintf(1, 'ORDER\n'); 16 | prl(dat, i2); 17 | 18 | function [] = prl(dat, i) 19 | 20 | for j=1:length(i) 21 | k = i(j); 22 | fprintf(1, '%20s %f\n', iname(k), dat(k)); 23 | end 24 | -------------------------------------------------------------------------------- /tpcw/matlab/wirt.m: -------------------------------------------------------------------------------- 1 | function [w] = wirt(dat) 2 | %------------------------------------------------------------------------ 3 | % function [] = wirt(dat) 4 | % 5 | % Plots web interaction response time (WIRT) for all transactions. 6 | % These are plotted in two graphs, as defined by the TPC-W Spec. 7 | % An inverse cumulative distribution is used, which indicates 8 | % what percentage of the interactions took longer than a given 9 | % time. 10 | %------------------------------------------------------------------------ 11 | 12 | clf; 13 | subplot(2,1,1); 14 | wirti(dat, [wi_home, wi_prod, wi_sreq, wi_shop, wi_buyr, wi_ordi, wi_admr]); 15 | 16 | subplot(2,1,2); 17 | wirti(dat, [wi_newp, wi_bess, wi_sres, wi_creg, wi_buyc, wi_ordd, wi_admc]); 18 | 19 | figure(gcf); 20 | -------------------------------------------------------------------------------- /docs/api/servlets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Generated Documentation (Untitled) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <H2> 16 | Frame Alert</H2> 17 | 18 | <P> 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 | <BR> 21 | Link to<A HREF="Book.html">Non-frame version.</A> 22 | 23 | -------------------------------------------------------------------------------- /docs/page.css: -------------------------------------------------------------------------------- 1 | body { background-color: #FFFFFF; margin: 0px 0px 0px 0px; font-family: Verdana, Helvetica, sans-serif; font-size: 90%;} 2 | 3 | a:link { color: #4E92D6; } 4 | a:visited { color: #4E92D6; } 5 | a:active { color: #96B7D9; } 6 | a:hover { color: #96B7D9; } 7 | 8 | .mainhead { background-color:#004080; color: #96B7D9; } 9 | .mencell { vertical-align:top; background-color:#004080; color: #96B7D9; padding: 20px 10px 50px 0px; } 10 | .texttabcell { padding: 10px; } 11 | .textcell { padding: 20px 0px 20px 5px; } 12 | .headcell { background-color:#004080; font-weight:bold; color: #FFFFFF; padding: 3px 5px 3px 5px; spacing: 0px; } 13 | .smallheadcell { background-color:#004080; color: #FFFFFF; padding: 3px 5px 3px 5px; spacing: 0px; } 14 | 15 | .imp { color:#DC0000; } 16 | -------------------------------------------------------------------------------- /docs/api/servlets/packages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |
19 | The front page has been relocated.Please see: 20 |
21 |           Frame version 22 |
23 |           Non-frame version.
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/api/rbe/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Generated Documentation (Untitled) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <H2> 16 | Frame Alert</H2> 17 | 18 | <P> 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 | <BR> 21 | Link to<A HREF="rbe/package-summary.html">Non-frame version.</A> 22 | 23 | -------------------------------------------------------------------------------- /docs/api/rbe/packages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |
19 | The front page has been relocated.Please see: 20 |
21 |           Frame version 22 |
23 |           Non-frame version.
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tpcw/matlab/iname.m: -------------------------------------------------------------------------------- 1 | function [n] = iname(i) 2 | %------------------------------------------------------------------------- 3 | % function [n] = iname(i) 4 | % 5 | % Returns the string name of an interaction. 6 | %------------------------------------------------------------------------- 7 | 8 | n = {}; 9 | 10 | n = {n{:}, 'Initial Home'}; 11 | n = {n{:}, 'Admin Confirm'}; 12 | n = {n{:}, 'Admin Request'}; 13 | n = {n{:}, 'Best Sellers'}; 14 | n = {n{:}, 'Buy Confirm'}; 15 | n = {n{:}, 'Buy Request'}; 16 | n = {n{:}, 'Customer Regist.'}; 17 | n = {n{:}, 'Home'}; 18 | n = {n{:}, 'New Products'}; 19 | n = {n{:}, 'Order Display'}; 20 | n = {n{:}, 'Order Inquiry'}; 21 | n = {n{:}, 'Product Detail'}; 22 | n = {n{:}, 'Search Request'}; 23 | n = {n{:}, 'Search Results'}; 24 | n = {n{:}, 'Shopping Cart'}; 25 | 26 | n = n{i}; 27 | 28 | -------------------------------------------------------------------------------- /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 | package rbe.util; 11 | 12 | public class CharRangeStrPattern extends AbCharStrPattern { 13 | protected char first; // The character to find. 14 | protected char last; // The last character to match. 15 | 16 | public CharRangeStrPattern(char first, char last) { 17 | this.first = first; 18 | this.last = last; 19 | } 20 | 21 | // Does this character match. 22 | protected boolean charMatch(char c) {return((c>=first) && (c<=last));}; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /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 | package rbe.util; 10 | 11 | public class Debug { 12 | public static void assert(boolean assertCond, String message) 13 | { 14 | if (!assertCond) { 15 | throw new DebugError("Assert failed: " + message); 16 | } 17 | } 18 | 19 | public static void fail(String message) 20 | { 21 | throw new DebugError("Assert failed: " + message); 22 | } 23 | } 24 | 25 | class DebugError extends Error { 26 | String message; 27 | 28 | public DebugError(String message) 29 | { 30 | this.message = message; 31 | } 32 | 33 | public String toString() 34 | { 35 | return ("DebugError: " + message); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tpcw/runtpcw: -------------------------------------------------------------------------------- 1 | #This command line runs the TPC-W Browsing Mix with 30 EB's, output file run1.m 2 | #100 seconds of ramp-up time, 1000 seconds of exection, and 100 seconds of ramp 3 | #down time. http://whitelace.ece.wisc.edu:8085/ is used as the web server 4 | #prefix for all requests. There are 10000 items in the database, and a standard 5 | #Think time of multiplier of 1.0. 6 | 7 | java -mx512M rbe.RBE -EB rbe.EBTPCW1Factory 30 -OUT run1.m -RU 100 -MI 1000 -RD 100 -WWW http://whitelace.ece.wisc.edu:8085/ -CUST 144000 -ITEM 10000 -TT 1.0 8 | 9 | #This command line does the same, using the TPC-W Shopping Mix, and no think 10 | #time. 11 | java -mx512M rbe.RBE -EB rbe.EBTPCW2Factory 30 -OUT run1.m -RU 100 -MI 1000 -RD 100 -WWW http://whitelace.ece.wisc.edu:8085/ -CUST 144000 -ITEM 10000 -TT 0.0 12 | 13 | #This command line does the same, using the TPC-W Ordering Mix 14 | java -mx512M rbe.RBE -EB rbe.EBTPCW2Factory 30 -OUT run1.m -RU 100 -MI 1000 -RD 100 -WWW http://whitelace.ece.wisc.edu:8085/ -CUST 144000 -ITEM 10000 -TT 0.0 15 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gd_ss.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "gd.h" 6 | 7 | #define TRUE 1 8 | #define FALSE 0 9 | 10 | /* Exported functions: */ 11 | extern void gdImagePngToSink(gdImagePtr im, gdSinkPtr out); 12 | extern gdImagePtr gdImageCreateFromPngSource(gdSourcePtr inSource); 13 | 14 | /* Use this for commenting out debug-print statements. */ 15 | /* Just use the first '#define' to allow all the prints... */ 16 | /*#define GD_SS_DBG(s) (s) */ 17 | #define GD_SS_DBG(s) 18 | 19 | void gdImagePngToSink(gdImagePtr im, gdSinkPtr outSink) 20 | { 21 | gdIOCtx *out = gdNewSSCtx(NULL,outSink); 22 | gdImagePngCtx(im, out); 23 | out->free(out); 24 | } 25 | 26 | gdImagePtr gdImageCreateFromPngSource(gdSourcePtr inSource) 27 | { 28 | gdIOCtx *in = gdNewSSCtx(inSource, NULL); 29 | gdImagePtr im; 30 | 31 | im = gdImageCreateFromPngCtx(in); 32 | 33 | in->free(in); 34 | 35 | return im; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gdtopng.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "gd.h" 3 | 4 | /* A short program which converts a .png file into a .gd file, for 5 | your convenience in creating images on the fly from a 6 | basis image that must be loaded quickly. The .gd format 7 | is not intended to be a general-purpose format. */ 8 | 9 | int main(int argc, char **argv) 10 | { 11 | gdImagePtr im; 12 | FILE *in, *out; 13 | if (argc != 3) { 14 | fprintf(stderr, "Usage: gdtopng filename.gd filename.png\n"); 15 | exit(1); 16 | } 17 | in = fopen(argv[1], "rb"); 18 | if (!in) { 19 | fprintf(stderr, "Input file does not exist!\n"); 20 | exit(1); 21 | } 22 | im = gdImageCreateFromGd(in); 23 | fclose(in); 24 | if (!im) { 25 | fprintf(stderr, "Input is not in PNG format!\n"); 26 | exit(1); 27 | } 28 | out = fopen(argv[2], "wb"); 29 | if (!out) { 30 | fprintf(stderr, "Output file cannot be written to!\n"); 31 | gdImageDestroy(im); 32 | exit(1); 33 | } 34 | gdImagePng(im, out); 35 | fclose(out); 36 | gdImageDestroy(im); 37 | 38 | return 0; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/pngtogd.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "gd.h" 3 | 4 | /* A short program which converts a .png file into a .gd file, for 5 | your convenience in creating images on the fly from a 6 | basis image that must be loaded quickly. The .gd format 7 | is not intended to be a general-purpose format. */ 8 | 9 | int main(int argc, char **argv) 10 | { 11 | gdImagePtr im; 12 | FILE *in, *out; 13 | if (argc != 3) { 14 | fprintf(stderr, "Usage: pngtogd filename.png filename.gd\n"); 15 | exit(1); 16 | } 17 | in = fopen(argv[1], "rb"); 18 | if (!in) { 19 | fprintf(stderr, "Input file does not exist!\n"); 20 | exit(1); 21 | } 22 | im = gdImageCreateFromPng(in); 23 | fclose(in); 24 | if (!im) { 25 | fprintf(stderr, "Input is not in PNG format!\n"); 26 | exit(1); 27 | } 28 | out = fopen(argv[2], "wb"); 29 | if (!out) { 30 | fprintf(stderr, "Output file cannot be written to!\n"); 31 | gdImageDestroy(im); 32 | exit(1); 33 | } 34 | gdImageGd(im, out); 35 | fclose(out); 36 | gdImageDestroy(im); 37 | 38 | return 0; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gd2topng.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "gd.h" 3 | 4 | /* A short program which converts a .png file into a .gd file, for 5 | your convenience in creating images on the fly from a 6 | basis image that must be loaded quickly. The .gd format 7 | is not intended to be a general-purpose format. */ 8 | 9 | int main(int argc, char **argv) 10 | { 11 | gdImagePtr im; 12 | FILE *in, *out; 13 | if (argc != 3) { 14 | fprintf(stderr, "Usage: gd2topng filename.gd2 filename.png\n"); 15 | exit(1); 16 | } 17 | in = fopen(argv[1], "rb"); 18 | if (!in) { 19 | fprintf(stderr, "Input file does not exist!\n"); 20 | exit(1); 21 | } 22 | im = gdImageCreateFromGd2(in); 23 | fclose(in); 24 | if (!im) { 25 | fprintf(stderr, "Input is not in GD2 format!\n"); 26 | exit(1); 27 | } 28 | out = fopen(argv[2], "wb"); 29 | if (!out) { 30 | fprintf(stderr, "Output file cannot be written to!\n"); 31 | gdImageDestroy(im); 32 | exit(1); 33 | } 34 | gdImagePng(im, out); 35 | fclose(out); 36 | gdImageDestroy(im); 37 | 38 | return 0; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/mathmake.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define scale 1024 5 | 6 | int basis[91]; 7 | int cost[360]; 8 | 9 | main(void) { 10 | int i; 11 | printf("#define costScale %d\n", scale); 12 | printf("int cost[] = {\n "); 13 | for (i=0; (i <= 90); i++) { 14 | basis[i] = cos((double)i * .0174532925) * scale; 15 | } 16 | for (i=0; (i < 90); i++) { 17 | printf("%d,\n ", cost[i] = basis[i]); 18 | } 19 | for (i=90; (i < 180); i++) { 20 | printf("%d,\n ", cost[i] = -basis[180-i]); 21 | } 22 | for (i=180; (i < 270); i++) { 23 | printf("%d,\n ", cost[i] = -basis[i-180]); 24 | } 25 | for (i=270; (i < 359); i++) { 26 | printf("%d,\n ", cost[i] = basis[360-i]); 27 | } 28 | printf("%d\n", cost[359] = basis[1]); 29 | printf("};\n"); 30 | printf("#define sintScale %d\n", scale); 31 | printf("int sint[] = {\n "); 32 | for (i=0; (i<360); i++) { 33 | int val; 34 | val = cost[(i + 270) % 360]; 35 | if (i != 359) { 36 | printf("%d,\n ", val); 37 | } else { 38 | printf("%d\n", val); 39 | } 40 | } 41 | printf("};\n"); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gd_io.h: -------------------------------------------------------------------------------- 1 | #ifndef GD_IO_H 2 | #define GD_IO_H 1 3 | 4 | #include 5 | 6 | typedef struct gdIOCtx { 7 | int (*getC)(struct gdIOCtx*); 8 | int (*getBuf)(struct gdIOCtx*, void*, int); 9 | 10 | void (*putC)(struct gdIOCtx*, int); 11 | int (*putBuf)(struct gdIOCtx*, const void*, int); 12 | 13 | int (*seek)(struct gdIOCtx*, const int); 14 | long (*tell)(struct gdIOCtx*); 15 | 16 | void (*free)(struct gdIOCtx*); 17 | 18 | } gdIOCtx; 19 | 20 | typedef struct gdIOCtx *gdIOCtxPtr; 21 | 22 | void Putword(int w, gdIOCtx *ctx); 23 | void Putchar(int c, gdIOCtx *ctx); 24 | 25 | void gdPutC(const unsigned char c, gdIOCtx *ctx); 26 | int gdPutBuf(const void *, int, gdIOCtx*); 27 | void gdPutWord(int w, gdIOCtx *ctx); 28 | void gdPutInt(int w, gdIOCtx *ctx); 29 | 30 | int gdGetC(gdIOCtx *ctx); 31 | int gdGetBuf(void *, int, gdIOCtx*); 32 | int gdGetByte(int *result, gdIOCtx *ctx); 33 | int gdGetWord(int *result, gdIOCtx *ctx); 34 | int gdGetInt(int *result, gdIOCtx *ctx); 35 | 36 | int gdSeek(gdIOCtx *ctx, const int); 37 | long gdTell(gdIOCtx *ctx); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /tpcw/matlab/wirtvsthr.m: -------------------------------------------------------------------------------- 1 | function [w,t] = wirtvsthr(d) 2 | %------------------------------------------------------------------------- 3 | % function [] = wirtvsthr(d) 4 | % 5 | % WIRT vs. Througput. 6 | % 7 | % D is a {} of run structures, for different numbers of EBs. 8 | %------------------------------------------------------------------------- 9 | 10 | global wirtNorm 11 | global wipsNorm 12 | 13 | j = []; 14 | w = []; 15 | t = []; 16 | for i=1:length(d) 17 | if (~isempty(d{i})) 18 | j = [j, i]; 19 | w = [w, d{i}.wirt{wi_home}.avg]; 20 | s = ceil((d{i}.startMI-d{i}.startRU)/1000); 21 | e = floor((d{i}.startRD - d{i}.startRU)/1000); 22 | t = [t, sum(d{i}.wips(s:e))/(e-s)]; 23 | end 24 | end 25 | 26 | %subplot(1,2,2); 27 | %plot(t, w/1000, 'k-o'); 28 | %xlabel('Home Response Time (s)'); 29 | %ylabel('Throughput (WIPS)'); 30 | subplot(2,1,1); 31 | plot(j, w/1000, 'k-o'); 32 | xlabel('Emulated Browsers'); 33 | ylabel('Norm. Home Int. Resp. Time (s)'); 34 | grid on; 35 | subplot(2,1,2); 36 | plot(j, t/wipsNorm, 'k-o'); 37 | xlabel('Emulated Browsers'); 38 | ylabel('Norm. Throughput (WIPS)'); 39 | grid on; 40 | -------------------------------------------------------------------------------- /tpcw.properties: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # tpcw.properties for build.xml. 3 | # Copyright 2003 by Jan Kiefer. 4 | # 5 | # This file is distributed "as is". It comes with no warranty and the 6 | # author takes no responsibility for the consequences of its use. 7 | # 8 | # Usage, distribution and modification is allowed to everyone, as long 9 | # as reference to the author(s) is given and this license note is included. 10 | ############################################################################## 11 | 12 | # set the JDBC parameters 13 | #jdbc.driver=com.mysql.jdbc.Driver 14 | jdbc.driver=com.mckoi.JDBCDriver 15 | jdbc.path=jdbc:mckoi://localhost/?user=admin&password=admin 16 | jdbc.connPoolMax=100 17 | 18 | sql.bigCharType=varchar(500) 19 | #sql.bigCharType=tinyblob 20 | 21 | # set the values you want for tpcw 22 | num.item=1000 23 | num.eb=10 24 | 25 | # use the right session string for your servlet container 26 | #sessionIdString=$sessionid$ 27 | sessionIdString=jsessionid= 28 | 29 | standardUrl=http://localhost:8080 30 | #servletUrlPath=/servlet 31 | servletUrlPath= 32 | tpcwUrlPath=/tpcw 33 | -------------------------------------------------------------------------------- /main.properties: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # main.properties for build.xml. 3 | # Copyright 2003 by Jan Kiefer. 4 | # 5 | # This file is distributed "as is". It comes with no warranty and the 6 | # author takes no responsibility for the consequences of its use. 7 | # 8 | # Usage, distribution and modification is allowed to everyone, as long 9 | # as reference to the author(s) is given and this license note is included. 10 | ############################################################################## 11 | 12 | # 13 | cpServ=/usr/share/java/servlet-2.3.jar 14 | 15 | # 16 | cpJDBC=/usr/share/java/mkjdbc.jar 17 | 18 | # 19 | webappDir=/usr/share/tomcat4/dist/webapps 20 | 21 | # 22 | perlPath=/usr/bin/perl 23 | 24 | # 25 | imagesDir=${webappDir}/tpcw/Images 26 | 27 | # 28 | sqlFilter=sql-mckoi.properties 29 | 30 | #dbName=std 31 | dbName=mckoi 32 | -------------------------------------------------------------------------------- /tpcw/rbe/args/StringArg.java~: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * rbe.args.StringArg 3 | * Timothy Heil 4 | * 11/11/99 5 | * 6 | * String command line argument. 7 | *------------------------------------------------------------------------*/ 8 | 9 | package rbe.args; 10 | 11 | public class StringArg extends Arg { 12 | public String s = null; 13 | 14 | public StringArg(String arg, String name, String desc) { 15 | super(arg, name, desc, true, false); 16 | } 17 | 18 | public StringArg(String arg, String name, String desc, ArgDB db) { 19 | super(arg, name, desc, false, true, db); 20 | } 21 | 22 | public StringArg(String arg, String name, String desc, String def) { 23 | super(arg, name, desc, false, true); 24 | s = def; 25 | } 26 | 27 | public StringArg(String arg, String name, String desc, String def, 28 | ArgDB db) { 29 | super(arg, name, desc, false, true, db); 30 | s = def; 31 | } 32 | 33 | // Customize to parse arguments. 34 | protected int parseMatch(String [] args, int a) 35 | throws Arg.Exception 36 | { 37 | if (a == args.length) { 38 | throw new Arg.Exception("String argument missing.", a); 39 | } 40 | 41 | s = args[a]; 42 | return(a+1); 43 | } 44 | 45 | public String value() { return(s); } 46 | } 47 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/pngtogd2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "gd.h" 4 | 5 | /* A short program which converts a .png file into a .gd file, for 6 | your convenience in creating images on the fly from a 7 | basis image that must be loaded quickly. The .gd format 8 | is not intended to be a general-purpose format. */ 9 | 10 | int main(int argc, char **argv) 11 | { 12 | gdImagePtr im; 13 | FILE *in, *out; 14 | int cs, fmt; 15 | 16 | if (argc != 5) { 17 | fprintf(stderr, "Usage: pngtogd2 filename.png filename.gd2 cs fmt\n"); 18 | fprintf(stderr, " where cs is the chunk size\n"); 19 | fprintf(stderr, " fmt is 1 for raw, 2 for compressed\n"); 20 | exit(1); 21 | } 22 | in = fopen(argv[1], "rb"); 23 | if (!in) { 24 | fprintf(stderr, "Input file does not exist!\n"); 25 | exit(1); 26 | } 27 | im = gdImageCreateFromPng(in); 28 | fclose(in); 29 | if (!im) { 30 | fprintf(stderr, "Input is not in PNG format!\n"); 31 | exit(1); 32 | } 33 | out = fopen(argv[2], "wb"); 34 | if (!out) { 35 | fprintf(stderr, "Output file cannot be written to!\n"); 36 | gdImageDestroy(im); 37 | exit(1); 38 | } 39 | cs = atoi(argv[3]); 40 | fmt = atoi(argv[4]); 41 | gdImageGd2(im, out, cs, fmt); 42 | fclose(out); 43 | gdImageDestroy(im); 44 | 45 | return 0; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /tpcw/rbe/util/AbCharStrPattern.java~: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * rbe.util.AbCharStrPattern.java 3 | * Timothy Heil 4 | * 10/5/99 5 | * 6 | * Abstract StringPattern template for single character matching patterns. 7 | *------------------------------------------------------------------------*/ 8 | 9 | package rbe.util; 10 | 11 | public abstract class AbCharStrPattern extends StringPattern { 12 | 13 | // Search from index start to end, inclusive. 14 | public int find(String s, int start, int end) 15 | { 16 | int i; 17 | 18 | for (i=start;i<=end;i++) { 19 | if (charMatch(s.charAt(i))) { 20 | this.start = i; 21 | this.end = i; 22 | return(i); 23 | } 24 | } 25 | 26 | return(-1); 27 | } 28 | 29 | // See if pattern matches exactly characters pos to end, inclusive. 30 | public boolean matchWithin(String s, int pos, int end) 31 | { 32 | if (charMatch(s.charAt(pos))) { 33 | this.start = this.end = pos; 34 | return(true); 35 | } 36 | else { 37 | return(false); 38 | } 39 | } 40 | 41 | // Minimum and maximum lengths. 42 | protected int minLength() {return(1);} 43 | protected int maxLength() {return(1);} 44 | 45 | // Does this character match. 46 | protected abstract boolean charMatch(char c); 47 | } 48 | -------------------------------------------------------------------------------- /tpcw/rbe/README_TPCA: -------------------------------------------------------------------------------- 1 | README_TPCA 2 | 3 | This file describes briefly how to run TPC-A using the RBE. 4 | 5 | The file, "README," in this directory provides more general 6 | information about using the RBE. Look there for more details. 7 | 8 | Example command line (all one line, of course): 9 | 10 | java rbe.RBE -EB rbe.EBTPCBFactory 1 1 1 1 1 1 1 -5 5 -TT 0.01 11 | -OUT tpcb.m -RU 1 -MI 5 -RD 1 12 | 13 | The general format is: 14 | 15 | java rbe.RBE -EB rbe.EBTPCBFactory 16 | 17 | -TT 18 | -OUT -RU -MI -RD 19 | 20 | num_cl: The number of clients, emulated browsers, or connections. 21 | minBID, maxBID: The range of random branch IDs produced. 22 | minTID, maxTID: The range of random account IDs produced. 23 | minDelta, maxDelta: The range of account deltas produced. 24 | think: EB think times range from 7s to 70s times this value. 25 | output_file: An output matlab file (required). 26 | ramp_up: Warm-up time before measuring interaction rate. 27 | measure: Length of time for measuring performance. 28 | ramp_down: Steady-state after measurment interval. 29 | 30 | See README for more details about -TT, -OUT, -RU, -MI, and -RD. 31 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gdparttopng.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include /* For atoi */ 3 | #include "gd.h" 4 | 5 | /* A short program which converts a .png file into a .gd file, for 6 | your convenience in creating images on the fly from a 7 | basis image that must be loaded quickly. The .gd format 8 | is not intended to be a general-purpose format. */ 9 | 10 | int main(int argc, char **argv) 11 | { 12 | gdImagePtr im; 13 | FILE *in, *out; 14 | int x, y, w, h; 15 | 16 | if (argc != 7) { 17 | fprintf(stderr, "Usage: gdparttopng filename.gd filename.png x y w h\n"); 18 | exit(1); 19 | } 20 | in = fopen(argv[1], "rb"); 21 | if (!in) { 22 | fprintf(stderr, "Input file does not exist!\n"); 23 | exit(1); 24 | } 25 | 26 | x = atoi(argv[3]); 27 | y = atoi(argv[4]); 28 | w = atoi(argv[5]); 29 | h = atoi(argv[6]); 30 | 31 | printf("Extracting from (%d, %d), size is %dx%d\n", x, y, w, h); 32 | 33 | im = gdImageCreateFromGd2Part(in, x, y, w, h); 34 | fclose(in); 35 | if (!im) { 36 | fprintf(stderr, "Input is not in PNG format!\n"); 37 | exit(1); 38 | } 39 | out = fopen(argv[2], "wb"); 40 | if (!out) { 41 | fprintf(stderr, "Output file cannot be written to!\n"); 42 | gdImageDestroy(im); 43 | exit(1); 44 | } 45 | gdImagePng(im, out); 46 | fclose(out); 47 | gdImageDestroy(im); 48 | 49 | return 0; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /tpcw/matlab/wips.m: -------------------------------------------------------------------------------- 1 | function [w] = wips(dat) 2 | %------------------------------------------------------------------------ 3 | % function [] = wips(dat) 4 | % 5 | % Plot throughput (as web-interactions per second, WIPS) over time. 6 | % Compute and plot average throughput over measurement interval. 7 | % Plot +/- 5% bounds. 8 | %------------------------------------------------------------------------ 9 | global wipsNorm 10 | 11 | % Find end of data. 12 | 13 | for i=1:length(dat.wips) 14 | j = length(dat.wips)-i+1; 15 | if (dat.wips(j)>0) 16 | break; 17 | end 18 | end 19 | 20 | len = j; 21 | 22 | clf; 23 | hold on; 24 | l = plot(dat.wips(1:len)/wipsNorm, 'r.'); 25 | 26 | avg(1) = 0; 27 | for i=1:30 28 | avg(1) = avg(1) +dat.wips(i); 29 | end 30 | 31 | for i=31:len 32 | avg(i-29) = avg(i-30) + dat.wips(i) - dat.wips(i-30); 33 | end 34 | 35 | avg = avg / 30; 36 | 37 | l = plot((30:len)-15, avg/wipsNorm, 'k-'); 38 | 39 | ax = axis; 40 | s = (dat.startMI-dat.startRU)/1000; 41 | e = (dat.startRD-dat.startRU)/1000; 42 | plot([s,s], ax(3:4), 'b--'); 43 | plot([e,e], ax(3:4), 'b--'); 44 | 45 | s=floor(s); 46 | e=ceil(e); 47 | 48 | avg = sum(dat.wips(s:e))/(e-s+1)/wipsNorm; 49 | plot([s,e], [avg, avg], 'g--'); 50 | 51 | %title({'Throughput Over Time', sprintf('Avg WIPS = %9.2f', avg)}); 52 | title('Throughput Over Time'); 53 | ylabel('Normalized WIPS'); 54 | xlabel('Time (s)'); 55 | -------------------------------------------------------------------------------- /tpcw/rbe/args/PrintStreamArg.java~: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * rbe.args.PrintStreamArg 3 | * Timothy Heil 4 | * 10/29/99 5 | * 6 | * Abstract command line argument parsing class. 7 | *------------------------------------------------------------------------*/ 8 | 9 | package rbe.args; 10 | 11 | import java.io.PrintStream; 12 | import java.io.FileOutputStream; 13 | 14 | public class PrintStreamArg extends Arg { 15 | public PrintStream s = null; 16 | public String fName = null; 17 | 18 | public PrintStreamArg(String arg, String name, String desc) { 19 | super(arg, name, desc, true, false); 20 | } 21 | 22 | public PrintStreamArg(String arg, String name, String desc, ArgDB db) { 23 | super(arg, name, desc, true, false, db); 24 | } 25 | 26 | // Customize to parse arguments. 27 | protected int parseMatch(String [] args, int a) 28 | throws Arg.Exception 29 | { 30 | if (a == args.length) { 31 | throw new Arg.Exception("File name missing.", a); 32 | } 33 | 34 | PrintStream oldS = s; 35 | try { 36 | s = new PrintStream(new FileOutputStream(args[a])); 37 | fName = args[a]; 38 | if (oldS!=null) oldS.close(); 39 | } 40 | catch (java.io.IOException fnf) { 41 | throw new Arg.Exception("Unable to open file " + args[a] + ".", a); 42 | } 43 | 44 | return(a+1); 45 | } 46 | 47 | public String value() { return(fName); } 48 | } 49 | -------------------------------------------------------------------------------- /docs/api/rbe/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF } 7 | 8 | /* Table colors */ 9 | .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ 10 | .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ 11 | .TableRowColor { background: #FFFFFF } /* White */ 12 | 13 | /* Font used in left-hand frame lists */ 14 | .FrameTitleFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } 15 | .FrameHeadingFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } 16 | .FrameItemFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } 17 | 18 | /* Example of smaller, sans-serif font in frames */ 19 | /* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */ 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} 29 | 30 | -------------------------------------------------------------------------------- /docs/api/servlets/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF } 7 | 8 | /* Table colors */ 9 | .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ 10 | .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ 11 | .TableRowColor { background: #FFFFFF } /* White */ 12 | 13 | /* Font used in left-hand frame lists */ 14 | .FrameTitleFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } 15 | .FrameHeadingFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } 16 | .FrameItemFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } 17 | 18 | /* Example of smaller, sans-serif font in frames */ 19 | /* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */ 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} 29 | 30 | -------------------------------------------------------------------------------- /tpcw/ImgGen/ImgFiles/RestFiles/rdgif.c: -------------------------------------------------------------------------------- 1 | /* 2 | * rdgif.c 3 | * 4 | * Copyright (C) 1991-1997, 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 contains routines to read input images in GIF format. 9 | * 10 | ***************************************************************************** 11 | * NOTE: to avoid entanglements with Unisys' patent on LZW compression, * 12 | * the ability to read GIF files has been removed from the IJG distribution. * 13 | * Sorry about that. * 14 | ***************************************************************************** 15 | * 16 | * We are required to state that 17 | * "The Graphics Interchange Format(c) is the Copyright property of 18 | * CompuServe Incorporated. GIF(sm) is a Service Mark property of 19 | * CompuServe Incorporated." 20 | */ 21 | 22 | #include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ 23 | 24 | #ifdef GIF_SUPPORTED 25 | 26 | /* 27 | * The module selection routine for GIF format input. 28 | */ 29 | 30 | GLOBAL(cjpeg_source_ptr) 31 | jinit_read_gif (j_compress_ptr cinfo) 32 | { 33 | fprintf(stderr, "GIF input is unsupported for legal reasons. Sorry.\n"); 34 | exit(EXIT_FAILURE); 35 | return NULL; /* keep compiler happy */ 36 | } 37 | 38 | #endif /* GIF_SUPPORTED */ 39 | -------------------------------------------------------------------------------- /tpcw/rbe/args/IntArg.java~: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * rbe.args.IntArg.java 3 | * Timothy Heil 4 | * 10/29/99 5 | * 6 | * Command line argument for integers. 7 | *------------------------------------------------------------------------*/ 8 | 9 | package rbe.args; 10 | 11 | public class IntArg extends Arg { 12 | public int num =0; 13 | 14 | public IntArg(String arg, String name, String desc) { 15 | super(arg, name, desc, false, false); 16 | } 17 | 18 | public IntArg(String arg, String name, String desc, ArgDB db) { 19 | super(arg, name, desc, false, false, db); 20 | } 21 | 22 | public IntArg(String arg, String name, String desc, int def) { 23 | super(arg, name, desc, false, true); 24 | num = def; 25 | } 26 | 27 | public IntArg(String arg, String name, String desc, int def, ArgDB db) { 28 | super(arg, name, desc, false, true, db); 29 | num = def; 30 | } 31 | 32 | // Customize to parse arguments. 33 | protected int parseMatch(String [] args, int a) 34 | throws Arg.Exception 35 | { 36 | if (a == args.length) { 37 | throw new Arg.Exception("Integer argument missing value.", a); 38 | } 39 | try { 40 | num = Integer.parseInt(args[a]); 41 | } 42 | catch(NumberFormatException nfe) { 43 | throw new Arg.Exception("Unable to parse integer value (" + 44 | args[a] + ").", a); 45 | } 46 | 47 | return(a+1); 48 | } 49 | 50 | public String value() { return(""+num); } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gd2time.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include /* for atoi */ 3 | #include /* For time */ 4 | #include "gd.h" 5 | 6 | /* A short program which converts a .png file into a .gd file, for 7 | your convenience in creating images on the fly from a 8 | basis image that must be loaded quickly. The .gd format 9 | is not intended to be a general-purpose format. */ 10 | 11 | int main(int argc, char **argv) 12 | { 13 | gdImagePtr im; 14 | FILE *in; 15 | int x, y, w, h; 16 | int c; 17 | int i; 18 | int t0; 19 | 20 | if (argc != 7) { 21 | fprintf(stderr, "Usage: gd2time filename.gd count x y w h\n"); 22 | exit(1); 23 | } 24 | 25 | c = atoi(argv[2]); 26 | x = atoi(argv[3]); 27 | y = atoi(argv[4]); 28 | w = atoi(argv[5]); 29 | h = atoi(argv[6]); 30 | 31 | printf("Extracting %d times from (%d, %d), size is %dx%d\n", c, x, y, w, h); 32 | 33 | t0 = time(0); 34 | for (i=0; i < c; i++) { 35 | in = fopen(argv[1], "rb"); 36 | if (!in) { 37 | fprintf(stderr, "Input file does not exist!\n"); 38 | exit(1); 39 | } 40 | 41 | im = gdImageCreateFromGd2Part(in, x, y, w, h); 42 | fclose(in); 43 | 44 | if (!im) { 45 | fprintf(stderr, "Error reading source file!\n"); 46 | exit(1); 47 | } 48 | gdImageDestroy(im); 49 | }; 50 | t0 = time(0) - t0; 51 | printf("%d seconds to extract (& destroy) %d times\n",t0, c); 52 | 53 | return 0; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /tpcw/ImgGen/ImgFiles/README.COMPILE: -------------------------------------------------------------------------------- 1 | The current directroy is assumed to be '.' i.e '/ImgGen/ImgFiles' 2 | To Compile the programs - The following things must be done/validated 3 | 4 | The Sources have C++ style comments and hence the CFLAG 'Allow C++ style 5 | comments in C file' must be turned on. 6 | 7 | The Directory gd-1.7.2 must be present in the parent directory 8 | of this directory 9 | 10 | The file cjpeg.c must be checked for proper existence of the following 11 | include paths: 12 | ../gd-1.7.2/gd.h 13 | ../gd-1.7.2/gdfontg.h 14 | 15 | The only other file needed from ../gd-1.7.2/ is gdfontg.c 16 | 17 | The file jconfig.h must be edited to suite the needs of the target platform 18 | 19 | The Makefile must be edited for proper CFLAGS and libraries. The linker 20 | needs the Math-Library 21 | 22 | Running make should generate the executable tpcwIMG in the current directory 23 | 24 | Pl. Note: 25 | The Directory './RestFiles' have files that were originally in the package 26 | obtained from the TPCW web site but are not used in the binary tpcwIMG 27 | 28 | Files added/removed/changed to the original package obtained from TPCW web site. 29 | 30 | Added : Makefile 31 | Added : ../gd-1.7.2 (Freeware Package) 32 | Added : ../README 33 | Added : README.COMPILE 34 | Changed : jconfig.h - for proper #define for Solaris (Platform Specific Changes) 35 | Changed : cjpeg.h - Path Seperator (from '\' to '/') 36 | Changed : All Files - Got Rid of '^M' from end of each line 37 | Removed : Moved unwanted files into 'RestFiles' 38 | -------------------------------------------------------------------------------- /tpcw/ImgGen/gd-1.7.2/gd2copypal.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "gd.h" 3 | 4 | /* A short program which converts a .png file into a .gd file, for 5 | your convenience in creating images on the fly from a 6 | basis image that must be loaded quickly. The .gd format 7 | is not intended to be a general-purpose format. */ 8 | 9 | int main(int argc, char **argv) 10 | { 11 | gdImagePtr im; 12 | gdImagePtr pal; 13 | FILE *in, *out; 14 | if (argc != 3) { 15 | fprintf(stderr, "Usage: gd2copypal palettefile.gd2 filename.gd2\n"); 16 | exit(1); 17 | } 18 | in = fopen(argv[1], "rb"); 19 | if (!in) { 20 | fprintf(stderr, "Palette file does not exist!\n"); 21 | exit(1); 22 | } 23 | pal = gdImageCreateFromGd2(in); 24 | fclose(in); 25 | if (!pal) { 26 | fprintf(stderr, "Palette is not in GD2 format!\n"); 27 | exit(1); 28 | } 29 | 30 | in = fopen(argv[2], "rb"); 31 | if (!in) { 32 | fprintf(stderr, "Input file does not exist!\n"); 33 | exit(1); 34 | } 35 | im = gdImageCreateFromGd2(in); 36 | fclose(in); 37 | if (!im) { 38 | fprintf(stderr, "Input is not in GD2 format!\n"); 39 | exit(1); 40 | } 41 | 42 | gdImagePaletteCopy(im, pal); 43 | 44 | out = fopen(argv[2], "wb"); 45 | if (!out) { 46 | fprintf(stderr, "Output file cannot be written to!\n"); 47 | gdImageDestroy(im); 48 | exit(1); 49 | } 50 | gdImageGd2(im, out, 128, 2); 51 | fclose(out); 52 | gdImageDestroy(pal); 53 | gdImageDestroy(im); 54 | 55 | return 0; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /tpcw/rbe/args/DoubleArg.java~: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * rbe.args.DoubleArg.java 3 | * Timothy Heil 4 | * 10/29/99 5 | * 6 | * Command line argument for double precision floating point values. 7 | *------------------------------------------------------------------------*/ 8 | 9 | package rbe.args; 10 | 11 | public class DoubleArg extends Arg { 12 | public double num =0; 13 | 14 | public DoubleArg(String arg, String name, String desc) { 15 | super(arg, name, desc, false, false); 16 | } 17 | 18 | public DoubleArg(String arg, String name, String desc, ArgDB db) { 19 | super(arg, name, desc, false, false, db); 20 | } 21 | 22 | public DoubleArg(String arg, String name, String desc, double def) { 23 | super(arg, name, desc, false, true); 24 | num = def; 25 | } 26 | 27 | public DoubleArg(String arg, String name, String desc, 28 | double def, ArgDB db) 29 | { 30 | super(arg, name, desc, false, true, db); 31 | num = def; 32 | } 33 | 34 | // Customize to parse arguments. 35 | protected int parseMatch(String [] args, int a) 36 | throws Arg.Exception 37 | { 38 | if (a == args.length) { 39 | throw new Arg.Exception("Double argument missing value.", a); 40 | } 41 | try { 42 | num = Double.valueOf(args[a]).doubleValue(); 43 | } 44 | catch(NumberFormatException nfe) { 45 | throw new Arg.Exception("Unable to parse double value (" + 46 | args[a] + ").", a); 47 | } 48 | 49 | return(a+1); 50 | } 51 | 52 | public String value() { return(""+num); } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /tpcw/ImgGen/ImgFiles/jconfig.h: -------------------------------------------------------------------------------- 1 | /* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ 2 | /* see jconfig.doc for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #define NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | /* Define "boolean" as unsigned char, not int, per Windows custom */ 19 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 20 | typedef unsigned char boolean; 21 | #endif 22 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 23 | 24 | 25 | #ifdef JPEG_INTERNALS 26 | 27 | #undef RIGHT_SHIFT_IS_UNSIGNED 28 | 29 | #endif /* JPEG_INTERNALS */ 30 | 31 | #ifdef JPEG_CJPEG_DJPEG 32 | 33 | #define BMP_SUPPORTED /* BMP image file format */ 34 | #define GIF_SUPPORTED /* GIF image file format */ 35 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 36 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 37 | #define TARGA_SUPPORTED /* Targa image file format */ 38 | 39 | #define TWO_FILE_COMMANDLINE /* optional */ 40 | #undef USE_SETMODE /* Microsoft has setmode(), solaris does not */ 41 | #define NEED_SIGNAL_CATCHER 42 | #undef DONT_USE_B_MODE 43 | #undef PROGRESS_REPORT /* optional */ 44 | 45 | #endif /* JPEG_CJPEG_DJPEG */ 46 | -------------------------------------------------------------------------------- /tpcw/matlab/tran.m: -------------------------------------------------------------------------------- 1 | function [t] = tran() 2 | 3 | 4 | t=[ 0, 0, 0, 0, 0, 0, 0, 9999, 0, 0, 0, 0, 0, 0, 0 5 | 0, 0, 0, 0, 0, 0, 0, 9952, 0, 0, 0, 0, 9999, 0, 0 6 | 0, 8999, 0, 0, 0, 0, 0, 9999, 0, 0, 0, 0, 0, 0, 0 7 | 0, 0, 0, 0, 0, 0, 0, 167, 0, 0, 0, 472, 9927, 0, 9999 8 | 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 9999, 0, 0 9 | 0, 0, 0, 0, 4614, 0, 0, 6546, 0, 0, 0, 0, 0, 0, 9999 10 | 0, 0, 0, 0, 0, 8666, 0, 8760, 0, 0, 0, 0, 9999, 0, 0 11 | 0, 0, 0, 3124, 0, 0, 0, 0, 6249, 0, 6718, 0, 7026, 0, 9999 12 | 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, 9735, 9784, 0, 9999 13 | 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 9999, 0, 0 14 | 0, 0, 0, 0, 0, 0, 0, 72, 0, 8872, 0, 0, 9999, 0, 0 15 | 0, 0, 58, 0, 0, 0, 0, 832, 0, 0, 0, 1288, 8603, 0, 9999 16 | 0, 0, 0, 0, 0, 0, 0, 635, 0, 0, 0, 0, 0, 9135, 9999 17 | 0, 0, 0, 0, 0, 0, 0, 2657, 0, 0, 0, 9294, 9304, 0, 9999 18 | 0, 0, 0, 0, 0, 0, 2585, 9552, 0, 0, 0, 0, 0, 0, 9999]; 19 | 20 | for i=1:15 21 | pmin = 1; 22 | for j=1:15 23 | c = t(i,j); 24 | if (c>0) 25 | t(i,j) = (c-pmin+1)/9999; 26 | pmin = c+1; 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /tpcw/matlab/wirti.m: -------------------------------------------------------------------------------- 1 | function [h, leg] = wirti(dat, i) 2 | %------------------------------------------------------------------------ 3 | % function [] = wirti(dat, i) 4 | % 5 | % Plots histograms of web interaction response time (WIRT) for some 6 | % interactions. See TPC-W Spec Clause 5.6.1. 7 | % 8 | % i is a vector of interaction numbers to plot. 9 | % 10 | % Note that wi_init is automatically included with wi_home. 11 | %------------------------------------------------------------------------ 12 | 13 | % Plot symbols and colors. 14 | sym = {'k+-', 'b.-', 'ro-', 'gs-', 'm^-', 'cx-', 'kd-'}; 15 | 16 | % Find end of data. 17 | 18 | maxC = wirtcon(i(1)); 19 | 20 | for j=2:length(i) 21 | maxC = max(maxC, wirtcon(i(j))); 22 | end 23 | % maxC = maxC * 4; 24 | maxC = 30; 25 | millsperi = maxC*10; 26 | 27 | cla; 28 | 29 | hold on; 30 | 31 | hx = (0:100)/100*maxC; 32 | 33 | leg = {}; 34 | h = []; 35 | for j=1:length(i) 36 | hy = zeros(1, 101); 37 | wh = dat.wirt{i(j)}.h; 38 | if (i(j)==wi_home) 39 | wh(:,2) = wh(:,2) + dat.wirt{wi_init}.h(:,2); 40 | end 41 | for k=1:length(wh(:,2)) 42 | b = min(floor(wh(k,1)/millsperi) + 1, 101); 43 | hy(b)=hy(b) + wh(k,2); 44 | end 45 | 46 | t = 0; 47 | tot = sum(hy); 48 | hy = hy/tot*100; 49 | for k=1:101 50 | t = t + hy(k); 51 | hy(k) = 100-t; 52 | end 53 | l = plot(hx, hy, sym{j}); 54 | leg = {leg{:}, iname(i(j))}; 55 | h = [h, l]; 56 | end 57 | 58 | title('Response Time'); 59 | ylabel('% Interactions'); 60 | xlabel('Time (s)'); 61 | 62 | legend(h, char(leg),1); 63 | ax = axis; 64 | ax(1:2) = ceil([0, maxC]); 65 | 66 | axis([0 20 0 100]); 67 | -------------------------------------------------------------------------------- /tpcw/rbe/util/StrStrPattern.java~: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * rbe.util.StrStrPattern.java 3 | * Timothy Heil 4 | * 10/5/99 5 | * 6 | * StringPattern matching a string. 7 | *------------------------------------------------------------------------*/ 8 | 9 | package rbe.util; 10 | 11 | public class StrStrPattern extends StringPattern { 12 | protected String p; // The string to match. 13 | 14 | public StrStrPattern(String s) { 15 | p = s; 16 | } 17 | 18 | public int length() { return(p.length()); } 19 | 20 | // Search from index start to end, inclusive. 21 | public int find(String s, int start, int end) 22 | { 23 | int i = s.indexOf(p, start); 24 | if (i==-1) { 25 | return(-1); 26 | } 27 | // FIXME: This is slower than needed, when the 28 | // string is much longer than end. 29 | else if (i>=(end+p.length())) { 30 | return(-1); 31 | } 32 | else { 33 | this.start = i; 34 | this.end = this.start + p.length()-1; 35 | return(i); 36 | } 37 | } 38 | 39 | // See if pattern matches exactly characters pos to end, inclusive. 40 | public boolean matchWithin(String s, int pos, int end) 41 | { 42 | if ((end-pos+1)0) { 57 | Arg.Exception e = 58 | new Arg.Exception("" + numErr + " arguments not given.\n" + req, 59 | args.length-1); 60 | e.start = 0; 61 | throw e; 62 | } 63 | } 64 | 65 | public void print(PrintStream out) { 66 | int a; 67 | 68 | for (a=0;a 25 | set the number of the run (for filename only), default: 1 26 | 27 | -n 28 | set the nummber of ebs to start, default: 20 29 | 30 | -u 31 | ramp up time, default: 100 32 | 33 | -i 34 | measurement interval time, default: 1200 35 | 36 | -d 37 | ramp down time, default: 50 38 | 39 | -w 40 | url of SUT to use, default: http://tiamak/tpcw/ 41 | 42 | -t 43 | set the type for the rbe to use 44 | 1: Browsing Mix 45 | 2: Shopping mix (default) 46 | 3: Ordering Mix 47 | 48 | HELP 49 | exit 0 50 | } 51 | 52 | error() 53 | { 54 | # print an error and exit 55 | echo "$1" 56 | exit 1 57 | } 58 | 59 | tftype=2 60 | runnr=1 61 | numebs=10 62 | ru=100 63 | mi=1200 64 | rd=50 65 | url="http://localhost:8080/tpcw/" 66 | 67 | # The option parser, change it as needed 68 | # In this example -f and -h take no arguments -l takes an argument 69 | # after the l 70 | while [ -n "$1" ]; do 71 | case $1 in 72 | -h) help;shift 1;; # function help is called 73 | -r) runnr=$2;shift 2;; 74 | -n) numebs=$2;shift 2;; 75 | -u) ru=$2;shift 2;; 76 | -i) mi=$2;shift 2;; 77 | -d) rd=$2;shift 2;; 78 | -w) url=$2;shift 2;; 79 | -t) tftype=$2;shift 2;; 80 | --) shift;break;; # end of options 81 | -*) echo "error: no such option $1. -h for help";exit 1;; 82 | *) break;; 83 | esac 84 | done 85 | 86 | datum=`date +%Y%m%d_%H%M` 87 | filename="run"$runnr"_e"$numebs"_"$datum".m" 88 | 89 | fact="rbe.EBTPCW"$tftype"Factory" 90 | 91 | java rbe.RBE -EB $fact $numebs -OUT $filename -RU $ru -MI $mi -RD $rd -WWW $url -ITEM 1000 -CUST 28800 -GETIM false 92 | -------------------------------------------------------------------------------- /tpcw/rbe/util/StringPattern.java~: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * rbe.util.StringPattern.java 3 | * Timothy Heil 4 | * 10/5/99 5 | * 6 | * Abstract class representing a pattern to match in a string. 7 | *------------------------------------------------------------------------*/ 8 | 9 | package rbe.util; 10 | 11 | public abstract class StringPattern { 12 | int start, end; // Last match. 13 | 14 | // Find a match in the given string. 15 | // Return index of first character of pattern, if the 16 | // pattern is found. 17 | // Returns -1 if no pattern is found. 18 | 19 | // Search whole string. 20 | public int find(String s) 21 | { 22 | return(find(s, 0, s.length()-1)); 23 | } 24 | 25 | // Search starting at index start. 26 | public int find(String s, int start) 27 | { 28 | return(find(s, start, s.length()-1)); 29 | } 30 | 31 | // Search from index start to end, inclusive. 32 | // Note that the ENTIRE pattern must fit between start and end, 33 | // not just begin matching before end. 34 | public abstract int find(String s, int start, int end); 35 | 36 | // See if pattern matches first part of string. 37 | public boolean match(String s) 38 | { 39 | return(match(s, 0, s.length()-1)); 40 | } 41 | 42 | // See if pattern matches at index pos. 43 | public boolean match(String s, int pos) 44 | { 45 | return(matchWithin(s, pos, s.length()-1)); 46 | } 47 | 48 | // See if pattern matches exactly characters pos to end, inclusive. 49 | public boolean match(String s, int pos, int end) 50 | { 51 | int saveStart = start; 52 | int saveEnd = this.end; 53 | 54 | if (matchWithin(s, pos, end)) { 55 | if (this.end==end) { 56 | return(true); 57 | } 58 | this.start = saveStart; 59 | this.end = saveEnd; 60 | } 61 | 62 | return(false); 63 | } 64 | 65 | // Find a complete match starting at pos and stopping before or at end. 66 | public abstract boolean matchWithin(String s, int pos, int end); 67 | 68 | // Returns the index of the last charcter that matched the 69 | // pattern. 70 | public int end() {return(end);} 71 | 72 | // Returns the index of the first character that last matched 73 | // the pattern. 74 | public int start() {return(start);} 75 | 76 | // Minimum and maximum lengths. 77 | protected abstract int minLength(); 78 | protected abstract int maxLength(); 79 | } 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /tpcw/servlets/Address.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Address.java - This class is a stupid hack because I need an object 3 | * to synchronize credit cart transactions against. 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 | class Address { 56 | } 57 | -------------------------------------------------------------------------------- /tpcw/ImgGen/ImgFiles/jcinit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jcinit.c 3 | * 4 | * Copyright (C) 1991-1997, 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 contains initialization logic for the JPEG compressor. 9 | * This routine is in charge of selecting the modules to be executed and 10 | * making an initialization call to each one. 11 | * 12 | * Logically, this code belongs in jcmaster.c. It's split out because 13 | * linking this routine implies linking the entire compression library. 14 | * For a transcoding-only application, we want to be able to use jcmaster.c 15 | * without linking in the whole library. 16 | */ 17 | 18 | #define JPEG_INTERNALS 19 | #include "jinclude.h" 20 | #include "jpeglib.h" 21 | 22 | 23 | /* 24 | * Master selection of compression modules. 25 | * This is done once at the start of processing an image. We determine 26 | * which modules will be used and give them appropriate initialization calls. 27 | */ 28 | 29 | GLOBAL(void) 30 | jinit_compress_master (j_compress_ptr cinfo) 31 | { 32 | /* Initialize master control (includes parameter checking/processing) */ 33 | jinit_c_master_control(cinfo, FALSE /* full compression */); 34 | 35 | /* Preprocessing */ 36 | if (! cinfo->raw_data_in) { 37 | jinit_color_converter(cinfo); 38 | jinit_downsampler(cinfo); 39 | jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); 40 | } 41 | /* Forward DCT */ 42 | jinit_forward_dct(cinfo); 43 | /* Entropy encoding: either Huffman or arithmetic coding. */ 44 | if (cinfo->arith_code) { 45 | ERREXIT(cinfo, JERR_ARITH_NOTIMPL); 46 | } else { 47 | if (cinfo->progressive_mode) { 48 | #ifdef C_PROGRESSIVE_SUPPORTED 49 | jinit_phuff_encoder(cinfo); 50 | #else 51 | ERREXIT(cinfo, JERR_NOT_COMPILED); 52 | #endif 53 | } else 54 | jinit_huff_encoder(cinfo); 55 | } 56 | 57 | /* Need a full-image coefficient buffer in any multi-pass mode. */ 58 | jinit_c_coef_controller(cinfo, 59 | (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding)); 60 | jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); 61 | 62 | jinit_marker_writer(cinfo); 63 | 64 | /* We can now tell the memory manager to allocate virtual arrays. */ 65 | (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); 66 | 67 | /* Write the datastream header (SOI) immediately. 68 | * Frame and scan headers are postponed till later. 69 | * This lets application insert special markers after the SOI. 70 | */ 71 | (*cinfo->marker->write_file_header) (cinfo); 72 | } 73 | -------------------------------------------------------------------------------- /tpcw/servlets/BuyConfirmResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * BuyConfirmResult.java - Class used to store the results of the buy 3 | * confirm web interaction 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 | public class BuyConfirmResult { 56 | public Cart cart; 57 | public int order_id; 58 | } 59 | -------------------------------------------------------------------------------- /docs/doc.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | TPC-W Java Implementation 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 45 | 79 | 80 |

TPC-W Java Implementation

26 | 29 | 32 | 35 | 38 | 41 | 44 | 46 |

Implementation

47 | 48 | 49 | 50 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 74 | 75 | 76 |
API
53 | 57 |
Design
64 |

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 |

TPC-W servlets
68 |

69 |

70 | The following class diagram shows all general supporting classes for the servlets. 71 |

TPC-W general classes

72 | 73 |
77 | 78 |
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 | 23 | 24 | 77 | 78 |
Book 25 |
26 | BuyConfirmResult 27 |
28 | Cart 29 |
30 | CartLine 31 |
32 | Customer 33 |
34 | Order 35 |
36 | OrderLine 37 |
38 | ShortBook 39 |
40 | TPCW_admin_request_servlet 41 |
42 | TPCW_admin_response_servlet 43 |
44 | TPCW_best_sellers_servlet 45 |
46 | TPCW_buy_confirm_servlet 47 |
48 | TPCW_buy_request_servlet 49 |
50 | TPCW_customer_registration_servlet 51 |
52 | TPCW_Database 53 |
54 | TPCW_execute_search 55 |
56 | TPCW_home_interaction 57 |
58 | TPCW_new_products_servlet 59 |
60 | TPCW_order_display_servlet 61 |
62 | TPCW_order_inquiry_servlet 63 |
64 | TPCW_product_detail_servlet 65 |
66 | TPCW_promotional_processing 67 |
68 | TPCW_say_hello 69 |
70 | TPCW_search_request_servlet 71 |
72 | TPCW_shopping_cart_interaction 73 |
74 | TPCW_Util 75 |
76 |
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 | 21 | 22 | 23 | 24 | 25 | 45 | 70 | 71 |

TPC-W Java Implementation

26 | 29 | 32 | 35 | 38 | 41 | 44 | 46 |

Introduction

47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 65 | 66 | 67 |
About
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 |
Description
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 |
68 | 69 |
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 | 23 | 24 | 77 | 78 |
Book 25 |
26 | BuyConfirmResult 27 |
28 | Cart 29 |
30 | CartLine 31 |
32 | Customer 33 |
34 | Order 35 |
36 | OrderLine 37 |
38 | ShortBook 39 |
40 | TPCW_admin_request_servlet 41 |
42 | TPCW_admin_response_servlet 43 |
44 | TPCW_best_sellers_servlet 45 |
46 | TPCW_buy_confirm_servlet 47 |
48 | TPCW_buy_request_servlet 49 |
50 | TPCW_customer_registration_servlet 51 |
52 | TPCW_Database 53 |
54 | TPCW_execute_search 55 |
56 | TPCW_home_interaction 57 |
58 | TPCW_new_products_servlet 59 |
60 | TPCW_order_display_servlet 61 |
62 | TPCW_order_inquiry_servlet 63 |
64 | TPCW_product_detail_servlet 65 |
66 | TPCW_promotional_processing 67 |
68 | TPCW_say_hello 69 |
70 | TPCW_search_request_servlet 71 |
72 | TPCW_shopping_cart_interaction 73 |
74 | TPCW_Util 75 |
76 |
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 | --------------------------------------------------------------------------------