Friday, February 13, 2009

[Gd] Upcoming AJAX panel - JQuery, Dojo, YUI, GWT, and MooTools at the Googleplex

| More

Google Web Toolkit Blog: Upcoming AJAX panel - JQuery, Dojo, YUI, GWT, and MooTools at the Googleplex

Community meetups are a great way to meet new people with similar passions and interests as your own. It's also a great place for the community to exchange ideas. Often you get an interesting presentation to boot.

In fact, for those of you interested and within reasonable traveling distance, the Silicon Valley JavaScript meetup group has organized an exciting AJAX Panel next week on February 18th 2009. There will be representatives there from YUI, Dojo, MooTools, JQuery and of course GWT. There's a lot of interest, so be sure to sign up before the event fills up.

I've also been talking with the SV-GTUG (Silicon Valley - Google Technology User Group) organizers about doing a GWT presentation at an upcoming meeting. We don't have a firm date yet, but I'd like to start collecting your questions and suggestions for material you'd like to see covered. You can vote on other people's ideas or post your own questions here.

Finally, if you know about or organize a local user group that has developers interested in GWT, let me know. I'd like to hear about your group, and perhaps there's a way we can help make your meetings even more compelling.


[Gd] Web App Wednesday, Mashup, Backup, and Decay

| More

Google App Engine Blog: Web App Wednesday, Mashup, Backup, and Decay

Posted by Jeff Scudder, App Engine Team

Michael Bernstein is doing something I find very interesting. Not only is he creating applications on App Engine, he creates a new one every Wednesday. His site, appropriately named Web App Wednesday, is where he is creating a new web application every Wednesday, starting first with the site itself, followed by F/OSS License Info, a single-page site that displays information about the most common Open Source software licenses. Another recent app, LinQR , is a URL shortening service and QR code generator. Good luck to Michael and we look forward to seeing what he comes up with next Wednesday.

If you're doing something cool with App Engine please let us know! We'd love to highlight it here on the blog or even have you write up an article explaining what you've done, like this new article from Omar Abdelwahed on Creating a Facebook App with Google App Engine and Best Buy Remix.

Speaking of articles, Aral Balkan has written an article on his backup and restore utility and our own Joe Gregorio published an article on a design for popularity ranking using voting and time-based decay.


[Gd] Android Market update: support for priced applications

| More

Android Developers Blog: Android Market update: support for priced applications

I'm pleased to announce that Android Market is now accepting priced applications from US and UK developers. Developers from these countries can go to the publisher website at to upload their application(s) along with end user pricing for the apps. Initially, priced applications will be available to end users in the US starting mid next week. We will add end user support for additional countries in the coming months.

We will also enable developers in Germany, Austria, Netherlands, France, and Spain to offer priced applications later this quarter. By the end of Q1 2009, we will announce support for developers in additional countries. Developers can find more information about priced applications in Android Market at

Google Checkout will serve as the payment and billing mechanism for Android Market. Developers who do not already have a Google Checkout merchant account can easily sign up for one via the publisher website.

Also, Android Market for free applications will become available to users in Australia starting February 15th Pacific Time and in Singapore in the coming weeks. Developers can now make their applications available in these countries via the publisher website at

We look forward to seeing more great applications on Android Market.


Thursday, February 12, 2009

[Gd] The sky's (almost) the limit! "High CPU" is no more.

| More

Google App Engine Blog: The sky's (almost) the limit! "High CPU" is no more.

Posted by Pete Koomen, App Engine Team

We're very excited today to announce that we've raised limits on several App Engine operations:

  • No more "High CPU Requests"! App Engine Apps were once allowed no more than 2 CPU-intensive requests per minute. We've made some adjustments to the way we handle requests, and have eliminated this limitation altogether. To learn more about how this works and the implications for your app, see our documentation.

  • Response deadline raised to 30 seconds. The amount of time an App Engine app can take to respond to an incoming request has been raised from 10 to 30 seconds! There are limits on the number of simultaneous active requests an application can process at any given moment--see our docs to learn more.

  • Size limits on code files, static files, and requests/responses raised to 10MB! App Engine apps can now receive requests and send responses of up to 10MB in size, and users can upload 10MB code and static files as well. Note that API requests (e.g. memcache.set(), db.put()) are still limited to 1MB in size.

