winterthunder: (Default)
[personal profile] winterthunder posting in [community profile] intro_to_cs
Hi everyone!

First, class business... I went poking around the website, and I found a suggested schedule for the problem sets. They actually correspond to the lectures, imagine that! Anyway, armed with this new info, I've made some tweaks to the problem set schedule.



PS2- 1/22
PS3- 2/5
PS4- 2/19
PS5- 3/5
PS6- 3/19
PS7- 3/26
PS8- 4/16
PS9- 4/23
PS10- 4/30
PS11- 5/14
PS12- 6/4



I also discovered that there are three quizzes associated with this course. So I'm putting the question to you all - do you want to do them?

Poll #2096 Quiz? What Quiz?
Open to: Registered Users, detailed results viewable to: All, participants: 7


I would like to include the quizzes in the course.

View Answers

Yeah, sure, extra practice is good.
7 (100.0%)

No way, I've got enough on my hands with the problem sets.
0 (0.0%)

If you would like to do the quizzes, how should we incorporate them?

View Answers

Add them on top of the lecture and reading in the week where they fit in the sylabus.
7 (100.0%)

Push the lectures back a week to make time for the quiz
0 (0.0%)

Some other idea which I'll tell you about in the comments
0 (0.0%)



Okay, that's out of the way, on to the readings.

I gotta say, this week kicked my ass, and these readings were right there with work and family issues, putting their prints on my bum. The wikibook chapters in particular just are not working for me. Is anyone else having that issue? My notes on those chapters are scattered with big red question marks and underlines with "What does this mean??" written off to the side. Part of this, I think, is that I really don't do numbers. I had to go look up the definition of a prime for the problem set...

Anyway, I've got some questions to toss out for discussion.

1- From the Data Structures reading, what are stacks and queues and why do we care about them? The reading just goes, 'This makes it easy to use lists in stacks and queues, whee!' (Or at least, that was my impression...)
2- From the same reading, why is it useful to be able to unpack a tuple?

Anyone else have questions for the class? This set of readings certainly provides fertile ground for questions. All of section 5.8 of the Data Structures had me going, "Bzuh?" And I just gave up on the wikibook...

Poll #2097 Who rocked problem set one?
Open to: Registered Users, detailed results viewable to: All, participants: 1


I have...

View Answers

Knocked it out of the park.
1 (100.0%)

Struck out.
0 (0.0%)

There's still another at bat to go!
0 (0.0%)

I thought problem set one...

View Answers

Was easy peasy
0 (0.0%)

Was a pain, but achievable
1 (100.0%)

Was way too hard... when did we learn how to do this stuff, again?
0 (0.0%)



Now, [personal profile] aranthe has generously posted answers to some of the exercises in the readings. Anyone want to volunteer to do that for PS1?

Date: 2010-01-16 03:23 am (UTC)
jetamors: Yoruichi is really hot (Default)
From: [personal profile] jetamors
IDK about the stack and queues stuff; like, I can understand what they are, but I don't know how they're usually applied. Hopefully we'll get to use them in problems soon.

Tuple unpacking... I don't know if this is the exact application for it in Python, but I know in Matlab, sometimes you get a big undifferentiated table of data, and so you have to go through and say, okay, column 1 is time, column 2 is heart rate, and so on; this seems like one way to do that.

I can post answers to ps1; would you like me to do it in this entry, or make another one?

Date: 2010-01-17 01:19 am (UTC)
From: [personal profile] aranthe

Re: stacks and queus: This isn't as complicated as the lack of information made it sound. It's just an order concept:

stack
An ordered list (or array, if you're coming from other languages) where items are added and deleted in Last-In-First-Out (LIFO) order. In other words, when you add an element to a stack, you push it into the first position (index 0); when you remove an element, you pop it from the last position (index length-1).
queue
An ordered list (or array, if you're coming from other languages) where items are added and deleted in First-In-First-Out (FIFO) order. When you add an element to a queue, you append it. It becomes the last index. When you remove an element, you leftpop it; this removes the item at index 0.

Stacks and queues are ways of adding and removing items from a list rather than objects in and of themselves.

Re: unpacking tuples. [personal profile] jetamors gave one example. I can see where it would be especially helpful in a configuration case. Once set, configuration data should generally be immutable. This way, you don't have to worry about the data stored in the tuple being changed, but you can assign each piece of it its own meaningful name.

A trivial example: Suppose you had a tuple that stored a person's last name, first name and birth date:

person = 'Smith', 'John', '01.16.80'

If you don't unpack it, you have to refer to each of those things by index: person[0], person[1], person[2]. Most people find the typing of brackets rather awkward because of their location. It's a lot simpler to do this:

last, first, birth = person

That way, you can use meaningful names to refer to each piece of data and they're simpler and quicker to type.

From a programming standpoint, since the tuple data can't be changed, if you want to change the data and use it several times in its changed form in the app, the only way to do that is to assign it to a variable that can accept the changes you want to make.

qRmEpuCBFsnrqoNoUj

Date: 2012-01-07 07:27 am (UTC)
From: (Anonymous)
Haha. I woke up down today. You've chreeed me up!

pnXUfWHMsjOQ

Date: 2012-01-07 11:36 am (UTC)
From: (Anonymous)
Well I guess I don't have to spend the weekend fiuginrg this one out!

Profile

Introduction to Computer Science

July 2010

S M T W T F S
    123
45678910
11121314151617
18192021222324
2526272829 3031

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 19th, 2025 03:21 am
Powered by Dreamwidth Studios