Rethink

Well, yes, I started off thinking about using Smarty templates on the new site.

Then I thought again. First of all, I want to start getting this stuff off the ground and working. So why should I blow time and effort on starting from scratch with a new templating system? Surely it’s going to be better to start off with what I know, primarily as a proof-of-concept, and keeping in mind that yes, I will want to sort it all into templates later. And ideally with a minimum of code-cruft and work.

But for now, well hell, I might as well just do it in my normal way, which is fairly modular (i.e. templated) anyway, just without bundles of extra stuff. Then when it’s up and running I can run a development copy that uses the templates. When they’re all up, running, and tested, I can move them into the main site. Hey, that almost sounds like something sensible.

I must be doing something wrong…


Templating

Over the weekend, I’m going to be doing some more work on the new site. I’ve got most of it in my head now, so it’s “just” a matter of now getting it into code, and working.

As part of that process, I’ve decided to be “brave” and use a templating system for the first time on a home-grown site. I can see that it’ll have a lot of strengths in the long run, but my experiences with the templating “system” *cough* we use for work’s main site is such a sack of shit I’m still not certain about them. So it’s all part of my own learning curve, really, seeing if another method for doing them is going to be better.

I’m going to be going with one I got asked about for a job interview a while back, Smarty. The name doesn’t fill me with optimism, but hell, I’m willing to give it all a bash.

I’ll write more about them on Monday, I’m sure…


USB Sticks

About four months ago, I bought a little USB pendrive/thumbdrive/stick with 512Mb of memory on it. It’s been a great way to have a back-up of all the stuff I’m working on at the moment – although of course with that amount of stuff on it, it’s going to be a nightmare if I lose it.

No shock, I lost the bloody thing. Couldn’t find it anywhere. Having already had it fall out of my pocket once – and luckily be found again – I figured it’d done the same again, and this time I was chuffed. So, a brief flurry of changed passwords later, I ordered a new USB stick, exactly the same as the previous one.

Now, about two months later, I’ve put on a shirt this morning and thought “Hmm, wonder what that is in the pocket?” Of course, it’s the first USB stick. It’s been through the washing machine, and god knows what else (and isn’t it lucky that I rarely bother to iron shirts?) but when I got to work I stuffed it into the USB slot and lo, it works.

So now I’ve got two sticks – I’ll probably end up using one for work stuff, and one for my own stuff. Sounds like a plan. Well, at least until I lose one of them again…


Hand Coding

There are times where I can just end up feeling like a complete numpty. This has been one of those days.

Because I’m also an epically sad git, when it comes to writing webpages and PHP (PHP in particular, in this case) I tend to write them by hand, rather than using programs like DreamWeaver or whatever to do the work for me. There’s a lot of reasons for this, primarily that if I write it I know what I’ve done, it’s fixed in my head, and I can go back later, look at it, and know what I’m doing. Dreamweaver in particular is not good for that kind of thing.

The down-side of hand-coding, though, is that on occasion you can make a right arse of things, and then it can take a while to figure it out. And that’s what’s happened today. I’ve been trying to figure out why something was displaying when it shouldn’t be. And could I? Could I eckerslike.

I’ve finally figured it out though, and it’s a simple mistake because of writing stuff by hand.

In PHP, setting a variable is done by using $variable=1;

If you then want to check the value of it, you need to use if ($variable==1) .

Yes, I was checking it with if ($variable=1), which in PHP is something that’s always true – because you’ve assigned it to be 1 in that self-same line. One character wrong, and now it’s all fixed and working perfectly. And it only took three hours to figure out…


Blog-stuff

Hallelujah – I’ve just completed the initial version of the commenting and so on for the blogging system I’ve written for work.

So we’ve now got a fully functioning (if currently still pretty basic) blogging tool, which will be up and running and in use for Friday’s deadline.

Needless to say, I’m really rather chuffed with myself. It’s sad to be this geeky sometimes – but what the hell, I’m still chuffed.


Blog Tool

Wow, that’s scary. I’m now a good 90% of the way to having written a complete multi-user (and I do mean seriously multi-user) blogging tool. It’s “just” comments to go now.

Of course, this is just version 1. There’s a lot of development still to go on with it, but the basics are there and running.

Who knows, I may even end up using it myself – although for the moment WP is sufficient for my needs.

And before anyone asks, there were major reasons for supposedly re-inventing the wheel on this one. Not least that nobody short of typepad has come up with anything that works in even vaguely the same way. (i.e. multi-user, all using the same basic domain – so blogs appear at username.site.com , and a bundle of other things.)

Sometimes I’m so geeky I even scare myself…


Shuttle

A while back – quite a while back, as it happens – I bought a new PC. All very sexy, a little Shuttle box, 64 bit AMD processor, blah blah.

Regular readers will have noticed that I haven’t mentioned it all that much. There’s a reason for that – it’s still not working.

I’ve tried pretty much all I can think of, short of cannibalising the hard drive out of the old PC and shoving that in to see if anything works that way. The list so far includes:

  • complete disassembly and reassembly – including checking the seating/positioning of the processor
  • Installing Windows XP, Xp64 and 2000
  • Installing Mandrake and Ubuntu linuxes (Linii?)
  • Swapping out various components, to see if there are problems on those

I’ve also changed from an SATA drive to a normal IDE drive.

The problem is that while nothing has so far installed properly or run properly, the errors are never the same. It’s normally that some file or other isn’t installed, or is corrupted, but then every so often you get an “IRQL NOT LESS OR EQUAL” error, or a different Screen Of Death. The Linux installs die with a totally corrupted screen, so I’ve no idea what the problem there is.

The only conclusion I’m left with now is that the motherboard itself is screwed. Unless anyone else has any other ideas about what it could be?