9 October 2014

Who I Am

Okay, take a deep breath.  Here it comes, kicking, clawing, and yowling.

Are you ready for it?

My name is Dan Falconer.  I’m a geek.

I have a lot of websites.  Right now, they’re all mine, and there’s not a clear reason for many of them to exist.  Here are those websites:

  • CrazedSanity.com — completely home-grown, every line of code written from me.  Built from the ground up by me.  My handle (minus the “.com”) for most everything.
  • CrazedBuzz.com — my WordPress site.  Where I go to write stuff and not worry about digging into code if the blog post won’t save.  Same as my Xbox Live handle (because “crazedsanity” wasn’t available)
  • Buzzkill.org — my other website… mostly just like CrazedSanity.com, replete with all the blog posts from said website, but with a few (very VERY old) unique pages.
  • BuzzkillProductions.net — the exact same site as Buzzkill.org.  EXACT SAME.  It exists because of… reasons.
  • TTORP.crazedsanity.com — the Table Top Online Role Playing web application.

The other places I “own” or otherwise lurk:

  • GitHub.com — where I store a bunch of code repositories.
  • BitBucket.org — where I store more code repositories (many of which are hidden)
  • Facebook — where I pretend to be social… but only because it has “networking” in it.
  • Google Plus — the other social networking site… that I really wish would get more traction than Facebook.
  • Deviant Art — where I post my doodles and stuff.

There’s more than that.  But let’s face it, this was a total over-share.  You’re welcome.

Category: Uncategorized | Comments Off on Who I Am
9 October 2014

Understanding Dynamic Webpage Updates

There’s a lot of ways to make your webpage update without requiring the user to refresh the page.  The way Facebook updates your news feed while you’re looking at it.  Or Google+, or Twitter, or whatever.

I’m going to talk about just three ways: Polling (with Ajax), Web Sockets, and Comet (or “long polling”).  There’s a ton of different variations of ways to may pages update dynamically.  I’m not going to talk about Flash, or Java, or other icky things (I’m looking at you, Silverlight).

Polling (via Ajax)

Polling the server, using Ajax, was the first way used to make pages interactive.  Your browser would use Javascript to periodically ask the server if anything has happened.  Maybe once every few minutes, or sometimes up to every second (or as quickly as it could, in some cases).

Ajax is a combination of a few technologies, and can be a bit confusing to talk about… so let’s distill it down.  Basically, your browser asks the server, “hey, did (X) change?” to which the server would mostly respond, “no.”  When there’s a change, some part of the displayed page would get that updated bit of information.  Pretty over-simplified, but that’s the gist of it.

The problem is that the server is getting asked a lot of questions.  It’s like reloading the webpage constantly to see if there’s a change: given enough people, that puts a heavy burden on the server.   To fix this, Comet and Web Sockets were created.

Web Sockets

The concept of web sockets is, in its simplest form, that the server will respond when something has changed.  Instead of asking every second for 30 seconds to get a single response (asking 30 times if something has changed), web sockets kinda says, “hey, just let me know when something changes.”  The server only sends back when something actually has changed: in our scenario, that means we’ve eliminated 29 questions.

Unfortunately, Web Sockets is a feature that isn’t 100% supported. Well, it is mostly supported in the newest browsers, but not necessarily completely.  Not in all of them.  And older browsers?  Yeah, they’re screwed.

Comet

So polling is cool, but it’s fairly taxing on the server.  Web Sockets is a cool idea, but isn’t completely supported.  In comes Comet to create that middle ground.

Essentially, comet is just like polling, but with a twist: instead of returning a response immediately, as with polling via Ajax, the server would hold on to the request, and only respond after a certain amount of time or after something changed.  Basically the same as Web Sockets, except… well, different.

The great thing about comet is that pretty much all modern browsers support it.  In fact, even most of the older browsers support it!

Category: Code, Software Development | Comments Off on Understanding Dynamic Webpage Updates