Wednesday, April 30, 2014

Flow Rate and Conservation: Water and Bytes

HWT Image Library
During my short shower this morning, the water pressure was a little low as a result of the water supply line relocation. Residents have been asked to reduce water consumption during this time.

Network bandwidth is similar to water flow, it's a somewhat limited resource. Soon all schools will have a 100 Mbit connection to Central, and there should be lots of bandwidth to the Internet from there. However despite continuing efforts by Tech Services to open up a bigger pipe, demand will often outstrip supply.

While a 100 Mbit connection is a decent speed, as more devices and users connect we need to be cognizant that it is for the entire staff and student population. Technical measures are in place to limit individual connection speeds, particularly on the schoolguest Wi-Fi networks, but there are only a certain number of streaming videos that can be watched simultaneously.

Part of digital citizenship education for students is discussion about mindful and appropriate use. For example you can remind them about using streaming music sites such as Songza, Grooveshark, or rather than having YouTube music videos playing while they work (video uses approximately 40 times as much bandwidth as audio).

Of course this will become a more pressing concern as more schools implement "bring your own device" (BYOD) and require students to use their devices for educational activities.

Wednesday, April 9, 2014

Check if Google Apps Users Have Logged in (Google Apps Script)

If you're using Google Apps for Education (with the provisioning API enabled) and have a list of domain users that you want to check if they've logged in or not, here's a quick Spreadsheet script you can try. It queries to see if the user has agreed to the terms or not. Of course you'll need to run this from an account that has admin permissions on your domain.

function onOpen() {
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var entries = [{name : "Start Checking", functionName : "startLoop"}];
  spreadsheet.addMenu("Check Users", entries);

function startLoop() {
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var activeSheet = sheet.getActiveSheet();
  var maxRows = activeSheet.getMaxRows();
  var result = Browser.msgBox('This script will check ' + maxRows + ' rows worth of data from the currently selected cell.', Browser.Buttons.OK_CANCEL);
  if (result != 'cancel') {
    for (var i=0;i<maxRows;i++) {checkUser();}
  } else {Browser.msgBox('Okay, maybe some other time');}

function checkUser() {
  var sheet = SpreadsheetApp.getActiveSheet();
  var range = SpreadsheetApp.getActiveRange();
  var newRange =  range.offset(0, 1);
  var username = range.getValue();
  var user = UserManager.getUser(username);
  var agreedToTerms = user.getAgreedToTerms();
  var newSelection = range.offset(1, 0);

I'm assuming that you're somewhat familiar with Google Apps Script and using it with Spreadsheets. Let me know in the comments if you need clarification.