Archive for the 'Warwick Blogs' 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 »

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 »

October 21, 2005

I’ve done it again…

Just a quick entry for now, because I don’t have a lot of time before doing some Combinatorics assignment. However, I just thought I’d poke my head around the door to point out that I’ve not been beaten to death by a rampaging herd of slightly obtuse aardvarks. Let’s face it, that just can’t be good for your health.

But anyway, I will post later. Promise*.

* - Statement may be false. May not be used as a floatation device.

12:33 pm | Posted in Randomness, Warwick Blogs | No Comments »

October 7, 2005

Get in

Well, I know I haven’t blogged for a while, so whilst I’m sitting here waiting for some inspiration on the Measure Theory assignment this week I’ll update everyone who is mildly interested (probably zilch) on what’s been going on.

First off, the involuntary “get in” reaction. Last week I applied to become a peer tutor, and being the enormous idiot that I am forgot to fill in a word at the bottom (which I consequently blogged earlier). However, everyone on listy3 got an e-mail today asking whether they wanted to help out, since a ninth class has had to be created to fit everybody in. This time, I got the e-mail after about 20 minutes, and have had a response to say that I have the place. Unfortunately, the class on Monday morning is on the 5th floor Physics seminar room, but I’m not about to complain.

Anyway, apart from that I’ve been busy updating vBulletin to 3.5 over at SFN – my habitual geeky home. For anybody that’s interested in the sciences or anything else besides, come along and post some stuff. It’s good fun and we’re trying to add to the academic base of people that we have there, so I’m going to plug it like a beast.

Naturally, that’s taken up a lot of my time. I’ve re-written a mod I wrote to render LaTeX using a small PHP class. I discovered the utter uniequivocable joys of dvipng, which makes creating PNG’s so much faster it’s just utterly untrue. The class also provides a number of options (one being MathML, if I can get it to work). So that’s good.

Besides that there’s been lectures as per normal. I’m enjoying all of the courses I’m doing so far; the problem is, I don’t know which ones to drop. I’m on something silly at the moment, like 250, but if I only drop 5 modules that gets me back down the scale quite a bit. I think I may put it off until later.

Also, I put some fencing up today. And I’m going home to visit the folks later, so it’s all good. For now though, I think I shall depart to beat Measure Theory with uncountably many sticks, and perhaps an open cover or two.

7:12 pm | Posted in Computing, Maths, SFN, Warwick Blogs | 3 Comments » | Show comments »

September 30, 2005

Cheese.

It’s very good for you. Especially in Tesco Value ubersize packs.

On other less related matters, I’m bored.

10:10 pm | Posted in Boredom, Randomness, Warwick Blogs | 3 Comments » | Show comments »

Bah.

I’m a bit annoyed at the moment. I filled in the form to become an Analysis peer tutor again this year, and forgot to fill in the bottom of the form saying whether I could attend the meeting today or not – probably because I’m stupid. Got an e-mail yesterday at 2pm asking me whether I could attend, but I didn’t see it until 6pm when I got home – by which time, he wouldn’t get the e-mail until the following morning, making it too late for me to get in.

I got a rather apologetic e-mail saying they’d filled the groups and would e-mail me if someone doesn’t turn up, so I guess I’ll just have to wait and see. I doubt it’ll happen though. Quite annoying, really, since I enjoyed doing it last year and was very much hoping to do it this year. However, it’s out of my hands now and I suppose I’ll wait and see.

On the good side, I dropped Continuum Mechanics, since the lecturer obviously hasn’t learnt anything from Differential Equations in the first year. I’ll just sign up for something else instead – with over 100 CATS left to play with, I’m sure I’ll cope.

12:11 pm | Posted in Maths, University, Warwick Blogs | No Comments »