text:
(function() {
  var Child, Runner, a_json_parse, bufferify, fs, iced, iutils, make_esc, parse_args, path, read, semver, spawn, __iced_k, __iced_k_noop, _ref;

  iced = require('iced-runtime');
  __iced_k = __iced_k_noop = function() {};

  semver = require('semver');

  iutils = require('iced-utils');

  _ref = iutils.spawn, Child = _ref.Child, spawn = _ref.spawn;

  a_json_parse = iutils.util.a_json_parse;

  parse_args = require('minimist');

  read = require('read');

  make_esc = require('iced-error').make_esc;

  fs = require('fs');

  path = require('path');

  bufferify = function(s) {
    if (typeof s === 'string') {
      return new Buffer(s, 'utf8');
    } else {
      return s;
    }
  };

  Runner = (function() {
    function Runner() {
      this._key = null;
      this._old_version = null;
      this._new_version = null;
      this._name = null;
      this._filename = "./package.json";
      this._config = null;
    }

    Runner.prototype.check_clean = function(cb) {
      var args, b, buf, child, err, rc, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      args = ["status", "--porcelain"];
      buf = [];
      err = null;
      child = new Child(args, {
        quiet: true,
        interp: 'git'
      });
      child.filter(function(f) {
        return buf.push(bufferify(f));
      });
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner.check_clean"
          });
          child.run().wait(__iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return rc = arguments[0];
              };
            })(),
            lineno: 38
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          if (rc !== 0) {
            err = new Error("git status failed with error " + rc);
          } else {
            b = Buffer.concat(buf).toString('utf8');
            if (b.match(/\S/)) {
              err = new Error("refusing to push; directory is unclean");
              console.log(b);
            }
          }
          return cb(err);
        };
      })(this));
    };

    Runner.prototype.parse_args = function(cb) {
      this.argv = parse_args(process.argv.slice(2), {
        alias: {
          k: ["key"],
          f: ["force"],
          i: ["inc"],
          S: ["no-dir-sign"],
          I: ["no-increment"],
          o: ["otp"]
        },
        boolean: ["f", "S", "I"],
        string: ["i", "o"]
      });
      return cb(null);
    };

    Runner.prototype.read_pkg = function(cb) {
      var esc, raw, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      esc = make_esc(cb, "Runner::read_pkg");
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner.read_pkg"
          });
          fs.readFile(_this._filename, esc(__iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return raw = arguments[0];
              };
            })(),
            lineno: 68
          })));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          (function(__iced_k) {
            __iced_deferrals = new iced.Deferrals(__iced_k, {
              parent: ___iced_passed_deferral,
              filename: "/Users/max/src/keybase/mwr/src/main.iced",
              funcname: "Runner.read_pkg"
            });
            a_json_parse(raw, esc(__iced_deferrals.defer({
              assign_fn: (function(__slot_1) {
                return function() {
                  return __slot_1._pkg = arguments[0];
                };
              })(_this),
              lineno: 69
            })));
            __iced_deferrals._fulfill();
          })(function() {
            _this._name = _this._pkg.name;
            _this._old_version = semver.parse(_this._pkg.version);
            return cb(null);
          });
        };
      })(this));
    };

    Runner.prototype.inc_version = function(cb) {
      if (this.argv.I) {
        this._new_version = this._pkg.version;
      } else {
        this._new_version = semver.parse(this._pkg.version).inc(this.argv.inc || "patch");
      }
      this._new_version_s = this._new_version.toString();
      this._new_version_vs = "v" + this._new_version_s;
      return cb(null);
    };

    Runner.prototype.write_new_pkg = function(cb) {
      var esc, json, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      esc = make_esc(cb, "write_new_pkg");
      (function(_this) {
        return (function(__iced_k) {
          if (!_this.argv.I) {
            _this._pkg.version = _this._new_version_s;
            json = JSON.stringify(_this._pkg, null, "  ");
            (function(__iced_k) {
              __iced_deferrals = new iced.Deferrals(__iced_k, {
                parent: ___iced_passed_deferral,
                filename: "/Users/max/src/keybase/mwr/src/main.iced",
                funcname: "Runner.write_new_pkg"
              });
              fs.writeFile(_this._filename, json, esc(__iced_deferrals.defer({
                lineno: 92
              })));
              __iced_deferrals._fulfill();
            })(function() {
              (function(__iced_k) {
                __iced_deferrals = new iced.Deferrals(__iced_k, {
                  parent: ___iced_passed_deferral,
                  filename: "/Users/max/src/keybase/mwr/src/main.iced",
                  funcname: "Runner.write_new_pkg"
                });
                _this.git_stage(_this._filename, esc(__iced_deferrals.defer({
                  lineno: 93
                })));
                __iced_deferrals._fulfill();
              })(__iced_k);
            });
          } else {
            return __iced_k();
          }
        });
      })(this)((function(_this) {
        return function() {
          return cb(null);
        };
      })(this));
    };

    Runner.prototype.select_key = function(cb) {
      var err, _ref1, _ref2, _ref3;
      err = null;
      if (!this.argv.key || this.argv.key.length === 0) {

      } else if (((_ref1 = this._config) != null ? _ref1.keys : void 0) == null) {
        err = new Error("can't use the -k flag without a config file");
      } else if ((this._key = (_ref2 = this._config) != null ? (_ref3 = _ref2.keys) != null ? _ref3[this.argv.key] : void 0 : void 0) == null) {
        err = new Error("don't recognize this key: " + this.argv.key);
      }
      return cb(err);
    };

    Runner.prototype.git_stage = function(fn, cb) {
      var args, err, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      args = ["add", fn];
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner.git_stage"
          });
          _this._git(args, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return err = arguments[0];
              };
            })(),
            lineno: 111
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          return cb(err);
        };
      })(this));
    };

    Runner.prototype.commit = function(cb) {
      var args, err, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      args = ["commit", "-m", this._new_version_vs];
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner.commit"
          });
          _this._git(args, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return err = arguments[0];
              };
            })(),
            lineno: 122
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          return cb(err);
        };
      })(this));
    };

    Runner.prototype.tag = function(cb) {
      var args, err, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      args = ["tag", "-a", "-m", this._new_version_vs];
      if (this._key) {
        args.push("-u", this._key);
      }
      args.push(this._new_version_vs);
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner.tag"
          });
          _this._git(args, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return err = arguments[0];
              };
            })(),
            lineno: 136
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          return cb(err);
        };
      })(this));
    };

    Runner.prototype.verify = function(cb) {
      var args, err, res, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      console.log("About to publish:\n  * " + this._name + "\n  * Old version: " + (this._old_version.toString()) + "\n  * New version: " + (this._new_version.toString()) + "\n  * Signing key: " + this._key);
      args = {
        prompt: "Are you sure? [y/N] "
      };
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner.verify"
          });
          read(args, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                err = arguments[0];
                return res = arguments[1];
              };
            })(),
            lineno: 151
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          var _ref1;
          err = err != null ? err : (_ref1 = res.toLowerCase()) === "y" || _ref1 === "yes" ? null : new Error("operation canceled!");
          return cb(err);
        };
      })(this));
    };

    Runner.prototype.publish = function(cb) {
      var args, err, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      args = ["publish"];
      if (this.argv.o != null) {
        args.push("--otp", this.argv.o);
      }
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner.publish"
          });
          _this._npm(args, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return err = arguments[0];
              };
            })(),
            lineno: 162
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          return cb(err);
        };
      })(this));
    };

    Runner.prototype._cmd = function(name, args, cb) {
      var err, opts, rc, s, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      opts = {
        interp: name
      };
      s = args.join(" ");
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner._cmd"
          });
          spawn(args, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return rc = arguments[0];
              };
            })(),
            lineno: 170
          }), opts);
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          err = rc !== 0 ? new Error("" + name + " " + s + ": bad exit: " + rc) : null;
          return cb(err);
        };
      })(this));
    };

    Runner.prototype._git = function(args, cb) {
      return this._cmd("git", args, cb);
    };

    Runner.prototype._keybase = function(args, cb) {
      return this._cmd("keybase", args, cb);
    };

    Runner.prototype._npm = function(args, cb) {
      var err, opts, rc, s, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      opts = {
        interp: "npm"
      };
      s = args.join(" ");
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner._npm"
          });
          spawn(args, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return rc = arguments[0];
              };
            })(),
            lineno: 184
          }), opts);
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          err = rc !== 0 ? new Error("npm " + s + ": bad exit: " + rc) : null;
          return cb(err);
        };
      })(this));
    };

    Runner.prototype.push = function(cb) {
      var args, err, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      args = ["push", "--tags", "origin", "master"];
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner.push"
          });
          _this._git(args, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return err = arguments[0];
              };
            })(),
            lineno: 197
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          return cb(err);
        };
      })(this));
    };

    Runner.prototype.read_config = function(cb) {
      var err, fn, home, raw, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      home = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
      fn = path.join(home, ".mwr.json");
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner.read_config"
          });
          fs.readFile(fn, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                err = arguments[0];
                return raw = arguments[1];
              };
            })(),
            lineno: 205
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          (function(__iced_k) {
            if (typeof err === "undefined" || err === null) {
              (function(__iced_k) {
                __iced_deferrals = new iced.Deferrals(__iced_k, {
                  parent: ___iced_passed_deferral,
                  filename: "/Users/max/src/keybase/mwr/src/main.iced",
                  funcname: "Runner.read_config"
                });
                a_json_parse(raw, __iced_deferrals.defer({
                  assign_fn: (function(__slot_1) {
                    return function() {
                      err = arguments[0];
                      return __slot_1._config = arguments[1];
                    };
                  })(_this),
                  lineno: 207
                }));
                __iced_deferrals._fulfill();
              })(__iced_k);
            } else {
              return __iced_k(err.code === 'ENOENT' ? err = null : void 0);
            }
          })(function() {
            return cb(err);
          });
        };
      })(this));
    };

    Runner.prototype.main = function(cb) {
      var esc, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      esc = make_esc(cb, "Runner::main");
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/mwr/src/main.iced",
            funcname: "Runner.main"
          });
          _this.read_config(esc(__iced_deferrals.defer({
            lineno: 216
          })));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          (function(__iced_k) {
            __iced_deferrals = new iced.Deferrals(__iced_k, {
              parent: ___iced_passed_deferral,
              filename: "/Users/max/src/keybase/mwr/src/main.iced",
              funcname: "Runner.main"
            });
            _this.parse_args(esc(__iced_deferrals.defer({
              lineno: 217
            })));
            __iced_deferrals._fulfill();
          })(function() {
            (function(__iced_k) {
              __iced_deferrals = new iced.Deferrals(__iced_k, {
                parent: ___iced_passed_deferral,
                filename: "/Users/max/src/keybase/mwr/src/main.iced",
                funcname: "Runner.main"
              });
              _this.read_pkg(esc(__iced_deferrals.defer({
                lineno: 218
              })));
              __iced_deferrals._fulfill();
            })(function() {
              (function(__iced_k) {
                __iced_deferrals = new iced.Deferrals(__iced_k, {
                  parent: ___iced_passed_deferral,
                  filename: "/Users/max/src/keybase/mwr/src/main.iced",
                  funcname: "Runner.main"
                });
                _this.inc_version(esc(__iced_deferrals.defer({
                  lineno: 219
                })));
                __iced_deferrals._fulfill();
              })(function() {
                (function(__iced_k) {
                  __iced_deferrals = new iced.Deferrals(__iced_k, {
                    parent: ___iced_passed_deferral,
                    filename: "/Users/max/src/keybase/mwr/src/main.iced",
                    funcname: "Runner.main"
                  });
                  _this.select_key(esc(__iced_deferrals.defer({
                    lineno: 220
                  })));
                  __iced_deferrals._fulfill();
                })(function() {
                  (function(__iced_k) {
                    __iced_deferrals = new iced.Deferrals(__iced_k, {
                      parent: ___iced_passed_deferral,
                      filename: "/Users/max/src/keybase/mwr/src/main.iced",
                      funcname: "Runner.main"
                    });
                    _this.check_clean(esc(__iced_deferrals.defer({
                      lineno: 221
                    })));
                    __iced_deferrals._fulfill();
                  })(function() {
                    (function(__iced_k) {
                      if (!_this.argv.f) {
                        (function(__iced_k) {
                          __iced_deferrals = new iced.Deferrals(__iced_k, {
                            parent: ___iced_passed_deferral,
                            filename: "/Users/max/src/keybase/mwr/src/main.iced",
                            funcname: "Runner.main"
                          });
                          _this.verify(esc(__iced_deferrals.defer({
                            lineno: 222
                          })));
                          __iced_deferrals._fulfill();
                        })(__iced_k);
                      } else {
                        return __iced_k();
                      }
                    })(function() {
                      (function(__iced_k) {
                        __iced_deferrals = new iced.Deferrals(__iced_k, {
                          parent: ___iced_passed_deferral,
                          filename: "/Users/max/src/keybase/mwr/src/main.iced",
                          funcname: "Runner.main"
                        });
                        _this.write_new_pkg(esc(__iced_deferrals.defer({
                          lineno: 223
                        })));
                        __iced_deferrals._fulfill();
                      })(function() {
                        (function(__iced_k) {
                          if (!_this.argv.I) {
                            (function(__iced_k) {
                              __iced_deferrals = new iced.Deferrals(__iced_k, {
                                parent: ___iced_passed_deferral,
                                filename: "/Users/max/src/keybase/mwr/src/main.iced",
                                funcname: "Runner.main"
                              });
                              _this.commit(esc(__iced_deferrals.defer({
                                lineno: 224
                              })));
                              __iced_deferrals._fulfill();
                            })(__iced_k);
                          } else {
                            return __iced_k();
                          }
                        })(function() {
                          (function(__iced_k) {
                            __iced_deferrals = new iced.Deferrals(__iced_k, {
                              parent: ___iced_passed_deferral,
                              filename: "/Users/max/src/keybase/mwr/src/main.iced",
                              funcname: "Runner.main"
                            });
                            _this.tag(esc(__iced_deferrals.defer({
                              lineno: 225
                            })));
                            __iced_deferrals._fulfill();
                          })(function() {
                            (function(__iced_k) {
                              __iced_deferrals = new iced.Deferrals(__iced_k, {
                                parent: ___iced_passed_deferral,
                                filename: "/Users/max/src/keybase/mwr/src/main.iced",
                                funcname: "Runner.main"
                              });
                              _this.push(esc(__iced_deferrals.defer({
                                lineno: 226
                              })));
                              __iced_deferrals._fulfill();
                            })(function() {
                              (function(__iced_k) {
                                __iced_deferrals = new iced.Deferrals(__iced_k, {
                                  parent: ___iced_passed_deferral,
                                  filename: "/Users/max/src/keybase/mwr/src/main.iced",
                                  funcname: "Runner.main"
                                });
                                _this.publish(esc(__iced_deferrals.defer({
                                  lineno: 227
                                })));
                                __iced_deferrals._fulfill();
                              })(function() {
                                return cb(null);
                              });
                            });
                          });
                        });
                      });
                    });
                  });
                });
              });
            });
          });
        };
      })(this));
    };

    return Runner;

  })();

  exports.run = function() {
    var err, r, rc, ___iced_passed_deferral, __iced_deferrals, __iced_k;
    __iced_k = __iced_k_noop;
    ___iced_passed_deferral = iced.findDeferral(arguments);
    r = new Runner();
    (function(_this) {
      return (function(__iced_k) {
        __iced_deferrals = new iced.Deferrals(__iced_k, {
          parent: ___iced_passed_deferral,
          filename: "/Users/max/src/keybase/mwr/src/main.iced",
          funcname: "run"
        });
        r.main(__iced_deferrals.defer({
          assign_fn: (function() {
            return function() {
              return err = arguments[0];
            };
          })(),
          lineno: 234
        }));
        __iced_deferrals._fulfill();
      });
    })(this)((function(_this) {
      return function() {
        if (typeof err !== "undefined" && err !== null) {
          console.log("Error: " + err.message);
          rc = -2;
        } else {
          rc = 0;
        }
        return process.exit(rc);
      };
    })(this));
  };

}).call(this);


