Archive for the 'Academia' Category

April 12, 2006

Past Exams and More Programming

Well my brain is thoroughly fried; just completed the 2002–2003 past exam papers for Combinatorics and Topology, and now I can barely concentrate so I’m going to take a large break and try not to think about how much I’m going to screw up Measure Theory. Anyway, thought I’d post another entry and see if I can get myself on a roll. Like that’s going to happen.

So, last night I mainly concentrated on getting this homemade YUV overlay built, and it seems to have worked nicely. The problem wasn’t Mesa, more the fact that I was generating 5 textures/frame, and telling OpenGL to overlay them in a very inefficient way. After spending some time reading up on Cg shaders, I created a basic fragment shader that did the job super quickly with only three textures. So I’m happy.

The other topic on my programming agenda is the blog. I really want to get going on my own website, and the blog is quite an integral part of that. I’m quite picky when it comes to having multiple copies of things, and I don’t like the idea of all of my original blog entries being separate from the blog entries here. So I’m going to have to come up with some way of keeping a central store of blog entries and comments, somehow. I was thinking that I might use a cronjob’d php script to grab entries and comments via RSS or similar, then update the database accordingly. But again, there are problems to this approach – what happens when I get a load of entires on here?

Bah, I’ll have to thnk of something. But besides that, I’ve been playing around with PHP’s PDO objects and they’re very cool. I’ll never have to worry about manually escaping my SQL data again. I’ve created a basic abstraction layer for some common functions, but I’m sitting here wondering whether it’s really worth it. Right now, I’m thinking “probably not”.

So those are the things going on at the moment. I should probably be revising, but I’m sick to death of it by this stage in time. Can’t wait until next year – the more 100% assessed modules, the better.

4:59 pm | Posted in Computing, Maths, Revision, Warwick Blogs | 2 Comments » | Show comments »

April 11, 2006

Damned Revision

Well, it’s been a whole load of time since I posted, mainly due to revision and lazyness on my part. So I thought I’d post a quick update on what I’m doing – not that anyone will be all too interested.

So I’m back in Walsall after spending a week down at Sarah’s. Unfortunately, things haven’t been brilliant on the revision front. Whilst I’m mildly optimistic about Combinatorics, Introduction to Topology and to a lesser extent Topics in Mathematical Biology, I know that Measure Theory is going to be awful. I’ve not done a lot of work for it, and to be honest, I just don’t understand a lot of the material.

However, on the upside, I’ve finished all of my Topology and Topics exercise sheets, which is something that has never been done before. I’m now at the stage where, a week before the dreaded exams, I’m getting my act together and doing three past exam papers a day. So maybe there’s hope yet; we shall see, I suppose. I figure that even if Measure Theory goes badly, I can still pull it up with some better marks from the other modules.

However, I didn’t really want to talk about exams so I’ll talk about something equally as boring – programming. Been playing around quite a bit with two things over the holidays. Firstly – and this has been on the agenda for some time now – coding an OpenGL GStreamer application to map video onto a cube or some other random object. Surprisingly, this was initially very easy, once I’d found out how to actually get the contents of the GStreamer buffer into my program.

Basically I use decodebin to get the video playback working, and then pipe it through ffmpegcolorspace to get a nice RGB texture. Then, I use fakesink and a handoff function to actually generate the texture to screen and map it onto a cube. The hardest bit was actually finding out about the handoff function – it’s buried deep inside the GStreamer Plugin Guide, which is quite annoying. However, it does look quite cool. You can even take a look at it for yourself if you’d like.

Even so, I wasn’t quite satisfied. The biggest speed hump is the ffmpegcolorspace conversion, as generically most video files use some kind of YUV format to store video frames. Typically, and somewhat ashamingly, there’s no general way of dealing with YUV textures in OpenGL – all of the extensions out there generally suck, and don’t work for different versions. Plus, none of them cope with 4:2:0 planar YUV, only 4:2:2 pixel-packed for the most part. So some form of conversion to RGB is required, and a significant amount of CPU overhead is incurred in the process.

For the last couple of weeks I’ve been looking at various ways of efficiently using the GPU to do this conversion for me. Colour matrices were the first option I looked at. Basically, given some texture, one can use a colour matrix to remap colours in any given format. However, the major problem is going from 4:2:0 planar to 4:4:4 pixel packed, and that itself incurs quite a significant overhead.

