Friday 30 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Fridaygram: Mandela’s memory, Shuttle farewell, wine surprise

Author Photo
By Scott Knaster, Google Developers Blog Editor

This week the Nelson Mandela Centre of Memory launched its online multimedia archive. This site features a large collection of documents, photos, and videos of and about Mandela, including private letters and diaries covering all periods of his life. The archive is built on Google App Engine and is supported by a grant from the Google Cultural Institute.


Last week we posted about an amazing ride-along video of the Space Shuttle Solid Rocket Booster. Now, as a coda to that, take a look at these words and photos from the Space Shuttle decommissioning process. In their retirement, the Shuttles will eventually go on public display, now that they have completed their service in space.

Finally, if you find yourself relaxing this weekend with a glass of wine, ponder for a moment how you could use that wine to turn ordinary metal into a superconductor. Then go ahead and drink up.


Once a week we post a Fridaygram, featuring cool stuff that has little to do with developer announcements. Each Fridaygram item must pass only one test: it has to be interesting to us nerds.

Localize your apps and content more easily – new formats in Translator Toolkit

By Chris Yang, Product Manager and Haidong Shao, Software Engineer, Translator Toolkit

Cross-posted with the Google Open Source Blog and the Google Translate Blog

At Google, we put a lot of energy into helping localize the world's information to make it more useful to more people. It's not just about localizing our own products – we want to provide tools that make it easy for translators and developers around the world to localize their own apps and content. Google Translator Toolkit is our online translation tool for amateur and professional translators -- it’s built on Google Translate and supports more than 100,000 language pairs.

This week, the Translator Toolkit team has launched support for four new translation-related file formats:

Android Resource (.xml)
Application Resource Bundle (.arb)
Chrome Extension (.json)
GNU gettext-based (.po)

With these new file formats, you can use Translator Toolkit to localize your apps and other products and content much more quickly and easily.

For example, to translate your Android application, go into the res/values directory and upload strings.xml into Translator Toolkit -- Translator Toolkit will now automatically translate it. You can then share your translations with amateur or professional translators, who can localize the text using Translator Toolkit’s WYSIWYG online editor.



When you’re finished, you can export your translated application and store it in a locale-specific directory in Android. Voilà -- easy localization! 翻译起来太方便了!

In addition, we’ve made the Translator Toolkit interface more intuitive for these new file formats so users can translate faster and more accurately. For example, you can turn on ‘Customized colors’ so translators can annotate the edited segments, ‘Number of characters in the segment’ to make sure the text doesn’t run too long (very important for mobile devices), and ‘Synchronized scrolling’ so you can scroll the original and translated text at the same time, which makes navigation much easier.



With these new file formats and UI features, along with the file formats we already support (.aea, .srt, .html), we hope Translator Toolkit can help you reach more users around the world.

When you’re ready, give Google Translator Toolkit a try and suggest any improvements you’d like to see so we can work on making it even better.


Chris Yang and Haidong Shao are on the Google Translation Toolkit team.

Posted by Scott Knaster, Editor

Thursday 29 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

CSS: fast to load, easy to maintain

Josh
Matt
By Matt Atterbury and Joshua Marantz, Pagespeed Automatic Team

Fast web pages are important, but so are maintainable ones. For example, CSS @import helps web designers modularize the implementation of their sites. The drawback to using @import is performance. Each @import is a new HTTP request, and every level of @import costs an additional serial round-trip between browser and server, since the browser does not know the URI of the imported CSS file until it downloads, parses, and executes the file that’s importing it. Here’s a waterfall diagram of a simple HTML page that uses @import to load a CSS file that includes a background image:


Web designers deserve the same benefits enjoyed by programmers, who get to use optimizing compilers and other tools to employ modularity without sacrificing performance. Driving toward this goal, we recently announced mod_pagespeed 0.10.21.2, which supports the new feature flatten_css_imports.

Using this feature, the same web page is automatically optimized by flattening the imported CSS files into their parent. This reduces the number of HTTP requests, and more importantly, the number of serial round trips. In this case, the small background image also got inlined into the combined CSS file, reducing the serial round-trip count by 2:


This feature is especially useful to WordPress users with child themes that override their parent theme (http://codex.wordpress.org/Child_Themes) because that feature uses @imports. But every web page and web user benefits from CSS that’s fast and well-structured, so if you’re an Apache administrator, download mod_pagespeed today and read more on our code site.


Matt Atterbury and Joshua Marantz are Software Engineers on Google’s Pagespeed Automatic team in Cambridge, MA, which is dedicated to making the web faster for everyone. When not coding, Matt is probably on his bike. Josh has been working on making software run fast for several decades, at Google and before that on accelerated chip simulation.

Posted by Scott Knaster, Editor


OAuth 2.0 Playground: new features

Author PhotoBy Nicolas Garnier, Developer Relations

Last November, we launched the OAuth 2.0 Playground, a tool enabling you to easily experiment with the OAuth 2.0 protocol and APIs that use the protocol.

screen shot
The OAuth 2.0 Playground

Since then, we've continued adding new features to improve the developer experience and increase the versatility of the tool.

Below is a list of features that we added since the initial release of the OAuth 2.0 playground.


Support for the OAuth 2.0 Client-side flow

You can now use the playground to experiment with the OAuth 2.0 Client-side flow by simply changing a setting in the OAuth 2.0 configuration dialog. Once set, every subsequent authorization request is performed using the client-side flow, and the playground’s interface and logic adapt accordingly.

screen shot
Setting the OAuth flow type


Support for newer OAuth 2.0 drafts

We have added a setting to change the location of the access token in authorized requests to the APIs. We added support for the authorization header with a Bearer prefix and the access_token URL parameter locations. This makes the playground compatible with most APIs supporting OAuth 2.0 drafts 10 to 25.

screen shot
Setting the access token location


Display available API operations

You can now easily display all the operations that are available using your current access token. After clicking the Find available Request URIs button, the operations along with their associated HTTP Methods and URIs are displayed on the right-hand side. This should help you quickly set up your request to the Google APIs without needing to search through the online documentation.

screen shot
Displaying the available endpoints after being authorized for the Google+ API


Note: the technique used to find the list of operations available given an access token is described in this blog post.


Support for the access_type and the approval_prompt parameters

The playground now also lets you try the new Google-specific settings of the OAuth 2.0 flow: the access_type and the approval_prompt parameters of the authorization request.

screen shot
Setting the access type and whether or not to force the approval prompt


Automatically refresh access tokens

If a refresh token is available, you can enable a feature that will automatically refresh the access token shortly before it expires. This is convenient if you are using the playground for a long time or if you are re-initializing the playground using the deep-link feature.

screen shot
Enabling the access token auto-refresh feature


Selectable links in responses

Clicking any links in an HTTP response will populate the request URI field so that you can quickly and conveniently set up the playground for the next operation.

screen shot
Clicking a link populates the Request URI field


If you have any feedback or would like to get in touch with us, please don’t hesitate to post on the OAuth 2.0 Playground forum.


Nicolas Garnier joined Google Developer Relations in 2008 and lives in Zurich. He is a Developer Advocate focusing on Google Apps and Web APIs. Before joining Google, Nicolas worked at Airbus and at the French Space Agency where he built web applications for scientific researchers.

Posted by Scott Knaster, Editor

Wednesday 28 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Moving the Google+ Hangouts API out of preview

By Amit Fulay, Product Manager, Google+ Hangouts

Cross-posted from the Google+ Developers Blog

One of the most important ways we connect with others is in person. That's why we're so excited about Google+ Hangouts, and why we launched a preview of the Hangouts API a few months ago. Today we're moving this API out of preview, and enabling developers to launch and share their hangout apps with the entire Google+ community!

Hangout apps are regular web apps, running in a big window inside the Hangout UI. In addition to using shared-state APIs to give users real-time interactivity, you also have access to built-in Hangout features, such as:
  • Initiate a group video chat with up to 10 people 
  • Control hangout microphones, cameras, speakers and volume levels 
  • Add sound effects and attach image overlays to faces 
  • Set UI elements such as the video feed, chat pane, and notifications
It’s easy to get started: read the documentation, build and publish your app, and then let users know. You can easily get the word out in one of two ways: 1) post a link to it on Google+, and/or 2) add the new hangout button to your website. In either case, anyone who clicks will start a new hangout with your app running inside. It then appears in the “Recent” apps pane for future hangouts.

To get the ball rolling, we're introducing a new "Apps" pane in Google+ Hangouts, as well as some featured applications, including Aces HangoutCacoo, Scoot & Doodle, Slideshare, Clubhouse Challenge by Bravo, and Google Effects. We’re looking forward to seeing what you can dream up in the weeks and months ahead.

Follow the conversation on Google+, and happy building!


Amit Fulay is Product Manager for Google+ Hangouts.

Posted by Scott Knaster, Editor

The Go project reaches a major milestone: Go 1

By the Go team

the Go Gopher

In November 2009 Google announced the Go project, a new open source programming language. Since then more than 200 outside contributors have made thousands of contributions to the code, tests, and documentation. The open source community has been essential to Go's success.

It is a great pleasure to announce today that the Go project has reached a stable point we are calling Go version 1, or Go 1 for short. Go 1 is the result of months of work refining the specification, improving the implementation, increasing portability and re-working and adjusting the standard library. Go 1 offers compatibility for future growth: programs written to the Go 1 specification will work dependably for years to come even as Go continues to develop.

The benefits of Go 1 are also available to Google App Engine developers, as Go 1 is now the standard Go runtime on Google App Engine.

Go 1 is a consistent, portable, dependable base upon which to build programs, projects, and businesses. To learn more about Go 1, hear what the gophers have to say at the Go blog. For more information about Go in general, visit golang.org, which has documentation, references, articles, and even an interactive tour of the language.


When he's not traveling the world, the Go Gopher lives in Paris with his collection of medals won at international staring competitions. He enjoys "The Wire" and any movies by Werner Herzog.

Posted by Scott Knaster, Editor

Friday 23 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Fridaygram: forests, skies, sunken wrecks

Author Photo
By Scott Knaster, Google Developers Blog Editor

