Day to day ramblings of a web developer, with rants and raves about work, music, fatherhood, and life in general, with a liberal smattering of japes and jokes....
Friday, September 17, 2010
DJ Fresh - Gold Dust OFFICIAL VIDEO (Out NOW)
Monday, August 16, 2010
Lost Generation
Saturday, August 14, 2010
Tuesday, July 20, 2010
Quick Tip – Optimizing DOM Traversal » Learning jQuery - Tips, Techniques, Tutorials
The topic of optimization has come up a number of times in the jQuery mailing list. jQuery’s DOM traversal is powerful and easy, but it can sometimes be slow as well. As with any JavaScript library or framework, the helper methods will be slower than the plain old JavaScript (p.o.j) methods. Nevertheless, if we keep in mind the jQuery’s speed hierarchy, the speed difference between jQuery and p.o.j. will often be negligible.
The “speed hierarchy” goes like this, in order of fastest to slowest:
- ID : $(‘#some-id’)
- Element : $(‘div’)
- Class : $(‘.some-class’)
jQuery uses JavaScript’s native
getElementById()to find an ID in the document. It’s fast — probably the single fastest way to find something in the DOM — because it’s only looking for a single unique thing, and it’ll stop looking once it has found it. So, if we have<h2 id="title">This is my title</h2>, we would use$('#title'), not$('h2#title')to access it.To find a bare class name, as in #3 above, jQuery goes through every element in the entire DOM. To find an element, on the other hand, it uses
getElementsByTagName(), thereby limiting the number of elements it has to traverse right from the start. Therefore, if we know which element the class is tied to, we can speed up the traversal significantly by referring to it, using, for example,$('div.some-class')rather than$('.some-class').Likewise, we can help jQuery gather our classes faster if we can limit where jQuery looks to a particular ID:
$('#sidebar .menu'), not$('.menu').I’m sure there other ways to make DOM traversal speedier, so if anyone knows any other tricks, I’d love to see them in the comments. Also, I should probably reiterate that if speed is all you care about, no library/framework is going to beat p.o.j.
Update: Motivated by enej’s comment, I put together a little speed-test page where you can try out a number of different DOM queries and see how fast they are. Since I posted a link to the page on the jQuery mailing list, there has been quite a bit of activity in this area. Aaron Heimlich extended the speed test to work in conjunction with Firebug for some awesome reporting, and rumor has it that Yehuda Katz is working on an entire speed-test suite.
Update
Please be aware that these optimizations are not necessarily helpful as of jQuery 1.3 because of the new “Sizzle” selector engine.
A handy tip for those who are interested in speeding up their jQuery code. It may seem obvious, but I've had a conversation about this in the last couple of days, so thought it would be handy to post!
An open letter to Harvester Restaurants
To Whom It May Concern.
I visited your Harvester in Fareham last night as a family gathering to celebrate my girlfriend's birthday, and frankly, it was probably the worst meal of my life, after a catalogue of issues from the moment we arrived. I shall list each point for you so you can see just how badly your Fareham branch is run.1) When we arrived, we were greeted by a barman who was surly at best. There was no "good evening, what can I get you", and when I want to pay by card, he just said "I havent got a card reader" in a merable surly fashion, and walked off, then returned and just held the reader out for me to use. Maybe, as a front of house member of staff, he should be a little more polite and maybe even try to engage customers as they arrive.2) When we got to our table, despite the staff seeing we had two children with us, we had to wait nearly over 10 minutes for a child's menu3) When I went to the salad bar, there were no white rolls, no potatoe salad left, no pasta salad left, and the coleslaw was made with lettuce!! The lettuce all looked dry and tired, the peppers looked slimy and frankly, I was unwilling to eat any of it. 4) When our order eventually arrived, the waitress didnt clear away all the used salad bowls and side plates, which we had stacked at the end of the table when we finished them.5) None of the plates of food had any sort of garnish, just a plate of tired, brown looking food. My chips were cold, and the extra prawns my girlfirend ordered to accompany her fillet steak looked revolting, pale and dry, and to add insult to injury they were cold. I asked the waitress to get me some hot chips and sent the prawns back too, but when she returned, the prawns still looked inedble and my chips were still not hot!6) Not wanting to spoil my girlfriends meal, I decided not to cause a scene or complain until the end of the meal, but when the waitress returned with our drinks order, she then spilt a drink on my meal, and then laughed!!! Maybe if the bowls from the salads had been cleared, she would have had room to put the drinks down safely. At this point, I had to go outside and have a cigarette as I was so angry at the complete ineptitude of your entire operation and how it was spoiling my girlfriends evening out.7) At this point I complained to one of the waiting staff, who said she had told the manager about the situation, and the managers response to her was "Leave them til they have finished their meal". Surely, a better approach would be to come over and see if she could help sort things out and ensure our evening wasnt completely ruined. No such luck.8) Finally, when the manager did eventually come over and speak with us, she just said "I understand you havent had a very good meal". I then outlined the catalog of failure to here, and she didnt even say sorry. She just said ok, we will only charge for the drinks. Then she left us. She didnt return to the table, but instead left a waitress to deal with us. As a "manager" maybe she should have made a bit more effort, but frankly, after everything else I witnessed last night, I'm not really that surprised.9) The final insult came when my girlfriend visited the toilet before leaving, which was dirty, and had no toliet paper!So. Thanks for a FANTASTIC evening. It was definately a "A Night to Remember". I will NEVER step foot in one of your establishments ever again, and I will make it a point to make sure that anyone I know does'nt have to go through the same experience.Your service is appalling. Your food is disgusting. Your standards are so low I'm not even sure you have any. Unimpressed.Sunday, June 06, 2010
A Geeky Guitarist Post...
Well, I've just had a week off work, the majority of which was spent sat in the sunshine playing my guitar - A refreshing change from sitting in front of my laptop for hours on end! Anyway, since picking my guitar back up a couple of months ago, I've discovered some web sites and iPhone apps that are really useful to all guitarists, of any skill level, and I thought I'd take time out to share them...
Useful Sites
I've found it really helpful to sit down in front of my PC with my guitar and learn from online tabs and video lessons, so here's my list of some of the best guitar sites...
- Ultimate Guitar - I suspect most guitarists already know this one, so forgive me for stating the obvious, but this site definately needs mentioning. Great content, including reviews of guitars, hardware, bands and more, a huge repository of song tabs and chords, interviews, lessons and much more. This should be your first stop!
- Free Guitar Videos - I really like this site. A huge amount of video based lessons in all styles, with well produced videos. A good one to site in front of your PC with your guitar and actually have "virtual lessons". This is a site that has really helped me get back up to speed since picking my guitar up after not playing for a few years!
- JGuitar - Although it's design looks very dated, JGuitar has a few handy features, including a Chord Calculator that automatically determines every mathematically possible fingering for a chord based on the options you specify, handy for sussing out alternative fingerings, a Tab Mapper, that takes a tab URL and generates chord structures, and a Chord Search function. It's well worth exploring.
- Justin Guitar - If you want to learn how to play well known tracks, or you're interested in getting to grips with some music theory, Justin Sandercoe's site is brilliant. Justin Sandercoe is a London based guitarist, songwriter, performer, producer and educato, and his video lessons on YouTube have had over 60 million views! I've spent quiet a bit of time on this site, and my playing has definately improved! Even if you spend just 10 minutes on Justin Guitar, you will see how much much time, effort and enthusiasm Justin has spent on making his site a brilliant guitarists resource.
- Guitarists.net - Another site with great content, although the design and layout is a bit dated. It features quite a few good lessons, for beginners and also for more advanced players, covering music theory, scales, licks, tricks and more. There is also an interesting directory of music/guitar related software. Check it out!
- Chops from Hell - This is one for my colleague Tristan! A proper "RAWK" site with cheesy design, but this site has some lessons and videos for the "shredder" guitarist. Definately not for beginners, but worth checking out if you want to see some guys who can really play "metal" lead guitar. While I'm not really into some of the heavier rock music, I really admire people who can "shred".
- Guitar Player - Another really good resource, from the magazine Guitar Player. Lots of great content, including video lessons from some amazing musicians (Check out Joe Bonamassa's blues videos). This site has also has some interesting "non-lesson" articles - Have a read of "
- Guitar Player World - This site has a few good lessons, covering beginners and some more advanced stuff, along with articles and lessons about playing different styles. A lot of the lessons are more text/theory based, rather than video or tabs, but still worth reading!
- YouTube - Although not a dedicated guitarist's site, there are literally thousands of video guitar lessons available on YouTube. Some are definately better than others, but a few users worth checking out include RockOnGoodPeople, BerkleeMusic, GuitarJamzDotCom and LickLibrary
- ChordBook - This one's a bit different, as it is Flash based, with an interactive section allows you to choose guitar type (electric or acoustic) and find any chord and hear them played on the virtual guitar. You can also create your own chords and save them for later use. Chord book also has a Flash based interactive Scales tool to help you learn your scales!
iPhone Apps
As well as using my PC to improve my guitar skill, I've also discovered "there's an app for that" when it comes to the iPhone too! Here's the list of guitar related apps I have on my iPhone...
- Guitar Toolkit - This is one of my favourites. A really well put together app, with a tuner for most popular tunings and suitable for 6 and 12 string guitars, bass, banjo, mandolin and ukelele, a metronome, complete with tap pad to set your own timing, and chord and scale libraries. A must buy, and a definate bargain at £5.99.
- Ultimate Guitar Tabs - Another app that I have used almost daily since getting back into guitar. It uses Ultimate Guitar's huge database of tabs and chords, allowingyou to search for any song you want to learn to play, with both tabs and chords. Most songs have multiple versions, rated by other users so you can easily see which is the best or most accurate version to learn. This one would be good on the iPad, as tab and chords tend to need a decent screen area so you can read and play, but still handy on the iPhone.
- Guitar: Play and Share - This one is just amazing. there are quiet a few "iphoine guitar" apps, that allow you to "play" chords and scales, but to be honest, none of them work that well, as the iphone is'nt really anything like a guitar! Guitar: Play and Share gets around this by simply providing buttons for chords (over 1900 in the library, and you can define your own) , then you simply hit the strings you want to play. A simple, but ingenious solution, and it's a fantastic tool for creating your own progressions and songs, even without your guitar. If you ever find yourself having an idea, but you don't have a guitar to hand, this is a must have.
- Fretboard - FretBoard holds a collection of more than 140 instrument tunings in 15 instrument groups and a huge amount of music theory packed in a simple and intuitive interface guaranteeing fast access and easy understanding, and helps visualize chords and scales.
- ChordMaster - A very handy chord library, from D'Addario. With more than 7800 chords and variations, with the ability to strum and hear individual notes in each chord. Very handy indeed!
I'm sure there are more iPhone apps out there, but that's the list of apps I've installed and use regularly. I hope those of you who play guitar finds something handy, in the meantime, I'm off to sit in the garden and practice!
Saturday, May 15, 2010
Thursday, April 29, 2010
Its All Their Fault. Politics for the Facebook Generation
Watch the video, then visit the site. Idealist? Probably, but maybe this is the first general election in the UK where there is a real desire for change, and a means to influence it. The internet gives us all a voice and a way to educate ourselves about the issues, and to make informed decisions. Check it out.
An interesting DOCTYPE and JavaScript fix.
I've been working on a new project at work this week and found this interesting little bug. My JavaScript worked perfectly in a static page on my local server, but when it was moved into a dynamic template driven page, it failed, with a cryptic message in Firebug..
syntax error
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
Not much use for debugging huh? Especially considering identical code worked perfectly on the static box. It turns out, that if you have a script without an "src"attribute set correctly, or if you have an error in an external JSON feed, the DOCTYPE will fail.
So then, this tricky to find, but easy to fix error is fixed by making sure every script your page is being called correctly. In my scenario, it was due to an error in and external JSON file.
Hope it helps.
Monday, April 26, 2010
Why Some Men Have Dogs And Not Wives
2. Dogs don't notice if you call them by another dog's name.
3. Dogs like it if you leave a lot of things on the floor.
4. A dog's parents never visit.
5. Dogs agree that you have to raise your voice to get your point across.
6. You never have to wait for a dog; they're ready to go 24 hours a day.
7. Dogs find you amusing when you're drunk..
8. Dogs like to go hunting and fishing.
9. A dog will not wake you up at night to ask, "If I died, would you
get another dog?"
10. If a dog has babies, you can put an ad in the paper and give them away.
11. A dog will let you put a studded collar on it without calling you a pervert.
12. If a dog smells another dog on you, they don't get mad. They just
think it's interesting.
13. Dogs like to ride in the back of a pickup truck. And last, but certainly not least: 14. If a dog leaves, it won't take half of your stuff.
Posterous. First Impressions
I've noticed quite a few people using Posterous of late, so I thought I'd see what the buzz was about.It's a very cool idea. Post something once, by email, SMS or web, and publish to your Posterous homepage, Twitter feed, Flickr stream, Facebook profile etc.
So, here goes. My first posterous post. Overall, I'm impressed. Lot's of really nicely done interface design, with a bit of Prototype goodness thrown in. It was easy to setup an account, it's possible to be up and running almost instantly, but I opted to go through the signup process so I could customise my posts and setup publishing to Blogger etc. I'm hoping that now I have the means to post once and publish everywhere in one hit, I will be able to post more often, as I usually find myself too busy to sit and write long posts. Fingers crossed, you may even see proper regular posts.
My one gripe? It's a biggie I'm afraid.
Posterous allows you to import from your other blogs. I thought this would be a great idea, being able to put everything in once place so I have some historic content from the off, but in practice, it seems a bit flawed. As you can see, I have quite a few posts here already, but the import process has truncated them all! So, you can read the first paragraph, and that's it. Not even a link through to the original blog article. Arrrgh. For the time being, bear with me while I go back and manually add the missing content.
Other than that, very cool. I'm definately going to try to post regularly and see how it goes. Watch this space!
Saturday, April 10, 2010
Dan Bull - Dear Auntie [an open letter to the BBC]
http://www.youtube.com/watch?v=soGKRMb8p0U&feature=youtube_gdata
Genius. With a serious message.
Thursday, January 22, 2009
Long time no see
AS a starter for 10....
Has anyone seen the new Go-Kat ad? Go-Kat for Indoor Cats. - Should'nt that be Stay-Kat, or maybe Don't Go-Kat, or even Scaredy-Kat??
Just struck me as funny, thats all!
Friday, June 06, 2008
Sponsor Me!
So, with this in mind, I am going to be doing a midnight 12 mile walk as a fundraiser. So please, spare a couple of quid and five minutes of your time to sponsor me at
http://www.justgiving.com/markkennard
Thanks.
Thursday, June 05, 2008
Absolutely shocking (if you're a geek like me!)
I am a web developer/designer (did you notice the order there?) who has been working on the web for 12 years. In that time, I have tried my hardest to stay up on current trends, latest techniques and new ideas in the web development field. I started as a "web designer" back in 1996, and over the past decade have had to stay abreast of developments, constantly honing my existing skills and learning new ones. So, bearing this in mind here goes....
WHY IS MICROSOFT USING PISS-POOR HTML TECHNIQUES IN THEIR VISUAL STUDIO 2008 EXPRESS EDITION TRAINING VIDEOS??????????
Do I seem a littled hot under the collar? That's because I am.
I work for a well known recruitment website, who are currently migrating their 'nix based web site and database etc across to ASP.NET - no, wait, thats not the punchline..., and as a result, my collegues and I on the design team are on a learning curve. Now, it's not too bad for me personally as I am a bit of an oddball on the team, in as much as I'm reasonably capable with non-design stuff, like Javascript, Ajax, XML, ASP, VB, SQL database coding (yes, yes, I know, Microsoft technologies), Actionscript etc, I'm a sort of designer programmer if you like, but most of the design team are DESIGNERS!
The whisper around the office is that the "recommended" web design/development software will be one of the following.
- Microsoft Expression Web - WHAT????? Has anyone actually used this out of choice? Our team have been working with Homesite (oldskool), and the old favorite Dreamweaver (we're on CS3 now), with a couple of us using alternative tools of choice, split between the Mac chaps using Coda, and myself using the awesome Aptana Studio (more on that another time....). I've installed an evaluation copy of Expression Web. All I can say is it looks and feels remarkably like F***tpage. Need I say more? and yes, I've read the rave reviews. I just think they are wrong. Dreamweaver killer, my arse.
- Microsoft Visual Web Developer 2008 - Hmm. Top tool for the hardcore coders, but let's be honest, it's not the most inspiring tool for creating top notch sites now, is it?
So, I have been scooting around the net when I find a spare moment,
looking out for useful tutorials and resources relating to how the
ASP.NET migration will affect us and any changes that may be ahead.
Naturally, the first place you'd think of looking would be the vendors
documentation and resources right? WRONG.
In the interests of being able to put forward an informed opinion on the matter, I spent a bit of time checking out Visual Web Developer 2008 this evening, specifically, watching some of the video training that Microsoft are providing on their site.
Please, if you are a web designer/developer/standards/accesibility nut, watch this video, and spot the mistakes. I actually sat laughing as I watched. Shocking.
For those of you that are'nt total geeks, I'll explain....
Microsoft, at first, weren't particularly interested in the internet, then, they realised how big it would be and decided to jump on board. In the early days, they did'nt rule the online world as much as they do now, but over time, and several anti-trust cases, they now have a huge share of the world's web browser market. During the mid - late 90's we had the "browser wars" where it was sometimes easier to write 2 versions of your code to be sure all your site visitors could have the same experience. Fun times.
These days, things are getting better. It's still challenging to create a web site or web application that works across the broadest possible range of users, but today, we have more and more standards. XHTML and CSS are the norm, and sites are becoming more accesible, and useful by the day. Even Microsoft are flying the standards flag. No really...check this out, from the Expression Web product overview...
"Build dynamic, interactive pages that harness the power of the Web to
deliver superior quality. Built-in support for today's modern Web
standards makes it easy to optimize your sites for accessibility and
cross-browser compatibility."
So, imagine my amusement, when I am watching the very first video in a series aimed at new ASP.NET developers, admittedly maybe hobbyists or students, but new developers all the same, and I am told to add a totally non-standard font to the project page (this should be CSS) and then a bit later, am shown how to use an HTML table for layout purposes (again, this should be CSS based).....
Microsoft. Come on. It's 2008. You are pushing a very clever technology. So why, why , why are you insisting on oldskool 1990's HTML? If thats what you're recommending or endorsing, regardless of your new enthusiasm for standards, I am REALLY looking forward to the laugh I'm going to have when we start looking at the HTML your ASP.NET controls spit out.....
Jokers.
Tuesday, May 06, 2008
Progressive Enhancement - Graceful Degradation on steriods
As a designer/developer moving away from Flash to more standards compliant methods and technologies, I was interested to read about how it's possible to meet the needs of all scenarios, including text based browsers, screen readers, non-javascript users, and Flash enabled users. If you have any interest in contemporary web design and reaching the maximum number of users, this is a top-notch article.
Developing Flash websites using progressive enhancement
Sunday, May 04, 2008
Potential clouds for Flash and Silverlight
Today however, I am not so sure. As open source and standards complaince have gained momentum, so too has the ability to build rich interactivity into a web site or web application without the use of third-party add-ons or plug-ins.
As I mentioned in my previous post, I have been "out of circulation" from all things web for some time, and since my return to the fray, I have noticed just how far the web has come.
With technologies such as AJAX, JavaScript and CSS increasingly maturing, so the need for third-party technologies decrease. As a simple example, Flash used to be the only way to ensure your website could load external content on-the-fly and be sure it would work. Now, with AJAX, XML, JavaScript, and a little careful thought and planning you can combine content from any number of sources, natively, in the browser.
With this all in mind, I read an interesting article this evening on ZDnet about the possibility that Adobe (the company behind Flash, for those of you non-techie readers), and Microsoft (Silverlight) could potentially "have an agenda" (after all, as global companies, they ARE in it for the money) and that as developers we should not rely on theiier technology.
Maybe it's time to seriously consider the viability of using proprietory tools...click here to read the article and decide for yourself. I'd be interested to hear your thoughts...