SE250:March 27

From Marks Wiki
Jump to navigation Jump to search

Announcement

  • Third year SE students believe that their lecture rooms are too far apart.ECE department want to know if this is a problem spread SE wide.Voting:: Please raise your hand if you believe that 2nd year lecture theaters are spread too far apart too.
  • IEEE Soccer Tournament:World famous IEEE soccer* tournament is here.We need 5-10 healthy participants to be a part of this mind blowing game of skill. Represent your year and department against the others. 'Let's bring the glory home!!

Here's the e-mail sent to me:

Hey there, just a message regarding the annual 5-a side IEEE/ECE Indoor Soccer Tournament. This year it will be on Friday 11 April (the last Friday before the mid semester break) 
between 2.00pm and 5.00pm at the University Rec  Centre. All of the departments within ECE (and including Mechatronics) will be competing for a total of 11 teams which are:

Computer Systems Part 2
Computer Systems Part 3
Computer Systems Part 4
Electrical Part 2
Electrical Part 3
Electrical Part 4
Software Part 2
Software Part 3
Software Part 4 
Mechatronics
Post-Graduates

It will be fun and competitive with pizza and drink for everyone involved. As class reps, we would really like your help in organizing your year's team. 
The maximum size is 10 players and minimum of 5, it's up to you guys who you  pick and how many you have. But please only use players from your year and department (no ring-ins).

Student IT (http://www.studentit.co.nz) has also kindly donated prizes for the winning teams. The draws and finalized rules are still getting sorted out and we'll update you guys when 
everything is confirmed. As things look, it will  most likely be a knockout format.

We would like your final squad list to be submitted by Friday 4 April (in TWO weeks time). Just give us an email back with your players' names so we know your team will be there.
It will be a great event, and we REALLY appreciate  your help!
  • Please put down your names and sign here:
Rachit Bhatia --RicksterTalk 13:22, 27 March 2008 (NZST)
Sam Dalton Sdal039 17:52, 27 March 2008 (NZST)
Haroun Barazanchi
Krishant Lodhia

Minute

  • Lecture started with a vote(?) on whether the lecture rooms are too far apart or not, result were that the room are fine.
  • Soccer talk, read above for detail.
  • Un-lecture tomorrow.
  • Revisit yesterday's code on main memory and function memory.

--When C reads a string in double quotation mark, eg "world", it automatically allocates a memory space in the Read-Only memory for the string and place the string value in it.

  • Next week's lab will be on linked list.
  • John showed us code on malloc where it fills the memory with a certain block_size and prints out how many times it allocated the block.

--Codes:

long i;
int block_size = 100;

while(malloc(block_size) !=0)
     i++;

printf("allocated %ld times for %ld bytes\n", i, i*block_size);

--The program froze, and John had to terminate Emacs. "It does work", John claims.

  • Back to Linked List

--It stores value in a scattered manner, allowing very fast adding and removing of element, unlike array where values are stored in an adjacent memory next to each other, which makes the adding and removing of element a very slow process as the whole array of values have to be moved around. --Downside of linked list is that it uses a lot of memory space. --Codes(revisiting from before on linked list) this is the function of initializing the linked list:

Cons* cons(element_t value, Cons* next){
    Cons* cell = malloc(sizeof(cons));
    cell->value = value;
    cell->next = next;
    return cell;
}

--Codes(reconstructing Main):

Cons* my_list = cons(1, cons(2, cons(3, nil)));

--The code executes in this manner,

   -It starts with reading this,(3, nil), and creates a space for 3, and a pointer which points to nil.
   -It then reads, (2, cons(3, nil)), and creates a space for 2, and a pointer to (3, nil).
   -It then reads, (1, cons(2, cons(3, nil))), and creates a space for 1, and a pointer to (2, cons(3, nil)).

--However to create a linked list from 1 to n, a loop is required.

Cons one_to_n;
int i;
int n = 5;
one_to_n = nil;
for (i = n; i > n; i--)
    one_to_n = cons(i, one_to_n);

End of meeting.

Minute taken by twon06915:29, 27 March 2008 (NZST)