Saturday, May 28, 2011

[Gd] Chrome Developer Tools: Put JavaScript memory under control

| More

Chromium Blog: Chrome Developer Tools: Put JavaScript memory under control

Modern web applications are becoming increasingly complex. To achieve functionality previously only available in desktop applications, they often comprise many frameworks glued together. As a result, memory usage by an application can grow unexpectedly. That’s why it is important to keep memory usage under control from the moment you start building it. In this post, we will cover four tools in Google Chrome that can help you understand how your application makes use of JavaScript memory.
The simplest one is the built-in Task Manager. It is available under > Tools > Task Manager. The “JavaScript memory” column isn't visible by default, but you can turn it on via the context menu [1]:


The numbers are updated in the real time.

If you’d like to visualise memory usage over time, try the Memory Graph of Chrome Developer Tools’ Timeline panel. To start using it, open Developer Tools, switch to the Timeline panel, and click on the “Memory” item. After you start capturing Timeline events, the graph starts updating itself:


The most functional tool in controlling JavaScript memory usage and finding leaks is the new powerful Heap Profiler available in Chrome Dev Channel. To get a heap snapshot, open the Profiles panel in Developer Tools and press the “Take heap snapshot” button:


Snapshots contain every object from the JavaScript heap, so you can explore them in detail and find out how much memory every object of your application consumes. The heap profiler also offers the following features:
  • snapshots diffing
  • grouping objects by constructor
  • calculating retained sizes of objects
  • showing dominators tree
  • revealing paths to GC roots or window objects
In addition, the heap profiler takes into account native DOM nodes, and allows you to uncover DOM-related memory leaks.

It is also possible to measure how much JavaScript memory is currently used from within the page itself. You can sample values from the performance.memory window property at different points of your application lifetime. Please note, that the property does not report anything, unless you run Chrome with --enable-memory-info command-line argument.

For a more complete reference on working with the Chrome Developer Tools heap profiler, check out the tutorial.



[1]: How to invoke the context menu in the Chrome Task Manager:
  • Windows: Right click on any part of the grid;
  • Linux: Right click on the grid itself;
  • Mac: Ctrl+Right click on column headers

Posted by Mikhail Naganov, Software Engineer
URL: http://blog.chromium.org/2011/05/chrome-developer-tools-put-javascript.html

Thursday, May 26, 2011

[Gd] Spring cleaning for some of our APIs

| More

The official Google Code blog: Spring cleaning for some of our APIs


By Adam Feldman, APIs Product Manager

Google I/O is always an exciting time for developers. This year we made 34 separate announcements, including 7 new APIs:
With all of the recent API announcements, our API directory is getting quite long! However, some of our older APIs have been superseded by bigger and better things and others may not be receiving the necessary love.

As the web evolves and priorities change, we sometimes deprecate APIs – that is, remove them from active development – to free up resources and concentrate on moving forward. Today we're announcing a spring cleaning for some of our APIs.

Note that the vast majority of Google APIs are not affected by this announcement.

Following the standard deprecation period – often, as long as three years – some of the deprecated APIs will be shut down. The rest have no scheduled date for shutdown, but won’t get any new features. The policy for each deprecated API is specified in its documentation.
Wherever possible, the documentation includes suggested alternatives designed to help you achieve similar functionality — whether it’s a new version or related offering. We hope these alternatives, along with lengthy deprecation periods, will help minimize the impact and allow us to focus on building great products together.

Adam Feldman is a Product Manager, focusing on all of Google's APIs and making sure Google provides the best possible platform to developers.

Posted by Scott Knaster, Editor
URL: http://googlecode.blogspot.com/2011/05/spring-cleaning-for-some-of-our-apis.html

Wednesday, May 25, 2011

[Gd] Beta Channel Update

| More

Google Chrome Releases: Beta Channel Update

The Chrome Beta channel has been updated to 12.0.742.68 for all platforms.  This release contains a small number of UI updates and performance fixes.  The full list of changes is available in the SVN revision log.  Interested in switching to the Beta channel?  Find out how.  If you find a new issue, please let us know by filing a bug.

Jason Kersey
Google Chrome
URL: http://googlechromereleases.blogspot.com/2011/05/beta-channel-update_25.html

[Gd] Stable Channel Update

| More

Google Chrome Releases: Stable Channel Update

The Stable channel has been updated to 11.0.696.71 for the Macintosh, Windows, Linux and Chrome Frame platforms

Security fixes and rewards:

