text:
(function() {
  var AuthenticateClient, Base, Config, KeyManager, PostMessageClient, SessionClient, Thread, ThreadClient, UserSet, chris, donnie, err, iced, idg, log, main, make_esc, max, rc, unlocker, __iced_deferrals, __iced_k, __iced_k_noop, _ref, _ref1,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  iced = require('iced-coffee-script').iced;
  __iced_k = __iced_k_noop = function() {};

  SessionClient = require('./session').SessionClient;

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

  Base = require('./base').Base;

  Config = require('./config').Config;

  _ref = require('./data'), UserSet = _ref.UserSet, Thread = _ref.Thread;

  _ref1 = require('../test/data/users.iced'), donnie = _ref1.donnie, chris = _ref1.chris, max = _ref1.max;

  AuthenticateClient = require('./authenticate').AuthenticateClient;

  log = require('iced-logger');

  idg = require('keybase-messenger-core').id.generators;

  KeyManager = require('kbpgp').KeyManager;

  PostMessageClient = require('./post').PostMessageClient;

  exports.ThreadClient = ThreadClient = (function(_super) {
    __extends(ThreadClient, _super);

    function ThreadClient(_arg) {
      var cfg;
      cfg = _arg.cfg, this.thread = _arg.thread, this.me = _arg.me;
      ThreadClient.__super__.constructor.call(this, {
        cfg: cfg
      });
      this.thread_auth_km = null;
      this.cipher = null;
    }

    ThreadClient.prototype.init_thread = function(arg, cb) {
      var args, esc, msg, scli, session_id, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      esc = make_esc(cb, "Client::init_thread");
      scli = new SessionClient({
        cfg: this.cfg
      });
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/max/src/keybase/messenger-client/src/thread.iced",
            funcname: "ThreadClient.init_thread"
          });
          scli.establish_session(esc(__iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return session_id = arguments[0];
              };
            })(),
            lineno: 31
          })));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          (function(__iced_k) {
            __iced_deferrals = new iced.Deferrals(__iced_k, {
              parent: ___iced_passed_deferral,
              filename: "/home/max/src/keybase/messenger-client/src/thread.iced",
              funcname: "ThreadClient.init_thread"
            });
            _this.thread.gen_init_msg(esc(__iced_deferrals.defer({
              assign_fn: (function() {
                return function() {
                  return msg = arguments[0];
                };
              })(),
              lineno: 32
            })));
            __iced_deferrals._fulfill();
          })(function() {
            msg.session_id = session_id;
            args = {
              endpoint: "thread/init",
              method: "POST",
              data: msg
            };
            _this.cipher = _this.thread.get_cipher();
            (function(__iced_k) {
              __iced_deferrals = new iced.Deferrals(__iced_k, {
                parent: ___iced_passed_deferral,
                filename: "/home/max/src/keybase/messenger-client/src/thread.iced",
                funcname: "ThreadClient.init_thread"
              });
              _this.request(args, esc(__iced_deferrals.defer({
                lineno: 41
              })));
              __iced_deferrals._fulfill();
            })(function() {
              return cb(null);
            });
          });
        };
      })(this));
    };

    ThreadClient.prototype.get_authenticate_klass = function() {
      return AuthenticateClient;
    };

    ThreadClient.prototype.get_poster_klass = function() {
      return PostMessageClient;
    };

    ThreadClient.prototype.authenticate = function(_arg, cb) {
      var auth, err, klass, user, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      user = _arg.user;
      user || (user = this.me);
      klass = this.get_authenticate_klass();
      auth = new klass({
        thread: this.thread,
        user: user,
        cfg: this.cfg
      });
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/max/src/keybase/messenger-client/src/thread.iced",
            funcname: "ThreadClient.authenticate"
          });
          auth.authenticate(__iced_deferrals.defer({
            assign_fn: (function(__slot_1) {
              return function() {
                err = arguments[0];
                return __slot_1.thread_auth_km = arguments[1];
              };
            })(_this),
            lineno: 55
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          return cb(err);
        };
      })(this));
    };

    ThreadClient.prototype.update_write_token = function(_arg, cb) {
      var args, err, msg, user, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      user = _arg.user;
      log.debug("+ update write token for " + user.display_name);
      msg = {
        i: this.thread.i,
        user_zid: this.thread.get_user_zid(user),
        old_token: user.t,
        new_token: idg.write_token()
      };
      args = {
        endpoint: "thread/update_write_token",
        method: "POST",
        data: msg
      };
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/max/src/keybase/messenger-client/src/thread.iced",
            funcname: "ThreadClient.update_write_token"
          });
          _this.request(args, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return err = arguments[0];
              };
            })(),
            lineno: 71
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          if (typeof err === "undefined" || err === null) {
            user.t = msg.new_token;
          }
          log.debug("- write token update: -> " + err);
          return cb(err);
        };
      })(this));
    };

    ThreadClient.prototype.post_message = function(_arg, cb) {
      var args, err, klass, mime_type, msg, msg_zid, poster, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      msg = _arg.msg, mime_type = _arg.mime_type;
      args = {
        cfg: this.cfg,
        from: this.me,
        signing_km: this.thread_auth_km,
        thread: this.thread,
        msg: msg,
        mime_type: mime_type
      };
      klass = this.get_poster_klass();
      poster = new klass(args);
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/max/src/keybase/messenger-client/src/thread.iced",
            funcname: "ThreadClient.post_message"
          });
          poster.post({}, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                err = arguments[0];
                return msg_zid = arguments[1];
              };
            })(),
            lineno: 83
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          return cb(err, poster, msg_zid);
        };
      })(this));
    };

    ThreadClient.prototype.delete_messages = function(_arg, cb) {
      var err, msg_zid, poster, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      poster = _arg.poster, msg_zid = _arg.msg_zid;
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/max/src/keybase/messenger-client/src/thread.iced",
            funcname: "ThreadClient.delete_messages"
          });
          _this.poster.delete_messages({
            msg_zid: msg_zid
          }, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return err = arguments[0];
              };
            })(),
            lineno: 89
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          return cb(err);
        };
      })(this));
    };

    return ThreadClient;

  })(Base);

  unlocker = function(raw, cb) {
    var esc, km, ___iced_passed_deferral, __iced_deferrals, __iced_k;
    __iced_k = __iced_k_noop;
    ___iced_passed_deferral = iced.findDeferral(arguments);
    esc = make_esc(cb, "Unlocker");
    (function(_this) {
      return (function(__iced_k) {
        __iced_deferrals = new iced.Deferrals(__iced_k, {
          parent: ___iced_passed_deferral,
          filename: "/home/max/src/keybase/messenger-client/src/thread.iced"
        });
        KeyManager.import_from_armored_pgp({
          raw: raw
        }, esc(__iced_deferrals.defer({
          assign_fn: (function() {
            return function() {
              return km = arguments[0];
            };
          })(),
          lineno: 96
        })));
        __iced_deferrals._fulfill();
      });
    })(this)((function(_this) {
      return function() {
        (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/max/src/keybase/messenger-client/src/thread.iced"
          });
          km.unlock_pgp({
            passphrase: ''
          }, esc(__iced_deferrals.defer({
            lineno: 97
          })));
          __iced_deferrals._fulfill();
        })(function() {
          return cb(null, km);
        });
      };
    })(this));
  };

  main = function(cb) {
    var cfg, cli, esc, msg, msg_zid, poster, thread, user_set, ___iced_passed_deferral, __iced_deferrals, __iced_k;
    __iced_k = __iced_k_noop;
    ___iced_passed_deferral = iced.findDeferral(arguments);
    log["package"]().env().set_level(log["package"]().DEBUG);
    cfg = new Config({
      port: 3021
    });
    user_set = new UserSet({
      users: [donnie, chris, max]
    });
    thread = new Thread({
      cfg: cfg,
      user_set: user_set,
      etime: 0
    });
    cli = new ThreadClient({
      cfg: cfg,
      thread: thread,
      me: donnie
    });
    esc = make_esc(cb, "test");
    msg = "This feels like my element.";
    (function(_this) {
      return (function(__iced_k) {
        __iced_deferrals = new iced.Deferrals(__iced_k, {
          parent: ___iced_passed_deferral,
          filename: "/home/max/src/keybase/messenger-client/src/thread.iced"
        });
        donnie.unlock_private_key(unlocker, esc(__iced_deferrals.defer({
          lineno: 108
        })));
        __iced_deferrals._fulfill();
      });
    })(this)((function(_this) {
      return function() {
        (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/max/src/keybase/messenger-client/src/thread.iced"
          });
          cli.init_thread({}, esc(__iced_deferrals.defer({
            lineno: 109
          })));
          __iced_deferrals._fulfill();
        })(function() {
          (function(__iced_k) {
            __iced_deferrals = new iced.Deferrals(__iced_k, {
              parent: ___iced_passed_deferral,
              filename: "/home/max/src/keybase/messenger-client/src/thread.iced"
            });
            cli.update_write_token({
              thread: thread,
              user: chris
            }, esc(__iced_deferrals.defer({
              lineno: 110
            })));
            __iced_deferrals._fulfill();
          })(function() {
            (function(__iced_k) {
              __iced_deferrals = new iced.Deferrals(__iced_k, {
                parent: ___iced_passed_deferral,
                filename: "/home/max/src/keybase/messenger-client/src/thread.iced"
              });
              cli.authenticate({}, esc(__iced_deferrals.defer({
                lineno: 111
              })));
              __iced_deferrals._fulfill();
            })(function() {
              (function(__iced_k) {
                __iced_deferrals = new iced.Deferrals(__iced_k, {
                  parent: ___iced_passed_deferral,
                  filename: "/home/max/src/keybase/messenger-client/src/thread.iced"
                });
                cli.post_message({
                  msg: msg
                }, esc(__iced_deferrals.defer({
                  assign_fn: (function() {
                    return function() {
                      poster = arguments[0];
                      return msg_zid = arguments[1];
                    };
                  })(),
                  lineno: 112
                })));
                __iced_deferrals._fulfill();
              })(function() {
                (function(__iced_k) {
                  __iced_deferrals = new iced.Deferrals(__iced_k, {
                    parent: ___iced_passed_deferral,
                    filename: "/home/max/src/keybase/messenger-client/src/thread.iced"
                  });
                  cli.delete_messages({
                    poster: poster,
                    msg_zid: msg_zid
                  }, esc(__iced_deferrals.defer({
                    lineno: 113
                  })));
                  __iced_deferrals._fulfill();
                })(function() {
                  return cb(null);
                });
              });
            });
          });
        });
      };
    })(this));
  };

  (function(_this) {
    return (function(__iced_k) {
      __iced_deferrals = new iced.Deferrals(__iced_k, {
        filename: "/home/max/src/keybase/messenger-client/src/thread.iced"
      });
      main(__iced_deferrals.defer({
        assign_fn: (function() {
          return function() {
            return err = arguments[0];
          };
        })(),
        lineno: 118
      }));
      __iced_deferrals._fulfill();
    });
  })(this)((function(_this) {
    return function() {
      rc = 0;
      if (typeof err !== "undefined" && err !== null) {
        log.error(err.toString());
        rc = 2;
      }
      return process.exit(rc);
    };
  })(this));

}).call(this);


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <sunning.democollection.design.scrollcard.SlidingCardView
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <sunning.democollection.design.scrollcard.SlidingCardView
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <sunning.democollection.design.scrollcard.SlidingCardView
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <sunning.democollection.design.scrollcard.SlidingCardView
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</android.support.design.widget.CoordinatorLayout>

