Friday, March 6, 2009

[Gd] 2.0.168.0 has Over 150 Bug Fixes, new version of V8 and WebKit Merges

| More

Google Chrome Releases: 2.0.168.0 has Over 150 Bug Fixes, new version of V8 and WebKit Merges

Google Chrome's Dev channel has been updated to 2.0.168.0. The highlights for this week:
    • New
      • NTLM auth without automatic logon (Issues 6567, 6824)
      • Remote Desktop and Vista Theme changes now work nicely
      • New French and Polish dictionaries
      • Better support for PAC files and use of V8 to process them (use --proxy-resolver-v8 to try)
    • Fixes
      • More improvements to full screen mode
      • Many crash and stability fixes
    • Known Issues
      • Issue 5127: Ctrl-T accelerator for a new tab does not select Omnibox
      • Issue 8438: Browser hangs if history page shows after clearing history
      • Issue 8456: History tab search tab eats every alternate clicks
      • Issue 8453: Regression: about:network dialog shows up behind current Chrome window
      • Issue 8479: Javascript alerts don't work in New Tab Page.
      • Issue 8437: Cannot switch to background Chrome window with modal dialog open
      • Issue 8412: Copying most visited page screenshot and selecting paste and go causes crash
      • Issue 8399: Bookmarking a page not reflected on history page when open
      • Issue 8318: "Exit Full Screen" link does nothing
      • Issue 8372: Background paint issues with Task manager in maximized mode.
      • Issue 8345: Browser crash on "Remove/Remove All' of passwords
      • Issue 8289: Drag drop of bookmark from IE/FF crashes tab and then loads the page
      • Issue 8071: Javascript debugger doesn't come up for constrained windows
      • Issue 8040: Zoom is broken in [New Tab]
      • Issue 8016: Fonts and Languages Tab is truncated.
      • Issue 7920: Ctrl+Shift+T should not undo SSL Error page !

    Find about the Dev channel and how to subscribe at
    http://dev.chromium.org/getting-involved/dev-channel.


    Release Notes:
    • [r10197]Add support to ProxyService for downloading a PAC script on behalf of the ProxyResolver. A ProxyResolver can select this new behavior by subclassing ProxyResolver with does_fetch = false. A consequence of this change is that proxy resolve requests are maintained in a queue by ProxyService (rather than implicitly in a queue on the PAC thread's message loop). This simplifies cancellation.This solves issue 7461, and is work-in-progress towards {2764, 74}BUG=7461 (Issue: 7461)
    • [r10240]Update French dictionary files. (Issue: 7745)
    • [r10284]Updated Polish dictionary from http://extensions.services.openoffice.org/project/pl-dict. (Issue: 7745)
    • [r10294]Fixing 8010: Missing options from Options dlg. (Issue: 8010)
    • [r10308]We allow Flash to popup windows in response to user gesture messages like WM_LBUTTONUP, etc. However (Issue: 7850)
    • [r10316]This make accelerators work in interstitial pages. (Issue: 7056)
    • [r10337]Fix system menu positioning a bit. In Aero glass, the maximized mode menu was going offscreen by one pixel, causing Windows to reposition it strangely. In both frames, the vertical offset below the tabstrip needed a bit of tweaking. (Issue: 7927)
    • [r10338]Allow JS Debugger shortcut to work in fullscreen mode, since there's no reason not to. (Issue: 8023)
    • [r10359]Force the browser to restored mode before going fullscreen, since Windows doesn't seem to want to hide the taskbar for maximized windows regardless of their dimensions. (Issue: 7997)
    • [r10372]Update animations in fullscreen mode to prevent stuck throbbers. (Issue: 8031)
    • [r10382]Set pan cursor hotspots to center (Issue: 6173)
    • [r10431]Fix fullscreen mode opacity issues on Aero glass. We need to not extend the glass into the client area at all in fullscreen mode or text over it becomes semitransparent. (Issue: 8066)
    • [r10456]Fixes Issue 7377: Regression: Omnibox trims URL ending with 0x85 (Issue: 7377)
    • [r10476]Do not map virtual keycodes (VK_0 - VK_9) to characters when accelerators in the UI. (Issues: 8043, 7444)
    • [r10502]Makes it so windows opened from links in Windows Live Messenger cause the window to appear instead of being invisible. (Issue: 3126)
    • [r10565]An attempt at fixing a crasher reported from the field. (Issue: 5549)
    • [r10585]Issue 7318: Popup Titlebar Appears Under Windows Taskbar (Issue: 7318)
    • [r10586]A fix for Issue 4400 (or maybe 4222). (Issue: 4400)
    • [r10631]Fix 8200: Pressing Esc should cancel dialogs, not commit. (Issue: 8200)
    • [r10636]When we open a popup window from an app window, we used to identify this popup window as an app too. (Issue: 5739)
    • [r10663]Workaround for webkit change that broke Gears. The fix is to use a V8 (Issue: 8209)
    • [r10667]Implement the NTLM authentication scheme by porting (Issues: 6567, 6824)
    • [r10773]Resolve crash when deleting history by preventing the deleter from being called multiple times. We need to add UI to make what's happening clearer to the user, but this gets us over the hump for now. Also change the history page to queue deletions.Allow history search from the new tab page.Make history title inclusion safer (createTextNode changes).Show starred status on history page.BUG=8214,8163,8271,8284 (Issues: 8214, 8284, 8271, 8163)
    • [r10777]Make it so that dropdown selects don't deactivate the main frame when openedhttp://crbug.com/8247 (Issue: 8247)
    • [r10787]Fix a crash when installing plugins. (Issue: 8087)
    • [r10824]Implement the PAC js-binding for "myIpAddress()". (Issue: 2764)
    • [r10827]Add a command line flag --v8-proxy-resolver, to select the new PAC implementation. (Issues: 2764, 74)
    • [r10843]Fix error being thrown in isInNet() PAC js. (Issue: 2764)
    • [r10845]Make Chromium windows not hide auto-hide taskbars. (Issue: 20)
    • [r10862]Make New Tab Page work correctly in incognito mode (8294) (Issues: 8271, 8282, 8294)
    • [r10863]* Make the download page focus the input field onload.* Fix spacing between controls (Pause/Cancel).* Help deblock download UI creation (timeout in downloads.html, kMaxDownloads in downloads_ui.cc)* Allow resume for paused downloads (Issues: 8270, 8271, 8130, 8330)
    • [r10864]Show icons for exe files in download manager. Issue was that the paths were coming in with the wrong slash direction and escaping, which was OK for non-exes, but strangely bad for exes. (Issue: 8327)
    • [r10887]Update v8 to version 1.0.3.1 containing a fix for a crash bug in new
    • [r10888]Update V8 again to get a crash fix and a regexp fix.
    • [r10960]Ensure that we display a sad face for a windowed plugin when the plugin process crashes. This was a regression introduced by creating the plugin parent on the browser UI thread, which remains valid when the plugin process crashes. (Issue: 7673)
    • [r10962]Fix a crash in chrome.exe caused by the external tab container instance getting destroyed without (Issue: 1688967)
    Jonathan Conradt
    Engineering Program Manager
    URL: http://googlechromereleases.blogspot.com/2009/03/201680-has-over-150-bug-fixes-new.html

    [Gd] New 3D Cities in Google Earth

    | More

    Official Google SketchUp Blog: New 3D Cities in Google Earth

    Today, Lucerne, Switzerland and Santa Rosa, California joined the growing list of cities and towns that have voluntarily incorporated themselves onto the "3D virtual map" in Google Earth. These cities both submitted 3D models of their downtowns to Google via the Cities in 3D Program. In doing so, they joined others who view Google Earth as an effective way to promote their town to virtual tourists, enable potential businesses to evaluate a new site, and help city planners share design proposals with their communities in a way that we all can relate to: in 3D.
    If you would like to share your 3D data with the world, please contact us. We'd be happy to answer any questions you many have about the process.

    Posted by Bruce Polderman, Sr. Business Product Manager
    URL: http://sketchupdate.blogspot.com/2009/03/new-3d-cities-in-google-earth.html

    [Gd] A shiny new Ruby API site

    | More

    Official Google SketchUp Blog: A shiny new Ruby API site

    The Google SketchUp Ruby API site received a big overhaul this week. In addition to a fresh new look, we updated all of our documentation, examples, and tutorials. If you've ever wanted to play with the Ruby API, now is the time, and getting started has never been easier. If you've never heard of Ruby, check out our FAQ for some high-level details. We would like to extend a big "Thank You" to all of the Ruby developers out there who have contributed to our Ruby documentation wiki in the past.

    We would also like to take this opportunity to mention that the Google I/O Developer Conference is May 28th and 27th in San Francisco, CA. Members of the SketchUp team will be presenting in the What you don't know about Geo APIs can't hurt you session and will also be available during Office Hours. Hope to see you there!

    Posted by Bryce Stout, Product Manager
    URL: http://sketchupdate.blogspot.com/2009/03/shiny-new-ruby-api-site.html

    [Gd] [Libraries][Update] - jQuery UI 1.7.0

    | More

    Google AJAX API Alerts: [Libraries][Update] - jQuery UI 1.7.0

    jQuery UI was updated to version 1.7.0
    URL: http://ajax-api-alerts.blogspot.com/2009/03/librariesupdate-jquery-ui-170.html

    Thursday, March 5, 2009

    [Gd] Experimental Features

    | More

    Google AJAX APIs Blog: Experimental Features

    As part of Tuesday's Google Code Labs announcement, the AJAX Search API became part of the graduating class. We're still working with our lawyerly team members to update our Terms of Use to include a 3-year deprecation policy. If you're curious what that policy will look like, take a look at Section 4.5 of the Visualization API terms -- it will be similar to that.

    You'll see that an exception to the deprecation policy will be features marked "experimental." This label is for experimental features that the deprecation policy does not apply to and therefore they can be changed or removed in the future, even if the deprecation policy applies to the rest of the API. You may have seen in the AJAX Search API reference that we have a few such features already, so we wanted to make sure you knew which ones those were.

    The current experimental features include all of Book Search and the "image type" restriction of Image Search. We've done our best to clearly mark all of these as experimental in the docs.

    As always, please let us know if you have any questions or comments.
    URL: http://googleajaxsearchapi.blogspot.com/2009/03/experimental-features.html

    [Gd] Latest .NET SDK Released! LINQ & New Social Notifier Sample

    | More

    YouTube API Blog: Latest .NET SDK Released! LINQ & New Social Notifier Sample

    Posted by Frank Mantek, Google Data APIs Team

    The new .NET SDK is released and available for download here:

    http://code.google.com/p/google-gdata/downloads/list

    There's now updated support for YouTube V2 and a new vertical object model that allows you to use local LINQ queries. Please go through the Google.YouTube namespaces and see what's new there. We have some documentation for it here:

    http://google-gdata.googlecode.com/svn/trunk/clients/cs/docs/AdditionalContent/YouTubeLinqExamples.html

    Last, but not least, there is the Notifier for YouTube sample application, which showcases the activity feeds YouTube is exposing. You can subscribe to events from your friends and other YouTube users and get notified whenever they leave their marks in the YouTube universe. The sample is also available as a separate download.

    The complete release notes can be found here:

    http://google-gdata.googlecode.com/svn/docs/RELEASE_NOTES.HTML

    which also lists all the bugs that were fixed in this release. Report new ones here:

    http://code.google.com/p/google-gdata/issues/list
    URL: http://apiblog.youtube.com/2009/03/latest-net-sdk-released-linq-new-social.html

    [Gd] Friends, Activites and You - Become a Socialite the .NET Way

    | More

    Official Google Data APIs Blog: Friends, Activites and You - Become a Socialite the .NET Way

    Posted by Frank Mantek, Google Data APIs Team

    The new .NET SDK has been released and is available for download. There are a lot of changes, and among the highlights you will find:

    - Updated support for YouTube V2
    - Support for Google Contacts V2
    - Support for Google Documents List V2

    For those 3 services, there is now a vertical object model that allows you to use local LINQ queries. Please go through the Google.YouTube, Google.Contacts and Google.Documents namespaces and see what's new there. We have some documentation for it here:

    http://google-gdata.googlecode.com/svn/trunk/clients/cs/docs/AdditionalContent/YouTubeLinqExamples.html

    The new Google Document project template in Visual Studio shows you how to retrieve all documents and populate a treeview with those documents. In addition there is a Document List Exporter sample application to showcase the new export functionality of the Google Documents service.

    Last, but not least, there is the Notifier for YouTube sample application which showcases the activity feeds YouTube is exposing. You can subscribe to events from your friends and other YouTube users and get notified whenever they leave their marks in the YouTube universe. The sample is also available as a separate download on the download page mentioned before.

    The complete release notes can be found here, and along with the notes is a list of all of the bugs fixed in this release. To report new bugs, you can go to the .NET library issue tracker.

    Enjoy!
    URL: http://googledataapis.blogspot.com/2009/03/friends-activites-and-you-become.html

    [Gd] Code Conversations Episode 1 - Chris DiBona on Google's Open Source Programs

    | More

    Google Code Blog: Code Conversations Episode 1 - Chris DiBona on Google's Open Source Programs

    By Neel Kshetramade, Google Developer Programs

    "Code Conversations" is a new series of videos intended to film casual conversations with notable Google developers and legends in the technology field. No agenda, no topic... just thoughts. This video is the first episode of this series, in which Chris DiBona, our intrepid open source programs manager talks to Stephanie Liu of the Developer Team about his "sweet goatee" in the Chrome Comic. He also explains why Google open sourced Chrome and Android and why we didn't do it sooner. He also touches on why much of Google's software isn't open sourced.

    Intros:

    Chris DiBona is the open source programs manager at Google, where his team oversees license compliance and supports the open source developer community through the release of open source software projects and programs such as the Google Summer of Code. Before joining Google, Chris was an editor at Slashdot, has edited the books Open Sources: Voices from the Open Source Revolution and Open Sources 2.0: The Continuing Evolution and formerly co-hosted the FLOSS weekly with Leo Laporte. His personal blog is called Ego Food.

    Stephanie Liu is a Programs Manager on the Developer Team here at Google.



    We'll be checking your comments on this post for feedback and ideas for future Code Conversations.
    URL: http://google-code-updates.blogspot.com/2009/03/code-conversations-episode-1-chris.html

    [Gd] Window Backgrounds & UI Speed

    | More

    Android Developers Blog: Window Backgrounds & UI Speed

    Some Android applications require to squeeze every bit of performance out of the UI toolkit and there are many ways to do so. In this article, you will discover how to speed up the drawing and the perceived startup time of your activities. Both these techniques rely on a single feature, the window's background drawable.

    The term window background is a bit misleading however. When you setup your user interface by calling setContentView() on an Activity, Android adds your views to the Activity's window. The window however does not contain only your views, but a few others created for you. The most important one is, in the current implementation used on the T-Mobile G1, the DecorView, highlighted in the view hierarchy below:

    A typical Android view hierarchy

    The DecorView is the view that actually holds the window's background drawable. Calling getWindow().setBackgroundDrawable() from your Activity changes the background of the window by changing the DecorView's background drawable. As mentioned before, this setup is very specific to the current implementation of Android and can change in a future version or even on another device.

    If you are using the standard Android themes, a default background drawable is set on your activities. The standard theme currently used on the T-Mobile G1 uses for instance a ColorDrawable. For most applications, this background drawable works just fine and can be left alone. It can however impacts your application's drawing performance. Let's take the example of an application that always draws a full screen opaque picture:

    An opaque user interface doesn't need a window background

    You can see on this screenshot that the window's background is invisible, entirely covered by an ImageView. This application is setup to redraw as fast as it can and draws at about 44 frames per second, or 22 milliseconds per frame (note: the number of frames per second used in this article were obtained on a T-Mobile G1 with my finger on the screen so as to reduce the drawing speed which would otherwise be capped at 60 fps.) An easy way to make such an application draw faster is to remove the background drawable. Since the user interface is entirely opaque, drawing the background is simply wasteful. Removing the background improves the performance quite nicely:

    Remove the background for faster drawing

    In this new version of the application, the drawing speed went up to 51 frames per second, or 19 milliseconds per frame. The difference of 3 milliseconds per is easily explained by the speed of the memory bus on the T-Mobile G1: it is exactly the time it takes to move the equivalent of a screenful of pixels on the bus. The difference could be even greater if the default background was using a more expensive drawable.

    Removing the window's background can be achieved very easily by using a custom theme. To do so, first create a file called res/values/theme.xml containing the following:

    <resources>
    <style name="Theme.NoBackground" parent="android:Theme">
    <item name="android:windowBackground">@null</item>
    </style>
    </resources>

    You then need to apply the theme to your activity by adding the attribute android:theme="@style/Theme.NoBackground" to your <activity /> or <application /> tag. This trick comes in very handy for any app that uses a MapView, a WebView or any other full screen opaque view.

    Opaque views and Android: this optimization is currently necessary because the Android UI toolkit is not smart enough to prevent the drawing of views hidden by opaque children. The main reason why this optimization was not implemented is simply because there are usually very few opaque views in Android applications. This is however something that I definitely plan on implementing as soon as possible and I can only apologize for not having been able to do this earlier.

    Using a theme to change the window's background is also a fantastic way to improve the perceived startup performance of some of your activities. This particular trick can only be applied to activities that use a custom background, like a texture or a logo. The Shelves application is a good example:

    Textured backgrounds are good candidates for window's background

    If this application simply set the wooden background in the XML layout or in onCreate() the user would see the application startup with the default theme and its dark background. The wooden texture would only appear after the inflation of the content view and the first layout/drawing pass. This causes a jarring effect and gives the user the impression that the application takes time to load (which can actually be the case.) Instead, the application defines the wooden background in a theme, picked up by the system as soon as the application starts. The user never sees the default theme and gets the impression that the application is up and running right away. To limit the memory and disk usage, the background is a tiled texture defined in res/drawable/background_shelf.xml:

    <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/shelf_panel"
    android:tileMode="repeat" />

    This drawable is simply referenced by the theme:

    <resources>
    <style name="Theme.Shelves" parent="android:Theme">
    <item name="android:windowBackground">@drawable/background_shelf</item>
    <item name="android:windowNoTitle">true</item>
    </style>
    </resources>

    The same exact trick is used in the Google Maps application that ships with the T-Mobile G1. When the application is launched, the user immediately sees the loading tiles of MapView. This is only a trick, the theme is simply using a tiled background that looks exactly like the loading tiles of MapView.

    Sometimes the best tricks are also the simplest so the next time you create an activity with an opaque UI or a custom background, remember to change the window's background.

    Download the source code of the first example.

    Download the source code of Shelves.

    URL: http://android-developers.blogspot.com/2009/03/window-backgrounds-ui-speed.html

    Wednesday, March 4, 2009

    [Gd] Giving your GWT Application a Voice

    | More

    Google Web Toolkit Blog: Giving your GWT Application a Voice

    Jason Freeman recently created Piano Etudes, an audio-enabled GWT application integrated with Flash. We're happy to say that Jason had a chance to stop by to talk about the development strategy he used to add audio to Piano Etudes. Check it out below.

    As a faculty member at the Georgia Tech Center for Music Technology, I recently developed Piano Etudes, a musical application built with GWT, along with a student of mine, Akito Van Troyer. Since Piano Etudes is about music, audio was a top priority for us throughout the development process. In this post, I’d like to share what we’ve learned from our experiences with audio and GWT and explain how we implemented audio functionality.

    There is currently no built-in audio support in GWT; nevertheless, it’s fairly simple to add audio to a GWT app. Several audio APIs for GWT exist in various stages of development, including Fred Sauer’s gwt-voices, CodeLathe’s GWT SoundManager, Jeffrey Miller’s gwt-sound, and the sound classes in the GWT Incubator. Most of these libraries in turn rely upon the Flash Sound API instead of the inconsistent audio support found natively in web browsers.

    For Piano Etudes, we found it easier to build our own GWT classes to support the audio features we needed, instead of using one of the APIs listed above. We wrote JSNI methods to access Scott Schiller’s SoundManager2 Javascript Sound API. SoundManager2, which similarly relies upon Flash, is a clean and elegant API that Scott has been fanatically supporting and updating. A couple of the GWT audio libraries also use SoundManager2, though they only support a subset of its API.

    Regardless of how you choose to implement audio in your GWT app, we've discovered a few key principles while working on Piano Etudes that you may want to consider:

    1. Keep your audio code in separate Java classes
    2. Tune your application to avoid timing problems with audio
    3. Identify complex audio rendering and move it from the client to the server when necessary

    Keep your audio code separate

    Because audio support in GWT is rapidly evolving, the API you choose to use today may not be the one you use a year from now. So it’s essential to wrap your audio functionality in your own audio classes. Then if you change implementations later, you’ll only have to tweak a few classes instead of auditing your entire code base.

    For Piano Etudes, we created two GWT Java classes to handle all audio functionality. These are the only classes in our code base that assume a particular audio implementation and are also the only classes that contain JSNI methods.

    One class, called SoundManager, includes static JSNI methods for initializing SoundManager2 and configuring its global parameters.

    For example, Soundmanager.setDebugMode() will enable or disable debugging:

    public native void setDebugMode(boolean b) /*-{
    $wnd.soundManager.debugMode = b;
    }-*/;

    Each instance of our other class, called Sound, represents a single audio file to be played back in GWT. This class wraps methods such as play, pause, stop, getting and setting panning, and getting and setting playback position.

    It was important for us to hide SoundManager2’s implementation details from the rest of our GWT code. Both SoundManager2 and parts of our GWT application code have their own bookkeeping, so there is potential for bad cross usage if the code isn't kept separate. For instance, SoundManager2 requires that an ID string be assigned to each sound object, and it uses that ID in many of its methods. Our Sound class handles this ID string internally and privately. The constructor method generates a unique ID string for each instance of the Sound object:

    public Sound(String fileName) {
    soundID = CustomIDGenerator.getUniqueId();

    // additional initialization code
    }

    The Sound object then uses this ID in other methods. For example:

    public native void stop() /*-{
      $wnd.soundManager.stop(this.@net.jasonfreeman.pianoetudes.client.sound.Sound::soundID);
    }-*/;

    There is no need for any other application code to be aware of this ID string; they are able to use instances of Sound in a more object-oriented, implementation-neutral manner.

    Tune your application for well-timed audio

    In Piano Etudes, the timing of audio events is important. Typically, each measure of moveable music is stored as a separate audio file, so when audio files do not play back at the correct times, there is an audible gap or jump between measures of music. Audio timing is similarly important in applications where sound effects are triggered by user actions or where multiple audio files must play back together in sync.

    Neither Javascript nor Flash are famous for precise timing, so there is an upper bound on timing precision within GWT as well. But there are a few strategies that do improve precision:

    • Optimize GWT code. The performance of your audio code can be affected by sluggish code elsewhere. We use a combination of Java and Javascript profiling tools to isolate hot spots and resolve performance problems. It’s also important to realize that even if your app doesn’t feel sluggish, it may still suffer from performance problems that affect audio. For example: I once found a bug in a conditional statement that had turned O(n) code into O(n2) code. Even though the problem was not noticeably slowing down the GUI widget with which it was associated, it was degrading the timing of audio events.
    • Beware of silent gaps at the beginning and end of MP3 files. These are often created in the encoding process and can cause unwanted delays in audio playback. Use an encoder, such as LAME, that supports a "nogaps" option.
    • Preload your sound files. When timing is important, create your sound objects and load your audio files in advance. If you wait to do so until the moment you are ready to play them, there will be a noticeable delay the first time each sound is played. In SoundManager2, the "autoLoad" flag will force audio files to load in advance.

    Know when it’s time to move server side

    Both Flash and GWT have limited capabilities when it comes to audio. You can play sounds, jump around within sounds, combine them together, query waveform data, and perform other basic tasks. Newer versions of Flash do support some sample-level manipulation of audio data, but it would be tough to use these features from JavaScript or, by extension, from GWT. (In fact, it’s tough to use these features at all in their present form.)

    So what if your GWT app requires advanced audio features such as sample-accurate timing, sound synthesis, digital signal processing, or mixdowns to audio files? You could implement audio functionality in a Java applet instead of through Flash, taking advantage of a Java-based audio API such as JSynJavaSound, or Minim to access additional features unavailable in GWT. But if you’re like me, the headaches associated with Java applets are one of the reasons you’re using GWT in the first place, so that is not an enticing solution.

    Fortunately, there is another alternative: render your audio on the server. This successfully avoids the limitations of client-side systems, though it does introduce other issues related to scalability, latency, and bandwidth. While it’s not a universal solution, it is a valuable strategy for your toolbox.

    Here’s a simple use case: in Piano Etudes, we wanted users to be able to download the music they created as an MP3 file. In GWT and Flash there is no obvious way to render an audio file to disk or to convert it into an MP3. So instead, we handle this task server side.

    When a user clicks a button to download the MP3 of their music, GWT sends a representation of that music to the server; for each audio track, it describes the audio clips in the track and the timings of those clips. We post the data as JSON via HTTP to a PHP script, but this could be done just as easily via any other client-server communication paradigm supported in GWT. Here’s some code for the client side:

    FormPanel mp3Form = new FormPanel("_blank");
    HorizontalPanel panel = new HorizontalPanel();
    Hidden mp3Data = new Hidden("data", timeline.getAsJSON());
    panel.add(mp3Data);
    mp3Form.setWidget(panel);
    mp3Form.setAction(URL.encode(SERVER_SCRIPT_URL));
    mp3Form.setMethod(FormPanel.METHOD_POST);

    This code snippet submits a JSON array to the server representing the audio clips and timings for each track of music. The JSON data is sent as a hidden field in an HTML form. The result obtained from the server (the MP3 file) is returned to a new web browser window, keeping the GWT app open in the current window.

    When the server-side script receives the data from the client, it processes that data to create and run a simple script in a computer-music language called RTCmix. (Classic scripting languages for computer music, such as CSound and RTCmix, are great for rendering audio server-side.) The audio file output by the RTCmix script is then converted to an MP3 using LAME, and that file is returned to the client browser, which downloads it. Here is a simplified excerpt from our PHP script (our entire script is only 100 lines of code):

    // initialize the rtcmix script
    $audio = tempnam("/tmp", "PianoEtude"); // output file
    $script = "set_option(\"AUDIO_OFF\", \"CLOBBER_ON\")\n"; // non-real-time
    $script .= "rtsetparams(44100, 2)\n"; // sampling rate and number of output channels
    $script .= "rtoutput(\"$audio\")\n"; // output to temp file
    $script .= "load(\"" . $CMIX_LIB_PATH . "\")\n"; // library path for rtcmix

    // create an rtcmix command to place each audio clip
    $timeline = json_decode($data);
    foreach ($timeline as $track) {
    $insertPoint = 0;
    foreach ($track as $soundObject) {
        $soFileName = $soundObject[0];
        $soDur = $soundObject[1];
        $script .= "rtinput(\"$soFileName\")\n";
        // insert the audio clip into the output audio file
        $script .= "STEREO($insertPoint, 0, DUR(), 0.5, 0.5, 0.5)\n";
        $insertPoint += $soDur;
      }
    }

    // execute the rtcmix script
    $scriptFile = tempnam("/tmp", "script");
    $handle = fopen($scriptFile, 'w');
    fwrite($handle, $script);
    fclose($handle);
    $cmd = "$rtcmix < $scriptFile";
    $result = shell_exec($cmd);

    // convert to MP3
    $mp3File = tempnam("/tmp", "mp3");
    $cmd = "$lame $audio $mp3File";
    $result = shell_exec($cmd);
    // return result
    readfile($mp3File);

    You can also use client-side and server-side audio together. For example: instead of just having the web browser download this server-generated MP3 file to disk, our GWT app could use a client-side audio API to play it back inside of the app.

    Let your GWT application be heard

    By using a variety of GWT or Javascript APIs to connect with the Flash Sound API, you can add rich audio features to your GWT apps; for more advanced functionality, GWT apps can communicate with a server to render audio remotely. Regardless of the exact implementation(s) you choose, keeping your GWT app optimized and your audio code structurally isolated will ensure that audio performs well in your app and can incorporate future improvements to audio support in the browser

    URL: http://googlewebtoolkit.blogspot.com/2009/03/giving-your-gwt-application-voice.html

    [Gd] Using stats from site: and Sitemap details

    | More

    Official Google Webmaster Central Blog: Using stats from site: and Sitemap details

    Webmaster Level: Beginner to Intermediate

    Every now and then in the webmaster blogosphere and forums, this issue comes up: when a webmaster performs a [site:example.com] query on their website, the number of indexed results differs from what is displayed in their Sitemaps report in Webmaster Tools. Such a discrepancy may smell like a bug, but it's actually by design. Your Sitemap report only reflects the URLs you've submitted in your Sitemap file. The site operator, on the other hand, takes into account whatever Google has crawled, which may include URLs not included in your Sitemap, such as newly added URLs or other URLs discovered via links.

    Think of the site operator as a quick diagnosis of the general health of your site in Google's index. Site operator results can show you:
    • a rough estimate of how many pages have been indexed
    • one indication of if your site has been hacked
    • if you have duplicate titles or snippets
    Here is an example query using the site operator:



    Your Sitemap report provides more granular statistics about the URLs you submitted, such as the number of indexed URLs vs. the number submitted for crawling, and Sitemap-specific warnings or errors that may have occurred when Google tried to access your URLs.

    Sitemap report

    Feel free to check out our Help Center for more on the site: operator and Sitemaps. If you have further questions or issues, please post to our Webmaster Help Forum, where experienced webmasters and Googlers are happy to help.

    Posted by Charlene Perez, Search Quality Team
    URL: http://googlewebmastercentral.blogspot.com/2009/03/using-stats-from-site-and-sitemap.html

    [Gd] Google Code University: New Materials and SIGCSE

    | More

    Google Code Blog: Google Code University: New Materials and SIGCSE

    By Andrea Held, Google Code University

    With SIGCSE kicking off today, we are happy to announce that we pushed a small - but fresh - addition of course materials to Google Code University, a growing repository of open access Computer Science materials. With the credit belonging to Berkeley and UC San Diego, there are now more Distributed Systems materials available which complement some of the other CS resources. As usual, the materials are Creative Commons licensed allowing adaptations and modifications to fit new course designs.

    We'll also be participating and presenting at SIGCSE, so be sure to chat with us if you'd like to contribute course materials, or you're welcome to discuss in the forum.
    URL: http://google-code-updates.blogspot.com/2009/03/google-code-university-new-materials.html

    [Gd] Introducing SketchUp Sages

    | More

    Official Google SketchUp Blog: Introducing SketchUp Sages


    There's a brand-new source of SketchUp salvation on the Interweb, and it's a doozy. SketchUp Sages is a collection of the very best advice from some of the very best SketchUp modelers on the planet. These kind, expert souls have put together a one-stop place to look for all kinds of answers and it's great.

    The site starts with a section that answers the question, "How do I make SketchUp run faster?" ...and it only gets better from there. If you consider yourself a SketchUp enthusiast, you owe it to yourself to visit this site ASAP.

    Posted by Aidan Chopra, SketchUp Evangelist
    URL: http://sketchupdate.blogspot.com/2009/03/introducing-sketchup-sages.html

    Tuesday, March 3, 2009

    [Gd] Test drive data pipelining and OpenSocial templates

    | More

    OpenSocial API Blog: Test drive data pipelining and OpenSocial templates

    OpenSocial v0.9 is coming right along, and we've prototyped some new features so that app developers can try them out. This stage in the iterative process is crucial to ensuring that containers are improving their OpenSocial platforms by adding the features that will make your apps more successful. Make your voice heard, and help improve the OpenSocial spec!

    The first two prototypes to check out are data pipelining and OpenSocial templates. Data pipelining allows you to specify the data you want to use in your app, while templates let you describe how to render the app--all using a markup language (that's right, no JavaScript necessary!). Using data pipelining and templates will reduce the number of round trips between the container and your server, making your app render more quickly. Template values are also HTML-escaped, plugging many XSS vulnerabilities automatically.

    Data Pipelining
    To use data pipelining, add <Require feature="opensocial-data"> to the ModulePrefs in your gadget spec. Then you can specify the data that you want by adding request tags to a <Content> section of your gadget spec. For example, to access the viewer's friends, include a tag like this:
    <script xmlns:os="http://ns.opensocial.org/2008/markup" type="text/os-data">
    <os:PeopleRequest key="friends" userId="@viewer" groupId="@friends">
    </script>
    Note that you set the key attribute in the os:PeopleRequest so that you can access the data returned. You can use the data to render a template (as shown below) or access the data using JavaScript like this: opensocial.data.getContext().getDataSet('friends').

    OpenSocial Templates
    Once you've specified the data you need, you can use a template to display it. To enable templates in your app, include the following tags in your ModulePrefs:
    <Require feature="opensocial-templates">
    <Param name="process-on-server">true</param>
    </Require>
    Now you can add templates that define how to render social data. For example, to access the data specified above and print a list of the viewer's friends, include a template like this:
    <script type="text/os-template">
    <ul>
    <li repeat="${friends}">
    <span class="name" id="id${Context.Index}">${Cur.name.givenName}</span>
    </li>
    </ul>
    </script>
    This example illustrates several special variables in OpenSocial templates:
    • repeat - iterate over the 'friends' object by adding the repeat attribute to the element.
    • Context.Index - an index for the object being repeated.
    • Cur - a reference to the current object. In this case that object is a JSON representation of a person so you can access fields directly.
    These new features are currently available on the orkut sandbox, so you can try them out today. For more information (including a full example), visit the OpenSocial Templates page on the OpenSocial wiki. Once you've had a chance to check it out, please send a note to the spec list -- OpenSocial templates are designed to make app development easier, so let us know if we hit the mark.

    Posted by Lane LiaBraaten, OpenSocial Team
    URL: http://opensocialapis.blogspot.com/2009/03/test-drive-data-pipelining-and.html

    [Gd] Google Code Labs and the SOAP Search API

    | More

    Google AJAX APIs Blog: Google Code Labs and the SOAP Search API

    As recently announced, a new program was introduced today for Google Code Labs. We're proud that the AJAX Search API has already graduated from Labs, which demonstrates our long-term commitment to it.

    Also part of that announcement was that the SOAP Search API will be retired on August 31st, 2009. It was deprecated in 2006, when we stopped accepting new developers for the API. Since then, it's been steadily declining in usage and we believe the majority of use cases are sufficiently handled by the more comprehensive AJAX Search API.

    In many ways, this AJAX API is a superset of the SOAP API, providing access to local, news, image, and video search results, among others, in addition to web search. Therefore, we encourage SOAP developers to explore our documentation and consider migrating their applications.

    Please keep in mind that the AJAX APIs exist for the benefit of end-users; several of their features and usage guidelines are designed with them in mind. For instance, each search performed with the API must be the direct result of a user action. Automated searching is strictly prohibited, as is permanently storing any search results. Please refer to the Terms of Use for more detail.

    And for developers new to the AJAX Search API, don't forget to check out our discussion group, a good resource if you have questions or need more help. Welcome aboard!
    URL: http://googleajaxsearchapi.blogspot.com/2009/03/google-code-labs-and-soap-search-api.html

    [Gd] Introducing Labs for Google Code

    | More

    Google Code Blog: Introducing Labs for Google Code

    Tom Stocky, Director, Google Developer Products

    As Google's developer program continues to grow -- already over 60 APIs and tools on Google Code today -- we credit much of this growth to a culture of exploration and rapid iteration, and to the invaluable feedback and insights we receive from you about each product as it evolves.

    Reflecting this culture, we're pleased to introduce Google Code Labs today as a home for developer products still in their early stages of development. Our hope, of course, is that all of our developer products grow up to be huge successes, but we realize that not every single one will reach that goal. The Labs program offers engineering teams at Google and the developer community a chance to explore ideas and get involved early.

    With that background, we're also announcing that several of our best-known and most-used APIs and tools are among the first set of Google Code Labs "graduates" -- including App Engine, Google Web Toolkit, AJAX Search API, Maps API, Earth API, Calendar Data API, YouTube APIs, and more. See the full list of graduates on the Google Code Labs page.

    For these graduates, we're increasing our commitment with published deprecation policies and other critical support services. The Visualization API terms, Contacts Data API terms, and Picasa Web Albums Data API terms include good examples of transparent deprecation policies. They state that we'll support each version for at least 3 years from when it's deprecated or a newer version is introduced. We're working to get policies posted for the other graduates as well, though the time period may vary a bit from product to product. It will be 3 years for most, but it might be less for some. The AdWords API, for example, has a policy of supporting old versions for 4 months.

    Of course, even established products need a way to experiment with new features. With that in mind, some products will have features labeled "experimental" that could change (or even be removed) at any time, while the rest of the API is covered by a deprecation policy with long-term support.

    There are additional hurdles for an API to graduate from Labs. They include requirements like having a dedicated, ongoing engineering team and comprehensive test suite. We also want to do things like the App Engine System Status Dashboard for more products.

    Finally, we'd like to bid a fond adieu to one of our first developer products, the venerable SOAP Search API. It has been deprecated since 2006, when we stopped accepting new developers for the API, and it's finally hanging up the gloves and retiring on August 31st. It has been steadily declining in usage over the last couple years and we believe that the majority of use cases are sufficiently handled by the more comprehensive AJAX Search API (which supports not only web search, but local, news, images, video, and more). For those interested in migrating, there are more details in the AJAX APIs blog.

    Thank you for making the past five-plus years such a success. We look forward to doing great things together with Google Code Labs and we hope you'll join us in congratulating the new graduates.
    URL: http://google-code-updates.blogspot.com/2009/03/introducing-labs-for-google-code.html

    [Gd] Introducing Labs for Google Code

    | More

    Google Code Blog: Introducing Labs for Google Code

    Tom Stocky, Director, Google Developer Products

    As Google's developer program continues to grow -- already over 60 APIs and tools on Google Code today -- we credit much of this growth to a culture of exploration and rapid iteration, and to the invaluable feedback and insights we receive from you about each product as it evolves.

    Reflecting this culture, we're pleased to introduce Google Code Labs today as a home for developer products still in their early stages of development. Our hope, of course, is that all of our developer products grow up to be huge successes, but we realize that not every single one will reach that goal. The Labs program offers engineering teams at Google and the developer community a chance to explore ideas and get involved early.

    With that background, we're also announcing that several of our best-known and most-used APIs and tools are among the first set of Google Code Labs "graduates" -- including App Engine, Google Web Toolkit, AJAX Search API, Maps API, Earth API, Calendar Data API, YouTube APIs, and more. See the full list of graduates on the Google Code Labs page.

    For these graduates, we're increasing our commitment with published deprecation policies and other critical support services. The Visualization API terms, Contacts Data API terms, and Picasa Web Albums Data API terms include good examples of transparent deprecation policies. They state that we'll support each version for at least 3 years from when it's deprecated or a newer version is introduced. We're working to get policies posted for the other graduates as well, though the time period may vary a bit from product to product. It will be 3 years for most, but it might be less for some. The AdWords API, for example, has a policy of supporting old versions for 4 months.

    Of course, even established products need a way to experiment with new features. With that in mind, some products will have features labeled "experimental" that could change (or even be removed) at any time, while the rest of the API is covered by a deprecation policy with long-term support.

    There are additional hurdles for an API to graduate from Labs. They include requirements like having a dedicated, ongoing engineering team and comprehensive test suite. We also want to do things like the App Engine System Status Dashboard for more products.

    Finally, we'd like to bid a fond adieu to one of our first developer products, the venerable SOAP Search API. It has been deprecated since 2006, when we stopped accepting new developers for the API, and it's finally hanging up the gloves and retiring on August 31st. It has been steadily declining in usage over the last couple years and we believe that the majority of use cases are sufficiently handled by the more comprehensive AJAX Search API (which supports not only web search, but local, news, images, video, and more). For those interested in migrating, there are more details in the AJAX APIs blog.

    Thank you for making the past five-plus years such a success. We look forward to doing great things together with Google Code Labs and we hope you'll join us in congratulating the new graduates.
    URL: http://google-code-updates.blogspot.com/2009/03/introducing-labs-for-google-code.html

    [Gd] Android Layout Tricks #3: Optimize by merging

    | More

    Android Developers Blog: Android Layout Tricks #3: Optimize by merging

    In the previous installment of Android Layout Tricks, I showed you how to use the <include /> tag in XML layout to reuse and share your layout code. I also mentioned the <merge /> and it's now time to learn how to use it.

    The <merge /> was created for the purpose of optimizing Android layouts by reducing the number of levels in view trees. It's easier to understand the problem this tag solves by looking at an example. The following XML layout declares a layout that shows an image with its title on top of it. The structure is fairly simple; a FrameLayout is used to stack a TextView on top of an ImageView:

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <ImageView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"

    android:scaleType="center"
    android:src="@drawable/golden_gate" />

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="20dip"
    android:layout_gravity="center_horizontal|bottom"

    android:padding="12dip"

    android:background="#AA000000"
    android:textColor="#ffffffff"

    android:text="Golden Gate" />

    </FrameLayout>

    This layout renders nicely as we expected and nothing seems wrong with this layout:



    A FrameLayout is used to overlay a title on top of an image


    Things get more interesting when you inspect the result with HierarchyViewer. If you look closely at the resulting tree you will notice that the FrameLayout defined in our XML file (highlighted in blue below) is the sole child of another FrameLayout:

    A layout with only one child of same dimensions can be removed

    Since our FrameLayout has the same dimension as its parent, by the virtue of using the fill_parent constraints, and does not define any background, extra padding or a gravity, it is totally useless. We only made the UI more complex for no good reason. But how could we get rid of this FrameLayout? After all, XML documents require a root tag and tags in XML layouts always represent view instances.

    That's where the <merge /> tag comes in handy. When the LayoutInflater encounters this tag, it skips it and adds the <merge /> children to the <merge /> parent. Confused? Let's rewrite our previous XML layout by replacing the FrameLayout with <merge />:

    <merge xmlns:android="http://schemas.android.com/apk/res/android">

    <ImageView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"

    android:scaleType="center"
    android:src="@drawable/golden_gate" />

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="20dip"
    android:layout_gravity="center_horizontal|bottom"

    android:padding="12dip"

    android:background="#AA000000"
    android:textColor="#ffffffff"

    android:text="Golden Gate" />

    </merge>

    With this new version, both the TextView and the ImageView will be added directly to the top-level FrameLayout. The result will be visually the same but the view hierarchy is simpler:

    Optimized view hierarchy using the merge tag

    Obviously, using <merge /> works in this case because the parent of an activity's content view is always a FrameLayout. You could not apply this trick if your layout was using a LinearLayout as its root tag for instance. The <merge /> can be useful in other situations though. For instance, it works perfectly when combined with the <include /> tag. You can also use <merge /> when you create a custom composite view. Let's see how we can use this tag to create a new view called OkCancelBar which simply shows two buttons with customizable labels. You can also download the complete source code of this example. Here is the XML used to display this custom view on top of an image:

    <merge
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:okCancelBar="http://schemas.android.com/apk/res/com.example.android.merge">

    <ImageView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"

    android:scaleType="center"
    android:src="@drawable/golden_gate" />

    <com.example.android.merge.OkCancelBar
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"

    android:paddingTop="8dip"
    android:gravity="center_horizontal"

    android:background="#AA000000"

    okCancelBar:okLabel="Save"
    okCancelBar:cancelLabel="Don't save" />

    </merge>

    This new layout produces the following result on a device:

    Creating a custom view with the merge tag

    The source code of OkCancelBar is very simple because the two buttons are defined in an external XML file, loaded using a LayoutInflate. As you can see in the following snippet, the XML layout R.layout.okcancelbar is inflated with the OkCancelBar as the parent:

    public class OkCancelBar extends LinearLayout {
    public OkCancelBar(Context context, AttributeSet attrs) {
    super(context, attrs);
    setOrientation(HORIZONTAL);
    setGravity(Gravity.CENTER);
    setWeightSum(1.0f);

    LayoutInflater.from(context).inflate(R.layout.okcancelbar, this, true);

    TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.OkCancelBar, 0, 0);

    String text = array.getString(R.styleable.OkCancelBar_okLabel);
    if (text == null) text = "Ok";
    ((Button) findViewById(R.id.okcancelbar_ok)).setText(text);

    text = array.getString(R.styleable.OkCancelBar_cancelLabel);
    if (text == null) text = "Cancel";
    ((Button) findViewById(R.id.okcancelbar_cancel)).setText(text);

    array.recycle();
    }
    }

    The two buttons are defined in the following XML layout. As you can see, we use the <merge /> tag to add the two buttons directly to the OkCancelBar. Each button is included from the same external XML layout file to make them easier to maintain; we simply override their id:

    <merge xmlns:android="http://schemas.android.com/apk/res/android">
    <include
    layout="@layout/okcancelbar_button"
    android:id="@+id/okcancelbar_ok" />

    <include
    layout="@layout/okcancelbar_button"
    android:id="@+id/okcancelbar_cancel" />
    </merge>

    We have created a flexible and easy to maintain custom view that generates an efficient view hierarchy:

    The resulting hierarchy is simple and efficient

    The <merge /> tag is extremely useful and can do wonders in your code. However, it suffers from a couple of limitation:

    • <merge /> can only be used as the root tag of an XML layout

    • When inflating a layout starting with a <merge />, you must specify a parent ViewGroup and you must set attachToRoot to true (see the documentation of the inflate() method)

    In the next installment of Android Layout Tricks you will learn about ViewStub, a powerful variation of <include /> that can help you further optimize your layouts without sacrificing features.

    Download the complete source code of this example.

    URL: http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-by.html

    Monday, March 2, 2009

    [Gd] Community modeling in Madison, NJ

    | More

    Official Google SketchUp Blog: Community modeling in Madison, NJ

    Madison, New Jersey took a big step towards becoming only the second town in the US to organize a community effort to develop a 3D model of their downtown for Google Earth.

    It all started with Mayor Mary-Anna Holden attending the National Main Street Conference last year. This conference is attended by community leaders from around the country who want to learn about creative ways to promote their downtowns. Google attended the event and presented how McMinnville, Tennessee had used Google SketchUp to model their downtown.

    Attendees, including Mayor Holden, saw the potential that such a model could have on their town and kept asking “How do we do this?".

    In Mayor Holden’s case, the answer rested with the son of her neighbor, a young man by the name of Teddy Bogdanski. Mayor Holden approached Teddy, a Boy Scout, with an idea for an Eagle Scout project, which lead an effort to model Madison.

    Soon after they spoke, I received an email from Teddy asking if Google would be willing to support the effort. How could I decline an Eagle Scout? I replied that we would. A date was established where my colleagues and I would travel to Madison and conduct a short training effort on the use of SketchUp to model for Google Earth.

    With Googlers agreeing to visit his town, Teddy had work to do to ensure that his project was a success. His role was that of a coordinator & project manager, and he did a stupendous job.

    We’d conducted product training before, but not an abbreviated one with a focus on creating textured models for Google Earth. While we did this, Teddy was hard at work collecting volunteers and approval to use his high school computer lab. I’m not sure who had the tougher job: Teddy or us... but I’m pretty sure it was Teddy.

    When we walked into Madison High School early Saturday morning we were greeted by Teddy, his parents, teachers, and 25 volunteers eager to help. It was awesome. We got right to work.

    Aidan Chopra, the author of SketchUp for Dummies, kicked the day off with a short lesson on the basics of SketchUp. Craig D’Andrea from our team followed with a demonstration and instruction on how to apply digital photos to 3D SketchUp models. Within an hour the mice were flying, the keyboards were clicking, and hands were being raised. The three of us spent the remainder of the day providing support to the group.

    Models of downtown began to take shape, and within a few hours a number of models were already completed. Smiles were crossing the faces of those finishing models as they pointed at their screens with pride. Madison was quickly becoming a virtual city.

    Teddy and his group of volunteers have scheduled two subsequent meetings to complete their downtown. We look forward to seeing their models in Google Earth very soon, and wish them the best in their efforts.

    We would like to encourage other towns to follow the lead of these pioneers. If you have questions about how to proceed, please visit the Cities in 3D Program.

    Posted by Bruce Polderman, Sr. Business Product Manager
    URL: http://sketchupdate.blogspot.com/2009/03/community-modeling-in-madison-nj.html