Skip to main content

Home/ Sensorica Knowledge/ Group items tagged script

Rss Feed Group items tagged

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
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
Kurt Laitner

Asia Times Online :: Nondominium - the Caspian solution - 0 views

  • A Caspian partnership The proposal is that the littoral states should form a Caspian Foundation legal entity, and commit to that entity all existing rights in respect of the use, and the fruits of use (usufruct), of the Caspian Sea, and everything on it, in it, or under it. The Caspian Foundation would act as custodian or steward and the nations would have agreed governance rights of veto. This negative or passive veto right of stewardship is very different from conventional property rights of absolute ownership and temporary use under condominium. Moreover, it does not have the active power of control held under common law by a trustee on behalf of beneficiaries, and the legal complexities and management conflicts which go with it. The Caspian Foundation would be a subscriber to a Caspian Partnership framework agreement between the nations, investors of money or money's worth, and a consortium of service providers. This Caspian Partnership would not be yet another international organization, with everything that goes with that. It would not own anything, employ anyone or contract with anyone: it would simply be an associative framework agreement within which Caspian nations self-organize to the common purpose of the sustainable development of the Caspian Sea.
  • Nondominium - the Caspian solution By Chris Cook Twenty-first century problems cannot be solved with 20th century solutions. Nowhere is that saying so true as in territorial disputes where oil and gas are involved. The riches of the Caspian Sea have been the subject of dispute for years, and relatively simple - but still intractable - binary issues between Iran and Russia are now multiplied by the conflicting claims of what are now five littoral Caspian nations: Azerbaijan, Iran; Kazakhstan; Russia and Turkmenistan. Their claims relate not just to rights on the Caspian Sea surface, but to rights in the sea, and above all to the rights to the treasures that lie under it. There are two 20th century legal approaches: international law //ad information var tf_adModel = "FEV"; var tf_adType = "InBannerVideo"; var tf_commonLocation = "http://cdnx.tribalfusion.com/media/common/expand/"; //leave this variable as it is var tf_cookieFlash = "http://cdnx.tribalfusion.com/media/common/TFSObj_v2s"; var tf_isExpansionHandle = true; var tf_floatAdScriptPath = "http://cdnx.tribalfusion.com/media/common/floating/TF_FloatAdLibrary.js"; var tf_zoomFlash = "http://cdnx.tribalfusion.com/media/common/floating/TFScale_v1"; var tf_banner = { "flag" : "inBanner", "width" : 300, "height" : 250, "widthExpanded" : 600, "heightExpanded" : 450, "widthFloating" : 950, "heightFloating" : 570, "iWin" : [ ], "flashFile" : "http://cdnx.tribalfusion.com/media/4523336/Glow_Banner_Square_Template_V201", extraFlashVars:"tf_showPanelonLoad=true&tf_phase2=false", "video_expand" : "http://cdnx.tribalfusion.com/media/4523336/video.flv", "imageFile" : "http://cdnx.tribalfusion.com/media/4523336/300.jpg", "video" : "http://cdnx.tribalfusion.com/media/4523336/video.flv", "clickTag" : "http://bs.serving-sys.com/BurstingPipe/adServer.bs?cn=tf&c=20&mc=click&pli=8816678&PluID=0&ord=619093658", "clickTag1" : "http://bs.serving-sys.com/BurstingPipe/adServer.bs?cn=tf&c=20&mc=click&pli=8816678&PluID=0&ord=619093658", "clickTag2" : "http://bs.serving-sys.com/BurstingPipe/adServer.bs?cn=tf&c=20&mc=click&pli=8816678&PluID=0&ord=619093658", "socialNetworks" : [ ], "video_expand_start" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=0pcLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_midpoint" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=50pcLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_firstQuartile" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=25pcLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_thirdQuartile" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=75pcLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_complete" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=100pcLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_mute" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=MuteLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_unmute" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=UnmuteLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_pause" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=PauseLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_rewind" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=RewindLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_resume" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=ResumeLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_replay" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=ReplayLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_fullscreen" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=FSLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "video_expand_close" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=VCloseLive&ord=619093658&custom1=Video_Expand&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;vo:@video_order@;ph:@phase@", "clickTag_tracking" : "http://a.tribalfusion.com/insights/impression?client=554133&campaign=AdvilEN.AB.CAN.EB.FFG.300_V15(4765995)&mediaSource=fireflyvideo&creative=300x250&event=ClickLive&ord=619093658&custom1=Save 3 Now(Click Tag)&custom2=buyID:8493362;mediaID:4765995;ord:619093658;td:@TIMEDIFFERENCE@;adspaceId:26181;ph:@phase@", "clickTag1_tracking" : "http:
  • A Caspian partnership The proposal is that the littoral states should form a Caspian Foundation legal entity, and commit to that entity all existing rights in respect of the use, and the fruits of use (usufruct), of the Caspian Sea, and everything on it, in it, or under it. The Caspian Foundation would act as custodian or steward and the nations would have agreed governance rights of veto. This negative or passive veto right of stewardship is very different from conventional property rights of absolute ownership and temporary use under condominium. Moreover, it does not have the active power of control held under common law by a trustee on behalf of beneficiaries, and the legal complexities and management conflicts which go with it. The Caspian Foundation would be a subscriber to a Caspian Partnership framework agreement between the nations, investors of money or money's worth, and a consortium of service providers. This Caspian Partnership would not be yet another international organization, with everything that goes with that. It would not own anything, employ anyone or contract with anyone: it would simply be an associative framework agreement within which Caspian nations self-organize to the common purpose of the sustainable development of the Caspian Sea.
  • ...1 more annotation...
  • A Caspian partnership The proposal is that the littoral states should form a Caspian Foundation legal entity, and commit to that entity all existing rights in respect of the use, and the fruits of use (usufruct), of the Caspian Sea, and everything on it, in it, or under it. The Caspian Foundation would act as custodian or steward and the nations would have agreed governance rights of veto. This negative or passive veto right of stewardship is very different from conventional property rights of absolute ownership and temporary use under condominium. Moreover, it does not have the active power of control held under common law by a trustee on behalf of beneficiaries, and the legal complexities and management conflicts which go with it. The Caspian Foundation would be a subscriber to a Caspian Partnership framework agreement between the nations, investors of money or money's worth, and a consortium of service providers. This Caspian Partnership would not be yet another international organization, with everything that goes with that. It would not own anything, employ anyone or contract with anyone: it would simply be an associative framework agreement within which Caspian nations self-organize to the common purpose of the sustainable development of the Caspian Sea.