Please see the Chromium security page for more detail. Note that the referenced bugs may be kept private until a majority of our users are up to date with the fix.

  • [72189] Low CVE-2011-1801: Pop-up blocker bypass. Credit to Chamal De Silva.
  • [$1000] [82546] High CVE-2011-1804: Stale pointer in floats rendering. Credit to Martin Barbella.
  • [82873] Critical CVE-2011-1806: Memory corruption in GPU command buffer. Credit to Google Chrome Security Team (Cris Neckar).
  • [82903] Critical CVE-2011-1807: Out-of-bounds write in blob handling. Credit to Google Chrome Security Team (Inferno) and Kostya Serebryany of the Chromium development community.

The following bugs were fixed:
  • REGRESSION: selection extended by arrow keys flickers on LinkedIn.com. (Issue 83197).
  • Have ConnectBackupJob try IPv4 first to hide potential long IPv6 connect timeout (Issue 81686).
  • Mac plugin crashes are too low in stats (Issue 82172).
  • Incorrect ACLs on the archived copy of setup.exe  (Issue 82424)

If you find new issues, please let us know by filing a bug.
Want to change to another Chrome release channel? Find out how.

Karen Grunberg
Google Chrome
URL: http://googlechromereleases.blogspot.com/2011/05/stable-channel-update_24.html

[Gd] Dev Channel Update

| More

Google Chrome Releases: Dev Channel Update

The Dev channel has been updated to 13.0.772.0 for Windows, Mac, Linux, and ChromeFrame.

All
  • Updated V8 - 3.3.8.1
  • Continued work on Print Preview
  • Making progress on rel:preload
  • Crash fixes
More details about additional changes are available in the svn log of all revision.

 You can find out about getting on the Dev channel here: http://dev.chromium.org/getting-involved/dev-channel.

If you find new issues, please let us know by filing a bug at http://code.google.com/p/chromium/issues/entry

Anthony Laforge
Google Chrome
URL: http://googlechromereleases.blogspot.com/2011/05/dev-channel-update_23.html

[Gd] Chrome OS Beta Channel Update

| More

Google Chrome Releases: Chrome OS Beta Channel Update

The Chrome OS Beta channel has been updated to R12 release 0.12.433.48 including Chrome 12.0.742.60 Beta, new flash player and several stability and functional improvements over the previous release.

In addition to all Chrome 12 new features (see Chrome 12 blogpost), there are several great Chrome OS improvements including:
  • A fix for [Bug 13269] Chat window refuses to open, even if contacts list will
  • Flash 10.2.158.22
  • File Manager context menu
  • Update default avatars and guest icon

No new known issues.

You can find full list of fixes that are in Chrome OS R12 in the chromium-os bug tracker. If you find new issues, please let us know by visiting our help site or filing a bug. You can submit feedback using ‘Report an issue’ under the wrench menu.

Orit Mazor
Google Chrome
URL: http://googlechromereleases.blogspot.com/2011/05/chrome-os-beta-channel-update_23.html

[Gd] How to get from weekend idea to funded startup

| More

The official Google Code blog: How to get from weekend idea to funded startup


By Don Dodge, Developer Advocate

Almost every developer has an idea and might want to start a company. Where do you start? Entrepreneurs Paul Buchheit, Joe Kraus, and Seth Priebatsch explained how to go from hacking on the nights and weekends to building an investor funded startup. We also discussed how to find co-founders, attract investors, and focus on the key decisions. You can watch the complete Google I/O session on YouTube. Here are some highlights.



Should I have a co-founder? Having strong co-founders join you in transforming your idea into a real company is critical to success. There is a positive correlation between the number of co-founders and successful outcomes up to about four co-founders. Beyond four co-founders there isn’t much data. But having more co-founders on your team definitely improves your chances of success.

What are important characteristics of a co-founder? It helps if you have worked together before, know each other well, have complimentary expertise, and can communicate openly and honestly. Joe Kraus said you should be able to settle arguments with great answers, not the compromise middle position. What else should you look for in a co-founder?
  1. Experience starting a company
  2. Domain experience and an understanding of the market
  3. Balance and different experience than your own
  4. Passion about the company vision
How do you get started? Paul Buchheit knew he wanted to start a company but didn’t know how. So, he decided to join a startup to get some experience. That startup was Google. Paul learned how startups grow, and worked with some great people who would later become his co-founders at FriendFeed. Having experience at a startup earns you credibility with potential co-founders, employees, and investors.

What matters most; team, traction, idea, or market segment? They all matter, but the people on the team are the number one consideration. The founding team shapes the product vision and sets the direction for the company. Potential employees and investors are attracted...or not, by the members of the founding team. The idea matters, but will probably change significantly over time, so most investors don’t fixate on the idea. The market segment is important, but only as a gauge of the range of successful outcomes. Traction from early users or customers makes it much easier to raise money.