Blending textures is possibly the best way of doing this. Basically, one generates 5 different textures along with using a simple colour-lookup table. Firstly, we lay down the Y channel as a luminance channel. Then the additive U, then subtractive U, and the same for V. In effect, just layering one channel on top of another to simulate the YUV->RGB conversion in the GPU.

However, there are again problems with this. The naive approach is to redraw texture upon texture, which means that every pixel needs to be redrawn 5 times every frame – at 25fps, that’s 125 times/second! In order to get the most out of the GPU, I used the ARB_multitexture extension, which allows you to layer textures extremely quickly in one pass. I also delved into the world of shaders to try and work out whether it might even be worth usnig only 3 textures and doing the RGB conversion through a simple ARB fragment program. This is something I’m still looking into.

Unfortunately, although this actually works and I’ve tested it, it’s still very very slow. However, I’m using quite a crap Intel 915GM based GPU under Linux. The i915 driver is not particularly good at the moment, and upgrading to Mesa 6.5 seems to have made matters even worse. glxgears is showing only 600fps – I should be getting at least 1300 according to other guys with the same card. So I’m guessing – and hoping – that the problem lies with the drivers and not my card. When I get back, I’m going to check it out on my Radeon 9800 and we’ll see how that copes.

Anyway, that’s probably enough for now. I’m going to reboot and see if I can get this all working nicely.

10:00 pm | Posted in GStreamer, Linux, Maths, Revision, Warwick Blogs | 3 Comments » | Show comments »

March 14, 2006

End of Term

Well, after the complete downer at the end of term, things are looking up. I’m spending a week down in Plymouth with Sarah, and it’s been nice and relaxing so far. I’ve spent quite a few hours coding on the website tonight, trying to get things done by the end of the week. When I get back on Saturday, I’m going to have an awful lot of revision to do and not a whole load of time, so for the main part I will probably not be blogging or doing much else than revision.

My first four exams are at the beginning of April, and I’m not looking forward to them that much.

  • Topics in Mathematical Biology
    The course itself doesn’t seem to be too hard. Sure, there’s non-linear PDEs and all that jazz, but we don’t seem to actually do an awful lot with it. The problem with this exam is definately going to be the sheer amount of things that we have to know. And, unfortunately, there’s just no way around that apart from extensive revision.
  • Introduction to Topology
    I’d like to think that at this point in time, I understand topology fairly well. Again, there’s a fair amount to revise for but this is something that I can tackle, and it certainly isn’t insurmountable in terms of understanding. Which is always good. I just hope we don’t get a nasty exam.
  • Measure Theory
    This one has me a little worried. The problem is that there’s a lot to revise for and it’s also quite challenging from the standpoint of knowledge. We didn’t have the best lecturer, so that doesn’t really help matters. Really need to get going on some past exam sheets and do some questions.
  • Combinatorics
    I understand and enjoy this course. My only worry is that the lecturer, Daan Krammer, sets a nice(ish) exam. Last year’s was pretty nasty, and although it’s fairly easy to do, it takes a lot of time – not something that you have an awful lot of in the examination rooms.

Anyway, this is all worrying about nothing at the moment. I’ll worry more when I get back to Coventry and get going on the actual revision. For the time being, I’m going to drink some tea and enjoy myself here (as much as I can).

On the website front, I’ve finally got the “proper” CSS coding in place which means user-selectable themes! I know that’s what you’ve all been begging me for in a completely silent fashion. But yes, I have three CSS templates for the new (WB) theme, the default theme and also the old theme which did mainly suck. But there we go. Just need to write the appropriate bits for password changing, selecting themes, profile information perhaps and a couple other things, then I’ll have something that closely resembles a proper website.

I’m also going to make a distinct effort when I get back to catalogue all of my loose pieces of code here and there that do minorly useful things. I really want to put them on the web, since at least some people might e-mail me. I like e-mails, after all.

On top of that, I hope to accomplish the image catalogue as well as putting the photo galleries back online. I’d also quite like to optimize the scripting so that it all runs a lot faster and uses less SQL queries. Also, the CSS could, as always, need some work but I think I’ll leave that for the time being.

