Book reading: Google Sketchup for Dummies

Sunday, May 30th, 2010

Aidan Chopra. Google SketchUp® 7 For Dummies®. For Dummies, 2009.
41 Amazon ratings!

Even though Sketchup is quite an intuitive tool to use the book is a means to summarize the knowledge. For Dummies is a great series and this book is no exception.

Part 1 of the book describes what Sketchup is for. It is written for people who have not heard of Sketchup and therefore I decided to skip it.

Part 2 is called Modelling in Sketchup and it starts with explaining how to build a house. I like Dummies series because it is very practically oriented. I did not have to read how to draw a box or a circle, the stuff that most people will manage to learn on their own.

Modeling buildings is what I am interested in. The author of this book also thinks that this is an interesting topic. However, Sketchup can do a whole lot of other things – furniture, cars, trees, you name it. However, a building is a perfect example to demonstrate how to use various Sketchup tools. Indeed, a building has a roof, walls, and staircase. Each component has its tricks.

I think Sketchup is a great program because it has lots of tools. A saying goes Sharpen your tools. I think that Skethcup is on the front edge of innovation in graphic tools. For example, a Push/Pull tool can cut windows and doors in a wall, build a triangular roof, and finalize a staircase. Such a multi-purpose tool but still it is quite intuitive when you start to use it. Another tool called Follow Me combines the functionality of 2-3 tools in traditional CAD frameworks. It allows to extend an arbitrary shape along an arbitrary curve, thus making it possible to build a vase, a sphere, or a staircase.

Here are examples of what I could create immediately after reading the book. These complex shapes take only a couple of clicks to build with Sketchup tools.

Chapter 8 describes how to use photographs to facilitate creating of building models. An indispensable stuff if you want to model your very own house. Within hours from taking the book in your hands you will have a draft 3D model of your beloved mansion!

In Part 3 the author describes additional unexpected capabilities of Sketchup. It turns out that it supports multiple styles. Even though Sketchup offers non-photorealistic rendering (NPR) only, still there are lots of options from wireframe, to shaded faces, to NPR. Btw., it is possible to obtain a photograph-quality imaging from Sketchup using plugins (written in Ruby) and 3rd party tools.

Using Google Earth inside Sketchup makes it possible to geo-locate your building and watch it under various lighting conditions – at sunrise, at noon, or at glorious sunset. The building will cast appropriate shadows so you can decide where you want to plant your garden.

Chapter 10 describes how to browse buildings as in first-person game. You can even climb the stairs and walk round the corners smoothly.

In the remaining two parts the book describes how to share your model with the community as well as what the community has to offer. There are lots of cool tutorials out there. One of the great resources are the YouTube videos that the author of the book Aidan Chopra shot as compliment to the book. They are available here. Each video is quite short. Obviously, when I discovered the book I watched the videos first and then began reading the book. Overall, it a very enjoyable learning experience!

Building cities for the rest of us

Friday, May 28th, 2010



It is well known that Google spends a lot of effort on various cool things. Its advances in technology make it possible for people to do things they could not do before. I always wanted to express myself in art but when I was in school I never managed to draw a decent painting. But with Google Sketchup and Building Maker I can build models of everything with the assistance of computer and the web. A great combination of a number of technologies: satellite imaging, graphics, web programming, user interfaces.

Google Earth is a program that many people have spent hours playing with. But those attractive 3D models of buildings were a privilege of qualified engineers and designers until recently. Given the ambicious goal of modeling every city on Earth Google had to ask for help of the community. Because not everybody is a gifted designer, Google has created Building Maker, a tool that presents an image of a building to a user and asks to find a shape that matches its best.

A few basic shapes are available: box, prism, etc. A box is used to model the body of the house whereas a prism is used to model the roof. It is possible to define relationships between elements, that is to specify that one is situated next to another.

Once the user has aligned all visible points on one image she can move on to the next one. After aligning the model you can submit it for review. Once it gets accepted to the buildings layer you can see it using Google Earth and also everybody else will see it. All this beauty (including Google Earth) lives within a window of your browser. I wonder which language it was written in. Obviously, browser applications are matching desktop applications in their capabilities and functionality.

But this cool technology relies on so-cold bird-eye views of cities which are not available everywhere. Another limitation of this technology is the basic set of shapes that building maker has. This is why if you want to model more complex buildings you have to use Sketchup, a 3D drawing program.

Of course, Sketchup facilitates the process through image-matching technology. You can load a photo into Sketchup, align axes and use the image essentially in the same way as in Building Maker. However, a lot more shapes are available: circles, arcs, as well as tools to manipulate them. After constructing the first version of your model you can use additional photographs as textures of its faces. As with Building Maker, it is possible to get the model added to the buildings layer of Google Earth after review.

