Archive for the 'Site Development' Category

July 5, 2005

A longer update…

This might not be complete, but I’ll post some semblance of what I’ve been doing for the past week or so, and fill in the details tomorrow.

The website is coming along by leaps and bounds. I’m really pleased with how it’s turned out so far, and it’s starting to get there. Sunday was a nightmare - basically wrote the template parsing routine, and it took absolutely bloody ages. The reason? Well, I use a templating system similar to the one found in vBulletin or Smarty. Namely, it has conditions in it in a similar style to PHP - I’ll post more about that soon.

However, that’s now complete and I’m very happy with the results. The templating is working perfectly, and because of that I’m going to be able to have a fully styleable website for very little extra work. It does mean that I now have to go through and completely change bits of the code, though. Whilst most of it can simply be changed or adapted, other bits need overhauling. I’ve completed 5 out of 8 sections, but I still have Statistics (template nightmare) and Projects (nightmare generally) to finish. After that, of course, I actually have to start doing things like the User CP (so people can change their passwords and stuff). But, the good news is that very little HTML has made it through to the backend - inevitably, there will be small pockets, but most of it has been totally eradicated.

On top of the website work, I’ve been travelling down to Oxford a few days a week with my dad. For those of you that don’t know, I help out/maintain the tape library there, and part of that was creating a better system than the one they had currently installed. That’s pretty much complete now, but I still have a few tweaks. However, most of my work is going to be pure tape logging, and whilst the pay is good it’s still mind-numbingly boring. Today was a slight respite from it, since I spent the entire of the day sorting out tapes that had been left around, looking at the contents of the CDs and playing with the shiny new Adrenaline to sort out a load of files on there. However, tomorrow will be 100% logging - great.

As far as everything else goes, I’m seeing Sarah on Saturday which I’m looking forward to. My car needs to be MOT’d, and I need to renew the insurance. I have to re-program another website for dad, as well as create a design and structure for my aunt. On top of all of this, I have administrative duties at SFN, and to top it all off I want to concentrate on revising some of the maths topics that I’m not so hot on.

So, all in all, it could be rather a busy week.

However, I’m not going to complain. I’d rather be busy than bored, and at least I’m getting to see people and do things, and have some sort of income over the summer.

Anyway, I shall report back tomorrow at some point. I’ve promised myself that I want to get this website done tomorrow at the latest so that I have time to fit in everything else. However, I suppose we’ll have to see.

And one final thing: I won’t be allowing non-users to comment on my blog from when I put the new back-end up. It’s not that I can’t do it, but I prefer not to with the new spam-fest of commenting bots everywhere. I haven’t had an attack yet, but I’d prefer not too.

I must go now, before the computer sucks me back in again - night all.

12:58 am | Posted in Personal, Site Development | 1 Comment » | Show comment »

July 2, 2005

Perhaps it’s not that bad after all

New tests now show that my pages are loading between 0.02 and 0.05 seconds (avg 0.0393s), so that’s not too bad. I’m still making 8 SQL queries per page, but I think I might be able to get that down a tad. Right now, 3 of those are for sessions alone, leaving a measly 1 for user identification, 1 for template identification (!) and a couple of other miscellaneous ones (for example, displaying the news).

I’ve also optimized a couple of other queries. Guess we’ll have to see how it turns out.

Also, I should be in bed right now, so I’m going. Definately this time. Honest. Maybe.

Grr.

2:45 am | Posted in Site Development | No Comments »

It’s that time again…

So you have to put up with my blogging. Ha.

Anyway, been down to work today. Awfully dull (as usual), but I can’t complain. Currently working on the new and improved website - the backend rocks unimaginably, although php’s implementation of classes makes it about 5 times slower than the normal procedural version. Never mind - hopefully that should change come PHP 5.1.

In other news, we’re getting 8mbit broadband. I’ve heard bad things about the customer service with Bulldog, but I’m hoping that’s mainly to do with the fact that BT are a bunch of gaylords and don’t like LLU.

I should really go to bed though, since I have now been up for 20 hours with less than 5 hours sleep last night. Woo and all that. Talk tomorrow at some point, hopefully.

1:26 am | Posted in Site Development | No Comments »

June 21, 2005

OOP is great, and some info about the site

Before you read this post, just understand that it’s more intended for myself than anyone else, and a lot of it won’t make sense. I’ll try and update later as to the changes, but the likely chance is that you won’t actually see any changes at all.

You’ll probably know that I built the code for this site myself. What you probably don’t know is that the backend of this website is rather complex, if I do say so myself. OOP (object-oriented programming) is used extensively throughout to make the backend really, really flexible. For instance, this backend could quite easily be taken out and put directly into another site without too much hassle at all.

The main idea is to use the database to provide content, and, to some extent, the layout for the site. My sites generally tend to sit in a simple fashion - have a toolbar on the left, right or perhaps both, with some floating divs over the place and a few other tweaks and fixes.

