Archive for the 'Programming' Category

Supporting iPhone custom protocols

Friday, November 27th, 2009

The iPhone Safari browser supports several extra protocols to launch their corresponding apps:
Apple documentation on iPhone integration

  • sms ex. Text this ( <a href=”sms:5555555555″>Text this</a> ) For SMS texting
  • tel ex. Phone this ( <a href=”tel:5555555555″>Phone this</a> ) For regular phone calls
  • youtube ex. Singing Shiba ( <a href=”youtube:rnXQDMDobHc”>Singing Shiba</a> ) Starting youtube videos
  • itms ex. ZipCar App ( <a href=”itms://itunes.apple.com/ca/app/zipcar/id329384702?mt=8&uo=6″>Items</a> ) ZipCar App
  • maps ex. CN Tower ( <a href=”maps:301 Front Street West, Toronto, ON”>CN Tower</a> ) Launching maps with address marker

HTML 5 and Push technology

Friday, November 27th, 2009

The ability for a user to be on a site and have the web server cause an action to occur on the site, via ‘push technology‘, is soon to be realized at the HTML 5 leve. Although this type of interaction has always been available; through Flash, Java and Javascript. It’s finally being brought-up to the HTML level as noted in W3C documentation. The Stray Orange blog has a good post relating to HTML 5 push technology.

PHP XML ignore whitespace

Thursday, October 15th, 2009

$xml_data = preg_replace("/>\s+</", "><", $xml_data);

Removes all the whitespace, tabs and newlines between the nodes from an XML file. A lot of PHP XML parsers tend to parse the white space, which can cause errors. Adding the function before the PHP XML data handler executes will prevent those issues from arising.

Force YouTube to play HQ (high quality) or HD (high definition) link

Tuesday, July 28th, 2009

Add:&fmt=18 to the end of the YouTube video URL will play the video in HQ (high quality).
Add:&fmt=22 to the end of the YouTube video URL will play the video in HD (high definition).

Regular: http://www.youtube.com/watch?v=SVvx13dpTEA
High Quality: http://www.youtube.com/watch?v=SVvx13dpTEA&fmt=18
High Definition: http://www.youtube.com/watch?v=SVvx13dpTEA&fmt=22

If a video is not available in HQ or HD, then they will not be able to be shown in those formats.

HTML5 – A great progression in markup

Friday, July 10th, 2009

Hardly a buzz-word, more the “hail-mary” of markup language progression, HTML5 brings very important tags and standards to the web.
First and foremost, HTML5 solves the question from that last couple of years of what DOCTYPE to use with XHTML.

<!DOCTYPE html>

John Resig (creator of jQuery) has the best write-up on HTML5 link to John Resig site.

HTML5 also brings three new “Flash killer” tags (when I write “Flash killer” I intend that a lot of frivolous reasons people use flash for, will be replaced by these tags, not flash will be gone).

The <video> tag (YouTube demo) will eventually replace Flash Video, and hopefully SilverLight too, because it offers no reliance on Flash and better compatibility with mobile devices of the future. As in it is easier to detect a video format to play based on browser than to have a flash video player mobile device. Also, flash video does have some basic limitation and does sometimes hog more CPU than required to show a video. Especially if you can have a more core level video decompression happening on a machine. One issue that has been popping-up is the age old, what video codec to support. My two cents say, doesn’t really matter, browsers should try to support as many as they can and a clear winner will prevail, hopefully one that doesn’t exist yet. Van Kesteren has a good write-up on the issue, he is a bit biased though.

<audio> has less of a struggle, because MP3 is supreme and it would be great to see Soundmanager get an upgrade in using this new tag. This would replace the enormous amount of small flash mp3 players that are scattered about the web.

And <canvas> tag. I’ve seen this used in several new beta web apps and the best HTML5 canvas tag online demo to date. It’s pretty crazy what kind of stuff is already being made with this tag and javascript.