I can’t wait to get this thing finished. It’s been a long time coming and, considering the amount of work I’ve put into it, I’ve not had a lot to show for it. Certainly the coding will be most of the work, but I must sit down and actually write some content, otherwise this place will be nothing more than a skeleton. I’m more determined than ever that during this exam period I will blog more than I have done before. I need somewhere that I can vent my frustrations and not bombard my poor Sarah with rambling maths questions.

Anyway, I must stop writing now as it is certainly time for bed. Tomorrow, I think I’ll mainly concentrate on the user control panel and get that out of the way. Once I get that done, I can move on to sort out the other bits and pieces that are more shiny.

1:16 am | Posted in Exams, Maths, Site Development, University, XHTML/CSS | No Comments »

March 10, 2006

A Bad Day

Not been a great day, when all’s said and done. A friend of mine has, frankly, shown his true colours this afternoon and to be honest I’m quite annoyed about it all. I don’t think he reads this blog, but in case you do; I don’t consider you as a friend any longer. Don’t expect anything from me in the future, because you’re not going to get it. Grow up.

Basically that’s spoiled my day up until now. We had Pizza Hut tonight, which was nice, but honestly I’ve never been quite this angry with anyone before and I don’t particularly like it. I just find it hard to believe that anybody could be quite so immature and idiotic, but there we go.

So, I’ve decided to come back to Coventry tonight instead of doing the usual Maths-fest. I have to pick Sarah up later, but I do have two episodes of Ramsey’s Kitchen Nightmares to catch up on and I would really like to work some more on the website tonight. I’ve patched up most of it to use my new templating system, and it seems to work a treat. I’m still not 100% sure about the performance, but I reckon I can get away with it pretty easily. Perhaps if I do some database work and tidy the OOP code a little, it can be enhanced a bit more.

Still, load times of about ~0.01 seconds per page aren’t too bad. I just want it to be able to process the databases efficiently. I’d better get on with it then, I suppose. Bleh.

8:53 pm | Posted in Personal, Site Development, University | No Comments »

February 22, 2006

Oh dear, quite late for this

Well, it’s a little later than I wanted to go to bed, but oh well. Got quite a bit of work done on the project tonight; fixed some problems with the code, cleaned it up and general polishing. Also, fixed a couple of design flaws that were just annoying me; can now hook up more than one output module to each PDESolver object, which is nice.

Basically, the PDESolver object is an abstract class which has one virtual function, solve(). This is implemented by subclasses allowing me to very quickly and easily create new methods for PDE solving without going through all of the hassle of starting from scratch. As a part of this, I also created another abstact class, PDEOutput, which is designed to allow sub-classes to implement output methods (such as to files, X11). Up until this point, I could only output to one PDEOutput object at once; now I can do multiple things, which is always good.

I also now have some very funky 3d visualizations of my solutions thanks to OpenDX. It’s really starting to come together; hopefully if I pull my finger out and finish off the write-up tomorrow then I can get it all done and printed out by the weekend. Here’s for hoping, at least. I’m going to try and put the graphs on here for everyone to see because they’re really quite nice. However, I’ve not got them quite to my liking yet and I still feel that they need a bit of tweaking. Hoping to find some way to get some good anti-aliased fonts out of OpenDX.

Aside from this, I watched Robots tonight (which was my Valentine’s present from Sarah). I’ve forgotten how much I loved that film; it was definately a good one from Blue Sky. Can’t wait for Ice Age 2.

Anyway, I’m definately going to bed now. Need some sleep, and I’m doing campus tours tomorrow. Wouldn’t want to give the prospective undergraduates bad ideas about student life, oh no…

2:56 am | Posted in Computing, Maths | No Comments »

February 19, 2006

Not enough time in the day

I clearly don’t have enough time in the day for everything I want to do. Almost have IMAP set up at home so that I can remote access all of my e-mail from either my desktop or my new laptop without having to transfer it all everywhere. Just got to set up fetchmail and procmail to fetch and move the appropriate messages.

Apart from that I’d like to work on the website but it’s currently far too early in the morning to attempt such a task. Today I copied ~20 sides of notes from various lectures, which brings me (almost) back up to date. The only lectures I have left to copy up are ones that I don’t yet have notes for – definately something to chase up on Monday.

Other than that, went to Skool Dayz for Mark’s birthday party. Apologies to all that were involved – I am hopeless at going out to the Union, and I probably shan’t do it again. The last time I actually visited the place was the Elections Party in my first year.

