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 of Web Sources De-Selection Milestone

See Spring 2000 Project Milestones

Is it illegal to allow selection of news sources and/or primary category in addition to the required deselection of news sources only functionality via our web interface? Matthew Wolenetz

It's not illegal – it's just not required. Mark Guzdial

i need a little clarification on this project. first, when we run our program it should allow us to import a prefence file and/or create a new one, correct? now on our web interface we should allow a user to view this prefence list, previously created, and deselect certain sources and generate a paper based on the selections. my question now is this: say a user visits the site, deselects some sources, views the stories and then leaves. if he goes back to the site, not having restarted the server or in anyway refreshed or updated the source list, should the sources he deselected previously remain deselected on the site?

Alex Salazar

No. You shouldn't save the deselection information anywhere. Each visit gets just the original preferences stored on disk. Mark Guzdial

I am going to allow both deselection and selection on my WebUI. Right now, I allow my paper to run both the morphic view and the WebUI at the same time. There isn't a problem with this is there? I mean, why not? Everytime the model starts, it loads the options from the file and kicks off both views. Views, of course, get their information from the model, not the save file. It is cool because as you change your options on the web you can see the changes in the morphic view and visa versa. The changes hold while the newspaper program is running. When you get back from your trip, you can look at your options on the morphic view and decide to save them to the file, or just forget about them. I do not allow saving to the file from the web, is this what you meant up there? I think this is the best way to have the design set up; but, from that comment up there it seems like I may not be following the directions.

Are you saying that if somebody changes their mind while on the trip, they have to change their options every time they want to see their paper? This doen't make much sence, especially not on a trip of any considerable length. Please let me know if there is anything wrong with the way I am setting mine up. I can see why you wouldn't want to save if you could only deselect, but if you can also select, there is no need to throw your changes out every time.

Thank you, Michael Emard

Are we to conform to the original project requirement that if no news sources are selected, we are to select (at least) 2 general news sources automatically for generation during web (deselection) use? Matthew Wolenetz

Sure. Mark Guzdial

Is the "changed:/update:" method allowed to be used to pass data objects rather than just symbols? It appears to be legal since "self changed" does a "self changed: self", and I noticed many things in Alice use the "changed:/update:" mechanism to pass the currentTime.

For what I'm doing, the sender and receiver don't need to know who reveived or sent the data.

Jared Ivey

Yes, you can, but it's not a good idea. Here's a better idea: There is a changed:with: (I think that's the name). You send the aspect and the data at once. It's still not as clean as the just-send-the-aspect version (e.g., if you include the data in the update, then you have another place where you're dependent on a particular form of the data.) Mark Guzdial

I've been having fun with processes in Squeak today, and have determined that, to my knowledge, they are DANGEROUS. See the class comment in the fileOut attached below for more details. Beware! Save your image prior to even thinking about running this code. The code simply creates 10 threads, starts them running, and then attempts to terminate them prior to their completion. Unexpected results (like the last thread started sometimes executes completely TWICE, and subsequent morphic display problems) lead me to think that Squeak's low-level support for multi-processing is faulty. Please let me know if I'm wrong. Matthew Wolenetz Missing File (/cs2340/uploads/

I'll take a look at your code, but here are some issues to consider. Morphic update is independent of processes, so sure, you can whump the processor and screw up Morphic. Also note that it's pretty easy to terminate or even create a couple of Morphic update processes at once. Yes, processes are dangerous...and fun. :-) But I don't think that they are inherently faulty. Mark Guzdial

You may not have realized that Squeak processes are cooperatively multitasked among processes with the same priority. You can explicitly yield control by saying "Processor yield". Inserting this command into one of your inner loops shows what is happening: all the processes are sharing the same x variable.

I didn't notice any oddities with morphic after running your code a few dozen times. But I bet this wasn't the only thread experiment you did in that image. Probably one of the other experiments allowed an extra UI thread to get started. Often you can recover an image by jumping to an MVC project and watching all the notifiers pop up. When you jump back to Morphic, you should only have one UI thread left. By the way, Proceeding or Restarting a background thread from a debugger is an easy way to create these excess UI threads, so be careful not to do that. -Lex Spoon

I originally had problems with variable sharing (11 being the only number captured (and being captured 10000 times with large main thread Delay values)), and I thought I had solved them with the usage of the [ :x | ...] newProcessWith: n instead of my original [ ... (using n) ...] newProcess process initialization. I did figure out that processes are non-preemptively scheduled (at the same priority), and some forms of Semaphore accessing seemed to implicitly cause your "Processor yield" (this is why I added the counting to 2 million to introduce a delay to see if I could preempt it from the main thread). If x is being shared, then why do the various (1..10) values of n get "self capture:"'ed? I still don't understand why 2000 10's are added instead of 1000 10's sometimes (not always, especially if the main thread's Delay forMilliseconds is greatly increased). I'll fiddle with this some more in a fresh image when I have the time. Regarding Morphic, how do you "safely" create and terminate "user-level" processes? Also, were you testing my code on the same (2.7alpha?) linux vm installed for public use in the CoC? Matthew Wolenetz

If you leave Morphic (i.e., go to MVC) and re-enter, other UI processes should go away. To get rid of other user-level processes, inspect Process allInstances and send terminate to the ones you don't want. Mark Guzdial

If the user chooses news sources which do not include any that cover the main category they chose- should we go out and retrieve something from a news source that will cover their main category?

Shaun Morber

Nope. You cover the news sources they pick, but nothing's primary, so you pick what to put where. Mark Guzdial

Ok, maybe I'm just a little slow, but I've been trying to figure out exactly how to dynamically generate the code for a checkbox from an ordered collection of websites. Doing a bunch of ifs to see if they're in there would work, but take time and code. Is there a better way to do this? Thanks,
David Jaggie

"If they're in there"? What do you mean? I think that the easiest way to build a list structure from an orderedCollection would be using collect: or insert:into: Mark Guzdial
Ah, allow me to clarify. I meant to say generate the checkbox HTML code dynamically. I don't want to have to do a huge series of "Is this website present?" statements if there is an easier way to do it like being able to hand off the OC and say generate checks based off of this.
David Jaggie

If there is a method that the website object understands like "Are you up?" then a collect: method could be built with an ifTrue: inside the block to collect the appropriate code. Mark Guzdial
i decided to do some work from home and now i'm running into some trouble. i start my server and then check my IP address through NetnameResolver and it gives me my network name. someone said it might be becuase i have two ethernet cards and it doesn't know which one to use. basically, i have ADSL running into by box and then i network out its access to the rest of my house's network. if anyone has any ideas please let me know

Alex Salazar

Squeak doesn't know how to deal with multiple IP's for the same box. So, no, it won't work. Mark Guzdial

I have almost the same setup (modem instead of ADSL shared out to the rest of the apartment - multiple ip's but there's only one network card since we're using a modem) and all I used was http://localhost:8080/ and that worked fine. If you want the actual ip so other people can test it use winipcfg and get the ip of the network card being used to share the internet connection. Worked for me. Kapil Chandra

Link to this Page