Northern Geekender

Peter J Lambert of Pixelicious fame has had a great idea. At least the best idea I heard today. Pretty short notice but if anyone fancies a trip down (or up?) to York for something of a geek get together let me know.

I can’t say I’m definately going as I just found out but decided to spread the word anyway – and with any luck will definately try and make the trip. I had been feeling (and I think I even complained once) about the lack of a sense of Northerness (not that southerners, or Scots for that matter, aren’t nice people or anything but…) amongst web design. Real Ale, Grit, Coal, that sort of thing – you just dont see that much web design that looks like it was inspired by that.

Anyway, the 15th (Saturday) looks to be the date of choice. Head over to pixelicious.co.uk to express an interest or complain or find out more information.

If anyone from around Newcastle does fancy it let me know as well – I’d probably be even more inclined to go and meet strangers if other strangers (or Chris) who live and work near me where going.

Another great looking magazine

After complains of the lack of a decent magazine, and after the passing and resurection of Design in Flight another one raised it’s head. Yeh. Have a look at treehouse.

Another great, low cost ($15), well designed publication that you can print out and read in the moments away from the computer.

OK, so I haven’t read that much yet but what I have was both interesting, informative and hey, pretty well edited.

Thumbs up to any and all involved.

Are kids being taught web standards? II

Disclaimer: I went to uni but not to study anything even remotely to do with the web. I basically make everything up as I go along. Bear that in mind when reading my commentry.

Phil (xlab.co.uk) just made an observation regarding webstandards and education that I thought particularly interesting. Are kids being taught web standards?

Based on my experience, limited as it may be, I’d have to vote no. I’d maybe even go further – are kids (sorry to any young readers, I’m just going with the flow) being taught web design?

Web design, at least to my mind, involves a wide range of disciplines – Human Computer Interaction, Information design and theory, Graphic design, Application design and development and so on and so forth. Without a general appreciation of all of these you are not, again to my thinking, a web designer. That isn’t to say you aren’t a fantastic Graphic Designer or what not, but a web designer is simply a broader disciple.

Back to education. And teaching. Now to teach such a rapidly changing medium? A course, I would imagine, needs planning over three years. The problem their is that in web design and development three years is an awful long time in terms of best practice and up to date thinking. I want to work with people who know AJAX, real world CSS, semantic thinking XHTML and unobtrusive Javascript. That sort of course simply could not have been written 4 years ago. And writing it now will leave it dramatically out of date in 4 years time – when all we’ll be wanting is more Python Programmers (or something)

In a sort of unlikely to get picked up on sticking neck out statement, I’d say I’d love to help out. I see the only option is getting the local web industry involved in education. Seminars, chats, meet-ups, anything that get’s those in education nearer to the reality (yes – you do have to consider users other than your mates, tutors and design magazines) the better.

Anyone else out their think the same? Willing to get involved? Maybe the time is now?

Leave a comment here or on phil’s post or post something on your site and lets discuss the issue. Does anyone else feel strongly about this? Even as someone not involved in the recruitment side of things directly at the moment I still want to work with the best – and in my mind so should everyone else.

Mailing lists and Me

Ok. I just came to a realisation. I think somewhere along the line I got addicted. First I tried one. It seemed pretty good. Not really having any effect on my and generally just being good to feel part of something.

But I couldn’t stop at one. I thought I could handle more and more. So I went in for some of the hard stuff. And lots of it.

And look at me now. Typing this while waiting for more email that is reasonable for a small company in a week to download because I didn’t check my email for a day or so. Time for rehab I think.

I dont want to chuck the habit completely, just pair back my addiction, get some control. So who stays and who goes?

DiH (designersinhouse.com) is certainly leading at the moment as a keeper. It’s proved useful, interesting and informative so far – plus I met Matt at @media.

I think maybe their’s room for one more. CSS-d, WSG, thelist, webdesign-L your time is coming.

Photos and Flickr

I’ve been a (distant) admirer of flickr since I had a brief play a while back. Nice interface, good idea and all that. Well I finally got round to setting up a proper account.

I’d recently got myself a reasonable digital camera. Nothing expensive or fancy – in the past whenever I’ve thought about taking photo’s I’ve always got bored and given up. This time is going to be different. Hopefully.