Computational PDEs has been worked on over the past couple of days. This time I have to create a program to model either the regular KdV equation or the modified KdV equation (there’s not an awful lot of coding difference to either method). I’ve completed the programming itself, but I’ve run into a couple of odd things. Namely, my oscillations start at double the time that they probably should do. Hopefully I’ll talk to the lecturer on Monday about this as I’m a little confused as to what is actually involved.

Anyway, I shall hope to squeeze in a bit of time on the website sometime tomorrow. Have quite a lot of work to do in the meantime, but I’m optimistic that I can get it done now that I’ve pretty much finished the coding for my Computational PDEs module. We shall see, I suppose.

2:26 am | Posted in Computing, Linux, Maths | No Comments »

January 18, 2006

Bleh

Well, it’s certainly been quite some time since I last blogged. The reasons are fairly few and far between; mainly it’s because I’ve been extremely busy (read: excruciatingly lazy) and haven’t had a lot of time on my hands to sit down and empty my thoughts out. I had been thinking of moving back to my own personal site, but I really don’t have the motivation to sit down and actually code the rest of the site.

Christmas was good, although a little boring. Spent most of my time on the computer, doing various bits and pieces and a little maths. Didn’t get a whole bunch, but I’m not really altogether bothered – which is a bit odd, but I suppose that’s all part of “growing up” or some rubbishly similar thing.

Can’t believe that we’re already in week 3. I’m taking an insane amount of CATS simply for the reason that I don’t know what to drop, and I’m feeling a little overwhelmed by it all. Seem to have lost any motivation to do work at the moment, and that’s a little disconcerting. Taking Manifolds – which I find, for the most part, gibberish – as a fourth year module, as well as Computational PDEs and Equivariant Bifurcation Theory.

The former is really a rather good course. Basically, it involves the computation of numerical solutions to PDEs – oh, I bet you didn’t see that one coming. Oh no. The latter is also quite good, covering the symmetries of group actions on various sets and differential equations.

But the more I think about it, the less I want to do a PhD/MSc in mathematics alone. Of all the courses over the past three years, I’ve highly enjoyed all of the numerics and programming that’s been thrown at me; indeed that’s where I’ve got some of my best marks. So, at the moment, I’m thinking that I might sit down and contemplate applying for some postgraduate stuff at the CSC.

Anyway, that’s a long way off yet. Let’s see if I can keep this blogging thing up, eh?

9:03 pm | Posted in Computing, Maths, Warwick Blogs | No Comments »

November 14, 2005

Nothing to do!

Well, I find myself sitting here in the maths department with very little that I can actually do for the moment; I have to say, this makes rather a large change from the norm, but there we go. I say very little, because theoretically I should either be working on Topology (can’t be bothered) or Combinatorics. However, I’m giving myself a break since I’ve managed to complete all but the last question on the assignment a week and a half before it’s due in. Warwick Accommodation form for next year’s hopeful on-campus place has also been submitted.

Anyway, thought I’d come on here and let you all know that. Not that anyone will be interested in a post that basically has no content and is generally useless to everyone. But never mind, eh?

I think I might go back to the house now.

7:18 pm | Posted in Boredom, Maths, Warwick Blogs | No Comments »

November 8, 2005

It’s been a while

I’ve not been on here for a while again, mainly due to maths and far too little time, but I thought I’d give a quick update to let you all know how I’m getting on.

Firstly, the maths. Measure Theory has been a pig this week (those who are doing the course will love and cherish question 7 on this week’s assignment). I only know a handful of people who have completely finished it, and I’m certainly not one of them. I’ve managed to complete 2/3 of it, so maybe I’ll get lucky and they won’t mark the stupidly hard question.

Combinatorics has been going well. Got the third assignment in a whole 3 days earlier than it was actually due in, and with an (almost) complete set of answers. The lecture notes are excellent, which is always good, and I think the course is one of the most organised I’ve seen so far. Then again, Daan Krammer has always produced brilliantly organised notes and – touch wood – reasonable exams, so my hopes are high.

