May 16, 2013

Send your name & message to Mars!


Go to Mars with MAVEN! 
Submit your name and a message to be sent into Mars orbit on the MAVEN spacecraft.

May 6, 2013

A small google translator

This example show how to use the textArea and retrieve the content when I submit the value.


1:    function doGet() {  
2:     var app = UiApp.createApplication();  
3:     //create a penel which will hold all the elements  
4:     var panel = app.createVerticalPanel();  
5:     var label1 = app.createLabel('Write the text to translate');  
6:     //Create text area which will hold the source text  
7:     var textArea1 = app.createTextArea().setId('originText').setName('originText').setWidth('300').setHeight('100');     
8:     textArea1.setText('Roma รจ la capitale d\'Italia');  
9:     //Create a button  
10:     var button = app.createButton('Translate');  
11:     var label2 = app.createLabel('Taranslated text:');  
12:     //Create text area which will hold translated text  
13:     var textArea2 = app.createTextArea().setId('destitinationText').setWidth('300').setHeight('100');        
14:     //Create a click handler which will call the translate function  
15:     var handler = app.createServerClickHandler('translate');  
16:     handler.addCallbackElement(textArea1); // This row is important  
17:     button.addClickHandler(handler);     
18:     //add all the elemnts to the panel  
19:     panel.add(label1).add(textArea1).add(button).add(label2).add(textArea2);     
20:     //Add the panel to the application   
21:     app.add(panel);   
22:     return app;  
23:    }  
24:    function translate(e){  
25:     //Get the current activae application  
26:     var app = UiApp.getActiveApplication();  
27:     //get the source text of TextArea1     
28:     var text = e.parameter.originText;  
29:     //Now translate the text  
30:     var translatedText = LanguageApp.translate(text, 'it', 'en');  
31:     //set the text of text area 2 as the translated text  
32:     app.getElementById('destitinationText').setText(translatedText);  
33:     return app;  
34:    }  


May 4, 2013

The crisis generated


In this video the author says that the crisis was created in such a way that countries lose their sovereignty.
The fund MES is a huge waste grant.
Behind all this there are lobbies that seek to take over the world.

Is it true?
Maybe you should inform us better and we are very careful

May 1, 2013

May 1 - Labor Day

Today, May 1 is Labor Day weekend, and considering that many people are out of work then there are

plenty to celebrate this day.

A phrase of Pope Francis says: "the company is not right if it gives everyone a job or exploits workers"

then goes on to say:


"Dreams are the driving force of our life, never stop dreaming".




Apr 29, 2013

Retrieve and fill a document with your google contacts using Google Scripts

 function myFunction() {   
  // Create a new document  
  var doc = DocumentApp.create('MyContactsList');  
  //loop all contacts and put them inside the document   
  var contacts = ContactsApp.getContacts();  
  for (var i=0; i<contacts.length; i++)  
  {  
   if ( contacts[i].getFullName() != '' )   
   {  
    try  
    {  
     doc.appendParagraph(contacts[i].getFullName() + ' ' +   
                       contacts[i].getEmails()[0].getAddress() );  
    }  
     catch(e)  
    {  
      doc.appendParagraph(contacts[i].getFullName() + ' without email' );    
    }     
   }  
  }   
  // Save and close the document  
  doc.saveAndClose();  
  // Get the URL of the document  
  var url = doc.getUrl();  
  // Get the email address of the active user - that's you  
  var emailAddress = Session.getActiveUser().getEmail();   
  GmailApp.sendEmail(emailAddress,'Your contact list',   
      'The document filled with your contacts is here: ' + url);  
 }