






Extending MathMorphs with Function Plotting
Extending MathMorphs with Function Plotting, by Andres Valloud of UBA.
Current draft: valloud2.pdf
Promised reviewers:
Bruce O'Neel (beoneel@mindspring.com)
Hi, this is Andres.
I have found a mistake in the explanation of how to use BitBlt to do Heckbert quantization. In the page before the last one, it reads that if you don't tell BitBlt to use a destination, it will overwrite the source. That is incorrect, and I have just fixed it. I also corrected some typos and minor errors. A new draft will be in place soon.
Mark Guzdial just updated Andres' draft with version 2, which may address the above error.
Hi, this is Bruce O'Neel
I liked this chapter very much. I have a few small comments:
- There should be a URL which points you to the code, unless the code is in the normal Squeak image by the time the book is published. In fact the URL should probably be there so that people can find updates.
- A change set with a class with a bunch of class methods, one per example in the text would be nice. That way people can try things out without mistyping them in :-)
- The preformance evalution section is nice, but hidden. Maybe it could be mentioned in the introduction so that people can find it easier?
Hi Bruce, this is Andres Valloud.
I am glad you liked the chapter very much :))).
- There should be a URL which points you to the code.
True. I will work on this. Also, there will be some image segments with more complex stuff (this will take time).
- A changeset with a class with a bunch of class methods, one per example in the text would be nice.
Actually, the examples were taken from the examples already present in the code (for the most part). I think that except the pie chart and the number theory plots, everything else is in the code in the form of class methods.
- The performance evaluation section is nice, but hidden.
Hmmmm... ok. I think you are right, Bruce.
A new draft will be coming, then :))).
Thanks for taking the time to review my chapter!!!
Andres.
Mark's Review of "Extending MathMorphs with Function Plotting"
I enjoyed this chapter quite a bit, Andres! I think it works best by thinking of it as a case study. It's an answer to the question: "How does one work through a complex problem in Squeak?"
There are two audiences for this chapter. The first are people seriously interested in function plotting. The second are people who want to build Squeak projects with similar problems. Most people aren't going to build Function Plotters, but issues of coordinate systems, color representations, aspect ratios, performance, and object decomposition will appear in many people's Squeak projects, so the chapter serves them as a well worked-out example. My guess is that the second audience is much larger than the first, and serving the second audience serves the first – but some of what would be useful for the first would be less useful for the second. My preference is to emphasize the second over the first, mostly because of space concerns.
I have two overall concerns about the chapter right now:
- We won't have color plates for the book, and many of your figures don't really work in grayscale. I don't know what to suggest here other than (a) perhaps reducing the number of figures to those that work in grayscale and (b) perhaps remapping some of the colors to something that works in grayscale?
- There are parts of this chapter where there is TOO much detail (serving the FP audience, not the general FP-issue audience), where the "lessons learned" of the section are hard to imagine applying in any other context. I'll point out sections that I had particular concerns with below, but as you revise, perhaps you might judge what to leave in and what to leave based on the question of application elsewhere. Would others, not building function plotters, find this useful?
- One place where detail can be cut is in the multiple examples that you provide. One example is probably enough of each idea. For example, on pages 22, 23, and 24 you offer a standard plot, a ThetaRho plot for random generation, and another plot on random sequences. One example is probably enough.
- In order to be useful as "lessons learned," you need to elaborate your lessons. Some of your decisions are offered without rationale (described below). I'd rather remove detail and include rationale, where a tradeoff must be made.
Issues
- P. 1: The first paragraph of the history notes isn't too useful, and the information there gets recapitulated in the following paragraphs that I think work better.
- P. 2 and on: "Plottng" -> "Plotting" in chapter heading
- p. 2 and on: What font are you using for System information (e.g., "Form")? Is it the Symbol style defined in the Chapter template or something else?
- p. 3: You describe choosing FormCanvas over Form for drawing, but don't give any reasons. This is exactly the kind of information that WOULD be useful to others trying to make decisions about what to build on in Squeak.
- P. 4 and on: Spelling issue – "Cartessian" -> "Cartesian"
- P. 4 "in cartesian (not 'than') AS in polar"
- p. 7 and on: Some comments in your code would be useful. Yes, you do give a good description of the algorithm in the text, but one of the lessons I'm taking from the textbook is that it helps the reader to reiterate the issues in comments. Telling people twice, in different ways, helps.
- p. 8: "The best way to deal with garbage collection..." I couldn't figure out where this paragraph came from. Where do you mention GC as an issue? Why is it an issue? GC time can be an issue in projects, so a mention of it is great, but I couldn't figure out how this fit.
- p. 8: What's an "ambient" (title of section, but appearing nowhere else that I can find in the text)?
- p. 10: Second paragraph of "First step of evaluation in polar coordinates" is confusing. Some of the antecedents or implications aren't obvious. For example, last sentence: "The problem is that we do not know this beforehand." Before what? Before we start sampling? Before we're done sampling? And earlier in the paragraph: "This takes time..." What's "this" referring to?
- p. 11, 12: Please comment code, especially when it's sooo long.
- p. 13: I don't see the value of the color schemes table. It's interesting to know that there are schemes, and what they control, and even the cool story about making things look like notebook paper or blackboards. But a half page of color values is not so useful.
- p. 17: What's an RGB cube?
- p. 17: "The Munsell color system space looks like a cylinder. Actually it is called a tree, but it is better to describe it as a cylinder." I lost you. Why is it a cylinder or a tree, and why is it better to describe it as a cylinder?
- p. 18: What are the axes on this figure?
- p. 19: "We want exactly this behavior for the function color assignment" – I may have been confused, but I thought that the previous page was about finding SIMILAR colors, but your goal is to find "colors as far apart from each other as possible." Doesn't that meant that you want exactly the OPPOSITE behavior?
- p. 20: "About the output, it is very desirable to be able to output the plot to more than one form canvas simultaneously. In Morphic, for instance, we could see the plot being generated in real time." I don't understand this. Why is desirable to be able to output to more than one at once? Why does doing this give you real time plotting in Morphic?
- For all your plots, could you also show the code that you used to generate the plot? That won't take up much space, but it will really help the audience particularly interested in Function Plotting
- As said above: "Pages 22, 23, and 24 you offer a standard plot, a ThetaRho plot for random generation, and another plot on random sequences. One example is probably enough."
- p. 25: The "Application of the ThetaRhoPlotter in Number Theory" example is really nice – it's short, nice looking, and works in grayscale
- p. 27-28: I recommend dropping the pie chart example. It's not that powerful of an example in terms of informing the non-FP audience.
- p. 28-29: I liked the graph dragging plot mode example – again: short, understandable, works well in grayscale
- p. 30: I'd drop the Pending Issues section
- p. 31-33: I'm not sure if the "Function Plotter Itself" provides more insight for the detail that's provided.
- p. 38: The illustration of color quantization doesn't work in grayscale – I can't see any of the issues.
- p. 40-42: "Performance evaluation in Squeak" This reads like a tutorial on MessageTally, which really is beyond the scope of your chapter. I suggest chopping it.
Hi Mark!
Thanks for reviewing my chapter, I am glad you enjoyed it! :))).
The color plates can be redrawn with other colors at little extra cost. I will use John Maloney's suggestion about using a completely white background for the pictures.
P1. History notes shortened.
P2. Plottng -> Plotting, thanks!
P2. System font. I don't have the Symbol style here (although I think you meant System). I have System style defined with Helvetica at size 10. I think it was supposed to be 12, but when writing I felt it was a bit too big so I changed it to 10 and then forgot to resize it back. Changed.
P3. FormCanvas over Form. In the chapter I wrote that FormCanvases have different and more suitable protocol but didn't tell why. Changed.
P4. Cartessian -> Cartesian. Fixed.
P7. Added comments to the code.
P7 and on. Will add comments to the code.
P8. I enhanced the reference to GC in the chapter.
More changes coming soon!
Hi Mark!
I am sorry I am a bit late with the deadline... I was rearended at the
freeway and I am also finishing moving down with my wife to San Diego...
eek. To make things worse, Word managed to break all my index entries
again. Fortunately, I found out that by binarily replacing 45CDh,' =' by
'XE =' in the file converts all broken index entries into working ones.
It seems that Microsoft also translated saving codes when they
translated Microsoft Word. Amazing.
In any case, here are the rest of the changes :).
P8. Ambients are mentioned in p7.
P10. Clarified.
P13. Color schemes' section reduced.
P11 and P12. Code commented.
P17. RGB cube explained.
P17. Tree sentence deleted.
P18. Axis of the figure clarified.
P19. The key is that colors are chosen so they are as far apart as
possible from all colors selected before. Clarified.
P20. Issue with multiple targets explained.
The code for the plots can be lenghty...
P22,23,24. Examples of standard mode plots shortened — dropped two of
them.
P28. Dropped the pie chart.
P38. Dropped the color quantization illustration. Without color plates,
it will be difficult to show any artifact.
P40-42: dropped the section.
I am sending a new draft to you. Thanks for your patience,
Andres.
For whatever it's worth, this draft chapter is a superb piece of work.
A long time Smalltalk user.
saxo
Link to this Page