Skip to main content

Home/ Sensorica Knowledge/ Group items tagged google

Rss Feed Group items tagged

Tiberius Brastaviceanu

Google Apps Script - introduction - 0 views

  • control over Google products
  • can access and control Google Spreadsheets and other products
  • scripts
  • ...44 more annotations...
  • run directly on Google servers in order to provide direct access to the products they control.
  • can also use Google Apps Script from Google Sites
  • Google Apps Script Template Gallery
  • Google Apps Script Blog
  • guide contains the information you need to use Google Apps Script, a server-side scripting language, based on JavaScript, that runs on Google's servers alongside Google Apps
  • enable varying degrees of interactivity among the applications
  • easy enough to use that you don't have to be a programmer to create scripts.
  • use it to automate complex tasks within Google Apps
  • You don't have to be a programmer to use Google Apps Script
  • A script is a series of instructions you write in a computer language to accomplish a particular task. You type in the instructions and save them as a script. The script runs only under circumstances you define.
  • The Google Apps Script API provides a set of objects. You can use these objects and their associates methods to access Google Docs and Spreadsheets, Gmail, Google Finance, and other Google applications.
  • To run a script, you must first add the script to a Google Spreadsheet or Google Site using the Script Editor.
  • You can retrieve information from a wide selection of Google Apps and Services and from external sources, including web pages and XML sources. You can use Google Apps Script to create email, spreadsheets, pages on Google Sites, and files in the Google Docs Document List.
  • The instructions in a script are grouped into functions.
  • objects
  • methods
  • for such tasks
  • Create pages on a Google Site
  • Customize a Spreadsheet
  • Send email based on information in a Spreadsheet
  • You can manipulate
  • numeric
  • financial
  • string
  • an XML document
  • controlling data in the following applications
  • Spreadsheets
  • Google Document List
  • Contacts
  • Calendar
  • Sites
  • Google Maps
  • create and display interactive user interface elements
  • interact with relational database management systems
  • create folders, subfolders, and files in the Google Docs document list
  • access to user, session, and browser information
  • access to web services
  • extract data from XML documents and then manipulate that data
  • obtain translations of text from one language to another
  • send email
  • UrlFetch services
  • encode and decode strings and format dates
  • store properties on a per-script and per-user basis
  • create, delete and update contact information for individuals and for groups in Google Contacts
Tiberius Brastaviceanu

