<b>Welcome To My Home Page!</b>the web browser will display Welcome To My Home Page! (i.e., the same thing in bold face). For a couple of other examples of HTML elements, you might take a momentary glance at the HTML Quick Reference (but one of thousands you can find on the Web). It's good place to go to to look up elements of HTML.
mkdir public_html
Now give the following two commands:
chmod og+x .
chmod og+rx public_html
(Yes, that is a period after the x and the space.) These commands set the access permission on your new directories so that the Web server (and therefore anyone on the web) can access them.
Now enter the command
cd public_html
to enter your public_html directory.
Type ls to
see what is in the directory. You should find that there is nothing there (yet).
Right at this location is a template for
your home page. Go to that location and
view the source; you're going to be editing a file like this.
Come back to this page and right-click on this link, choosing
the "Save Link As..." option in the pop-up menu.
Navigate the file system to save it as index.html in your public_html directory!
It is important to save it under the name index.html.
Now you're going to edit index.html so that it's your home page. For that you need a text editor;
the Processing environment is a lot more than we need for that. On the Linux
machines, I recommend the use of kedit. To start it up (editing index.html), go to the terminal window, make sure you are still in public_html, and
type,
kedit index.html&
at the command prompt. That ampersand is quite important now, because you will
be typing commands at the command window later.
(Alternatively, probably
just double-clicking on the file will call it up with
kedit.)
In the file index.html,
change all the references to "Your Name" to your actual name.
Change "YourEmailAddress" to your actual e-mail address. Be sure to
save the file.
Now use the FireFox File menu (File/Open File)
to Open the file you have just
saved. You should see your new home page!
There's a bit more to do. We want this file to be visible to the whole
web. For that, now
give the command:
chmod og+r index.html
This makes your home page accessible to the server. Now return to the browser, and browse for the URL:
http://babbage.clarku.edu/~yourLogin/index.html
(Use your actual username, instead of yourLogin, after the tilde).
You should now see your home page on the server.
At Your Leisure (not during today's lab):
Use the Clark University link on your page to get to the main page for
the University. Find the links to student pages. Find some pages you
like, and use the View menu option to look at the HTML source for
those pages. Borrow some good ideas and put them on your page. Then
reinstall your updated page on the server. Add some interesting
links to your page. I would guess that, henceforth, your home pages will
be perpetually under construction....but please go on to the next
step before you get yourself hooked on that process.
Creating an Applet
Compared to raw Java, this is trivial in Processing.
Well... it usually is, anyway (caution, some more hoops ahead).
Start up Processing (type processing & at the command line). It should
open to the most recent project you produced in the lab, pesumably
the EightPuzzleFramework from
Lab 7. In fact,
I'd like you to use that project, even if it is not fully functional,
for reasons that will soon become clear. Stick with that project
for now; if you want to make changes later, you'll see how easy it is.
Now in the "File" menu choose "Export". A folder entitled "applet" will then
be created. In that folder, a Java applet has been created for you! That's it!
Okay, again, that's usually it.
In the case of EightPuzzleFramework
Processing probably
tells you that it's unable to compute the size of the
applet. We have to do this manually and edit the html source that
Processing creates accordingly. Now on Mac OS X, exporting results in the applet folder just popping up; I don't know how Processing behaves on Windows, but on Linux you have to find where the applet folder is. Fortunately, Processing doesn't just put it in any old random place. It's put in the same folder as that in which your .pde file resides. You'll just have to poke around in your folders to find
that. When you do, open the applet folder. Find the file index.html in it. Edit it so that the two lines,
archive="Eight_Puzzle.jar" width="100" height="100"read like this instead:
archive="Eight_Puzzle.jar" width="210" height="255"(that first line is there just for context; it hasn't changed). I found that width 210 and height 255 worked based on computing the size variables in the code; hopefully you will find the same.
<p> Source code: <a href="Eight_Puzzle.pde">Eight_Puzzle</a> <a href="EightPuzzle.pde">EightPuzzle</a>
<a href="EightPuzzlePlayer.pde">EightPuzzlePlayer</a>
<a href="PushBar.pde">PushBar</a>
<a href="Square.pde">Square</a> </p>
cd cd public_html mkdir MyAppletFolder(or any reasonable name you like in place of MyAppletFolder).
cd cd public_html chmod og+rx * -RThis ensures that all the files in your public_html directory are not only readable, but also executable.
<h3>Processing Examples</h3> <ul> <li><a href = "MyAppletFolder/index.html">MyFirstApplet</li> </ul>(you can, of course, put anything appropriate in place of "MyFirstApplet").