redpajama_set_name: RedPajamaGithub


text:
package main

import (
	"fmt"

	proxyconfig "istio.io/api/proxy/v1/config"
)

type http struct {
	*infra
	logs *accessLogs
}

func (r *http) String() string {
	return "http-reachability"
}

func (r *http) setup() error {
	r.logs = makeAccessLogs()
	return nil
}

func (r *http) teardown() {
}

func (r *http) run() error {
	if err := r.makeRequests(); err != nil {
		return err
	}
	if err := r.logs.check(r.infra); err != nil {
		return err
	}
	return nil
}

// makeRequests executes requests in pods and collects request ids per pod to check against access logs
func (r *http) makeRequests() error {
	testPods := []string{"a", "b"}
	if r.Auth == proxyconfig.ProxyMeshConfig_NONE {
		// t is not behind proxy, so it cannot talk in Istio auth.
		testPods = append(testPods, "t")
	}
	funcs := make(map[string]func() status)
	for _, src := range testPods {
		for _, dst := range testPods {
			for _, port := range []string{"", ":80", ":8080"} {
				for _, domain := range []string{"", "." + r.Namespace} {
					name := fmt.Sprintf("HTTP request from %s to %s%s%s", src, dst, domain, port)
					funcs[name] = (func(src, dst, port, domain string) func() status {
						url := fmt.Sprintf("http://%s%s%s/%s", dst, domain, port, src)
						return func() status {
							resp := r.clientRequest(src, url, 1, "")
							if len(resp.id) > 0 {
								id := resp.id[0]
								if src != "t" {
									r.logs.add(src, id, name)
								}
								if dst != "t" {
									r.logs.add(dst, id, name)
								}
								// mixer filter is invoked on the server side, that is when dst is not "t"
								if r.Mixer && dst != "t" {
									r.logs.add("mixer", id, name)
								}
								return nil
							}
							if src == "t" && dst == "t" {
								// Expected no match for t->t
								return nil
							}
							return errAgain
						}
					})(src, dst, port, domain)
				}
			}
		}
	}
	return parallel(funcs)
}


text:
package org.apache.hadoop.yarn.server.resourcemanager.scheduler;

import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.metrics.CustomResourceMetrics;
import org.apache.hadoop.yarn.metrics.CustomResourceMetricValue;

import java.util.Map;

public class QueueMetricsForCustomResources extends CustomResourceMetrics {
  private final CustomResourceMetricValue aggregatePreemptedSeconds =
      new CustomResourceMetricValue();
  private final CustomResourceMetricValue aggregatePreempted =
      new CustomResourceMetricValue();
  private final CustomResourceMetricValue pending =
      new CustomResourceMetricValue();
  private final CustomResourceMetricValue reserved =
      new CustomResourceMetricValue();

  public void increaseReserved(Resource res) {
    reserved.increase(res);
  }

  public void decreaseReserved(Resource res) {
    reserved.decrease(res);
  }

  public void increasePending(Resource res, int containers) {
    pending.increaseWithMultiplier(res, containers);
  }

  public void decreasePending(Resource res) {
    pending.decrease(res);
  }

  public void decreasePending(Resource res, int containers) {
    pending.decreaseWithMultiplier(res, containers);
  }

  public Map<String, Long> getPendingValues() {
    return pending.getValues();
  }

  public Map<String, Long> getReservedValues() {
    return reserved.getValues();
  }

  public void increaseAggregatedPreemptedSeconds(Resource res, long seconds) {
    aggregatePreemptedSeconds.increaseWithMultiplier(res, seconds);
  }

  public void increaseAggregatedPreempted(Resource res) {
    aggregatePreempted.increase(res);
  }

  CustomResourceMetricValue getAggregatePreemptedSeconds() {
    return aggregatePreemptedSeconds;
  }
}


text:
"use strict"

var Promise = require("bluebird")
var spawn = require("child_process").spawn
var path = require("path")
var extend = require("extend")
var fse = require("fs-extra")

var Installation = module.exports = function (version, srcDir, cacheDir, targetPath, installPath) {
  this._version = version
  this._srcDirPath = srcDir
  this._cacheDir = cacheDir
  this._targetPath = targetPath
  this._installPath = installPath

  this._npmCachePath = new Promise(function (resolve, reject) {
    var npmCachePath = path.resolve(this._cacheDir, "npm-cache")
    fse.mkdirs(npmCachePath, function (err) {
      if (err) return reject(err)
      return resolve(npmCachePath)
    }.bind(this))
  }.bind(this))
}

Installation.prototype.version = function () {
  return this._version
}

Installation.prototype.binaryPath = function () {
  return path.join(this._installPath, "bin", "iojs")
}

Installation.prototype.npm = function (cwd, args, opts, cb) {
  this._npmCachePath.then(function (npmCachePath) {
    cwd = cwd || this._targetPath
    cwd = path.resolve(this._targetPath, cwd)
    cb = cb || opts
    opts = extend({
      cwd: cwd,
      stdio: "inherit"
    }, opts === cb ? {} : opts)

    var callersEnvOverrides = opts.env
    opts.env = extend(process.env)

    // Fix up the environment to get npm working correctly in the bundled
    // io.js context. First, remove any npm_ env vars we may have inherited.
    Object.keys(opts.env).forEach(function (name) {
      if (name.match(/^npm_/)) delete opts.env[name]
    })

    // Now let's set npm's cache dir and nodedir (node source dir) to point
    // at the right things for this install.
    opts.env.npm_config_cache = npmCachePath
    opts.env.npm_config_nodedir = this._srcDirPath
    opts.env.PWD = cwd

    // Bring in caller's env overrides (what was originally opts.env)
    opts.env = extend(opts.env, callersEnvOverrides)

    // Next, let's make sure our bundled iojs, node and npm binaries are on
    // the PATH, such that they are chosen before any others installed on
    // the local system.
    opts.env.PATH = path.resolve(this._targetPath, this._installPath, "bin")
      + ":" + opts.env.PATH

    var npmBinPath = path.resolve(this._targetPath, this._installPath, "bin", "npm")
    spawn(npmBinPath, args, opts)
      .on("close", function (code, sig) {
        if (code !== 0 || sig) return cb(new Error("Got exit code (" + code + ") or signal (" + sig + ") from npm"))
        return cb(null)
      })
  }.bind(this))
}


text:
relimit
=======