These changes were inspired and driven by a great deal of developer feedback, and we're not done! Please let us know what you'd like to see next on App Engine in our Google Group!


[Gd] Tour 3D models in the new Ocean layer

| More

Official Google SketchUp Blog: Tour 3D models in the new Ocean layer

For the exciting release of Google Earth 5.0, the Google SketchUp team built a series of 3D models to highlight the new Ocean layer. Google Earth 5.0 now allows you to navigate under the surface of the sea and explore the ocean floor to see shipwrecks, submarines, buoys, and much more. We've put together a placemark tour to help easily find the 3D models in the ocean. To access the tour, download the kml file from the Google Earth Gallery page. The tour will visit models such as the Titanic, Batttleship Bismark, Aquarius underwater laboratory, as well as other submarines, shipwrecks, and dive destinations. Please make sure you have the latest version of Google Earth 5.0 and the 3D Buildings layer is turned on.

You can also find these models in the Google Earth - Ocean Layer collection in the Google 3D Warehouse. The SketchUp team added over 80 3D models to the 3D Buildings layer including models of NOAA moored buoys taking wind, wave, meteorological, and oceanographic measurements around the coasts of the United States.

Posted by Adam Hecht, 3D Data Specialist

[Gd] Track memory allocations

| More

Android Developers Blog: Track memory allocations

Despite the impressive hardware of the first Android phones (T-Mobile G1 and ADP1) writing efficient mobile applications is not always straightforward. Android applications rely on automatic memory management handled by Dalvik's garbage collector which can sometimes cause performance issues if you are not careful with memory allocations.

In a performance sensitive code path, like the layout or drawing method of a view or the logic code of a game, any allocation comes at a price. After too many allocations, the garbage collector will kick in and stop your application to let it free some memory. Most of the time, garbage collections happen fast enough for you not to notice. However, if a collection happens while you are scrolling through a list of items or while you are trying to defeat a foe in a game, you may suddenly see a drop in performance/responsiveness of the application. It's not unusual for a garbage collection to take 100 to 200 ms. For comparison, a smooth animation needs to draw each frame in 16 to 33 ms. If the animation is suddenly interrupted for 10 frames, you can be certain that your users will notice.

Most of the time, garbage collection occurs because of tons of small, short-lived objects and some garbage collectors, like generational garbage collectors, can optimize the collection of these objects so that the application does not get interrupted too often. The Android garbage collector is unfortunately not able to perform such optimizations and the creation of short-lived objects in performance critical code paths is thus very costly for your application.

To help you avoid frequent garbage collections, the Android SDK ships with a very useful tool called allocation tracker. This tool is part of DDMS, which you must have already used for debugging purposes. To start using the allocation tracker, you must first launch the standalone version of DDMS, which can be found in the tools/ directory of the SDK. The version of DDMS included in the Eclipse plugin does not offer you ability to use the allocation tracker yet.

Once DDMS is running, simply select your application process and then click the Allocation Tracker tab. In the new view, click Start Tracking and then use your application to make it execute the code paths you want to analyze. When you are ready, click Get Allocations. A list of allocated objects will be shown in the first table. By clicking on a line you can see, in the second table, the stack trace that led to the allocation. Not only you will know what type of object was allocated, but also in which thread, in which class, in which file and at which line. The following screenshot shows the allocations performed by Shelves while scrolling a ListView.

Even though it is not necessary, or sometimes not possible, to remove all allocations for your performance critical code paths. the allocation tracker will help you identify important issues in your code. For instance, a common mistake I have seen in many applications is to create a new Paint object on every draw. Moving the paint into an instance field is a simple fix that helps performance a lot. I highly encourage you to peruse the Android source code to see how we reduce allocations in performance critical code paths. You will also thus discover the APIs Android provide to help you reuse objects.

