All 31 entries tagged Degree Related Waffle

No other Warwick Blogs use the tag Degree Related Waffle on entries | View entries tagged Degree Related Waffle at Technorati | There are no images tagged Degree Related Waffle on this blog

September 25, 2005

Blast from the past

For some unknown reason I've just stumbled across the documentation I wrote for the CS120 coursework I did a little under 3 years ago. It made me chuckle so I thought I'd share it with you. Feel free to ignore the first section – it isn't that interesting.



I have written this assignment using shell script, awk and sed. While I realise that it is probably easier to implement using Perl, I decided to stick to what I know.

My submission for this assignment is 6 files: league, printout, cluboption, dateoption, ties, and capital. Printout is called by league when the -f option is given, or when no options are given at all. Cluboption is called when -c is given, and dateoption when -d is given. Ties is called by printout and dateoption to detect any ties between athletes, and capital, a sed script file, is called by printout and cluboption in order to solve to case insensitivity problem.

Generally, I have tried to use the simplest ways of solving the problem that I could think of (although it might not always look that way - this program may give you some fascinating insites into how my mind works ;-) ). I have used awk mainly for printing out certain parts of lines, avoiding long scripts and complicated functions. Similarly for sed, I know it is possible to do what I did in the "capital" file in about 5-10 lines, as I have seen examples on the internet, but I did not use this because I was not sure how it worked. I also tried to use tr as oppose to sed as often as possible, as it is simpler to understand.

Other than that, I have used utilities such as getopts (to combine options), grep, sort, cut, and if and while loops in conjunction with test. I feel that these were generally the simplest solutiouns to the problems faced. Grep -n was especially useful, as it prints line number: exactly as required for the postion in the league.

One thing I have used repeatedly throughout my code is while loop with the form:

max=`grep -c . temp`

while [ $counter != `expr $max + 1` ]

       variable=`awk '{ print $string }' file`

       variable=`echo $variable | cut -f$counter -d ' '`

       ....<em>do some task involving variable</em>......

       counter=`expr $counter + 1`


I have used this as a way of splitting up a variable which is initially in the form string1 string2 string.... into seperate variables, one per iteration, which can then be used by grep (for example) as ways of testing if lines with that string exist in another file.

I have also used uniq to solve the problem of ties - as a way of removing all but one occurence of a repeated name from the input file.


The problems I have encountered while doing this assignment are almost too numerous to mention. Every time I thought I had solved something I found another little fault had cropped up. Even as I write this (at 1 am on Tuesday 11 March), having worked for about 3 and a half weeks on this program, I am in a state of frustration and annoyance at one or two things which I have not solved (I will discuss them later), and cannot solve without rewriting most of my script. Believe me, because about 3 hours ago I was trying to do just that, and found that it was creating even more problems and errors. I decided to stick with what you see now, as it seemed to me that this script contains the minimum number of errors I have been able to achieve.

I think the major problem I encountered was in trying to combine multiple options. This involved rewriting most of my script at one point, if I remember correctly. The problem was getting one option to recognise that another had been run, and to use the data provided by the previous option to create its own output. In the end, this was sloved by having a file called temp being produced by every called script. This way, using the test [ -f temp ] in one script would tell you whether another has been executed. The options' scripts are executed in the order -f, -d, -c, so -f needs no test for the temp file, -d needs to test for it, and -c needs to test for both the temp file, and whether -d has been given, as the form of the temp files created by printout and dateoption are slightly different. Once these tests have been done, it is possible to use the temp file, if necessary, as the input for the script, rather than the raw data from the results file.

Aside from this, most of the implementation was reasonably easy going (for a given value of reasonable). Before I started trying to combine options my code was a lot more consise (believe it or not), it was just in undergoing this process that it turned into the monolith you see now.


As I have already stated, I decided to make the options combine successfully. I also chose to run a test to make sure that the date given with the -d option was valid (ie the day must actually exist for the given month, and the month must be 01 to 12).


I have thoroughly tested this script. Basic tests (league distance, league -c distance, league -d date distance, league -f file distance, league -c, league -x) have been run and given correct output. Also combinations of options have been tested, and in all cases the output was correct. I have also tested bad data if the club file, and in the results file, for various combinations of options, including both together. I have also tested for case insensitivity, and ties, and achieved correct output. The command also gives correct output for the extra white spaces test, but I think I solved this by fluke, and am yet to work out exactly how.

This brings me (regretably) to the last section, which I shall call...

Things which didn't work

I have decided that honesty is the best policy and, as you are pretty sure to find these any way, I might as well put them out in the open.

Firstly, I have only solved the bad data issues for the specific types of bad data given in the automatic test. Any other forms of bad data will likely produce incorrect output. Also, bad data in clubs.dat that does not involve adding an extra line (as in the test) will print out the bad line, but also use it to form the output, (although the output IS in the correct form). Also, the combination of -f with more than one item bad data and another gives bad output and error messages from various utilities used in the script. Finally (I hope) the -f - option does not work properly if there is bad data typed in by the user, or if there is no input by the user for the given distance.