[![Build Status](https://img.shields.io/travis/nodeca/relimit/master.svg?style=flat)](https://travis-ci.org/nodeca/relimit)
[![NPM version](https://img.shields.io/npm/v/relimit.svg?style=flat)](https://www.npmjs.org/package/relimit)
[![Coverage Status](https://coveralls.io/repos/github/nodeca/relimit/badge.svg?branch=master)](https://coveralls.io/github/nodeca/relimit?branch=master)

> Distributed rate limiter with tuneable scheduler.

Imagine, that you need to scan 1M of pages/images/videos. To do it effectively, you may wish:

- limit each domain to 4 scans/sec to avoid bans
- increase limit to 100 scans/sec for well known services like google
- restrict number of parallel connections to each domain
- restrict total outgoing connections from process to control resources
- distribute scans to cluster for miltiple IPs use and speed increase

All this things can be done with `relimit`! Built in redis adapter available
for distributed use.

Install
-------

`node.js` 8+ and `redis` 3.0+ required.

```sh
npm install idoit --save
```

API
---

### new Relimit({ scheduler, rate, normalize, consume, process, ns })

- **scheduler** (String) - optional, redis connection url if shared use needed.
  If not defined - local scheduler will be used.
- **rate(item)** (Function|String) - `"4/s"`, `100/2m` or function(item),
  returning such kind of string. Where `item` is single element of `relimit`
  input.
- **normalize(item)** (Function) - return grouping key for incoming item. For
  example, if input items are URLs, you may return domain name.
- **consume(item)** - consumer strategy, return `true` to allocate execution
  slot immediately, or `false` to postpone attempt. Default - return `true`.
- **process(item)** (AsyncFunction) - function to process incoming item, when
  time come.
- **ns** (String) - data namespace, currently used as redis keys prefix,
   "relimit:" by default.

Note on `consume(item)`. Imagine, that you run distributed limiter, and some
process can crash. If you allocate execution time for all incoming items
immediately, then after crash all such slots will be lost (will not be used).
Better idea will be to allocate slots only until available, and retry with the
rest of items later. Also, you may use internal stats about domain or total
active connections from local `relimit` instance to restrivt those.

Note on `rate(item)`. You may wish return different rates for different domains.
But value MUST be the same for the same domain (normalized item), that's
important.

Note on `process(item)`. This function is shceduled to do necessary actions on
incoming items. IT SHOULD NOT FAIL. Failure state is NOT `relimit` duty. You
may store result to retry later, readd new item to queue and so on. If you
return error, it will be forwarded to logger, but item will be marked as
processed.

### .push([ items ])

Place Array[item] or single item to incoming queue.

### .wait() -> Promise

Resolve when `relimit` idle (all job done).

### .stat(key) -> { total, active, pending }

Return statistics about specific items group or global one if `key` not set.
`key` is result of `normalize(item)` (for example, link -> domain).

### ? .start()

### ? .shutdown()

### ? .ready()

### ? .on('eventName', handler)

Why one more limiter?
---------------------

We needed customizeable rates and more convenient API for our needs. This one
is focused on massive URL requests use cases.

Note. Don't try to use this package for CPU management (reinventing system
scheduler for job queue). Use [idoit](https://github.com/nodeca/idoit) instead.

Other rate limiters:

- https://github.com/eventEmitter/leaky-bucket
- https://github.com/jesucarr/tokenbucket
- https://github.com/andyburke/tokenpipe
- https://github.com/tj/node-ratelimiter
- https://github.com/TabDigital/redis-rate-limiter
- https://github.com/classdojo/rolling-rate-limiter


text:
package org.apache.camel.component.sjms;

import java.util.Map;
import java.util.concurrent.ExecutorService;

import javax.jms.ConnectionFactory;
import javax.jms.ExceptionListener;

import org.apache.camel.CamelException;
import org.apache.camel.Endpoint;
import org.apache.camel.ExchangePattern;
import org.apache.camel.component.sjms.jms.DefaultDestinationCreationStrategy;
import org.apache.camel.component.sjms.jms.DefaultJmsKeyFormatStrategy;
import org.apache.camel.component.sjms.jms.DestinationCreationStrategy;
import org.apache.camel.component.sjms.jms.JmsKeyFormatStrategy;
import org.apache.camel.component.sjms.jms.MessageCreatedStrategy;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.annotations.Component;
import org.apache.camel.support.HeaderFilterStrategyComponent;

@Component("sjms")
public class SjmsComponent extends HeaderFilterStrategyComponent {

    private ExecutorService asyncStartStopExecutorService;

    @Metadata(label = "common", autowired = true,
              description = "The connection factory to be use. A connection factory must be configured either on the component or endpoint.")
    private ConnectionFactory connectionFactory;
    @UriParam(description = "Sets the JMS client ID to use. Note that this value, if specified, must be unique and can only be used by a single JMS connection instance."
                            + " It is typically only required for durable topic subscriptions."
                            + " If using Apache ActiveMQ you may prefer to use Virtual Topics instead.")
    private String clientId;
    @Metadata(label = "advanced",
              description = "Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification."
                            + " Camel provides one implementation out of the box: default. The default strategy will safely marshal dots and hyphens (. and -)."
                            + " Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation"
                            + " of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the # notation.")
    private JmsKeyFormatStrategy jmsKeyFormatStrategy = new DefaultJmsKeyFormatStrategy();
    @Metadata(label = "advanced", description = "To use a custom DestinationCreationStrategy.")
    private DestinationCreationStrategy destinationCreationStrategy = new DefaultDestinationCreationStrategy();
    @Metadata(label = "advanced",
              description = "To use the given MessageCreatedStrategy which are invoked when Camel creates new instances"
                            + " of javax.jms.Message objects when Camel is sending a JMS message.")
    private MessageCreatedStrategy messageCreatedStrategy;
    @Metadata(defaultValue = "5000", label = "advanced", javaType = "java.time.Duration",
              description = "Specifies the interval between recovery attempts, i.e. when a connection is being refreshed, in milliseconds."
                            + " The default is 5000 ms, that is, 5 seconds.")
    private long recoveryInterval = 5000;
    @Metadata(defaultValue = "1000", label = "advanced", javaType = "java.time.Duration",
              description = "Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS."
                            + " By default Camel checks once per second. But if you must react faster when a timeout occurs,"
                            + " then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout.")
    private long requestTimeoutCheckerInterval = 1000L;
    @Metadata(label = "advanced", defaultValue = "1",
              description = "Specifies the maximum number of concurrent consumers for continue routing when timeout occurred when using request/reply over JMS.")
    private int replyToOnTimeoutMaxConcurrentConsumers = 1;

    @Metadata(label = "advanced",
              description = "Specifies the JMS Exception Listener that is to be notified of any underlying JMS exceptions.")
    private ExceptionListener exceptionListener;

    public SjmsComponent() {
    }

    protected SjmsComponent(Class<? extends Endpoint> endpointClass) {
    }

    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        validateMepAndReplyTo(parameters);

        SjmsEndpoint endpoint = createSjmsEndpoint(uri, remaining);
        endpoint.setConnectionFactory(connectionFactory);
        endpoint.setDestinationCreationStrategy(destinationCreationStrategy);
        endpoint.setRecoveryInterval(recoveryInterval);
        endpoint.setMessageCreatedStrategy(messageCreatedStrategy);
        endpoint.setClientId(clientId);
        endpoint.setExceptionListener(exceptionListener);
        if (getHeaderFilterStrategy() != null) {
            endpoint.setHeaderFilterStrategy(getHeaderFilterStrategy());
        }
        setProperties(endpoint, parameters);
        return endpoint;
    }

    protected SjmsEndpoint createSjmsEndpoint(String uri, String remaining) {
        return new SjmsEndpoint(uri, this, remaining);
    }

    /**
     * Helper method used to verify that when there is a replyTo value we are using the InOut MEP. If namedReplyTo is
     * defined and the MEP is InOnly the endpoint won't be expecting a reply so throw an error to alert the user.
     *
     * @param  parameters {@link Endpoint} parameters
     * @throws Exception  throws a {@link CamelException} when MEP equals InOnly and replyTo is defined.
     */
    private static void validateMepAndReplyTo(Map<String, Object> parameters) throws Exception {
        boolean replyToSet = parameters.containsKey("replyTo");
        boolean mepSet = parameters.containsKey("exchangePattern");
        if (replyToSet && mepSet) {
            if (!parameters.get("exchangePattern").equals(ExchangePattern.InOut.toString())) {
                String replyTo = (String) parameters.get("replyTo");
                ExchangePattern mep = ExchangePattern.valueOf((String) parameters.get("exchangePattern"));
                throw new CamelException(
                        "Setting parameter replyTo=" + replyTo
                                         + " requires a MEP of type InOut. Parameter exchangePattern is set to " + mep);
            }
        }
    }

    @Override
    protected void doShutdown() throws Exception {
        if (asyncStartStopExecutorService != null) {
            getCamelContext().getExecutorServiceManager().shutdownNow(asyncStartStopExecutorService);
            asyncStartStopExecutorService = null;
        }
        super.doShutdown();
    }

    protected synchronized ExecutorService getAsyncStartStopExecutorService() {
        if (asyncStartStopExecutorService == null) {
            // use a cached thread pool for async start tasks as they can run for a while, and we need a dedicated thread
            // for each task, and the thread pool will shrink when no more tasks running
            asyncStartStopExecutorService
                    = getCamelContext().getExecutorServiceManager().newCachedThreadPool(this, "AsyncStartStopListener");
        }
        return asyncStartStopExecutorService;
    }

    public void setConnectionFactory(ConnectionFactory connectionFactory) {
        this.connectionFactory = connectionFactory;
    }

    public ConnectionFactory getConnectionFactory() {
        return connectionFactory;
    }

    public void setExceptionListener(ExceptionListener exceptionListener) {
        this.exceptionListener = exceptionListener;
    }

    public ExceptionListener getExceptionListener() {
        return exceptionListener;
    }

    public void setJmsKeyFormatStrategy(JmsKeyFormatStrategy jmsKeyFormatStrategy) {
        this.jmsKeyFormatStrategy = jmsKeyFormatStrategy;
    }

    public JmsKeyFormatStrategy getJmsKeyFormatStrategy() {
        return jmsKeyFormatStrategy;
    }

    public DestinationCreationStrategy getDestinationCreationStrategy() {
        return destinationCreationStrategy;
    }

    public void setDestinationCreationStrategy(DestinationCreationStrategy destinationCreationStrategy) {
        this.destinationCreationStrategy = destinationCreationStrategy;
    }

    public MessageCreatedStrategy getMessageCreatedStrategy() {
        return messageCreatedStrategy;
    }

    public void setMessageCreatedStrategy(MessageCreatedStrategy messageCreatedStrategy) {
        this.messageCreatedStrategy = messageCreatedStrategy;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public long getRecoveryInterval() {
        return recoveryInterval;
    }

    public void setRecoveryInterval(long recoveryInterval) {
        this.recoveryInterval = recoveryInterval;
    }

    public long getRequestTimeoutCheckerInterval() {
        return requestTimeoutCheckerInterval;
    }

    public void setRequestTimeoutCheckerInterval(long requestTimeoutCheckerInterval) {
        this.requestTimeoutCheckerInterval = requestTimeoutCheckerInterval;
    }

    public int getReplyToOnTimeoutMaxConcurrentConsumers() {
        return replyToOnTimeoutMaxConcurrentConsumers;
    }

    public void setReplyToOnTimeoutMaxConcurrentConsumers(int replyToOnTimeoutMaxConcurrentConsumers) {
        this.replyToOnTimeoutMaxConcurrentConsumers = replyToOnTimeoutMaxConcurrentConsumers;
    }
}


text:
#pragma once
#include <aws/lex-models/LexModelBuildingService_EXPORTS.h>
#include <aws/lex-models/LexModelBuildingServiceRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/lex-models/model/ConversationLogsRequest.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/lex-models/model/Tag.h>
#include <utility>

namespace Aws
{
namespace LexModelBuildingService
{
namespace Model
{

  /**
   */
  class AWS_LEXMODELBUILDINGSERVICE_API PutBotAliasRequest : public LexModelBuildingServiceRequest
  {
  public:
    PutBotAliasRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "PutBotAlias"; }

    Aws::String SerializePayload() const override;

    /**
     *
The name of the alias. The name is not case sensitive.

     */
    inline const Aws::String& GetName() const{ return m_name; }

    /**
     *
The name of the alias. The name is not case sensitive.

     */
    inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }

    /**
     *
The name of the alias. The name is not case sensitive.

     */
    inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }

    /**
     *
The name of the alias. The name is not case sensitive.

     */
    inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }

    /**
     *
The name of the alias. The name is not case sensitive.

     */
    inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }

    /**
     *
The name of the alias. The name is not case sensitive.

     */
    inline PutBotAliasRequest& WithName(const Aws::String& value) { SetName(value); return *this;}

    /**
     *
The name of the alias. The name is not case sensitive.

     */
    inline PutBotAliasRequest& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}

    /**
     *
The name of the alias. The name is not case sensitive.

     */
    inline PutBotAliasRequest& WithName(const char* value) { SetName(value); return *this;}

    /**
     *
A description of the alias.

     */
    inline const Aws::String& GetDescription() const{ return m_description; }

    /**
     *
A description of the alias.

     */
    inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; }

    /**
     *
A description of the alias.

     */
    inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; }

    /**
     *
A description of the alias.

     */
    inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); }

    /**
     *
A description of the alias.

     */
    inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); }

    /**
     *
A description of the alias.

     */
    inline PutBotAliasRequest& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}

    /**
     *
A description of the alias.

     */
    inline PutBotAliasRequest& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}

    /**
     *
A description of the alias.

     */
    inline PutBotAliasRequest& WithDescription(const char* value) { SetDescription(value); return *this;}

    /**
     *
The version of the bot.

     */
    inline const Aws::String& GetBotVersion() const{ return m_botVersion; }

    /**
     *
The version of the bot.

     */
    inline bool BotVersionHasBeenSet() const { return m_botVersionHasBeenSet; }

    /**
     *
The version of the bot.

     */
    inline void SetBotVersion(const Aws::String& value) { m_botVersionHasBeenSet = true; m_botVersion = value; }

    /**
     *
The version of the bot.

     */
    inline void SetBotVersion(Aws::String&& value) { m_botVersionHasBeenSet = true; m_botVersion = std::move(value); }

    /**
     *
The version of the bot.

     */
    inline void SetBotVersion(const char* value) { m_botVersionHasBeenSet = true; m_botVersion.assign(value); }

    /**
     *
The version of the bot.

     */
    inline PutBotAliasRequest& WithBotVersion(const Aws::String& value) { SetBotVersion(value); return *this;}

    /**
     *
The version of the bot.

     */
    inline PutBotAliasRequest& WithBotVersion(Aws::String&& value) { SetBotVersion(std::move(value)); return *this;}

    /**
     *
The version of the bot.

     */
    inline PutBotAliasRequest& WithBotVersion(const char* value) { SetBotVersion(value); return *this;}

    /**
     *
The name of the bot.

     */
    inline const Aws::String& GetBotName() const{ return m_botName; }

    /**
     *
The name of the bot.

     */
    inline bool BotNameHasBeenSet() const { return m_botNameHasBeenSet; }

    /**
     *
The name of the bot.

     */
    inline void SetBotName(const Aws::String& value) { m_botNameHasBeenSet = true; m_botName = value; }

    /**
     *
The name of the bot.

     */
    inline void SetBotName(Aws::String&& value) { m_botNameHasBeenSet = true; m_botName = std::move(value); }

    /**
     *
The name of the bot.

     */
    inline void SetBotName(const char* value) { m_botNameHasBeenSet = true; m_botName.assign(value); }

    /**
     *
The name of the bot.

     */
    inline PutBotAliasRequest& WithBotName(const Aws::String& value) { SetBotName(value); return *this;}

    /**
     *
The name of the bot.

     */
    inline PutBotAliasRequest& WithBotName(Aws::String&& value) { SetBotName(std::move(value)); return *this;}

    /**
     *
The name of the bot.

     */
    inline PutBotAliasRequest& WithBotName(const char* value) { SetBotName(value); return *this;}

    /**
     *
Identifies a specific revision of the $LATEST version.

     *
When you create a new bot alias, leave the checksum field blank.
     * If you specify a checksum you get a BadRequestException
     * exception.

When you want to update a bot alias, set the
     * checksum field to the checksum of the most recent revision of the
     * $LATEST version. If you don't specify the  checksum
     * field, or if the checksum does not match the $LATEST version, you
     * get a PreconditionFailedException exception.

     */
    inline const Aws::String& GetChecksum() const{ return m_checksum; }

    /**
     *
Identifies a specific revision of the $LATEST version.

     *
When you create a new bot alias, leave the checksum field blank.
     * If you specify a checksum you get a BadRequestException
     * exception.

When you want to update a bot alias, set the
     * checksum field to the checksum of the most recent revision of the
     * $LATEST version. If you don't specify the  checksum
     * field, or if the checksum does not match the $LATEST version, you
     * get a PreconditionFailedException exception.

     */
    inline bool ChecksumHasBeenSet() const { return m_checksumHasBeenSet; }

    /**
     *
Identifies a specific revision of the $LATEST version.

     *
When you create a new bot alias, leave the checksum field blank.
     * If you specify a checksum you get a BadRequestException
     * exception.

When you want to update a bot alias, set the
     * checksum field to the checksum of the most recent revision of the
     * $LATEST version. If you don't specify the  checksum
     * field, or if the checksum does not match the $LATEST version, you
     * get a PreconditionFailedException exception.

     */
    inline void SetChecksum(const Aws::String& value) { m_checksumHasBeenSet = true; m_checksum = value; }

    /**
     *
Identifies a specific revision of the $LATEST version.

     *
When you create a new bot alias, leave the checksum field blank.
     * If you specify a checksum you get a BadRequestException
     * exception.

When you want to update a bot alias, set the
     * checksum field to the checksum of the most recent revision of the
     * $LATEST version. If you don't specify the  checksum
     * field, or if the checksum does not match the $LATEST version, you
     * get a PreconditionFailedException exception.

     */
    inline void SetChecksum(Aws::String&& value) { m_checksumHasBeenSet = true; m_checksum = std::move(value); }

    /**
     *
Identifies a specific revision of the $LATEST version.

     *
When you create a new bot alias, leave the checksum field blank.
     * If you specify a checksum you get a BadRequestException
     * exception.

When you want to update a bot alias, set the
     * checksum field to the checksum of the most recent revision of the
     * $LATEST version. If you don't specify the  checksum
     * field, or if the checksum does not match the $LATEST version, you
     * get a PreconditionFailedException exception.

     */
    inline void SetChecksum(const char* value) { m_checksumHasBeenSet = true; m_checksum.assign(value); }

    /**
     *
Identifies a specific revision of the $LATEST version.

     *
When you create a new bot alias, leave the checksum field blank.
     * If you specify a checksum you get a BadRequestException
     * exception.

When you want to update a bot alias, set the
     * checksum field to the checksum of the most recent revision of the
     * $LATEST version. If you don't specify the  checksum
     * field, or if the checksum does not match the $LATEST version, you
     * get a PreconditionFailedException exception.

     */
    inline PutBotAliasRequest& WithChecksum(const Aws::String& value) { SetChecksum(value); return *this;}

    /**
     *
Identifies a specific revision of the $LATEST version.

     *
When you create a new bot alias, leave the checksum field blank.
     * If you specify a checksum you get a BadRequestException
     * exception.

When you want to update a bot alias, set the
     * checksum field to the checksum of the most recent revision of the
     * $LATEST version. If you don't specify the  checksum
     * field, or if the checksum does not match the $LATEST version, you
     * get a PreconditionFailedException exception.

     */
    inline PutBotAliasRequest& WithChecksum(Aws::String&& value) { SetChecksum(std::move(value)); return *this;}

    /**
     *
Identifies a specific revision of the $LATEST version.

     *
When you create a new bot alias, leave the checksum field blank.
     * If you specify a checksum you get a BadRequestException
     * exception.

When you want to update a bot alias, set the
     * checksum field to the checksum of the most recent revision of the
     * $LATEST version. If you don't specify the  checksum
     * field, or if the checksum does not match the $LATEST version, you
     * get a PreconditionFailedException exception.

     */
    inline PutBotAliasRequest& WithChecksum(const char* value) { SetChecksum(value); return *this;}

    /**
     *
Settings for conversation logs for the alias.

     */
    inline const ConversationLogsRequest& GetConversationLogs() const{ return m_conversationLogs; }

    /**
     *
Settings for conversation logs for the alias.

     */
    inline bool ConversationLogsHasBeenSet() const { return m_conversationLogsHasBeenSet; }

    /**
     *
Settings for conversation logs for the alias.

     */
    inline void SetConversationLogs(const ConversationLogsRequest& value) { m_conversationLogsHasBeenSet = true; m_conversationLogs = value; }

    /**
     *
Settings for conversation logs for the alias.

     */
    inline void SetConversationLogs(ConversationLogsRequest&& value) { m_conversationLogsHasBeenSet = true; m_conversationLogs = std::move(value); }

    /**
     *
Settings for conversation logs for the alias.

     */
    inline PutBotAliasRequest& WithConversationLogs(const ConversationLogsRequest& value) { SetConversationLogs(value); return *this;}

    /**
     *
Settings for conversation logs for the alias.

     */
    inline PutBotAliasRequest& WithConversationLogs(ConversationLogsRequest&& value) { SetConversationLogs(std::move(value)); return *this;}

    /**
     *
A list of tags to add to the bot alias. You can only add tags when you create
     * an alias, you can't use the PutBotAlias operation to update the
     * tags on a bot alias. To update tags, use the TagResource
     * operation.

     */
    inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }

    /**
     *
A list of tags to add to the bot alias. You can only add tags when you create
     * an alias, you can't use the PutBotAlias operation to update the
     * tags on a bot alias. To update tags, use the TagResource
     * operation.

     */
    inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }

    /**
     *
A list of tags to add to the bot alias. You can only add tags when you create
     * an alias, you can't use the PutBotAlias operation to update the
     * tags on a bot alias. To update tags, use the TagResource
     * operation.

     */
    inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; }

    /**
     *
A list of tags to add to the bot alias. You can only add tags when you create
     * an alias, you can't use the PutBotAlias operation to update the
     * tags on a bot alias. To update tags, use the TagResource
     * operation.

     */
    inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }

    /**
     *
A list of tags to add to the bot alias. You can only add tags when you create
     * an alias, you can't use the PutBotAlias operation to update the
     * tags on a bot alias. To update tags, use the TagResource
     * operation.

     */
    inline PutBotAliasRequest& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}

    /**
     *
A list of tags to add to the bot alias. You can only add tags when you create
     * an alias, you can't use the PutBotAlias operation to update the
     * tags on a bot alias. To update tags, use the TagResource
     * operation.

     */
    inline PutBotAliasRequest& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;}

    /**
     *
A list of tags to add to the bot alias. You can only add tags when you create
     * an alias, you can't use the PutBotAlias operation to update the
     * tags on a bot alias. To update tags, use the TagResource
     * operation.

     */
    inline PutBotAliasRequest& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }

    /**
     *
A list of tags to add to the bot alias. You can only add tags when you create
     * an alias, you can't use the PutBotAlias operation to update the
     * tags on a bot alias. To update tags, use the TagResource
     * operation.

     */
    inline PutBotAliasRequest& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; }

  private:

    Aws::String m_name;
    bool m_nameHasBeenSet;

    Aws::String m_description;
    bool m_descriptionHasBeenSet;

    Aws::String m_botVersion;
    bool m_botVersionHasBeenSet;

    Aws::String m_botName;
    bool m_botNameHasBeenSet;

    Aws::String m_checksum;
    bool m_checksumHasBeenSet;

    ConversationLogsRequest m_conversationLogs;
    bool m_conversationLogsHasBeenSet;

    Aws::Vector<Tag> m_tags;
    bool m_tagsHasBeenSet;
  };

} // namespace Model
} // namespace LexModelBuildingService
} // namespace Aws


