Showing posts with label Google. Show all posts
Showing posts with label Google. Show all posts

Monday, October 12, 2009

Google Apps


Introduction Google Apps
Google Apps is a cloud base group ware products that run in a web browser(concept of SAS) ,This includes communication tools
  • Mail Solution with less spam and mobile access
  • Office productivity tools (Google Docs: text files, spreadsheets and presentations).
  • Google Calendar and IM with mobile access
  • Google Sites (to develop web pages)
To take a tour of google apps
http://apps.gepportal.com/google-apps-basics


The tools are free, or users can pay for a Premium Edition that adds more storage space and other features.It’s easy and inexpensive or no-cost way to get these services at your  custom domain.(just like http://gmail.vu.edu.pk or http://mail.haroonidrees.com).


Google Apps Education  Edition 
An Education Edition is offered at no cost to K–12
and higher 
education. As Google said



"Google Apps for Education is free.This includes user accounts for incoming students in the future. As you may know, Google was founded by a research project at Stanford University, and this is just one way we can give back to the educational community."


Google Apps allows institutions to use their own domain name with the service and to customize the interface to reflect the branding of that institution.
The Url to access Google Apps is
http://www.google.com/a/
Why Educational should  use Google App
The link explain better reason of using Google Apps
http://www.google.com/a/help/intl/en/edu/sell.html







Standard Edition

     It is another version of Google Apps which also is free.It facilitate collaboration for an organization ,small business, business startup or communities less than 50 users with your custom domain.
Standard Edition offers
  • Same storage space as regular gmail.com accounts
  • Text ads mandatory
  • Limited to 50 Users
  • Email attachments cannot be any larger than 10 megabytes.


Premier Edition.
       This is the paid version of Google Apps.It facilitate corporates ,medium or large organization.This is exactly a cloud computing concept which describe that modern users will "rent" or borrow online software instead of actually purchasing and installing it on their home computers and decrease of maintenance headache.
  • 50 $USD / account / year
  • 25 GB space for e-mail
  • Text ads optional
  • Integrated Postini "security, compliance, policy management, and message recovery services"
  • Conference room/resource scheduling
  • 99.9% e-mail uptime guarantee
  • APIs for Single Sign On, etc.
  • 24/7 phone support
  • 3rd party applications and services
  • Google Video (Private company version of Youtube.)

Monday, July 27, 2009

Voice chat with Google talk user using Empathy Messenger

Few days back one of my unknown friend called me and asked to me that can we do voice chat on Ubuntu Linux with Google talk? and he told me that Pidgin and Gaim messengers don't support voice chat with Google talk in current release(Pidgin is working on video and voice support for details click on link).At that time I don't know its detail, After doing some search I got solution for this matter.

We can do voice with Google talk on Ubuntu using Empathy Messenger. Empathy Messenger consists of a rich set of reusable instant messaging widgets, and a GNOME client using those widgets. It uses Telepathy and Nokia’s Mission Control, and reuses Gossip’s UI. To Setup Empathy and Google talk click here

Wednesday, December 17, 2008

Templates in google appengine

Externalizing html from core business logic is very good technique to create code simple and understandable. Embedded HTML in code is difficult to maintain. To Avoid embedded HTML in code python provides us different templating systems which are EZT, Cheetah, ClearSilver, Quixote, and Django , which are supported by google appengine. We use Django template engine in our example.
Create Model class with name message.py

from google.appengine.ext import db

class Message(db.Model):

content = db.TextProperty(required=True)

who = db.StringProperty()

when = db.DateTimeProperty(auto_now_add=True)


create main.py

class MainHandler(webapp.RequestHandler):

def get(self):

messages = db.GqlQuery('SELECT * FROM Message '

'ORDER BY when DESC').fetch(100)

values = {'messages': messages}

self.response.out.write( template.render('list.html', values))

def main():

application = webapp.WSGIApplication([('/', MainHandler)], debug=True)

wsgiref.handlers.CGIHandler().run(application)



if __name__ == '__main__':

main()


list.html

<head><title>..............</title>

<style>

.even {

background-color:#DDDDDD

}

.odd {

background-color:#FFFFFF

}

</style>

</head>

<body>

<table width="100%" cellspacing="0" cellpadding="0" >

{% for message in messages %}

<tr class="{% cycle even,odd %}" >

<td colspan="3">

<table width='100%' border=1>

<tbody>

<tr class="{% cycle even,odd %}">

<td width="20%" valign="top">Nick</td>

<td align="right" width="20%" valign="top">{{message.when}}</td>

</tr>

<tr height="40">

<td width="20%" valign="top">{{message.who}} </td>

<td width="80%" valign="top">{{message.content}}</td>

</tr>

</tbody>

</table>

</td>

</tr>

<tr height="5px"><td colspan='3' align='center'> </td></tr>

{% endfor %}

</table>

</body>

</html>

create app.yaml
application: template

version: 1

runtime: python

api_version: 1



- url: /.*

script: main.py

What the above code does

  1. In meesage.py file we define a model Message with three properties: content,who and when which plays a role of domain object and a db.This is part of App Engine not a python and It uses App Engine big table infrastructure which takes care of all of the distribution, replication and load balancing.

    for detail refrence of entities and model visit http://code.google.com/appengine/docs/datastore/
  2. In main.py we define MainHandler class which serve as request handler of all get requests.We use GQL in our code for getting all message model objects. After fetching all results we assign these meesage to values and reponse back to list.html page. self.response.out.write use for writing reponse and template.render method use for rendring list template.
  3. After that we create html file with the name of list.html .In this html file we use Django script for manupolation Message objects. {% for message in messages %} is just foreach like code structure and "{% cycle even,odd %}" uses for applying style class alternatively each time. you can use any number of values, separated by commas for alternatively.

Using google webapp framework in google appengine

Google includes python based web application framework with app engine.This framework pretty similar with MVC pattern.A webapp application has three parts:
  • one or more RequestHandler classes that process requests and build responses
  • a WSGIApplication instance that routes incoming requests to handlers based on the URL
  • a main routine that runs the WSGIApplication using a CGI adaptor.
Now the time to look at example code of webapp framwork.We are going to write webapp.py


from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

class MainPage(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello World from the webapp framework!')

application = webapp.WSGIApplication(
[('/', MainPage)],
debug=True)

def main():
run_wsgi_app(application)

if __name__ == "__main__":
main()

our app.yaml
application: webapptest

version: 1

runtime: python

api_version: 1



handlers:

- url: /

script: webapp.py
http://code.google.com/appengine/docs/webapp/
What the above code does

  1. The webapp module is in the google.appengine.ext
  2. This code defines one request handler, MainPage, mapped to the root URL (/).We can map diffrent urls with diffrent handlers
  3. When webapp receives an HTTP GET request to the URL /, it instantiates the MainPage class and calls the instance's get method. Inside the method, information about the request is available using self.request. Typically, the method sets properties on self.response to prepare the response.
Now copy the webapptest folder to google appengine folder and type localhost:8080/ !

learning google appengine in 5 minutes

Creating an App Engine application is easy, and only takes a few minutes.

First you need to download the following packages

  1. Python www.python.org/download/releases/2.5.2/
  2. SDK www.code.google.com/appengine/downloads.html

Creating a Simple Request Handler

Create a directory named helloworld. All files for this application reside in this directory.Inside the helloworld directory, create a file named helloworld.py, and give it the following contents:

print 'Content-Type: text/plain'  
print '' print 'Hello, world!'


This Python script responds to a request with an HTTP header that describes the
content, a blank line, and the message Hello, world!.

Creating the Configuration File

An App Engine application has a configuration file called app.yaml. Among other things, this file describes which handler scripts should be used for which URLs.

Inside the helloworld directory, create a file named app.yaml with the following contents:

application: helloworld
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
script: helloworld.py

Testing the Application

google_appengine/dev_appserver.py helloworld

Type the following URL and enjoy!

http://localhost:8080/










Reference
http://code.google.com/appengine/docs/gettingstarted/