Scott Hanselman

Google Gears - Maybe all Rich Internet Applications needed was Local Storage and an Offline Mode

May 30, 2007 Comment on this post [26] Posted in Javascript | Musings | Tools | XML
Sponsored By

Stunning move by Google today in the Rich Internet Application space. While most of us (myself included) are off debating Flash vs. Silverlight vs. Apollo vs. Whatever, Google introduces Google Gears...at technology all of the above (or none of the above) can utilize...

This is a huge move and is quite brilliant. In one seemingly innocuous move (and one tiny 700k (yes, 700K) download) Google is well positioned to get Google Docs, including Writely, Spreadsheet and Presentation, along with who knows what else, enabled for offline use. And the whole thing is Open Sourced via the New BSD License.

Here's a snippet of Javascript that is used to detect if Google Gears in installed. Note the three (currently) different ways, one each for Firefox, IE and Safari.

 var factory = null;

  // Firefox
  if (typeof GearsFactory != 'undefined') {
    factory = new GearsFactory();
  } else {
    // IE
    try {
      factory = new ActiveXObject('Gears.Factory');
    } catch (e) {
      // Safari
      if (navigator.mimeTypes["application/x-googlegears"]) {
        factory = document.createElement("object");
        factory.style.display = "none";
        factory.width = 0;
        factory.height = 0;
        factory.type = "application/x-googlegears";
        document.documentElement.appendChild(factory);
      }
    }
  }

To the right is a dialog box that pops up to let you know that Google Gears is going to store data locally. Gears uses SQLite to store information, and you use SQL from your JavaScript to CRUD (Create, Read, Update, Delete) your data. I wonder how would would store data securely?

If you like, you can explore the databases that are created using SQLite Database Browser. This starts to explain why SQLite was a 2005 Google Open Source Award Winner. ;)

The local storage shows up when running Internet Explorer on Windows under:

C:\Users\Scott\AppData\LocalLow\
Google\Google Gears for Internet Explorer\
www.yourdomain.com\http_80

Within Firefox, the local storage databases go in:

...\Application Data\Mozilla\Firefox\Profiles\
<profile>\Google Gears for Firefox

So it seems I can't go to a Gears-enabled site in IE and later in Firefox and share data. Each browser gets it's own data storage. That means num of browsers * num of gears enabled uris = num of SQLite databases. For folks who run more than one browser, this makes the whole local storage thing a tricky issue, but I can understand why they'd segment databases by browser. I disagree, but I see their point of view.

Gears also includes a thread pool "tiny process pool" like construct that lets you perform CPU-intensive things without triggering the "Stop unresponsive script" dialog box, but you can't touch the DOM. Again, very cool and very intelligent tradeoffs.

Things are looking up, methinks. It'd be nice if Gears-like (Gearsesque?) functionality could get built into next-gen browsers the way that XmlHttpRequest did. Seems like only yesterday I was deep in the middle of the Great Cookie Scare of 1995, explaining to client what Cookies were...NO, they can't write out a megabyte sized cookie, no cookies aren't programs...glad that's over. If we've going to build some rich stuff, let's stop with the Flash Shared Objects and IsolatedStorage already and get the browser to solve this problem. Kudos for Google and let's pray there's no offline ads...

Technorati Tags: , , , , ,

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Is This Useful? - Google Street View

May 30, 2007 Comment on this post [19] Posted in Musings
Sponsored By

A while back I posted about interesting maps (actually in 2005!) and listed out all the interesting map sites. At the time, Amazon's maps.a9.com was the most innovative because they had street level imagery. They've since shut down, but today Google Maps took it to the next level with Google StreetView.

Not sure why you'd want to watch a blurry video rather than just going there, but you can see a demo on YouTube if you like.

The embedded Flash has a nice draggable cylinder view like QuickTime VR, letting you see any angle stitched together.

The user interface is pure brilliance. Pick up the little yellow man and drag him, and his little feet float in the wind as you drag him round, until he's firmly planted on virtual ground again. A green arrow indicates which direction he's facing. Even arrow keyboard hotkeys work as they should!

Here's the real question - is this useful?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Going to Foo Camp 2007

May 30, 2007 Comment on this post [12] Posted in Musings | Speaking
Sponsored By

I received and accepted an invitation to go to O'Reilly's "Foo Camp" 07, being held in Sebastopol, CA, north of San Fransisco. Here's the schpeal:

We've invited about 250 Friends Of O'Reilly (aka Foo), people who're doing interesting works in fields such as web services, data visualization and search, open source programming, computer security, hardware hacking, GPS, alternative energy, and all manner of emerging technologies to share their works-in-progress, show off the latest tech toys and hardware hacks, and tackle challenging problems together. We'll have some planned activities, but much of the agenda will be determined by you. We'll provide space, electricity, a wireless network, and a wiki. You bring your ideas, enthusiasms, and projects. We all get to know each other better, and hopefully come up with some cool ideas about how to change the world.

There's about 250 folks going, and the list of "foo campers" is pretty cool. I'm going to have trouble keeping track of everyone, as the all seem so darned interesting.

One important thing about Foo Camp it seems, is that every attendee should be prepared to demo something that they are working on. This is, of course, where paralysis sets in. Here's their list of suggested sessions so far.

I like the sound of these:

  • Islam 2.0 - Understanding the intersection between spirituality and computing...creating 'life services' for Muslims (Imran Ali).
  • Using Improvisation to spur creativity and generate ideas (Kent Nichols, Douglas Sarine)