text:
"use strict";

// combined version

var newman = require('newman');
const util = require('util');
var Console = require("console").Console;
var logger = new Console(process.stdout, process.stderr);

module.exports = function(grunt) {

	grunt.log.header = function() {};

	grunt.initConfig({
		pkg : grunt.file.readJSON('package.json'),
		play : {
			beta : {
				options : {
					track : 'beta',
					packadeName : 'dk.socialite.sclclubapp',
					apkFile : './platforms/android/build/outputs/apk/android-release.apk',
					googleAccountFile : './secret.json'
				}
			},
			production : {
				options : {
					track : 'production',
					packadeName : 'dk.socialite.sclclubapp',
					apkFile : './platforms/android/build/outputs/apk/android-release.apk',
					googleAccountFile : './secret.json'
				}
			}
		},
		bump : {
			options : {
				versionFrom : 'json',
				xml : 'config.xml',
				json : 'package.json'
			}
		},
		crypt : {
			options : {
				password : 'fh'
			}
		},
		doxdox : {
			html : {
				inputs : [ 'main.js', 'jsc/*controllers.js', 'jsc/*Router.js', 'jsc/filters.js', 'jsc/fileServer.js', 'jsc/*Factory.js' ],
				output : 'docs/dox/index.html',
				config : {
					'title' : 'Sample Title',
					'description' : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit',
					'package' : 'package.json'
				}
			},
			markdown : {
				inputs : [ 'main.js', 'jsc/*controllers.js', 'jsc/*Router.js', 'jsc/filters.js', 'jsc/fileServer.js', 'jsc/*Factory.js' ],
				output : 'docs/docs.md'
			}
		},
		protractor : {
			options : {
				keepAlive : false,
				noColor : false,
				webdriverManagerUpdate : true
			},
			local : {
				options : {
					configFile : "tests/conf.js"
				}
			},
			sauce : {
				options : {
					configFile : "tests/saucelabs.conf.js"
				}
			}
		},
		sftp : {
			all : {
				files : {
					"./" : "platforms/android/build/outputs/apk/android-release.apk"
				},
				options : {
					path : '/app/',
					srcBasePath : "platforms/android/build/outputs/apk/",
					host : 'club.socialite.dk',
					username : '<%= sshprod.user %>',
					password : '<%= sshprod.password %>',
					showProgress : true
				}
			}
		},
		newman : {
			all : {
				name : "common tests in cloud",
				options : {
					collection : './tests/rest/test.socialite.json',
					environment : './tests/rest/cloud.environment.json',
					insecure : true,
					reporters : [ 'html', 'json' ],
					reporter : {
						html : {
							export : './tests/e2e-reports/newman-cloud.html'
						},
						json : {
							export : './tests/e2e-reports/newman-cloud.json'
						}
					}
				}
			},
			prod : {
				name : "common tests in prod",
				options : {
					collection : './tests/rest/socialite common tests.postman_collection.json',
					environment : './tests/rest/cloud.postman_environment.json',
					insecure : true,
					reporters : [ 'html', 'json' ],
					reporter : {
						html : {
							export : './tests/e2e-reports/newman-prod.html'
						},
						json : {
							export : './tests/e2e-reports/newman-prod.json'
						}
					}
				}
			},
			reports : {
				name : "report tests in dev",
				options : {
					collection : './tests/rest/reports.postman_collection.json',
					outputFile : 'tests/e2e-reports/results.json',
					environment : './tests/rest/dev.postman_environment.json',
					insecure : true,
					noColor : true,
					reporters : [ 'html', 'json' ],
					reporter : {
						html : {
							export : './tests/e2e-reports/newman-prod.html'
						},
						json : {
							export : './tests/e2e-reports/newman-prod.json'
						}
					}
				}
			}
		},
		sshexec : {
			d2prod : {
				command : 'cd /app/clubdatabase && bash scripts/deploy.sh',
				options : {
					host : 'socialite.dk',
					username : '<%= sshprod.user %>',
					password : '<%= sshprod.password %>'
				}
			},
			d2test : {
				command : 'cd /app/clubdatabase && bash scripts/deploy2test.sh',
				options : {
					host : 'socialite.dk',
					username : '<%= sshprod.user %>',
					password : '<%= sshprod.password %>'
				}
			},
			test : {
				command : 'cd /test/clubdatabase && git pull',
				options : {
					host : 'socialite.dk',
					username : '<%= sshprod.user %>',
					password : '<%= sshprod.password %>'
				}
			},
			testhard : {
				command : 'cd /test/clubdatabase && git reset --hard && git pull',
				options : {
					host : 'socialite.dk',
					username : '<%= sshprod.user %>',
					password : '<%= sshprod.password %>'
				}
			}
		},
		gta : {
			commit : {
				command : 'commit --all -m "grunt deploy" --author="Allan Schytt <as@ascsi.dk>"',
				options : {
					stdout : false,
					stderr : false,
				}
			},
			push : {
				command : 'push --all https://<%= git.user %>:<%= git.password %>@bitbucket.org/fountainhouse/clubdatabase.git',
				options : {
					stdout : false,
					stderr : false,
				}
			}
		}
	});

	grunt.loadNpmTasks('grunt-protractor-runner');
	grunt.loadNpmTasks('grunt-git-them-all');
	grunt.loadNpmTasks('grunt-ssh');
	grunt.loadNpmTasks('grunt-doxdox');

	grunt.registerTask('dox', [ 'doxdox:markdown', 'doxdox:html' ]);

	grunt.registerTask('dtest', [ 'crypt', 'force_on', 'gta:commit', 'force_off', 'gta:push' ]);
	grunt.registerTask('dprod', [ 'crypt', 'force_on', 'gta:commit', 'force_off', 'gta:push' ]);

	grunt.registerTask('gittest', [ 'crypt', 'force_on', 'gta:commit', 'force_off', 'gta:push', 'sshexec:test' ]);
	grunt.registerTask('githard', [ 'crypt', 'force_on', 'gta:commit', 'force_off', 'gta:push', 'sshexec:testhard' ]);

	grunt.registerTask('go', [ 'bump', 'play:production' ]);
	grunt.registerTask('deploy', [ 'crypt', 'sftp' ]);

	grunt.registerTask('rest', [ 'newman:all' ]);
	grunt.registerTask('ptest', [ 'protractor:local' ]);
	grunt.registerTask('pprod', [ 'protractor:local', 'newman:all' ]);
	grunt.registerTask('sauce', [ 'protractor:sauce', 'newman:all' ]);

	grunt.registerMultiTask('newman', 'custom newman task runner', function() {

		var done = this.async();

		require('newman').run(this.data.options)

		.on('done', function(err, summary) {
			if (err || summary.error) {
				console.log(summary.error);
				return false;
			}
			console.log("newman tesdone");
			done();
		});
	});

	grunt.registerTask('force_on', 'force the force option on',
		function() {
			grunt.option('force', true);
		});

	grunt.registerTask('force_off', 'turn force option off',
		function() {
			grunt.option('force', false);
		});

	grunt.registerTask('bump', 'custom bump task runner', function() {

		var done = this.async();

		var options = this.options({
			versionFrom : 'json',
			xml : 'config.xml',
			json : 'package.json'
		});

		grunt.log.verbose.ok('reading local package.json file');
		grunt.file.defaultEncoding = 'utf8';
		var pkg = grunt.file.readJSON(options.json);
		var parts = pkg.version.split('.');

		for (var i = 0; i < parts.length; ++i) {
			switch (i) {
			case 0:
				if (args.indexOf('major') !== -1) {
					parts[i] = (Number(parts[i]) + 1).toString();
					parts[1] = '0';
					parts[2] = '0';
					pkg.version = parts[0] + '.' + parts[1] + '.' + parts[2];
				}
				break;
			case 1:
				if (args.indexOf('minor') !== -1) {
					parts[i] = (Number(parts[i]) + 1).toString();
					parts[2] = '0';
					pkg.version = parts[0] + '.' + parts[1] + '.' + parts[2];
				}
				break;
			case 2:
				if (args.indexOf('sub') !== -1) {
					parts[i] = (Number(parts[i]) + 1).toString();
					pkg.version = parts[0] + '.' + parts[1] + '.' + parts[2];
				}
			}
		}

		grunt.file.write(options.json, JSON.stringify(pkg, null, 2));

		if (grunt.file.exists(options.xml)) {
			var regex = /(.+)version *= *\"[0-9]+\.?[0-9]+?\.?[0-9]+?\"(.+)/g
			var config = grunt.file.read(options.xml);
			config = config.replace(regex, "$1version=\"" + pkg.version + "\"$2");
			grunt.file.write(options.xml, config);
		}

		grunt.log.ok('bumped to version ' + pkg.version);

		done();
	});

	grunt.registerTask('crypt', 'crypto plugin', function() {

		// grunt crypt --encrypt

		var done = this.async();

		var crypto = require('crypto');

		var options = this.options({
			password : null
		})

		function encrypt(key) {
			var cipher = crypto.createCipher('aes-256-ctr', key)
			var text = JSON.stringify(JSON.parse(grunt.file.read('../keys/keys.json')));
			var crypted = cipher.update(text, 'utf8', 'hex');
			crypted += cipher.final('hex');
			grunt.file.write('../keys/keys.enc', crypted);
		}

		function decrypt(key) {
			var decipher = crypto.createDecipher('aes-256-ctr', key)
			var dec = decipher.update(grunt.file.read('../keys/keys.enc'), 'hex', 'utf8')
			dec += decipher.final('utf8');
			return JSON.parse(dec);
		}

		if (!options.password) {
			require('inquirer').createPromptModule()({
				type : 'password',
				name : 'password',
				message : 'password'
			}).then(answers => {
				var key = answers['password'];

				if (grunt.option('encrypt'))
					encrypt(key);

				grunt.config.merge(decrypt(key));

				done();
			});
		} else {
			if (grunt.option('encrypt'))
				encrypt(options.password);

			grunt.config.merge(decrypt(options.password));

			done();
		}

	});

	grunt.registerTask('play', 'custom play release task runner', function() {

		var done = this.async();

		var options = this.options;

		var key = require('./secret.json');
		var version = require('./package.json').version;

		var editId = '' + (new Date().getTime());

		var scopes = [
			'https://www.googleapis.com/auth/androidpublisher'
		];

		// here, we'll initialize our client
		var OAuth2 = google.auth.OAuth2;
		var oauth2Client = new OAuth2();
		var jwtClient = new google.auth.JWT(key.client_email, null, key.private_key, scopes, null);
		var play = google.androidpublisher({
			version : 'v2',
			auth : oauth2Client,
			params : {
				packageName : options.packageName
			}
		});

		google.options({
			auth : oauth2Client
		});

		var apkfile = options.apkFile;

		startEdit() // "open" our edit
			.then(function(data) {
				var apk = require('fs').readFileSync(apkfile); // stage the upload
				// (doesn't actually
				// upload anything)
				return upload({
					edit : data.edit,
					apk : apk
				});
			}).then(function(data) {
			return setTrack(data); // set our track
		}).then(function(data) {
			return commitToPlayStore(data); // commit our changes
		}).then(function(data) {
			console.log('Successful upload:', data); // log our success!
		}).catch(function(err) {
			console.log(err);
			process.exit(0);
		});

		/**
		 * Sets our authorization token and begins an edit transaction.
		 */
		function startEdit() {
			return new Promise(function(resolve, reject) {
				jwtClient.authorize(function(err, tokens) { // get the tokens
					if (err) {
						console.log(err);
						return;
					}
					oauth2Client.setCredentials(tokens); // set the credentials from
					// the tokens
					play.edits.insert({
						resource : {
							id : editId,
							expiryTimeSeconds : 600 // this edit will be valid for 10
						// minutes
						}
					}, function(err, edit) {
						if (err || !edit) {
							reject(err);
						}
						resolve({
							edit : edit
						});
					});
				});
			});
		}

		/**
		 * Stages an upload of the APK (but doesn't actually upload anything)
		 */
		function upload(data) {
			var edit = data.edit;
			var apk = data.apk;

			return new Promise(function(resolve, reject) {
				play.edits.apks.upload({
					editId : edit.id,
					media : {
						mimeType : 'application/vnd.android.package-archive',
						body : apk
					}
				}, function(err, res) {
					if (err || !res) {
						reject(err);
					}
					resolve(_.omit(_.extend(data, {
						uploadResults : res
					}), 'apk'));
				}); // pass any data we care about to the next function call
			});
		}

		/**
		 * Sets our track (beta, production, etc.)
		 */
		function setTrack(data) {
			var edit = data.edit;
			var track = options.track;

			return new Promise(function(resolve, reject) {
				play.edits.tracks.update({
					editId : edit.id,
					track : track,
					resource : {
						track : track,
						versionCodes : [ +data.uploadResults.versionCode ]
					}
				}, function(err, res) {
					if (err || !res) {
						reject(err);
					}

					resolve(_.extend(data, {
						setTrackResults : res
					}));
				});
			});

		}

		/**
		 * Commits our edit transaction and makes our changes live.
		 */
		function commitToPlayStore(data) {
			return new Promise(function(resolve, reject) {
				play.edits.commit({
					editId : data.edit.id
				}, function(err, res) {
					if (err || !res) {
						reject(err);
					}

					resolve(_.extend(data, {
						commitToPlayStoreResults : res
					}));

					grunt.log.ok('new version committed');

					done();
				});
			});
		}

	});

};