I’ve only really got round to one proper shoot and in non ideal conditions (well, in terms of photography – basically in a room under a pub) but I’m pretty happy with a couple of the photo’s. But maybe that’s because I like somewhat abstract orange/red shots?

Anyway, hopefully I’ll get round to taking and uploading some more shots. And maybe using some of them on this site.

A Typo? On this site?

Well, their are no doubt lots of typo’s on this site but I’m referring to the Ruby on Rails blogging application Typo (currently version 2.5.5)

So far I have to say it’s quite nice. I’m only playing at the moment – the site you are currently reading (for those of you actually on the site, and not reading the feed) is a product of my PHP skills. Some of it I like (ie. the bits I wanted to write), others I’m not too sure about and well, it doesn’t do anything I cant be bothered to write. Which up until not hasn’t been a problem. But I’d still quite like live searching, categories and tags and all that malarkey.

Browsing the usual supect sites the choice between using a bespoke system and an existing solution seems fairly split. John Hicks is always raving about TextPattern and saying nice things. You see lots of MovableType fans and WordPress fans but non to be fair I never really liked them. Maybe that was just me?

It might be that all, especially WordPress and MovableType are pretty mature solutions and that I like something to hack on? So a custom self built solution seems the way to go? Or does it? With everything providing very similar featuresets – and differing only in a few important areas building something bespoke means 95% redesigning and rebuilding the wheel and maybe 5% innovation. Which is cool as a learning experience but I’m now in more of a get stuff done mood of late.

I haven’t decided as yet one way or the other but Typo might just be the anwser. Small enough to hack, an excuse to learn Rails and featureful to boot.

Nice URLs and PHP

I all one for nice url’s, that is removing all the gumf involving question marks and ampersands and the like for something that is both shorter, more human readable and more search engine friendly.

Doing it in PHP is actually pretty straightforward once you get the hang of it and can be pretty powerful – so here goes with a short tutorial of sorts. It’s will probably be brief and make too many assumptions of the reader – any questions just let me know and I may even try and write it up properly.

The basic principle is to stop using the GET array (accessible from $\_SERVER\[‘GET’\]) to make descisions with. The question then becomes what to replace it with. A simple class borrowed from the Sitepoint PHP Anthology book written by Harry Fuecks is at least my answer. The PathVars class does pretty much what is says in the name, specifically providing access to the path contents in the form of an array. I’ll provide a link to a code archive for this article rather than just copy and paste whole classes – download it now if you are interested in the behind the scenes bits.

So we now create a new PathVars instance like so:

/* Pathvars object */ $pathvars = new PathVars($_SERVER['SCRIPT_NAME']);

And we can now magically get access to each element of the path (separated by a /) from the instance variable pathvars:

$params = $pathvars->pathVars;

Or more correctly by using the method provided:

$pathvars->fetchByIndex(0)

Where the fetchByIndex parameter is the element you want from the array.

Ok, so so far I’m really just repeating the work of others, if you like this sort of thing I’d really recommend the book. The next step on top of this is however is to decide what to do with the information when you have it. The following shows a very simple example – potentially for use in a simple blog or news site:

switch ($pathvars->fetchByIndex(0)) { case "article": include(views/article.view.php); case "page": include(views/page.view.php); default: include('views/home.view.php'); }

In this example where we have www.example.com/article or www.example.com/article/a\_sample\_article\_name the article view include file is used.

What these include files then do is up to you, in my case each of them passes different parameters to a simple templating system which then outputs the page. Again, have a look at the code samples to see that in action.

Let me know if anyone found this interesting, useful or informative and I might post other titbits, otherwise it’s probably back to inane ramblings and misplaced conjecture.

the greatness of online tutorials

A somewhat grandiouse title but hey, dont you just love it when things just work? A slow evening lead to following two tutorials at once, the outcome I now have andy budd’s fab iTunes playlists set up and I have rails running on my host. Woo Hoo.

I love working things out and generally dont mind things ending up not working even but sometimes it’s nice when everything takes only a small amount of time and effort and then works. A sense of acomplishment, and admiration, if you will.

Oh, proof of the rails pudding: morethanseven.net:3000/ WEBrick at the moment, FastCGI is for another day, hopefully soon. And before you ask, I didn’t just copy the source from a local install. Really.

