Google Cloud Print (GCP)

What is Cloud Computing?

Cloud computing is no more a new term now, it’s been there from quite a long time. In layman’s terms cloud computing is nothing but utilizing internet cloud for using your files and applications over the internet.

What is Google Cloud Print (GCP)?

Finally Google has brought cloud computing application which will be available to common internet users. (Though Email on the internet is also an efficient example of cloud computing.)

Google has given a very simple definition for GCP which says “Google Cloud Print (GCP) enables any app (web, mobile, desktop) on any device to print to any cloud-connected printer.”

If you are in the bus travelling to office and simultaneously surfing the internet and found some good article you want your kid to read, you can send it to GCP, GCP will send it to your home printer and it will print the article at home printer.

How it works?

Google Cloud Print Workflow

1)      When user gives a print command from any of the devices shown in the above diagram (e.g. Tablet, Laptop or cell phone), it gives call to the Google Cloud Print APIs.

2)      Once Google Cloud Print service receives the API call, it searches for the user’s configured printers. Users associate printers with their Google Account.

3)      Google Cloud Print service sends the print job to the printer.

(After the configuration of the printer in Google Cloud, you can share it with your friends, relatives in the same way you share documents with the Google doc.)

Google has divided the printers in two main categories –

Cloud ready printers – Cloud Ready printers are a new generation of printers with native support for connecting to cloud print services. That means in their firmware they have ability to connect to Google cloud. No need of any devices between printer and cloud.

E.g. HP Printers (http://www.hp.com/global/us/en/eprint/google-cloud-print.html?re_r11400_campaigns_eprint_google_cloud_print_redirect)

Non-cloud printers - All the printers which do not have ability directly communicate to Google cloud are the non-cloud printers. They need PC and a software interface (e.g. Google Chrome) to talk to Google cloud print service.

Reference –

http://code.google.com/apis/cloudprint/docs/overview.html

Which camera to buy? – Some quick thoughts before buying new camera

Many times people ask me which camera I should buy. As it is very general question,
I would like to help them by narrowing down choices.
(Since more people are interested in digital camera so I would not touch base on film camera in this post.)

1) Point and shoot Camera
These are the simple cameras which does allow user to make changes in the light exposure or aperture. I would like to define two categories for these cameras-

a. Camera’s that can fit in your pocket (BASIC).
Advantages
i. Very compact and light wet.
ii. You can carry it in your pocket.
iii. Low price
iv. Sufficient to capture good pictures for different occasions.

Disadvantages
i. Does not give more options to user to configure the settings while clicking the picture
ii. Does not have big zoom since lens are very compact.
iii. Can not connect external lens.

b. Camera’s that can not fit in your pocket (ADVANCED).
Advantages
i. Can zoom in and take picture of remote objects easily.
ii. Sufficient to start photography as a hobby.
iii. Does give more options to user to configure the settings while clicking the picture
iv. It’s a best option between basic camera and SLR Camera

Disadvantages
i. Can not connect external lens.
ii. You can not carry it in your pocket.
iii. Expensive than basic point and shoot camera

2) DSLR Camera
Advantages
i. It’s a professional camera.
ii. Can zoom in and take picture of remote objects easily.
iii. Can connect external lens.
iv. Does give more options to user to configure the settings while clicking the picture

Disadvantages
i. Buy only if you are serious about photography otherwise it will remain as a show piece in your gadget collection.
ii. Very Bulky
iii. Expensive

Feel free to give your feedback on this article.

Difference between Concurrent Garbage collection and Background Garbage collection

In .Net framework 4.0, Microsoft has added new feature related to garbage collection called as Background garbage collection. Before going to Background garbage collection let’s first revise the basic garbage collection.

What is garbage collection?

In .net world, Garbage collection is nothing but collecting unused memory locations by freeing unused objects from managed heap memory.

How it works?

Have you notice a how cleaning staff remove all the garbage from a trash bag. They just open the bag and empty it in a bigger pot. So when they empty the trash bag, new garbage items comes out first and then the old one and then older ones and so on.

Imagine a trash bag with three section new garbage section, older garbage Section and oldest garbage Section. Garbage automatically moves from one section to another as it gets older.

In the similar way managed heap memory is managed in three sections generation 0 (young objects), generation 1 (older objects) and generation 2 (oldest objects).

Garbage collector first runs a check on generation 0, if it doesn’t found any free objects it runs a check on generation 1 and then checks on generation 2.

  • Generation 0. This is the youngest generation and contains short-lived objects. E.g. temp variable. Garbage collection occurs most frequently in this generation.
  • Generation 1. This generation contains short-lived objects and serves as a buffer between short-lived objects and long-lived objects.
  • Generation 2. This generation contains long-lived objects. An example of a long-lived object is an object in a server application that contains static data that is live for the duration of the process.

Life Cycle of object in Garbage Collector context

Sr.No. Concurrent Garbage Collection Background Garbage Collection Foreground Garbage Collection
1 Garbage collector thread runs concurrently with the other threads In Background Garbage Collection, generation 0 and 1 (ephemeral generations) are collected as needed while generation 2 collection is in progress Being a part of background garbage collection, Collection of generation 0 and 1 (ephemeral generations) during the background garbage collection is known as foreground garbage collection.
2 Only applicable to generation 2 while generation 0 and 1 are non-concurrent. Only applicable to generation 2. Only applicable to generation 0 and 1.
3 For freeing the generation 0 and 1 object you have to wait till concurrent garbage collector finishes the generation 2. Background garbage collection suspends itself when foreground garbage collection is in progress. Foreground garbage collection is not running when background garbage collection is running.
4 Framework 3.5 or below Framework 4.0 or above Framework 4.0 or above
5 You can configure this collection using <gcServer> element in the run time configuration schema. There is no configuration option for this collection. It gets automatically enable with the concurrent garbage collection. There is no configuration option for this collection. It gets automatically enable with the concurrent garbage collection.
6 Allocation restrictions No Allocation restrictions
7 Server and workstation option available Only workstation option available Only workstation option available

Hope this article will help you understanding existing and new feature of garbage collection in .net framework 4.0.

Feel free to send me your queries regarding garbage collection and I will try my level best to address those queries.

- Abhi

________________________________________________________________________

Glossary

Manage Heap – After the garbage collector is initialized by the CLR, it allocates a segment of memory to store and manage objects. This memory is called the managed heap, as opposed to a native heap in the operating system.

There is a managed heap for each managed process. All threads in the process allocate objects on the same heap. The heap can be considered as the accumulation of two heaps: the large object heap and the small object heap. The large object heap contains objects that are 85,000 bytes and larger. Very large objects on the large object heap are usually arrays. It is rare for an instance object to be extremely large.

A marking phase that finds and creates a list of all live objects.

A relocating phase that updates the references to the objects that will be compacted.

A compacting phase that reclaims the space occupied by the dead objects and compacts the surviving objects. The compacting phase moves objects that have survived a garbage collection toward the older end of the segment.

Because objects in generations 0 and 1 are short-lived, these generations are known as the ephemeral generations.