View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Questions on Sp2002 P5 Milestone

Ask about P5 here...

I am having major problems trying to edit the Point class, specifically the - operator. This problem is reproduceable (4 times on my computer, including once after a restart) by opening squeak with a fresh 3.2a-4599 image, clicking Tools then Browser, right click and find class "Point", click on the - method,

the line I was trying to change is:
arg isPoint ifTrue: [^ (x - arg x) @ (y - arg y)].

I have tried both deleting and commenting out that line, and changing it to:

arg isPoint ifTrue: [^ Point x: (x - arg x) abs y: (y - arg y) abs].

at this point I press alt+s to save, type in my initials, and then squeak crashes. there is an attachment to this page called deathScreen3.gif which is a printScreen of what squeak looks like when this occurs. this specific time I had just restarted my computer, and only opened a fresh image (extracted from the zip download).

Hank Wilde
Hank, think about how often Point subtraction must occur in Squeak. It may even be already compiled out, not a message send. By redefining it, you force the method to be executed. Why not define something like mySubtract:? Why would you have to redefine subtraction? Mark Guzdial

because I was reading in Points from a file, and they were being stored as strings, like '313'@'420' and then the distance method was trying to subtract between String(SequenceableCollection) and it was crashing all over itself when one entry would be length 2 and another length 3. Then I found asNumber and asInteger.
Hank Wilde

Okay we have a web crawler that does lots of preliminary web stuff before the map is displayed. This takes a while and it happens everytime you do openInWorld on a new instance of GTCampusMap. A suggestion from a TA was to make a class variable in GTCampusMap. Because this preliminary stuff is the same for every instance of the campus map. How would we go about making this class variable and having it run only once for each squeak session?

Subject to Change
what I did when I was trying to run p4 was added a classVariable to GTCampusMap. It is set to nil by default so instead of saying buildingsDB := collect: [:...] you test whether your classVariable is nil or not and then store this biuldingsDB collection in your classvariable... that way on successive calls to this initialization method the variable will no longer be nil and the arduous webcrawling is avoided. Webb -it occurs to me you may be asking "how do I add a classVariable?" you add it just below where you add instanceVariable (instanceVariableNames: ' '), below is (classVariableNames: ' ')

Or store stuff to a file accessible via the Web. Mark Guzdial

We made a web crawler to get routes from MapQuest. Some buildings works fine as MapQuest recognized the addresses, but some building address is not even recognized by Map Quest. So what do we do on the addresses that are not recognized by MapQuest? Jonathan Broomfield
You don't have to support those. Mark Guzdial

So, how do we get to some of these buildings? I don't even know which street Uncle Heinie Way, N.W. (Carnegie Building and Student Success Center) is. It's one of 3, but I don't know which one, since you can't drive on any of them around there anymore. Also, the Tech Tower has an address of North Avenue. Where would we start/end drawing on our map if someone's going to/from the Tech Tower, since it's obviously NOT on North Avenue?

Nathan Owens
That's one of the downsides of using a web service. You'll probably have to implement some filter that will translate some of the MapQuest data to your map. Mark Guzdial

We're not using a web service (where did I mention that in my post?). I was just looking at individual buildings, trying to make sure that we'd covered all of the necessary intersections (we're building a graph of of the intersections, and we'll do a graph search on that to find the path). Maybe I'll try to use Mapquest or some other map program to see if it'll tell me which road is which, since the map doesn't say.
Nathan Owens

I don't see how using map quest is going to extend to an imaginary campus.
Obviously, it's not. In fact, mapquest doesn't even have to extend to P6. Read it carefully: I let you specify routes anyway you want in P6 and P7. Mark Guzdial

I heard something in lecture about having squeak help you match up all of the file opens with the file closes. How do you do that?

You can't do that, but you can look for all senders of close and all senders of open within your own code (using Method Finder, among other tools). Then it's pretty easy to match them up. Mark Guzdial COULD make modifications such that doing an accept in a browser will automatically scan your code, and insert file closes where needed. That would be fun, eh? Shaggz

Does Squeak have a concept of infinity? Infinity being a number such that for all x ~= infinity, x infinity? Or something like "Integer maxNumber"? It'd probably be more involved than that, to answer "is 2(infinity) greater than or equal to infinity?", but all I need is a number guaranteed to be larger than any finite number. Michael L. Mitchell

(2(Float infinity)) = (Float infinity). (Float infinity) > (SmallInteger maxVal). Of course, if you're talking about floating point numbers, there is the argument that since the set being representend (real numbers) is not countable, determining if infinity will always be larger than every other member of the set is more difficult. Fortunately, squeak doesn't include a complete description of reals, so this really isn't an issue... Shaggz

What do we do if there's a landmark that have an address but the map does not have the road that the landmark is on? An example is Folk Residence Hall on 531 Turner Place, N.W. There is no Turner Place on the map we drew, which look similar to the one provided for M1.

Johnny S. Yen
Knights Who Say 'Squeak'

Heres a Q&A from milestone 4 which should answer this question(Sami Deen):

The Map doesnt have a marietta Street, what do we do about buildings that are located on marietta street? Chase Peeler
Add the street to your Map. I never said that your P1 map would work for P4. Mark Guzdial

I have a pretty large form in b/w. When I try to get some color with depth I get a squeak out of memory error. Is there anyway around this error or a way to just have a Pen have color on a form without using the depth method? I just want my pen color to show up red. How can I do this?
Randy Rockinson

Sounds like you're running in Linux (if not, then this probably doesn't pertain to you). Try "squeak -memory 50m ". The 50m means that you'll start out with a 50 MB buffer, instead of the default 20 MB buffer. If that's not big enough (it usually is), you can try a bigger one. Nathan Owens

Link to this Page