text:
<?cs def:custom_masthead() ?>

    <?cs if:project.name ?>
      <a href="<?cs var:toroot ?>packages.html"><?cs var:project.name ?>
    <?cs /if ?>

      <?cs call:default_search_box() ?>
      <?cs if:reference && reference.apilevels ?>
        <?cs call:default_api_filter() ?>
      <?cs /if ?>

<?cs /def ?>

redpajama_set_name: RedPajamaGithub


text:
LightmakerComplexifyBundle
=========

[![Build Status](https://travis-ci.org/LightmakerCanada/ComplexifyBundle.svg)](https://travis-ci.org/LightmakerCanada/ComplexifyBundle)
[![Code Coverage](https://scrutinizer-ci.com/g/LightmakerCanada/ComplexifyBundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/LightmakerCanada/ComplexifyBundle/?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/LightmakerCanada/ComplexifyBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/LightmakerCanada/ComplexifyBundle/?branch=master)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/32d08283-d516-45b9-a283-f4ea95d989d0/mini.png)](https://insight.sensiolabs.com/projects/32d08283-d516-45b9-a283-f4ea95d989d0)
[![Latest Stable Version](https://poser.pugx.org/lightmaker/complexify-bundle/v/stable)](https://packagist.org/packages/lightmaker/complexify-bundle)
[![Total Downloads](https://poser.pugx.org/lightmaker/complexify-bundle/downloads)](https://packagist.org/packages/lightmaker/complexify-bundle)

A Symfony2 bundle for Michael Crumley's PHP port of Dan Palmer's jquery.complexify.js
- https://github.com/mcrumley/php-complexify/
- https://github.com/danpalmer/jquery.complexify.js/

## Installation

`composer require lightmaker/complexify-bundle`

### Update your Kernel

```php
# AppKernel.php
public function registerBundles() {
  $bundles = array(
    new Lightmaker\ComplexifyBundle\LightmakerComplexifyBundle()
  );
}
```

### Usage
You can use the `Lightmaker\ComplexifyBundle\Validator\Constraints\Complexify` constraint with the following options.

- message: The validation message (default: 'Password must be complex.')
- minimumChars: The minimum acceptable password length (default: 8)
- strengthScaleFactor: Scale the required password strength - higher numbers require a more complex password (default: 1)
- bannedPasswords: An array of banned passwords (Default: empty array)
- banMode: strict == don't allow substrings of banned passwords, loose == only ban exact matches (default: strict)
- encoding: (default: 'UTF-8')


text:
namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Table
{
    public interface ICreateTableWithColumnSyntax : IFluentSyntax
    {
        ICreateTableColumnAsTypeSyntax WithColumn(string name);
    }
}


text:
namespace Zep
{

struct TimedSection
{
    uint64_t elapsed = 0;
    uint64_t count;
};

timer globalTimer;
profile_data globalProfiler;

uint64_t timer_get_time_now()
{
    return std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
}

void timer_start(timer& timer)
{
    timer_restart(timer);
}

void timer_restart(timer& timer)
{
    timer.startTime = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
}

uint64_t timer_get_elapsed(const timer& timer)
{
    auto now = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
    return now - timer.startTime;
}

double timer_get_elapsed_seconds(const timer& timer)
{
    return timer_to_seconds(timer_get_elapsed(timer));
}

double timer_to_seconds(uint64_t value)
{
    return double(value / 1000000.0);
}

double timer_to_ms(uint64_t value)
{
    return double(value / 1000.0);
}

ProfileBlock::ProfileBlock(const char* timer)
    : strTimer(timer)
{
    timer_start(blockTimer);
    if (globalProfiler.timerData.find(timer) == globalProfiler.timerData.end())
    {
        globalProfiler.timerData[timer] = profile_value{};
    }
}

ProfileBlock::~ProfileBlock()
{
    elapsed = timer_get_elapsed(blockTimer);
    profile_add_value(globalProfiler.timerData.find(strTimer)->second, double(elapsed));
}

void profile_add_value(profile_value& val, double av)
{
    val.count++;
    val.average = val.average * (val.count - 1) / val.count + av / val.count;
    val.current = av;
}

} // namespace Zep


text:
package org.spongycastle.cms.jcajce;

import java.io.InputStream;
import java.security.Key;
import java.security.PrivateKey;

import javax.crypto.Cipher;

import org.spongycastle.asn1.x509.AlgorithmIdentifier;
import org.spongycastle.cms.CMSException;
import org.spongycastle.cms.RecipientOperator;
import org.spongycastle.jcajce.io.CipherInputStream;
import org.spongycastle.operator.InputDecryptor;

public class JceKeyTransEnvelopedRecipient
    extends JceKeyTransRecipient
{
    public JceKeyTransEnvelopedRecipient(PrivateKey recipientKey)
    {
        super(recipientKey);
    }

    public RecipientOperator getRecipientOperator(AlgorithmIdentifier keyEncryptionAlgorithm, final AlgorithmIdentifier contentEncryptionAlgorithm, byte[] encryptedContentEncryptionKey)
        throws CMSException
    {
        Key secretKey = extractSecretKey(keyEncryptionAlgorithm, contentEncryptionAlgorithm, encryptedContentEncryptionKey);

        final Cipher dataCipher = contentHelper.createContentCipher(secretKey, contentEncryptionAlgorithm);

        return new RecipientOperator(new InputDecryptor()
        {
            public AlgorithmIdentifier getAlgorithmIdentifier()
            {
                return contentEncryptionAlgorithm;
            }

            public InputStream getInputStream(InputStream dataIn)
            {
                return new CipherInputStream(dataIn, dataCipher);
            }
        });
    }
}


text:
package org.apache.nifi.event.transport.netty;

import io.netty.channel.Channel;
import io.netty.channel.EventLoopGroup;
import org.apache.nifi.event.transport.EventServer;
import org.apache.nifi.event.transport.configuration.ShutdownQuietPeriod;
import org.apache.nifi.event.transport.configuration.ShutdownTimeout;

import java.time.Duration;
import java.util.concurrent.TimeUnit;

/**
 * Netty Event Server
 */
class NettyEventServer implements EventServer {
    private final EventLoopGroup group;

    private final Channel channel;

    private final Duration shutdownQuietPeriod;

    private final Duration shutdownTimeout;

    /**
     * Netty Event Server with Event Loop Group and bound Channel
     *
     * @param group Event Loop Group
     * @param channel Bound Channel
     */
    NettyEventServer(final EventLoopGroup group, final Channel channel) {
        this(group, channel, ShutdownQuietPeriod.DEFAULT.getDuration(), ShutdownTimeout.DEFAULT.getDuration());
    }

    /**
     * Netty Event Server with Event Loop Group, bound Channel, and Shutdown Configuration
     *
     * @param group Event Loop Group
     * @param channel Bound Channel
     * @param quietPeriod server shutdown quiet period
     * @param timeout server shutdown timeout
     */
    NettyEventServer(final EventLoopGroup group, final Channel channel, final Duration quietPeriod, final Duration timeout) {
        this.group = group;
        this.channel = channel;
        this.shutdownQuietPeriod = quietPeriod;
        this.shutdownTimeout = timeout;
    }

    /**
     * Close Channel and shutdown Event Loop Group
     */
    @Override
    public void shutdown() {
        try {
            if (channel.isOpen()) {
                channel.close().syncUninterruptibly();
            }
        } finally {
            group.shutdownGracefully(shutdownQuietPeriod.toMillis(), shutdownTimeout.toMillis(), TimeUnit.MILLISECONDS).syncUninterruptibly();
        }
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Annls mycol. 37(4/5): 358 (1939)

#### Original name
Phyllachora pernettyae Syd., 1939

### Remarks
null


text:
// PkgCmdID.cs
// MUST match PkgCmdID.h

namespace AttachTo
{
    public static class ProgramsList
    {
        public const uint IIS = 0x100;

        public const uint IISExpress = 0x101;

        public const uint NUnit = 0x102;

        public const uint ArcSOC = 0x103;

        public const uint ArcMap = 0x104;

        public const uint ArcCatalog = 0x105;

        public const uint DBTool = 0x106;
    }
}


text:
"use strict";

const Channel = require(`../../lib`);

it(`doubleselect`, async function() {
  this.timeout(10 * 1000);
  const iterations = 100000; // number of iterations

  // sender sends a counter to one of four different channels. If two cases both
  // end up running in the same iteration, the same value will be sent to two
  // different channels.
  const sender = async (n, c1, c2, c3, c4) => {
    for (let i = 0; i < n; i++) {
      await Channel.select([c1.push(i), c2.push(i), c3.push(i), c4.push(i)]);
    }

    c1.close();
    c2.close();
    c3.close();
    c4.close();
  };

  // mux receives the values from sender and forwards them onto another channel.
  // It would be simpler to just have sender's four cases all be the same
  // channel, but this doesn't actually trigger the bug.
  const mux = async (output, input, done) => {
    await input.forEach(async value => {
      await output.push(value);
    });

    await done.push(true);
  };

  // recver gets a steam of values from the four mux's and checks for
  // duplicates.
  const recver = input => {
    const seen = new Map();

    input.forEach(v => {
      if (seen.has(v)) {
        throw new Error(`got duplicate value: ${v}`);
      }

      seen.set(v, true);
    });
  };

  const c1 = Channel();
  const c2 = Channel();
  const c3 = Channel();
  const c4 = Channel();
  const done = Channel();
  const cmux = Channel();
  sender(iterations, c1, c2, c3, c4);
  mux(cmux, c1, done);
  mux(cmux, c2, done);
  mux(cmux, c3, done);
  mux(cmux, c4, done);

  // We keep the recver because it might catch more bugs in the future.
  // However, the result of the bug linked to at the top is that we'll
  // end up panicking with: "throw: bad g->status in ready".
  recver(cmux);

  await done.shift();
  await done.shift();
  await done.shift();
  await done.shift();
  cmux.close();
});


text:
<?php
/**
 * @author Honza Cerny (http://honzacerny.com)
 */

namespace App\AdminModule\Presenters;

use Nette\Application\UI\Form;
use Aprila\Administration\Presenter\BaseSecurePresenter;

class FormExamplePresenter extends BaseSecurePresenter
{
	protected $accessLevelName = 'Form Example';

	public function renderDefault()
	{

	}

	public function createComponentExampleForm()
	{
		$form = new Form();

		$form->addText('username', "Name:");
		$form->addPassword('userpassword', "Password:");
		$form->addTextArea('textarea', "Textarea");

		$form->addText('name_r', "Name:")->setRequired();
		$form->addText('name_example', "Example:")->setRequired()->setOption('example', 'This is example option');
		$form->addPassword('password_r', "Password:")->setRequired();
		$form->addTextArea('textarea_r', "Textarea")->setRequired();

		$form->addSelect('select', "Select", ['Option 1', 'Option 2']);
		$form->addUpload('upload', 'Upload');
		$form->addCheckbox('checkbox', 'Checkbox');
		$form->addRadioList('radioList', 'Radio list', ['Item A', 'Item B']);
		$form->addCheckboxList('checkboxList', 'Checkbox list,', ['Item A', 'Item B']);

		$form->addText('link', 'Link:')->setRequired()->addRule(Form::URL);
		$form->addText('email', 'Email:')->setRequired()->addRule(Form::EMAIL);

		$form->addSubmit('actionSend', 'Save');

		$form->onSuccess[] = function () {
			$this->flashMessage('Form sended');
		};

		return $form;
	}

}


text:
import java.util.Map;

import com.xensource.xenapi.HostPatch;
import com.xensource.xenapi.Types;

/**
 * The HostPatch.apply() method is deprecated. We'll try to use it. The test is that the
 * program will compile, but the compiler will protest.
 */
public class DeprecatedMethod extends TestBase
{
    public static void RunTest(ILog logger, TargetServer server) throws Exception
    {
        TestBase.logger = logger;
        try
        {
            connect(server);

            Map<HostPatch, HostPatch.Record> all_recs = HostPatch.getAllRecords(connection);
            if (all_recs.size() > 0)
            {
                logln("Found HostPatches. Applying the first one...");
                Map.Entry<HostPatch, HostPatch.Record> first = null;
                for (Map.Entry<HostPatch, HostPatch.Record> entry : all_recs.entrySet())
                {
                    first = entry;
                    break;
                }

                logln(first.getValue().toString());
                try {
                    first.getKey().apply(connection);
                    throw new Exception("Managed to use deprecated method HostPatch.apply()!");
                } catch (Types.MessageDeprecated e) {
                    logln("Caught expected MessageDeprecated exception. Do not fail.");
                }
            } else
            {
                logln("There aren't any HostPatches to be applied...");
            }
        } finally
        {
            disconnect();
        }
    }
}


text:
import { logger } from '../config/logger'
import { thinky } from '../models'
// import { restrictWebsocketAccess } from '../lib/authorization'
const WebSocketServer = require('ws').Server

export class MessageController {
    private ws
    private app
    constructor(app) {
        this.app = app
        this.setupWebsocketServer()
    }
    public setupWebsocketServer(): void {
        this.ws = new WebSocketServer({
            server: this.app.server,
            autoAcceptConnections: false,
            path: '/messages',
            keepalive: true,
            keepaliveInterval: 2000,
            keepaliveGracePeriod: 2000
        })
        this.ws.on('connection', clientWS => {
            // console.log(clientWS.upgradeReq.headers)
            // TODO: add origin verification
            // var location = url.parse(clientWS.upgradeReq.url, true)
            // *** IMPORTANT NOTE ***
            // Consider using socket io and https://github.com/kirkness/react-native-swift-socketio
            // until React Native solves the issues with sending cookies on websocket handshake
            // TODO: enable websocket cookie validation when RN websocket fixes WS sending cookies
            // if (!restrictWebsocketAccess(clientWS.upgradeReq)) { return clientWS.close() }
        })
        this.ws.on('close', () => logger.info(`[Main IO] Disconnected from ${arguments}`))
        this.pushChangesToWebsocket()
    }
    public pushChangesToWebsocket(): void {
        try {
            thinky.r.table('Message').changes().map((message) => {
                return message.merge({
                    // IMPORTANT NOTE: this pluck values are hardcoded, and they should
                    // consider at least the graphql fragment for the chat component (Chat/index.tsx)
                    author: thinky.r.table('User').get(message('new_val')('userId')).pluck('name', 'email', 'id')
                })
            }).run().then(changes => {
                changes.on('data', (newMessage) => {
                    this.ws.clients.forEach(client => client.send(JSON.stringify(newMessage)))
                })
            })
        } catch (err) {
            logger.info(`[Setup Main IO] Error: ${err}`)
        }
    }
}


text:
package org.springframework.social.google.api.calendar.impl;

import java.text.MessageFormat;

import org.springframework.social.google.api.calendar.UpdateEventBuilder;

/**
 * {@link UpdateEventBuilder} implementation.
 *
 * @author Martin Wink
 */
public class UpdateEventBuilderImpl extends UriQueryBuilderImpl<UpdateEventBuilder, Object> implements UpdateEventBuilder {
	public UpdateEventBuilderImpl(String urlTemplate, String calendarId, String eventId) {
		super(MessageFormat.format(urlTemplate, encode(calendarId), encode(eventId)));
	}

	@Override
	public UpdateEventBuilder alwaysIncludeEmail(boolean alwaysIncludeEmail) {
		return appendQueryParam("alwaysIncludeEmail", alwaysIncludeEmail);
	}

	@Override
	public UpdateEventBuilder maxAttendees(int maxAttendees) {
		return appendQueryParam("maxAttendees", maxAttendees);
	}

	@Override
	public UpdateEventBuilder sendNotifications(boolean sendNotifications) {
		return appendQueryParam("sendNotifications", sendNotifications);
	}
}


text:
#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/micro/all_ops_resolver.h"
#include "tensorflow/lite/micro/kernels/kernel_runner.h"
#include "tensorflow/lite/micro/test_helpers.h"
#include "tensorflow/lite/micro/testing/micro_test.h"

namespace tflite {
namespace testing {
namespace {

// The Logistic kernel assumes an output in the range [0, 1.0], leading to these
// quantization parameters.
const float quantized_output_scale = 1.0 / 255.0;
const int quantized_output_zero_point_int8 = -128;

const int flat_size_basic = 10;
int shape_basic[] = {2, 2, 5};
const float input_data_basic[] = {1, 2, 3, 4, 5, -1, -2, -3, -4, -5};
const float golden_basic[] = {0.73105858, 0.88079708, 0.95257413, 0.98201379,
                              0.99330715, 0.26894142, 0.11920292, 0.04742587,
                              0.01798621, 0.00669285};

const int flat_size_wide_range = 10;
int shape_wide_range[] = {2, 1, 5};
const float input_data_wide_range[]{
    1.0, 2.0, 3.0, 4.0, 93.0, -1.0, -2.0, -3.0, -4.0, -93.0,
};
const float golden_wide_range[] = {
    0.73105858, 0.88079708, 0.95257413, 0.98201379, 1.0,
    0.26894142, 0.11920292, 0.04742587, 0.01798621, 0.0,
};

template <typename T>
void ValidateLogisticGoldens(TfLiteTensor* tensors, const int tensor_count,
                             T* output_data, const T* golden,
                             int output_dims_count, float tolerance) {
  int inputs_array_data[] = {1, 0};
  TfLiteIntArray* inputs_array = IntArrayFromInts(inputs_array_data);
  int outputs_array_data[] = {1, 1};
  TfLiteIntArray* outputs_array = IntArrayFromInts(outputs_array_data);

  const TfLiteRegistration registration =
      tflite::ops::micro::Register_LOGISTIC();
  micro::KernelRunner runner(registration, tensors, tensor_count, inputs_array,
                             outputs_array, nullptr);

  TF_LITE_MICRO_EXPECT_EQ(kTfLiteOk, runner.InitAndPrepare());
  TF_LITE_MICRO_EXPECT_EQ(kTfLiteOk, runner.Invoke());

  for (int i = 0; i < output_dims_count; ++i) {
    TF_LITE_MICRO_EXPECT_NEAR(golden[i], output_data[i], tolerance);
  }
}

void TestLogisticFloat(int* input_dims_data, const float* input_data,
                       const float* golden, int* output_dims_data,
                       float* output_data) {
  TfLiteIntArray* input_dims = IntArrayFromInts(input_dims_data);
  TfLiteIntArray* output_dims = IntArrayFromInts(output_dims_data);
  const int output_elements_count = ElementCount(*output_dims);

  constexpr int inputs_size = 1;
  constexpr int outputs_size = 1;
  constexpr int tensors_size = inputs_size + outputs_size;
  TfLiteTensor tensors[tensors_size] = {
      CreateTensor(input_data, input_dims),
      CreateTensor(output_data, output_dims),
  };

  ValidateLogisticGoldens(tensors, tensors_size, output_data, golden,
                          output_elements_count, 1e-5);
}

template <typename T>
void TestLogisticQuantized(int* input_dims_data, const float* input_data,
                           T* input_quantized, const float input_scale,
                           const int input_zero_point, const float* golden,
                           T* golden_quantized, int* output_dims_data,
                           const float output_scale,
                           const int output_zero_point, int8_t* output_data) {
  TfLiteIntArray* input_dims = IntArrayFromInts(input_dims_data);
  TfLiteIntArray* output_dims = IntArrayFromInts(output_dims_data);
  const int output_elements_count = ElementCount(*output_dims);

  constexpr int inputs_size = 1;
  constexpr int outputs_size = 1;
  constexpr int tensors_size = inputs_size + outputs_size;
  TfLiteTensor tensors[tensors_size] = {
      CreateQuantizedTensor(input_data, input_quantized, input_dims,
                            input_scale, input_zero_point),
      CreateQuantizedTensor(output_data, output_dims, output_scale,
                            output_zero_point),
  };

  tflite::Quantize(golden, golden_quantized, output_elements_count,
                   output_scale, output_zero_point);
  ValidateLogisticGoldens(tensors, tensors_size, output_data, golden_quantized,
                          output_elements_count, 1.0);
}

}  // namespace
}  // namespace testing
}  // namespace tflite

TF_LITE_MICRO_TESTS_BEGIN

TF_LITE_MICRO_TEST(LogisticFloatBasicShouldMatchGolden) {
  float output_data[tflite::testing::flat_size_basic];
  tflite::testing::TestLogisticFloat(
      tflite::testing::shape_basic, tflite::testing::input_data_basic,
      tflite::testing::golden_basic, tflite::testing::shape_basic, output_data);
}

TF_LITE_MICRO_TEST(LogisticQuantizedInt8BasicShouldMatchGolden) {
  const float input_scale = 0.1;
  const int input_zero_point = 0;
  int8_t input_quantized[tflite::testing::flat_size_basic];
  int8_t golden_quantized[tflite::testing::flat_size_basic];
  int8_t output_data[tflite::testing::flat_size_basic];

  tflite::testing::TestLogisticQuantized(
      tflite::testing::shape_basic, tflite::testing::input_data_basic,
      input_quantized, input_scale, input_zero_point,
      tflite::testing::golden_basic, golden_quantized,
      tflite::testing::shape_basic, tflite::testing::quantized_output_scale,
      tflite::testing::quantized_output_zero_point_int8, output_data);
}

TF_LITE_MICRO_TEST(LogisticFloatWideRangeShouldMatchGolden) {
  float output_data[tflite::testing::flat_size_wide_range];
  tflite::testing::TestLogisticFloat(
      tflite::testing::shape_wide_range, tflite::testing::input_data_wide_range,
      tflite::testing::golden_wide_range, tflite::testing::shape_wide_range,
      output_data);
}

TF_LITE_MICRO_TEST(LogisticQuantizedInt8WideRangeShouldMatchGolden) {
  const float input_scale = 1.0;
  const int input_zero_point = 0;
  int8_t input_quantized[tflite::testing::flat_size_wide_range];
  int8_t golden_quantized[tflite::testing::flat_size_wide_range];
  int8_t output_data[tflite::testing::flat_size_wide_range];

  tflite::testing::TestLogisticQuantized(
      tflite::testing::shape_wide_range, tflite::testing::input_data_wide_range,
      input_quantized, input_scale, input_zero_point,
      tflite::testing::golden_wide_range, golden_quantized,
      tflite::testing::shape_wide_range,
      tflite::testing::quantized_output_scale,
      tflite::testing::quantized_output_zero_point_int8, output_data);
}

TF_LITE_MICRO_TESTS_END


text:
const webpack = require('webpack')
const path = require('path')
const ls = require('list-directory-contents')
const fs = require('fs')
const assert = require('assert')

function run (name, next) {
  if (!name) return console.log('End.')

  const config = require(path.resolve(`./tests/${name}/build/webpack.config.js`))
  console.log(`"${name}": building...`)

  webpack(config, (err, stats) => {

    if (err) throw err

    console.log(`"${name}": testing...`)

    const testPath = path.join(__dirname, name, 'test')
    const testPathLength = testPath.length

    ls(testPath, (err, tree) => {
      if (err) throw err

      const testTree = tree.filter((i) => /.*\..+/.test(i))
      const testContent = testTree.map((i) => i.substring(testPathLength))
      const testContentLength = testContent.length
      const outputPath = path.join(__dirname, name, 'output')
      const outputPathLength = outputPath.length

      ls(outputPath, (err, outputTree) => {
        if (err) throw err

        const outputContent = outputTree.filter((i) => /.*\..+/.test(i))
        const outputContentLength = outputContent.length

        // console.log('outputContent: ', outputContent)
        // console.log('outputContentLength: ', outputContentLength)

        if (testContentLength === outputContentLength) {
          const result = outputContent.reduce((successfulTests, outputToTest) => {
            const outputFilename = outputToTest.substring(outputPathLength)
            const testAgainst = testContent.indexOf(outputFilename)

            const success = testAgainst > -1 && fs.readFileSync(outputToTest).equals(fs.readFileSync(testTree[testAgainst]))

            // if (!success) {
            //   console.log(`FAILED: "${outputFilename}" AGAINST "${testTree[testAgainst]}..."`)
            // }

            return success ? successfulTests + 1 : successfulTests
          }, 0)

          // console.log('RESULT: ', result)
          // console.log('TEST CONTENT LENGTH: ', testContentLength)

          if (result === testContentLength) {
            console.log(`Test "${name}" passed.`)
            run(next.shift(), next)
          } else {
            console.log('There are files missing or with different content.')
            console.log(`Test "${name}" failed on file ${outputContent}.`)
            assert(result === testContentLength)
          }
        } else {

          console.log(`Expected ${testContentLength} file(s).`)
          console.log(`Found ${outputContentLength} file(s).`)
          console.log(`Test "${name}" failed.`)
          assert(testContentLength === outputContentLength)
        }
      })
    })
  })
}

module.exports = run


text:
package apple.networkextension;

import java.io.*;
import java.nio.*;
import java.util.*;
import com.google.j2objc.annotations.*;
import com.google.j2objc.runtime.*;
import com.google.j2objc.runtime.block.*;
import apple.audiotoolbox.*;
import apple.corefoundation.*;
import apple.coregraphics.*;
import apple.coreservices.*;
import apple.foundation.*;

/**
 * @since Available in iOS 8.0 and later.
 */
@Library("NetworkExtension/NetworkExtension.h") @Mapping("NEVPNProtocolIPSec")
public class NEVPNProtocolIPSec
    extends NEVPNProtocol
     {

    @Mapping("init")
    public NEVPNProtocolIPSec() { }

    /**
     * @since Available in iOS 8.0 and later.
     */
    @Mapping("authenticationMethod")
    public native @Representing("NEVPNIKEAuthenticationMethod") long getAuthenticationMethod();
    /**
     * @since Available in iOS 8.0 and later.
     */
    @Mapping("setAuthenticationMethod:")
    public native void setAuthenticationMethod(@Representing("NEVPNIKEAuthenticationMethod") long v);
    /**
     * @since Available in iOS 8.0 and later.
     */
    @Mapping("useExtendedAuthentication")
    public native boolean usesExtendedAuthentication();
    /**
     * @since Available in iOS 8.0 and later.
     */
    @Mapping("setUseExtendedAuthentication:")
    public native void setUsesExtendedAuthentication(boolean v);
    /**
     * @since Available in iOS 8.0 and later.
     */
    @Mapping("sharedSecretReference")
    public native NSData getSharedSecretReference();
    /**
     * @since Available in iOS 8.0 and later.
     */
    @Mapping("setSharedSecretReference:")
    public native void setSharedSecretReference(NSData v);
    /**
     * @since Available in iOS 8.0 and later.
     */
    @Mapping("localIdentifier")
    public native String getLocalIdentifier();
    /**
     * @since Available in iOS 8.0 and later.
     */
    @Mapping("setLocalIdentifier:")
    public native void setLocalIdentifier(String v);
    /**
     * @since Available in iOS 8.0 and later.
     */
    @Mapping("remoteIdentifier")
    public native String getRemoteIdentifier();
    /**
     * @since Available in iOS 8.0 and later.
     */
    @Mapping("setRemoteIdentifier:")
    public native void setRemoteIdentifier(String v);

}


text:
class DummyModelPresenter < BasePresenter
  presents :dummy

  delegate :id, to: :dummy

  def show_value(value)
    handle_none(value) do
      value
    end
  end

  def name
    dummy.name.upcase
  end

  def self.name
    "Class name"
  end

  def dummy_name
    "DUMMY"
  end

  def get_object
    dummy
  end

  def get_template
    @template
  end

  def self.get_object
    @@object
  end

  def self.get_template
    @@template
  end

end


text:
if RUBY_PLATFORM == "java"
  require 'jruby'
  JRuby.runtime.instance_config.run_ruby_in_process = false
end

require 'irt/prompter'

module IRT

  def cli?
    !!ENV['IRT_COMMAND']
  end

  def lib_path
    File.expand_path '../../../lib', __FILE__
  end

  # this fixes a little imperfection of the YAML::dump method
  # which adds a space at the end of the class
  def yaml_dump(val)
    yml = "\n" + YAML.dump(val)
    yml.gsub(/ +\n/, "\n")
  end

  module Utils

    def create_tmp_file()
      require 'tempfile'
      tmp_file = Tempfile.new(['', '.irt'])
      tmp_file << "\n" # one empty line makes irb of 1.9.2 happy
      tmp_file.flush
      # ENV used because with IRT.cli? 2 different processes need to access the same path
      ENV['IRT_TMP_PATH'] = tmp_file.path
      at_exit { check_save_tmp_file(tmp_file) }
      ENV['IRT_TMP_PATH']
    end

    def save_as(file_path, source_path=IRT.irt_file, tmp=false)
      new_file_path = File.expand_path(file_path)
      if File.exists?(new_file_path)
        return false if IRT::Prompter.no? %(Do you want to overwrite "#{new_file_path}"?), :hint => '[y|<enter=n]', :default => 'n'
      end
      dirname = File.dirname(new_file_path)
      FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
      FileUtils.cp source_path, new_file_path
      ask_run_new_file new_file_path, source_path, tmp
    end

    def edit_with(editor, file, line=nil)
      cmd_format = IRT.send("#{editor}_command_format".to_sym)
      raise IRT::NotImplementedError, "#{cmd}_command_format missing" unless cmd_format
      system sprintf(cmd_format, file, line||0)
    end

    def version
      @version ||= File.read(File.expand_path('../../../VERSION', __FILE__)).strip
    end

    def copyright
      @copyrignt ||= Dye.dye "irt #{version} (c) 2010-2013 Domizio Demichelis", :blue, :bold
    end

  private

    def ask_run_new_file(new_file_path, source_path, tmp)
      if IRT::Prompter.yes?( %(Do you want to run the file "#{File.basename(new_file_path)}" now?) )
        # if we are saving a tmp_file from a save_as command (not from an at_exit block)
        if ENV['IRT_TMP_PATH'] && IRT.respond_to?(:irt_file) && IRT.irt_file == Pathname.new(ENV['IRT_TMP_PATH']).realpath
          ENV.delete('IRT_TMP_PATH')
          # reset tmp file content so check_save_tmp_file will be skipped
          File.open(source_path, 'w'){|f| f.puts "\n"}
        end
        if tmp && IRT.cli?
          ENV['IRT_COMMAND'] = ENV['IRT_COMMAND'].sub(/#{Regexp.quote(source_path)}/, new_file_path)
          exec ENV['IRT_COMMAND']
        else
          IRT::Session.run_file new_file_path
        end
      end
    end

    def check_save_tmp_file(tmp_file)
      if tmp_file.size > 1
        IRT::Prompter.yes? %(The template file has been modified, do you want to save it?) do
          IRT::Prompter.choose %(Enter the file path to save:), /[\w0-9_]/ do |file_path|
            save_as(file_path, tmp_file.path, tmp=true)
          end
        end
      end
    end

  end

  extend self
  extend Utils

end


text:
echo "installing ember and its dependencies"
# ember-cli, bower and phantomjs

apt-get -y update && apt-get -y install  g++ build-essential npm nodejs-legacy;
npm install -g ember-cli@$EMBER_CLI_VERSION
npm install -g bower@$BOWER_VERSION
npm install -g node-sass

# phantomjs
apt-get update && \
  apt-get upgrade -y && \
  apt-get install -y vim git wget libfreetype6 libfontconfig bzip2 && \
  mkdir -p /srv/var && \
  wget -q --no-check-certificate -O /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 && \
  tar -xjf /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C /tmp && \
  rm -f /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 && \
  mv /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/ /srv/var/phantomjs && \
  ln -s /srv/var/phantomjs/bin/phantomjs /usr/bin/phantomjs && \
  git clone https://github.com/n1k0/casperjs.git /srv/var/casperjs && \
  ln -s /srv/var/casperjs/bin/casperjs /usr/bin/casperjs && \
  apt-get autoremove -y && \
  apt-get clean all;

echo "installing ruby"
# Install ruby & ruby-dev
 apt-get -y update && apt-get -y install  ruby ruby-dev git python;

 gem sources --add https://rubygems.org/
 gem update --no-rdoc --no-ri
 gem install \
		compass --no-ri --no-rdoc \
		ffi \
		--pre sass-css-importer \
    compass;

# Install Scala
  echo "installing Scala"
## Piping curl directly in tar
  curl -fsL http://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar xfz - -C /root/ && \
  echo >> /root/.bashrc && \
  echo 'export PATH=~/scala-$SCALA_VERSION/bin:$PATH' >> /root/.bashrc;

# Install sbt
  curl -L -o sbt-$SBT_VERSION.deb http://dl.bintray.com/sbt/debian/sbt-$SBT_VERSION.deb && \
  dpkg -i sbt-$SBT_VERSION.deb && \
  rm sbt-$SBT_VERSION.deb && \
  apt-get update && \
  apt-get install sbt && \
  sbt sbtVersion;


text:
using content::BrowserThread;
using content::WebContentsTester;
using testing::_;
using testing::Mock;

TEST(PrefServiceTest, NoObserverFire) {
  TestingPrefService prefs;

  const char pref_name[] = "homepage";
  prefs.RegisterStringPref(pref_name, std::string());

  const char new_pref_value[] = "http://www.google.com/";
  PrefObserverMock obs;
  PrefChangeRegistrar registrar;
  registrar.Init(&prefs);
  registrar.Add(pref_name, &obs);

  // This should fire the checks in PrefObserverMock::Observe.
  const StringValue expected_value(new_pref_value);
  obs.Expect(&prefs, pref_name, &expected_value);
  prefs.SetString(pref_name, new_pref_value);
  Mock::VerifyAndClearExpectations(&obs);

  // Setting the pref to the same value should not set the pref value a second
  // time.
  EXPECT_CALL(obs, Observe(_, _, _)).Times(0);
  prefs.SetString(pref_name, new_pref_value);
  Mock::VerifyAndClearExpectations(&obs);

  // Clearing the pref should cause the pref to fire.
  const StringValue expected_default_value("");
  obs.Expect(&prefs, pref_name, &expected_default_value);
  prefs.ClearPref(pref_name);
  Mock::VerifyAndClearExpectations(&obs);

  // Clearing the pref again should not cause the pref to fire.
  EXPECT_CALL(obs, Observe(_, _, _)).Times(0);
  prefs.ClearPref(pref_name);
  Mock::VerifyAndClearExpectations(&obs);
}

TEST(PrefServiceTest, HasPrefPath) {
  TestingPrefService prefs;

  const char path[] = "fake.path";

  // Shouldn't initially have a path.
  EXPECT_FALSE(prefs.HasPrefPath(path));

  // Register the path. This doesn't set a value, so the path still shouldn't
  // exist.
  prefs.RegisterStringPref(path, std::string());
  EXPECT_FALSE(prefs.HasPrefPath(path));

  // Set a value and make sure we have a path.
  prefs.SetString(path, "blah");
  EXPECT_TRUE(prefs.HasPrefPath(path));
}

TEST(PrefServiceTest, Observers) {
  const char pref_name[] = "homepage";

  TestingPrefService prefs;
  prefs.SetUserPref(pref_name, Value::CreateStringValue("http://www.cnn.com"));
  prefs.RegisterStringPref(pref_name, std::string());

  const char new_pref_value[] = "http://www.google.com/";
  const StringValue expected_new_pref_value(new_pref_value);
  PrefObserverMock obs;
  PrefChangeRegistrar registrar;
  registrar.Init(&prefs);
  registrar.Add(pref_name, &obs);

  // This should fire the checks in PrefObserverMock::Observe.
  obs.Expect(&prefs, pref_name, &expected_new_pref_value);
  prefs.SetString(pref_name, new_pref_value);
  Mock::VerifyAndClearExpectations(&obs);

  // Now try adding a second pref observer.
  const char new_pref_value2[] = "http://www.youtube.com/";
  const StringValue expected_new_pref_value2(new_pref_value2);
  PrefObserverMock obs2;
  obs.Expect(&prefs, pref_name, &expected_new_pref_value2);
  obs2.Expect(&prefs, pref_name, &expected_new_pref_value2);
  registrar.Add(pref_name, &obs2);
  // This should fire the checks in obs and obs2.
  prefs.SetString(pref_name, new_pref_value2);
  Mock::VerifyAndClearExpectations(&obs);
  Mock::VerifyAndClearExpectations(&obs2);

  // Make sure obs2 still works after removing obs.
  registrar.Remove(pref_name, &obs);
  EXPECT_CALL(obs, Observe(_, _, _)).Times(0);
  obs2.Expect(&prefs, pref_name, &expected_new_pref_value);
  // This should only fire the observer in obs2.
  prefs.SetString(pref_name, new_pref_value);
  Mock::VerifyAndClearExpectations(&obs);
  Mock::VerifyAndClearExpectations(&obs2);
}

// Make sure that if a preference changes type, so the wrong type is stored in
// the user pref file, it uses the correct fallback value instead.
TEST(PrefServiceTest, GetValueChangedType) {
  const int kTestValue = 10;
  TestingPrefService prefs;
  prefs.RegisterIntegerPref(prefs::kStabilityLaunchCount, kTestValue);

  // Check falling back to a recommended value.
  prefs.SetUserPref(prefs::kStabilityLaunchCount,
                    Value::CreateStringValue("not an integer"));
  const PrefService::Preference* pref =
      prefs.FindPreference(prefs::kStabilityLaunchCount);
  ASSERT_TRUE(pref);
  const Value* value = pref->GetValue();
  ASSERT_TRUE(value);
  EXPECT_EQ(Value::TYPE_INTEGER, value->GetType());
  int actual_int_value = -1;
  EXPECT_TRUE(value->GetAsInteger(&actual_int_value));
  EXPECT_EQ(kTestValue, actual_int_value);
}

TEST(PrefServiceTest, UpdateCommandLinePrefStore) {
  TestingPrefService prefs;
  prefs.RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, false);

  // Check to make sure the value is as expected.
  const PrefService::Preference* pref =
      prefs.FindPreference(prefs::kCloudPrintProxyEnabled);
  ASSERT_TRUE(pref);
  const Value* value = pref->GetValue();
  ASSERT_TRUE(value);
  EXPECT_EQ(Value::TYPE_BOOLEAN, value->GetType());
  bool actual_bool_value = true;
  EXPECT_TRUE(value->GetAsBoolean(&actual_bool_value));
  EXPECT_FALSE(actual_bool_value);

  // Change the command line.
  CommandLine cmd_line(CommandLine::NO_PROGRAM);
  cmd_line.AppendSwitch(switches::kEnableCloudPrintProxy);

  // Call UpdateCommandLinePrefStore and check to see if the value has changed.
  prefs.UpdateCommandLinePrefStore(&cmd_line);
  pref = prefs.FindPreference(prefs::kCloudPrintProxyEnabled);
  ASSERT_TRUE(pref);
  value = pref->GetValue();
  ASSERT_TRUE(value);
  EXPECT_EQ(Value::TYPE_BOOLEAN, value->GetType());
  actual_bool_value = false;
  EXPECT_TRUE(value->GetAsBoolean(&actual_bool_value));
  EXPECT_TRUE(actual_bool_value);
}

class PrefServiceUserFilePrefsTest : public testing::Test {
 protected:
  virtual void SetUp() {
    ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());

    ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_dir_));
    data_dir_ = data_dir_.AppendASCII("pref_service");
    ASSERT_TRUE(file_util::PathExists(data_dir_));
  }

  void ClearListValue(PrefService* prefs, const char* key) {
    ListPrefUpdate updater(prefs, key);
    updater->Clear();
  }

  void ClearDictionaryValue(PrefService* prefs, const char* key) {
    DictionaryPrefUpdate updater(prefs, key);
    updater->Clear();
  }

  // The path to temporary directory used to contain the test operations.
  ScopedTempDir temp_dir_;
  // The path to the directory where the test data is stored.
  FilePath data_dir_;
  // A message loop that we can use as the file thread message loop.
  MessageLoop message_loop_;
};

// Verifies that ListValue and DictionaryValue pref with non emtpy default
// preserves its empty value.
TEST_F(PrefServiceUserFilePrefsTest, PreserveEmptyValue) {
  FilePath pref_file = temp_dir_.path().AppendASCII("write.json");

  ASSERT_TRUE(file_util::CopyFile(
      data_dir_.AppendASCII("read.need_empty_value.json"),
      pref_file));

  PrefServiceMockBuilder builder;
  builder.WithUserFilePrefs(pref_file, base::MessageLoopProxy::current());
  scoped_ptr<PrefService> prefs(builder.Create());

  // Register testing prefs.
  prefs->RegisterListPref("list",
                          PrefService::UNSYNCABLE_PREF);
  prefs->RegisterDictionaryPref("dict",
                                PrefService::UNSYNCABLE_PREF);

  base::ListValue* non_empty_list = new base::ListValue;
  non_empty_list->Append(base::Value::CreateStringValue("test"));
  prefs->RegisterListPref("list_needs_empty_value",
                          non_empty_list,
                          PrefService::UNSYNCABLE_PREF);

  base::DictionaryValue* non_empty_dict = new base::DictionaryValue;
  non_empty_dict->SetString("dummy", "whatever");
  prefs->RegisterDictionaryPref("dict_needs_empty_value",
                                non_empty_dict,
                                PrefService::UNSYNCABLE_PREF);

  // Set all testing prefs to empty.
  ClearListValue(prefs.get(), "list");
  ClearListValue(prefs.get(), "list_needs_empty_value");
  ClearDictionaryValue(prefs.get(), "dict");
  ClearDictionaryValue(prefs.get(), "dict_needs_empty_value");

  // Write to file.
  prefs->CommitPendingWrite();
  MessageLoop::current()->RunAllPending();

  // Compare to expected output.
  FilePath golden_output_file =
      data_dir_.AppendASCII("write.golden.need_empty_value.json");
  ASSERT_TRUE(file_util::PathExists(golden_output_file));
  EXPECT_TRUE(file_util::TextContentsEqual(golden_output_file, pref_file));
}

class PrefServiceSetValueTest : public testing::Test {
 protected:
  static const char kName[];
  static const char kValue[];

  TestingPrefService prefs_;
  PrefObserverMock observer_;
};

const char PrefServiceSetValueTest::kName[] = "name";
const char PrefServiceSetValueTest::kValue[] = "value";

TEST_F(PrefServiceSetValueTest, SetStringValue) {
  const char default_string[] = "default";
  const StringValue default_value(default_string);
  prefs_.RegisterStringPref(kName, default_string);

  PrefChangeRegistrar registrar;
  registrar.Init(&prefs_);
  registrar.Add(kName, &observer_);

  // Changing the controlling store from default to user triggers notification.
  observer_.Expect(&prefs_, kName, &default_value);
  prefs_.Set(kName, default_value);
  Mock::VerifyAndClearExpectations(&observer_);

  EXPECT_CALL(observer_, Observe(_, _, _)).Times(0);
  prefs_.Set(kName, default_value);
  Mock::VerifyAndClearExpectations(&observer_);

  StringValue new_value(kValue);
  observer_.Expect(&prefs_, kName, &new_value);
  prefs_.Set(kName, new_value);
  Mock::VerifyAndClearExpectations(&observer_);
}

TEST_F(PrefServiceSetValueTest, SetDictionaryValue) {
  prefs_.RegisterDictionaryPref(kName);
  PrefChangeRegistrar registrar;
  registrar.Init(&prefs_);
  registrar.Add(kName, &observer_);

  EXPECT_CALL(observer_, Observe(_, _, _)).Times(0);
  prefs_.RemoveUserPref(kName);
  Mock::VerifyAndClearExpectations(&observer_);

  DictionaryValue new_value;
  new_value.SetString(kName, kValue);
  observer_.Expect(&prefs_, kName, &new_value);
  prefs_.Set(kName, new_value);
  Mock::VerifyAndClearExpectations(&observer_);

  EXPECT_CALL(observer_, Observe(_, _, _)).Times(0);
  prefs_.Set(kName, new_value);
  Mock::VerifyAndClearExpectations(&observer_);

  DictionaryValue empty;
  observer_.Expect(&prefs_, kName, &empty);
  prefs_.Set(kName, empty);
  Mock::VerifyAndClearExpectations(&observer_);
}

TEST_F(PrefServiceSetValueTest, SetListValue) {
  prefs_.RegisterListPref(kName);
  PrefChangeRegistrar registrar;
  registrar.Init(&prefs_);
  registrar.Add(kName, &observer_);

  EXPECT_CALL(observer_, Observe(_, _, _)).Times(0);
  prefs_.RemoveUserPref(kName);
  Mock::VerifyAndClearExpectations(&observer_);

  ListValue new_value;
  new_value.Append(Value::CreateStringValue(kValue));
  observer_.Expect(&prefs_, kName, &new_value);
  prefs_.Set(kName, new_value);
  Mock::VerifyAndClearExpectations(&observer_);

  EXPECT_CALL(observer_, Observe(_, _, _)).Times(0);
  prefs_.Set(kName, new_value);
  Mock::VerifyAndClearExpectations(&observer_);

  ListValue empty;
  observer_.Expect(&prefs_, kName, &empty);
  prefs_.Set(kName, empty);
  Mock::VerifyAndClearExpectations(&observer_);
}

class PrefServiceWebKitPrefs : public ChromeRenderViewHostTestHarness {
 protected:
  PrefServiceWebKitPrefs() : ui_thread_(BrowserThread::UI, &message_loop_) {
  }

  virtual void SetUp() {
    ChromeRenderViewHostTestHarness::SetUp();

    // Supply our own profile so we use the correct profile data. The test
    // harness is not supposed to overwrite a profile if it's already created.

    // Set some (WebKit) user preferences.
    TestingPrefService* pref_services = profile()->GetTestingPrefService();
#if defined(TOOLKIT_GTK)
    pref_services->SetUserPref(prefs::kUsesSystemTheme,
                               Value::CreateBooleanValue(false));
#endif
    pref_services->SetUserPref(prefs::kGlobalDefaultCharset,
                               Value::CreateStringValue("utf8"));
    pref_services->SetUserPref(prefs::kWebKitGlobalDefaultFontSize,
                               Value::CreateIntegerValue(20));
    pref_services->SetUserPref(prefs::kWebKitTextAreasAreResizable,
                               Value::CreateBooleanValue(false));
    pref_services->SetUserPref(prefs::kWebKitUsesUniversalDetector,
                               Value::CreateBooleanValue(true));
    pref_services->SetUserPref("webkit.webprefs.foo",
                               Value::CreateStringValue("bar"));
  }

 private:
  content::TestBrowserThread ui_thread_;
};

// Tests to see that webkit preferences are properly loaded and copied over
// to a WebPreferences object.
TEST_F(PrefServiceWebKitPrefs, PrefsCopied) {
  WebPreferences webkit_prefs =
      WebContentsTester::For(contents())->TestGetWebkitPrefs();

  // These values have been overridden by the profile preferences.
  EXPECT_EQ("UTF-8", webkit_prefs.default_encoding);
  EXPECT_EQ(20, webkit_prefs.default_font_size);
  EXPECT_FALSE(webkit_prefs.text_areas_are_resizable);
  EXPECT_TRUE(webkit_prefs.uses_universal_detector);

  // These should still be the default values.
#if defined(OS_MACOSX)
  const char kDefaultFont[] = "Times";
#elif defined(OS_CHROMEOS)
  const char kDefaultFont[] = "Tinos";
#else
  const char kDefaultFont[] = "Times New Roman";
#endif
  EXPECT_EQ(ASCIIToUTF16(kDefaultFont), webkit_prefs.standard_font_family);
  EXPECT_TRUE(webkit_prefs.javascript_enabled);
}


text:
/**
 */
package es.um.unosql.xtext.skiql.metamodel.skiql.util;

import es.um.unosql.xtext.skiql.metamodel.skiql.*;

import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;

import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;

import org.eclipse.emf.ecore.EObject;

/**
 *
 * The Adapter Factory for the model.
 * It provides an adapter createXXX method for each class of the model.
 *
 * @see es.um.unosql.xtext.skiql.metamodel.skiql.SkiqlPackage
 * @generated
 */
public class SkiqlAdapterFactory extends AdapterFactoryImpl {
	/**
	 * The cached model package.
	 *
	 *
	 * @generated
	 */
	protected static SkiqlPackage modelPackage;

	/**
	 * Creates an instance of the adapter factory.
	 *
	 *
	 * @generated
	 */
	public SkiqlAdapterFactory() {
		if (modelPackage == null) {
			modelPackage = SkiqlPackage.eINSTANCE;
		}
	}

	/**
	 * Returns whether this factory is applicable for the type of the object.
	 *
	 * This implementation returns true if the object is either the model's package or is an instance object of the model.
	 *
	 * @return whether this factory is applicable for the type of the object.
	 * @generated
	 */
	@Override
	public boolean isFactoryForType(Object object) {
		if (object == modelPackage) {
			return true;
		}
		if (object instanceof EObject) {
			return ((EObject)object).eClass().getEPackage() == modelPackage;
		}
		return false;
	}

	/**
	 * The switch that delegates to the createXXX methods.
	 *
	 *
	 * @generated
	 */
	protected SkiqlSwitch<Adapter> modelSwitch =
		new SkiqlSwitch<Adapter>() {
			@Override
			public Adapter caseSkiQLModel(SkiQLModel object) {
				return createSkiQLModelAdapter();
			}
			@Override
			public Adapter caseQuery(Query object) {
				return createQueryAdapter();
			}
			@Override
			public Adapter caseRelationshipQuery(RelationshipQuery object) {
				return createRelationshipQueryAdapter();
			}
			@Override
			public Adapter caseEntityQuery(EntityQuery object) {
				return createEntityQueryAdapter();
			}
			@Override
			public Adapter caseEntitySpec(EntitySpec object) {
				return createEntitySpecAdapter();
			}
			@Override
			public Adapter caseEntityOperation(EntityOperation object) {
				return createEntityOperationAdapter();
			}
			@Override
			public Adapter caseType(Type object) {
				return createTypeAdapter();
			}
			@Override
			public Adapter caseVersionHistory(VersionHistory object) {
				return createVersionHistoryAdapter();
			}
			@Override
			public Adapter caseBefore(Before object) {
				return createBeforeAdapter();
			}
			@Override
			public Adapter caseAfter(After object) {
				return createAfterAdapter();
			}
			@Override
			public Adapter caseBetween(Between object) {
				return createBetweenAdapter();
			}
			@Override
			public Adapter caseDateTime(DateTime object) {
				return createDateTimeAdapter();
			}
			@Override
			public Adapter caseAll(All object) {
				return createAllAdapter();
			}
			@Override
			public Adapter caseCountOperation(CountOperation object) {
				return createCountOperationAdapter();
			}
			@Override
			public Adapter caseVariationFilter(VariationFilter object) {
				return createVariationFilterAdapter();
			}
			@Override
			public Adapter casePropertySpec(PropertySpec object) {
				return createPropertySpecAdapter();
			}
			@Override
			public Adapter casePropertySelectorSpec(PropertySelectorSpec object) {
				return createPropertySelectorSpecAdapter();
			}
			@Override
			public Adapter caseOperation(Operation object) {
				return createOperationAdapter();
			}
			@Override
			public Adapter caseRelationshipSpec(RelationshipSpec object) {
				return createRelationshipSpecAdapter();
			}
			@Override
			public Adapter caseAggregationSpec(AggregationSpec object) {
				return createAggregationSpecAdapter();
			}
			@Override
			public Adapter caseReferenceSpec(ReferenceSpec object) {
				return createReferenceSpecAdapter();
			}
			@Override
			public Adapter caseTargetExpression(TargetExpression object) {
				return createTargetExpressionAdapter();
			}
			@Override
			public Adapter caseRelationshipExpression(RelationshipExpression object) {
				return createRelationshipExpressionAdapter();
			}
			@Override
			public Adapter caseEntityExpression(EntityExpression object) {
				return createEntityExpressionAdapter();
			}
			@Override
			public Adapter casePrimitiveType(PrimitiveType object) {
				return createPrimitiveTypeAdapter();
			}
			@Override
			public Adapter caseRelationshipType(RelationshipType object) {
				return createRelationshipTypeAdapter();
			}
			@Override
			public Adapter caseRelationSpec(RelationSpec object) {
				return createRelationSpecAdapter();
			}
			@Override
			public Adapter casePropertyFilter(PropertyFilter object) {
				return createPropertyFilterAdapter();
			}
			@Override
			public Adapter caseHaving(Having object) {
				return createHavingAdapter();
			}
			@Override
			public Adapter caseHavingType(HavingType object) {
				return createHavingTypeAdapter();
			}
			@Override
			public Adapter caseHavingKeys(HavingKeys object) {
				return createHavingKeysAdapter();
			}
			@Override
			public Adapter caseHavingVariations(HavingVariations object) {
				return createHavingVariationsAdapter();
			}
			@Override
			public Adapter defaultCase(EObject object) {
				return createEObjectAdapter();
			}
		};

	/**
	 * Creates an adapter for the target.
	 *
	 *
	 * @param target the object to adapt.
	 * @return the adapter for the target.
	 * @generated
	 */
	@Override
	public Adapter createAdapter(Notifier target) {
		return modelSwitch.doSwitch((EObject)target);
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.SkiQLModel Ski QL Model}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.SkiQLModel
	 * @generated
	 */
	public Adapter createSkiQLModelAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.Query Query}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.Query
	 * @generated
	 */
	public Adapter createQueryAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.RelationshipQuery Relationship Query}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.RelationshipQuery
	 * @generated
	 */
	public Adapter createRelationshipQueryAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.EntityQuery Entity Query}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.EntityQuery
	 * @generated
	 */
	public Adapter createEntityQueryAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.EntitySpec Entity Spec}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.EntitySpec
	 * @generated
	 */
	public Adapter createEntitySpecAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.EntityOperation Entity Operation}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.EntityOperation
	 * @generated
	 */
	public Adapter createEntityOperationAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.Type Type}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.Type
	 * @generated
	 */
	public Adapter createTypeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.VersionHistory Version History}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.VersionHistory
	 * @generated
	 */
	public Adapter createVersionHistoryAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.Before Before}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.Before
	 * @generated
	 */
	public Adapter createBeforeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.After After}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.After
	 * @generated
	 */
	public Adapter createAfterAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.Between Between}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.Between
	 * @generated
	 */
	public Adapter createBetweenAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.DateTime Date Time}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.DateTime
	 * @generated
	 */
	public Adapter createDateTimeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.All All}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.All
	 * @generated
	 */
	public Adapter createAllAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.CountOperation Count Operation}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.CountOperation
	 * @generated
	 */
	public Adapter createCountOperationAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.VariationFilter Variation Filter}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.VariationFilter
	 * @generated
	 */
	public Adapter createVariationFilterAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.PropertySpec Property Spec}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.PropertySpec
	 * @generated
	 */
	public Adapter createPropertySpecAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.PropertySelectorSpec Property Selector Spec}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.PropertySelectorSpec
	 * @generated
	 */
	public Adapter createPropertySelectorSpecAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.Operation Operation}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.Operation
	 * @generated
	 */
	public Adapter createOperationAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.RelationshipSpec Relationship Spec}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.RelationshipSpec
	 * @generated
	 */
	public Adapter createRelationshipSpecAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.AggregationSpec Aggregation Spec}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.AggregationSpec
	 * @generated
	 */
	public Adapter createAggregationSpecAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.ReferenceSpec Reference Spec}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.ReferenceSpec
	 * @generated
	 */
	public Adapter createReferenceSpecAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.TargetExpression Target Expression}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.TargetExpression
	 * @generated
	 */
	public Adapter createTargetExpressionAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.RelationshipExpression Relationship Expression}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.RelationshipExpression
	 * @generated
	 */
	public Adapter createRelationshipExpressionAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.EntityExpression Entity Expression}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.EntityExpression
	 * @generated
	 */
	public Adapter createEntityExpressionAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.PrimitiveType Primitive Type}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.PrimitiveType
	 * @generated
	 */
	public Adapter createPrimitiveTypeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.RelationshipType Relationship Type}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.RelationshipType
	 * @generated
	 */
	public Adapter createRelationshipTypeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.RelationSpec Relation Spec}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.RelationSpec
	 * @generated
	 */
	public Adapter createRelationSpecAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.PropertyFilter Property Filter}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.PropertyFilter
	 * @generated
	 */
	public Adapter createPropertyFilterAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.Having Having}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.Having
	 * @generated
	 */
	public Adapter createHavingAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.HavingType Having Type}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.HavingType
	 * @generated
	 */
	public Adapter createHavingTypeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.HavingKeys Having Keys}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.HavingKeys
	 * @generated
	 */
	public Adapter createHavingKeysAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link es.um.unosql.xtext.skiql.metamodel.skiql.HavingVariations Having Variations}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.HavingVariations
	 * @generated
	 */
	public Adapter createHavingVariationsAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for the default case.
	 *
	 * This default implementation returns null.
	 *
	 * @return the new adapter.
	 * @generated
	 */
	public Adapter createEObjectAdapter() {
		return null;
	}

} //SkiqlAdapterFactory


