//
archives

Google

This category contains 4 posts

Origin http://127.0.0.1:8888 is not allowed by Access-Control-Allow-Origin – GWT Debugging

During GWT debugging, if you are making a RequestBuilder on a different domain without using JSONP, you may have this problem.
To fix it you must configure Header in order to accept requests from other domains. In Apache HTTP Server you can set them in the VirtualHost configuration of bar.com using the directive Header set.

 
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "X-Requested-With"

Or better filtering by your origin – see also https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Allow-Origin


Header set Access-Control-Allow-Origin "http://foo.com"
Header set Access-Control-Allow-Headers "X-Requested-With"

Consuming Google Translate API with Python

Google just released the beta version of the Python API Client  for their APIs – http://code.google.com/p/google-api-python-client. Just to try how does it works here a very short example for a command line translator from italian to english.

The result is a simple program that in input takes an Italian sentence and writes in output the English translation.

#>python translate.py 'nel mezzo del cammin di nostra vita'
Your [nel mezzo del cammin di nostra vita] is
... [in the middle of the journey of our life]

To write this simple program you have to install the Python API - http://code.google.com/p/google-api-python-client/wiki/Installation. After just create a new file translate.py and copy and paste the following code


#!/usr/bin/python2.4
# -*- coding: utf-8 -*-

“”"Italian to English Translate API exaple
“”"

__author__ = ‘giulio.roggero@gmail.com’

from apiclient.discovery import build

import pprint
import getopt
import argparse
import json

def main():

parser = argparse.ArgumentParser()
parser.add_argument(‘words’)

args = parser.parse_args()
print “Your [" + args.words + "] is”

service = build(‘translate’, ‘v2′,
developerKey=’AIzaSyDKIH5TfJKNjtbknd-KUZvRrBJA7DXKy40′)
jsonres = service.translations().list( source=’it’, target=’en’, q=[args.words]).execute()

print “… [" + jsonres['translations'][0]['translatedText'] + “]”

if __name__ == ‘__main__’:
main()

Please update the developerKey with your dev key activating the API in the API Console - https://code.google.com/apis/console

Android VS Chrome OS – the future of Operating Systems

Chrome OS or Android 3.0? This question fulfills the google page. Try to search for “Chrome OS vs Android ” and more than 36 Milion of result are listed!

A lot of different opinion are expressed: “Chrome OS will be the only one”, “android is the most used”, “this comparison is not correct beacause are two different system with two different targets”, and so on….

My opinion is that Google has developed Google Chrome to manage it’s destiny (as Jeff Jarvis wrote in the book “What Would Google Do”).

Therefore both Android and Google Chrome OS are just enablers and hosting for the Chrome Browser. Both platforms will survive and may be other platforms will be developed but the main object of Google is to simplify the access to the Web and to Web Apps. This is why Chrome.

It’s not surprising that Chrome works very well on Windows, MacOS and Linux. Chrome is a pervasive open source platform where all your stuff are synchronized and ready to run.

Google is creating a real distributed operating system, step by step, using Chrome and the Internet. Therefore my opinion is that it’s not important if will survive Android or Google Chrome OS because the Web will be the final Operating System.

For new applications I bet that HTML5 will be the common platform and the Internet the common Infrastructure, Google is moving in this direction. And also the competitors like Apple and Microsoft.

Using gmail as a platform


Google offers the possibility to extend gmail and to create products and services over gmail using the gmail contextual gadgets.

Some examples of existend contextual gadget are the you tube video preview and the feature “Also include” in the CC/BCC (activable via gmail->settings->labs).

I’m going to develop a POC for organizing email and attachments like itsme project. I don’t know if this is already possible in gmail but I’ll try.

In the next future gmail may get more relevance as platform if Google will continue to develop more sophisticated extensions.

Updates on this project will follow in the next weeks!

Twitter Updates

Follow

Get every new post delivered to your Inbox.

Join 67 other followers