Google’s Vision of the Web in 2015

Marshall Kirkpatrick of ReadWriteWeb had an interesting post today recapping an interview with Google’s CEO Eric Schmidt at last week’s Gartner Symposium. In a short, 6 minute segment out of the full 45 minute interview (video below), Schmidt hinted at what the future of the internet will bring.

Via RWW: Google’s Eric Schmidt on What the Web Will Look Like in 5 Years

  • Five years from now the internet will be dominated by Chinese-language content.
  • Today’s teenagers are the model of how the web will work in five years – they jump from app to app to app seamlessly.
  • Five years is a factor of ten in Moore’s Law, meaning that computers will be capable of far more by that time than they are today.
  • Within five years there will be broadband well above 100MB in performance – and distribution distinctions between TV, radio and the web will go away.
  • “We’re starting to make significant money off of Youtube”, content will move towards more video.
  • “Real time information is just as valuable as all the other information, we want it included in our search results.”
  • There are many companies beyond Twitter and Facebook doing real time.
  • “We can index real-time info now – but how do we rank it?”
  • It’s because of this fundamental shift towards user-generated information that people will listen more to other people than to traditional sources. Learning how to rank that “is the great challenge of the age.” Schmidt believes Google can solve that problem.

It’s hard to argue with any of those, really. The one I’m looking forward to most of all is the convergence of media platforms as the lines between TV, Radio, and Web become more and more blurry. As those lines become blurred, more innovation will occur between the gaps and the old-time revenue models based mostly on distribution begin to fall apart.

Posted in Social Media, Technology | 1 Comment

Dynamic function names in JavaScript

If you are doing some more advanced JavaScript applications, you’ll likely run into the problem at one point or another when you need to dynamically generate the name of a function you wish to call. This is the equivalent of PHP’s call_user_func().

Here’s how you can do it.

// Define some vars
var foo = "hello";
var bar = "world";
var function_name = "say_" + foo + bar;
 
// Since its name is being dynamically generated, always ensure your function actually exists
if (typeof(window[function_name]) === "function")
{
	window[function_name](" World!");
}
else
{
	throw("Error.  Function " + function_name + " does not exist.");
}
 
function say_helloworld(the_word)
{
	alert("Hello " + the_word);
}
 
// Browser will alert "Hello World!"

When you think about it, it makes a lot of sense considering all global objects in JavaScript are actually properties of the “window” object. Take a look at this example to understand that concept a bit more.

var foo = "apple";
 
function foobar()
{
	var foo = "orange";
	alert(window["foo"]); // alerts "apple"
	alert(foo); // alerts "orange"
	alert(window["foobar"]); // alerts the foobar function
}
 
foobar();

Here’s another example of when using a string to call a function could come in handy. This time we’re calling the property of an object we’ve created.

function Person()
{
	this.message = "Hello World!";
	this.say_hello = function(to)
	{
		alert(this.message);
	}
}
 
var Derek = new Person();
function_name = "say_hello";
Derek[function_name]();

See how it looks pretty much the same as the method above using a global function?

Hope that shed some light on your problem.

Posted in Web Development | Tagged | Leave a comment

Opacity supports “Export to Canvas”

Looks like I may be able to soon replace Adobe Fireworks as my image editing tool of choice for the web. Ajaxian recently featured a new tool called Opacity, and if you follow through to their website, you’ll find a great video tutorial that shows how you can create great looking icons and simple images.

But, the best feature in my eyes could be their JavaScript export option that can be dumped inside HTML5′s <canvas> tag to render & animate the image. I haven’t yet seen the source code this generates, but it seems logical that you could translate layer based vector art into JavaScript.

opacity-export.jpg

Another feature I also love is the integration with the various OSX FTP clients like CyberDuck and Transmit, as well as the dynamic web preview option.

With <canvas> being relatively new on the scene, a tool like this could really bridge the gap between designers & developers and accelerate the adoption of another open standard that can help push the “open web” forward.

You can read more about Opacity at WebMonkey’s review or check out Opacity’s product page

Posted in Web Development | Leave a comment

Daily Tip: Chrome for OSX

chromium-icon.png

