User Tools

Site Tools


Sidebar

Top
Seminar
Courses
Textbooks
Documents
Downloads (-2016)
Downloads (2016-)
Weblog
RSS aggregates
Discussions
Archives


EMBL BioImage Data Analysis

EuBIAS

NEUBIAS

—- Contact
CMCI Alumni
ALMF
EMBL Heidelberg
EMBL Intranet


Popularity Ranking


Timeline of @cmci_

cmci_ avatar

RT @biomicugm: Topics: Biostatistics, computational evolutionary biology, computational genomics and proteomics, graph models, image analys…
About 4 days, 16 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @JustinMCrocker: We are looking for an interdisciplinary EIPOD postdoc to join our group @EMBL! Potential projects with @Eileen_Furlong,…
About 4 days, 16 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @BioImagingUK: This maybe of interest to the @NEUBIAS_COST @openmicroscopy communities #imageAnalysis #imagingScientist https://t.co/I5
About 4 days, 16 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @BioImagingUK: Software developer position on large image data analysis - working closely with the lab of @bayraktar_lab @sangerinstitut…
About 1 week, 2 days ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @AssafZaritsky: Modeling the interplay of lamellipodial motion and the intercellular actomyosin cable during epithelial wound healing h…
About 1 week, 2 days ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @jytinevez: @florianjug says be careful when using #CARE for intensity based quantification; CARE restoration is like a non linear trans…
About 1 week, 4 days ago by: Kota Miura (@cmci_)
blogtng:blogtop
Algorithm FRAP Fiji ImageJ ImageJ Plugin ImageJ Plugin 3Dviewer Imaris Java Javascript Python R bias blog dokuwiki fiji google imagej java libraries matlab meetings neubias news papers python references software webadmin




CMCI weblog

google APPs script: transferring name list in google spread sheet to google contacts.

A bit for the convenience of organizing a course:

1. Student registration by google Forms

2. Using the automatically generated name, email address, units, sort each student to a class and store them in google contacts. google APPs script, javascripting

First part is more or less interactive, and second part code is as shown below.

//made on 100615 kota Miura
// for sorting student list in Google spread sheet (collected by forms), 
// storing contacts in google contacts and also associate with each class. 
//

function storeNamesInContacts() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheets()[0];
  var studentDataRange = sheet.getRange("A2:L29");
  // For every row of student data, generate an student object.  
  var studentObjects = getRowsData(sheet, studentDataRange); //right hand side is a custom functon in the tutorial
  var thirdst = studentObjects[2];

  var gp1 = ContactsApp.findContactGroup("BasicCourse201006a");
  if (gp1 == null) {
    var gp1 = ContactsApp.createContactGroup("BasicCourse201006a");
  }
  var gp2 = ContactsApp.findContactGroup("BasicCourse201006b");
  if (gp2 == null) {
    var gp2 = ContactsApp.createContactGroup("BasicCourse201006b");  
  }    
  for (i=0; i<studentObjects.length; i++){
    if ((studentObjects[i].course == 1) || (studentObjects[i].course == 2)) { 
      nc = ContactsApp.createContact(FirstNameFrom(studentObjects[i].name), LastNameFrom(studentObjects[i].name), studentObjects[i].email);
      if (studentObjects[i].course == 1) nc.addToGroup(gp1);
      if (studentObjects[i].course == 2) nc.addToGroup(gp2); 
      stringtodisp = "name "+ nc.getFullName()+"\n email "+ nc.getEmailAddresses()[0] + " course =" + studentObjects[i].course;
      //Browser.msgBox(stringtodisp);     
     }
  }
}

function FirstNameFrom(fullname) {
  var key = "";
  var upperCase = false;
  for (var i = 0; i < fullname.length; ++i) {
    var letter = fullname[i];
    if (letter == " " && key.length > 0) {
      i = fullname.length;
    } else {
      key += letter;
    }
  }
  return key;
}

function LastNameFrom(fullname) {
  var key = "";
  var laststarts = false;
  for (var i = 0; i < fullname.length; ++i) {
    var letter = fullname[i];
    if (letter == " ") {
      laststarts = true;
    } else {
      if (laststarts ){
        key += letter;
      }
    }
  }
  return key;
}

At the bottom of above script, “Library” in the link below should be copied and pasted in the same file. http://www.google.com/google-d-s/scripts/reading_spreadsheet_data.html

entry generator

Weblog Archive

blogtng/blogtop.txt · Last modified: 2016/05/24 05:46 (external edit)