text:
namespace PR {
namespace UI {
// The Transform convention is TRS!
class PR_LIB_UI TransformableEntity {
public:
	TransformableEntity();
	virtual ~TransformableEntity() = default;

	inline const Matrix4f& transform() const { return mTransformCache; }
	// TRS
	void setTransform(const Matrix4f& trans);
	void setTransform(const Vector3f& pos, const Quaternionf& rot, const Vector3f& scale);
	void setTransform(const Vector3f& pos, const Quaternionf& rot, float scale);
	void setTransform(const Vector3f& pos, const Quaternionf& rot);
	// TR
	void setTransformNoScale(const Matrix4f& trans);
	Matrix4f transformNoScale() const;

	Matrix3f normalTransform() const;

	inline const Vector3f& position() const { return mTranslation; }
	inline const Vector3f& translation() const { return mTranslation; }
	inline const Quaternionf& rotation() const { return mRotation; }
	inline const Vector3f& scale() const { return mScale; }

	// Operators do not interfere with eachother -> Translation is applied before rotation...
	void translate(const Vector3f& v);
	void rotate(const Quaternionf& v);
	void scale(const Vector3f& v);
	void scale(float f);

	void setTranslation(const Vector3f& v);
	void setRotation(const Quaternionf& v);
	void setScale(const Vector3f& v);
	void setScale(float f);

