Fuzzy Matches in Google Sheets

When trying to build our curriculum inventory I needed to match thousands of strings in Google Sheets. Doing this manually would have been tedious and prone to error. The EQ function would fail if there was one character different, forget about objectives that had words shifted around. Here’s my script that outputs the percentage of string A that is present in string B averaged with the percentage of string B that is in string A. I found that anything over 40% seems to be semantic match.

function howMuchMatches(string1, string2) {
 
  // clean both strings
  var array1 = string1.trim().toLowerCase().replace(/[^\w\s\d]/g,"").split(" ");
  var array2 = string2.trim().toLowerCase().replace(/[^\w\s\d]/g,"").split(" ");
  
  // how much of string1 is in string2
  var numberOfMatches12 = 0;
  
  for (i=0; i < array1.length; i++) {
    if (array2.indexOf(array1[i])&gt;=0)
      { numberOfMatches12++; }

  // how much of string2 is in string1
  var numberOfMatches21 = 0;

  for (i=0; i < array2.length; i++) {
    if (array1.indexOf(array2[i])&gt;=0)
      { numberOfMatches21++; }

  // convert those to percentages
  var percentMatch12 = numberOfMatches12/array1.length;
  var percentMatch21 = numberOfMatches21/array2.length;

  // return the average the two
  return (percentMatch12 + percentMatch21)/2; 
}

Preview 7 vs Preview 8

Preview Icons

What happened to the that little boy on the Preview Icon?

Preview plays a big part of my workflow for reading and annotating PDF’s stored in Papers 3. I highlight, circle things, and add a lot of text, then all annotations are saved automatically back into the Papers library. Preview and Papers work together more smoothly than PDF Expert and Papers for the iPad. On the iPad, I use PDF Expert to do the same and Preview 7 and PDF Expert worked beautifully together.

The Mavericks version, Preview 7, worked incredibly well for this. With Yosemite, in Preview 8 we’re mourning the loss of more than just that boy. I was able to install both Preview 7 and 8 on my Mac and compare side by side.

Continue reading “Preview 7 vs Preview 8”

π day & RPN Calculator.app

March 14th, or π-day, this year takes on additional numerical significance. Only once in a hundred years we are able to celebrate π to its billionth decimal place.

3.141592653

3/14/15 9:26:53

I wonder if Galileo Galilei geeked out on 3/14/1592 6:53:59.

In other mathematically geeky news, while doing several calculations on my Mac I was longing for my old HP scientific calculator with reverse polish notation. Looking through the Mac app store at all the emulators, I decided to see if the built-in calculator app had this feature. And guess what it does.

calculator_app

In the View menu, you can select “RPN mode” and now you get a calculator with a stack visible 2 deep. I don’t know if this was possible in previous versions of OS X, but I love the geeks at Apple that made this happen.

Happy π-day. Now we wait for May the Fourth.

CORD 2014 – There’s an App For That (Paperless Edition)

CORD-Anniv-FinalLogoHello CDEM and CORD attendees. Each year for the past few years, a colleague and I have presented some of the most useful apps of the past year. This year, Jason Wagner (@TheTechDoc) and I have been asked to do the same.

Feedback from those previous sessions really focused around providing demonstrations rather than just a list and description of what applications we found useful. Respecting our time constraints, I’ve put some quick demonstrations of useful software below. I will be spending most of my time talking about screencasting software and principles, but I’m happy to discuss any thing (here or at the conference).
Continue reading “CORD 2014 – There’s an App For That (Paperless Edition)”

1password demo

Part of the “There’s an App For That” talk Rakesh and I have given at CORD has included software recommendations. People requested demonstrations of how to use the software. So here’s the first one, 1password for iPhone (also available for iPad, Mac, PC and Android).