Tiberius Brastaviceanu

Google Apps Script - introduction - 0 views

  • installing and running existing scripts from the Script Gallery
  • Spreadsheet
  • Insert
  • ...27 more annotations...
  • Install
  • Close
  • Choose a script and click Run
  • The onOpen function adds the Finance menu and the menu item Get Stock to the Spreadsheet
  • the onOpen() function
  • code function onOpen() declares the function and its name
  • code between the curly braces is the code that performs actions when you run the onOpen() function
  • the SpreadsheetApp.getActiveSpreadsheet method to obtain a spreadsheet object representing the currently-active spreadsheet.
  • invoking methods on ss, the script can manipulate the currently-active spreadsheet.
  • method is code that is associate exclusively with a class and performs a particular task on objects of that class
  • insert the column headers into the corresponding cells
  • the getRange() method
  • setValue() method
  • identify
  • arguments
  • You use arguments to pass data to a method.
  • String data
  • is in quotation marks
  • line var row = 2; creates a variable row with an initial value of 2
  • a counter
  • while (true) loop
  • if loop
  • if (!symbol) break; causes the script to exit from the while loop when there is no stock symbol in the variable symbol
  • The exclamation point states a negative (not) condition
  • continues to run, incrementing the row each time until it reaches an empty row
  • the break causes the script to exit from the loop and finish.
  • To comment out the code, put two forward slashes at the beginning of each line:
Tiberius Brastaviceanu