I believe that is it (or at least, this is what I have spotted). So now, for a bit of light entertainment (and please don't mark me down for this), I'd like to include my favourite saying from the last 4 weeks:

"CS120 Coursework - Like kicking a dead whale down a beach"

July 16, 2005


What the certificate should really say:

June 23, 2005

The Breakdown

Follow-up to The End of all Things from The random scribblings of a diseased imagination

Artificial Intelligence: Predicted: 75, Achieved: 54. WTF? Sodding Scaler.
Solid State Physics: Predicted: 75, Achieved: 83. Nice.
Physics in Medicine: Predicted: 70, Achieved: 63.
Computer Graphics: Predicted: 67, Achieved: 58. Scaler again :-(
Final Year Project: Predicted: 65, Achieved: 64.
Introduction Nuclei and Elementary Particles: Predicted: 65, Achieved: 73.
Scientific Method: Predicted: 65, Achieved: 64.
The Weather and the Environment: Predicted: 60, Achieved: 70.
Magnetic Properties of Solids: Predicted: 45, Achieved: 51.
Nuclear Magnetic Resonance: Predicted: 45, Achieved: 47.

Overall Degree Mark: 63%

A bit lower than I was expecting, due mainly to the AI scaler, but a respectable 2:1 none the less.

June 22, 2005

Judgement Day

So I got a 2:1, as I expected. Won't know the breakdown till tomorrow though.

That is all for now.

May 24, 2005

The End of all Things

By which I mean exams. Ever. Done. My degree is finished!
Except for a very delayed project Viva on the 31st, but I'm hoping if I ignore it it will go away

After the Magnetic Properties of Solids/NMR exam this morning (otherwise know as "Roadkill", "What the HELL was that?" and "The worst 3 hours of my life"), my predictions for the year are as follows:

Artificial Intelligence: 75
Solid State Physics: 75
Physics in Medicine: 70
Computer Graphics: 67
Final Year Project: 65
Introduction Nuclei and Elementary Particles: 65
Scientific Method: 65
The Weather and the Environment: 60
Magnetic Properties of Solids: 45
Nuclear Magnetic Resonance: 45

Actual marks will be provided on Results Day The Day of Terror for those interested bored enough to look in this general direction.

This gives me 64.625% for the year, and 64.425% for my degree - a nice mid-2:1.

Odd to think that my first two years (70.8 and 61.9% respectively) might as well not have counted, but that's how the maths goes…

Anyway. Now I can reclaim my life and never set foot in the library again.


May 21, 2005

Done and done!

Follow-up to AI Revision from The random scribblings of a diseased imagination

So the AI exam finishes at 5pm, and here I am back in my room.

Time taken: 1 hour 25 minutes
Expected mark: 74%

(It's not ok to hate me)

Edit: Turns out I missed 1e). Dammit that was an easy mark thrown away :-(

May 20, 2005

AI Revision

I have done about 7 hours in 2 days, and that is pretty much it. I did the 2004 paper in 55 minutes and the 2003 paper in 75 (out of 3 hours).
I think I did pretty well in both, but I am now worried that this is false confidence and the questions that appear tomorrow will be such that I can't answer them – I know nothing about planning and am a bit shaky in some other areas.

Here's hoping for 2003 again!

May 18, 2005

The Moron

The Moron is the fundamental particle of Stupidity. Every "intelligent" creature, or body is born with a large number of Morons. However, the Stupidity of the body can be reduced, by a process known as Proper Education, until it passes the Intelligence Threshold, where the wavefunction of the Moron is smaller than hbar/2. At this point the body's Stupidity is no longer noticable, except in situations described by the Theory of Special Stupidity, for example when the body consumes large quantities of alcohol.

If the body is never provided with a Proper Education, its number of Morons stays fairly constant – Morons are stable particles and will not decay spontaneously. In this case, the body generates a Stupidity Field, whose strength is proportional to 1 / r2. As a result, and other body brought into close contact with the Stupid Body is highly likely to have its own Stupidity increased temporarily. This explains the saying

Never argue with an idiot. He will bring you down to his level and beat you with experience

As the Stupidity Field is proportional to 1 / r2, all Stupid Bodies increase the Stupidity of the whole universe. The Field strength can be attenuated by enclosing the Body in a padded, soundproof cell lined with 1 metre of lead, and throwing away the key. However, a far better solution is to throw the Stupid Body into an infinite potential well, and forget about it.

The education system is a big pile of rubbish


No, but seriously. How and why should exams determine how "intelligent" or good at a subject we are. Exams teach you nothing. Learning for exams is a process of peaking at the right time, short-term memory-wise, and then forgetting everything the day after the exam (or in some cases the moment you leave the hall). As someone with a pretty decent short-term memory, I benefit from this system rather nicely, but it is ridiculously flawed. I will leave this university after 3 years with a degree in physics, but with approximately the same amount of knowledge as I had at A level.

Now before this moves on to a rant about how I would never have applied for physics if I knew it was going to be mosty dry, seemingly abstract applied maths (oops, too late) let me pull back. This doesn't apply just to our course, it applies to everyone (at least, everyone doing science – not so sure about arts students). Whatever you are studying now, think back to what you were doing at A level. I can almost guarentee that you will be able to remember quite a lot of what you studied then, with a little thought and maybe a brief glance over your notes. Not so any more. A prime example of this is the Solid State Physics I exam we poor physicists took in April. Two weeks later whilst revising another module there was some overlap, but none of us (out of about 5 students, all good candidates for 2:1 or better) could remember a simple derivation we had learned by heart for the exam. Revision provides you with no long term knowledge.

So what would be better? What would make that piece of paper you receive at the end of it all worth more, or at least more representative of your ability? I would say that it is obvious – continuous assessment throughout the year – small assignments every week or two. It would encourage us to study more during the first two terms of the year, from which we could gain longer-lasting knowledge than that achieved by cramming the night before an exam. Sure, keep exams. It's a reasonable way to make sure that someone hasn't simply been leeching the work of his or her peers throughout the year, but I would suggest that they should be worth no more than 50% of every module.

Ok, so uni learning is supposed to be independent, but motivation can be hard to come by when you have no reason to work for most of the year. Give us that reason and we will become much more productive (well, most of us). We may moan about it at the time, but we'll be a lot better prepared when the exams roll around. In our first year we had a module called Physics Problems – 6 CATs (standard size phyiscs course), 100% assessed. Problem sheets were provided by every module and a certain number had to be completed each week to get the credit. Similarly, a portion of our maths module that year was obtained from problem questions. Why does that not continue throughout the degree? Why isn't it worth more?

The current education system basically teaches us one thing, providing we survive it – how to cope with the stress caused exams. It's that or go insane. Our degree certificates are symbolic not of our successful pursuit of knowledge or enlightenment, but rather of our ability to survive in a system centred around reducing us to burned out, twitching, and occasionally dribbling zombies once a year, every year, for the duration of our course.

May 03, 2005

The Law of Deadlines strikes again

So with 12 and a half hours to my double-deadline, I thought I'd be clever. My work was finished so I could print it ahead of time and avoid the stress that tomorrow (or rather later today) would inevitably bring. Easy. First task – convert Word documents to PDF so they can be read on the DCS computers where I have a fairly meagre amount of free print credits. Not as easy as it sounds. After trying various free trials of converting programs I gave up in frustration and emailed a friend who has the full version of Acrobat. I got the PDFs back after a short delay (the 1.2MB of my final project report was nearly too much for his PC to cope with). Everything's looking good. Except it's not. On page 14, one of my formulas has magically disappeared. Well, not a problem. I can print all the other pages in DCS and then use Word elsewhere to print the final page. So off I go to DCS

For once, getting in was easy. See, DCS doesn't like us minorities, and provides us with only office-hours access to the building, along with about only 1/10th of the print credits of our CS peers. Anyway, someone was nice enough to let me in. However, it soon turned out that whatever hope I had was false. Topaz had died, taking the entire DCS network with it. Grumpily I stomped down to the library, with the thought of at least getting the cover sheet to my report printed, to make sure it lines up with the window in the rather un-flashy "folders" (read two pieces of card and a binder) that physics provide. No luck – all the printers seem to be mysteriously broken.

The library shuts and I head over to the computing centre. Same story there. In a final desperate attempt to save at least some time before the morning, I try transferring my philosophy essay to disc – one of the many hoops the two pieces require you to jump through involve handing in the philosophy essay on disc along with 2 paper copies (other requirements range from being docked 10% if you give the paper submissions in with your left hand to having to electronically send your final report to Mexico. And no, I'm not kidding about that last one). But once again the Deadline Gods conspired against me. It seems that all my discs are faulty and of course there's no where to get new ones from at this time of night.

So I trudged home, only vaguely aware that I appeared to be living in both the past and present tense at the same time. That's what 12 hours of editing will do to you. Look…now I'm living in the future tense too!

To summarise, I have been unable to beat a deadline yet again, and yet again it is not my fault. Sometimes I really hate this university. I think I'm going to pass out now. Gotta be up early if I want to beat the rush…

October 2017

Mo Tu We Th Fr Sa Su
Sep |  Today  |
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31               

Search this blog


Most recent comments

  • Bob, I have three words for you…RIGHT FUCKING ON! except for the thing about girls…as I am a gir… by wouldn't you like to know on this entry
  • 96 seconds, expert, sayin by Brandon MacNeil on this entry
  • i use lol,omg,wtf,hehehhee,hhahahahahahha,ehem and heavy ass shit…. by Jack Aledruis Herringtonn on this entry
  • I think these phrases are very necessary, Naomi, since people OFTEN misinterprate your intentions wh… by Tim on this entry
  • holy shit dude i agree… lol… i liek use tiz as a filla w0rd n shiz lolh4x pwnt liek nubz0r lol k… by smoker on this entry

Blog archive

RSS2.0 Atom
Not signed in
Sign in

Powered by BlogBuilder