How do you find investors? People invest in businesses they understand, or people they know. Look for investors that have started companies in your area, or have invested in similar companies in the past. Talk to everyone you know about your idea. Joe Kraus, co-founder of Excite, tells the story of how he read a book about starting companies, called the author, got introduced to other people, who introduced him to other people, and finally ended up with a $3M investment from Kleiner Perkins, one of the top VCs in the world.

Should you raise money from VCs or Angels? The first consideration is who can help you most. You want more than just money from investors. You want help, advice, introductions to other people who can help, and maybe access to press. Aside from help, it depends on how much money you need to raise. Friends and Family is the best place to start to raise small amounts of money. Angel investors can fund anywhere from $100K to $1M or more. Venture Capitalists (VCs) usually invest $1M to $3M in a first round Series A investment.

Incubators, Angels, and VCs - Seth Priebatsch, founder of SCVNGR.com did all three in starting his company. Seth entered a business plan competition at Princeton...and won. He used that to get the initial product built, and then applied to DreamIT, a startup incubator. That experience at the incubator allowed him to build and refine the product. Next he raised a small amount of money from Angels and brought on advisers to help him grow the company. That led to a small round from VCs. Seth believes the more investors you have, the more help, advice, and experience you get.

How do you arrive at a valuation for the company? Joe Kraus says it is an art, not a science. It depends on the stage of the company, the competition, and how fast the market segment is growing. Most early stage startups don’t have revenue and don’t have many users so the valuation is typically between $1M and $3M, and depends on the experience of the founding team, how much progress you have made on the product, and the relative success of competitors. The best way to determine a fair valuation is by having several competing investors give you proposals.

Do I need a business plan? No, but you do need a good slide deck that explains what you want to do, what problem it solves, why it will be successful, and how your team can execute on the vision. Here is a link to a post that explains how to pitch your company to investors. A good pitch deck and a product demo are what most investors are looking for. Business plans might be useful for helping you refine your ideas and vision, but most investors will never read it.

Are patents, IP, and trademarks important? Paul Buchheit says in most cases they don’t matter for early stage startups. Joe Kraus added, patents might be of some value to a potential acquirer, but probably just as a defense against patent infringement cases. Patents are very expensive to obtain (legal bills) and they take two to four years, sometimes longer, to actually get issued. By that time most startups are out of business, acquired, or moving on to something else. Even if you have a patent, most startups can’t afford to defend them in court against potential infringers. The legal expense of defending a patent, and time lost away from your business, make it nearly impossible for a small startup.

Don Dodge is a Developer Advocate at Google helping developers build new applications on Google platforms and technologies. Prior to joining Google Don was a startup evangelist at Microsoft. He is also a veteran of five start-ups including Forte Software, AltaVista, Napster, Bowstreet, and Groove Networks.

Posted by Scott Knaster, Editor
URL: http://googlecode.blogspot.com/2011/05/how-to-get-from-weekend-idea-to-funded.html

Tuesday, May 24, 2011

[Gd] Hacking for humanity in Silicon Valley and around the globe

| More

The official Google Code blog: Hacking for humanity in Silicon Valley and around the globe


By Carlos Cuesta, Developer Marketing Team

Cross-posted with the Official Google Blog

Two years ago representatives from Google, Microsoft, Yahoo!, Hewlett-Packard, NASA and the World Bank came together to form the Random Hacks of Kindness (RHoK) program. The idea was simple: technology can and should be used for good. RHoK brings together subject matter experts, volunteer software developers and designers to create open source and technology agnostic software solutions that address challenges facing humanity. On June 4-5, 2011 we’ll hold the third Random Hacks of Kindness global event at five U.S. locations and 13 international sites, giving local developer communities the opportunity to collaborate on problems in person.


The RHoK community has already developed some applications focused on crisis response such as I’mOK, a mobile messaging application for disaster response that was used on the ground in Haiti and Chile; and CHASM, a visual tool to map landslide risk currently being piloted by the World Bank in landslide affected areas in the Caribbean. Person Finder, a tool created by Google’s crisis response team to help people find friends and loved ones after a natural disaster, was also refined at RHoK events and effectively deployed in Haiti, Chile and Japan.

We’re inviting all developers, designers and anyone else who wants to help “hack for humanity,” to attend one of the local events on June 4-5. There, you’ll meet other open source developers, work with experts in disaster and climate issues and contribute code to exciting projects that make a difference. If you’re in Northern California, come join us at the Silicon Valley RHoK event at Google headquarters.

And if you’re part of an organization that works in the fields of crisis response or climate change, you can submit a problem definition online, so that developers and volunteers can work on developing technology to address the challenge.