You know Street View as the cool Google Maps feature that gives you a peek at your destinations as you map them out. This week, Street View went off-road – way off, all the way to the Amazon Basin. Instead of streets, the Street View team photographed forests, villages, and rivers. The team used more than 50,000 photos to build the Amazon views, and the scenery is much more beautiful than most streets.

Tributary of the Rio Negro - View Larger Map

Speaking of places where there are no streets, take a look (and a listen) to this video of a day in the life of a Solid Rocket Booster (SRB) during a Space Shuttle launch. The video includes a 720p HD version, and the audio was cleaned up by Skywalker Sound to make it sound its finest.



Finally, check out these photos of the sunken Titanic published by National Geographic. This completes our tour of land, air, and sea. Now you can go and enjoy the outdoors yourself!


Once a week we post a Fridaygram, which has little to do with developer announcements and is just for fun. Each Fridaygram item must pass only one test: it has to be interesting to us nerds. Special congrats to the team at Skywalker Sound for resisting the urge to add anything to the SRB video.

Wednesday 21 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Google I/O registration reminder

Author PhotoBy Mike Fox, Google Developer Marketing Team

This is a friendly reminder that Google I/O 2012 registration is less than one week away! We can’t wait to see who will be joining us at Google I/O. Registration is first come, first served and opens next Tuesday, March 27, at 7 AM PDT / 14:00 UTC. Last year, tickets sold out in less than an hour, so to be prepared, we suggest you sign in to your Google+ account and be ready to pay with
Google Wallet (formerly Google Checkout). And remember that if you can’t make it to San Francisco, you can attend an I/O Extended viewing party, or watch I/O Live from just about anywhere.


image that reads I want a ticket

While you’re waiting for registration to open, play input/output and show your skill and creativity. If you need inspiration, take a look at some of the ingenious machines fellow developers have made. We’ll be showing off some of the best ones at Google I/O - will yours make the cut?


Mike Fox is a member of the Google Developer Marketing Team. When not working on I/O or cloud products he is cheering on his daughter's soccer team at the University of Notre Dame, trying to enjoy his son's dubstep DJ music, or cheering his brother racing in the 24 Hours of LeMons.

Posted by Scott Knaster, Editor

Tuesday 20 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Service Accounts have arrived

Author Photo
By Justin Smith, Product Manager

Starting today, Google supports Service Accounts, which provide certificate-based authentication for server-to-server interactions. This means, for example, that a request from a web application to Google Cloud Storage can be authenticated via a certificate instead of a shared key. Certificates offer better security properties than shared keys and passwords, largely because they are not human-readable or guessable.

Service accounts are currently supported by the following Google developer services:
  • Google Cloud Storage
  • Google Prediction API
  • Google URL Shortener
  • Google OAuth 2.0 Authorization Server
  • Google APIs Console
  • Google APIs Client Libraries for Python, Java, and PHP
Over time, more Google APIs and client libraries will be supported.

This feature is implemented as an OAuth 2.0 flow and is compliant with draft 25 of the OAuth 2.0 specification. An application implements the following steps to authenticate with a Service Account:
  1. Generate a JSON structure.
  2. Sign the JSON structure with a private key, and encode it as a JSON Web Token (JWT).
  3. Send the JWT to Google’s OAuth 2.0 Authorization Server in exchange for an access token.
  4. Send the access token to Google Cloud Storage or the Google Prediction API.
The Google APIs Client Libraries for Python, Java, and PHP wrap these steps into a few lines of code and abstract the error-prone signing and encoding operations from your applications. We strongly encourage you to use these libraries for this type of interaction. We will be expanding support to other client libraries (including Ruby and .NET). Library developers can find the specifics of the protocol in the OAuth 2.0 Service Accounts documentation.

If you’re a Google App Engine developer, all this might sound similar to what is described in these articles: App Engine & Storage, App Engine & Prediction. Service Accounts generalize this App Engine capability by making it available to other server-side platforms. When using another server-side platform, you can create a Service Account through the Google APIs Console. See the Google APIs Console documentation for more information on creating a Service Account.

As always, we welcome and appreciate feedback. Please post any questions or comments to the OAuth 2.0 Google group.


Justin Smith is a Google Product Manager and works on authentication and authorization technologies. He enjoys woodworking, cycling, country music, and the company of his wife and newborn daughter (not in that order).

Posted by Scott Knaster, Editor

Google Cloud Storage adds several highly requested features

Author Photo
By Navneet Joneja, Product Manager

Google Cloud Storage enables you to use our storage and network infrastructure to store and access your data with high reliability, scale and performance. Today, we’re launching several frequently requested new features:

Signed URLs and updated browser uploads

Many of you have asked us for "virtual valet keys" that give limited access to specific data to the bearer for a short time, enabling them to implement application-managed access control for mobile applications, premium content distribution, and so on. You can now implement these applications and more using short-lived signed URLs to address any object stored in Google Cloud Storage. This feature gives your application another powerful tool to control access to any piece of data. You can also use this feature to enable browser-based uploads from your end users to Google Cloud Storage without requiring them to have Google accounts (browser-based uploads were previously limited to the interoperable API). URL signing is implemented using PKCS-12 keys and the industry-standard RSA algorithm and is currently experimental.

Cross-Origin Resource Sharing