I have created models with both tools. Obviously, using photo matching in Sketchup takes longer because you have to apply textures to each face of the model manually. I have spent several days creating a model of a school next to our house. The model consists of several boxes. The main problem was connecting the boxes to make sure that there were no holes in the model. At one point I had a seemingly good model except that when I tried to build the roof it was breaking up into pieces. It turned out that the problem was in one wall which height was slightly less than heights of other walls, and therefore, there was a crack between the roof and that wall. Once you get used to measuring heights and widths of everything constructing becomes a lot easier. I would estimate the learning time of Sketchup as one week. But I have not started working with circular shapes yet! That’s the next level of skill!

These are the models that I have built so far. Click on the image to see 3D model.







Optimizing web pages

Sunday, February 7th, 2010

While working on Timeline Builder I noticed that loading a timeline takes a while. This is because Timeline is implemented as lots and lots of Javascript and even though it is minified and all files are concatenated into one the result is still quite big.

Compressing your scripts is a low-hanging fruit in optimizing the size of your web pages. But popular hosting providers don’t implement this feature by default, quite surprisingly.

One low-hanging fruit is to use compression when delivering the files from your web site. Quite surprisingly, this feature is not available by default if you host your web site on popular hosting service such as GoDaddy. But searching on the Internet allows one find out how to do it. OpensourceTutor is a blog with lots of interesting content.

This post describes how to use Apache for our purposes. Basically, it depends on the version of Apache. For 2.x version you have to implement the following .htaccess:


<ifmodule mod_deflate.c>
SetOutputFilter DEFLATE
</ifmodule>

This approach works with hosting provider Logol where I have one of my test sites. However, GoDaddy uses a different version of Apache and another approach is needed. I have tried replacing mod_deflate with mod_gzip but this did not work out.

The approach suggested at OpensourceTutor is to use the Apache rewrite engine. When an HTTP request arrives Apache will check whether a file with the same name but with a postfix .gz exists and if yes then it will serve the compressed file. Therefore, the web developer needs to upload the compressed version of each file that he wants to optimize. The .htaccess code looks as follows:


RewriteEngine on
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.+) $1.gz [QSA,L]

There is a third approach explained here in detail. It works for pages written in PHP. The basic idea is to prepend <? ob_start("ob_gzhandler"); ?> to your pages and that will turn on compression.

These are only few ideas on how to improve your web pages. There are automatic tools that analyze your web pages and make suggestions, most notably YSlow from Yahoo and Page Speed from Google. After reading their reports I learned that there are lots of ways in which I can improve my web site, including

  • Adding expires headers
  • Using entity tags
  • Minifying CSS and Javascript

These ideas mean that I need to maintain two versions of my web site – one which is publicly visible and optimized with compressed and minified scripts and another with uncompressed content which is convenient for development. Then I will need a script that converts the development version into production version. Even though such development configuration seems natural I have not found any tools that facilitate its implementation on popular hosting sites.

Page Speed can generate nice graphs as the one shown above. Each track represents one HTTP request. After I added compression the length of the tracks has been reduced, therefore the results of your efforts are easily measurable.

These two extensions demonstrate the flexibility of Firefox. I have noticed that people achieve glory these days not through a large software development effort such as an operating system or a word processor but through a little application such as a plugin. Typically, plugin runs on a bigger platform along with thousands of other plugins. I have read in Economist that last fall a pizza-tycoon kind of game running on Facebook has attracted several million gamers in a couple of month – an unimaginable rate for the gaming industry alone. But social network makes it possible.

Anyway, there are plugins that are so successful that people build their plugins on top of them. PageSpeed and YSlow are examples of this type of plugin because they are built on top of another Firefox plugin Firebug. Another example of plugin used to develop other plugins is Greasemonkey.

Book reading: The Google Way

Sunday, May 31st, 2009

Google is the most intriguing company ever. This book sheds light on the reasons behind its unprecedented success and describes lessons that we can learn from it.

Even though I use Google on a daily basis and think that I know this company, my perception of it changed a lot after reading the book. For example, some time ago Google released a product that had a glitch. I got disappointed and switched to a similar competitors offering. In the meantime Google’s product developed into something very useful while the competitor’s stayed where it was. If I had read this book earlier I would have made a better decision.

According to the author of the book there are several forces that steer Google as a company: the triumvirate of executives and user
community. Each of these parts has its share in Google’s success.

The founders challenged many traditional methods of managing a company. To start with, a governing triumvirate is very uncommon. The biggest advantage is that they compensate each other when making decisions. Another difference is how Google went public – the founders used then uncommon Dutch auction model to distribute initial set of shares. The author analyzes the advantages and disadvantages of Google management style.

Over the past, many companies have accumulated devoted user bases. This was achieved in different ways such as more traditional – offering a discount or less traditional elitism. The author of the book analyzes the reasons why so many people admire Google:

  • Using Google is free. However, many people asked to charge a nominal price in exchange of support.
  • Google releases beta versions of its products. It relies on large user community to report bugs and generate improvement ideas.
  • As a company whose revenue is based on online ads, Google has simplified the process of placing an ad. The process is totally automatic – the people bid for certain keywords which are associated with their ads.

