building your web site ats 315. your project make a web site that shows plots that you generated!...

38
Building Your Web Site ATS 315

Upload: marianna-evans

Post on 04-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Building Your Web Site

ATS 315

Page 2: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Your Project

Make a web site that shows plots that YOU generated!

Plots should regenerate every hour!

Page 3: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 1: Decide what plots you want to show

Pick out a couple of charts that can be made with the programs we have written this semester.

Don’t go nuts—maybe 4 or 5 plots at most!

Page 4: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 2: Make special versions of your programs with NO interaction!

Your programs shouldn’t require anyone to choose a variable, domain, contour interval or anything like that.

Each program should produce ONE chart!

Page 5: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Modify these programs so that they produce an XWD file

XWD = “XWindow Dump” a file format for images, similar to GIF

We’ll learn how to do this later.

Page 6: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 4: Create a “script” that runs these programs.

“scripts” – little programs that perform unix commands.

We’ll learn more about this later.

Page 7: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 5: Set up a “crontab” that runs your script each hour

crontabs are scripts that execute on a schedule.

We’ll learn more about this later.

Page 8: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 6: Make an HTML page to display your output

You already know how to do this!

Page 9: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

The Steps:

1. Decide what you’ll show

2. Versions w/o interaction

3. Produce XWD files

4. Set up scripts

5. Set up crontabs

6. Write HTML code

Page 10: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

/export/home/schragej/X/xwdjms a special version of a standard unix program “xwd” captures a graphics window and saves it as a .xwd

file no beeping!

xwdjms –name myplot

Page 11: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

/export/home/schragej/X/xwdjms a special version of a standard unix program “xwd” captures a graphics window and saves it as a .xwd

file no beeping!

xwdjms –name myplot

The name of the graphics window that you opened!

Don’t use any spaces!

Page 12: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

xwdjms uses “printf” to dump everything it does to the screen.

You need to “capture” this to a file!

xwdjms –name myplot > image.xwd

Page 13: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

xwdjms is a UNIX command, not a C command!

system(“ ”);

Page 14: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

xwdjms is a UNIX command, not a C command!

system(“ ”);

Example: system(“rm *.dat”);

Page 15: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

system(“/export/home/schragej/X/xwdjms –name myplot > image.xwd”);

Page 16: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

system(“/export/home/schragej/X/xwdjms –name myplot > image.xwd”);

Also, turn off the ghold!!!!!!!!

Page 17: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

system(“/export/home/schragej/X/xwdjms –name myplot > image.xwd”);

Also, turn off the ghold!!!!!!!!

Still more problems…

Page 18: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

Draw the mapDraw the datasystem(“xwdjms…”);

Even though you’ve given the orders to draw all the lines and all the data, the graphics might not “keep up”…

Page 19: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

Draw the mapDraw the datasystem(“xwdjms…”);

…when you call xwdjms, it’s possible/likely that the picture isn’t done yet!

You’ll capture a partial image!

Page 20: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

Draw the mapDraw the dataXFlush(display);system(“xwdjms…”);

You need to XFlush the display.

Page 21: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

Draw the mapDraw the dataXFlush(display);system(“xwdjms…”);

You need to XFlush the display.

Page 22: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

Draw the mapDraw the dataXFlush(display);system(“xwdjms…”);

Display *display;display = gget_xdisplay();

Page 23: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 3: Produce XWD files of your maps

Display *display;display = gget_xdisplay();Draw the mapDraw the dataXFlush(display);system(“xwdjms…”);

Page 24: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

The Steps:

1. Decide what you’ll show

2. Versions w/o interaction

3. Produce XWD files

4. Set up scripts

5. Set up crontabs

6. Write HTML code

Page 25: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 4: Create a “script” that runs these programs.

“scripts” – little programs that perform unix commands.

An example of a script:

Page 26: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 4: Create a “script” that runs these programs.

An example of a script:

#! /bin/csh –f

rm *.gif

mv sample.data my.data

Page 27: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 4: Create a “script” that runs these programs.

All scripts start with “pound bang space slash bin slash sea ess aich space minus eff”

#! /bin/csh –f

rm *.gif

mv sample.data my.data

Page 28: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 4: Create a “script” that runs these programs.

Everything after that just runs as if you typed it at the keyboard in Unix.

#! /bin/csh –f

rm *.gif

mv sample.data my.data

Page 29: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 4: Create a “script” that runs these programs.

Everything after that just runs as if you typed it at the keyboard in Unix.

#! /bin/csh –f

setenv DISPLAY wx-sun1:0.

rm *.xwd

MakeTempContours

/opt/sfw/bin/convert image.xwd temperature.gif

mv temperature.gif public_html

Page 30: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 4: Create a “script” that runs these programs.

Change the execution privileges on your script:

chmod a+x MyScript

Test it.

Page 31: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

The Steps:

1. Decide what you’ll show

2. Versions w/o interaction

3. Produce XWD files

4. Set up scripts

5. Set up crontabs

6. Write HTML code

Page 32: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 5: Set up a “crontab” that runs your script each hour

crontabs are scripts that execute on a schedule.

To edit a crontab, you need to have set the EDITOR variable to your favorite editor:

setenv EDITOR vi setenv EDITOR pico

Page 33: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 5: Set up a “crontab” that runs your script each hour

start editing:crontab –e

Every line of the crontab schedules one task to be run repeatedly.

There are 6 entries on every line:

Page 34: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 5: Set up a “crontab” that runs your script each hour

The first entry is the MINUTE of each hour during which to run your job.

15 * * * * /export/home/schragej/MyScript

Adams 1

Affelt

Augustyn 2

Campbell 3

Craft 4

Dea 5

Fontaine 6

Franks 7

Hollibaugh 8

Hyda 9

Karr 10

Malone 11

Novella 12

Robinson 13

Selin 14

Smoliak 15

Taylor 16

Wilson 17

Page 35: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 5: Set up a “crontab” that runs your script each hour

Entries 2, 3, 4, and 5 are the hour, day, day of week and day of month on which to run the job.

A star means “every”.

15 * * * * /export/home/schragej/MyScript

Page 36: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Step 5: Set up a “crontab” that runs your script each hour

The sixth entry is the name of your script, with the full path name!

If your script prints ANYTHING to the screen, you’ll need to include:

> /dev/null

or the output will be emailed to you!

15 * * * * /export/home/schragej/MyScript

Page 37: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

The Steps:

1. Decide what you’ll show

2. Versions w/o interaction

3. Produce XWD files

4. Set up scripts

5. Set up crontabs

6. Write HTML code

Page 38: Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!

Your (Last!) Assignment

Impress me with a web site with weather charts that refresh hourly!