We now support configuring storage buckets to return appropriate Cross-Origin Resource Sharing (CORS) headers, which streamlines the development of advanced JavaScript applications (such as browser-based games) using Google Cloud Storage. Other uses include serving web fonts from Google Cloud Storage and enabling trusted JavaScript access from your App Engine applications.

gsutil 3.0

We've been hard at work making gsutil easier to use at all levels. This latest release includes significant enhancements:
  • A refactored, cleaner code-base
  • Better in-tool documentation
  • Easy in-place update to new releases
  • Multithreaded operations
  • A hierarchical file tree abstraction layer that maps more closely to the way traditional file systems are organized.
To try all these features and more, download the latest version of gsutil (zip, tarball). Please note that wildcard and list bucket semantics have changed in gsutil to make the tool easier to use in a broad variety of use cases. You can read all about the latest update in the release notes.

We also recently reduced storage prices across all usage tiers by up to 15%.

As always, we welcome your feedback in our discussion group. If you haven’t tried Google Cloud Storage yet, you can sign up and get started here.


Navneet Joneja loves being at the forefront of the next generation of simple and reliable software infrastructure, the foundation on which next-generation technology is being built. When not working, he can usually be found dreaming up new ways to entertain his intensely curious almost-two-year-old.

Posted by Scott Knaster, Editor

A new home for Google Maps API developers

Author Photo
By Carlos Cuesta, Product Marketing Manager, Google Maps API

Cross-posted with the Google Geo Developers Blog

When we first launched the Google Maps API, it was all about a map, a pin, and a dream. Back then our technical documentation was relatively simple, consisting of a couple of developer docs and some code samples. Since then the Google Maps API has expanded far beyond our expectations, due in large part to the diverse and innovative developer ecosystem that has grown with us.

With the continuing evolution of the Google Maps API, it became clear that we needed more than just code documentation to convey what’s possible with the Google Maps API. Thus, developers.google.com/maps was born.

In addition to having all the same developer content that was previously available on code.google.com, the site is designed to highlight and illustrate new features of the Google Maps API through fun and interactive demos. Our goal with developers.google.com/maps is to inspire the next wave of innovation on the Google Maps API, and to connect developers and decision makers with the tools and services that can make their products better.


One of the features of the Google Developers site we’re most excited about is the 3rd party developer showcase, which allows us to celebrate a selection of innovative sites in the Google Maps API ecosystem. Showcase content is carefully curated by the Google Maps API team.

In order to help users discover relevant apps and topics in the showcase, we’ve devised a tagging system that allows you to filter examples both by theme, and by Google Maps API features used.



We hope that the showcase and the interactive examples on the new Google Maps API Developers capture your imagination and inspire you with what’s possible using the platform. The imagination of Google Maps API developers has always been what makes the product great and we’re looking forward to seeing what you come up with next.


Carlos Cuesta is the Product Marketing Manager for Google Maps API. He also enjoys travelling, photography, and collecting vinyl.

Posted by Scott Knaster, Editor

Friday 16 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Fridaygram: observing origami, beaming neutrinos, getting results

Author Photo
By Scott Knaster, Google Developers Blog Editor

Google provides many different services and products, but the ones I hear about most from my non-technical friends and family are search (of course) and Google doodles. This week’s cool doodle celebrated the work of origami master Akira Yoshizawa, generally recognized as the inventor of modern origami. Yoshizawa worked at a factory before deciding to spend all his time on origami. In a different era, if we were very very lucky, maybe he would have been a doodler and come up with something like this.


From folding paper to folding space: researchers at the Fermi National Accelerator Laboratory used neutrinos to send a message through matter to a detector located 1 km away in a cavern. Because neutrinos rarely collide with other particles, the message was able to pass through the Earth successfully. The team used a binary code to send the word neutrino to the other side. And once again, science fiction becomes fact, sort of.

Speaking of binary code, here’s something you can try over the weekend: on google.com, sign out of your account (temporarily, of course) or click Hide personal results, then search for binary and see how many results you get.


Once a week we post a Fridaygram, in which we take a break from the real news and have some fun. Each Fridaygram item must pass only one test: it has to be interesting to us nerds. And by the way, it looks like we've made another great nerd movie recommendation this week.

Thursday 15 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Sending Nice HTML Email with PHP


We're going to improve that output, and make the email into a nicer looking HTML-formatted email.




It's Not Much Different Than Text Email


Sending HTML Email through PHP uses the exact same mail function as text email:
mail($to, $subject, $message, $headers);

The last parameter, the headers, are optional for the function but required for sending HTML email, as this is where we are able to pass along the Content-Type declaration telling email clients to parse the email as HTML.