Note: this article was originally posted on my personal blog.


[Gd] Specify your canonical

| More

Official Google Webmaster Central Blog: Specify your canonical

Carpe diem on any duplicate content worries: we now support a format that allows you to publicly specify your preferred version of a URL. If your site has identical or vastly similar content that's accessible through multiple URLs, this format provides you with more control over the URL returned in search results. It also helps to make sure that properties such as link popularity are consolidated to your preferred version.

Let's take our old example of a site selling Swedish fish. Imagine that your preferred version of the URL and its content looks like this:

However, users (and Googlebot) can access Swedish fish through multiple (not as simple) URLs. Even if the key information on these URLs is the same as your preferred version, they may show slight content variations due to things like sort parameters or category navigation:

Or they have completely identical content, but with different URLs due to things such as a tracking parameters or a session ID:

Now, you can simply add this <link> tag to specify your preferred version:

<link rel="canonical" href="" />

inside the <head> section of the duplicate content URLs:

and Google will understand that the duplicates all refer to the canonical URL: Additional URL properties, like PageRank and related signals, are transferred as well.

This standard can be adopted by any search engine when crawling and indexing your site.

Of course you may have more questions. Joachim Kupke, an engineer from our Indexing Team, is here to provide us with the answers:

Is rel="canonical" a hint or a directive?

It's a hint that we honor strongly. We'll take your preference into account, in conjunction with other signals, when calculating the most relevant page to display in search results.

Can I use a relative path to specify the canonical, such as <link rel="canonical" href="product.php?item=swedish-fish" />?

Yes, relative paths are recognized as expected with the <link> tag. Also, if you include a <base> link in your document, relative paths will resolve according to the base URL.

Is it okay if the canonical is not an exact duplicate of the content?

We allow slight differences, e.g., in the sort order of a table of products. We also recognize that we may crawl the canonical and the duplicate pages at different points in time, so we may occasionally see different versions of your content. All of that is okay with us.

What if the rel="canonical" returns a 404?

We'll continue to index your content and use a heuristic to find a canonical, but we recommend that you specify existent URLs as canonicals.

What if the rel="canonical" hasn't yet been indexed?

Like all public content on the web, we strive to discover and crawl a designated canonical URL quickly. As soon as we index it, we'll immediately reconsider the rel="canonical" hint.

Can rel="canonical" be a redirect?

Yes, you can specify a URL that redirects as a canonical URL. Google will then process the redirect as usual and try to index it.

What if I have contradictory rel="canonical" designations?

Our algorithm is lenient: We can follow canonical chains, but we strongly recommend that you update links to point to a single canonical page to ensure optimal canonicalization results.

Can this link tag be used to suggest a canonical URL on a completely different domain?

No. To migrate to a completely different domain, permanent (301) redirects are more appropriate. Google currently will take canonicalization suggestions into account across subdomains (or within a domain), but not across domains. So site owners can suggest vs. vs., but not vs.

Sounds great—can I see a live example?

Yes, helped us as a trusted tester. For example, you'll notice that the source code on the URL specifies its rel="canonical" as:

The two URLs are nearly identical to each other, except that Nelvana_Limited, the first URL, contains a brief message near its heading. It's a good example of using this feature. With rel="canonical", properties of the two URLs are consolidated in our index and search results display's intended version.

Feel free to ask additional questions in our comments below. And if you're unable to implement a canonical designation link, no worries; we'll still do our best to select a preferred version of your duplicate content URLs, and transfer linking properties, just as we did before.

Written by Joachim Kupke, Senior Software Engineer, and Maile Ohye, Developer Programs Tech Lead

Wednesday, February 11, 2009

[Gd] TubeLoc: An AS3 Player Wrapper Using LocalConnection

| More

YouTube API Blog: TubeLoc: An AS3 Player Wrapper Using LocalConnection

Posted by Jeff Fisher, YouTube APIs and Tools Team

