Two weeks later, on deadline day…
I think I defeated the XQuery assignment. It took the best part of a week, guessing at around 18 hours, but my 485 lines of code handle everything I can think of that was within the spec of the assignment. It was loads of fun handling transformations from various combinations of sequences, choices, star-expressions, minOccurs and maxOccurs in an element to a XML description of regular expressions, as well as implementing a combinations generator and a function to filter out unique elements in a sequence of elements.
I’m sure all that stuff with a functional lean is pretty old hat to someone who’s a Python, Erlang, F# or Haskell guru, but for little ol’ me with my OO background, it was pretty painful to swap my thinking over to immutable variables (which I’m sure is a contradiction in terms!), a complete inability to track state and just plain indulgence in recursion.
In short, it was brilliant. Exactly what I’m here for, to get out of my ‘comfort zone’ and learn new ways of thinking. Continue reading “Semi-Structured Data and the Web – Day 5.5″
Homework this work was rather tricky – transforming XMLSchema into a tree grammar representation using XQuery. Sounds simple enough, but I now feel a certain revulsion, maybe even extending as far as hatred, towards XQuery. To be honest, I think it’s got a lot to do with the fact that XQuery is a functional language, and I’m new to the whole functional thing. It feels a little like programming by explosion… Towards the deadline, I think I was starting to get the hang of it. You just have to think a little… differently. Unfortunately, it took too long for me to figure this out and get the homework assignment done, so we had to hand in a partially complete assignment. Not liking that much.
On the menu today: More tree grammar stuff, including algorithms to validate an instance document against a grammar, Schematron (a rule-based document validation language) and XSugar – all of which have more homework assignments set. No time for more blogging, too much work to do!
So, after little snow towards the end of the week, it pelted down on Sunday night, leaving the pavements and roads like an ice rink at 6am – I only narrowly avoided sliding down the hill to the tram stop on my backside. It’s at times like this I’m very glad of my thermos mug of tea!
Scheduling around last week’s coursework didn’t go perfectly – we ended up working til late on the Sunday night to finish off the last bits. Unfortunately, I wasn’t able to meet up with my groupmate last week as it was quite late in the day before we actually sorted out the group assignments. It would have been handy to meet up and get a plan of attack together for the week’s coursework, and we were – perhaps – a little uncoordinated. That said, we just about made it, and everything got in on time. 08:55, for a 9am deadline kind of on-time, that is. Continue reading “Semi-Structured Data and the Web – Day 2″