Assignment three questions and answers

Here are a few notes about assignment three. Suggestions for additions to this list are welcome (via e-mail).


Before getting to the Q&A part, I'd like to take the opportunity to recommend that you do not start in some other spreadsheet program and then attempt to convert your file to gnumeric; this is tricky, and students occasionally end up with zeroes for trying this and submitting something unreadable. If you want, you could play with your formulas in some other spreadsheet program, but you really have to use a CDF machine to produce your final file (and you will have to re-type any formulas you produced in a different spreadsheet program), and you definitely have to make sure your file is a Gnumeric file.


First of all, here is how to replicate your formula down a column or across a row in Gnumeric, using copy/paste (which is the usual method for performing this replication, although there are others).

Suppose you have a formula in cell D1 which you want replicated in cells D2 through D10. Select (single-click on) cell D1, and then select the "copy" command (by pressing control-C, or by selecting "copy" from the "edit" menu). Then select cells D2 through D10, by pressing the mouse button on cell D2, moving the mouse to sweep out the range while holding down the mouse button, and then releasing the mouse button; and select the "paste" command (by pressing control-V, or by selecting "paste" from the "edit" menu). That pastes the one copied value into each of the nine target cells which are selected, adjusting relative references as appropriate.


Some references:

See the projectile-trajectory problem, discussion, and a gnumeric solution in projectile.html.

And a detailed example of setting file modes with "chmod" so that the web server can publish your web pages in modes.html.

Also common HTML errors to avoid.

Material in March 9 tutorial about assignment three


Here's how "hlookup()" works. You don't need to know all of the following; you can use it for reference in understanding the examples, and you can read it all if you are interested.

The first parameter to hlookup() is the thing you want to look up (this is easy (I hope!)).

The second parameter indicates the range to search. A "range" in a spreadsheet program is identified by the upper-left corner and the lower-right corner. For example, the range B3:D5 comprises the cells B3, B4, B5, C3, C4, C5, D3, D4, and D5. You can make the boundaries of the range absolute where needed (you'll want to do that for the assignment question), i.e. $B$3:$D$5. And finally, the two cell names which specify a range are separated by a colon.

The third parameter indicates what the result of the hlookup() should be. It always searches on the top row of the range. So if you want to search in the number of days row, that should be the top row of your range. Then, what do you want it to return? If you want it to return the value immediately below that, that's the second row of the range, so you put "2" for the second parameter. In general, it always searches on the top row (row number 1), but the result when it finds the correct column can be any row number which you specify as the third parameter to hlookup().

The fourth parameter controls which mode hlookup() runs in, with two possibilities (hence a boolean value is used to choose, because that nicely has two possibilities): If the fourth parameter is FALSE, then it is looking for the exact value. E.g. if the search row says 0, 28, 59, 90, etc, and you search for 30, that won't be found. If the fourth parameter is TRUE, then it is looking for the nearest value which is less-than-or-equal-to the search value, so if you're searching for 30, you'll find the 28. For this assignment, as in lab 4, we are looking for an exact match; so use FALSE.

The fifth parameter controls what is returned. If it decides that the search object is found in column number 3, it can return either 3 or 59 (if the data we're searching in, again, is 0, 28, 59, 90, ...). Usually we prefer the latter behaviour, and in fact you're allowed to specify only four parameters to hlookup() and then it will return the search object rather than its index number. If you want to specify the fifth parameter explicitly, use FALSE to say that you want the search data, not its index number.


You don't need hlookup() in tiles.gnumeric.
The assignment requests the two tables, that's all. You don't have to attempt to find the minimum number of tiles, etc.
It is a human judgement which size is best. The spreadsheet should give the human all of the data so that they can decide.


Q: What should CEILING be applied to in part 2 (tiles)?

A: Very little. Please start without it, and only use it when you find it's needed.

In particular, the sizes in metres must not have CEILING applied to them. For example, if the tiles are 0.5 metres and the width is 1.5 metres, then that requires three tiles but if you did CEILING(1.5) you would get two metres and think you needed four tiles.


Some part 3 notes:

That list of HTML tags I posted is at http://www.dgp.toronto.edu/~ajr/104/diary/03/tags.html.

I strongly recommend using a text-oriented editor, such as nedit, to create these HTML files. (For use in a terminal window, e.g. from home with ssh, you could use "pico".) Do not use an "HTML editor" of any kind. Solutions created with an "HTML editor" will probably get a zero because you will be graded on the quality of the HTML code.

You can open a file in a web browser with the 'open' menu item; you don't need to publish it on the web to be able to view it in a web browser. (Although you also need to publish it on the web to comply with part four, and this is certainly one way to look at it in a web browser, it's just not the only way.)

Your file should also look reasonable when displayed with a simple "cat" in a terminal window. This makes it look more like a computer program than a document, but it shouldn't be a mess, just a different notation (one you are currently learning!).


Q: Can I copy "fancyW.gif" to my own directory and use it from there?

A: No. Use the copy at http://www.dgp.toronto.edu/~ajr/gen/fancyW.gif. You can simply use src="http://www.dgp.toronto.edu/~ajr/gen/fancyW.gif" in your img tag.

For the image which you use for the tidal wave, you can copy it to your own directory or reference it directly as you wish. But the point is that the value in the src parameter in the img tag is an arbitrary URL, which need not be a relative URL referring to a file in the same directory (although it can be).


Q: The "alt" text in <img> tags is for web browsers which don't show images. Is there a web browser which doesn't show images which I can use to see what my "fancyW" tag looks like without images?

A: The best choice for this is probably the text-mode web browser "lynx". In a terminal window, you can type "lynx", a space, and a URL; or you can type lynx, space, filename. Use the up and down arrow keys to move around (even when you're attempting to move left and right, you still use the up and down arrow keys!), and press return to select.


Q: Where should I put the line breaks in surfing.html?

A: No, you shouldn't. Leave the formatting up to the web browser. If the web browser window is wide, everything will fit on the same line; if it's narrow, the text will be broken up. This is what we use structural tags for, as opposed to appearance-oriented tags.


And if you still haven't looked at it, please go through htmlerrors.html and make sure you are not committing any of the errors listed there. And be sure you're using only structural tags.


[main course page]