If you can’t wait to get your hands on Chrome for OSX, go download a Chromium nightly build, unzip, and copy to your Applications folder.

At first glance, it doesn’t appear much different from Safari, which isn’t too surprising since they’re both based off the the same layout engine (WebKit). The real differences are just going to come in the skin (which is pretty similar) and the JavaScript engine (Chromium = V8, Safari = Nitro, formerly “Squirrelfish”).

Posted in Technology | Leave a comment

The Reason RSS Cloud Can Work Now

cloud.jpg

Rogers Cadenhead recently wrote a post “The Reason RSS Cloud Failed to Catch On“. In this he argues that RSS Cloud is not sustainable when it begins to scale to thousands of users needing to receive pings every time a post is made. While he has a point, I believe his argument is much more accurate when put into the context of 1999 as opposed to 2009, and it is even more irrelevant a few years from now. This points to one thing… RSS Cloud was ahead of its time.

Today, supporting RSS Cloud is cheap. Bandwidth is a fraction of a percent now compared to what is was 10 years ago along with cloud based virtual servers available for ~$10 / month. I’d suspect a properly tweaked VPS at the Rackspace Cloud or EC2 could handle millions of pings / day without issue. Unlike PubSubHubBub, the content of the post is not delivered with RSS Cloud, it is just a body-less ping, so bandwidth isn’t even an issue. A server supporting these types of capabilities back in 1999 would have cost thousands of dollars per month. Now? Just a few bucks. 5 years from now I suspect it will be free (example: Google App Engine is currently free and could be configured for this service).

Let’s go ahead and take into consideration the dream scenario with RSS Cloud, and that is that we have completely replaced Twitter. In this scenario Ashton Kutcher will have 5 million followers and will need to notify each of those followers when he tweets out 100 mundane posts / day. Let’s not kid ourselves and not think there is a middle man in there somewhere. These services are the “Cloud” portion of whole term. Just like Feedburner and Google Reader are proxies between publisher and reader now (by storing local caches of RSS feeds), there will be many services that would be happy to host the feeds, providing a web client to the reader and analytics to the publisher in turn receiving all the statistics they chew on. Proof? Twitter purchased Summize (search.twitter.com) and Google bought FeedBurner because they saw the value of this type of service. Afterall, the analytics portion of that is the whole business model that Twitter is rumored to be building.

But ok… let’s assume those “Cloud” services never pop up because, hell… I don’t see any reason why they wouldn’t, but let’s just imagine they don’t exist. Solution? TURN OFF THE NOTIFICATIONS! That’s the beauty of RSS Cloud feeds, it’s completely backwards compatible with non-Cloud enabled feeds. If the Cloud server fails to send out notifications, then their subscribers will simply revert back to the old method of routine polls looking for new content. But, failing to notify your subscribers of new content in a sea of real-time has drastic consequences. Even if you are the first to report information, you will always be “scooped” by others because the lag caused by your inability to notify your subscribers. That alone will be enough to even the playing field. As a compromise, you could get away with just notifying a few dozen RSS aggregators (Google, Yahoo, Feedburner) to take care of the majority of your subscribers, and those using readers you don’t notify will revert to polls.

So as you can see, RSS Cloud is currently gaining traction because it wasn’t until now that it was a viable service for the masses. Even now there is very little support within the client portion of RSS Cloud, but I suspect that will be a battleground many will fight for in the next couple years.

Posted in Web Development | Tagged , , , , , | 9 Comments

Cloud Enabled

Today WordPress.com announced RSS Cloud support for all their hosted blogs. Not to be left out of the party, I also installed the RSS Cloud plugin on this blog.

RSS Cloud is an ancient RSS element (in web 2.0 years) that has been given new life recently as the “realtime web” in exploding (thanks to Twitter and Facebook). Basically, it allows RSS readers the ability to be notified when a feed has been updated instead of waiting minutes, hours, or days before that client has a chance to check the feed. Now, an RSS Cloud supported reader that is subscribed to an RSS Cloud enabled feed can be notified within seconds that the feed has been updated. RSS now has a realtime element.

