function(a) {
    var fn = function(n, src, got, all) {
      if (n === 0) {
        all.push(got);
        return;
      }

      for (var j = 0; j < src.length; j++) {
        fn(n - 1, src.slice(j + 1), got.concat([src[j]]), all);
      }
    };

    var excluded = excludedPlugins.map(function(plugin) {
      return 'plugins/' + plugin + '.js';
    });

    // Remove the plugins that we don't want to build
    a = a.filter(function(n) {
      return excluded.indexOf(n) === -1;
    });

    var all = [a];

    for (var i = 0; i < a.length; i++) {
      fn(i, a, [], all);
    }

    return all;
  }
function(a) {
    var fn = function(n, src, got, all) {
      if (n === 0) {
        all.push(got);
        return;
      }

      for (var j = 0; j < src.length; j++) {
        fn(n - 1, src.slice(j + 1), got.concat([src[j]]), all);
      }
    };

    var excluded = excludedPlugins.map(function(plugin) {
      return 'plugins/' + plugin + '.js';
    });

    // Remove the plugins that we don't want to build
    a = a.filter(function(n) {
      return excluded.indexOf(n) === -1;
    });

    var all = [a];

    for (var i = 0; i < a.length; i++) {
      fn(i, a, [], all);
    }

    return all;
  }
function ( a ) { var fn = function ( n , src , got , all ) { if ( n === 0 ) { all . push ( got ) ; return ; } for ( var j = 0 ; j < src . length ; j ++ ) { fn ( n - 1 , src . slice ( j + 1 ) , got . concat ( [ src [ j ] ] ) , all ) ; } } ; var excluded = excludedPlugins . map ( function ( plugin ) { return 'plugins/' + plugin + '.js' ; } ) ; // Remove the plugins that we don't want to build a = a . filter ( function ( n ) { return excluded . indexOf ( n ) === - 1 ; } ) ; var all = [ a ] ; for ( var i = 0 ; i < a . length ; i ++ ) { fn ( i , a , [ ] , all ) ; } return all ; }
Taken from http://dzone.com/snippets/calculate-all-combinations
Taken from http : // dzone . com / snippets / calculate - all - combinations
Build the xsd