XXII List of Exercises
Exercise 4.5 Vectorize a numerical integration rule . . . . . . . . . . . . . . . . 146
Exercise 4.6 Vectorize a formula containing an if condition . . . . . . . . . 146
Exercise 4.7 Slicing of two-dimensional arrays . . . . . . . . . . . . . . . . . . . . . 146
Exercise 4.8 Implement Exercise 2.9 using NumPy arrays . . . . . . . . . . 163
Exercise 4.9 Implement Exercise 2.10 using NumPy arrays . . . . . . . . . 163
Exercise 4.10 Replace lists by NumPy arrays in convert2.py . . . . . . . . . 164
Exercise 4.11 Use the Gnuplot module in the simviz1.py script . . . . . . . 164
Exercise 4.12 Extension of Exercise 2.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Exercise 4.13 NumPy arrays and binary files . . . . . . . . . . . . . . . . . . . . . . . 164
Exercise 4.14 One-dimensional Monte Carlo integration . . . . . . . . . . . . . 164
Exercise 4.15 Higher-dimensional Monte Carlo integration . . . . . . . . . . . 165
Exercise 4.16 Load data file into NumPy array and visualize . . . . . . . . . 166
Exercise 4.17 Analyze trends in the data from Exercise 4.16 . . . . . . . . . 166
Exercise 4.18 Evaluate a function over a 3D grid . . . . . . . . . . . . . . . . . . . 167
Exercise 4.19 Evaluate a function over a plane or line in a 3D grid . . . . 167
Exercise 5.1 Implement a numerical integration rule in F77 . . . . . . . . . 205
Exercise 5.2 Implement a numerical integration rule in C . . . . . . . . . . . 206
Exercise 5.3 Implement a numerical integration rule in C++ . . . . . . . . 206
Exercise 6.1 Modify the Scientific Hello World GUI . . . . . . . . . . . . . . . . 240
Exercise 6.2 Change the layout of the GUI in Exercise 6.1 . . . . . . . . . . 241
Exercise 6.3 Control a layout with the grid geometry manager . . . . . . 241
Exercise 6.4 Make a demo of Newton’s method . . . . . . . . . . . . . . . . . . . 242
Exercise 6.5 Program with Pmw.EntryField in hwGUI10.py . . . . . . . . . . . 248
Exercise 6.6 Program with Pmw.EntryField in simvizGUI2.py . . . . . . . . 248
Exercise 6.7 Replace Tkinter variables by set/get-like functions . . . . . 249
Exercise 6.8 Use simviz1.py as a module in simvizGUI2.py . . . . . . . . . . 249
Exercise 6.9 Apply Matlab for visualization in simvizGUI2.py . . . . . . . 249
Exercise 6.10 Program with Pmw.OptionMenu in simvizGUI2.py . . . . . . . . 282
Exercise 6.11 Study the nonlinear motion of a pendulum . . . . . . . . . . . . 283
Exercise 6.12 Add error handling with an associated message box . . . . 284
Exercise 6.13 Add a message bar to a balloon help . . . . . . . . . . . . . . . . . 284
Exercise 6.14 Select a file from a list and perform an action . . . . . . . . . . 284
Exercise 6.15 Make a GUI for finding and selecting font names . . . . . . . 285
Exercise 6.16 Launch a GUI when command-line options are missing . 285
Exercise 6.17 Write a GUI for Exercise 3.14 . . . . . . . . . . . . . . . . . . . . . . . 286
Exercise 6.18 Write a GUI for selecting files to be plotted . . . . . . . . . . . 286
Exercise 6.19 Write an easy-to-use GUI generator . . . . . . . . . . . . . . . . . . 286
Exercise 7.1 Write a CGI debugging tool . . . . . . . . . . . . . . . . . . . . . . . . . 310
Exercise 7.2 Make a Web calculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Exercise 7.3 Make a Web application for registering participants . . . . 311
Exercise 7.4 Make a Web application for numerical experiments . . . . . 311
Exercise 7.5 Become a “nobody” user on a Web server . . . . . . . . . . . . . 312
Exercise 8.1 Use the getopt/optparse module in simviz1.py . . . . . . . . 318
Exercise 8.2 Store command-line options in a dictionary . . . . . . . . . . . . 319
Exercise 8.3 Turn files with commands into Python variables . . . . . . . 319