It would be much easier to draw a diagram right about now, but I’m too lazy for that so I won’t. However, this is how the whole thing basically works:

  • Instantiate a config object, and connect to the database using the various options.
  • Create a user object. This reads the cookies that are placed in your browser, and sees if you’re currently logged in.
  • Create a session object. This tracks your current session, as well as gather statistics and other menial things.
  • Create a layout object. This is where most of the work gets done. The page gets assembled and output with a variety of options.

Why is it good? Well, it allows for a great deal of abstraction between what I do in the pages themselves and the actual backend, making it easier to debug.

However, I want to take it a bit further; I basically want to ensure that if I wanted to take out the front-end and slap on a completely different site, I can do this. I originally designed the backend for a project that hasn’t yet been finished, and after moving it to realm, I bodged it a bit to make it work. So, I need to do a few things:

  • The layout object currently uses an object to specify various things about the page; i.e. the title, whether we want the toolbar to be displayed, etc. This is a nice little trick that I thought up; each sub-section can display different titles, have different outputs and all sorts of other stuff without messing around too much. Because everything’s buffered until the very last minute, it allows a lot of flexibility. I want to extend this idea - it can certainly be made nicer.
  • Again, the layout object needs to be seperated from specifics. I want to use template sets which are stored in the database, and then these can be parsed to allow for several style sets. It also allows for yet more abstraction.
  • The config options will vary depending on a variety of things. For instance, every site I code will have some sort of database connection, but not necessarily use my LaTeX plugin. I’d like to have some sort of inheritance going on there.
  • Standardize the CSS. This is important if I want to go on and make things better. However, I’m going to have to give this one some thought.
  • Get rid of the damn functions that are thrown about all over the place; all site-specific functions should be in a different file.
  • This is the important one: create a method for processing of form variables and the like. I think the best way of doing this is to modify the page object and provide a list of variables that the script expects. If one is missing or of an invalid type, then the layout object can deal with it in the appropriate manner. This way, I don’t have to do things like escaping strings before they go into the database, I can just shove them straight in without too many worries.

Also, some random facts for you: the backend by itself is over 1500 lines long - if you add the pages code to that (i.e. the stuff you guys actually see), it goes up to something like 3500 lines.

Anyway, I’m going to go off and get started, methinks. No time like the present, and all that.

6:33 pm | Posted in PHP/MySQL, Site Development | 1 Comment » | Show comment »

More usefulness

I’ve not added anything new today (yet). There’s an annoying bug I have to fix with the logout function, but that should hopefully be a reasonably simple fix. In other news, I’ve coded a small bit of JavaScript that I think is quite funky. Whilst I usually loathe JavaScript to the extreme, I’m coming to see that small bits are quite useful when used properly. The problem is, loads of kids abuse it and have multiple flying things everywhere whilst saying “omg look aet teh c00lness!!!!112″ Basically, this bit of code fades out the sidebar and extends the content to the full width of the box. Yes, it’s a bit useless but it looks cool and allows for easier viewing. I might add it tonight if I can be arsed, and I can find a place to put the checkbox.

In other news, the Wing Wa meal was completed successfully today, with multiple fun and food had by all. It’s actually very reasonably priced; £5.80 for lunch, all you can eat and there’s absolutely loads of food to choose from. List of people: myself and Sarah, Alan, Emma, Alex and Katie, Helen and Dan, Lewis and finally Mark. Mo couldn’t make it, but that’s okay since he’s going to come around tomorrow to collect his present.

Anyway, I’m going to go off and post some stuff on SFN. Have fun.

5:17 pm | Posted in Personal, Site Development, University, XHTML/CSS | No Comments »

June 20, 2005

Some more features

Some of you may have noticed the “Register” button in the top right corner. That is indeed the button you need to perform clickage upon in order to register your account here. Here’s a list of things again:

  • Added registration!
  • Fixed a couple of minor cosmetic issues.
  • Fixed the people page so that it renders properly in IE, because as we all know: IE is “teh sux0r”.
  • Fixed some LaTeX issues. Not of the kinky variety.
  • Added a new feature to the comments system. Your e-mail address is displayed, but with a new twist. If you set your e-mail as dave@monkeyfish.com, it will get displayed as dave@dontspam.monkeyfish.com, so the robots won’t necessarily be able to find it easily.

I may also have some image validation thingy to make sure that robots aren’t trying to register.

So, apart from this, all is good. I’m still mulling over the photos section idea, and in order for me to bring it back, it does need a complete recode really. This will take a few hours, and whilst some of you may say “hurrah, Dave is a giant goat with loads of time!!” I am neither a giant goat (except on Sundays) or possibly a person with loads of time. Okay, that’s a lie - I have loads of time. Which leads me back to the beginning of my argument. Oh dear.

Anyway, it’s another lovely day around here, so I might go out in a bit and enjoy the sunshine. Or possibly run around like a headless chicken. Oh, the hilarity of it all.

1:43 pm | Posted in Randomness, Site Development | 2 Comments » | Show comments »

June 19, 2005

Whoops (again)

Forgot to post for the past couple of days. However, I do have rather a good reason for it. In fact, I have a very good reason for it: namely GTA: San Andreas which has just been released for PC. It’s rather a good game, and has taken up pretty much two entire days of my existance to get somewhere near completion. The map is so incredibly large, and there are so many things to do that I think I may have to spend at least the next week or two trying to get to the coveted 100% mark. Oh, what a hardship.