We know developers really like AS3, but sometimes they have difficulty getting our players to work correctly. To make this process easier for the Flashy/Flexy crowd, the awesome Ben Longoria has given us TubeLoc.

TubeLoc is an AS3 wrapper around the Player API that uses LocalConnection to communicate to the AS2 YouTube SWFs. It takes this a step further by also providing Flex components to make inserting a YouTube video and controls easy.

Ready to get started? First read the article that goes in depth on how to use TubeLoc. Next, visit the project page to download the code and play with the live demos. Finally, tell us what you think on the forum. Thanks Ben!

[Gd] Dev Update: Bug Fixes

| More

Google Chrome Releases: Dev Update: Bug Fixes

Update: This release is on hold while we work out an issue with updates. --Mark Larson, 11 Feb 09

Google Chrome's Dev channel has been updated to Thanks to work done in WebKit, Google Chrome can use web fonts (read more about it here: ), including dynamic fonts for complex scripts. If you are a web developer this is huge news for you.

New features:
  • Web Font support, including dynamic and complex scripts
  • Command line switch for the location of the disk cache.
Known Issues:
Find about the Dev channel and how to subscribe at

The complete list of changes is available in the release notes.

Jonathan Conradt
Engineering Program Manager
Mountain View, CA

[Gd] Spell Check Dictionary Improvements

| More

Chromium Blog: Spell Check Dictionary Improvements

If you're anything like us, you're spending more and more of your time working online. The spellchecker built into Chromium can be a big help in keeping your blog, email, documents, and forum postings spelled correctly and easy to read. Chromium integrates the popular open source library Hunspell with WebKit's built-in spellchecking infrastructure to check words and to provide suggestions in 27 different languages.

The Hunspell dictionary maintainers have done a great job creating high-quality dictionaries that anybody can use, but one of the problems with any dictionary is that there are inevitably omissions, especially as new words appear or proper nouns come into common use. We at Google are in a good position to use our knowledge of the internet to identify and fix some of these omissions. The Google translation team used their language models to generate a sorted list of the most popular words in each language. This was cross-checked with the Hunspell dictionaries to generate a list of the top 1000 words not present in each dictionary. This list includes many popular words, but also common misspellings. To remove these words, each list was reviewed by specialist in that language. Generally, we tried to keep proper nouns and even foreign words as long as they were in common usage.

We hope that by using the the existing GPL/LGPL/MPL tri-license for our addition, our work can be picked up by other users of Hunspell. We also hope to make more improvements in the future, both for additional languages like Turkish, and to refine the word lists we already have. If you're passionate about your language, you can help out by writing affix rules for the added words or reviewing more word lists.