text:
import sys
from pubnub import Pubnub

from optparse import OptionParser

parser = OptionParser()

parser.add_option("--publish-key",
                  dest="publish_key", default="demo",
                  help="Publish Key ( default : 'demo' )")

parser.add_option("--subscribe-key",
                  dest="subscribe_key", default="demo",
                  help="Subscribe Key ( default : 'demo' )")

parser.add_option("--secret-key",
                  dest="secret_key", default="demo",
                  help="Secret Key ( default : 'demo' )")

parser.add_option("--cipher-key",
                  dest="cipher_key", default="",
                  help="Cipher Key")

parser.add_option("--auth-key",
                  dest="auth_key", default=None,
                  help="Auth Key")

parser.add_option("--origin",
                  dest="origin", default="pubsub.pubnub.com",
                  help="Origin ( default: pubsub.pubnub.com )")

parser.add_option("--ssl-on",
                  action="store_false", dest="ssl", default=False,
                  help="SSL")

parser.add_option("--uuid",
                  dest="uuid", default=None,
                  help="UUID")

(options, args) = parser.parse_args()

print(options)

pubnub = Pubnub(options.publish_key,
                options.subscribe_key,
                options.secret_key,
                options.cipher_key,
                options.auth_key,
                options.ssl,
                options.origin,
                options.uuid)