Google Apps Script - introduction - 0 views

  • how to accomplish some common tasks
  • add a custom menu to a Spreadsheet and link specific functions in your script to menu items
  • the menu items, the functions pops up a message box.
  • ...11 more annotations...
  • you will want the custom menu to be displayed as soon as the Spreadsheet is opened. To do this,include an onOpen function in your script
  • array of objects
  • An array is a collection of elements that works something like a Spreadsheet. Each element in an array can be identified by its location in the array, called an index point.
  • Arrays
  • are zero-based
  • Arrays are a convenient way to store and manipulate data within a computer program or script.
  • Each menu item is placed inside curly braces, and this syntax defines each name-function name pair as an object.
  • After the definition of the menu entries comes the definition of the menu itself:
  • Here's generalized code for creating menu items and a menu.
  • The following code pops up a message box when a user selects a menu item on the new menu:
  • the generalized code
Kurt Laitner

Smart contracts · FellowTraveler/Open-Transactions Wiki · GitHub - 0 views

  • Once voting groups are someday eventually added to OT, they will also be able to act as parties to agreements, and they will be able to take a vote in order to change their own bylaws!
    • Kurt Laitner
       
      ah governance
  • Scripted clauses can also be configured to trigger on certain events.
  • Smart contracts are most distinguished by the fact that they can have scriptable clauses
  • ...7 more annotations...
  • The script code is unable to manipulate any assets excepting those explicitly declared beforehand on the smart contract,
  • Not only can the smart contract move_funds() between these declared accounts, as its script logic dictates, but it can also stash_funds() directly inside the contract itself!
  • A smart contract can be activated, after which point it takes on a “life of its own”
  • You can also define variables in your smart contract, which persist through its entire lifetime. As the smart contract—including its internal state—continues to process over time, receipts will continue to drop into the relevant parties’ inboxes,
  • A signed copy of the original smart contract shows it as it was, when the parties first signed and activated it. Additionally, a server-signed, updated version of the contract comes with each receipt, showing the latest state
  • Once the contract expires (or is deactivated) then a finalReceipt is dropped into all relevant inboxes, after which no other receipts are possible for that smart contract.
  • Let’s say a party needs to DIRECTLY trigger one of the clauses on the contract. (Instead of waiting around for it to trigger automatically based on some rule.) For example, perhaps an escrow user wishes to execute a clause in order to DISPUTE THE OUTCOME, or perhaps an arbitrator wishes to activate a clause in order to RENDER A JUDGMENT. OT’s smart contracts can do precisely these sorts of things, limited only by your imagination (and my pre-alpha code.)
Steve Bosserman

Hacker School - 1 views

  •  
    Students at Hacker School might be interested in helping SENSORICA develop Google scripts or sensor applications.
Kurt Laitner

