Monday, July 30, 2007
Friday, July 27, 2007
Tower Crane
ref: Picasa - Tower Crane
Monday, July 23, 2007
M359: TMA03 - Result
Last night, at 23:40, I got my result back for TMA03. Although it wasn't 100% like TMA02 it was still in the high 90's, so am rather pleased.
This does present me with another problem though and it is one that I have experienced with other courses. How do I do well in the exam. For all my courses so far, except for 1, I have got a grade 2 although my TMA scores have been grade 1 standard. I really let myself down at exam time. It's not as though I don't revise for the exams, it's just that I have difficulty in remembering certain things such as lists. This results I believe from my job in that I work for a small company and have to cover all aspects of I.T. and Computing. So for a 3 month stint I might be doing ASP.NET programming and then not touch it for another year. If I then need to do more ASP.NET I tend to refer back to previous work, text books and the Net. I have termed this as "Use and Forget". This issue has manifested itself in the courses that I have done, for example with M359 I fully understood blocks 1, 2 and 3, and the concepts involved, with this being reflected in both my scores and my tutors' comments, but now looking back I can't remember the nitty-gritty such as "list the enduring issues in data management" from block 1 without continuously referring back to the text. This means that I am still hunting for the revision / memory technique that suits me best.
Friday, July 20, 2007
MU120: Update
For this course you need a graphics calculator (TI-83 or TI-84) and on Friday last week I took delivery of a TI-84+ SE. It's rather impressive and all I have to do now is to figure out how to use it.
On Wednesday I received my first lot of course books for MU120. This set is classified as the preparatory pack and it contained 3 books, a pamphlet (on how to use the calculator), course guide, audio CD and the usual welcome notes. If I get chance I will post a more comprehensive list of what I received.
Wednesday, July 11, 2007
M359: TMA03
Have just submitted TMA03 of M359. This has been or rather felt like quiet a long slog, but perhaps it's because I had the exam for M263 half-way through the TMA which meant that there was a bit of a gap after starting it due to revision for M263.
Must admit at the moment I am feeling the mid course blues, although now the TMA has been submitted I hope that I can re-motivate myself and get back into the swing of things.
Monday, July 09, 2007
M359: Block 3 Ex 5.13 - Flawed?
IMHO the solution (page 211) provided for exercise 5.13 (page 117) of block 3 is flawed for a specific set of circumstances.
Scenario
If the textbook table has a number of text books recorded for a specific course prior to the constraint (solution 5.13) being added, then once the constraint is added no text books will be able to be INSERT'd or UPDATE'd for any course not just the course where the number of recorded text books exceeds 5.
Example
For the following table:
bookcode,title, author_name, no_pages,course_code
'65281', 'Beginning Syntax', 'Kershaw, J.', 247, 'c2'
'12953', 'Grammatical Structures', (NULL), 258, 'c2'
'63948', 'Interpreting Semantics', 'Hyde, E.', (NULL), 'c4'
'73642', 'The Semantics of Romance Languages', 'Jane Hanley', (NULL), 'c4'
'65284', 'A First Course In Logic', 'Jerry Maxwell', 115, 'c5'
'65285', 'More Logic', 'Jerry Maxwell', 210, 'c5'
'65290', 'Even More Logic', (NULL), (NULL), 'c5'
'65291', 'A First Course In Magic', 'Jerry Maxwell', 115, 'c5'
'65292', 'A First Course In Poker', 'Jerry Maxwell', 115, 'c5'
'65293', 'A First Course In Distilling Whiskey','Jerry Maxwell', 115, 'c5'
'38572', 'Practical Pragmatics', 'Christine Davies',320, 'c7'
'93881', 'Advances in Pragmatics', 'Farmer, S.J.', (NULL), 'c7'
Note that course 'c5' has 6 text books recorded.
Now the constraint (solution 5.13) is added:
ALTER TABLE textbook
ADD CONSTRAINT max_5_textbooks CHECK (
5 >= ALL (SELECT COUNT(*)
FROM textbook
GROUP BY course_code));
Both of the following queries will break the constraint with SQLAnywhere generating a "Constraint 'max_5'_textbooks' violated:" error message, even though the first query relates to course 'c2' which only has 2 text books recorded and IMO should not break the constraint:
INSERT INTO textbook
VALUES ('65282', 'Ending Syntax', 'Jerry Maxwell', 115, 'c2');
UPDATE textbook
SET title = 'A First Course In SQL'
WHERE bookcode = '65291';
Solution
The following is my solution, which not only covers the requirements specified by the exercise but also for the above scenario:
ALTER TABLE textbook
ADD CONSTRAINT max_5_textbooks CHECK (
NOT (course_code =ANY(SELECT t.course_code
FROM textbook t
GROUP BY t.course_code
HAVING COUNT(t.course_code)>= 5)));
For the above 2 queries (the INSERT and the UPDATE queries) the INSERT will work and the UPDATE will fail, which is as expected.