I’ve decided not to bother going to any more Rings and Modules lectures. Frankly, I still don’t even get what a module is, let alone tensor products, finite dimensional algebras, faithful semi-modules and the rest. It’s like a complete contrast of Combinatorics; appauling lecturing style and lecture notes (sorry), not enough examples that actually make sense and a complete disregard for any sort of coherence. I was actually hoping that somebody would take note of what was said on the SSLC forms for Algebra II, but alas, Dr. Moody doesn’t seem to have caught onto the problems. I’m hoping that with a good book and some time over Christmas, I can teach myself the remainder of the course. However, this just doesn’t look likely anymore.

Since I’ve now effectively dropped both this and Dynamical Systems, I’ve had to take up Topics in Mathematical Biology just to make up my CATS (without those two I would be doing 42 this term). The dynamics of systems has always intruiged me, and I wrote my second year essay on the topic. I’ve managed to wade my way through and copy up about 20 pages of notes in the past week, so I only have a little bit to go. In fact, I should be doing this as we speak.

Besides all the maths, I’ve not been up to a whole lot. One thing to definately note is my 2nd year of dating my girlfriend (Sarah). I cannot believe it’s been 2 years already – hardly seems like I was in Cryfield getting hideously drunk – but it was a nice day. We went to see Serenity at Star City, which is by far the best film I’ve seen in a long time. After that, Pizza Hut was consumed (it’s a tradition) and then just general lazyness watching TV for the rest of the day.

Also been checking Warwick Accommodation, and apparently forms come out on Friday for final year undergraduates applying for on-campus accommodation. I’ve been looking forward to going back on campus for a while now, but the first vestiges of doubt started crawling back into my mind. Perhaps a little more thought is required on the subject, but I’ll apply anyway and deal with it later.

Other than all of this I’ve immersed myself in implementing some rudimentary AJAX for a project. It’s all to do with tape librarys, but it’s extremely boring so I won’t mention it here. Re-considering my decision to have my blog on here – I do miss my old website, and am seriously considering moving back there. I even completely re-did the CSS to enable me to implement styles a lot easier (so I can have both the original and new styling on here). However, I’m still waiting on my host to update to PHP5 (I know, it’s not completely production stable yet) so I’ll have to put it off for a little longer yet.

What little time I have left out of all that has been spent playing Black & White 2. I especially enjoy throwing rocks at random buildings and blowing up people with giant volcanos of immense and utter doom. In my case it does still suffer from the boredom factor of the original; it’s cool for a time, but after a few days the monotony starts to set in (constantly re-building towns, blowing people up, hurling rocks at giant axe-wielding monkeys, etc etc). Oh well, I do have the shortest attention span ever, after all.

And now I’ve realised that this really is rather a long list and I should probably get back to copying up the remaining 13.5 sides of notes still remaining. Yay?!

9:21 pm | Posted in Maths, Warwick Blogs, Web Development, Whining, XHTML/CSS | 3 Comments » | Show comments »

October 25, 2005

Sigh…

I don’t know what it is about Maths, but it has some very good ways of annoying the hell out of me. I now have a number of problems that I can’t figure out how to solve:

  • Measure Theory assignment is due in tomorrow but I can’t complete question 8. Measure theory is just one big mess at the moment though; I can understand the concepts perfectly, but when it comes to actually sitting down and proving something I’m just ultimately screwed. I need to (re)learn some set theory.
  • Dynamical Systems assignment is completely insane, to the point where I don’t think I’m going to be able to physically pass the exam or even do the damn thing.
  • Rings and Modules is another great big mess of uncertainty. The probability is that this module is almost certainly going to be dropped come the end of the term. The lecturing is, quite frankly, terrible and needs to be sorted out.
  • But if I drop that and don’t take Dynamical Systems, it will leave me with precisely 3 modules totalling 42 CATS this term – everything I want to take is next term. So I’d have to take ~100 CATS next term in order to get to my 150 total. Whee.
  • Why am I still in the Maths Department?
  • Why won’t Measure Theory go away and leave me alone?
  • Am I ultimately screwed for this year?

I’m extremely frustrated about the Measure Theory, frankly. It just seems that I can’t get my head around the proofs. Every time I think I’m getting somewhere, the entire proof gets bodged and I’m screwed. Either that, or because I don’t know as much as I should, I think its bodged and re-do it 97 times only to have someone tell me it’s actually correct.

Plus I’m still struggling with infimums and suprema 2 years after we were taught them. This really can’t be a good sign.

9:44 pm | Posted in Academia, Maths, Warwick Blogs | 1 Comment » | Show comment »