Digital Reality | Edge.org - 0 views

  • When you snap the bricks together, you don't need a ruler to play Lego; the geometry comes from the parts
  • first attribute is metrology that comes from the parts
  • digitizing composites into little linked loops of carbon fiber instead of making giant pieces
  • ...75 more annotations...
  • In a 3D printer today, what you can make is limited by the size of the machine. The geometry is external
  • is the Lego tower is more accurate than the child because the constraint of assembling the bricks lets you detect and correct errors
  • That's the exponential scaling for working reliably with unreliable parts
  • Because the parts have a discrete state, it means in joining them you can detect and correct errors
  • detect and correct state to correct errors to get an exponential reduction in error, which gives you an exponential increase in complexity
  • The next one is you can join Lego bricks made out of dissimilar materials.
  • The last one is when you're done with Lego you don't put it in the trash; you take it apart and reuse it because there's state in the materials. In a forest there's no trash; you die and your parts get disassembled and you're made into new stuff. When you make a 3D print or laser cut, when you're done there's recycling attempts but there's no real notion of reusing the parts
  • The metrology coming from the parts, detecting and correcting errors, joining dissimilar materials, disconnecting, reusing the components
  • On the very smallest scale, the most exciting work on digital fabrication is the creation of life from scratch. The cell does everything we're talking about. We've had a great collaboration with the Venter Institute on microfluidic machinery to load designer genomes into cells. One step up from that we're developing tabletop chip fab instead of a billion dollar fab, using discrete assembly of blocks of electronic materials to build things like integrated circuits in a tabletop process
  • a child can make a Lego structure bigger than themself
  • There's a series of books by David Gingery on how to make a machine shop starting with charcoal and iron ore.
  • There are twenty amino acids. With those twenty amino acids you make the motors in the molecular muscles in my arm, you make the light sensors in my eye, you make my neural synapses. The way that works is the twenty amino acids don't encode light sensors, or motors. They’re very basic properties like hydrophobic or hydrophilic. With those twenty properties you can make you. In the same sense, digitizing fabrication in the deep sense means that with about twenty building blocks—conducting, insulating, semiconducting, magnetic, dielectric—you can assemble them to create modern technology
  • By discretizing those three parts we can make all those 500,000 resistors, and with a few more parts everything else.
  • Now, there's a casual sense, which means a computer controls something to make something, and then there's the deep sense, which is coding the materials. Intellectually, that difference is everything but now I'm going to explain why it doesn't matter.
  • Then in turn, the next surprise was they weren't there for research, they weren't there for theses, they wanted to make stuff. I taught additive, subtractive, 2D, 3D, form, function, circuits, programming, all of these skills, not to do the research but just using the existing machines today
  • What they were answering was the killer app for digital fabrication is personal fabrication, meaning, not making what you can buy at Walmart, it’s making what you can't buy in Walmart, making things for a market of one person
  • The minicomputer industry completely misread PCs
  • the Altair was life changing for people like me. It was the first computer you could own as an individual. But it was almost useless
  • It was hard to use but it brought the cost from a million dollars to 100,000 and the size from a warehouse down to a room. What that meant is a workgroup could have one. When a workgroup can have one it meant Ken Thompson and Dennis Ritchie at Bell Labs could invent UNIX—which all modern operating systems descend from—because they didn't have to get permission from a whole corporation to do it
  • At the PC stage what happened is graphics, storage, processing, IO, all of the subsystems got put in a box
  • To line that up with fabrication, MIT's 1952 NC Mill is similar to the million-dollar machines in my lab today. These are the mainframes of fab. You need a big organization to have them. The fab labs I'll tell you about are exactly analogous to the cost and complexity of minicomputers. The machines that make machines I'll tell you about are exactly analogous to the cost and complexity of the hobbyist computers. The research we're doing, which is leading up to the Star Trek Replicator, is what leads to the personal fabricator, which is the integrated unit that makes everything
  • conducting, resistive, insulating.
  • The fab lab is 2 tons, a $100,000 investment. It fills a few thousand square feet, 3D scanning and printing, precision machining, you can make circuit boards, molding and casting tooling, computer controlled cutting with a knife, with a laser, large format machining, composite layup, surface mount rework, sensors, actuators, embedded programming— technology to make technology.
  • Ten years you can just plot this doubling. Today, you can send a design to a fab lab and you need ten different machines to turn the data into something. Twenty years from now, all of that will be in one machine that fits in your pocket.
  • We've been living with this notion that making stuff is an illiberal art for commercial gain and it's not part of the means of expression. But, in fact, today, 3D printing, micromachining, and microcontroller programming are as expressive as painting paintings or writing sonnets but they're not means of expression from the Renaissance. We can finally fix that boundary between art and artisans
  • You don't go to a fab lab to get access to the machine; you go to the fab lab to make the machine.
  • Over the next maybe five years we'll be transitioning from buying machines to using machines to make machines. Self-reproducing machines
  • But they still have consumables like the motors, and they still cut or squirt. Then the interesting transition comes when we go from cutting or printing to assembling and disassembling, to moving to discretely assembled materials
  • because if anybody can make anything anywhere, it challenges everything
    • Kurt Laitner
       
      great quote (replace challenges with changes for effect)
  • Now, the biggest surprise for me in this is I thought the research was hard. It's leading to how to make the Star Trek Replicator. The insight now is that's an exercise in embodied computation—computation in materials, programming their construction. Lots of work to come, but we know what to do
  • And that's when you do tabletop chip fab or make airplanes. That's when technical trash goes away because you can disassemble. 
  • irritated by the maker movement for the failure in mentoring
  • At something like a Maker Faire, there's hall after hall of repeated reinventions of bad 3D printers and there isn't an easy process to take people from easy to hard
  • We started a project out of desperation because we kept failing to succeed in working with existing schools, called the Fab Academy. Now, to understand how that works, MIT is based on scarcity. You assume books are scarce, so you have to go there for the library; you assume tools are scarce, so you have to go there for the machines; you assume people are scarce, so you have to go there to see them; and geography is scarce. It adds up to we can fit a few thousand people at a time. For those few thousand people it works really well. But the planet is a few billion people. We're off by six orders of magnitude. 
  • Next year we're starting a new class with George Church that we've called "How to Grow Almost Anything", which is using fab labs to make bio labs and then teach biotech in it. What we're doing is we're making a new global kind of university
  • Amusingly, I went to my friends at Educause about accrediting the Fab Academy and they said, "We love it. Where are you located?" And I said, "Yes" and they said, "No." Meaning, "We're all over the earth." And they said, "We have no mechanism. We're not allowed to do that. There's no notion of global accreditation."
  • Then they said something really helpful: "Pretend."
  • Once you have a basic set of tools, you can make all the rest of the tools
  • The way the Fab Academy works, in computing terms, it's like the Internet. Students have peers in workgroups, with mentors, surrounded by machines in labs locally. Then we connect them globally by video and content sharing and all of that. It's an educational network. There are these critical masses of groups locally and then we connect them globally
  • You still have Microsoft or IBM now but, with all respect to colleagues there, arguably that's the least interesting part of software
  • To understand the economic and social implications, look at software and look at music to understand what's happening now for fabrication
  • There's a core set of skills a place like MIT can do but it alone doesn't scale to a billion people. This is taking the social engineering—the character of MIT—but now doing it on this global scale.
  • Mainframes didn't go away but what opened up is all these tiers of software development that weren't economically viable
  • If you look at music development, the most interesting stuff in music isn't the big labels, it's all the tiers of music that weren't viable before
  • You can make music for yourself, for one, ten, 100, 1,000, a million. If you look at the tracks on your device, music is now in tiers that weren't economically viable before. In that example it's a string of data and it becomes a sound. Now in digital fab, it's a string of data and it becomes a thing.
  • What is work? For the average person—not the people who write for Edge, but just an average person working—you leave home to go to a place you'd rather not be, doing a repetitive operation you'd rather not do, making something designed by somebody you don't know for somebody you'll never see, to get money to then go home and buy something. But what if you could skip that and just make the thing?
    • Kurt Laitner
       
      !!!
  • It took about ten years for the dot com industry to realize pretty much across the board you don't directly sell the thing. You sell the benefits of the thing
  • 2016 it's in Shenzhen because they're pivoting from mass manufacturing to enabling personal fabrication. We've set Shenzhen as the goal in 2016 for Fab Lab 2.0, which is fab labs making fab labs
  • To rewind now, you can send something to Shenzhen and mass manufacture it. There's a more interesting thing you can do, which is you go to market by shipping data and you produce it on demand locally, and so you produce it all around the world.
  • But their point was a lot of printers producing beautiful pages slowly scales if all the pages are different
  • In the same sense it scales to fabricate globally by doing it locally, not by shipping the products but shipping the data.
  • It doesn't replace mass manufacturing but mass manufacturing becomes the least interesting stuff where everybody needs the same thing. Instead, what you open up is all these tiers that weren't viable before
  • There, they consider IKEA the enemy because IKEA defines your taste. Far away they make furniture and flat pack it and send it to a big box store. Great design sense in Barcelona, but 50 percent youth unemployment. A whole generation can't work. Limited jobs. But ships come in from the harbor, you buy stuff in a big box store. And then after a while, trucks go off to a trash dump. They describe it as products in, trash out. Ships come in with products, trash goes out
    • Kurt Laitner
       
      worse actually.. the trash stays
  • The bits come and go, globally connected for knowledge, but the atoms stay in the city.
  • instead of working to get money to buy products made somewhere else, you can make them locally
    • Kurt Laitner
       
      this may solve greece's problem, walk away from debt, you can't buy other people's (country's) stuff anymore, so make it all yourself
  • The biggest tool is a ShotBot 4'x8'x1' NC mill, and you can make beautiful furniture with it. That's what furniture shops use
  • Anything IKEA makes you can make in a fab lab
  • it means you can make many of the things you consume directly rather than this very odd remote economic loop
  • the most interesting part of the DIY phone projects is if you're making a do-it-yourself phone, you can also start to make the things that the phones talk to. You can start to build your own telco providers where the users provide the network rather than spending lots of money on AT&T or whoever
  • Traditional manufacturing is exactly replaying the script of the computer companies saying, "That's a toy," and it's shining a light to say this creates entirely new economic activity. The new jobs don't come back to the old factories. The ability to make stuff on demand is creating entirely new jobs
  • To keep playing that forward, when I was in Barcelona for the meeting of all these labs hosted by the city architect and the city, the mayor, Xavier Trias, pushed a button that started a forty-year countdown to self-sufficiency. Not protectionism
  • I need high-torque efficient motors with integrated lead screws at low cost, custom-produced on demand. All sorts of the building blocks that let us do what I'm doing currently rest on a global supply chain including China's manufacturing agility
  • The short-term answer is you can't get rid of them because we need them in the supply chain. But the long-term answer is Shenzhen sees the future isn't mass producing for everybody. That's a transitional stage to producing locally
  • My description of MIT's core competence is it's a safe place for strange people
  • The real thing ultimately that's driving the fab labs ... the vacuum we filled is a technical one. The means to make stuff. Nobody was providing that. But in turn, the spaces become magnets. Everybody talks about innovation or knowledge economy, but then most things that label that strangle it. The labs become vehicles for bright inventive people who don't fit locally. You can think about the culture of MIT but on this global scale
  • My allegiance isn't to any one border, it's to the brainpower of the planet and this is building the infrastructure to scale to that brainpower
  • If you zoom from transistors to microcode to object code to a program, they don't look like each other. But if we take this room and go from city, state, country, it's hierarchical but you preserve geometry
  • Computation violates geometry unlike most anything else we do
  • The reason that's so important for the digital fabrication piece is once we build molecular assemblers to build arbitrary systems, you don't want to then paste a few lines of code in it. You need to overlay computation with geometry. It's leading to this complete do-over of computer science
  • If you take digital fab, plus the real sense of Internet of Things—not the garbled sense—plus the real future of computing aligning hardware and software, it all adds up to this ability to program reality
  • I run a giant video infrastructure and I have collaborators all over the world that I see more than many of my colleagues at MIT because we're all too busy on campus. The next Silicon Valley is a network, it's not a place. Invention happens in these networks.
  • When Edwin Land was kicked out of Polaroid, he made the Rowland Institute, which was making an ideal research institute with the best facilities and the best people and they could do whatever they want. But almost nothing came from it because there was no turnover of the gene pool, there was no evolutionary pressure.  
  • the wrong way to do research, which is to believe there's a privileged set of people that know more than anybody else and to create a barrier that inhibits communication from the inside to the outside
  • you need evolutionary pressure, you need traffic, you need to be forced to deal with people you don't think you need to encounter, and you need to recognize that to be disruptive it helps to know what people know
  • For me the hardest thing isn't the research. That's humming along nicely. It's that we're finding we have to build a completely new kind of social order and that social entrepreneurship—figuring out how you live, learn, work, play—is hard and there's a very small set of people who can do that kind of organizational creation.
    • Kurt Laitner
       
      our challenge in the OVN space
  •  
    what is heavy is local, what is light is global, and increasingly manufacturing is being recreated along this principle
1 - 13 of 13
Showing 20 items per page