[Webgeek] Longshot

Has anyone out there attempt to use PHP 5.1 to generate a PDF, and then have it load inline in IE6, while behind a login? (ie. with a session running).

Aside from needing a session_cache_limiter(“private”); prior to session_start(); are there any other gotchas I should know about?

Today’s New Toys

It’s strange how rewarding I find adding bells and whistles to my http://ala.sda.ir domain. I need to go back and take another look at how the automatic calendar fetching is working at some point, because it’s not really very nicely formatted, and it seems to be ignoring weekends which is a bit fucking useless really.

But before I do that, I’m quite pleased with this one that I knocked up at lunch, a tool that will automatically fetch and post my weekly last.fm track charts whenever they publish a new set for me (which should be Sunday evenings some time, I think).

I do, incidentally, realise that things like the calendar, and the music charts are of no interest to anyone but me, but part of the point of the site is to serve as an second memory for me (since my built-in one is increasingly dying on its cognitive arse), as well as being an aggregator for my web presences.

In other news, I am delighted to discover a better del.icio.us plugin for firefox than the one they released themselves. It doesn’t have the handy toolbar buttons, but it does, crucially, allow you to manage multiple accounts, meaning I can finally stop polluting my workblog with non-tech/media links, and bung them into a linklog that is expressly about “shit Alasdair finds interesting”, which would also cover y’know, shit like current events, food and drink, photography, comics, gaming, and just general stuff.

More design nonsense

If anyone should happy to be feeling bored and creative, I could really do with tiny (20×20 pixels) icons to represent http://www.alasdair.biz and http://www.black-ink.org. And something in the same dimensions that says “Calendar”.

Usual beer and undying gratitude offered.

Logo-tastic

If anyone out there is a designer/generally handy with photoshop, and wants to do me a favour (and earn themselves a pint), then if you wanted to pick one of these logos (the ones with white backgrounds, for preference) and adapt it so that it looks more or less the same, but with the name of the company replaced with my name, I’d be hugely grateful.

(I’m looking for something in the 350 wide by 90 pixels high area, if possible.)

This week, I have:

Written a couple of bastard clever AJAX based tools. This is incomprehensible to most of you, I’m sure, but basically, they’re quite tricky, and prior to this week, I had done almost sod-all AJAX related stuff, so what it basically means is that I am a god-like genius, and you should all be Very Bastard Impressed, OK?

In my spare time, I have put together http://ala.sda.ir, which is basically a one-stop shop for all the various places I produce writing, photos, and general stuff. I’ve got a few bits and pieces left to do on it – I want to more clearly mark the origins of the different posts, and while it goes and fetches all the content itself, at the moment it only does so when I tell it to, rather than, say, automatically checking every few hours. I’ve got a couple of hoops to jump through to make it do that, but that’s fine.

I’ve also found time to finally sort myself out with some decent time planning stuff. If you should be moved by insatiable curiosity about what I’m doing on a given day, you can get out http://ala.sda.ir/cal which will list those of my movements as I’m willing to share with the world. (Before anyone asks: on those Wednesdays where they or I aren’t busy, I visit my folks.) If anyone knows of a PC app that will allow me to convert from iCal (which it uses) to vCal (which my PDA uses) format, then I will buy you a pint if I wind up using it. I also need to write a tool to pick up the week’s diary every Monday, and dump it out, probably both to LJ and to ala.sda.ir.

I’ve registered http://www.dead-air.org, which I intend to wire into half a dozen blogs and news sources, as a sort of personal info-feed.

I’ve also been to the gym once (would have been twice, but I had the plague), read three books, picked up two levels in World of Warcraft, and tonight, I’m off to see what promises to be a storming gig, followed by a packed weekend.

Can you tell that I’m feeling more like myself than I have in six months?

[Work] PHP/MS-SQL c onnect problem

Here’s one for the PHP webnerds out there:

PHP/SQL7. At the start of every script, I include db.php which contains this:

$db = mssql_connect(‘devbox’,’foo’,’bar’);
mssql_select_db(‘[devsitedb]’, $db) or die (“Couldn’t open database connection”);

And then I pass that connection into the various classes and functions on the site. Fine and dandy.

However, in the course of one fo the scripts for this site, I need to hook into a second database temporarily, so I do this at the appropriate point:

$second_db = mssql_connect(‘devbox’,’jim’,’bob’);
mssql_select_db(‘[anothersitedb]’, $second_db) or die (“Couldn’t open second database connection”);

Then do what I need to with that connection and close it with mssql_close($second_db);

Here’s the problem, though: despite the fact that the two connections are clearly different, the second one is overwriting the first, so that when I come back to doing things with the first connection, it now can’t find any of the stored procedures i needs. This is true at any point after $second_db is opened, and it make no difference whether or not I close $second_db. The conenction is just being over-written.

At the point of opening, print_r($db) returns “Resource id #2”. And that holds true for the second connection as well – print_r($second_db) also returns “Resource id #2”.

mssql.max_links is set to -1, so there should be no problem with the number of connections that I’m making…

Obviously, I would like it if this didn’t happen, and $second_db become “Resource id #3”, thus allowing me to juggle the two connections as I need to.

Anyone out there had similar problems, or able to spot what I’m missing?

Really quite fed up of this.

Just as I recovered from the weekend, I came down with a cold, but obviously, I haven’t done anything sensible like stay home. It is now almost week since I last went to the gym, and since at the moment, a brisk walk puts my heart rate through the roof and leaves me sweating in that unpleasantly diseased and clammy way, I don’t think I’ll be going tonight, either. I forsee sleeping in my future. It’s what I hate most about being unwell. All the pointless sleeping.

I’m idly wondering about paying for myself to go to ETech and SXSW Interative next year, because I’ve given up all hope of ever having a job that will pay for me to go to them, and I really want to go. Don’t suppose anyone else has got a job that would pay for me to go, if I sorted out flights and accomadation myself?

And on the geek project front, I’ve finally noticed Upcoming.org, which neatly spikes my big plan for the winter, by having got there first, and got almost everything right. I see that hirez has beaten me there, but is anyone else using it yet?

Now, more of that annoying sleeping I was talking about…

Digitalia.

Further to yesterday’s question, and the comments: You can now get an LJ feed of my workblog at als_workblog (I’m feeling original tonight…), and I’m going to start enabling commenting on selected entries. The basic linkbloggery that makes up about 50% of the thing is not for commenting on, but if I think there’s something worthing thinking a bit more about, then I’ll leave comments on.

Idle curiosity

How many of you, if any, read my workblog? How many of you would if someone bothered to syndicate it on LJ? This isn’t an ego thing (well, OK, maybe a little) it’s just that I started it because I didn’t want to clog people’s friends lists with dull techy/photography blogging, and I’m slowly becoming aware that a thing I more or less started as a memory dump for myself (because I thought it wouldn’t be of interest to anyone else) is picking up an audience, and I’m just curious to see if it has much, if anything, in common with my LJ friends list.