Click or scroll down Circle me on Google+ Fork me on GitHub Follow me on Twitter Ask me on Stack Overflow Gild me on Reddit Code Ninja, Entrepreneur, Idiot ChalkHQ — consulting, prototyping, mentoring HighF.in — resolve innefficiencies in your startup's workflow DearDrum.org — online open-mic / creative space The Dirac Equation (click to WikiPedia) A maxim Sun Tzu references in his magnum opus The Art of War

If you know the enemy and know yourself, you need not fear the result of a hundred battles.
If you know yourself but not the enemy, for every victory gained you will also suffer a defeat.
If you know neither the enemy nor yourself, you will succumb in every battle.
Fork me on GitHub

Tags

actionscript ad-hoc networks Adobe AIR anonymous Apple array Browsing convert Debugger Error Facebook file permissions Flash Flex fonts function future Google Google Plus grid hackers html javascript logs loop network p2p php privacy regexp Security Server social ssl technology terminal time Twitter upgrade Web 2.0 Web 3.0 Web 4.0 Web 5.0 wordpress

Featured Posts

  • Javascript: Undefined parameters
  • The Web, A Look Forward
  • Let Postfix send mail through your Gmail Account – Snow Leopard
  • Archives

  • April 2013
  • December 2011
  • July 2011
  • June 2011
  • March 2011
  • February 2011
  • January 2011
  • November 2010
  • October 2010
  • September 2010
  • July 2010
  • May 2010
  • Categories

  • Code
  • Design
  • Opinion
  • Security
  • Tools
  • Uncategorized
  • Latest Posts

    Why I Chose OGG Vorbis as the Audio Format on DearDrum.org

    This is from http://deardrum.org/about/html5

    What is HTML5 and why do I need it?

    To put it simply HTML is what websites are made of. HTML5 is just the newest version.

    DearDrum.org uses some pretty advanced stuff under the hood that's only available in HTML5. So in order to play audio on the site and do some other cool things you need a Web Browser that understands HTML5. (more on this below)

    Fortunately there are a few really amazing web browsers out there that do support HTML5 really well. And if you're not comfortable switching to a new browser there's probably a plugin for your browser to get you on board.

    Here are some quick links so you can get started, you only need one, but why not try them all if you have time. I'll go into a bit more detail and walk you through the issues below that if you're interested or confused by any of this.

    Links:

    Google Chrome is - in our professional opinion - the best web browser out there, hands down.
    Download Google Chrome

    Firefox is phenomenal too, and by far the most widely used browser that supports HTML5.
    Download Firefox

    Internet Explorer is, well, incompatible with everything. Google made a plugin called Chrome Frame which brings HTML5 to Internet Explorer. Despite some recent claims to the contrary IE9 will never support HTML5 by itself and requires Chrome Frame in all cases (more on this below).
    Download Google Chrome Frame for Internet Explorer

    Safari is in the same boat as Internet Explorer with regards to HTML5. They claim to support it but intentionally cripple its functionality. On a Mac you can install a plugin called XiphQT which will bring you up to speed. On Windows you'll need to switch to another browser to get proper HTML5 support.
    Download the XiphQT plugin for Mac

    Opera is a less known web browser that totally supports HTML5, and we love them for it.
    Download Opera

    So What is a Web Browser?

    Yeah yeah, I get it. Now What is HTML5? Really.

    You may have seen the code that makes up web pages. If you right click on this page you should see an option to view the source code of the page. That's HTML. Now the internet is an open place and as you can see there are lots of different browsers. So everyone kind of has to agree on the specifics of the HTML language. The specs for HTML5 aren't finalized yet but some of the more advanced browsers are already supporting most of HTML5 already. There is however a big argument going on surrounding HTML5 audio and video.

    At the end of the day HTML5 will have to be open, because the web needs to be open. Imagine if you had to pay $5000 a month to use Google, and that money wasn't even to pay Google, it went to some licence holder who owned use of the letter E... That would be terrible and there'd be no innovation on the web. There'd have been no Facebook or WikiPedia, and no DearDrum.org.

    What exactly is this HTML5 argument about?

    Up until now HTML has not had any built in support for audio or video. If you wanted to play audio or video on the web you had to use a plugin like Adobe Flash Player. Which is fine, but Adobe is a profit motivated company and the web is an open place, so in the interest of choice and freedom the new version of HTML, HTML5 does have built in audio and video support.

    Now the standards body that decides on what HTML5 will be is called W3C. Unfortunately the W3C is dominated by massive corporations who tend to dictate the standards in favour of their profit margin instead of what's best for an open, innovative web, and what's best for all of us. Up until now there hasn't really been much to debate over and it's been a long time since HTML4 came out anyway. Up until now Internet Explorer had majority market share and deliberately didn't follow the standards so web developers would have to focus on supporting IE's defunked and broken interpretation of HTML4. IE's massive market share was purely the result of being packaged with Windows. Microsoft has been sued over this anti-competitive practice because it directly hurt the web for so many years. During this time the other web browsers pushed to become faster and add amazing features to try gain as much market share as possible. It was IE vs. the world and Mozilla was their biggest rival with Firefox. If it wasn't for Firefox we'd all be eating dirt and living in shacks right now in a world where an open DearDrum.org could never even be conceived of.

    The problem with HTML5 audio/video support is that everyone needs to agree on an audio and video format; in the same way .txt is a text format and .jpg is an image format. The issue is licensing. There happen to be some really great audio and video formats out there that are open source, meaning they can be freely used and improved upon by anyone. There also happen to be a lot of big faceless corporations in the W3C, see a list here, some of whom own part of the licensing rights to a particular format known as H.264.

    When it comes to web browsers you have two sides of the argument. Those for an open web, and those whom want to charge everyone obscene amounts of money to use H.264. Currently the H.264 license allows people to use it. This free use has been extended to 2016 for the purposes of convincing non owners in the W3C - and the greater public, that it's free. After 2016 and quite frankly with the right high priced law firm any old time, that could expire and everyone would suddenly be charged $50 a day to watch youtube videos. Or $5000 a year to upload YouTube videos. If H.264 becomes the standard it would be a twisted joke and we would all be royally screwed.

    Microsoft and Apple both own part of the H.264 licensing rights. So they've chosen only to support that format. They could easily support both H.264 and WebM(the open, free format), but they don't because they're hoping that they can prolong the debate long enough that developers will have to support H.264 to reach the majority of people who use those two browsers - both packaged and preinstalled with their respective operating systems.

    Mozilla by it's very nature will always push for an open web, and Google's profit margin is directly tied to people's ability to generate content. Google went so far as to purchase the WebM format AND absolve the entire world from licensing fees should some obscure patent be discovered down the road and some sadistic person try capitalize on it. To Google it's a business expense, but it happened and it benefits everyone.

    The WebM format is a container format, which uses VP8 for video, and OGG Vorbis for audio. For DearDrum.org we decided to use OGG Vorbis as our audio format.

    Wow that was a lot to take in, so why does DearDrum.org use OGG Vorbis instead of MP3?

    While most your music is probably in .mp3 format, it costs a lot of money to transcode audio into the .mp3 format due to licensing. And who knows when that price will go up. When creating DearDrum.org I didn't want to be at the mercy of some company, and we didn't want to charge people to download and use the DearDrum.org Desktop App. We went in favour of choice, freedom, and openness because we value those ideals; and we want the web to remain an innovative grounds for inspiring new ideas.

     

    Flash FileRef Mysterious IOErrorEvent #2038

    This happened twice in the last two days and for the second occurrence I totally forgot what the issue was the first time I fixed it. So the lesson is blogging about this stuff as it happens saves time regardless of deadlines.

    So you're in Flash or Flex and your fileRef is failing to upload. Flash(Flex) Builder is telling you there's an IOError, but the line number given is where you set the local path of the File Reference. "WAHT!," you try an Event Listener and it does nothing. You vain atry/catch statement and it catches nothing. Despite what the compiler is telling you, you expand the try/catch statement to your whole uploading function hoping to narrow the issue down, but it does nothing. Finally you resort to Debugger breakpoints throughout the function and you discover it's actually being triggered by the call to fileRef.upload();. The possible causes just increased by an order of 50.

    Before you break something in your office, you should know that File Reference IOErrors can be triggered by a failing server upload script. Now hold on, you'd think IOErrors would only happen if the upload script URL was wrong or broken, like if you missed a semicolon in your php or some silly thing like that. But thankfully Adobe went the mysterious route and made this as ambiguous as possible. There are a ton of reasons why your upload script might fail in such a way that it triggers this error in flex, or in a non-debug version of your app just stay stuck at 0%, and it might not be immediately apparent or fun to track down. Reading this now you are appropriately upset, but wait another second.

    The first time this happened to me yesterday it happened because the upload name when I was getting the filesize of the temp upload file was wrong. In the following code that's the upfile1 part.

    $filesize = filesize($_FILES['upfile1']['tmp_name']);

    Then about 20 minutes later the same mysterious IOError popped up, but this time it was the server path I was moving the upload to. The path's are relative and I'm dyslexic, nuff said.

    move_uploaded_file($_FILES['upfile1']['tmp_name'], $incorrect_relative_file_path)

    Today however I was _shocked_ to find the crazy IOError because this time I knew all the paths were correct. In fact everything related to files was correct. I was sure, and I felt betrayed. (Once I re-realized that it wasn't a regular rational IOError... again). After a quickly unpleasant hunt through 1000+ lines of code I found a mysql query that was failing outside of an if/else clause. The reason it suddenly broke was that while editing the database at 5am this morning on no sleep I hit the wrong button -- so instead of deleting a column I accidentally dropped a whole table. There were two knew columns added since I backed it up that I had forgotten about in the haze, one of which caused the MySQL query to fail.

    I collapsed asleep last night with this unsolved, I had nightmares that alluded to it. Really. But after 5 hours the frustration overwhelmed my capacity for dreaming and I leaped out of the surreal scene and into another one --Dreamweaver. Now knowing this had a solution and that I'm not gonna have to run through a field at night with a town's worth of pitchforked locals chasing me I feel expansive relief. Makes me wonder if I'm doing this to chase that feeling or if it's just a side affect.