I'm hoping to record a number of Podcasts for folks to enjoy, and perhaps just conversations with cool people.

Help me, what sessions should I come to chat about? Here's some ideas I have so far...yours are appreciated as I'm only as clever as the sum of all of you. ;)

  • Carrying Water from the River to the Internet Cafe - Is Africa skipping a step on the technology road? How can The Continent avoid Brain Drain and support a new middle class of knowledge workers when there's no infrastructure to support them?
  • Using The Social Web to Improve Diabetes Care - What can the medical industry learn from Web 2.0 to provide better care for those with life-long chronic illnesses likes Diabetes?
  • How Important is NOT-English on The Web? - Will the Internet end up like the movie Serenity with just English and Mandarin? Or perhaps English, Spanish, French, Mandarin, Hindi and Arabic? Is there value in supporting a Web with pages in Amharic? Sioux? Zulu?
  • I left my Brain in my Other Pants or Where do you store yourself? or Techniques and Synchronization of your iLife or Mashing up your Life - Between email, contacts, calendars, freebusy information, documents, medical info, bills, accounts, my life is an exercise in synchronization...without an authoritative source. Who will be my cloud and can I trust them?

That's all I've got off the top of my head...What ideas do you have for me, Dear Reader? If you've gone to this event before, what tips can you offer me?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

The Duh Files - The file is too large for the destination file system

May 29, 2007 Comment on this post [16] Posted in Musings
Sponsored By

When copying giant (greater than 4 gig) files and Virtual Machines and Video and what-not to your fresh new External Hard Drive you might be greeted with this message, or one like it:

Doh! This hard drive came formatted as FAT32, which doesn't support files larger than 4 gigs. You can either Format the drive, by right clicking the Drive in My Computer and using the Tools tab, or, if you already have a bunch of files on it...

Run an Administrator Console (click the Start Menu, type cmd, then right click on the command prompt and click "Run As Administrator") then run:

C:\Users\Scott>convert h: /fs:ntfs /nosecurity
The type of the file system is FAT32.
Enter current volume label for drive H: My Book
The volume is in use by another process. Chkdsk
might report errors when no corruption is present.
Volume My Book created 1/31/2003 2:23 PM
Volume Serial Number is XXXX-XXXX
Windows is verifying files and folders...
File and folder verification is complete.
Windows has checked the file system and found no problems.
244,136,352 KB total disk space.
128 KB in 4 hidden files.
544 KB in 17 folders.
3,063,072 KB in 63 files.
241,072,576 KB are available.

32,768 bytes in each allocation unit.
7,629,261 total allocation units on disk.
7,533,518 allocation units available on disk.

Determining disk space required for file system conversion...
Total disk space: 244196001 KB
Free space on volume: 241072576 KB
Space required for conversion: 369647 KB
Converting file system
Conversion complete

...and continue your copy, with the crisis averted. Bummer there's no "Convert File System" button in the Tools Property Tab of a Disk Drive.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Virtual Machine CPU Performance

May 29, 2007 Comment on this post [12] Posted in Musings | Reviews | Tools
Sponsored By

In the last post on Virtual Machine Performance Tips I said, here are some realistic goals for your Guest OS (VM) performance, that I originally got from J. Sawyer at Microsoft:

  • Ideally Virtual PC performance is at:
    • CPU: 96-97% of host
    • Network: 70-90% of host
    • Disk: 40-70% of host

In the comments Vincent Evans said:

From personal experience with VM (running in MS Virtual Server) - i have grave doubts about your claim of VM CPU performance approaching anywhere near 90% of native.

Can you put more substance behind that claim and post a CPU benchmark of your native server vs. vm running on that server? For example i used a popular prime number benchmark (can't remember the name, wprime maybe? not sure.) and my numbers were more like 70% of native.

I agreed, so I took a minute during lunch and ran a few tests. For the test I used the Freely Available IE6 WindowsXP+SP2 Test Virtual Machine Image along with the Free Virtual PC 2007 and Virtual Server 2005 R2 as well.

These are neither scientific, nor are they rigorous. They are exactly what they claim to me. They are me running some tests during lunch, so take them as such. I encourage those of you who care more deeply than I to run your own tests and let me know why these results either suck, or are awesome.

I used wprime to calculate the square roots of the first 4,194,303 numbers. Wprime can spin up multiple threads, and this was significant because my system has two processors, so you'll see what kind of a difference this made in the tests.

Both Virtual PC and Virtual Server only let the Guest OS use one of the processors, so I did the tests on the Host OS with one, then two processors, to make sure the difference is clear.

My Hardware (as seen by wprime from the Host OS)

>refhw
CPU Found: CPU0
Name: Intel(R) Core(TM)2 CPU T7600 @ 2.33GHz
Speed: 2326 MHz
L2 Cache: 4096 KB
CPU Found: CPU1
Name: Intel(R) Core(TM)2 CPU T7600 @ 2.33GHz
Speed: 2326 MHz
L2 Cache: 4096 KB

Results

Looks like for both tests a VM's CPU, when stressed, runs at just about 90% of the speed of the Host OS, which is lower than the Goal of 96-97% I printed earlier. Tomorrow I'll update this post by rebooting and going into the BIOS and turning off my system's Hardware Assisted Virtualization and seeing if that makes a difference. If the results are lower (I assume they are) then that'll just confirm that VT Technology is useful - I assume that's a fair assumption.

You can try these tests yourself on your own machines using wprime. Just make sure you tell wprime how many threads to use in your Host OS, depending on your number of processors. Thanks to Vincent for encouraging the further examination!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.