The tutorial I followed for that I grabbed from xmlareas.com/ruby-rails-howto.html which might be of use on a range of reasonable shared hosting environments – though remember to remomve the temp directory as it will contain LOTS of files that may flag some hosting file limits.

Makes me want to write some sort of how to articles on some subject or other. Question on a post card is what?

So a big thanks for Andy’s rather geeky approach to cataloging music (my librarian housemate is going to love that) and to goldenratio (probably not a real name?) for the Rails article. Long live the Internet and all that.

The State of Newcastle

I’ve been a practicing web designer/developer/whatever in Newcastle for over three years now and about a year ago I set up a mailing list to try and act as a useful resource, shamelessly stealing from brightonnewmedia.org

So was born newcastlenewmedia.org.

The grand plan was to find other people like me with an interest. Anyone I could learn new bits from and hopefully the utopian dream of everyone getting something out of particupating in a community. It’s been, I guess, something of a partialy something. Traffic goes up and down depending on, well I dont really know. Hopefully it’s been useful on occasion.

One issue was I never really promoted it. So, with a little time on my hands rather than redesigning this site (again) I did a little work freshening up the website, adding a showcase of local designers personal sites in the process and the plan is to promote it a little. Hopefully get some more people on their and in particular some students from the local Uni’s – quite a few of which teach something along the lines of web design but approach it in wildly different ways – something I might write about next.

Anyway, I guess the main aim is to get a snap shot of the industry and in particularly the people who make up the industry, in and around the North East. Are their people in their bedrooms going crazy CSS zen Garden designs? Are their any DOM Scripting leviathans? British web designers seem to be the cream of the crop, or at least make up a decent percentage of the cream (why do Standards based design analogies always end up being cake related?), but where are the Northern designers, never mind the North East.

Anyone else think differently? Let me know. Send me sites of designers and developers in and around the North East and I’ll post them into the newcastlenewmedia.org site and we shall see.

unobtrusive javascript

Lots of talk around at the moment about unobtrusive javascript on the usual websites and discussion lists. However alot of people, maybe outside the inner circles, are still finding old school examples of inline code on out of date pages.

So here’s my tuppence. I guess the more websites that post new, up to date, examples and reasoning the better?

The premise is pretty simple. In the same way as controlling formating with tables and having everything being mixed up in one .htm file is frowned upon as simply being too much work – dealing with lots of inline snippets of javascript raises the same problems. Namely being time consuming to update and maintain.

The solution is to keep ALL your javascript in separate .js files, and that includes removing things like href="javascript:" or onclick=. The first question is therefor how – when I started looking down this route I found a simple answer hard to come by, having to look at more complex examples and reverse engineer them.

The following is the method I’m using at the moment. It may have issues I’m unaware – if your a javascript guru let me know. The examples are from the fluidflash page on this site, see it in action at www.morethanseven.net/fluidflash

We first I set up an initialisation function:

function init() { if (!document.getElementById) return false; liquid = document.getElementById("iNavLiquid"); liquid.onclick = liquidChangeClass; }

This sets the onclick event on the element with the id iNavLiquid that will trigger the function liquidChangeClass. Next we define that function:

function changeClass( targetId, newClass ) { if (document.getElementById){ target = document.getElementById( targetId ); target.className = newClass; } } function liquidChangeClass() { changeClass("iBody","liquid"); }

The specifics aren’t too important to this example but you can see the liquidChangeClass function which is triggered by the onclick event handler.

And finally we need to trigger the init function when the page loads. Their are lots of ways of doing this which is probably a conversation for another time – I used a schedule function from themaninblue.com which you can find below:

function schedule(objectID, functionCall, iteration) { if (iteration == null){ iteration = 0; } if (objectID == "window") { var oldonload = window.onload; if (typeof window.onload != "function") { window.onload = functionCall; } else { window.onload = function() { oldonload(); functionCall(); } } } else if (document.getElementById(objectID)) { functionCall(); } else if (iteration < 300) { setTimeout(function(){schedule(objectID, functionCall, iteration + 1)}, 10); } return true; } schedule("window", init);

So their we have it, hopefully a simple enough example of how to move to unobtrusive javascript. As most of this is generic and used all the time it’s far simpler that it first appears.