Showing posts with label lists. Show all posts
Showing posts with label lists. Show all posts

Thursday, November 25, 2010

In which we spend the majority of our time talking

The day started off with Mujtaba informing the class that we had the choice of taking Latin instead of French to get our Language credit next year. I knew this already, because we are in the same French class, and our teacher, Mr. Vetranos, was the one who told us about it. Personally, I'd love to take both. I've been wanting to learn Latin since Grade 3, but I don't want to stop taking French - after all, I've already spent five years in the Extended French program, so why drop it now?

Mr. Arkin told us about how valuable it was to know multiple languages. Being bilingual, trilingual, etc. is very helpful in many different aspects of life, especially getting a job. By the time we finished discussing this, half an hour had already passed. (Yeah...being worried about how much time we would have to actually work on our Repetition Assignments, I kept glancing at the clock. I would've looked at my watch, except it broke. Two months ago. *cry*)

So, after we closed the "forum" on languages, Mr. Arkin provided us with three points that will help one become a better programmer.
  1. Read with precision.
  2. Break a solution into an ordered set of steps.
  3. Visualize contents of memory.
He suggested we read our code to another person, while explaining what each symbol or keyword does (for the first point). Zarin-dono and I sort of do this - we're halfway there. Before each one of us prints out the code, we switch places to take a look at the other's code, pointing out anything that is peculiar or incorrect. Then, we print the code out. This is great, because we save both paper and toner.

I do break a solution into an ordered set of steps when I program. I write half of the documentation section (programmer, date, file name, purpose), then before I do anything else, I think about what I will do. When I have a basic outline of the steps needed to reach the solution, I start writing the program. Like Mr. Arkin previously suggested, I start with the input/processing section. Every time I finish typing out a major action, I make the necessary changes or additions to the declaration and/or initialization sections.

I don't visualize contents of memory unless I am desk checking my code. However, after I do a test run (of my program), I look back at what I inputted and mentally check to see if the processing is done correctly.

---

Then, Mr. Arkin gave a brief demonstration of three ways Repetition Assignment 8 could've been done (for a certain part of the code).

Method 1
if integer > 0 and integer mod 2 = 0 then

Method 2
if integer > 0 then
  if integer mod 2 = 0 then
  ...
  end if
end if

Method 3 (using a boolean expression)
positive := integer > 0
even := integer mod 2 = 0

if positive and even then

The last one is cool, but it requires more variables. If I was writing the program, I would most likely use Method 1 because it is the simplest and most straightforward (in my opinion) out of the three.

---

When we got to go to our computers, we had fifteen minutes left. I barely did anything, because I needed to check over some other stuff.

All our programming assignments are due on Monday. I finished everything, but I'm not sure if I have all the codes printed out. Derr. I need to make a checklist (though  I'd probably lose it anyways).

On another note, tomorrow is the Girls for Girls sleepover. I won't be home until Saturday afternoon (I'm going straight to the library, then dance class after I leave the school.)  I'll do my best to write my blog entry tomorrow afternoon, but if it's not up, you know why. I promise to write it the minute I get to the library on Saturday, though. *smile* I'll make a mad dash for one of the computers!

I think this is the longest blog entry I've written so far, ne? I'll stop talking (typing?) now.

Ja ne, minna-sama!

Tuesday, November 2, 2010

In which we learn about another Selection statement

