Dented Reality Notes
27 Aug 2007
What is Web 2.0? (#)
My brother recently emailed me with the relatively simple question, "what exactly is Web 2.0?" I know a lot of other people out there have taken a stab at defining the damn thing, but I thought I'd take a shot as well. Here's what I replied with:
It's kind of a "catch-all" expression for a lot of the things that are going on online now. It generally refers to things like blogs and wikis and sites where the user is actually doing all the work (thus the common term "User-Generated Content" or UCG).
Just to confuse things, a lot of people have started referring to a specific design style and set of technologies as being "Web 2.0" as well. This tends to include:
- anything mobile
- anything including mapping/geo
- AJAX (a JavaScript technique to avoid page-refreshes and make things more responsive)
- widgets (which are a whole other confusing mess of their own)
- anything that uses RSS/Atom feeds
So yeah... it's not easy to give a simple one-line answer, because it's kinda all of those things and more. Some people argue that it's a "revolution" of the way the web works, because "Web 1.0" was all about companies or bigger groups publishing information online, whereas 2.0 is more about "the little guy" out there (users) controlling and publishing their own content (think YouTube, Flickr, etc). To me, it's actually just an evolution though, a logical progression that just took a while because we had to figure out and refine the technologies to allow things to be easy enough for everyone to be involved.
That's my take on it anyway :)
24 Jul 2006
I'll Be At The Future (#)
Well-known and respected Carson Workshops are putting on a summit titled The Future of Web Apps. I'll be there!
13 Dec 2005
Ruby is the new PHP (#)
Don't know if this has dawned on anyone else yet...
PHP was the new Perl, written for the web
Ruby (+ Rails) is the new PHP, written for web 2.0
I guess that means I'd better get on the bandwagon and figure it out!
Resizing Browser Windows With JavaScript (#)
So here's an annoying one - I wanted to resize my browser window automatically, after the page had loaded (in a dynamic pop-up), to meet certain size requirements (namely to match a background image). The problem that I had was that all the different browsers support different methods and properties in relation to the 'viewport' (visible area of the browser), so I was having trouble finding a reliable way to do this.
I found a great breakdown over at quirksmode.org, but it didn't actually work in Safari (2.0.2), so I found that out pretty quickly, because that's what I'm working in. After a little playing around, I came up with the following modifications, which calculates the amount of chrome visible in the currrent window, and then takes that into account when resizing the entire window size.
I haven't tested this on too much other than Safari and Firefox on a Mac, but I think it should be reasonably compatible with others.
// Viewable size you want once resized
x = 600;
y = 400;
// Now set the window size for different browser types
// all except Explorer
if (self.innerHeight) {
// Figure out the measurements
iX = self.innerWidth;
iY = self.innerHeight;
oX = self.outerWidth;
oY = self.outerHeight;
// And resize to match the desired target
gX = oX - iX;
gY = oY - iY;
window.resizeTo(x + gX, y + gY)
}
// Explorer 6 Strict Mode
else if (document.documentElement && document.documentElement.clientHeight) {
document.documentElement.clientWidth = x;
document.documentElement.clientHeight = y;
}
// other Explorers
else if (document.body) {
document.body.clientWidth = x;
document.body.clientHeight = y;
}
12 Dec 2005
Google Maps Bookmarklet (#)
I'm sick of Cmd-T, maps.google.com, Enter, 'address' + ', sf, ca' so I made this quick little bookmarklet to speed up the process a little.
Drag it to your bookmark toolbar, then click it, enter a street address (eg. '2000 Bush St') and hit 'Ok' to get an instant Google Map to that location in San Francisco (my current hometown).
Obviously editing this to work for different cities in the US would be trivial - knock yourselves out.
11 Jul 2005
Here Comes The Giki (#)
You heard it here first - I predict that Google will soon release a wiki-based product of some kind. I don't know what they will do, or how they will make it 'simpler' or 'smarter' than wikis are already, but that's their problem I suppose.
I got my most recent copy of the 'Google Friends' newsletter, and towards the end, completely unrelated to anything else in the newsletter, they offer a definition (sort of) of what a Wiki is. They provide a link to Wikipedia and then leave it at that.
Google have already delved into the world of blogs (they own Blogger.com and run their own GoogleBlog), so I guess it was only a matter of time before they got into wikis as well. I wonder where this is going to go... especially since Yahoo! is already an avid supporter of Wikipedia at least (hosting some of their servers).
03 Jul 2005
Interesting Addition to Flickr (#)
In their continued integration with other Yahoo! properties, Flickr has added a 'Find Similar Images on Yahoo! Image Search' link to their tags pages. What interests me is the search string that is automatically built into that link.
Looking at the tag page for 'san francisco', the link doesn't go to the Y! Image search for just that tag, it is an automatically-built complex query (san francisco california OR bridge OR goldengatebridge OR goldengate OR alcatraz) which appears to be created using Flickr's automagical tag-relations building feature. It's calculating that those other words are related, so it's including them in the search to broaden the result-set. Pretty cool!
19 Apr 2005
Nerdalicious Sub-Conscious PHP Debugging (#)
I've dreamt in binary before, no big deal. When I was learning it (properly) and working with it a bit at university, I got a little carried away and would write my name on things in binary, that sort of ultra-cool nerd thing. Now I've stepped up from binary to PHP, and things appear to have accelerated from there;
Last night, I de-bugged the code that I was writing before I went to bed, in my sleep! I was working on my soon-to-be-released PHP Atom API package last night, as has been the case on many nights recently, and it got to be pretty late. I showered up, went to bed and all was well.
When I woke up this morning - I had memories of dreaming my way through the code that I had been working on the night before (1,500 lines, so no small feat ;) ), and in my dream, I had found a style of catching errors on some of my processing which wouldn't actually catch anything, and would always evaluate as if there was no error. I got up this morning and checked it, and sure enough - I was more coherent in my dream than I was while sitting in front of my PC coding.
My friend Ray dubbed this "nerdalicious" and I think that's a pretty awesomely descriptive word for it, so I'm calling this 'nerdalicious sub-conscious code de-bugging'.
14 Apr 2005
Better Random Hex (#)
Eric Scheid (founder of the excellent IAWiki) shot me a line with a more efficient and much sleeker version of my random hex code straight after I posted it, so here it is!
function random_hex() {
$color = '';
for ($c = 0; $c < 6; $c++) {
$i = rand(0, 15);
$color .= substr("0123456789ABCDEF", $i, 1)
}
$color = '#' . $color;
return $color;
}
Thanks Eric!
11 Apr 2005
Random Hex (#)
I needed some code to randomly generate me a hex value for use as a color in a webpage. Here's what I came up with (WARNING: Some colors are UGLY!)
function random_hex() {
$color = '';
for ($c = 0; $c < 6; $c++) {
$i = rand(0, 15);
switch ($i) {
case 10 :
$i = 'A';
break;
case 11 :
$i = 'B';
break;
case 12 :
$i = 'C';
break;
case 13 :
$i = 'D';
break;
case 14 :
$i = 'E';
break;
case 15 :
$i = 'F';
break;
default :
$i = $i;
break;
}
$color .= $i;
}
$color = '#' . $color;
return $color;
}