Google Apps Script - introduction - 0 views

  • Use the Script Editor to write and run scripts, to set triggers, and to perform other actions such as sharing scripts.
  • start the Script Editor from a Google Site
  • declares a function called myFunction()
  • ...69 more annotations...
  • You can perform the following tasks from the Script Editor.
  • pening, deleting, renaming, and saving scripts
  • Cutting, copying, and pasting text
  • Find and replace
  • Setting a time zone
  • scripts with time-based triggers
  • Running functions
  • Viewing log messages
  • revision history
  • write pseudocode first
  • When you're planning a script
  • narrative version of what the script needs to do.
  • A particular script is associated with one and only one Google Spreadsheet.
  • If you make a copy of the Spreadsheet, the script is also copied.
  • A particular Spreadsheet can have multiple scripts associated with it.
  • use the onOpen event handler in more than one script associated with a particular Spreadsheet, all scripts begin to execute when you open the Spreadsheet and the order in which the scripts are executed is indeterminate.
  • event handler is a function executed when a particular event takes place.
  • see Running Scripts in Response to an Event.
  • A script cannot currently call or create another script and cannot call functions in another script.
  • If you want to store the results of a function, you must copy them into a spreadsheet cell.
  • You can trigger Apps Script events from links that are embedded in a Google Site. For information about how to do this, see Using Apps Scrip in Your Ssite.
  • You can insert a script into a Site as a gadget.
  • you must grant permission for the script to run as a service.
  • You also designate whether only you can invoke the service or whether all members of your domain can invoke the service.
  • you can assign functions within the script any arbitrary name.
  • The instructions in a function must be enclosed within curly braces.
  • event handler
  • when a spreadsheet is opened,
  • when a script is installed
  • when a spreadsheet is edited
  • at times you choose
  • menu item
  • Using a drawing or button embedded in a Spreadsheet
  • Using a custom function that is referenced as a Spreadsheet function
  • Clicking the Run button
  • object-oriented programming languages
  • Google Apps Script uses the JavaScript language.
  • Operations
  • are performed using the objects and methods described in the API documentation.
  • An API provides pre-packaged code for standard tasks you need to accomplish in scripts or programs.
  • API includes objects that you use to accomplish tasks such as sending email, creating calendar entries
  • A method describes the behavior of an object and is a function attached to an object.
  • MailApp
  • use to create and send email
  • To send email, you invoke the sendEmail method and provide values for the method arguments.
  • Google Apps Script can access or retrieve data in different formats in different ways.
  • A custom function
  • is called directly from a cell in a Spreadsheet using the syntax =myFunctionName()
  • they cannot set values outside the cells
  • have some restrictions not shared by other functions
  • cannot send email
  • cannot operate on a Google Site
  • cannot perform any operations that require user authorization
  • cannot perform any operations that require knowledge of who the user
  • onInstall function
  • onOpen function
  • Other functions run when you run them manually or when they are triggered by clicking
  • Custom functions and formulas in the spreadsheet execute any time the entire Spreadsheet is evaluated or when the data changes in the function or formula's cell.
  • share the Spreadsheet
  • publish the script to the Script Gallery
  • spreadsheet template
  • the color coding for that line will not be correct
  • A script with incorrect syntax or other errors does not run.
  • The Script Editor includes a debugger.
  • view the current state of variables and objects created by a script while that script runs.
  • step through the code line by line as it executes or set breakpoints
  • The debugger does not work with custom functions, onEdit functions, event triggers, or scripts running as a service.
  • use the debugger to find errors in scripts that are syntactically correct but still do not function correctly.
  • Functions ending in an underscore (_), for example, internalStuff_(), are treated differently from other functions. You do not see these function in the Run field in the Script Editor and they do not appear in the Script Manager in the Spreadsheet. You can use the underscore to indicate that users should not attempt to run the function and the function is available only to other functions.
Tiberius Brastaviceanu

Google Apps Script - introduction - 0 views

  • Google Apps Script provides you with the ability to build a user interface for displaying or capturing information.
  • Viewing the Available User Interface Elements
  • Your scripts can display the user interface in two ways:
  • ...48 more annotations...
  • from a Spreadsheet
  • from a Site
  • As a stand-alone servlet
  • Deciding Whether to Run a Script from a Spreadsheet or as a Service
  • The built-in code autocomplete functionality in the editor requires you to type the trailing period that follows app.
  • Plan the script. What tasks should the script accomplish?
  • Write down the specific information you want to display to or collect from your users.
  • Draw the user interface
  • Determine what the script and interface should do in response to any user input.
  • Determine the conditions for exiting the script.
  • you need a UiApp application object to contain the user interface elements. After you create the UiApp application object, you can add buttons, dialog boxes, panels, and other elements to the UiApp application object.
  • The general syntax for these operations is as follows:
  • To create a UiApp application object, use the syntax var your_application_object_name = UiApp.createApplication();
  • To create a user interface element and associate it with your UiApp application object, use the syntax var your_ui_element_name= your_application_object_name.createElement_Name();.
  • To add one user interface element to another
  • use the syntax your_ui_element_name1.add(your_ui_element_name2);
  • a button with the text Press Me on it:
  • creates a vertical panel.
  • other kinds of panels
  • pop-up panels, stack panels, focus panels, form panels, and so on.
  • code for displaying your button on the panel:
  • add the panel to the application:
  • nstruct Google Apps Script to display the interface elements:
  • You can create the user interface elements in any order.
  • the display order
  • Creating the elements and adding them to your application are separate steps requiring separate instructions.
  • a short script that does nothing but display a panel with a button on it.
  • You can chain together setter methods
  • sets its title
  • set the size of the object:
  • how to use Grid objects and the setWidget method to create a more complex layout and also how to create text boxes and label them.
  • To make a user interface useful, you need the ability to update a Spreadsheet with information a user enters from the interface.
  • a short script that responds to an action in the interface by updating the Spreadsheet.
  • looping structure in the script to keep the panel displayed and active
  • Server-side means that the actions are performed by a server
  • same script, with functions added that enable the form to be used multiple times before a user chooses to exit.
  • script collects some information from text fields on a panel and writes that information into the Spreadsheet.
  • You can make a script's user interface available to users from inside a Spreadsheet or Site or by running it separately as a service.
  • how to make the user interface as a service.
  • A script that provides a stand-alone user interface must invoke the doGet(e) function or the doPost(e) function for an HTML form submit.
  • A script that provides the user interface from the Spreadsheet invokes doc.show(app).
  • The doGet(e) function takes the argument e, passing in the arguments for the user interface, including the user name of the person invoking the script.
  • After you write the script, you publish it as a service. During the publishing process, you define who has access to the script.
  • In a Google Apps domain, you can publish the script so that only you have access or so that everyone in the domain has access.
  • In a Google consumer account, you can publish the script so that only you have access or so that everyone in the world has access.
  • Updating a Spreadsheet from the User Interface, the user interface is displayed from the Spreadsheet where the script is stored. The following code defines how the user interface is displayed:
  • Here's the skeleton code for displaying a user interface as a stand-alone service:
  • some aspects of the two ways to display a user interface.