Konbanwa, minna-san! (In case you didn't know, konbanwa means "good evening", and minna means "everyone". The -san is added on, as the honorific. Sometimes, -sama is used as well.)
Okay, the Japanese lesson is over! *sweat* I sort of went off-track there, didn't I? *wince*

Mm...it's 10 : 30 P.M.
...I started this before ten, I swear! *sweat* I was just...writing something else...for an hour...

Anyways! Today we learnt about case statements. Or well, we reviewed it. Last night, I quickly read over Selection (II), so I didn't really have time to process everything. The only thing I really focussed on was label, and even then, I was still slightly confused.

In class, he clarified everything! So, it turns out that a case statment is basically a more sophisticated version of the if statement; used when there are many elsif options or objects following the keyword or. (Is that what you call them? ...I don't remember... Oh no...)

Er...for example, instead of writing:

if colour_choice = "blue" or colour_choice = "BLUE"
          or colour_choice = "Blue" then
     colour (blue)
elsif colour_choice = "red" or colour_choice = "RED"
          or colour_choice = "Red" then
     colour (red)
elsif colour_choice = "purple" or colour_choice = "PURPLE"
          or colour_choice = "Purple" then
     colour (purple)
end if

put "Thank you!"

You can use a case statement and write:

case colour_choice of
     label "blue", "BLUE", "Blue" :
          % blue text
          colour (blue)
     label "red", "RED", "Red" :
          % red text
          colour (red)
     label "purple", "PURPLE", "Purple" :
          % purple text
          colour (purple)
end case

put "Thank you!"

See, isn't that much easier? *smile* Now that I look back at some of my Selection Assignments, I feel like groaning because it took so long to write if-ladders.

Well, I'm off to check if I finished my whole ATM Assignment yet or not. I think I did...but I'd rather not take the chance. Then again, if I forget today, I can always do it tomorrow, ne?

Which reminds me! Tomorrow is Take Your Kids to Work Day! I'm going to my mom's office, and it's sort of strange because...my mom is setting up "lessons" for me with everyone except her. She said "if one of them is too busy, then I'll show you what I do". Can you believe that? *cries*

Er, yes...I should get going now.

Ja ne, minna-san!

Friday, October 1, 2010

Catching up!

Yes!!!
I made my deadline!!!
I'm so happy! I just danced around the living room!

Okay, I got that out my system. Back to CS!

Today, I caught up on what happened yesterday (because I was away for a X-Country meet). We got new definitions and had to create another glossary called the "Basic Computer Glossary". After sitting through half the class, I finally felt like I fully understood what was going on.

Of course, I might not be right.

But I'll deal with that issue when and if it comes up! (Yes, I'm really...optimistic...right now. Hn. According to Mr. Arkin, I should be asleep by now. No...I just finished my story half an hour ago, spent fifteen minutes jumping around celebrating, and then took another fifgeen minutes to calm down - sort of - before finally starting this.)

Anyways, sometime between the time I finish writing this blog entry and Sunday night, I'll have the BCG updated and live on the web.

I also have to find pictures for each of the words on the glossary...somehow I feel like I won't be able to get any anime or manga in this weekend.
...
There's always the next one!
And that's a long weekend too. *grins happily*

Ah, well, I'm off to work now!

Ja ne~!

Tuesday, September 28, 2010

Mm...I'm experiencing a case of forgetfulness...
Maybe it's because I actually slept for more than seven hours last night...
Yes...that must be it...I always feel sleepier in the day if I get more sleep at night...

CS was last period today. (Ah, a funny story - at my expense: I actually thought that the schedule for today was D, C, B, A...so I ended up standing outside the wrong classroom for ten minutes. Thank God it was a late start!) It was sort of nice, because today's class was very laidback and relaxing.

We continued to work on our Class Glossary. My partner and I spent the first ten minutes or so brainstorming more definitions, then we set to work, progressing on our own glossaries respectively. Last night, when I typed out the skeleton, I hadn't put the terms in alphabetical order - I was rushing it, since I had needed to leave soon. So I did that during class today! Ha...it was easier than I thought it would be...I'm just happy I didn't have to retype everything. Now, I have to validate it.

Actually, before I do that, I want to look up formal definitions and add them into the HTML. Yep, that's my homework for tonight.

I find Dropbox amazing and incredibly useful. Now I can access my fics and stories, as well as my drawings (once I download Gimp) from any computer. It'll be so much easier for me to work on them!

Mr. Arkin also informed us about Lab 235, which is open every day at lunchtime. I plan on going there at one point this semester, because I normally have nothing to do at lunch except sit down and read, draw or write. (Which reminds me! I wrote a Durarara!! drabble this morning. I need to type it out and post it up.)

Hehe, sorry for getting side-tracked. I'll be going now. Mm...I smell dinner! Om nom nom...

Monday, September 27, 2010

Confusion...Yes...Lots of confusion...

Ah, well...today I told Mr. Arkin about my missing work.
He looked for it on his computer, and it worked perfectly fine...
Then I relaxed. It's a good thing I had CS first thing in the morning, or this would be bothering me for the whole day.

But...I just checked my website again. And...the link still doesn't work...
So I looked at the source code, and it was correct! I don't know why my superpower assignment won't show up. It's really frustrating. I'm so confused...am I going to get a zero?

At this point, I've gotten over my anger and I've just gone into resignation. I give up...though this really does give me a bad feeling. I don't like it.

---

Anyways.
Today we learnt about different HTML lists. There are three types of them: ordered, unordered and definition. Ordered lists use numbers, unordered lists use bullets and definition lists look similar to a dictionary. After the lesson was over, we got into partners and brainstormed definitions for the Class Glossary.

My partner and I were doing our best! We managed to get eighteen definitions, though there are much more. After I finish writing this, I'll type out a skeleton for the Class Glossary we'll have live on the web. I'll also have to create a Dropbox account.

Sorry about the length of this entry. I'm pretty busy tonight (so much homework!) and I want to leave by 6pm at the latest. Nn...

Ja ne!