In fact, the headers area gives us the opportunity to do lots of important email functions. This is where we can set the From: and Reply To: settings if need be, as well as CC and BCC other recipients (Hey, a checkbox for CC'ing yourself would be a cool feature to add!). Here is the code used for the new and improved HTML-Sendin' Website Change Request Form:
$to = 'bob@example.com'; $subject = 'Website Change Reqest'; $headers = "From: " . strip_tags($_POST['req-email']) . "\r\n"; $headers .= "Reply-To: ". strip_tags($_POST['req-email']) . "\r\n"; $headers .= "CC: susan@example.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

Now We Can Use HTML Tags


The message parameter (a big string we pass to the mail function with the body of our email), can now have HTML tags in it. For example:
$message = '<html><body>'; $message .= '<h1>Hello, World!</h1>'; $message .= '</body></html>';

Here is whole shebang, to create the table of data as shown above:
$message = '<html><body>'; $message .= '<img src="http://css-tricks.com/examples/WebsiteChangeRequestForm/images/wcrf-header.png" alt="Website Change Request" />'; $message .= '<table rules="all" style="border-color: #666;" cellpadding="10">'; $message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" . strip_tags($_POST['req-name']) . "</td></tr>"; $message .= "<tr><td><strong>Email:</strong> </td><td>" . strip_tags($_POST['req-email']) . "</td></tr>"; $message .= "<tr><td><strong>Type of Change:</strong> </td><td>" . strip_tags($_POST['typeOfChange']) . "</td></tr>"; $message .= "<tr><td><strong>Urgency:</strong> </td><td>" . strip_tags($_POST['urgency']) . "</td></tr>"; $message .= "<tr><td><strong>URL To Change (main):</strong> </td><td>" . $_POST['URL-main'] . "</td></tr>"; $addURLS = $_POST['addURLS']; if (($addURLS) != '') { $message .= "<tr><td><strong>URL To Change (additional):</strong> </td><td>" . strip_tags($addURLS) . "</td></tr>"; } $curText = htmlentities($_POST['curText']); if (($curText) != '') { $message .= "<tr><td><strong>CURRENT Content:</strong> </td><td>" . $curText . "</td></tr>"; } $message .= "<tr><td><strong>NEW Content:</strong> </td><td>" . htmlentities($_POST['newText']) . "</td></tr>"; $message .= "</table>"; $message .= "</body></html>";

I think that looks A LOT nicer. And since this email is (theoretically) coming directly to you, isn't it nice to know that it will be formatted to be easy on the eyes?

Concerns


Some people just absolutely hate HTML email. For one, it can be a security risk as it's possible to run JavaScript in them in some email clients which can be problematic. HTML emails also have a habit of being more easily caught in Spam filters. I think it's less of a concern here as this email is essentially being created BY you FOR you.

-By Parthiv Patel

Tuesday 13 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Five things you didn’t know about Google I/O 2012

Author Photo
By Monica Tran, Google I/O Team

If you were following +Google Developers this morning, you’d already know that:
  1. Registration will be first come, first served on March 27th at 7 AM PDT / 14:00 UTC.
  2. Rooms at the W Hotel are currently going for $279. Limited time offer, while supplies last.
  3. Code Labs have graduated from Bootcamp and will now be incorporated into our 3-day agenda.
  4. This year’s After Hours theme is Carnival 2112.
  5. Real-time transcription (CART) will be provided live during the keynote and some breakout sessions.
That’s a lot to take in all at once, so to make it easier on you, we’ve consolidated everything you need to know about Google I/O 2012 at developers.google.com/io.

And because we know 105 days is a long time to wait, we’ve built a little game called input/output to help you pass the time. The objective is simple: use the tools and machine parts to create a Rube Goldberg-inspired machine that moves a particle from the <input> to the </output>. Then, share your machine on Google+ using #io12. Build well and you won't lose your marbles — build a machine of epic design and your creation could be featured at Google I/O 2012.


Whether you’ll be joining us in San Francisco, at an I/O Extended viewing party, or on I/O Live from the comforts of home, be sure to bookmark our Google I/O website to make the most of your 2012 experience. More details about the 3-day program, session schedules, and Developer Sandbox will come in the following months.


Monica Tran leads marketing for Google I/O and broader developer marketing programs at Google.

Posted by Scott Knaster, Editor

Meet the web platform again for the first time

By Alex Komoroske, Product Manager

Cross-posted with the Chromium Blog

A few weeks ago one of my developer friends was gushing about the capabilities of his favorite native platform. After every point I felt obliged to point out that the web platform either already had or was actively developing precisely the same capabilities—and then some. He was incredulous. "Prove it," he said.

So I pulled together a few of my favorite examples from the cutting edge of the web platform and recorded three screencasts to help my friend—and others—meet the web platform again for the first time.

The first video, Building on Foundations, goes over how the web platform has been fixing various historical shortcomings and building upon its core strengths, like complicated graphical effects, composability, and advanced text layout.



The next video, Learning from Other Platforms, reviews how the web platform offers new capabilities inspired by successes on other platforms with things like push notifications, payment APIs, and web intents.



The last video, On the Cutting Edge, demonstrates some of the new tricks the web platform is learning, like webcam access, powerful audio APIs, and complicated 3D graphics.



If you're interested in learning more about the technology behind any of the demos, check out the Meet the Web Platform companion guide.

I hope these videos capture your imagination and begin to show what is possible on the web platform. The web platform is evolving at an enormous pace, and I just can't wait to see where it goes next!


Posted by Scott Knaster, Editor

Friday 9 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Fridaygram: Colossus revealed, risk-taking bees, super attire

Author Photo
By Scott Knaster, Google Developers Blog Editor

The world’s first programmable computer was Colossus, built in England in 1943. During World War II, Colossus was used to break codes at the UK’s famed decryption center at Bletchley Park. With a little help from its friends, Bletchley Park was recently saved from destruction, and many of its historic sites are now being restored. This week, a gallery dedicated to Colossus opened at the National Museum of Computing, housed at Bletchley Park.

rebuilt Colossus
Colossus rebuilt. You can see it at The National Museum of Computing in the UK.
Reproduced with kind permission of The National Museum of Computing.

Even many years after the war, Colossus was kept secret. Another big secret, just discovered, is about honeybees: they’re not all alike. Researchers have found that some worker bees seem to be more interested than others in novel behaviors such as finding a new home for the hive. (Let’s call these the startup bees.) Scientists studied the genetic foundation for varying behaviors, and using chemical treatments, they were able to change whether bees were likely to display this “novelty-seeking” behavior.

Speaking of novelty, if you happen to be in Knoxville, Tennessee any time in March, you can check out some knitted superhero costumes on display at the University of Tennessee at Knoxville's Ewing Gallery. They’re perfect for wearing to your favorite upcoming superhero movie.


Ludicrous transitions are just part of the fun here at Fridaygram, where we take a break from the real news once a week. Each Fridaygram item must pass only one test: it has to be interesting to us nerds. By the way, the main topic of today’s post has no connection to this amazing movie, which features a great performance by Paul Frees (uncredited, of course).

Google Prediction API 1.5 adds enumeration, analysis, and more

Author Photo
By Marc Cohen, Developer Relations

The Google Prediction API Team has been hard at work on Release 1.5, which is available now, with the following new features:
  • Model enumeration. We’ve added the ability to list all of your models via the trainedmodels.list request. You can obtain the entire list in one response or you can iterate through a large listing in pieces using the maxResults and pageToken options.

  • Model analysis. We’ve added the ability to obtain more detailed information about data and models via the trainedmodels.analyze request, which returns information about the trained model’s output values, features, confusion matrix, and other information.

  • Simplified get method. We’ve simplified the output returned by the trainedmodels.get request. Model analysis data that previously was returned by a get request (e.g. the confusion matrix), is now returned by the new analyze request, along with additional analysis data. The get response now returns a simpler model description along with new timestamps indicating when the model was inserted and when model training completed, which should make it easier to keep track of model lifecycle.

  • New Google App Engine samples. We’ve created two new sample apps illustrating how to use the Prediction API from App Engine, coded in Python and Java. These samples show how to create and manage shared server OAuth 2.0 credentials, and how to make predictions on behalf of any site visitors using the shared server credentials. The sample code is available here and a live version of the sample app is available here: http://try-prediction.appspot.com.
You can read more about the API details here. The new release is available now via the HTTP RESTful interface and our various language-specific client libraries. You can also experiment with the new Prediction API 1.5 interactively via the Google APIs Explorer.

We’re always looking for ways to improve the Prediction API so, as always, please let us know about any problems or feature suggestions you might have. Happy Predicting!


Marc Cohen is a member of Google’s Developer Relations Team in Seattle. When not teaching Python programming and listening to indie rock music, he enjoys using the Google Prediction API to peer into the future.

Posted by Scott Knaster, Editor

Thursday 8 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Introducing Page Speed mobile analysis, on Google Chrome for Android

Matthew
Libo

By Libo Song and Matthew Hillyard, Software Engineers

Nearly a year ago, we launched Page Speed for Chrome, which has enabled Chrome users to get Page Speed performance suggestions to make their desktop sites faster. Today, we are releasing an update to Page Speed for Chrome that supports mobile Page Speed analysis via Chrome for Android. With Page Speed for Chrome and Chrome for Android, you can perform Page Speed analysis on the mobile version of your web pages, as they are loaded in the Chrome for Android mobile browser.

Many web sites serve mobile-specific versions of their pages. Often, the mobile pages have very different Page Speed scores and Page Speed reports from their desktop counterparts. Page Speed on Chrome for Android makes it easy to analyze both the desktop and mobile versions of your web pages, so you can be sure that your pages load faster for the users of both your desktop and mobile sites.

When analyzing the mobile version of pages, Page Speed for Chrome tunes its analysis to reflect the unique performance characteristics of mobile devices and networks, suggesting the optimizations that will have the biggest impact on reducing load times for your mobile users. Using the powerful Chrome Developer Tools Extension APIs, Page Speed for Chrome can identify renderer performance optimizations that are especially relevant on mobile, such as removing unnecessary reflows and finding long-running scripts that slow down your pages. Page Speed for Chrome will also automatically minify and optimize your HTML, JavaScript, CSS, and image files and make them available for you to download, so you can easily deploy them on your web server.

To get started using Page Speed on Chrome for Android:
  • Follow the instructions to install the Page Speed for Chrome extension on your desktop Chrome browser.
  • Enable remote debugging in Chrome running on your Android device.
  • Navigate to the remote Chrome Developer Tools page in your desktop browser (localhost:9222) .
  • Select one of the Chrome tabs running on your Android device.
In addition to the full Chrome Developer Tools, you will see Page Speed in the Developer Tools panel. Click the Page Speed icon to switch to the Page Speed tab, then click Run Page Speed to generate mobile Page Speed suggestions for the web page that’s loaded on your Android device.


Page Speed screen shot

We hope you’ll give Page Speed for Chrome on Android a try. Please send us feedback via our discussion list and let us know what features you’d like to see us to add next. You may also be interested in watching our recent Google I/O talk on Page Speed performance best practices for mobile web sites.


Libo Song is a software engineer at Google Boston working on the Page Speed team to make the web faster.

Matthew Hillyard worked on the Page Speed team as an intern. He has since graduated with a Master’s degree in computer science from Johns Hopkins University and currently is a software engineer on the Google+ team.

Posted by Scott Knaster, Editor

Wednesday 7 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Join us in London for an OpenID Workshop

Author Photo
By Eric Sachs, Senior Product Manager, Google Identity Team

UPDATE (March 7): Following our post two weeks ago, this event sold out almost immediately. To accommodate more people, the event has been moved to a larger room at Microsoft’s offices in London. For more details on agenda, speakers, location, and registration, please visit the event site.


The OpenID Foundation is hosting an OpenID workshop on March 28th that will be located at Google’s London office (UPDATE: moved to Microsoft’s London office). Google uses OpenID in a number of its services, and is a corporate member of the OpenID Foundation. The OpenID Foundation runs a series of workshops like this one for business decision makers, as well as running other OpenID summits that are more technical.

The event is for the owners of consumer websites and enterprise SaaS services to discuss how to improve login systems by using techniques such as OAuth, OpenID and an Account Chooser.

Please join us in London on Wednesday, March 28th, 2012 from 10:00 until 17:30 GMT. For more details on agenda, speakers, location, and registration, visit the event site.

In addition to the OpenID workshop, there is a similar event the previous day on identity security best practices, hosted by Ping Identity and sponsored by Google.


Eric Sachs has been a product manager at Google since 2003. He is now involved with industry efforts to increase adoption of Internet Identity standards including OAuth and OpenID.

Posted by Scott Knaster, Editor

Tuesday 6 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

How To Find The Current URL In PHP

In your valiant conquest of the web development industry, you will notice that some scripts will require that you know the current URL the user is browsing to provide certain services. A prime example would be in user management- where we make use of query strings to keep track of users. More practical solutions may even demand that we find the current URL to display relevant ads and increase conversion rates.

PHP has set forth certain global variables that makes this process painfully easy. We will be experimenting with several methods of finding certain parts in the URL within this tutorial. Respectively, they are:

  1. Finding the current domain

  2. Finding the path to the script

  3. Finding the query string (if any)

  4. Using a special short cut method to tie things together

Finding The Current Domain In PHP


If you need the current domain, you can use this neat little snipped below:
<?php
# Using HTTP_HOST
$domain = $_SERVER['HTTP_HOST'];
echo $domain;
?>

If we were to use this directly on this page, the output would be learnphponline.com – notice that it does not include the ‘http://’ or ‘www.’ prefixes. If you are trying to make a link, you could do so by concatenating these prefixes onto the HTTP_HOST server variable.

Finding The Path To The Current Script


If you need to link to the current page, we use the SCRIPT_NAME server variable. We see this in use a lot more than you would think. WordPress installations will link article titles to the same page for several reasons. First, it keeps things user friendly- but it is also great for search engine optimization. Don’t be afraid to follow their example such as the snippet below shows.
<?php
# Using SCRIPT_NAME
$path = $_SERVER['SCRIPT_NAME'];
echo "Path To Script Example: <a href='$path'>An Article Title</a>";
?>

You will notice that the domain section and query string is left out. Instead we get the script path that links nicely to the current page.

Finding The Query String In a URL


The query string is important in passing variables or authorization information across several different pages in your website. You have probably noticed this before when logging into your favorite website and seen something to this effect: “TheWebsite.com/users/index.php?name=YourName”

Making a query string is actually quite easy. Make a simple PHP file and create a link to the current file, yet concatenate a ternary symbol and assign a variable like this:

  • <a href=’www.yoururl.com/index.php?variable=value’>Test it!</a>


This won’t do anything since we haven’t coded anything to work with the variable. But it will allow us to test the server variable below.
<?php
# Using QUERY_STRING
$queryString = $_SERVER['QUERY_STRING'];
echo "Query: " . $queryString;
?>

Finding The Current URL With Request URI


If you are using MOD REWRITE to make your URLs more user-friendly, there is still a way to get the original URL. By using the REQUEST_URI server variable, we can get the URL given to access the page. So be definition, we bypass any rewrite rules.
<?php
# Using REQUEST_URI
echo "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
?>
This saves a little bit of space over the previous examples, since REQUEST_URI can replace the script path and query string server variables. This is best used when you don’t need these variables separated, which you commonly do.

Monday 5 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

1-up for web games

Author Photo
By David Glazer, Engineering Director, Google+

Hundreds of millions of users are already having fun playing games on the web. With GDC going on this week (#googlegdc), we wanted to give you an update on our efforts to improve the web ecosystem for game developers.

New technology capabilities

With HTML5, WebGL, and WebRTC, the browser has evolved into a feature-rich gaming platform. We are working closely with all browser vendors to further improve the web’s capabilities with new HTML5 APIs such as Gamepad, Mouse Lock, and Fullscreen.

Native Client (NaCl), a technology that enables console quality games in the browser, is also gaining traction. Starting today, the BlitzTech Gaming engine and the Havok Physics Engine have announced NaCl support, complementing a rich ecosystem of game middleware. Some of the latest games that take advantage of NaCl’s capabilities are Zombie Track Meat, Eets Munchies, Go Home Dinosaurs, Dark Legends, Air Mech, and Ubisoft’s From Dust. You can see an early preview of them at our GDC booth.


Improved distribution and monetization

Using social information in game play allows users to connect in more meaningful ways and developers to build even more compelling games. Google+ games continues to grow and attract exciting new games, including the exclusive launch of the epic fantasy title Kingdom Age last week. To help social game developers reach more users globally, all Google+ games will soon be available in the Chrome Web Store, providing an audience of hundreds of millions of users.

In addition, our In-App Payments solution recently added support for more currencies and optimized the payment flow to enable higher conversions.

Visit us at GDC and on the web

To get started working with us, you can now access a new site, developers.google.com/games, that pulls together all our technologies to help you build, distribute, promote, and monetize your games. And for those of you attending GDC this week, stop by our developer day and our booth. We are looking forward to continuing our collaboration with the gaming community and bringing the best games to hundreds of millions of Internet gamers.


David Glazer, Engineering Director for Google+ .

Posted by Scott Knaster, Editor

Friday 2 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Fridaygram: open source mentors, robotic fish, cooperative children

Author Photo
By Scott Knaster, Google Developers Blog Editor

Google Summer of Code, now in its eighth year, is a wonderful program that releases eager university students onto open source projects. To help participants succeed, the program connects students with mentors to guide them on their open source way.


Google Summer of Code wouldn’t work without a great bunch of mentors, and the program is now accepting applications from open source projects that want to provide mentors to participants. If you’re involved in an open source project, this is an excellent way for you to find and teach new developers, and of course to get them interested in your project in particular. The deadline for mentor applications is March 9, which is next Friday, so if you’re interested, don’t delay.

All Google Summer of Code mentors are required to be human for now. But experimenters are looking into what it takes for a robot to be a leader – of fish. To test their ideas, researchers at Polytechnic Institute of New York University built a robotic fish. By varying the way its tail moved and the speed of its swimming, the scientists were able to get their robot to assume a leadership role, with other fish swimming behind.

Finally, if science fiction movies have you concerned that humans might someday lose their leadership status to other primates, you can take comfort in a study that showed human children working together, while chimps and monkeys didn’t share tasks at all. In fact, adult non-humans didn’t even help their young: one of the study’s authors said that parents simply stole their offspring’s food. So, go humans!


On Fridays we (mostly) take a break from the real news and do a Fridaygram post just for fun. Each Fridaygram item must pass only one test: it has to be interesting to us nerds. We’re happy to have you reading Fridaygram, whether you’re human, ape, robotic fish, or other.

Thursday 1 March 2012
Facebook StumbleUpon Twitter Google+ Pin It

Making it even easier to monetize your games

By Peng Ying, Developer Advocate

(Cross-posted on the Google Commerce Blog)

As any merchant knows, the easier the path to purchase, the more likely the sale. That’s why the In-App Payments team is dedicated to developing a simple, yet intuitive API that makes the in-app purchase experience effortless for your customers -- leading to a higher conversion rate for you. Over the last few weeks, we’ve made some improvements to the API that we wanted to share:

Additional Currencies Accepted
With the recent international expansion of In-App Payments, we’ve expanded the types of currencies accepted so you can sell your goods in your customer’s native currency. If you’ve set up shop in the United Kingdom but your customer base is mostly in Japan, you can specify prices for your good in Japanese Yen and Google automatically handles currency conversion for you.

As of today, the supported currencies for In-App Payments are:


To use a different buyer currency, just specify the currency code in the JWT request:

   "request" => {
      "name" => "Piece of Cake",
      "description" => "Virtual chocolate cake to fill your virtual tummy",
      "price" => "1000",
      "currencyCode" => "JPY",
      "sellerData" => "user_id:1224245,offer_code:3098576987,affiliate:aksdfbovu9j"
   }



Card Details Minimized
In order to purchase through In-App Payments customers must first create a Google Wallet account, but entering payment information can be cumbersome. So, we’ve cut the amount of information that your customer has to enter when adding a new credit card to their Google Wallet. Now customers in many countries only need to specify their postal code instead of a full address, making the experience of creating or updating a Google Wallet quick and painless.


Terms of Service in Context
We’ve incorporated the Terms of Service into the purchase confirmation page to reduce the number of pages a new Google Wallet user sees before completing a purchase. This means that your new customers can easily review the Terms of Service and get to enjoying their items faster.






If you have any questions about Google In-App Payments, please reach out to us in the forum. We’ll also be hosting a regularly scheduled Google+ Hangout the first and third Thursday of every month at 9 a.m. PST to answer any technical questions about implementation of the API or about these new updates.

Stay tuned as we have plenty of new features to be released in 2012. Happy monetizing!


Posted by Scott Knaster, Editor