Tiberius Brastaviceanu

Google Apps Script - introduction - 0 views

  • script that you want to run every day at a specific time
  • script that should run after a user submits a data-collection form.
  • Google Apps Script provides simple event handlers and installable event handlers, which are easy ways for you to specify functions to run at a particular time or in response to an event.
  • ...39 more annotations...
  • let's consider the terminology we use for events
  • event triggers
  • triggers
  • in response
  • event handler
  • event
  • onInstall function
  • onOpen function.
  • onEdit function
  • the simple event handlers are restricted in what they are permitted to do:
  • The spreadsheet containing the script must be opened for editing
  • cannot determine the current user
  • cannot access any services that require authentication as that user
  • Calendar, Mail and Site are not anonymous and the simple event handlers cannot access those services.
  • can only modify the current spreadsheet. Access to other spreadsheets is forbidden.
  • see Understanding Permissions and Script Execution.
  • The onOpen function runs automatically when a user opens a spreadsheet.
  • add custom menu items to the spreadsheet's menu bar.
  • onEdit function runs automatically when any cell of the spreadsheet is edited.
  • record the last modified time in a comment on the cell that was edited.
  • The onInstall function is called when a script is installed from the Script Gallery.
  • setting up custom menus for the user.
  • the script can call onOpen from onInstall.
  • Installable event handlers are set on the Triggers menu within the Script Editor, and they're called triggers in this document.
  • When a specific time is reached
  • When a form is submitted
  • When a Spreadsheet is edited
  • When a Spreadsheet is opened.
  • They can potentially access all services available to the user who installed the handler.
  • are fully-capable scripts with none of the access limitations of simple event handlers
  • may not be able to determine which user triggered the event being handled
  • The spreadsheet containing the script does not have to be open for the event to be triggered and the script to run.
  • You can connect triggers to one or more functions in a script. Any function can have multiple triggers attached. In addition, you can add trigger attributes to a function to further refine how the trigger behaves.
  • When a script runs because of a trigger, the script runs using the identity of the person who installed the trigger, not the identity of the user whose action triggered the event. This is for security reasons.
  • Installing an event handler may prompt for authorization to access
  • An event is passed to every event handler as the argument (e). You can add attributes to the (e) argument that further define how the trigger works or that capture information about how the script was triggered.
  • an example of a function that sends email to a designated individual containing information captured by a Spreadsheet when a form is submitted.
  • With Google Apps, forms have the option to automatically record the submitter's username, and this is available to the script as e.namedValues["Username"]. Note: e.namedValues are only available for Google Apps domains and not for consumer Google accounts.
  • The available attributes for triggers are described in the following tables.
  •  
    script that you want to run every day at a specific time
