php for the soul, plus other stuff

Well, here we go. I came up with a “new” website concept on Saturday night so, you guessed it, my assignment got forgotten and I did an all-nighter. Long story short, it’s pretty much all finished, just doing touch-ups to it now. I’ll leave descriptions etc til it’s online, which is hopefully in next few days. Main issue is finding an available domain name!! I have finally gained an appreciation of the hatred felt for domain squatters. That, and how frustrating it is to attempt to name a blog….

Back to the other day, when I decided I better get it together and become another WordPress blogger, it was unbelievable how many 14 yr-old girls had decided to start blogs in 2004/2005 and made the first post then never again!! Seriously! And, before you say I was choosing dumb names (ie that 14 yr-old girls would choose), I will refer you to possible options:

  • myblog – 12 yr-old girl, couldn’t even post, only made comments to the default posts and pages (Sept 23, 2005)
  • qwerty – I take the “14 yr-old girls” bit back, nothing doing here (Nov 2, 2005)
  • ifelse – no idea who, China (end of 2005)
  • rofl – one hit wonder (Oct 23, 2005)
  • over9000 – Eastern European, the most used one so far (31 Aug – 27 Sept 2007)

I’ll stop there before I have a heart attack (check this out if you want one too!!). Anyway, moving on, I found a name (and not a bad one, may I say) and here it is.

In other news….my  RSS feed for this blog is up and rolling (Wahoo!), and I have got a whole lot of stuff done with php. So, here’s a lovely tid-bit as promised:

I’ve just been using
to get the ip of my site visitor. This is correct, but a bit of geeking the ‘net today led to this bit of work by scriptgoddess, and then built out a bit:
function getAddress() {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
else {
return $ip;

As a quick run down, if it doesn’t come absolutely clearly to you, we first check for $_SERVER['HTTP_CLIENT_IP'] (shared internet), and allocate that that as the address. If this isn’t available, we then move to $_SERVER['HTTP_X_FORWARDED_FOR'] (the ip a proxy was forwarding on behalf of), if required; otherwise we default to $_SERVER['REMOTE_ADDR']. This provides us with the most precise “real” ip address for the user visiting our site. The main hurdle we have overcome now is the inability to accurately map geo-demographics visiting your site. Purely using $ip=$_SERVER['REMOTE_ADDR'] will result in some ISPs and proxies claiming stupid volumes of traffic, while not allowing you to accurately target your content (and advertising!!).

I have to say I’m getting over the layout of my code in this theme (I just changed it twice), so I’m going to give up on posting code for now, and finish my web work. One of tomorrow’s tasks is now to find a new theme I like that supports displaying code in a useful manner.


not quite study related

Well today involved quite a bit of fiddling with mySQL, jdbc, and other fun database and java related goodies – not at all exciting, so I won’t go into more detail. You’ll be glad to know that I did manage to find time to have a mini-break, and I discovered a few lovely morsels of goodness floating out there on the ‘net.

  1. diary of an app store reviewer – you have to laugh!! A tongue-in-cheek blog, but VERY clever.
  2. this prank on a wife went horibly wrong in a ways you wouldn’t imagine

Also, a few vids I rolled past. They’re kind of predictable, but funny none-the-less for the amazing stupidity of some people.

Although, I have to say Britain for the win!! “How many colors on a four colored piece of paper?”

Anyway, not the most exciting of days, I have had a bit of a fiddle with some ideas in PHP, so I’ll post about them in the next day or so, once I have a result to show.

quick update – is microsoft doing something “decent” ???

Just a quick post, I’ll do a real one later today, but I wanted to note some potentially fantastic news.

Microsoft has just announced they will be allowing end users to downgrade from Windows 7 Professional or Ultimate editions to either Windows Vista Business or Window XP Professional, and also allowing OEMs to release products with XP Professional, XP Pro Tablet, or XP Pro X64 installed, instead of Windows Vista Business or Ultimate. There’s a WHOLE shebang of legal stuff, and who knows what might be “re-interpreted” between now and actuality. There’s also the time-limit that:

Microsoft OEMs will be allowed to provide such Windows Vista downgrades until six months after Windows 7 General Availability (GA).

which is only a month or two away, so really this only lasts til the end of 2009 but, end of the day, this is a step in the correct direction. The cynic in me feels, however, that this is just a move to either avoid some anti-trust / anti-competitive type liability issues, or to attempt to PR schmooze the public, or both. And, it comes only days after the release of Vista SP2, which implies a not so great or happy uptake of the same?? Time will tell. 

source: techarp

twittering, blogging, and procrastinating

Well, today I sorted out my twitter account – style, colors etc – and started following some people. I resisted the urge to follow ICHCheezburger, MC Hammer, Ashton Kutcher, and Tony Hawk; although John Mayer was an easy pass. I’ve made the somewhat lucid decision to limit my twitterati (is that a word – well, it should be!) to people I actually communicate with and care what they are doing. I am now on “following” terms with engadget. You can already see the MySpace/facebook-esque groupie thing getting well hammered on twitter. Other than the well publicised race between Oprah, Ashton et al to be the first to have a million followers on twitter, it’s a bit ridiculous to see the 1.6 million and counting people who actually believe that Britney Spears is following them in return and actually tracks their twitters.

In the real world, I found a couple of neat css tricks, and re-learnt my command-line Java; as well as consolidating some of my php scripts for dynamic geo-location components for pages. They were a bit of a mish-mash, having been done as I taught myself, and it’s amazing how cleaned up I could get them in relatively little time.

I think tomorrow’s post will be something like “css for the soul” or similar, and basically be a spewing forth of my latest tid-bits of knowledge and cunning tricks and hacks. Not that I’ve come up with much myself recently, it’s more been a pulling together and pooling of the genius available on the web and through Google. Although, I’ve now been tapping into Wolfram|Alpha as well – it’s starting to get a bit of flack, but I think that’s cause it’s in a newbie phase. The whole intent is that it is to be a humanistic learning-engine, so everytime we search it the answers get better….anyway, it can’t do any worse than Cuil has done….I did just go check, and Cuil is still alive, we just hear nothing from it these days.

just some sites doing some fun stuff

These are some great sites around the web which will keep you amused when you need a 30 second break from clients, management, or anything really:

  • notalwaysright – tales from dealing with customers
  • fmylife – some people need to tell the world how badly they stuffed up
  • textsfromlastnight – stories from the morning after the night before

After another night at work, these are the bookmarks which start to get me vaguely sane again. They’re all nice short’n’sharp punchlines, which mean you don’t get distracted all day.

I’m wondering how the rumours about the “new” iPhone are going to develop over the next weeks. I have my suspicions that Apple’s going to do their usual and ride the rumour train, before doing nothing. Then, once the disappointment’s settled, pull out something and WOW! the world. Either that, or Apple’s other trick of not doing much but making us consumers feel like we didn’t want anything more….I’m not knocking Apple, far from it, I appreciate the brilliance of a machine that can define a culture and do so in such a manner that we beg to be led further.

I still have yet to get my first Mac (I do have an iPod), so I feel allowed to approve aspects of Apple’s philosophy without falling into “fanboi” territory. I’m sure I can talk about this more another post, so I’ll leave it here.

My biggest rave at the moment has to be for the whole Wordpress thing. I only looked at it for the first time earlier today, when I decided to play with it on one of my virtual servers….”bloody marvellous” I said after about 5 minutes, then I set about getting it all together and starting my own. Here it is, and I hope it doesn’t fall apart in 3 days like half of these blogs seem to. I have started building other pages for the blog too, but they’re still works in progress, so no public touchy till I’m satisfied!! I’m still surfing through the themes available to me, and trying to find that balance between the look I want and the functionality and display characteristics I desire – have no fear, I will prevail.

Anyway, peace out for tonight, and I’ll be back with more brilliance tomorrow.

Opening Post….

Hello World!

Gotta start with that to be true to my CS leanings. This is my freshly started blog to chronicle my “exciting” life, but mainly to give me a forum to share stuff with the world. You know, cool sites I’ve found, neat code snippets I find or make, random tech or other news, basically anything that tickles my fancy.