Good Morning All,


Whilst the snow melts and slowly becomes slushy ice, let the weekly CompSoc email liven your day!


This Wednesday is the Gloucester Research dinner at Quod, I will send out a confirmation email to everyone I have got as attending after this one – if you don’t get one and said you wanted to come, please get in touch with


As usual I have included details of this event below, as well as an important notice about our upcoming AGM (at which a new committee will be elected), and of course the weekly technology competition.


Have a good one,


Ben and Alex

CompSoc Co-Presidents




                      The Oxford Computer Society




Gloucester Research Networking Dinner

Wednesday 08/02, 7pm, Quod


Gloucester Research is hosting a networking dinner for Oxford Computer Society Members on 8th February at Quod.


If you are interested in pursuing a career in financial IT whether as a software developer or within an infrastructure team - you are invited to a three course dinner, each course with different experienced members of the company.


This is a unique opportunity for you to find out first-hand about Gloucester Research and how they develop and support a sophisticated trading platform.


All of the places for this dinner have been taken, this notice is for information only.




Upcoming CompSoc AGM:


You may know that in Week 6 CompSoc will be holding its Annual General Meeting during which the committee for 2012/2013 will be elected. If you think you might be interested in a role on the committee then please feel free to get in touch with us over and we'd be happy to answer any questions that you might have – alternatively speak to us in person of course!


Along with the positions required by the university (President, Secretary and Treasurer) a number of other roles could be suitably created, such as Vice President, Social Secretary, Sponsorship Secretary, Publications Officer, etc. (basically whatever title + support that you think could be provided to the society). Personally, I (Ben) believe that a larger committee than the required roles is highly preferable – there is an upper limit of 10 members to the committee. Constitutionally, we have the that the required positions are:


The President, to preside over meetings, to authorise all expenditure and ultimately be responsible for the running of the Society.

The Secretary, to take minutes at meetings, deal with Society correspondence and stand in for the President when necessary.

The Treasurer, to maintain the accounts of the Society, report to the members thereon, and to stand in for the Secretary when necessary.




Technology Competition:

Challenge 4:


This week’s challenge is a long one.


A discrete elevator simulation.


This challenge is using a given list of discrete elevator request events (found at determine the number of elevators required to service the requests, and their final configuration once the requests have been serviced. The number of elevators required is the minimum needed to ensure all requests are serviced within 21 time blocks (ie completed in 21 or fewer time blocks after creation).


In the file of event requests, an event is either “SKIP”, or a list of requests in the form “x to y;”. “SKIP” is the event where no request was made. “x to y;” is the request go from floor x to floor y. Each line corresponds to the a time block, ie line 0 = time 0, line 1 = time 1 etc. In a single time block the requests for that block are made, then the elevators move in the direction they are travelling in, then the elevators service any requests at the floor they are now at. If an elevator is empty it can enter travel mode, where it will travel towards a selected request with the intention of servicing specifically that request (it can service others as long as they do not want to go past the selected request), as soon as it has picked up the specific request it travels in the direction needed for that request and resumes normal mode.


An elevator can only move up 1 floor, down 1 floor or remain at the same floor during each time block.


There is a building containing elevators which is 10 stories high, with each floor numbered 0 through to 9 (ie. 0 is the ground floor). Users request the elevator by pushing a button on the floor they are currently at, indicating the floor they are going to.


An elevator’s initial configuration is that it is idling at level 0. Individual elevators follow the following protocol:


Elevators can be in 2 modes: Normal mode and Travel mode

Normal mode:

1 currentFloor = currentFloor + direction //as long as this won’t place the elevator out of the building

2 let people out of the elevator if they are in it and this is their floor

3 if no one is in the elevator, then direction = 0 //ie we are idling

4 if anyone is waiting at currentFloor and would like to travel in the same direction as the elevator (or the elevator is idling) then they get on and we go to the floor they requested, if we were idling then we go in the direction for that floor. We always let the people who have been waiting the longest on first.


Travel mode:

1 currentFloor = currentFloor + direction //as long as this won’t place the elevator out of the building

2 let people out of the elevator if they are in it and this is their floor

3 if anyone is waiting at currentFloor and would like to travel between targetFloor and currentFloor then they get on

4 if currentFloor = targetFloor then let anyone on who would like to go in targetDestination direction and set direction to be towards targetDestination

5 switch to Normal mode


An elevator will switch into Travel mode if at the end of part 4 of normal mode it does not contain any passengers. When it switches into travel mode, it will take a request (x to y) which isn’t being acted upon by another elevator and travel to targetFloor (x), doing as much transporting as it can on the way, then will travel towards targetDestination (y). When it is travelling towards targetDestination it has switched back into Normal mode.


If there are [0..N] elevators the system acts in the following manner:

1 todo = <read in request events happening on this time block (if there are any)>

2 for i = 0 to N do

3    execute elevator i’s protocol once, removing any request events from todo which it can immediately handle

4 for i = 0 to N do

5    if elevator i is in Normal mode and empty, and todo is not empty then

6          take the request which has been waiting longest (x to y) from todo, and switch elevator i into Travel mode with targetFloor = x and targetDestination = y

7 advance the time by 1 and go back to step 1


One request is determined to be waiting longer than another if it was generated before the other. If they were generated at the same time, then the request before the other in the list defining them in the requests.txt file is the one that has been waiting longer.


Answers can be submitted to<num of elevators><final floor of elevator 0><final floor of elevator 1><etc..> (obviously without the brackets, ie just a string of numbers). Whilst the solution to this challenge may seem to favour using methods taught in 2nd year CompSci, it can clearly be solved without using any of that fanciness.


An example runthrough and solution can be found at


Anyone (with a email address) can sign up to the competition through the website, but only members can receive prizes. isn't connected to the compsoc network, and so you will need to make a new account to participate.


For more details about the competition see or contact if you have questions about this round.




Technology Competition:

Week 3 result:


Congratulations to Jonathan Tuckwell who was the first person to submit a correct response to last weeks challenge. We will get in touch separately to send you your prize.


The week 3 challenge was to find the message hidden in our termcard ( The message was binary ASCII plaintext in the border, which directed the reader to a link which led them to the solution.




CompSoc Jobs Mailing list


The society receives a number of advertisements each week from companies and individuals interested in employing our members. The jobs range from graduate positions, to a bit of help with another societies website.


If you would like to receive these emails just email with 'subscribe' in the subject line.