Visit http://www.rhok.org/ for more information and to sign up for your local event, and get set to put your hacking skills to good use.



Carlos Cuesta is a Product Marketing Manager in Mountain View, focusing on Google Geo APIs (Maps, Earth, Fusion Tables, and Places). When he's not at work, he spends his spare time hunting down the latest food trucks and street vendors, using Google Maps, of course.

Posted by Scott Knaster, Editor
URL: http://googlecode.blogspot.com/2011/05/hacking-for-humanity-in-silicon-valley.html

Monday, May 23, 2011

[Gd] Making stories with social media and YouTube videos

| More

YouTube API Blog: Making stories with social media and YouTube videos


By Xavier Damman, co-founder of Storify

(Cross-posted from the Google Code blog, where the post is part of Who's at Google I/O, a series of guest blog posts written by developers who are appearing in the Developer Sandbox at Google I/O.)


Storify is part of the Google I/O Sandbox. Please come say hi to find out more about how you can leverage our APIs so your users can remix your content to create stories to share on social networks.

Storify provides a super simple drag and drop user experience to create stories using elements from the web: tweets, YouTube videos, Facebook updates, SlideShare presentations, audioboo files, and so on (see Storify in action here). This post explains how we incorporate videos in Storify using YouTube Data API and Player API. All the code snippets are in JavaScript. In fact, our full stack is in JavaScript: we use NodeJS and MongoDB which we think is an ├╝ber cool mix.


The source of the source

To create a Storify source, we need to be able to get a feed of results using JSONp (basically JSON with a callback function so that you can do cross domain calls; from the YouTube API perspective this is the JSON-C format). For YouTube, the main search API endpoint looks like this:
request: function(formdata) {
return {
'url' : 'http://gdata.youtube.com/feeds/api/videos',
'params': {
'v' : 2,
'max-results' : 20,
'alt' : 'jsonc',
'q' : formdata.keywords
}
};
}
This function is called when the user clicks Submit in the search tab of the YouTube source in the Storify Editor. The main controller executes the request and sends the JSON result to the results method, which returns an array of normalized results:
results: function(json) {

if (json.data && json.data.totalItems && json.data.totalItems == 0) {
throw "No results found";
}

var videos = json.data.items;
var results_array = [];

for (var i = 0; i < videos.length; i++) {
var normalizedResult = {
permalink : 'http://www.youtube.com/watch?v='+videos[i].id,
source : 'youtube',
elementClass : 'video',
metadata : videos[i],
thumbnail : videos[i].thumbnail.sqDefault,
title: videos[i].title,
description : videos[i].description.substr(0,140),
author: {username: videos[i].uploader },
created_at : videos[i].uploaded,
oembed: {html: '<iframe id="youtube-'+videos[i].id+'" type="text/html" width="360" height="294" src="http://www.youtube.com/embed/'+videos[i].id+'?enablejsapi=1&origin=storify.com" frameborder="0">'
}};

results_array.push(normalizedResult);
}
return results_array;
}

Thanks to this normalized representation of a story element – in this case, it’s a video object – we can build an object-oriented story as the user drags and drops any of these elements. This technique has multiple benefits: we maintain attribution to the original content creator, and we can track the content as it spreads across the web (how many times it has been seen and from where).

The story element also provides the oEmbed HTML code. This is used to render the video embed when the video is added to the story. For that purpose we use the YouTube Player API with their new iframe embed.

Story.json

We have a very simple way to get any data out of our platform: just append .json to any storify.com URL and you get the JSON representation of the content of that page.

For example:

Add the Storify Editor to your site

The Storify Editor can be called in an iframe. You just need to provide a callback parameter, like this: http://storify.com/story/new?callback=yoursiteurlcallback. The user will be asked to authenticate with Twitter and then will be able to create a new story. Once the user is done and hits “Publish”, we call you back, passing you the permalink of the new story created:
yoursiteurlcallback?permalink=storyPermalink.

You can then either fetch the JSON of the story by appending “.json” to the storyPermalink or you can embed the story by loading <script src=”storyPermalink.js”></script>. This is a great way to provide your community with a way to create stories right from your site.




This is only the start. We plan to open a Sources API so that any developer can build a source for any service. Please come see us at our booth at the Google I/O Sandbox if you’re interested in joining our developer community. And check out this article in the New York Times to learn more.


Come see Storify in the Developer Sandbox at Google I/O on May 10-11.

Xavier Damman is the co-founder of Storify. He is also the founder of HackDemocracy, a community of hackers who want to improve our democracies using technology.
URL: http://apiblog.youtube.com/2011/05/making-stories-with-social-media-and.html