Kurt Laitner

Inequality: Why egalitarian societies died out - opinion - 30 July 2012 - New Scientist - 0 views

  • FOR 5000 years, humans have grown accustomed to living in societies dominated by the privileged few. But it wasn't always this way. For tens of thousands of years, egalitarian hunter-gatherer societies were widespread. And as a large body of anthropological research shows, long before we organised ourselves into hierarchies of wealth, social status and power, these groups rigorously enforced norms that prevented any individual or group from acquiring more status, authority or resources than others.*
  • How, then, did we arrive in the age of institutionalised inequality? That has been debated for centuries. Philosopher Jean-Jacques Rousseau reasoned in 1754 that inequality was rooted in the introduction of private property. In the mid-19th century, Karl Marx and Friedrich Engels focused on capitalism and its relation to class struggle. By the late 19th century, social Darwinists claimed that a society split along class lines reflected the natural order of things - as British philosopher Herbert Spencer put it, "the survival of the fittest". (Even into the 1980s there were some anthropologists who held this to be true - arguing that dictators' success was purely Darwinian, providing estimates of the large numbers of offspring sired by the rulers of various despotic societies as support.)
  • But by the mid-20th century a new theory began to dominate. Anthropologists including Julian Steward, Leslie White and Robert Carneiro offered slightly different versions of the following story: population growth meant we needed more food, so we turned to agriculture, which led to surplus and the need for managers and specialised roles, which in turn led to corresponding social classes.
  • ...8 more annotations...
  • One line of reasoning suggests that self-aggrandising individuals who lived in lands of plenty ascended the social ranks by exploiting their surplus - first through feasts or gift-giving, and later by outright dominance
  • At the group level, argue anthropologists Peter Richerson and Robert Boyd, improved coordination and division of labour allowed more complex societies to outcompete the simpler, more equal societies
  • From a mechanistic perspective, others argued that once inequality took hold - as when uneven resource-distribution benefited one family more than others - it simply became ever more entrenched. The advent of agriculture and trade resulted in private property, inheritance, and larger trade networks, which perpetuated and compounded economic advantages.
  • Many theories about the spread of stratified society begin with the idea that inequality is somehow a beneficial cultural trait that imparts efficiencies, motivates innovation and increases the likelihood of survival. But what if the opposite were true?
  • In a demographic simulation that Omkar Deshpande, Marcus Feldman and I conducted at Stanford University, California, we found that, rather than imparting advantages to the group, unequal access to resources is inherently destabilising and greatly raises the chance of group extinction in stable environments.
  • Counterintuitively, the fact that inequality was so destabilising caused these societies to spread by creating an incentive to migrate in search of further resources. The rules in our simulation did not allow for migration to already-occupied locations, but it was clear that this would have happened in the real world, leading to conquests of the more stable egalitarian societies - exactly what we see as we look back in history.
  • In other words, inequality did not spread from group to group because it is an inherently better system for survival, but because it creates demographic instability, which drives migration and conflict and leads to the cultural - or physical - extinction of egalitarian societies.
  • Egalitarian societies may have fostered selection on a group level for cooperation, altruism and low fertility (which leads to a more stable population), while inequality might exacerbate selection on an individual level for high fertility, competition, aggression, social climbing and other selfish traits.
Kurt Laitner

The Link Economy and Creditright - Geeks Bearing Gifts - Medium - 3 views

  • Online, content with no links has no value because it has no audience
  • News Commons used Repost as the basis of a content- and audience-sharing network among dozens of sites big and small in the state’s new ecosystem
  • Huffington Post and Twitter can get thousands of writers — including me — to make content for free because it brings us audience and attention.
  • ...25 more annotations...
  • Consider an alternative to syndication. I’ll call it reverse syndication. Instead of selling my content to you, what say I give it to you for free? Better yet, I pay you to publish it on your site. The condition: I get to put my ad on the content. I will pay you a share of what I earn from that ad based on how much audience you bring me.
  • That model values the creation of the audience
  • If content could travel with its business model attached, we could set it free to travel across the web, gathering recommendations and audience and value as it goes
  • She searched Google for “embeddable article” and up came Repost.us, already created by entrepreneur and technologist John Pettitt. Repost very cleverly allowed embeddable articles to travel with the creator’s own brand, advertising, analytics, and links.
  • First, he found that the overlap in audience between a creator’s and an embedder’s sites generally ran between 2 and 5 percent. That is to say, the embedders brought a mostly new audience to the creator’s content.
  • Instead, Pettitt found that click-through ran amazingly high: 5 to 7 percent — and these were highly qualified clicks of people who knew what they were going to get on the other side of a link
  • I call this creditright. We need a means to attach credit to content for those who contribute value to it so that each constituent has the opportunity to negotiate and extract value along the chain, so that each can gain permission to take part in the chain, and so that behaviors that benefit others in the chain can be rewarded and encouraged
    • Kurt Laitner
       
      so *net basically, or OVN contributory value accounting
  • Each creator’s ads traveled with its content — though that wasn’t necessarily optimal, because an ad for a North Jersey hairdresser wouldn’t perform terribly well with South Jersey readers brought in through embedding.
  • key factor in its failure: Repost could find many sites willing and eager to make their content embeddable. It didn’t find enough sites to embed the content.
  • But the embedders got nothing aside from the free use of content — content that was just a link away anyway
  • Our ultimate problem in media is that we do not have sufficient technical and legal frameworks for alternate business models.
  • That formula was the key insight behind Google: that links to content are a signal of its value; thus, the more links to a page from sites that themselves have more links, the more useful, relevant, or valuable that content is likely to be
  • Silicon Valley’s: Those people are your fans who are bringing value to you by sending you audiences and by contributing their creativity, and you’d be wise to build your businesses around making it easier, not harder, for them to get and share your content when and how they want it.
  • And so, we came to agree that we need new technological and legal frameworks flexible enough to enable multiple models to support creativity.
  • Hollywood’s side: People who download our content without buying it or who remix it without our permission — and the platforms that facilitate these behaviors — are stealing from us and must be stopped and punished.
  • Imagine you are a songwriter. You hear a street poet and her words inspire you to write a song about her, quoting her in the piece. You go to a crowdfunding platform — Kickstarter, Indiegogo, or Patreon — to raise money for you to go into the studio and perform and distribute your song. Another songwriter comes along and remixes it, making a new version and also sampling from others’ songs. Both end up on YouTube and Soundcloud, on iTunes and Google Play. Audience members discover and share the songs. A particularly popular artist shares the remixed version on Twitter and Facebook and it explodes. A label has one of its stars record it. The star appears on TV performing it. A movie studio includes that song in a soundtrack. There are many constituents in that process: the subject, the songwriter, the patrons, the fans, the remixer, the distributor, the label, the star, the show, the studio, and the platforms. Each contributed value.
  • Each may want to recognize value — but not all will want cash. There are other currencies in play: The poet may want credit and fame; the songwriter may want to sell concert tickets; the patrons may want social capital for discovering and supporting a new artist; the remixer may want permission to remix; the platforms may want a cut of sales or of subscription revenue; the show may want audience and advertising; the studio will want a return on its investment and risk.
  • I’ve suggested they would be wiser to seek another currency from Google: data about the users, helping build better services for readers and advertisers and thus better businesses
  • We will need a way to attach metadata to content, recording and revealing its source and the contributions of others in the chain of continuing creation and distribution.
  • We need a marketplace to measure and value their contributions and a means to negotiate rewards and permissions
  • We need payment structures to handle multiple currencies: data as well as money
  • And we need a legal framework to allow the flexible exploration of new models, some of which we cannot yet imagine.
  • It took many more years for society to develop principles of free speech to balance the economic and political interests of those who would attempt to control a new tool of speech.
  • We must reimagine the business of media and news from the first penny, asking where value is created, who contributes to it, where it resides, and how to extract it
  • Thus, we need new measures of value
1 - 20 of 473 Next › Last »
Showing 20 items per page