RSS Cloud support is still in it’s infancy with only 1 RSS reader supporting RSS Cloud notifications (River2), but within the coming year, it could become a game-changing technology that can give rise to self hosted Twitter-like publishing platforms. There’s a number of people (myself included) that are working on such platforms, and hopefully I’ll be able to make an announcement in the coming weeks. My feeling is, as great as WordPress is for blogging, it’s not the ideal platform for micro-blogging. What the community needs is a microblog version of WordPress that has a real-time element, and I think this RSS Cloud element fits the bill.

Related Articles

Posted in Web Development | Tagged , , , , | Leave a comment

Auto-versioning JavaScript & CSS files

As JavaScript becomes a more integral part to the core functionality of websites, ensuring that a user has a fresh copy of the latest code is as important as ever. Normally a browser will cache certain filetypes (CSS, JS, JPG, etc…) for an indefinite period of time. If the code within one of these cached files is updated, sometimes a browser will not know to reload that file. So, if those changes are important for the functionality of your website, your users may run into issues and not be able to use your site properly. Worse, they likely won’t have any idea what the issue is and will eventually give up and go elsewhere. But have no fear, there’s a solution to this problem… versioning your static files.

By “versioning” these files, I’m referring to changing their filenames from “my_styles.css” to “my_styles.version274.css” for example. The problem with that example is it relies on you renaming the file and updating your includes every time you make a change. That sounds like an nightmare, right? Luckily there’s a neat tactic you can you to make it appear to the browser to be a new file, but it will actually be the same file and will require no effort on your part. This variation of the versioning tactic is often referred to as “Auto-versioning”. Here’s an example…

First, we use the following rewrite rule in .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-s # Make the file doesn't actually exist
RewriteRule ^(.*)\.[\d]+\.(css|js)$ $1.$2 [L] # Strip out the version number

Now, we write the following PHP fuction:

/**
 *  Given a file, i.e. /css/base.css, replaces it with a string containing the
 *  file's mtime, i.e. /css/base.1221534296.css.
 *  
 *  @param $file  The file to be loaded.  Must be an absolute path (i.e.
 *                starting with slash).
 */
function auto_version($file)
{
  if(strpos($file, '/') !== 0 || !file_exists($_SERVER['DOCUMENT_ROOT'] . $file))
    return $file;
 
  $mtime = filemtime($_SERVER['DOCUMENT_ROOT'] . $file);
  return preg_replace('{\\.([^./]+)$}', ".$mtime.\$1", $file);
}

Now, wherever you include your CSS, change it from this:

<link rel="stylesheet" href="/css/base.css" type="text/css" />

To this:

<link rel="stylesheet" href="<?=auto_version('/css/base.css')?>" type="text/css" />

And when rendered, will appear as:

<link rel="stylesheet" href="/css/base.1251992914.css" type="text/css" />

How does this work? Because that mod_rewrite rule above will strip out the timestamp, your server will deliver /css/base.css as the requested file. But to the user’s browser, it will appear as a different file whenever it is updated.

Neat!


Note: Some strategies to fix this caching issue is to append a version # onto the end of the css or JavaScript file with a querystring, such as:

<link rel="stylesheet" href="/css/base.css?version=1234" type="text/css" />

This method will actually prevent the file from being cached, period! This is bad. You want the benefits of caching. You don’t want to make your users pull down 100k of JavaScript & CSS files on every page load. More importantly, your servers could start to strain under the additional load.

Why is it not cached? See Section 13 from the HTTP Specification, in particular Section 13.9

13.9 Side Effects of GET and HEAD

Unless the origin server explicitly prohibits the caching of their responses, the application of GET and HEAD methods to any resources SHOULD NOT have side effects that would lead to erroneous behavior if these responses are taken from a cache. They MAY still have side effects, but a cache is not required to consider such side effects in its caching decisions. Caches are always expected to observe an origin server’s explicit restrictions on caching.

We note one exception to this rule: since some applications have traditionally used GETs and HEADs with query URLs (those containing a “?” in the rel_path part) to perform operations with significant side effects, caches MUST NOT treat responses to such URIs as fresh unless the server provides an explicit expiration time. This specifically means that responses from HTTP/1.0 servers for such URIs SHOULD NOT be taken from a cache. See section 9.1.1 for related information.