class color(object):
    PURPLE = '\033[95m'
    CYAN = '\033[96m'
    DARKCYAN = '\033[36m'
    BLUE = '\033[94m'
    GREEN = '\033[92m'
    YELLOW = '\033[93m'
    RED = '\033[91m'
    BOLD = '\033[1m'
    UNDERLINE = '\033[4m'
    END = '\033[0m'

from datetime import datetime

def print_ok(msg, channel=None):
    chstr = color.PURPLE + "[" + datetime.now().strftime(
        '%Y-%m-%d %H:%M:%S') + "] " + color.END
    chstr += color.CYAN + "[Channel : " + channel + \
        "] " if channel is not None else "" + color.END
    try:
        print(chstr + color.GREEN + str(msg) + color.END)
    except UnicodeEncodeError as e:
        print(msg)

def print_error(msg, channel=None):
    chstr = color.PURPLE + "[" + datetime.now().strftime(
        '%Y-%m-%d %H:%M:%S') + "] " + color.END
    chstr += color.CYAN + "[Channel : " + channel + \
        "] " if channel is not None else "" + color.END
    try:
        print(chstr + color.RED + color.BOLD + str(msg) + color.END)
    except UnicodeEncodeError as e:
        print(msg)

import threading

def kill_all_threads():
    for thread in threading.enumerate():
        if thread.isAlive():
            thread._Thread__stop()

def get_input(message, t=None):
    while True:
        try:
            try:
                command = raw_input(message)
            except NameError:
                command = input(message)
            except KeyboardInterrupt:
                return None

            command = command.strip()

            if command is None or len(command) == 0:
                raise ValueError

            if t is not None and t == bool:
                valid = ["True", "true", "1", 1, "y", "Y", "yes", "Yes", "YES"]
                if command in valid:
                    return True
                else:
                    return False
            if t is not None:
                command = t(command)
            else:
                command = eval("'" + command + "'")

            return command
        except ValueError:
            print_error("Invalid input : " + command)

def _publish_command_handler():

    channel = get_input("[PUBLISH] Enter Channel Name ", str)
    if channel is None:
        return
    while True:
        message = get_input("[PUBLISH] Enter Message \
            ( QUIT or CTRL-C for exit from publish mode ) ")
        if message == 'QUIT' or message == 'quit' or message is None:
            return

        def _callback(r):
            print_ok(r)

        def _error(r):
            print_error(r)
        pubnub.publish(channel, message, _callback, _error)

def _subscribe_command_handler():
    channel = get_input("[SUBSCRIBE] Enter Channel Name ", str)

    def _callback(r):
        print_ok(r, channel)

    def _error(r):
        print_error(r, channel)
    pubnub.subscribe(channel, _callback, _error)

def _unsubscribe_command_handler():
    channel = get_input("[UNSUBSCRIBE] Enter Channel Name ", str)

    def _callback(r):
        print_ok(r)

    def _error(r):
        print_error(r)
    pubnub.unsubscribe(channel)

def _grant_command_handler():
    def _callback(r):
        print_ok(r)

    def _error(r):
        print_error(r)
    channel = get_input("[GRANT] Enter Channel Name ", str)
    auth_key = get_input("[GRANT] Enter Auth Key ", str)
    ttl = get_input("[GRANT] Enter ttl ", int)
    read = get_input("[GRANT] Read ? ", bool)
    write = get_input("[GRANT] Write ? ", bool)
    pubnub.grant(channel, auth_key, read, write, ttl, _callback)

def _revoke_command_handler():
    def _callback(r):
        print_ok(r)

    def _error(r):
        print_error(r)
    channel = get_input("[REVOKE] Enter Channel Name ", str)
    auth_key = get_input("[REVOKE] Enter Auth Key ", str)
    ttl = get_input("[REVOKE] Enter ttl ", int)

    pubnub.revoke(channel, auth_key, ttl, _callback)

def _audit_command_handler():
    def _callback(r):
        print_ok(r)

    def _error(r):
        print_error(r)
    channel = get_input("[AUDIT] Enter Channel Name ", str)
    auth_key = get_input("[AUDIT] Enter Auth Key ", str)
    pubnub.audit(channel, auth_key, _callback)

def _history_command_handler():
    def _callback(r):
        print_ok(r)

    def _error(r):
        print_error(r)
    channel = get_input("[HISTORY] Enter Channel Name ", str)
    count = get_input("[HISTORY] Enter Count ", int)

    pubnub.history(channel, count, callback=_callback, error=_error)

def _here_now_command_handler():
    def _callback(r):
        print_ok(r)

    def _error(r):
        print_error(r)
    channel = get_input("[HERE NOW] Enter Channel Name ", str)

    pubnub.here_now(channel, callback=_callback, error=_error)

commands = []
commands.append({"command": "publish", "handler": _publish_command_handler})
commands.append(
    {"command": "subscribe", "handler": _subscribe_command_handler})
commands.append(
    {"command": "unsubscribe", "handler": _unsubscribe_command_handler})
commands.append(
    {"command": "here_now", "handler": _here_now_command_handler})
commands.append({"command": "history", "handler": _history_command_handler})
commands.append({"command": "grant", "handler": _grant_command_handler})
commands.append({"command": "revoke", "handler": _revoke_command_handler})
commands.append({"command": "audit", "handler": _audit_command_handler})

# last command is quit. add new commands before this line
commands.append({"command": "QUIT"})

def get_help():
    help = ""
    help += "Channels currently subscribed to : "
    help += str(pubnub.get_channel_array())
    help += "\n"
    for i, v in enumerate(commands):
        help += "Enter " + str(i) + " for " + v['command'] + "\n"
    return help

while True:
    command = get_input(color.BLUE + get_help(), int)
    if command == len(commands) - 1 or command is None:
        kill_all_threads()
        break
    if command >= len(commands):
        print_error("Invalid input " + str(command))
        continue

    commands[command]['handler']()

#pubnub.start()


text:
"""Create a LithoLayers component with different properties."""

import numpy as np

from landlab.components.lithology.lithology import Lithology