Google has improved the way in which customers interact with it. Another important component is innovative environment within the company. Google is different from traditional companies in the following ways. Its HR department has highly variable size. Google fights bureaucracy by keeping the team size small. Instead of asking managers to evaluate the employees, peer reviews are used in Google. Fellow developers evaluate the projects written during the 20% free-time rule and select the most promising. The ability to work on what you like allows experienced developers to advance in the career ladder without being forced into becoming a manager.

In addition to the interesting content, the book has unique style of presenting it. Blogs are cited very often. Using this book I discovered many new interesting blogs.

This book is a bridge to understanding processes going on in the Internet industry. It will help improve your own company or evaluate other Internet companies.

Google Charts Builder

Friday, January 9th, 2009

Internet offers lots of information, above any reasonable amount for a normal human being. Thus, consuming information is not that easy. Researchers found out that there are two types of people – those who prefer web pages with few highlights and those who get excited when they see lots of numbers, possibly visualized.

In other words, lack of detail is not always what people are looking for. Personally, I get excited when I see lots of detailed information. Then I bookmark such a web page with the idea that I will visit it again to read it carefully but that happens rarely. I will revisit a web page if it is really important. This is why I like semantic web – it has lots of inter-linked structured information. On my web site I have lots of information represented as charts. Most of it is hidden in a protected zone, for example financial information.

In year 2005 I read an article in IEEE Spectrum. It described the idea of Gordon Bell who worked on MyLifeBits project. The idea is to record all possible information, everything that happens to you throughout the day using a camera. I am trying to implement this idea without a camera, though.The example above shows the number of visits to swimming pool per month.

I need a tool to visualize vast amounts of information. I want to try out different representations – bars, lines, circles, etc. and I need this charts on the web. There are lots of good drawing programs but they are not web-ready.

Google charts bridge the gap between information visualization and web. All the data and metadata are encoded in the URL. Of course, building such URLs manually is not easy. Thus I needed a tool to build charts quickly with different parameters.

I have searched Internet but what I found were tools that asked lots of questions. Instead, give me a chart that is almost ready, I will plug in my data and get the result. In other words, we need an
example-driven tool.

Here is Google Charts Builder. A sample chart is displayed as soon as the page is opened. I tried to make it as nice as possible. Not any type of the chart is supported yet, I will add them as necessary.

I have used this tool to build lots of charts and it allowed me to experiment with scale, chart type, labels, colors, etc.

There are tools for other Google APIs, for example Google Maps builder.

Web APIs are very powerful

Monday, December 22nd, 2008

While implementing Weather forecast on the homescreen of a Nokia device I faced a problem of inserting entries to Google calendar. I have thought of a number of approaches including using Twitter app called TwitterCal that connects the calendar with a Tweet user. In fact, this is quite an interesting application. Implemented as a Twitter user, it receives your messages in a quick add format and inserts them to your calendar. Unfortunately, the application is defunct. Thus the idea was to minimize the development effort. Now I am thinking of a pipeline of Twitter robots. One robot generates weather forecasts. It is connected to the TwitterCal which delivers the weather forecasts to your Google calendar.

But I could not avoid programming. Thus I started using Google Calendar API. As I am used to programming in PHP I wanted to use PHP API. However, that is quite a huge package and it uses Zend, I needed a simpler implementation. Thus, I read the documentation and decided to use good old curl to interact with Google servers. With a minimalistic API allowing only creating and deleting entries I implemented the first version of my project.

I need to deliver weather forecast for any city. Thus I have a search box in which the user enters the desired location. I am using BBC Weather site to search for the location. Here is what the result looks like when I enter New York:

Weather NY

This is not appropriate for a script. In fact, there is a weather forecast just for New York on BBC Weather but there is no direct way of getting there, only through clarifying questions. One idea is to make the script click on the first link on the above page but I have thought of a more elegant solution – use Google Search API!.

We are using Google search on a daily basis. Have you ever noticed that the results are available only in HTML format but not in RSS? Thus, automating search was always a problem. Not anymore, though. Google Search AJAX API allows you to launch queries from within your webpage using Javascript. The idea is that there is an edit box on a web page in which user enters a query and there is a DIV element on your web page in which the results are inserted. Google search is much more robust, it does not ask clarifying questions. If you search for BBC Weather New York the first result is the desired page with NY weather forecast. I am feeling lucky!

When a user of our project enters city name there is no need to display all possible results. We only need the URL of the first result. Thus the trick is to hide the output window to which the Google Search API inserted the results. After the results have been added to the hidden window and the first link has been extracted, we will show that URL on our web page as if we found it on our own! The whole power behind the Google search is neatly hidden on our modest web site. That’s the power of web APIs.

There is a lot of work going on right now on creating new APIs. Their capabilities are limitless. I am thinking of allocating a time slot every weekend to study web APIs that popular web sites expose. A Web API allows you to leverage great powers of those web giants when designing your own web page. You have total control on the look and feel of the results, the external sites shape the data only.

Today I found out that Nokia has adopted the idea of implementing custom homescreen widgets! Here is a contest which goal is to select the best homescreen widget for an upcoming Nokia N97 device. Should I submit Weather on the homescreen there once again?