Posted in Web Development | Tagged , , , | 7 Comments

Crowdsourcing Music Videos

I just came across one of the coolest music videos I’ve ever seen, and the beauty of it? It was made by a fan, just for the fun of it. Incredible.

Link: Two Weeks – Grizzly Bear from Gabe Askew.

One of the first things I thought about while watching Gabe’s video was whether this would be yet another take-down viral video because of copyright infringement? But, a group like Grizzly Bear (or their record label) would be crazy to complain about the soundtrack because of the attention it generates for the song.

You could either be a band that removes the soundtrack from someone’s artistic work, infuriating them and accomplishing nothing. Or, you could capitalize off it, much like Chris Brown’s (or his record label’s) decision to not remove the soundtrack from the “JK Wedding Dance” video that ended up boosting him to #4 on the iTunes charts and possibly saved his career.

Another recent example is the use of Barcelona’s “Please Don’t Go” song in a tranquil aquarium video that has been 1.8 million views at the times of this posting. The band was so pleased that they posted a video response to introduce themselves to their new fans and credited the video towards increased albums sales and concert attendance. Instead of saving a career (as in Brown’s case), this very well could make a career for these guys, and all because they lucked out and had a passionate, artistic fan that wanted to showcase both their works, together.

Gabe’s video is yet another great example of how music artists (and any celebrities) for that matter can use their fans to crowdsource ideas and content. Instead of spending thousands or millions to produce a video, you can get really high quality content for next to nothing, all because your fans are passionate about your work and want to be more involved. So get them involved, they want to be, and they’ll reward you for the opportunity.

As a final example, here’s a video from Tilly & The Wall which was completely crowdsourced by their fans. All they did was ask users to send in clips of them singing their song “Rainbows in the Dark” and spliced them all together, making an awesome, fun, and cheap video. Imagine a progressive band like Nine Inch Nails or Radiohead saying they weren’t going going to make a video for their latest single and instead were holding a contest for a fan to make an “official video” for that song and awarding $20k? Contests like that can become a breeding crowd for viral videos, something all musicians are dying for nowdays.

Related reading:

Posted in Music, Social Media | Leave a comment

5 of the Worst Songs, Ever

So a co-worker of mine introduced me to Shakira’s “She Wolf” song today, and wow is it horrid. It got me thinking… What other awful songs are out there polluting the pop charts? Well, here’s 5 that are probably somewhere in my top 50. Maybe someday I’ll post the other 45.

#1 Shakira – She Wolf (2009)

I can’t help but crack up everytime the chorus kicks in, it’s just horrible. And the “Ah-ooooo” 1:35 into the song? What hack producer though that was a good touch?



#2 Black Eyed Peas – I Gotta Feelin’ (2009)

This song is such a crock of shit. Not that I expected amazingly creative lyrics from the Black Eyed Peas, but c’mon, this song isn’t even trying. Here’s a great review from Cracked.com, Black Eyed Peas Have Officially Written The Worst Song Ever


#3 Rednex – Cotton Eye Joe (1995)

Whoever the hell though mixing techno and country would be a good idea needs to be shot. Oh, and don’t forget about the group’s chartbusting 2002 follow-up, Cotton Eye Joe 2002


#4 Toby Keith – The Angry American (2002)

On the topic of rednecks…

Outraged by the 9/11 terrorist attacks, Toby Keith enlisted in the Air Force — no, sorry, he wrote a fight anthem so vengeful, it makes “The Star-Spangled Banner” sound like “Give Peace a Chance.” Though right-wing radio hosts and politicians called him a hero, Keith (who hadn’t had a hit in years) moaned, “It sucks ass that I have to defend myself for being patriotic.” Wrong. You have to defend yourself for celebrating violence and bloodlust.


#5 – Billy Ray Cyrus – Achy Breaky Heart (1991)

As if line-dancing really needed a comeback. This is a song that gets stuck in your head, and won’t leave for at least a couple days. So go ahead, click the image, I dare you.


What are some songs you’d add to the list? Add a comment.

Posted in Music | 2 Comments

Tech Support

This has been blowing up on Twitter today, so figured it was worthy of a blog post. =D

Tech Support

Posted in Humor | Leave a comment