class LithoLayers(Lithology):

    """Create LithoLayers component.

    A LithoLayers is a three dimentional representation of material operated on
    by landlab components. Material can be removed through erosion or added to
    through deposition. Rock types can have multiple attributes (e.g. age,
    erodability or other parameter values, etc).

    If the tracked properties are model grid fields, they will be updated to
    the surface values of the Lithology. If the properties are not grid fields
    then at-node grid fields will be created with their names.

    It is constructed by specifying a series of depths below the surface, an
    anchor point, a series of rock type ids, and the functional form of a
    surface. Depths and IDs are both specified in order of closest
    to the surface to furthest from the surface.

    Additionally, an attribute dictionary specifies the properties of each
    rock type. This dictionary is expected to have the form of:

    .. code-block:: python

        attrs = {'K_sp': {1: 0.001,
                          2: 0.0001},
                 'D': {1: 0.01,
                       2: 0.001}}

    Where ``'K_sp'`` and ``'D'`` are properties to track, and ``1`` and ``2``
    are rock type IDs. The rock type IDs can be any type that is valid as a
    python dictionary key.

    References
    ----------
    **Required Software Citation(s) Specific to this Component**

    Barnhart, K., Hutton, E., Gasparini, N., Tucker, G. (2018). Lithology: A
    Landlab submodule for spatially variable rock properties. Journal of Open
    Source Software  3(30), 979 - 2. https://dx.doi.org/10.21105/joss.00979

    **Additional References**

    None Listed

    """

    _name = "LithoLayers"

    _unit_agnostic = True

    _cite_as = """@article{barnhart2018lithology,
                    title = "Lithology: A Landlab submodule for spatially variable rock properties",
                    journal = "Journal of Open Source Software",
                    volume = "",
                    pages = "",
                    year = "2018",
                    doi = "10.21105/joss.00979",
                    author = "Katherine R. Barnhart and Eric Hutton and Nicole M. Gasparini and Gregory E. Tucker",
                    }"""

    _info = {}

    def __init__(
        self,
        grid,
        z0s,
        ids,
        attrs,
        x0=0,
        y0=0,
        function=lambda x, y: 0 * x + 0 * y,
        layer_type="EventLayers",
        dz_advection=0,
        rock_id=None,
    ):
        """Create a new instance of a LithoLayers.

        Parameters
        ----------
        grid : Landlab ModelGrid
        z0s : ndarray of shape `(n_layers, )`
            Values of layer depth from surface at horizontal location (x0, y0).
        ids : ndarray of shape `(n_layers, )`
            Values of rock type IDs corresponding to each layer specified in
            **z0s**.
        attrs : dict
            Rock type property dictionary. See class docstring for example of
            required format.
        x0 : float, optional
            x value of anchor point for all layers.
        y0 : float, optional
            y value of anchor point for all layers.
        function : function, optional
            Functional form of layers as a function of two variables, x and y.
            Default value is `lambda x, y: 0*x + 0*y` for flatlying layers.
        layer_type : str, optional
            Type of Landlab layers object used to store the layers. If
            MaterialLayers (default) is specified, then erosion removes material
            and does not create a layer of thickness zero. If EventLayers is
            used, then erosion removes material and creates layers of thickness
            zero. Thus, EventLayers may be appropriate if the user is interested
            in chronostratigraphy.
        dz_advection : float, `(n_nodes, )` shape array, or at-node field array optional
            Change in rock elevation due to advection by some external process.
            This can be changed using the property setter.
        rock_id : value or `(n_nodes, )` shape array, optional
            Rock type id for new material if deposited.
            This can be changed using the property setter.

        Examples
        --------
        >>> from landlab import RasterModelGrid
        >>> from landlab.components import LithoLayers
        >>> mg = RasterModelGrid((3, 3))
        >>> z = mg.add_zeros('node', 'topographic__elevation')

        Create a LithoLayers with flatlying layers that altrnate between
        layers of type 1 and type 2 rock.

        >>> z0s = [-4, -3, -2, -1, 0, 1, 2, 3, 4]
        >>> ids = [1, 2, 1, 2, 1, 2, 1, 2, 1]
        >>> attrs = {'K_sp': {1: 0.001,
        ...                   2: 0.0001}}
        >>> lith = LithoLayers(mg, z0s, ids, attrs)
        >>> lith.dz
        array([[ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.],
               [ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.],
               [ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.],
               [ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.],
               [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
               [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
               [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
               [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
               [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])

        Now create a set of layers that dip. Our anchor point will be the
        default value of (x0, y0) = (0, 0)

        >>> lith = LithoLayers(mg, z0s, ids, attrs, function=lambda x, y: x+y)
        >>> lith.dz
        array([[ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.],
               [ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.],
               [ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.],
               [ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.],
               [ 0.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.],
               [ 0.,  0.,  1.,  0.,  1.,  1.,  1.,  1.,  1.],
               [ 0.,  0.,  0.,  0.,  0.,  1.,  0.,  1.,  1.],
               [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  1.],
               [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])

        We can get the surface values, and as we'd expect, they alternate as
        the dipping layers are exposed at the surface.

        >>> lith['K_sp']
        array([ 0.0001,  0.001 ,  0.0001,  0.001 ,  0.0001,  0.001 ,  0.0001,
                0.001 ,  0.0001])
        """

        function_args = function.__code__.co_varnames
        if len(function_args) != 2:
            msg = "LithoLayers: function must take exactly two arguments, x and y."
            raise ValueError(msg)

        if np.asarray(z0s).size != np.asarray(ids).size:
            msg = "LithoLayers: Size of layer depths and layer IDs must be the same"
            raise ValueError(msg)

        if np.any(np.diff(z0s) < 0):
            msg = "LithoLayers: Bad layer depth order passed."
            raise ValueError(msg)

        z_surf = function(grid.x_of_node - x0, grid.y_of_node - y0)

        if hasattr(z_surf, "shape"):
            if z_surf.shape != grid.x_of_node.shape:
                msg = "LithoLayers: function must return an array of shape (n_nodes,)"
                raise ValueError(msg)
        else:
            msg = "LithoLayers: function must return an array of shape (n_nodes,)"
            raise ValueError(msg)

        layer_thicknesses = []
        layer_ids = []

        num_layers = np.asarray(z0s).size

        last_layer_elev = np.zeros(grid.number_of_nodes)

        # create layers (here listed from the top to the bottom.)
        for i in range(num_layers):

            layer_depth = z_surf + z0s[i]
            layer_depth[layer_depth < 0] = 0

            layer_thickness = layer_depth.copy() - last_layer_elev.copy()

            last_layer_elev = layer_depth.copy()

            layer_thicknesses.append(layer_thickness)
            layer_ids.append(ids[i] * np.ones(z_surf.size))

        super().__init__(
            grid,
            layer_thicknesses,
            layer_ids,
            attrs,
            layer_type=layer_type,
            dz_advection=dz_advection,
            rock_id=rock_id,
        )


text:
<!DOCTYPE html>

    <title></title>

        Go back to model.

Compartment with metaId  . <input type="button"
                                                                      onclick="window.location.href=window.location.href+'/edit'"
                                                                      name="edit" value="Edit">Edit</input>


text:
.. php:namespace:: Imagine\Image

.. php:interface:: ImageInterface

   .. php:method:: ImageInterface::get()

      Returns the image content as a binary string

      :param string $format:
      :param array $options:

      :throws: Imagine\\Exception\\RuntimeException

      :returns: string $inary

   .. php:method:: ImageInterface::__toString()

      Returns the image content as a PNG binary string

      :param string $format:
      :param array $options:

      :throws: Imagine\\Exception\\RuntimeException

      :returns: string $inary

   .. php:method:: ImageInterface::draw()

      Instantiates and returns a DrawerInterface instance for image drawing

      :returns: Imagine\\Draw\\DrawerInterface

   .. php:method:: ImageInterface::getSize()

      Returns current image size

      :returns: Imagine\\Image\\BoxInterface

   .. php:method:: ImageInterface::mask()

      Transforms creates a grayscale mask from current image, returns a new
      image, while keeping the existing image unmodified

      :returns: Imagine\\Image\\ImageInterface

   .. php:method:: ImageInterface::histogram()

      Returns array of image colors as Imagine\\Image\\Color instances

      :returns: array

   .. php:method:: ImageInterface::getColorAt()

      Returns color at specified positions of current image

      :param Imagine\\Image\\PointInterface $point:

      :throws: Imagine\\Exception\\RuntimeException

      :returns: Imagine\\Image\\Color


text:
package org.apache.metron.enrichment.bolt;