The recent dev-channel release of Google Chrome ( has the additional words we generated for 19 of the languages. Hopefully, you'll see fewer common words marked as misspelled. For example, the English dictionary now includes "antivirus," "anime," "screensaver," and "webcam," and commonly used names such as "BibTeX," "Mozilla," "Obama," and "Wikipedia." For our scientific users, we even have "gastroenterology," "oligonucleotide," and "Saccharomyces"! We'd like to give special thanks to the great help we got from the translation team who generated the words and the language search specialists who reviewed the lists.

Posted by Brett Wilson and Siddhartha Chattopadhyay, Software Engineers

[Gd] Help us help you

| More

Official Google Webmaster Central Blog: Help us help you

You're a webmaster, right? Well, we love webmasters! To ensure we give you the best support possible, we've set up a survey to get your thoughts on Webmaster Central and our related support efforts. If you have a few extra minutes this week, please click here to give us your honest feedback.

Thanks from all of us on the Webmaster Central Team.

Posted by Matt Dougherty, Search Quality

[Gd] Google Friend Connect introduces the social bar

| More

Official Google Webmaster Central Blog: Google Friend Connect introduces the social bar

In our previous Google Friend Connect posts, we've enjoyed connecting with you, the webmasters, and hearing your feedback about Friend Connect. We're now standing on our own two feet -- find us over at the new Social Web Blog where we just announced the new social bar feature.

The social bar packages many of the basic social functions -- sign-in, site activities, comments, and members -- into a single strip that appears at the top or bottom of your website. You can use it alone, or use it to complement your existing social gadgets, by putting it on the top or bottom of as many of your webpages as you want.

For anyone visiting your site, the social bar offers a snapshot of the activity taking place within your website's community. One click on any these features produces a convenient, interactive drop-down gadget, so users get all the functionality of the Friend Connect gadgets, while you save real estate on your website. With the social bar, visitors can:
  • Join or sign in to your site, view and edit their profiles, and change their personal settings.
  • View recent activity on your website, including new members and posts on any of your pages.
  • Post on your wall or read and reply to others' comments.
  • See the other members of your site, check out other peoples' profiles, and become friends. Users can also find out if any of their existing friends are members of your site.
Watch this quick video to learn how easy it is to add a social bar to your website:

To try out the social bar before deciding whether to add it to your website, visit:

Posted by Mussie Shore, Product Manager, Google Friend Connect

[Gd] Apps that work together

| More

Android Developers Blog: Apps that work together

Android applications can easily be linked together using intents. One example of this involves Shazam, MySpace, and the Amazon MP3 Store. Once Shazam has identified a song, you can also search for the artist's official MySpace profile page or buy the song via via the Amazon MP3 app. Here, the three developers behind these apps talk about how they accomplished this:

To hear more about how the MySpace app for Android was built and lessons learned, watch Matt Kanninen:

Tomasz Zawada of Shazam also talks about his opinions on the Android platform and has some tips for developers building Android apps:

These and the other Android app developer videos can be found here.


Tuesday, February 10, 2009

[Gd] Rendering plug-in released for SketchUp 7

| More

Official Google SketchUp Blog: Rendering plug-in released for SketchUp 7

The Cadalog team just released their latest version of SU Podium 1.6.1 Beta a photo-realistic rendering plug-in for Google SketchUp. Version 1.6.1 includes new wide screen resolution options, support for SketchUp's parallel projection, and also fixes some significant bugs. The update to version 1.6.1 is free for Podium 1.5 or 1.6 users and it works with Google SketchUp 6 or 7, Pro or Free, Windows or Mac.

The SU Podium team has also announced the 4th Podium render contest. The render contest will enable users to produce photo-realistic renderings of any type of Google SketchUp model. The images will be judged on their creativity, originality, and their inspirational qualities. Prizes include a Nikon SLR Digital Camera, Apple iPod Touch, and a Western Digital My Passport portable hard drive. Please visit their contest page for more details.

Posted by Tasha Danko, Google SketchUp Team

Monday, February 9, 2009

[Gd] SDK version 1.1.9 Released

| More

Google App Engine Blog: SDK version 1.1.9 Released

Today we released version 1.1.9 of our SDK. Here's what's new in this release:

  • You can now use the Python standard libraries urllib, urllib2 or httplib to make HTTP requests. This has been a frequent request on our issue tracker.

  • We've been working on a set of tools that will make the process of uploading and downloading data from App Engine applications easier. Today we're excited to announce an early release of our new bulk uploading client. You can try it out here. Let us know what you think in our Google Group!

  • Several updates to our datastore, including the automatic generation of single property indexes and the addition of IN and != operators to db.Query. See the Datastore API docs for more details.

  • A bunch of additional bugfixes and enhancements, listed in our Release Notes.

You can download version 1.1.9 of the SDK for Windows, Mac, and Linux now on our Downloads page. As always, we spend a lot of time reading (and posting!) on our Google Group, and we welcome your feedback!

Posted by Pete Koomen, Google App Engine Team

[Gd] IIT Google Desktop Developer Challenge II (2008)

| More

Google Desktop APIs: IIT Google Desktop Developer Challenge II (2008)

Google Desktop has active ambassadors all over the world who have successfully held programming contests and seminars at their schools.

As a stepping stone for bigger events, we held IIT Google Desktop Developer Challenge II at Informatics Institute of Technology (IIT), Sri Lanka, last summer.

This is the second event we organized at IIT Sri Lanka; you can read about the first event.

IIT Google Desktop Developer Challenge II was a Google Desktop Gadget contest organized for student developers at our institute. Any student enrolled at IIT was eligible to take part, and the main purpose of the contest was to inspire new developers to try the Google Desktop APIs and develop gadgets.

First, the students who wished to participate in this contest had to hand in proposals, which contained a brief introduction to the gadget they planned to develop. After that, it was time for them to develop their gadgets. The completed gadgets were forwarded to a panel of experts including API Gurus and the Google Desktop team. All these steps were done online through the official website for the contest, powered by Google App Engine.

And now, we are very happy to announce the winners of the second successful ambassador event in Sri Lanka.

Nadeeshani Jayathilaka was selected as third runner up for the gadget Greeting Bird, while Shazin was selected as the second runner up the gadget Radio Pro. The first runner up was Hanitha Gnanathesigar for her gadget GHealth N Fitness.

The winner of the contest was Lakmal Jayathilaka, who created the gadget Text 2 Wav Converter.

We congratulate all the winners and would like to thank everyone who took part in this competition and who helped to make this event a success. You can view photos of the award ceremony on Picasa Web Albums. Last but not least, a special thanks to the Google Desktop team for the greatest support given.

Posted by Lahiru Lakmal Priyadarshana, Google Desktop Ambassador and Gadget Developer

[Gd] John Resig: Drop-in JavaScript Performance

| More

Google Code Blog: John Resig: Drop-in JavaScript Performance

By Steve Souders, Google Developer Team

Although Mozilla is right across the street, their JavaScript evangelist, John Resig, hails from Boston. When he comes to town, it's a great opportunity to learn about his current explorations in the world of JavaScript. I was fortunate to be able to host him for a Google tech talk last week. The video and slides are now available. In addition to his evangelism role at Mozilla, John is the creator of jQuery and Dromaeo, author of Pro JavaScript Techniques, and member of the Firebug Working Group. He's currently working on Secrets of the JavaScript Ninja, due out sometime this year.

In this talk, John starts off highlighting why performance will improve in the next generation of browsers, thanks to advances in JavaScript engines and new features such as process per tab and parallel script loading. He digs deeper into JavaScript performance, touching on shaping, tracing, just-in-time compilation, and the various benchmarks (SunSpider, Dromaeo, and V8 benchmark). John plugs my UA Profiler, with its tests for simultaneous connections, parallel script loading, and link prefetching. He wraps up with a collection of many other advanced features in the areas of communiction, DOM, styling, data, and measurements.

Wow, a lot of material to cover in one hour. An added benefit of having this talk given at Google is the questions from the audience. At one point, a member of the Google Chrome team goes into detail about how parsing works in V8. Many thanks to John for sharing his work and insights with all of us.


[Gd] Android 1.1 SDK, release 1 Now Available

| More

Android Developers Blog: Android 1.1 SDK, release 1 Now Available

Hello, developers! As you may have heard by now, users around the world have started to receive updates to their Android devices that provide new features and functionality. You may also have noticed that the new update reports as "Android 1.1". Applications written with the 1.0_r1 and 1.0_r2 SDKs will continue to work just fine on Android 1.1. But if you want to take advantage of the new APIs in 1.1, you'll need an updated SDK.

That's why I'm pleased to let you know that the Android 1.1 SDK, release 1 is now available. As you'll quickly see from the release notes, the actual API changes are quite minor, but useful. This new SDK has all the new APIs, as well as a new emulator image to let you test your applications. If you have a retail device running Android, contact your operator for the update schedule. An updated v1.1 system image for the Android Developer Phone 1 will be coming soon.

In addition to the new APIs, the emulator also contains improved ability to test localizations to the German language. Localizations for other languages will be added in future SDK releases.

You can download the updated SDK using the links above. Happy coding!


[Gd] To Assert or Not To Assert

| More

Google Testing Blog: To Assert or Not To Assert

by Miško Hevery

Some of the strongest objections I get from people is on my stance on what I call "defensive programming". You know all those asserts you sprinkle your code with. I have a special hate relationship against null checking. But let me explain.

At first, people wrote code, and spend a lot of time debugging. Than someone came up with the idea of asserting that some set of things should never happen. Now there are two kinds of assertions, the ones where you assert that an object will never get into on inconsistent state and the ones where you assert that objects never gets passed a incorrect value. The most common of which is the null check.

Than some time later people started doing automated unit-testing, and a weird thing happened, those assertions are actually in the way of good unit testing, especially the null check on the arguments. Let me demonstrate with on example.
class House {
Door door;
Window window;
Roof roof;
Kitchen kitchen;
LivingRoom livingRoom;
BedRoom bedRoom;

House(Door door, Window window,
Roof roof, Kitchen kitchen,
LivingRoom livingRoom,
BedRoom bedRoom){
this.door = Assert.notNull(door);
this.window = Assert.notNull(window);
this.roof = Assert.notNull(roof); = Assert.notNull(kitchen);
this.livingRoom = Assert.notNull(livingRoom);
this.bedRoom = Assert.notNull(bedRoom);

void secure() {

Now let's say that i want to test the secure() method. The secure method needs door and window. Therefore my ideal would look like this.
testSecureHouse() {
Door door = new Door();
Window window = new Window();
House house = new House(door, window,
null, null, null, null);;


Since the secure() method only needs to operate on door, and window, those are the only objects which I should have to create. For the rest of them I should be able to pass in null. null is a great way to tell the reader, "these are not the objects you are looking for". Compare the readability with this:
testSecureHouse() {
Door door = new Door();
Window window = new Window();
House house = new House(door, window,
new Roof(),
new Kitchen(),
new LivingRoom(),
new BedRoom());;


If the test fails here you are now sure where to look for the problem since so many objects are involved. It is not clear from the test that that many of the collaborators are not needed.

However this test assumes that all of the collaborators have no argument constructors, which is most likely not the case. So if the Kitchen class needs dependencies in its constructor, we can only assume that the same person who put the asserts in the House also placed them in the Kitchen, LivingRoom, and BedRoom constructor as well. This means that we have to create instances of those to pass the null check, so our real test will look like this:
testSecureHouse() {
Door door = new Door();
Window window = new Window();
House house = new House(door, window,
new Roof(),
new Kitchen(new Sink(new Pipes()), new Refrigerator()),
new LivingRoom(new Table(), new TV(), new Sofa()),
new BedRoom(new Bed(), new Closet()));;


Your asserts are forcing you to create so many objects which have nothing to do with the test and only confuse the reader and make the tests hard to write. Now I know that a house with a null roof, livingRoom, kitchen and bedRoom is an inconsistent object which would be an error in production, but I can write another test of my HouseFactory class which will assert that it will never happen.

Now there is a difference if the API is meant for my internal consumption or is part of an external API. For external API

I am not against asserts, I often use them in my code as well, but most of my asserts check the internal state of an object not wether or not I am passing in a null value. Checking for nulls usually goes against testability, and given a choice between well tested code and untested code with asserts, there is no debate for me which one I chose.

[Gd] Get closer to your models in the 3D Warehouse

| More

Official Google SketchUp Blog: Get closer to your models in the 3D Warehouse

If you thought the 3D View for models in Google 3D Warehouse was cool, you will flip for the new "Zoom and Pan". Now you can orbit, zoom in, pan around, and zoom out -- right in the preview window without having to download the model. Use your mouse wheel to roll in for a closer view. Click and hold the Shift key to pan around. You can even change the view when zoomed in! Check out this model of the Eiffel Tower.
  1. Click on the 3D View button in the preview window.
  2. Click and hold the left mouse button to swivel your view.
  3. Now the really cool part...roll your mouse wheel forward to zoom in.
  4. Click and hold the left mouse button to swivel the zoomed-in view.
  5. Hold the Shift key and pan up, down, left and right.

Now it's possible to get a clear idea of the model before you decide to download it!

Posted by Tom Stamm, 3D Warehouse Team