Talk:CSC 117 Sp08

From Computer Science Wiki

Jump to: navigation, search

Contents

[edit] Put Course Stuff Here

If 117 students put useful stuff here, they get credit, somehow. Oldham 13:01, 1 February 2008 (CST)

What is the difference between deep and shallow copies? Nick.thompson 11:26, 27 April 2008 (GMT-5)


I am trying to center my GraphWin object on my screen and I don't know the code to do it. I am also trying to find a command that will send focus to a particular GraphWin object so that when I have two open at the same time I can specify which one is active and on top. If anyone knows these codes please post them.--Mike.sivley 01:58, 9 March 2008 (GMT-5)

Thomas.curry 01:19, 23 April 2008 (GMT-5) I'm having some trouble with the clock (classes are rough for me). I'll take another look, and maybe I'll understand it before later and have it done, but it'd be great if someone could help me tonight if I don't. Thanks.

[edit] Preparing for Exam 1 Wed Feb 27

  • New & Important: I posted the first page of the exam (instructions) with a description of the kinds of questions on

the course web page (near the bottom of the page.) If you look at this then the exam should be less surprising than it might ptherwise be. If you like surprises, well, have fun with that.

  • If you will be off campus for an excused absence, if you need extra time to take the test, you need to notify me by the end of class Monday

Feb 25.Oldham 01:32, 24 February 2008 (GMT-5)

  • Quiz 5 on Friday Feb 22 -- validating email addresses, was pretty rough for a quiz, but it is instructive. I am posting the quiz with a solution & commentary on the 117 page near the bottom under EXAM 1. I strongly encourage you to look at it. Understanding that quiz would be an excellent step in exam preparation, and an excellent step toward getting the point of the course in general.
  • General advice: look at labs for lists, loops, strings, files and decisions. If you can do the lab tasks independently you're in good shape. Look at the quizzes -- if you don;t have a clue why you missed a question you need to fix that. If your solutions to technical assignments 1 and 2 worked, great. If not, you need help. If you read chapter 1 of Spinello and can recall the ideas there, good. If not, review it.
  • Time before the exam is getting short. Do not assume you can at this point consume an hour of time in my office -- there are 23 people in the class. I', happy to see you. But coherent questions here or even in email taht I can post here are a form of creditable contribution to the class. And formulating those questions -- it helps you understand the answer.

[edit] Problems With Coding

[edit] User input to List

I thought I'd post this particular issue I'm having on THW1. I'm having a lot of trouble assigning the user-input into a list which can then be sorted. Any suggestions from the peanut gallery? Kurtis 23.32, 14 February 2008 (EST)

  • Oldham 20:30, 17 February 2008 (GMT-5) Whoops. Did not see this in time -- have to see why I was not notified of the post. Anyway:
   mylist = input("Enter a list: ") ''user enters'' [1,2,3] (ex. input() can read a list literal)

When I try to write my entries to a file, I either get all the elements in os.environ and each sub-element or I get only the last element and the last sub-element I want (i.e. PATHEXT and .MSC). Any help? --Nicola.klein 06:43, 25 February 2008 (GMT-5)

In regards to your second issue, be sure that you don't have your fout = open() and fout.close() commands inside your loop. If so, each time your loop runs it will reopen your file for writing which will clear everything that was there. That would be a cause for getting just the last entry.

On your first issue (not sure why I put them backwards), what you need to do is run through your os.environ variable without changing its format. ex:

n = os.environ
List = []
for x in n:
  List.append(x)


  • This will treat n as an instance, not a list, so when you run through its segments it will only address the class names, like PATHEXT, HOMEPATH, USERNAME, etc, and not their actual components.--Mike.sivley 07:30, 25 February 2008 (GMT-5)
    • Peter.burns 05:54, 2 April 2008 (GMT-5) : The problem isn't that it's treating n as an instance, the problem is that when you iterate through a dictionary, you only get the keys. If you want to get the keys and their values, you would use the 'items' method of the dictionary, like so:
n = os.environ
for (name, val) in n.items():
   print "the name:", name
   print "the value:", val
   print ""
  • Mary.takhtjian 03:13, 14 March 2008 (GMT-5) Is there any way to make text vertical? or does each letter have to be drawn?
    • Apparently, no, there's not. I just checked the online documentation for the graphics package, and I didn't see anything that would do that. Jackie.soenneker 01:01, 15 March 2008 (GMT-5)
Personal tools