In other news, I get my exam results on Friday which I’m currently not looking forward to. So, in order to keep my mind off it I’m going to work on the site a bit (as well as playing GTA). I haven’t got around to doing anything yet, but I’m going to try and get the Mandelbrot set generator up and running in the Projects section today. It’s a pretty cool program, but I need to optimize it and generally get it to work better. I do have a minor problem in that I forgot to set the precision of cout and cin; by default, it only reads in numbers up to about 7 decimal places, so you can’t get most of the interesting shots.

I’m also not sure as to whether I should get the Photos section back up or not. There are a lot of photos - last count, over 500 - and although I have more than sufficient bandwidth for now, I can’t help but wonder what will happen if the site takes off a bit. I’m also considering putting some kind of Google AdWords on here, but at the moment the pendulum swings towards “no”. For starters, not enough people visit the site to make it worthwile, and I’m not sure that I could get them to blend in properly. I will only put them on if it doesn’t compromise the layout of the site.

The world of maths is looking quite diverse for next year. I’m considering what modules to do for next year, and this is quite a hefty challenge - the sheer number of courses on offer makes it quite hard to make my mind up. Like most other universities, we’re allowed to choose a variety of modules in the third year, totalling 120 CATS (module points) or more if we desire. Most of the third year modules are worth 15 CATS each, and the fourth year modules 18 CATS. Now, assuming that I actually get on the MMath course - which I really hope I do - I have to take two courses from the fourth year modules. At the moment, this is looking like it’s going to be Manifolds, since it’s needed for so many other 4th year modules and a choice of either Lie Groups (taught my my tutor) or Mathematical Recipies, which is more of an applied module.

My worry at the moment is that I’m not sure which “route” I should be taking. This year, I pretty much took a 50/50 pure/applied route. However, I’m finding myself inextricably drawn towards courses that concentrate mainly on the pure. I find that they’re extremely interesting and, for the most part, make me work harder on them. Metric Spaces went really well for me - it was a really nice exam, and although it didn’t have the same insane marking that it usually does for definitions, it had interesting questions that made you think, but were still managable. I have to also admit that the applied courses are also interesting, but my concern is that I’m going to screw them up, and I don’t quite have the same understanding that I do for the pure.

Of course, the other issue here is my postgraduate opportunities. Again, assuming I get onto the MMath and I’m finding the 4th year work enjoyable and I can cope with it, then I’d quite like to do a PhD. Even if I didn’t actually go on to do research and other insane mathematics then it would greatly increase my job opportunities. However, that’s a good two years away yet; not to mention that if I don’t get on the MMath, all of this talk is a complete waste of time.

Anyway, I think that’s enough for now. I’m going to concentrate on SFN now, and try and catch up on the backlog of posts that I have to moderate. Woo. See you all later.

3:13 pm | Posted in Computing, Maths, Personal, SFN, Site Development, University | No Comments »

June 16, 2005

Things to do with the site tomorrow

Oh such an imaginative title. Never mind. Hopefully, these things will be done in the correct order.

  • Create registration form for all you people out there that want some kind of account.
  • Photos section, if I can be bothered.
  • Fix sidebar with proper links.

I’m sure there’s something else, but I can’t quite remember what right now. Oh well, I shall perhaps edit this post in a minute.

12:53 am | Posted in Site Development | 3 Comments » | Show comments »

June 15, 2005

More site changes

So, yet more site changes today. I’ve got some of the People section finished, but I need to add the University collection of people to that.

Anyway, for those of you who actually use the RSS syndication that I have on here, you’re probably going to want to update stuff, since I’ve changed a lot of stuff around, and the RSS feed is now gotten from a different location. Maybe someone out there uses it apart from me, possibly.

I shall be updating again in a bit. However, for the time being, it’s back to Bill Bailey and the joy of Bewilderness.

11:22 pm | Posted in Site Development | No Comments »

And now, the boredom

Yes, so now I have finally finished the damn second year, the sheer, unadulterated boredom has set in. Yesterday was fairly dull, but it was pretty cool. Ended up going to the Bull Ring and then going off to visit the Apple Store. I have to say that I find the PowerBook G4’s particularly appealing, and I’m seriously considering buying one. Got a few things, but nothing of great significance.

Today, I spent a long, long time in the Projects section trying to finish the entire site off. Finally, finally, finally it’s finished, but I just need to populate the thing with some decent projects (there’s a fair few). Tomorrow, I’m going to do the People section, and then the registration form. After that, if I’m feeling really lucky, I’ll re-create the photos section in the spirit of the site.

On the maths front, I’ve been reading up on Galois Theory (a module I’m taking next year). It looks to be fairly interesting; basically, covering questions such as for which polynomial does the equation yield a formula for the roots? You can do it for all quadratics, cubics and quartics, but quintics can’t be done. All in the quest to be prepared for next year’s courses.

Anyway, back to the coding. I shall perhaps start the People section now. Hmm…

12:28 am | Posted in Computing, LaTeX, Maths, Site Development | No Comments »