	inline void show(bool b = true) { mVisible = b; }
	inline void hide(bool b = true) { show(!b); }
	inline bool isVisible() const { return mVisible; }
	inline bool isHidden() const { return !mVisible; }

private:
	void cache();
	Matrix4f calcMatrix() const;

	Vector3f mTranslation;
	Quaternionf mRotation;
	Vector3f mScale;
	Matrix4f mTransformCache;

	bool mVisible;
};
} // namespace UI
} // namespace PR


text:
const app = require("../server.js");
const chai = require("chai");
const chaiHttp = require("chai-http");
const should = chai.should();

chai.use(require("chai-things"));
chai.use(chaiHttp);

describe("Routes tests", () => {

  //This test should get all users in database
  it("Should get all users in database", (done) => {
    chai.request(app)
      .get("/users/all")
      .end((err, res) => {
        res.should.have.status(200);
        res.should.have.header("content-type", "application/json; charset=utf-8");
        done(err);
      });
  });

  //This test gets all the reservations in database
  it("Should get all reservations in database", (done) => {
    chai.request(app)
      .get("/reservations")
      .end((err, res) => {
        res.should.have.status(200);
        res.should.have.header("content-type", "application/json; charset=utf-8");
        done(err);
      });
  });

  //This test fails to post a user to the database because of a missing password
  it("Should fail to post a user to the database because of a missing password", (done) => {
    chai.request(app)
      .post("/users/register")
      .send({ username: "asd"})
      .end((err, res) => {
        res.should.have.status(200);
        res.should.have.header("content-type", "application/json; charset=utf-8");
        res.body.should.have.property("message").eql("No password was given");
        done(err);
      });
  });

  /*it("Should fail to log in the user", (done) => {
    chai.request(app)
      .post("/users/login")
      .send({ username: "notadminm8"})
      .end((err, res) => {
        res.should.have.status(400);
        console.log(res);
        done(err);
      });
  });*/

  //This test logs in the user
  it("Should log in the user", (done) => {
    chai.request(app)
      .post("/users/login")
      .send({ username: "notadminm8", password: "qwe123"})
      .end((err, res) => {
        res.should.have.status(200);
        res.should.have.header("content-type", "text/html; charset=utf-8");
        done(err);
      });
  });
});


text:
package com.capgemini.boot.core;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = TestSettings.SETTINGS_PREFIX)
public class TestSettings {
    public static final String SETTINGS_PREFIX = "test-settings";

    private Map<String, String> settingMap = new HashMap<String, String>();

    private List<String> settingList = new ArrayList<String>();

    private String singleSetting;

    public Map<String, String> getSettingMap() {
        return settingMap;
    }

    public List<String> getSettingList() {
        return settingList;
    }

    public String getSingleSetting() {
        return singleSetting;
    }

    public void setSingleSetting(String value) {
        singleSetting = value;
    }
}