import org.apache.storm.task.TopologyContext;
import org.apache.storm.tuple.Values;
import org.adrianwalker.multilinestring.Multiline;
import org.apache.metron.test.bolt.BaseEnrichmentBoltTest;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.junit.Before;
import org.junit.Test;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.argThat;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class JoinBoltTest extends BaseEnrichmentBoltTest {

  public class StandAloneJoinBolt extends JoinBolt<JSONObject> {

    public StandAloneJoinBolt(String zookeeperUrl) {
      super(zookeeperUrl);
    }

    @Override
    public void prepare(Map map, TopologyContext topologyContext) {

    }

    @Override
    public Set<String> getStreamIds(JSONObject value) {
      HashSet<String> ret = new HashSet<>();
      for(String s : streamIds) {
        ret.add(s + ":");
      }
      return ret;
    }

    @Override
    public JSONObject joinMessages(Map<String, JSONObject> streamMessageMap) {
      return joinedMessage;
    }
  }

  /**
   {
   "joinField": "joinValue"
   }
   */
  @Multiline
  private String joinedMessageString;

  private JSONObject joinedMessage;

  @Before
  public void parseMessages() {
    JSONParser parser = new JSONParser();
    try {
      joinedMessage = (JSONObject) parser.parse(joinedMessageString);
    } catch (ParseException e) {
      e.printStackTrace();
    }
  }

  @Test
  public void test() {
    StandAloneJoinBolt joinBolt = new StandAloneJoinBolt("zookeeperUrl");
    joinBolt.setCuratorFramework(client);
    joinBolt.setTreeCache(cache);
    try {
      joinBolt.prepare(new HashMap(), topologyContext, outputCollector);
      fail("Should fail if a maxCacheSize property is not set");
    } catch(IllegalStateException e) {}
    joinBolt.withMaxCacheSize(100);
    try {
      joinBolt.prepare(new HashMap(), topologyContext, outputCollector);
      fail("Should fail if a maxTimeRetain property is not set");
    } catch(IllegalStateException e) {}
    joinBolt.withMaxTimeRetain(10000);
    joinBolt.prepare(new HashMap(), topologyContext, outputCollector);
    joinBolt.declareOutputFields(declarer);
    verify(declarer, times(1)).declareStream(eq("message"), argThat(new FieldsMatcher("key", "message")));
    when(tuple.getValueByField("key")).thenReturn(key);
    when(tuple.getSourceStreamId()).thenReturn("geo");
    when(tuple.getValueByField("message")).thenReturn(geoMessage);
    joinBolt.execute(tuple);
    verify(outputCollector, times(0)).emit(eq("message"), any(tuple.getClass()), any(Values.class));
    verify(outputCollector, times(0)).ack(tuple);
    when(tuple.getSourceStreamId()).thenReturn("host");
    when(tuple.getValueByField("message")).thenReturn(hostMessage);
    joinBolt.execute(tuple);
    verify(outputCollector, times(0)).emit(eq("message"), any(tuple.getClass()), any(Values.class));
    verify(outputCollector, times(0)).ack(tuple);
    when(tuple.getSourceStreamId()).thenReturn("hbaseEnrichment");
    when(tuple.getValueByField("message")).thenReturn(hbaseEnrichmentMessage);
    joinBolt.execute(tuple);
    when(tuple.getSourceStreamId()).thenReturn("stellar");
    when(tuple.getValueByField("message")).thenReturn(new JSONObject());
    verify(outputCollector, times(0)).emit(eq("message"), any(tuple.getClass()), eq(new Values(key, joinedMessage)));
    joinBolt.execute(tuple);
    verify(outputCollector, times(1)).emit(eq("message"), any(tuple.getClass()), eq(new Values(key, joinedMessage)));
    verify(outputCollector, times(1)).ack(tuple);
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>XSSFShapeGroup (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

org.apache.poi.xssf.usermodel

Class XSSFShapeGroup

java.lang.Object

org.apache.poi.xssf.usermodel.XSSFShape

org.apache.poi.xssf.usermodel.XSSFShapeGroup

public final class XSSFShapeGroup
extends XSSFShape

This object specifies a group shape that represents many shapes grouped together. This shape is to be treated
 just as if it were a regular shape but instead of being described by a single geometry it is made up of all the
 shape geometries encompassed within it. Within a group shape each of the shapes that make up the group are
 specified just as they normally would.

Author:

Yegor Kozlov

Field Summary

Fields inherited from class org.apache.poi.xssf.usermodel.XSSFShape

anchor, drawing, EMU_PER_PIXEL, EMU_PER_POINT, parent, PIXEL_DPI, POINT_DPI

Constructor Summary

Constructors

Modifier
Constructor and Description

protected
XSSFShapeGroup(XSSFDrawing drawing,
              org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTGroupShape ctGroup)

Construct a new XSSFSimpleShape object.

Method Summary

Methods

Modifier and Type
Method and Description

XSSFConnector
createConnector(XSSFChildAnchor anchor)

Creates a simple shape.

XSSFPicture
createPicture(XSSFClientAnchor anchor,
             int pictureIndex)

Creates a picture.

XSSFSimpleShape
createSimpleShape(XSSFChildAnchor anchor)

Creates a simple shape.

XSSFTextBox
createTextbox(XSSFChildAnchor anchor)

Constructs a textbox.

org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTGroupShape
getCTGroupShape()

protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties
getShapeProperties()

Returns xml bean with shape properties.

protected static org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTGroupShape
prototype()

Initialize default structure of a new shape group

void
setCoordinates(int x1,
              int y1,
              int x2,
              int y2)

Sets the coordinate space of this group.

Methods inherited from class org.apache.poi.xssf.usermodel.XSSFShape

getAnchor, getDrawing, getParent, isNoFill, setFillColor, setLineStyle, setLineStyleColor, setLineWidth, setNoFill

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

XSSFShapeGroup

protected XSSFShapeGroup(XSSFDrawing drawing,
              org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTGroupShape ctGroup)

Construct a new XSSFSimpleShape object.

Parameters:

drawing - the XSSFDrawing that owns this shape

ctGroup - the XML bean that stores this group content

Method Detail

prototype

protected static org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTGroupShape prototype()

Initialize default structure of a new shape group

createTextbox

public XSSFTextBox createTextbox(XSSFChildAnchor anchor)

Constructs a textbox.

Parameters:

anchor - the child anchor describes how this shape is attached
               to the group.

Returns:

the newly created textbox.

createSimpleShape

public XSSFSimpleShape createSimpleShape(XSSFChildAnchor anchor)

Creates a simple shape.  This includes such shapes as lines, rectangles,
 and ovals.

Parameters:

anchor - the child anchor describes how this shape is attached
               to the group.

Returns:

the newly created shape.

createConnector

public XSSFConnector createConnector(XSSFChildAnchor anchor)

Creates a simple shape.  This includes such shapes as lines, rectangles,
 and ovals.

Parameters:

anchor - the child anchor describes how this shape is attached
               to the group.

Returns:

the newly created shape.

createPicture

public XSSFPicture createPicture(XSSFClientAnchor anchor,
                        int pictureIndex)

Creates a picture.

Parameters:

anchor - the client anchor describes how this picture is attached to the sheet.

pictureIndex - the index of the picture in the workbook collection of pictures,
                     XSSFWorkbook.getAllPictures() .

Returns:

the newly created picture shape.

getCTGroupShape

@Internal
public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTGroupShape getCTGroupShape()

setCoordinates

public void setCoordinates(int x1,
                  int y1,
                  int x2,
                  int y2)

Sets the coordinate space of this group.  All children are constrained
 to these coordinates.

getShapeProperties

protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties getShapeProperties()

Description copied from class: XSSFShape

Returns xml bean with shape properties.

Specified by:

getShapeProperties in class XSSFShape

Returns:

xml bean with shape properties.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

                Copyright 2014 The Apache Software Foundation or
        its licensors, as applicable.


text:
@interface AWLThemeManager : NSObject

@property (nonatomic, strong) NSString *currentTheme;

// return themeName
- (NSString*)addTheme:(NSString*)themePath;
- (NSArray*)allThemes;

//Get color from defaults.plist
- (UIColor*)colorForKey:(NSString*)key;
- (UIColor*)colorForKey:(NSString*)key forTheme:(NSString*)themeName;

//Get font from defaults.plist
- (UIFont*)fontForKey:(NSString*)key;
- (UIFont *)fontForKey:(NSString *)key forTheme:(NSString*)themeName;

//Get img name from defaults.plist, and then img from theme bundle. Use key as image name if img name is missed.
- (UIImage*)imageNamed:(NSString*)key;
- (UIImage *)imageNamed:(NSString *)key forTheme:(NSString*)themeName;

//key in defaults.plist of the current theme
- (id)objectForKey:(NSString*)key;
- (id)objectForKey:(NSString *)key forTheme:(NSString*)themeName;

//file path in the current theme bundle
- (NSString*)filePathForFileName:(NSString*)fileName;
- (NSString *)filePathForFileName:(NSString *)fileName ofType:(NSString*) type;
- (NSString*)filePathForFileName:(NSString *)fileName forTheme:(NSString*)themeName;
- (NSString*)filePathForFileName:(NSString *)name ofType:(NSString*) type forTheme:(NSString*)themeName;

@end


text:
<?php
//
// Copyright (c) 2020-2022 Grigore Stefan <g_stefan@yahoo.com>
// Created by Grigore Stefan <g_stefan@yahoo.com>
//
// MIT License (MIT) <http://opensource.org/licenses/MIT>
//

defined("XYO_CLOUD") or die("Access is denied");

if($this->xyo_module_id>0) {

	foreach($this->items as $item) {
		if($item["type"]=="select"){
			$this->generateComponent($item["type"],array("element" =>$item["name"]));
		}else{
			$this->generateComponent($item["type"],array_merge(array("element" =>$item["name"]),$item["parameters"]));
		};
	};

};


text:
/*globals  $, _ , Backbone, alert, console */
/*jslint browser: true */

var App = {
    Models: {},
    Collections: {},
    Views: {},
    Routers: {},
    alert: null,
    browser: null, // holder for main router
    navbar: null, // holder for NavigationBar instance
    mainAnchor: null // holder for landing page code
};

$(function () {
    'use strict';

    console.log('starting main program');

    App.navbar = new App.Views.NavigationBar();
    App.navsearch = new App.Views.NavSearch();
    App.mainAnchor = new App.Views.MainAnchor();
    App.mainAnchor.showLanding();
    App.alert = new App.Views.Alert();
    App.browser = new App.Routers.Main();
    Backbone.history.start();
});


text:
title: " The Bold Report Version 3.0.0"
date: 2014-10-22 11:39:03 -05:00
tags:
- from the editor
- site news
layout: post
custom_type: post
---

Hi Reader,

I'm taking a quick moment to write you about the new design on *The Bold Report*. This is the second redesign of this site, and its third major incarnation. If you normally read links and articles via your RSS reader, please take a moment to take a look.

I've been up to a lot lately. [Exciting things are happening in my personal life](http://instagram.com/p/saorGTycIO/), ~~The East Wing is back~~, ~~I started a daily show~~, and ~~a membership I launched about a month ago already has seven members that are supporting my online work~~.

With all of that, I've decided it was time to get back into this site. With all my different commitments and my client work, I can't commit to the daily posting of times past, but I would like to start writing useful articles and links again. I have a Sonos Play:1 review that I've been writing for almost a year, that I just need to buckle down and actually finish. Over the next few weeks, links and articles will begin to ramp up again which I'm really excited about.

All in all, if you've been a fan of this site, I hope your patience and support will soon pay off.

Thank you from the bottom of my heart.

Best,
Timmy Tim Tim


text:
import { GearIcon, RepoIcon } from "@primer/octicons-react";
import { gql } from "graphql-tag";

import {
  Card,
  CardHeader,
  CardTitle,
  Icon,
  IllustratedText,
  Link,
  LinkBlock,
  TagButton,
} from "@/components";

export const OwnerRepositoryCardFragment = gql`
  fragment OwnerRepositoryCardFragment on Repository {
    name
  }
`;

export function NoRepositoryCard() {
  return (
    <Card>
      <CardHeader border={0}>
        <CardTitle>No repository found</CardTitle>
      </CardHeader>
    </Card>
  );
}

export function ActiveRepositoryCard({ repository, url, ...props }) {
  return (
    <Card {...props}>
      <CardHeader border={0}>
        <CardTitle display="flex" alignItems="center" gap={2}>
          <IllustratedText icon={RepoIcon} gap={2}>
            <Link to={`${url}/builds`}>{repository.name}</Link>
          </IllustratedText>
        </CardTitle>
      </CardHeader>
    </Card>
  );
}

export function InactiveRepositoryCard({ repository, url, ...props }) {
  return (
    <Card {...props}>
      <CardHeader border={0}>
        <CardTitle display="flex" alignItems="flex-start" gap={2}>
          <IllustratedText icon={RepoIcon} gap={2}>
            <Link to={`${url}/builds`}>{repository.name}</Link>
          </IllustratedText>
        </CardTitle>
        <TagButton as={LinkBlock} to={`${url}/settings`}>
          <Icon as={GearIcon} />
          Settings
        </TagButton>
      </CardHeader>
    </Card>
  );
}


text:
define(['angular'], function (angular) {
    'use strict';
    return angular.module('app.controllers', []);
});


text:
<?php
declare(strict_types=1);

namespace phpDocumentor\Descriptor\Tag;

/**
 * Descriptor representing the var tag on a property.
 */
class VarDescriptor extends BaseTypes\TypedVariableAbstract
{
}


text:
/* eslint-env jest */

const dummySequence = {
  _id: 'streets',
  __v: 0,
  seq: 65
}

const save = function (cb) {
  return cb(null, dummySequence)
}

function Model (_doc) {
  this._doc = _doc
}

Model.findByIdAndUpdate = function (query, operation, option) {
  return Promise.resolve({
    ...dummySequence,
    save
  })
}

module.exports = Model


text:
REM text within <> needs to be replaced with original path on the test PC before using this batch file.

set path=%path%;<Keil_v5 path>\UV4;
cd <Jenkins path>\jobs\Coverity_test\workspace\embedded
rd fmlib /s /q
md fmlib

REM fmlib is to be taken from \\fs2\Public\Host_Software\MotionQ\release_1.x.xx folder
copy <FMLib release path>\FMLib_Embedded.lib fmlib\
cd <Jenkins path>\jobs\Coverity_test\workspace
UV4.exe -r embedded\projects\SH-Xpresso-LPC54102\keil-mdk-build\SH-Xpresso-LPC54102.uvprojx