text:
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip python-dev openjdk-9-jre
cat > /etc/resolv.conf <<EOF
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.71.212.9
nameserver 10.71.212.10
EOF

sudo touch /var/run/coverage.ready

redpajama_set_name: RedPajamaGithub


text:
package dotty.runtime.function;

@FunctionalInterface
public interface JFunction2$mcDID$sp extends JFunction2<Object, Object, Object> {
    abstract double apply$mcDID$sp(int v1, double v2);

    default Object apply(Object v1, Object v2) { return (Double) apply$mcDID$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2)); }
}


text:
#include "lib.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "home-expand.h"
#include "file-dotlock.h"
#include "hash.h"
#include "mail-user.h"
#include "mail-storage-settings.h"
#include "duplicate.h"

#include <fcntl.h>
#include <unistd.h>

#define DUPLICATE_FNAME ".dovecot.lda-dupes"
#define COMPRESS_PERCENTAGE 10
#define DUPLICATE_BUFSIZE 4096
#define DUPLICATE_VERSION 2

struct duplicate {
	const void *id;
	unsigned int id_size;

	const char *user;
	time_t time;
};

struct duplicate_file_header {
	uint32_t version;
};

struct duplicate_record_header {
	uint32_t stamp;
	uint32_t id_size;
	uint32_t user_size;
};

struct duplicate_file {
	pool_t pool;
	HASH_TABLE(struct duplicate *, struct duplicate *) hash;
	const char *path;

	int new_fd;
	struct dotlock *dotlock;
	unsigned int changed:1;
};

struct duplicate_context {
	char *path;
	struct dotlock_settings dotlock_set;
	struct duplicate_file *file;
};

static const struct dotlock_settings default_duplicate_dotlock_set = {
	.timeout = 20,
	.stale_timeout = 10,
};

static int duplicate_cmp(const struct duplicate *d1, const struct duplicate *d2)
{
	return (d1->id_size == d2->id_size &&
		memcmp(d1->id, d2->id, d1->id_size) == 0 &&
		strcasecmp(d1->user, d2->user) == 0) ? 0 : 1;
}

static unsigned int duplicate_hash(const struct duplicate *d)
{
	/* a char* hash function from ASU -- from glib */
        const unsigned char *s = d->id, *end = s + d->id_size;
	unsigned int g, h = 0;

	while (s != end) {
		h = (h << 4) + *s;
		if ((g = h & 0xf0000000UL)) {
			h = h ^ (g >> 24);
			h = h ^ g;
		}
		s++;
	}

	return h ^ strcase_hash(d->user);
}

static int
duplicate_read_records(struct duplicate_file *file, struct istream *input,
		       unsigned int record_size)
{
	const unsigned char *data;
	struct duplicate_record_header hdr;
	size_t size;
	unsigned int change_count;

	change_count = 0;
	while (i_stream_read_data(input, &data, &size, record_size) > 0) {
		if (record_size == sizeof(hdr))
			memcpy(&hdr, data, sizeof(hdr));
		else {
			/* FIXME: backwards compatibility with v1.0 */
			time_t stamp;

			i_assert(record_size ==
				 sizeof(time_t) + sizeof(uint32_t)*2);
			memcpy(&stamp, data, sizeof(stamp));
			hdr.stamp = stamp;
			memcpy(&hdr.id_size, data + sizeof(time_t),
			       sizeof(hdr.id_size));
			memcpy(&hdr.user_size,
			       data + sizeof(time_t) + sizeof(uint32_t),
			       sizeof(hdr.user_size));
		}
		i_stream_skip(input, record_size);

		if (hdr.id_size == 0 || hdr.user_size == 0 ||
		    hdr.id_size > DUPLICATE_BUFSIZE ||
		    hdr.user_size > DUPLICATE_BUFSIZE) {
			i_error("broken duplicate file %s", file->path);
			return -1;
		}

		if (i_stream_read_data(input, &data, &size,
				       hdr.id_size + hdr.user_size - 1) <= 0) {
			i_error("unexpected end of file in %s", file->path);
			return -1;
		}

		if ((time_t)hdr.stamp >= ioloop_time) {
			/* still valid, save it */
			struct duplicate *d;
			void *new_id;

			new_id = p_malloc(file->pool, hdr.id_size);
			memcpy(new_id, data, hdr.id_size);

			d = p_new(file->pool, struct duplicate, 1);
			d->id = new_id;
			d->id_size = hdr.id_size;
			d->user = p_strndup(file->pool,
					    data + hdr.id_size, hdr.user_size);
			d->time = hdr.stamp;
			hash_table_insert(file->hash, d, d);
		} else {
                        change_count++;
		}
		i_stream_skip(input, hdr.id_size + hdr.user_size);
	}

	if (hash_table_count(file->hash) *
	    COMPRESS_PERCENTAGE / 100 > change_count)
		file->changed = TRUE;
	return 0;
}

static int duplicate_read(struct duplicate_file *file)
{
	struct istream *input;
	struct duplicate_file_header hdr;
	const unsigned char *data;
	size_t size;
	int fd;
	unsigned int record_size = 0;

	fd = open(file->path, O_RDONLY);
	if (fd == -1) {
		if (errno == ENOENT)
			return 0;
		i_error("open(%s) failed: %m", file->path);
		return -1;
	}

	/* <timestamp> <id_size> <user_size> <id> <user> */
	input = i_stream_create_fd(fd, DUPLICATE_BUFSIZE, FALSE);
	if (i_stream_read_data(input, &data, &size, sizeof(hdr)) > 0) {
		memcpy(&hdr, data, sizeof(hdr));
		if (hdr.version == 0 || hdr.version > DUPLICATE_VERSION + 10) {
			/* FIXME: backwards compatibility with v1.0 */
			record_size = sizeof(time_t) + sizeof(uint32_t)*2;
		} else if (hdr.version == DUPLICATE_VERSION) {
			record_size = sizeof(struct duplicate_record_header);
			i_stream_skip(input, sizeof(hdr));
		}
	}

	if (record_size == 0 ||
	    duplicate_read_records(file, input, record_size) < 0)
		i_unlink_if_exists(file->path);

	i_stream_unref(&input);
	if (close(fd) < 0)
		i_error("close(%s) failed: %m", file->path);
	return 0;
}

static struct duplicate_file *duplicate_file_new(struct duplicate_context *ctx)
{
	struct duplicate_file *file;
	pool_t pool;

	i_assert(ctx->path != NULL);

	pool = pool_alloconly_create("duplicates", 10240);

	file = p_new(pool, struct duplicate_file, 1);
	file->pool = pool;
	file->path = p_strdup(pool, ctx->path);
	file->new_fd = file_dotlock_open(&ctx->dotlock_set, file->path, 0,
					 &file->dotlock);
	if (file->new_fd != -1)
		;
	else if (errno != EAGAIN)
		i_error("file_dotlock_open(%s) failed: %m", file->path);
	else {
		i_error("Creating lock file for %s timed out in %u secs",
			file->path, ctx->dotlock_set.timeout);
	}
	hash_table_create(&file->hash, pool, 0, duplicate_hash, duplicate_cmp);

	(void)duplicate_read(file);
	return file;
}

static void duplicate_file_free(struct duplicate_file **_file)
{
	struct duplicate_file *file = *_file;

	*_file = NULL;
	if (file->dotlock != NULL)
		file_dotlock_delete(&file->dotlock);

	hash_table_destroy(&file->hash);
	pool_unref(&file->pool);
}

bool duplicate_check(struct duplicate_context *ctx,
		     const void *id, size_t id_size, const char *user)
{
	struct duplicate d;

	if (ctx->file == NULL) {
		if (ctx->path == NULL) {
			/* duplicate database disabled */
			return FALSE;
		}
		ctx->file = duplicate_file_new(ctx);
	}

	d.id = id;
	d.id_size = id_size;
	d.user = user;

	return hash_table_lookup(ctx->file->hash, &d) != NULL;
}

void duplicate_mark(struct duplicate_context *ctx,
		    const void *id, size_t id_size,
                    const char *user, time_t timestamp)
{
	struct duplicate *d;
	void *new_id;

	if (ctx->file == NULL) {
		if (ctx->path == NULL) {
			/* duplicate database disabled */
			return;
		}
		ctx->file = duplicate_file_new(ctx);
	}

	new_id = p_malloc(ctx->file->pool, id_size);
	memcpy(new_id, id, id_size);

	d = p_new(ctx->file->pool, struct duplicate, 1);
	d->id = new_id;
	d->id_size = id_size;
	d->user = p_strdup(ctx->file->pool, user);
	d->time = timestamp;

	ctx->file->changed = TRUE;
	hash_table_insert(ctx->file->hash, d, d);
}

void duplicate_flush(struct duplicate_context *ctx)
{
	struct duplicate_file *file = ctx->file;
	struct duplicate_file_header hdr;
	struct duplicate_record_header rec;
	struct ostream *output;
        struct hash_iterate_context *iter;
	struct duplicate *d;

	if (file == NULL)
		return;
	if (!file->changed || file->new_fd == -1) {
		/* unlock the duplicate database */
		duplicate_file_free(&ctx->file);
		return;
	}

	memset(&hdr, 0, sizeof(hdr));
	hdr.version = DUPLICATE_VERSION;

	output = o_stream_create_fd_file(file->new_fd, 0, FALSE);
	o_stream_cork(output);
	o_stream_nsend(output, &hdr, sizeof(hdr));

	memset(&rec, 0, sizeof(rec));
	iter = hash_table_iterate_init(file->hash);
	while (hash_table_iterate(iter, file->hash, &d, &d)) {
		rec.stamp = d->time;
		rec.id_size = d->id_size;
		rec.user_size = strlen(d->user);

		o_stream_nsend(output, &rec, sizeof(rec));
		o_stream_nsend(output, d->id, rec.id_size);
		o_stream_nsend(output, d->user, rec.user_size);
	}
	hash_table_iterate_deinit(&iter);

	if (o_stream_nfinish(output) < 0) {
		i_error("write(%s) failed: %m", file->path);
		o_stream_unref(&output);
		duplicate_file_free(&ctx->file);
		return;
	}
	o_stream_unref(&output);

	if (file_dotlock_replace(&file->dotlock, 0) < 0)
		i_error("file_dotlock_replace(%s) failed: %m", file->path);
	duplicate_file_free(&ctx->file);
}

struct duplicate_context *duplicate_init(struct mail_user *user)
{
	struct duplicate_context *ctx;
	const struct mail_storage_settings *mail_set;
	const char *home = NULL;

	if (mail_user_get_home(user, &home) <= 0) {
		i_error("User %s doesn't have home dir set, "
			"disabling duplicate database", user->username);
	}

	ctx = i_new(struct duplicate_context, 1);
	ctx->path = i_strconcat(home, "/"DUPLICATE_FNAME, NULL);
	ctx->dotlock_set = default_duplicate_dotlock_set;

	mail_set = mail_user_set_get_storage_set(user);
	ctx->dotlock_set.use_excl_lock = mail_set->dotlock_use_excl;
	ctx->dotlock_set.nfs_flush = mail_set->mail_nfs_storage;
	return ctx;
}

void duplicate_deinit(struct duplicate_context **_ctx)
{
	struct duplicate_context *ctx = *_ctx;

	*_ctx = NULL;
	if (ctx->file != NULL) {
		duplicate_flush(ctx);
		i_assert(ctx->file == NULL);
	}
	i_free(ctx->path);
	i_free(ctx);
}


text:
/**
** 说明:页面元数据操作模块,提供封装过的页面组件、工具函数
**/

//组件库模型定义文件路径
var baseUrl = "/widget/";

(function(){

//页面模型元数据对象,注册到window中,全局可用
var PageMeta = function(){

	//step 1: init stage:
	this.inited = false;
	//系统中注册的扩展类型(组件),通过扩展注册类型,增加新的类型
	this.extTypes = {
			//json基础类型
			"TTextDef":null,
			"TIntegerDef":null,
			"TNumberDef":null,
			"TBooleanDef":null,
			"TArrayDef":null,
			//扩展类型
                                       "TLinkDef":null,
			"TPictureDef":null,
			//自定义组件
			"TPicLinkDef":null,
			"TTextLinkDef":null,
	};

	//json schema定义的内置类型列表
	this.josnBuildInType = [ "array", "boolean", "integer", "null", "number", "object", "string" ];
};

PageMeta.prototype = {
		// 装载扩展类型定义
	init:function (pageMetaDefURL){
		//for(var i=0;i < this.types.length;i++){
		for(var ti in this.extTypes){
	    	this.initComponent(ti);
		}
		this.inited = true;
	},

	//获得页面元数据的元元数据定义
	loadPageMetaMetaDef:function(pageMetaDefURL){
		var meta = fetchUrlContent(pageMetaDefURL);
		pageMeta = JSON.parse(meta);
		return transToPageModeMeta(pageMeta);
	},

	//初始化组件的meta定义,从各个组件定义json中解析
	initComponent:function(ti){
		if(this.extTypes[ti]) return this.extTypes[ti];

		var url = baseUrl + ti + ".json";
		console.log("loading widget def :" +  url);
		var tmpDef = fetchUrlContent(url);
		var clz = new window.widget(ti,tmpDef);
		clz.init();
		this.extTypes[ti] = clz;
		return clz;
	},

	//得到指定类型的模型定义;
	//注意:模型已经进行clone
	//array需要根据实际情况进行进一步的元素类型扩展:
	getWidgetCloneDef:function(ti,arrayObj){
		var clz = this.initComponent(ti);
		if(clz){
			var tmp_clz = deepCopy({},clz);
			if(ti === "TArrayDef"){
				tmp_clz['title'] = arrayObj['title'];
				this.expendArrayDef(tmp_clz,arrayObj['items']);
			}

			if(arrayObj['options']){
				tmp_clz.metaMetaDef['options'] = deepCopy({},arrayObj['options']);
			}
			return tmp_clz;
		}
		return null;
	},

	//array需要根据实际情况进行进一步的元素类型扩展:
	expendArrayDef:function(clz,itemsDef){
		var ttp = itemsDef['type'];
		if(ttp === 'object'){
			var clz1 = buildObject(itemsDef);
			if(itemsDef['title']) clz1['title'] = itemsDef['title'];
			clz.metaMetaDef['properties']['items'] = clz1;
		}
		else{	//buildin type....
			if(this.extTypes.hasOwnProperty(ttp)){
				var clz1 = this.getWidgetCloneDef(ttp,itemsDef);
				clz.metaMetaDef['properties']['items'] = clz1.metaMetaDef;
			}
			else{
				//
			}
		}
	},

	//判断类是否为json schema内置类型
	isJSONBuildin:function(theType){
		return this.josnBuildInType.indexOf(theType) !== -1;
	}

} //end PageMetaObj prototype def

	//register page meta to window obj
	window.pagemeta = new PageMeta();
})();
//end closure def

/**
**	页面元数据模块共用函数库
**/
//深度copy对象函数,直接采用json-editor的js函数$extend
var deepCopy = function(destination) {
  var source, i,property;
  for(i=1; i<arguments.length; i++) {
    source = arguments[i];
    for (property in source) {
      if(!source.hasOwnProperty(property)) continue;
      if(source[property] && $isplainobject(source[property])) {
        if(!destination.hasOwnProperty(property)) destination[property] = {};
        deepCopy(destination[property], source[property]);
      }
      else {
        destination[property] = source[property];
      }
    }
  }
  return destination;
};

//判断是否为对象类型
var $isplainobject = function( obj ) {
      // Not own constructor property must be Object
      if ( obj.constructor &&
        !obj.hasOwnProperty('constructor') &&
        !obj.constructor.prototype.hasOwnProperty('isPrototypeOf')) {
        return false;
      }

      // Own properties are enumerated firstly, so to speed up,
      // if last one is own, then all properties are own.

      var key;
      for ( key in obj ) {}

      return key === undefined || obj.hasOwnProperty(key);
};

//动态装载json数据函数,返回指定url的json字符串
function fetchUrlContent(url){
	  var r = new XMLHttpRequest();
	  var ret = "";
	  r.open("GET", url, false);
	  r.onreadystatechange = function () {
		console.log("url:" + url);
	    if (r.readyState != 4) return;
	    // Request succeeded
	    if(r.status === 200) {
	      var response;
	      try {
	        ret = r.responseText;
	        return ;
	      }
	      catch(e) {
	        window.console.log(e);
	        throw "Failed to parse external ref "+url;
	      }
	     }
	    // Request failed
	    else {
	      window.console.log(r);
	      throw "Failed to fetch ref via ajax- "+url;
	    }
	  };
	  r.send();
	  return ret;
      //throw "unkown error:"+ url;
}

/**
** 跟踪用户修改信息
**/
var changeList = {};
function eventChanged(ctrl,actionType){
	if(ctrl && ctrl.path){
		console.log("Event change:" + ctrl.path + ", actionType:"+actionType);
		changeList[ctrl.path] = actionType;
	}
	else{
		console.log("change invalided event:" + ctrl);
	}
}

///针对mcms特殊需求场景的解决方案
//1. 权限继承
/**
** 参数editor设置完毕后,扫描所有节点,对设置的运营级别和当前设置人员级别进行判断和设置:
** 1. 设置比自己运营级别高的选项为disable,不可选择
** 2. 对比自己运营级别低,但是是高运营级别的人员设置的也设置为disable
**/
function scanMeta2Level(editor,setterLevel,isSingleOp){
	var levelStack = [];
	var parentLevel = "1";
	var path = "root.pageBlocks.";
	var curJson = editor.getValue().pageBlocks;	//页面区域定义
        if(isSingleOp){
            for(var bName  in curJson){
                    disableOpLevel(editor,curJson[bName],setterLevel,parentLevel,levelStack,path+bName);
            }
        }
        else
	for(var bName  in curJson){
		innerScanMeta2Level(editor,curJson[bName],setterLevel,parentLevel,levelStack,path+bName);
	}
}
    //内部函数,设置权限继承
function innerScanMeta2Level(editor,valueJson,setterLevel,parentLevel,levelStack,path){
// 	levelStack.push(parentLevel);
	var subEditor = editor.getEditor(path);
	// 判断是否为按照数组位置授权,如果是,不再继续向下执行;
	if(subEditor && subEditor.options){
		if(subEditor.options.assignByIndex === true){
			return ;
		}
	}
	var tmpEditor = editor.getEditor(path+".distLevel");
	if(tmpEditor && tmpEditor.control.lastChild){
		var slt = tmpEditor.control.lastChild;
		var selectValue = slt.options[slt.selectedIndex].value;

	// console.log(" scan node:" + path + ",sltval:" + selectValue +",parentLevel:" + parentLevel);
		if(selectValue === ""){ //继承父级
			var opts = slt.options;
			for(var opt =0 ;opt < opts.length;opt++){
				if(opts[opt].value === parentLevel){
					opts[opt].selected = true;
					break;
				}
			}
		}
		selectValue = slt.options[slt.selectedIndex].value;
		if(selectValue < setterLevel){
			slt.disabled = true;
		}
		else{
			var opts = slt.options;
			for(var opt =0 ;opt < opts.length;opt++){
				if(opts[opt].value < setterLevel){//权限级别更高的,不能选择
					opts[opt].disabled = true;
				}
			}
		}
	}
	//继续设置子对象
	for(var bName in valueJson){
		if(!window.isplainobject(valueJson[bName]))  continue;
		var tLevel = valueJson['distLevel'];
		if(! tLevel)  tLevel = parentLevel;
		innerScanMeta2Level(editor,valueJson[bName],setterLevel,tLevel,levelStack,path+"."+bName);

	}
	// levelStack
}

//如果为单一层级运营模式,简单的将运营权限设置为空并disabled
function disableOpLevel(editor,valueJson,setterLevel,parentLevel,levelStack,path){
//  levelStack.push(parentLevel);i
        var tpath = path+".distLevel";
        var slt = findOpLevelEditorByPath(editor,tpath);
        if(slt){
            slt.options[0].selected = true;
            slt.disabled = true;
         }
    //继续设置子对象
    for(var bName in valueJson){
        if(!window.isplainobject(valueJson[bName]))  continue;
        var tLevel = valueJson['distLevel'];
        if(! tLevel)  tLevel = parentLevel;
        disableOpLevel(editor,valueJson[bName],setterLevel,tLevel,levelStack,path+"."+bName);
    }
    // levelStack
}

//初始化模型第一次载入的运营权限:页面区域默认设置为集团,后边的继承该设置
function initOpLevel(editor){
    var path = "root.pageBlocks.";
    var curJson = editor.getValue().pageBlocks; //页面区域定义
    for(var bName  in curJson){
        var tpath = path+bName+".distLevel";
        var slt = findOpLevelEditorByPath(editor,tpath);
        if(slt){
            slt.options[1].selected = true;
        }
    }
}

///设置不同等级用户的编辑状态:
    //设置编辑状态
    function setEditor4Level(editorRoot,authInfo,ppath){
        scanArrayAxises(editorRoot,authInfo,ppath);

        var pp =  authInfo.parentPath;
        pp = ppath +  (pp === ""?"":"."+pp) ;
        for(var fp in authInfo.flatPath){
            if(authInfo.arrayAxises > 0){   //如果实例数组存在,需要在数组纬度上展开
                for(var ti =0; ti < authInfo.arrayAxises;ti++){
                    var apth = pp + "." +ti +"." + authInfo.flatPath[fp];
                    // console.log( apth);
                    var editor = editorRoot.getEditor(apth);

//             console.log("set path enable :" + preIdens +">" + parentPath + "." + authInfo.flatPath[fp]);
                    if(editor)  editor.enable();
                }
            }
            else{
                var apth = pp + "." + authInfo.flatPath[fp];
                // console.log( apth);
                var editor = editorRoot.getEditor(apth);

//             console.log("set path enable :" + preIdens +">" + parentPath + "." + authInfo.flatPath[fp]);
                if(editor)  editor.enable();
            }
        }

        var i =0;
        for(var a in authInfo.arrayPath){   //处理每个数组类型
            var ai = authInfo.arrayPath[a];
            if(authInfo.arrayAxises > 0){
                for(var ti =0 ; ti < authInfo.arrayAxises;ti ++){   //在数组类型上展开
//                     console.log(" set path: to extend@" + pp +"."+ti);
                    setEditor4Level(editorRoot,ai,pp+"."+ti);
                }
            }
            else{
                                  console.log(" set path: to extend@" + pp);
                setEditor4Level(editorRoot,ai,pp);
            }
        }
    }

     var searchLevel = 100;

    function scanArrayAxises(editor,ai,ppath){
        var pp =  ai.parentPath;
        pp = ppath +  (pp === ""?"":"."+pp) ;
        for(var i =0; i < searchLevel;i++){
            var arrayIdxPath = pp + "." +  i;
            var arrayIns =editor.getEditor(arrayIdxPath);
            if(!arrayIns)  break;
            ai.arrayAxises = i+1;
        // console.log("scan array axis :"+ppath + ","+arrayIdxPath);
        }
    }

//jsoneditor对象查询定位工具方法

/**
**设置整个子节点运营权限全部为某个层级,disabledSlt==true:设置控件不可修改
**/
function setOpLevelToTree(editor,path,oplevel,showTxt,disabledSlt){
	var edt = editor.getEditor(path);
	if(edt){
		var objs = edt.editors;
		for(var o in objs){
			if(o.indexOf("distLevel") > -1){
				var slt = findOpLevelEditorByPath(editor,path+"."+o);
				if(slt){
					for(var k in slt.options){
						var kk = slt.options[k];
						if(kk.value === (""+oplevel)){
							kk.selected = true;
							kk.text = showTxt;
							break;
						}
					}
					if(disabledSlt)
						slt.disabled = true;
					else
						slt.disabled = false;
				}
			}
			else{	//
				setOpLevelToTree(editor,path+"."+o,oplevel,showTxt,disabledSlt);
			}
		}
	}
}

//找到指定path的权限层级设置对象控件select
function findOpLevelEditorByPath(editor,path){
    var tmpEditor = editor.getEditor(path);
        if(tmpEditor && tmpEditor.control.lastChild){
            return tmpEditor.control.lastChild;
        }
        return null;
}

//查找object数据结构对象的title html区块
//结构为:
<>title</><>button list</>
function getObjDefTitleArea(editor,path){
    var tdiv = editor.getEditor(path);  //ex:root.pageBlocks.A4GAd.blockTitle
    if(tdiv && tdiv.title){
        return tdiv.title;
    }
    return null;
}
//查找obj对象属性的title定义区块;形式为:xxxx
function getObjPropDefTittleArea(editor,path){
    //ex:root.pageBlocks.A4GAd.blockTitle.default
    var tdiv = editor.getEditor(path);  //ex:root.pageBlocks.A4GAd.blockTitle
    if(tdiv && tdiv.label){
        return tdiv.label;
    }
    return null;
}

//得到一个可用的按钮模版,用于后续的添加按钮等操作,
//模版来自于root对象的第一个功能按钮
var funcButtonTemp = null ;
function getTemplateButton(editor){
    if(!funcButtonTemp){
        if(!editor) return null;
        if(editor.root.title.childNodes[1].children[0]){
            funcButtonTemp = editor.root.title.childNodes[1].children[0].cloneNode();
        }
        else{
            console.error("no buttontemplate to clone");
            return null;
        }
    }

            return funcButtonTemp.cloneNode();
}
//创建button对象并设置title,callback:
//var kk = getFuncButton(jsoneditor,"你好",function(e){alert('ere');});
//ex:jsoneditor.root.title.appendChild(kk)
function getFuncButton(editor,title,callback){
    var tb = getTemplateButton(editor);
    if(!tb) return null;

    if(title) tb.innerText = title;
    if(callback) tb.addEventListener('click',callback);
    return tb;
}

   function getFormInputField(type) {
    var el = document.createElement('input');
    el.setAttribute('type',type);
    return el;
  }


text:
module Elasticfeed

  class Agent

    attr_accessor :client

    # @param [Elasticfeed::Client] client
    def initialize(client)
      @client = client
    end

    # @param [String] apiurl
    def set_apiurl(apiurl)
      @client.url = apiurl
    end

    # @return [Array<Elasticfeed::Resource::Organisation>]
    def orgs
      org_list = []
      client.get('/org').each do |org|
        g = Elasticfeed::Resource::Organisation.new
        g.set_client(client)
        g.set_data(org)

        org_list.push g
      end
      org_list
    end

    # @return [Array<Elasticfeed::Resource::Plugin>]
    def plugins
      plugin_list = []
      client.get('/system/plugin').each do |org|
        g = Elasticfeed::Resource::Plugin.new
        g.set_client(client)
        g.set_data(org)

        plugin_list.push g
      end
      plugin_list
    end

    # @return [Array<Elasticfeed::Resource::Application>]
    def apps
      app_list = []
      client.get('/application').each do |application|
        g = Elasticfeed::Resource::Application.new
        g.set_client(client)
        g.set_data(application)

        app_list.push g
      end
      app_list
    end

    def feeds
      feed_list = []
      apps.each do |app|
        feed_list.concat app.feeds
      end
      feed_list
    end

    def entries
      entry_list = []
      feeds.each do |feed|
        entry_list.concat feed.entries
      end
      entry_list
    end

    def workflows
      workflow_list = []
      feeds.each do |feed|
        workflow_list.concat feed.workflows
      end
      workflow_list
    end

    # @return [Elasticfeed::Resource::Organisation]
    def find_organisation(id)
      Elasticfeed::Resource::Organisation.find(@client, id)
    end

    # @return [Elasticfeed::Resource::Plugin]
    def find_plugin(id)
      Elasticfeed::Resource::Plugin.find(@client, id)
    end

    # @return [Elasticfeed::Resource::Application]
    def find_application(id)
      Elasticfeed::Resource::Application.find(@client, id)
    end

  end
end


text:
class AP_API apMemoryAllocationFailureEvent : public apEvent
{
public:
    apMemoryAllocationFailureEvent(osCallStack callStack);
    apMemoryAllocationFailureEvent();
    ~apMemoryAllocationFailureEvent();

    // Overrides osTransferableObject:
    virtual osTransferableObjectType type() const;
    virtual bool writeSelfIntoChannel(osChannel& ipcChannel) const;
    virtual bool readSelfFromChannel(osChannel& ipcChannel);

    // Overrides apEvent:
    virtual EventType eventType() const;
    virtual apEvent* clone() const;

    osCallStack& callStack() { return m_callStack; }

private:
    /// Call stack where the allocation happened.
    osCallStack m_callStack;
};

#endif //__APMEMORYALLOCATIONFAILUREEVENT_H


text:
<?php

namespace DoeSangue\GraphQL\Mutation;

use GraphQL;
use App\User;
use GraphQL\Type\Definition\Type;
use Folklore\GraphQL\Support\Mutation;

class CreateCampaignMutation extends Mutation
{

  protected $attributes = [
    'name' => 'createCampaign'
  ];
}


text:
class RegularScheduleSerializer < ActiveModel::Serializer
  attributes :weekday, :opens_at, :closes_at
end


text:
<?php

namespace cs\Storage;
class Local extends _Abstract {
	/**
	 * @inheritdoc
	 */
	function __construct ($base_url, $host, $user = '', $password = '') {
		$this->base_url  = url_by_source(PUBLIC_STORAGE);
		$this->connected = true;
	}
	/**
	 * @inheritdoc
	 */
	function get_files_list ($dir, $mask = false, $mode = 'f', $prefix_path = false, $subfolders = false, $sort = false, $exclusion = false, $system_files = false, $apply = null, $limit = null) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function file ($filename, $flags = null) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function file_get_contents ($filename, $flags = null) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function file_put_contents ($filename, $data, $flags = null) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function copy ($source, $dest) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$arguments[1] = $this->absolute_path($arguments[1]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function unlink ($filename) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function file_exists ($filename) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function move_uploaded_file ($filename, $destination) {
		$arguments    = func_get_args();
		$arguments[1] = $this->absolute_path($arguments[1]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function rename ($oldname, $newname) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$arguments[1] = $this->absolute_path($arguments[1]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function mkdir ($pathname, $mode = 0777, $recursive = false) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function rmdir ($dirname) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function is_file ($filename) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function is_dir ($filename) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function url_by_source ($source) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	/**
	 * @inheritdoc
	 */
	function source_by_url ($url) {
		$arguments    = func_get_args();
		$arguments[0] = $this->absolute_path($arguments[0]);
		$return       = call_user_func_array(__FUNCTION__, $arguments);
		return $return;
	}
	protected function absolute_path ($path) {
		// If not absolute path -
		return preg_match('#^(([a-z]+:)?//|/)#i', $path) ? $path : PUBLIC_STORAGE.'/'.ltrim($path);
	}
}


text:
// Copyright 2015 Joyent, Inc.

var assert = require('assert-plus');
var util = require('util');
var sshpk = require('sshpk');
var SSHBuffer = require('./ssh-buffer');
var errs = require('./errors');
var AgentProtocolError = errs.AgentProtocolError;

function readClientFrame(buf) {
	var id = buf.readUInt8();
	var obj = {};
	switch (id) {
	case 11:
		obj.type = 'request-identities';
		break;
	case 13:
		obj.type = 'sign-request';
		obj.publicKey = buf.readBuffer();
		obj.data = buf.readBuffer();
		obj.flags = [];

		var flagint = buf.readUInt();
		if ((flagint & 0x01) != 0)
			obj.flags.push('old-signature');
		if ((flagint & 0x02) != 0)
			obj.flags.push('rsa-sha2-256');
		if ((flagint & 0x04) != 0)
			obj.flags.push('rsa-sha2-512');
		break;
	case 17:
		obj.type = 'add-identity';
		obj.privateKey = buf.readPrivateKeyBuf();
		obj.comment = buf.readString();
		break;
	case 18:
		obj.type = 'remove-identity';
		obj.publicKey = buf.readBuffer();
		break;
	case 19:
		obj.type = 'remove-all-identities';
		break;
	case 22:
		obj.type = 'lock';
		obj.password = buf.readString();
		break;
	case 23:
		obj.type = 'unlock';
		obj.password = buf.readString();
		break;
	case 25:
		obj.type = 'add-identity-constrained';
		obj.privateKey = buf.readPrivateKeyBuf();
		obj.comment = buf.readString();
		obj.constraints = [];
		while (!buf.atEnd()) {
			var consType = buf.readUInt8();
			var cons = {};
			switch (consType) {
			case 1:
				cons.type = 'lifetime';
				cons.seconds = buf.readUInt();
				break;
			case 2:
				cons.type = 'confirm';
				break;
			default:
				throw (new AgentProtocolError(util.format(
				    'Unsupported key constraint type: 0x%02x',
				    consType)));
			}
			obj.constraints.push(cons);
		}
		break;
	case 27:
		obj.type = 'extension';
		obj.extension = buf.readString();
		obj.data = buf.readBuffer();
		break;
	default:
		throw (new AgentProtocolError(util.format(
		    'Unsupported message type ID: 0x%02x', id)));
	}
	if (!buf.atEnd()) {
		throw (new AgentProtocolError(util.format(
		    'Message of type "%s" was too long (%d bytes unused)',
		    obj.type, buf.remainder().length)));
	}
	return (obj);
}

function writeClientFrame(obj) {
	var buf = new SSHBuffer({});
	switch (obj.type) {
	case 'request-identities':
		buf.writeUInt8(11);
		break;
	case 'sign-request':
		buf.writeUInt8(13);
		assert.buffer(obj.publicKey, 'publicKey');
		assert.buffer(obj.data, 'data');
		assert.arrayOfString(obj.flags, 'flags');
		buf.writeBuffer(obj.publicKey);
		buf.writeBuffer(obj.data);
		var flagint = 0;
		if (obj.flags.indexOf('old-signature') !== -1)
			flagint |= 0x01;
		if (obj.flags.indexOf('rsa-sha2-256') !== -1)
			flagint |= 0x02;
		if (obj.flags.indexOf('rsa-sha2-512') !== -1)
			flagint |= 0x04;
		buf.writeUInt(flagint);
		break;
	case 'add-identity':
		buf.writeUInt8(17);
		assert.buffer(obj.privateKey, 'privateKey');
		assert.string(obj.comment, 'comment');
		buf.write(obj.privateKey);
		buf.writeString(obj.comment);
		break;
	case 'remove-identity':
		buf.writeUInt8(18);
		assert.buffer(obj.publicKey, 'publicKey');
		buf.writeBuffer(obj.publicKey);
		break;
	case 'remove-all-identities':
		buf.writeUInt8(19);
		break;
	case 'lock':
		buf.writeUInt8(22);
		assert.string(obj.password, 'password');
		buf.writeString(obj.password);
		break;
	case 'unlock':
		buf.writeUInt8(23);
		assert.string(obj.password, 'password');
		buf.writeString(obj.password);
		break;
	case 'add-identity-constrained':
		buf.writeUInt8(25);
		assert.buffer(obj.privateKey, 'privateKey');
		assert.string(obj.comment, 'comment');
		assert.arrayOfObject(obj.constraints, 'constraints');
		buf.write(obj.privateKey);
		buf.writeString(obj.comment);
		obj.constraints.forEach(function (cons) {
			switch (cons.type) {
			case 'lifetime':
				assert.number(cons.seconds, 'cons.seconds');
				buf.writeUInt8(1);
				buf.writeUInt(cons.seconds);
				break;
			case 'confirm':
				buf.writeUInt8(2);
				break;
			default:
				throw (new AgentProtocolError(util.format(
				    'Invalid outgoing key constraint type: ' +
				    '"%s"', cons.type)));
			}
		});
		break;
	case 'extension':
		buf.writeUInt8(27);
		assert.string(obj.extension, 'extension');
		assert.buffer(obj.data, 'data');
		buf.writeString(obj.extension);
		buf.writeBuffer(obj.data);
		break;
	default:
		throw (new AgentProtocolError(util.format('Invalid outgoing ' +
		    'frame type: "%s"', obj.type)));
	}
	return (buf);
}

function readAgentFrame(buf) {
	var id = buf.readUInt8();
	var obj = {};
	switch (id) {
	case 5:
		obj.type = 'failure';
		break;
	case 6:
		obj.type = 'success';
		var rem = buf.remainder();
		/* Extensions can overload the "success" message */
		if (rem.length > 0) {
			obj.remainder = rem;
			return (obj);
		}
		break;
	case 12:
		obj.type = 'identities-answer';
		obj.identities = [];
		var n = buf.readUInt();
		for (var i = 0; i < n; ++i) {
			obj.identities.push({
				key: buf.readBuffer(),
				comment: buf.readString()
			});
		}
		break;
	case 14:
		obj.type = 'sign-response';
		obj.signature = buf.readBuffer();
		break;
	case 28:
		obj.type = 'ext-failure';
		break;
	default:
		throw (new AgentProtocolError(util.format(
		    'Unsupported message type ID: 0x%02x', id)));
	}
	if (!buf.atEnd()) {
		throw (new AgentProtocolError(util.format(
		    'Message of type "%s" was too long (%d bytes unused)',
		    obj.type, buf.remainder().length)));
	}
	return (obj);
}

function writeAgentFrame(obj) {
	var buf = new SSHBuffer({});
	switch (obj.type) {
	case 'failure':
		buf.writeUInt8(5);
		break;
	case 'success':
		buf.writeUInt8(6);
		if (obj.remainder !== undefined) {
			assert.buffer(obj.remainder, 'remainder');
			buf.write(obj.remainder);
		}
		break;
	case 'identities-answer':
		buf.writeUInt8(12);
		assert.optionalArrayOfObject(obj.identities, 'identities');
		if (!obj.identities) {
			buf.writeUInt(0);
		} else {
			buf.writeUInt(obj.identities.length);
			obj.identities.forEach(function (id) {
				assert.buffer(id.key, 'key');
				assert.string(id.comment, 'comment');
				buf.writeBuffer(id.key);
				buf.writeString(id.comment);
			});
		}
		break;
	case 'sign-response':
		buf.writeUInt8(14);
		assert.buffer(obj.signature, 'signature');
		buf.writeBuffer(obj.signature);
		break;
	case 'ext-failure':
		buf.writeUInt8(28);
		break;
	default:
		throw (new AgentProtocolError(util.format('Invalid outgoing ' +
		    'frame type: "%s"', obj.type)));
	}
	return (buf);
}

module.exports = {
	readClientFrame: readClientFrame,
	readAgentFrame: readAgentFrame,
	writeClientFrame: writeClientFrame,
	writeAgentFrame: writeAgentFrame
};


text:
<?php

namespace Http\Message;

/**
 * Factory for PSR-7 Request and Response.
 *
 * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
 */
interface MessageFactory extends RequestFactory, ResponseFactory
{
}


text:
package dhgarrette.typesupervisedtagging.run

import scala.annotation.tailrec

import dhgarrette.typesupervisedtagging.minmodel.ModelMinimizer
import dhgarrette.typesupervisedtagging.run.MinGreedy.TaggerTrainCommand
import opennlp.scalabha.tag.hmm.SemisupervisedHmmTaggerTrainer
import opennlp.scalabha.tag.hmm.SupervisedHmmTaggerTrainer
import opennlp.scalabha.tag.hmm.UnsupervisedHmmTaggerTrainer
import opennlp.scalabha.tag.support.CondCountsTransformer
import opennlp.scalabha.tag.support.TagDictFactory
import opennlp.scalabha.tag.ScoreResults
import opennlp.scalabha.tag.Tagger
import opennlp.scalabha.util.CollectionUtils._
import opennlp.scalabha.util.LogNum

class MinGreedy[Sym, Tag](
  taggerEvaluate: (Tagger[Sym, Tag], Map[Sym, Set[Tag]]) => ScoreResults[Sym, Tag] // evaluate a tagger and tag dict
  ) {

  val startEndTag = "<END>".asInstanceOf[Tag]
  def end(seq: IndexedSeq[Tag]) = startEndTag +: seq :+ startEndTag
  def makeGrammar(tagged: Iterable[IndexedSeq[(Sym, Tag)]]) = tagged.map(s => end(s.map(_._2)).sliding2).flatten.toSet.groupByKey

  def run(
    fullTagDict: Map[Sym, Set[Tag]],
    rawTrain: Iterable[IndexedSeq[Sym]],
    tagDictFactory: TagDictFactory[Sym, Tag],
    firstIterationTrainer: TaggerTrainCommandFactory[Sym, Tag],
    oddIterationTrainer: TaggerTrainCommandFactory[Sym, Tag],
    evenIterationTrainer: TaggerTrainCommandFactory[Sym, Tag],
    finalTrainerOpt: Option[TaggerTrainCommandFactory[Sym, Tag]],
    modelMinimizer: ModelMinimizer,
    pathTagsOnly: Boolean) {

    val (minChosen, minAutoTagged) = modelMinimizer.minTagPath(rawTrain.asInstanceOf[Iterable[IndexedSeq[String]]], fullTagDict.asInstanceOf[Map[String, Set[String]]]).asInstanceOf[(Map[Tag, Set[Tag]], List[List[(Sym, Tag)]])]
    val autoTagged = minAutoTagged.map(_.toIndexedSeq)

    val constrainedGrammar = if (pathTagsOnly) makeGrammar(autoTagged) else minChosen
    println("number of bigrams for use after minimization: " + constrainedGrammar.flattenOver.size)

    val (minGreedyTagger, results) =
      doIteration(1,
        firstIterationTrainer,
        oddIterationTrainer,
        evenIterationTrainer,
        constrainedGrammar,
        autoTagged,
        rawTrain,
        tagDictFactory,
        fullTagDict,
        1,
        Nil)

    finalTrainerOpt.foreach { finalTrainer =>
      val minGreedyTaggerAutoTagged = minGreedyTagger.tag(rawTrain)
      val constrainedGrammar = makeGrammar(minGreedyTaggerAutoTagged)
      val contrainedTagDict = tagDictFactory.make(minGreedyTaggerAutoTagged)
      println("Supervised training on MIN-GREEDY tagged output")
      val autosupervisedTagger = finalTrainer(None, fullTagDict, rawTrain).train(fullTagDict, null, minGreedyTaggerAutoTagged)
      taggerEvaluate(autosupervisedTagger, fullTagDict).toString.split("\n").map("      " + _).foreach(println)
    }
  }

  @tailrec
  private def doIteration(i: Int,
    odd: TaggerTrainCommandFactory[Sym, Tag],
    nextOdd: TaggerTrainCommandFactory[Sym, Tag],
    even: TaggerTrainCommandFactory[Sym, Tag],
    constrainedGrammar: Map[Tag, Set[Tag]],
    autoTagged: Iterable[IndexedSeq[(Sym, Tag)]],
    rawTrain: Iterable[IndexedSeq[Sym]],
    tagDictFactory: TagDictFactory[Sym, Tag],
    fullTagDict: Map[Sym, Set[Tag]],
    prevGrammarSize: Int,
    results: List[(List[String], ScoreResults[Sym, Tag])]): (Tagger[Sym, Tag], List[(List[String], ScoreResults[Sym, Tag])]) = {

    val (oddTagger, autoTaggedByOdd, _, oddConstrainedTagDict, oddResultString, oddResults) =
      iterationSide(i,
        "EM with grammar from previous + full dictionary",
        odd,
        Some(constrainedGrammar),
        fullTagDict,
        rawTrain,
        autoTagged,
        tagDictFactory,
        fullTagDict)

    val (evenTagger, autoTaggedByEven, newConstrainedGrammar, _, evnResultString, evnResults) =
      iterationSide(i + 1,
        "EM with full grammar + dictionary from previous",
        even,
        None,
        oddConstrainedTagDict,
        rawTrain,
        autoTaggedByOdd,
        tagDictFactory,
        fullTagDict)

    val grammarSize = newConstrainedGrammar.flattenOver.size
    println("grammarSize=%d, prevGrammarSize=%d, diff=%d, pct=%f".format(grammarSize, prevGrammarSize, math.abs(grammarSize - prevGrammarSize), math.abs(grammarSize - prevGrammarSize) * 100.0 / prevGrammarSize))

    if (math.abs(grammarSize - prevGrammarSize) * 100 / prevGrammarSize < 5) {
      (evenTagger, results)
    }
    else {
      doIteration(i + 2,
        nextOdd,
        nextOdd,
        even,
        newConstrainedGrammar,
        autoTaggedByEven,
        rawTrain,
        tagDictFactory,
        fullTagDict,
        grammarSize,
        results ++ List(
          (oddResultString, oddResults),
          (evnResultString, evnResults)))
    }
  }

  private def iterationSide(
    i: Int,
    desc: String,
    trainerFactory: TaggerTrainCommandFactory[Sym, Tag],
    constrainedGrammar: Option[Map[Tag, Set[Tag]]],
    tagDict: Map[Sym, Set[Tag]],
    rawTrain: Iterable[IndexedSeq[Sym]],
    autoTagged: Iterable[IndexedSeq[(Sym, Tag)]],
    tagDictFactory: TagDictFactory[Sym, Tag],
    fullTagDict: Map[Sym, Set[Tag]]) = {

    val tagger = trainerFactory(constrainedGrammar, tagDict, rawTrain).train(tagDict, rawTrain, autoTagged)
    val newAutoTagged = tagger.tag(rawTrain)
    val newConstrainedGrammar = makeGrammar(newAutoTagged)
    val newConstrainedTagDict = tagDictFactory.make(newAutoTagged)
    val results = taggerEvaluate(tagger, fullTagDict)

    val resultString = List(
      desc,
      "  Observed in tagging of raw data with EM-trained tagger: num tag bigrams = %d, tag dict size = %d".format(newConstrainedGrammar.flattenOver.size, newConstrainedTagDict.flattenOver.size),
      "    Test set eval; full grammar:")

    printResult(i, resultString, results)

    (tagger, newAutoTagged, newConstrainedGrammar, newConstrainedTagDict, resultString, results)
  }

  private def iterationSide_OLD(
    i: Int,
    desc: String,
    tagger: Tagger[Sym, Tag],
    tagDict: Map[Sym, Set[Tag]],
    rawTrain: Iterable[IndexedSeq[Sym]],
    tagDictFactory: TagDictFactory[Sym, Tag],
    fullTagDict: Map[Sym, Set[Tag]]) = {

    val autoTagged = tagger.tag(rawTrain)
    val constrainedGrammar = makeGrammar(autoTagged)
    val constrainedTagDict = tagDictFactory.make(autoTagged)
    val results = taggerEvaluate(tagger, fullTagDict)
    val resultString = List(
      desc,
      "  Observed in tagging of raw data with EM-trained tagger: num tag bigrams = %d, tag dict size = %d".format(constrainedGrammar.flattenOver.size, constrainedTagDict.flattenOver.size),
      "    Test set eval; full grammar:")

    printResult(i, resultString, results)

    (constrainedGrammar, constrainedTagDict, resultString, results)
  }

  private def printResult(i: Int, b: List[String], r: ScoreResults[Sym, Tag]) = {
    println
    println(i + ": ")
    b.foreach(println)
    r.toString.split("\n").map("    " + _).foreach(println)
  }

}

object MinGreedy {

  trait TaggerTrainCommand[Sym, Tag] {
    def train(
      tagDict: Map[Sym, Set[Tag]],
      rawTrainSequences: Iterable[IndexedSeq[Sym]],
      taggedTrainSequences: Iterable[IndexedSeq[(Sym, Tag)]]): Tagger[Sym, Tag]
  }

  case class UnsupervisedTaggerTrainCommand[Sym, Tag](
    initialUnsupervisedEmissionDist: Tag => Sym => LogNum,
    estimatedTransitionCountsTransformer: CondCountsTransformer[Tag, Tag],
    estimatedEmissionCountsTransformer: CondCountsTransformer[Tag, Sym],
    startEndSymbol: Sym,
    startEndTag: Tag,
    maxIterations: Int = 50,
    minAvgLogProbChangeForEM: Double = 0.00001)
    extends TaggerTrainCommand[Sym, Tag] {

    override def train(
      tagDict: Map[Sym, Set[Tag]],
      rawTrainSequences: Iterable[IndexedSeq[Sym]],
      taggedTrainSequences: Iterable[IndexedSeq[(Sym, Tag)]]): Tagger[Sym, Tag] = {

      val trainer =
        new UnsupervisedHmmTaggerTrainer(
          initialUnsupervisedEmissionDist,
          estimatedTransitionCountsTransformer,
          estimatedEmissionCountsTransformer,
          startEndSymbol,
          startEndTag,
          maxIterations,
          minAvgLogProbChangeForEM)
      trainer.trainUnsupervised(tagDict, rawTrainSequences)
    }
  }

  case class SemisupervisedTaggerTrainCommand[Sym, Tag](
    initialTransitionCountsTransformer: CondCountsTransformer[Tag, Tag],
    initialEmissionCountsTransformer: CondCountsTransformer[Tag, Sym],
    estimatedTransitionCountsTransformer: CondCountsTransformer[Tag, Tag],
    estimatedEmissionCountsTransformer: CondCountsTransformer[Tag, Sym],
    startEndSymbol: Sym,
    startEndTag: Tag,
    maxIterations: Int = 50,
    minAvgLogProbChangeForEM: Double = 0.00001)
    extends TaggerTrainCommand[Sym, Tag] {

    override def train(
      tagDict: Map[Sym, Set[Tag]],
      rawTrainSequences: Iterable[IndexedSeq[Sym]],
      taggedTrainSequences: Iterable[IndexedSeq[(Sym, Tag)]]): Tagger[Sym, Tag] = {

      val trainer =
        new SemisupervisedHmmTaggerTrainer(
          initialTransitionCountsTransformer,
          initialEmissionCountsTransformer,
          estimatedTransitionCountsTransformer,
          estimatedEmissionCountsTransformer,
          startEndSymbol,
          startEndTag,
          maxIterations,
          minAvgLogProbChangeForEM)
      trainer.trainSemisupervised(tagDict, rawTrainSequences, taggedTrainSequences)
    }
  }

  case class SupervisedTaggerTrainCommand[Sym, Tag](
    transitionCountsTransformer: CondCountsTransformer[Tag, Tag],
    emissionCountsTransformer: CondCountsTransformer[Tag, Sym],
    startEndSymbol: Sym,
    startEndTag: Tag)
    extends TaggerTrainCommand[Sym, Tag] {

    override def train(
      tagDict: Map[Sym, Set[Tag]],
      rawTrainSequences: Iterable[IndexedSeq[Sym]],
      taggedTrainSequences: Iterable[IndexedSeq[(Sym, Tag)]]): Tagger[Sym, Tag] = {

      val trainer =
        new SupervisedHmmTaggerTrainer(
          transitionCountsTransformer,
          emissionCountsTransformer,
          startEndSymbol,
          startEndTag)
      trainer.trainSupervised(taggedTrainSequences, tagDict)
    }
  }

}

trait TaggerTrainCommandFactory[Sym, Tag] {
  def apply(
    grammar: Option[Map[Tag, Set[Tag]]],
    tagDict: Map[Sym, Set[Tag]],
    rawTrainSequences: Iterable[IndexedSeq[Sym]]): TaggerTrainCommand[Sym, Tag]
}


text:
SYNONYM

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

#### Published in
Science, N. Y. 16: 138 (1902)

#### Original name
Arachniotus trachyspermus Shear, 1902

### Remarks
null


text:
class CreateSpreeReimbursements < ActiveRecord::Migration
  def change
    create_table :spree_reimbursements do |t|
      t.string :number
      t.string :reimbursement_status
      t.integer :customer_return_id
      t.integer :order_id
      t.decimal :total, precision: 10, scale: 2

      t.timestamps
    end

    add_index :spree_reimbursements, :customer_return_id
    add_index :spree_reimbursements, :order_id

    remove_column :spree_refunds, :customer_return_id, :integer
    add_column :spree_refunds, :reimbursement_id, :integer

    add_column :spree_return_items, :reimbursement_id, :integer
  end
end


text:
#import "RCTView.h"

/**
 * Special scheme used to pass messages to the injectedJavaScript
 * code without triggering a page load. Usage:
 *
 *   window.location.href = RCTJSNavigationScheme + '://hello'
 */
extern NSString *const RCTJSNavigationScheme;

@interface RCTWebView : RCTView

@property (nonatomic, strong) NSURL *URL;
@property (nonatomic, assign) NSEdgeInsets contentInset;
@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;
@property (nonatomic, copy) NSString *injectedJavaScript;

- (void)goForward;
- (void)goBack;
- (void)reload;

@end


text:
package pub.weber.bym.activitylifecycletest;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.Button;

import static android.R.attr.start;

public class MainActivity extends AppCompatActivity {

    public static final String TAG = "MainActivity --->>>> ";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG,"onCreate");
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_main);
        Button startNormalActivity = (Button) findViewById(R.id.start_normal_activity);
        final Button startDialogActivity = (Button) findViewById(R.id.start_dialog_activity);

        startNormalActivity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,NormalActivity.class);
                startActivity(intent);
            }
        });
        startDialogActivity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,DialogActivity.class);
                startActivity(intent);
            }
        });
    }

    @Override
    protected void onStart(){
        super.onStart();
        Log.d(TAG,"onStart");
    }

    @Override
    protected void onResume(){
        super.onResume();
        Log.d(TAG,"onResume");
    }

    @Override
    protected void onPause(){
        super.onPause();
        Log.d(TAG,"onPause");
    }

    @Override
    protected void onStop(){
        super.onStop();
        Log.d(TAG, "onStop");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d(TAG, "onDestroy");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.d(TAG, "onRestart");
    }
}


text:
layout:     post
title:      Sample Preparation
date:       2015-03-19 12:00:00
author:     Alicia White
---

To prepare the samples for indentation, the samples were first placed on an epoxy mount.  Then mechanical ploshing was done with 1200-4000 grit paper, lubricated with water for 1-2 mins each to remove the top layer of polymer found near the mold surface.  Then polishing was done with 1 um diamond suspension to remove scratches and create a uniform surface.
![3 um polish](https://db.tt/Wsg3cHbS)

This image shows a 3 um diamond suspension polsih which is very similar to the polish done with the higher grit papers.

![1 um polish](https://db.tt/HLJqYW1c)

This image shows the use of the 1 um polish to remove surface scatches.

As a final polish, ion polishing was done to provide as stress free a surface as possible.

![Ion polish](https://db.tt/c1icHHXB)


text:
/**
 * Caches membership of virtual users to rooms in memory
 * and also stores the state of whether users are registered.
 */
export type UserMembership = "join"|"invite"|"leave"|"ban"|null;
export type UserProfile = {
    displayname?: string;
    avatar_url?: string; // eslint-disable-line camelcase
}
export class MembershipCache {
    private membershipMap: {[roomId: string]: { [userId: string]: [UserMembership, UserProfile] }} = {};
    private registeredUsers = new Set<string>();

    /**
     * Gets the *cached* state of a user's membership for a room.
     * This DOES NOT check to verify the value is correct (i.e the
     * room may have state reset and left the user from the room).
     *
     * This only caches users from the appservice.
     *
     * @param roomId Room id to check the state of.
     * @param userId The userid to check the state of.
     * @returns The membership state of the user, e.g. "joined"
     */
    public getMemberEntry(roomId: string, userId: string): UserMembership {
        if (this.membershipMap[roomId] === undefined || this.membershipMap[roomId][userId] === undefined) {
            return null;
        }
        return this.membershipMap[roomId][userId][0];
    }

    /**
     * Gets the *cached* state of a user's membership for a room.
     * This DOES NOT check to verify the value is correct (i.e the
     * room may have state reset and left the user from the room).
     *
     * This only caches users from the appservice.
     *
     * @param roomId Room id to check the state of.
     * @param userId The userid to check the state of.
     * @returns The member's profile information.
     */
    public getMemberProfile(roomId: string, userId: string): UserProfile {
        if (this.membershipMap[roomId] === undefined || this.membershipMap[roomId][userId] === undefined) {
            return {};
        }
        return this.membershipMap[roomId][userId][1];
    }

    /**
     * Set the *cached* state of a user's membership for a room.
     * Use this to optimise intents so that they do not attempt
     * to join a room if we know they are joined.
     * This DOES NOT set the actual membership of the room.
     *
     * This only caches users from the appservice.
     * @param roomId Room id to set the state of.
     * @param userId The userid to set the state of.
     * @param membership The membership value to set for the user
     *                       e.g joined.
     */
    public setMemberEntry(roomId: string, userId: string, membership: UserMembership, profile: UserProfile): void {
        if (this.membershipMap[roomId] === undefined) {
            this.membershipMap[roomId] = {};
        }

        // Bans and invites do not mean the user exists.
        if (membership === "join" || membership === "leave") {
            this.registeredUsers.add(userId);
        }

        this.membershipMap[roomId][userId] = [membership, profile];
    }

    /**
     * Is a user considered registered with the homeserver.
     * @param userId A Matrix userId
     */
    public isUserRegistered(userId: string): boolean {
        return this.registeredUsers.has(userId);
    }

    public getMembersForRoom(roomId: string, filterFor?: UserMembership): string[]|null {
        if (!this.membershipMap[roomId]) {
            return null;
        }
        if (!filterFor) {
            return Object.keys(this.membershipMap[roomId]);
        }
        const members = [];
        for (const [userId, [membership]] of Object.entries(this.membershipMap[roomId])) {
            if (membership === filterFor) {
                members.push(userId);
            }
        }
        return members;
    }
}


text:
project_path: /web/_project.yaml
book_path: /web/fundamentals/_book.yaml
description: Learn how to soften and give weighting to your animations.

{# wf_updated_on: 2016-08-23 #}
{# wf_published_on: 2014-08-08 #}

# The Basics of Easing {: .page-title }

{% include "web/_shared/contributors/paullewis.html" %}

Nothing in nature moves linearly from one point to another. In reality, things tend to accelerate or decelerate as they move. Our brains are wired to expect this kind of motion, so when animating you should use this to your advantage. Natural motion makes your users feel more comfortable with your apps, which in turn leads to a better overall experience.

### TL;DR {: .hide-from-toc }
* Easing makes your animations feel more natural.
* Choose ease-out animations for UI elements.
* Avoid ease-in or ease-in-out animations unless you can keep them short; they tend to feel sluggish to end users.

In classic animation, the term for motion that starts slowly and accelerates is "slow in," and for motion that starts quickly and decelerates is "slow out." The terminology most commonly used on the web for these are "ease in" and "ease out," respectively. Sometimes the two are combined, which is called "ease in out." Easing, then, is really the process of making the animation less severe or pronounced.

## Easing keywords

CSS transitions and animations both let you [choose the kind of easing you want to use for your animations](choosing-the-right-easing). You can use keywords that affect the easing (or `timing`, as it's sometimes called) of the animation in question. You can also [go completely custom with your easing](custom-easing), which gives you a lot more freedom to express your app's personality.

Here are some of the keywords that you can use in CSS:

* `linear`
* `ease-in`
* `ease-out`
* `ease-in-out`

Source: [CSS Transitions, W3C](http://www.w3.org/TR/css3-transitions/#transition-timing-function-property)

You can also use a `steps` keyword, which allows you to create transitions that have discrete steps, but the keywords listed above are the most useful for creating animations that feel natural.

## Linear animations

Animations without any kind of easing are referred to as **linear**. A graph of a linear transition looks like this:

As time moves along, the value increases in equal amounts. With linear motion, things tend to feel robotic and unnatural, and this is something that users find jarring. Generally speaking, you should avoid linear motion.

Whether you're coding your animations using CSS or JavaScript, you'll find that there is always an option for linear motion.

[See a linear animation](https://googlesamples.github.io/web-fundamentals/fundamentals/design-and-ui/animations/box-move-linear.html){: target="_blank" .external }

To achieve the effect above with CSS, the code would look something like this:

    transition: transform 500ms linear;

## Ease-out animations

Easing out causes the animation to start more quickly than linear ones, and it also has deceleration at the end.

Easing out is typically the best for user interface work, because the fast start gives your animations a feeling of responsiveness, while still allowing for a natural slowdown at the end.

[See an ease-out animation](https://googlesamples.github.io/web-fundamentals/fundamentals/design-and-ui/animations/box-move-ease-out.html){: target="_blank" .external }

There are many ways to achieve an ease out effect, but the simplest is the `ease-out` keyword in CSS:

    transition: transform 500ms ease-out;

## Ease-in animations

Ease-in animations start slowly and end fast, which is the opposite of ease-out animations.

This kind of animation is like a heavy stone falling, where it starts slowly and hits the ground quickly with a deadening thump.

From an interaction point of view, however, ease-ins can feel a little unusual because of their abrupt end; things that move in the real world tend to decelerate rather than simply stopping suddenly. Ease-ins also have the detrimental effect of feeling sluggish when starting, which negatively impacts the perception of responsiveness in your site or app.

[See an ease-in animation](https://googlesamples.github.io/web-fundamentals/fundamentals/design-and-ui/animations/box-move-ease-in.html){: target="_blank" .external }

To use an ease-in animation, similarly to ease-out and linear animations, you can use its keyword:

    transition: transform 500ms ease-in;

## Ease-in-out animations

Easing both in and out is akin to a car accelerating and decelerating and, used judiciously, can provide a more dramatic effect than just easing out.

Do not use an overly long animation duration, because of the sluggishness of an ease-in start to the animation. Something in the range of 300-500ms is typically suitable, but the exact number depends heavily on the feel of your project. That said, because of the slow start, fast middle, and slow end, there is increased contrast in the animation, which can be quite satisfying for users.

[See an ease-in-out animation](https://googlesamples.github.io/web-fundamentals/fundamentals/design-and-ui/animations/box-move-ease-in-out.html){: target="_blank" .external }

To get an ease-in-out animation, you can use the `ease-in-out` CSS keyword:

    transition: transform 500ms ease-in-out;


text:
<?php

namespace Drupal\content_moderation\Plugin\Field;

use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityPublishedInterface;
use Drupal\Core\Field\FieldItemList;
use Drupal\Core\TypedData\ComputedItemListTrait;

/**
 * A computed field that provides a content entity's moderation state.
 *
 * It links content entities to a moderation state configuration entity via a
 * moderation state content entity.
 */
class ModerationStateFieldItemList extends FieldItemList {

  use ComputedItemListTrait {
    ensureComputedValue as traitEnsureComputedValue;
    get as traitGet;
  }

  /**
   * {@inheritdoc}
   */
  protected function computeValue() {
    $moderation_state = $this->getModerationStateId();
    // Do not store NULL values, in the case where an entity does not have a
    // moderation workflow associated with it, we do not create list items for
    // the computed field.
    if ($moderation_state) {
      // An entity can only have a single moderation state.
      $this->list[0] = $this->createItem(0, $moderation_state);
    }
  }

  /**
   * {@inheritdoc}
   */
  protected function ensureComputedValue() {
    // If the moderation state field is set to an empty value, always recompute
    // the state. Empty is not a valid moderation state value, when none is
    // present the default state is used.
    if (!isset($this->list[0]) || $this->list[0]->isEmpty()) {
      $this->valueComputed = FALSE;
    }
    $this->traitEnsureComputedValue();
  }

  /**
   * Gets the moderation state ID linked to a content entity revision.
   *
   * @return string|null
   *   The moderation state ID linked to a content entity revision.
   */
  protected function getModerationStateId() {
    $entity = $this->getEntity();

    /** @var \Drupal\content_moderation\ModerationInformationInterface $moderation_info */
    $moderation_info = \Drupal::service('content_moderation.moderation_information');
    if (!$moderation_info->shouldModerateEntitiesOfBundle($entity->getEntityType(), $entity->bundle())) {
      return NULL;
    }

    // Existing entities will have a corresponding content_moderation_state
    // entity associated with them.
    if (!$entity->isNew() && $content_moderation_state = $this->loadContentModerationStateRevision($entity)) {
      return $content_moderation_state->moderation_state->value;
    }

    // It is possible that the bundle does not exist at this point. For example,
    // the node type form creates a fake Node entity to get default values.
    // @see \Drupal\node\NodeTypeForm::form()
    $workflow = $moderation_info->getWorkFlowForEntity($entity);
    return $workflow ? $workflow->getTypePlugin()->getInitialState($entity)->id() : NULL;
  }

  /**
   * Load the content moderation state revision associated with an entity.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   The entity the content moderation state entity will be loaded from.
   *
   * @return \Drupal\content_moderation\Entity\ContentModerationStateInterface|null
   *   The content_moderation_state revision or FALSE if none exists.
   */
  protected function loadContentModerationStateRevision(ContentEntityInterface $entity) {
    $moderation_info = \Drupal::service('content_moderation.moderation_information');
    $content_moderation_storage = \Drupal::entityTypeManager()->getStorage('content_moderation_state');

    $revisions = \Drupal::service('entity.query')->get('content_moderation_state')
      ->condition('content_entity_type_id', $entity->getEntityTypeId())
      ->condition('content_entity_id', $entity->id())
      // Ensure the correct revision is loaded in scenarios where a revision is
      // being reverted.
      ->condition('content_entity_revision_id', $entity->isNewRevision() ? $entity->getLoadedRevisionId() : $entity->getRevisionId())
      ->condition('workflow', $moderation_info->getWorkflowForEntity($entity)->id())
      ->allRevisions()
      ->sort('revision_id', 'DESC')
      ->execute();
    if (empty($revisions)) {
      return NULL;
    }

    /** @var \Drupal\content_moderation\Entity\ContentModerationStateInterface $content_moderation_state */
    $content_moderation_state = $content_moderation_storage->loadRevision(key($revisions));
    if ($entity->getEntityType()->hasKey('langcode')) {
      $langcode = $entity->language()->getId();
      if (!$content_moderation_state->hasTranslation($langcode)) {
        $content_moderation_state->addTranslation($langcode);
      }
      if ($content_moderation_state->language()->getId() !== $langcode) {
        $content_moderation_state = $content_moderation_state->getTranslation($langcode);
      }
    }
    return $content_moderation_state;
  }

  /**
   * {@inheritdoc}
   */
  public function get($index) {
    if ($index !== 0) {
      throw new \InvalidArgumentException('An entity can not have multiple moderation states at the same time.');
    }
    return $this->traitGet($index);
  }

  /**
   * {@inheritdoc}
   */
  public function onChange($delta) {
    $this->updateModeratedEntity($this->list[$delta]->value);

    parent::onChange($delta);
  }

  /**
   * {@inheritdoc}
   */
  public function setValue($values, $notify = TRUE) {
    parent::setValue($values, $notify);

    if (isset($this->list[0])) {
      $this->valueComputed = TRUE;
    }
    // If the parent created a field item and if the parent should be notified
    // about the change (e.g. this is not initialized with the current value),
    // update the moderated entity.
    if (isset($this->list[0]) && $notify) {
      $this->updateModeratedEntity($this->list[0]->value);
    }
  }

  /**
   * Updates the default revision flag and the publishing status of the entity.
   *
   * @param string $moderation_state_id
   *   The ID of the new moderation state.
   */
  protected function updateModeratedEntity($moderation_state_id) {
    $entity = $this->getEntity();

    /** @var \Drupal\content_moderation\ModerationInformationInterface $content_moderation_info */
    $content_moderation_info = \Drupal::service('content_moderation.moderation_information');
    $workflow = $content_moderation_info->getWorkflowForEntity($entity);

    // Change the entity's default revision flag and the publishing status only
    // if the new workflow state is a valid one.
    if ($workflow && $workflow->getTypePlugin()->hasState($moderation_state_id)) {
      /** @var \Drupal\content_moderation\ContentModerationState $current_state */
      $current_state = $workflow->getTypePlugin()->getState($moderation_state_id);

      // This entity is default if it is new, the default revision state, or the
      // default revision is not published.
      $update_default_revision = $entity->isNew()
        || $current_state->isDefaultRevisionState()
        || !$content_moderation_info->isDefaultRevisionPublished($entity);

      $entity->isDefaultRevision($update_default_revision);

      // Update publishing status if it can be updated and if it needs updating.
      $published_state = $current_state->isPublishedState();
      if (($entity instanceof EntityPublishedInterface) && $entity->isPublished() !== $published_state) {
        $published_state ? $entity->setPublished() : $entity->setUnpublished();
      }
    }
  }

}


text:
module SshHelpers
  require 'net/ssh/test'
  include Net::SSH::Test

  def story_with_new_channel
    story do |session|
      channel = session.opens_channel
      yield channel
      channel.gets_close
      channel.sends_close
    end
  end

  def script
    Net::SSH::Test::Extensions::IO.with_test_extension do
      yield
      expect(socket.script.events).to be_empty, "there should not be any remaining scripted events, but there are still #{socket.script.events.length} pending"
    end
  end

  def script_with_connection
    script do
      allow(subject).to receive(:ssh_connection).and_return connection
      yield
    end
  end
end


text:
package report_test

import (
	"reflect"
	"testing"
	"time"

	"github.com/weaveworks/common/mtime"
	"github.com/weaveworks/common/test"
	"github.com/weaveworks/scope/report"
	s_reflect "github.com/weaveworks/scope/test/reflect"
)

func newu64(value uint64) *uint64 { return &value }

// Make sure we don't add a topology and miss it in the Topologies method.
func TestReportTopologies(t *testing.T) {
	var (
		reportType   = reflect.TypeOf(report.MakeReport())
		topologyType = reflect.TypeOf(report.MakeTopology())
	)

	var want, have int
	for i := 0; i < reportType.NumField(); i++ {
		if reportType.Field(i).Type == topologyType {
			want++
		}
	}

	r := report.MakeReport()
	r.WalkTopologies(func(_ *report.Topology) {
		have++
	})
	if want != have {
		t.Errorf("want %d, have %d", want, have)
	}
}

func TestReportTopology(t *testing.T) {
	r := report.MakeReport()
	if _, ok := r.Topology(report.Container); !ok {
		t.Errorf("Expected %s topology to be found", report.Container)
	}
	if _, ok := r.Topology("foo"); ok {
		t.Errorf("Expected %s topology not to be found", "foo")
	}
}

func TestNode(t *testing.T) {
	{
		node := report.MakeNodeWith("foo", map[string]string{
			"foo": "bar",
		})

		if v, _ := node.Latest.Lookup("foo"); v != "bar" {
			t.Errorf("want foo, have %s", v)
		}
	}
	{
		node := report.MakeNode("foo").AddCounter("foo", 1)
		if value, _ := node.LookupCounter("foo"); value != 1 {
			t.Errorf("want foo, have %d", value)
		}
	}
	{
		node := report.MakeNode("foo").WithAdjacent("foo")
		if node.Adjacency[0] != "foo" {
			t.Errorf("want foo, have %v", node.Adjacency)
		}
	}
}

func TestReportUpgrade(t *testing.T) {
	mtime.NowForce(time.Now())
	defer mtime.NowReset()
	parentsWithDeployment := report.MakeSets().Add(report.Deployment, report.MakeStringSet("id"))
	rsNode := report.MakeNode("bar").
		WithParents(parentsWithDeployment)
	namespaceName := "ns"
	namespaceID := report.MakeNamespaceNodeID(namespaceName)
	podNode := report.MakeNode("foo").
		WithLatests(map[string]string{report.KubernetesNamespace: namespaceName}).
		WithParents(report.MakeSets().Add(report.ReplicaSet, report.MakeStringSet("bar")))
	expectedPodNode := podNode.PruneParents().WithParents(parentsWithDeployment)
	rpt := report.MakeReport()
	rpt.ReplicaSet.AddNode(rsNode)
	rpt.Pod.AddNode(podNode)
	namespaceNode := report.MakeNode(namespaceID).
		WithLatests(map[string]string{report.KubernetesName: namespaceName})
	expected := report.MakeReport()
	expected.ReplicaSet.AddNode(rsNode)
	expected.Pod.AddNode(expectedPodNode)
	expected.Namespace.AddNode(namespaceNode)
	got := rpt.Upgrade()
	if !s_reflect.DeepEqual(expected, got) {
		t.Error(test.Diff(expected, got))
	}
}

func TestReportUnMerge(t *testing.T) {
	n1 := report.MakeNodeWith("foo", map[string]string{"foo": "bar"})
	r1 := makeTestReport()
	r2 := r1.Copy()
	r2.Container.AddNode(n1)
	// r2 should be the same as r1 with just the foo-bar node added
	r2.UnsafeUnMerge(r1)
	// Now r2 should have everything removed except that one node, and its ID
	expected := report.Report{
		ID: r2.ID,
		Container: report.Topology{
			Nodes: report.Nodes{
				"foo": n1,
			},
		},
	}

	// Now test report with two nodes unmerged on report with one
	r1.Container.AddNode(n1)
	r2 = r1.Copy()
	n2 := report.MakeNodeWith("foo2", map[string]string{"ping": "pong"})
	r2.Container.AddNode(n2)
	// r2 should be the same as r1 with one extra node
	r2.UnsafeUnMerge(r1)
	expected = report.Report{
		ID: r2.ID,
		Container: report.Topology{
			Nodes: report.Nodes{
				"foo2": n2,
			},
		},
	}

	if !s_reflect.DeepEqual(expected, r2) {
		t.Error(test.Diff(expected, r2))
	}
}


text: Your password has been changed successfully.


text:
module CloudFormer
  module SQS
    class QueuePolicy < Resource

      aws_property :policy_document, type: Hash, required: true
      aws_property :queues, type: String, list: true, required: true
    end
  end
end


text:
if( typeof module !== "undefined" && module.exports ) {
    module.exports = Runtime;
}
else if ( typeof define === "function" && define.amd && define.amd.attemplate ) {
    define( "Runtime", [], function () { return Runtime; } );
}
else if ( global ) {
    global.Runtime = Runtime;
}

})(this);


text:
exports.viewLogin2 = function(req, res){
  res.render('login2', {
  	layout: 'loginLayout2'
  });
};


text:
package edu.neu.ccs.pyramid.util;

import static org.junit.Assert.*;

public class GridTest {
    public static void main(String[] args) {
//        test1();
//        test2();
        test3();
    }

    private static void test1(){
        System.out.println(Grid.uniform(0,10,11));
        System.out.println(Grid.uniform(0,1,5));
    }

    private static void test2(){
        System.out.println(Grid.logUniform(0.1,10,3));
        System.out.println(Grid.logUniform(0.1,1000,5));
    }

    private static void test3(){
        System.out.println(Grid.uniformDecreasing(0,10,11));

    }
}


text:
'use strict';

const fetch = require('node-fetch');
const URL = require('url');

class RabbitManagement {
  constructor({ protocol, hostname, port, username, password, vhost }) {
    this.baseURL = URL.format({
      protocol,
      hostname,
      port,
      // Plugin rabbitmq_management API always lives under /api/
      // @see https://cdn.rawgit.com/rabbitmq/rabbitmq-management/v3.7.7/priv/www/api/index.html
      pathname: '/api',
    });

    // Create basic auth header.
    this.authHeader = Buffer(`${username}:${password}`).toString('base64');

    // Expose AMQP vhost for building correct API endpoints.
    this.vhost = vhost;
  }

  async getQueueInfo(queueName) {
    const endpoint = `/queues/${this.vhost}/${queueName}`;
    let response = {};
    try {
      response = await this.get(endpoint);
    } catch (error) {
      // Wrap HTTP exceptions in meaningful response.
      throw new Error(`Incorrect RabbitManagement.getQueueInfo() response for GET ${endpoint}: ${error.message}`);
    }
    return response;
  }

  async getExchangeInfo(exchangeName) {
    const endpoint = `/exchanges/${this.vhost}/${exchangeName}`;
    let response = {};
    try {
      response = await this.get(endpoint);
    } catch (error) {
      // Wrap HTTP exceptions in meaningful response.
      throw new Error(`Incorrect RabbitManagement.getExchangeInfo() response for GET ${endpoint}: ${error.message}`);
    }
    return response;
  }

  async getQueueBindings(queueName, exchangeName) {
    const endpoint = `/bindings/${this.vhost}/e/${exchangeName}/q/${queueName}`;
    const response = await this.get(endpoint);
    // API returns 200 and empty array when no bindings found.
    if (response.length < 1) {
      // Return false if queue is not bound to its exchange:
      // by design of this app a queue should have at least one valid route.
      return false;
    }
    return response;
  }

  async getMessagesFrom(queueName, count, requeue = true) {
    const endpoint = `/queues/${this.vhost}/${queueName}/get`;
    let response = {};
    try {
      response = await this.post(endpoint, {
        count,
        ackmode: requeue ? 'ack_requeue_true' : 'ack_requeue_false',
        encoding: 'auto',
      });
    } catch (error) {
      // Wrap HTTP exceptions in meaningful response.
      throw new Error(`Incorrect RabbitManagement.getMessagesFrom() response for GET ${endpoint}: ${error.message}`);
    }
    return response;
  }

  async get(endpoint) {
    const options = this.getFetchDefaults();
    const fullUrl = this.fullUri(endpoint);
    const response = await fetch(fullUrl, options);
    return RabbitManagement.handleFetchResponse(response);
  }

  async post(endpoint, data) {
    const options = this.getFetchDefaults();
    options.method = 'POST';
    options.body = JSON.stringify(data);

    const response = await fetch(this.fullUri(endpoint), options);
    return RabbitManagement.handleFetchResponse(response);
  }

  static handleFetchResponse(response) {
    // Tolerate "200 OK" responses only.
    if (response.status !== 200) {
      throw new Error(`RabbitManagement.handleFetchResponse(): HTTP status ${response.status}: ${response.statusText}`);
    }

    // Always expect correct 200 response to have JSON body.
    return response.json();
  }

  fullUri(endpoint) {
    return `${this.baseURL}${endpoint}`;
  }

  getFetchDefaults() {
    return {
      headers: {
        Authorization: `Basic ${this.authHeader}`,
      },
    };
  }
}

module.exports = RabbitManagement;


text:
<?php

namespace Google\Service\Docs;

class InsertTableRequest extends \Google\Model
{
  /**
   * @var int
   */
  public $columns;
  protected $endOfSegmentLocationType = EndOfSegmentLocation::class;
  protected $endOfSegmentLocationDataType = '';
  protected $locationType = Location::class;
  protected $locationDataType = '';
  /**
   * @var int
   */
  public $rows;

  /**
   * @param int
   */
  public function setColumns($columns)
  {
    $this->columns = $columns;
  }
  /**
   * @return int
   */
  public function getColumns()
  {
    return $this->columns;
  }
  /**
   * @param EndOfSegmentLocation
   */
  public function setEndOfSegmentLocation(EndOfSegmentLocation $endOfSegmentLocation)
  {
    $this->endOfSegmentLocation = $endOfSegmentLocation;
  }
  /**
   * @return EndOfSegmentLocation
   */
  public function getEndOfSegmentLocation()
  {
    return $this->endOfSegmentLocation;
  }
  /**
   * @param Location
   */
  public function setLocation(Location $location)
  {
    $this->location = $location;
  }
  /**
   * @return Location
   */
  public function getLocation()
  {
    return $this->location;
  }
  /**
   * @param int
   */
  public function setRows($rows)
  {
    $this->rows = $rows;
  }
  /**
   * @return int
   */
  public function getRows()
  {
    return $this->rows;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(InsertTableRequest::class, 'Google_Service_Docs_InsertTableRequest');


text:
require 'spec_helper'

describe 'ZabbixApi::Screens' do
  let(:screens_mock) { ZabbixApi::Screens.new(client) }
  let(:client) { double }

  describe '.method_name' do
    subject { screens_mock.method_name }

    it { is_expected.to eq 'screen' }
  end

  describe '.identify' do
    subject { screens_mock.identify }

    it { is_expected.to eq 'name' }
  end

  describe '.delete' do
    subject { screens_mock.delete(data) }

    let(:data) { { testidentify: 222 } }
    let(:result) { { 'screenids' => ['1'] } }
    let(:identify) { 'testidentify' }
    let(:method_name) { 'testmethod' }

    before do
      allow(screens_mock).to receive(:log)
      allow(screens_mock).to receive(:identify).and_return(identify)
      allow(screens_mock).to receive(:method_name).and_return(method_name)
      allow(client).to receive(:api_request).with(
        method: 'screen.delete',
        params: [data]
      ).and_return(result)
    end

    context 'when result is not empty' do
      it 'returns the id of first screen' do
        expect(subject).to eq 1
      end
    end

    context 'when result is empty' do
      let(:result) { [] }

      it { is_expected.to be_nil }
    end
  end

  describe '.get_or_create_for_host' do
    subject { screens_mock.get_or_create_for_host(data) }

    let(:data) { { screen_name: screen_name, graphids: graphids } }
    let(:screen_name) { 'testscreen' }
    let(:result) { { 'screenids' => ['1'] } }
    let(:graphids) { [2222] }
    let(:method_name) { 'testmethod' }
    let(:existing_screen_id) { 1212 }
    let(:newly_created_screen_id) { 3434 }

    before do
      allow(screens_mock).to receive(:get_id).with(name: screen_name).and_return(existing_screen_id)
    end

    context 'when screen already exist' do
      it 'returns the id of first screen' do
        expect(subject).to eq existing_screen_id
      end
    end

    context "when screen doesn't exist" do
      let(:existing_screen_id) { nil }
      let(:index) { 0 }
      let(:screenitems) do
        [
          {
            resourcetype: 0,
            resourceid: 2222,
            x: (index % hsize).to_i,
            y: (index % graphids.size / hsize).to_i,
            valign: valign,
            halign: halign,
            rowspan: rowspan,
            colspan: colspan,
            height: height,
            width: width
          }
        ]
      end

      before do
        allow(screens_mock).to receive(:create).with(
          name: screen_name,
          hsize: hsize,
          vsize: vsize,
          screenitems: screenitems
        ).and_return(newly_created_screen_id)
      end

      context 'when data do not have all value for request' do
        let(:hsize) { 3 }
        let(:valign) { 2 }
        let(:halign) { 2 }
        let(:rowspan) { 1 }
        let(:colspan) { 1 }
        let(:height) { 320 }
        let(:width) { 200 }
        let(:vsize) { [1, (graphids.size / hsize).to_i].max }

        it 'creates screen with default and rest of provided values' do
          expect(subject).to eq newly_created_screen_id
        end
      end

      context 'when data do not have all value for request' do
        let(:hsize) { 3 }
        let(:valign) { 2 }
        let(:halign) { 2 }
        let(:rowspan) { 1 }
        let(:colspan) { 1 }
        let(:height) { 320 }
        let(:width) { 200 }
        let(:vsize) { 5 }

        let(:data) do
          {
            screen_name: screen_name,
            graphids: graphids,
            hsize: hsize,
            valign: valign,
            halign: halign,
            rowspan: rowspan,
            colspan: colspan,
            height: height,
            width: width,
            vsize: vsize
          }
        end

        it 'creates screen with values provided in data' do
          expect(subject).to eq newly_created_screen_id
        end
      end
    end
  end
end


text:
*{padding:0px;margin:0px;}
body{
   margin:0px;
}

#left{
   width:188px;
   padding-left:10px;
   vertical-align:top;
   font-size:12px;
}

#left_top{
   width:188px;
}

.diary_icon{
   background:url('images/diary.jpg') left center no-repeat;
}
.address_icon{
   background:url('images/address.jpg') left center no-repeat;
}
.email_icon{
   background:url('images/email.jpg') left center no-repeat;
}
.sms_icon{
   height:0px !important;
   padding-top:0px !important;
}

.BlockTop{
   width:178px;
}
.BlockTop .center{
   text-align:left;
   color:#383838;
}

.BlockBottom{
   width:178px;
}
.BlockBottom .center{
   text-align:left;
   color:#383838;
}

.head{
   width:171px !important;
   width:178px;
   padding-left:5px;
   border-top:1px #5b99ca solid;
   border-left:1px #5b99ca solid;
   border-right:1px #5b99ca solid;
   background:#9ac5e8;
}

.container{
   width:176px !important;
   width:178px;
   border-left:1px #5b99ca solid;
   border-right:1px #5b99ca solid;
   overflow-x:auto;
}
.container div.a{
   display:block;
   height:20px;
   line-height:20px;
   padding-left:18px;
   color:#393939;
   background:url('images/dot.png') 5px center no-repeat;
}

.container .TableList{
   border:0px;
}

.container .TableList a{
   background:none;
}

.container .trHover{
   border:0px;
}
.container .trHover td.TableData,
.container .trHover .TableData td{
   border:0px;
   border-bottom:1px #cccccc solid;
   text-align:left;
   padding-left:21px;
   background-image:url('images/dot.png');
   background-position: 8px center;
   background-repeat:no-repeat;
}

.treeList{
   width:166px !important;
   width:178px;
   padding:5px;
}

a.header{
   display:block;
   height:32px;
   line-height:32px;
   color:#383838 !important;
   font-size:12px !important;
   font-weight:bold;
   padding-left:21px;
   background: url("images/ar.png") no-repeat 5px center;
}
a.header-active{
   background: url("images/arrow_d.png") no-repeat 5px center;
}

#right{
   vertical-align:top;
   height:100%;
}


text:
[![icon-256x256.png](/src/public/icon-256x256.png)](https://modspl.us)

Plan modules and meetings with your friends easily with [mods+](https://modspl.us).

# Group members

- Li Jia'En Nicholette (A0114535M): frontend, timetable, timeshare
- Ng Zhi An (A0099903R): pm, sync, offline
- Patrick Cho Chung Ting (A0065571A): backend, database, auth
- Tan Jia Min Michelle (A0112828H): frontend, design, team


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>ar.edu.ungs</groupId>
	<version>1.0.0</version>
	<artifactId>SiSaludSRL</artifactId>
	<name>SiSaludSRL</name>
	<description>Proceso Batch</description>

	<!-- Propiedades Generales -->
	<properties>
		<!-- Propiedades de Maven -->
		<maven.eclipse.plugin.framework.version>2.10</maven.eclipse.plugin.framework.version>
		<org.apache.maven.plugins.maven-javadoc-plugin.version>2.10.3</org.apache.maven.plugins.maven-javadoc-plugin.version>
		<org.apache.maven.plugins.maven-surefire-plugin.version>2.19.1</org.apache.maven.plugins.maven-surefire-plugin.version>
		<org.apache.maven.plugins.maven-compiler-plugin.version>2.3.2</org.apache.maven.plugins.maven-compiler-plugin.version>
		<org.apache.maven.plugins.maven-resources-plugin.version>2.4.3</org.apache.maven.plugins.maven-resources-plugin.version>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>

		<!-- Juego de Caracteres -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

		<!-- Versión de Java para Compilación -->
		<java.compile.version>1.8</java.compile.version>

		<!-- Módulos de Spring -->
		<spring.framework.version>4.0.3.RELEASE</spring.framework.version>
		<org.springmodules.spring-modules-jakarta-commons>0.8</org.springmodules.spring-modules-jakarta-commons>

		<!-- Injección de Dependencias -->
		<javax.inject.version>1</javax.inject.version>

		<!-- Módulos Hibernate (Persistencia) -->
		<org.hibernate.version>5.0.1.Final</org.hibernate.version>
		<org.hibernate.javax.persistence.version>1.0.0.Final</org.hibernate.javax.persistence.version>

 		<!-- Poi -->
        <poi.version>3.14</poi.version>

		<!-- Provider de Eclipse -->
		<org.eclipse.persistence.eclipselink.version>2.5.2</org.eclipse.persistence.eclipselink.version>

		<!-- Driver de Oracle -->
		<com.oracle.ojdbc6.version>11.2.0.3</com.oracle.ojdbc6.version>

		<!-- Utilerías de Apache -->
		<commons-lang.version>2.6</commons-lang.version>

		<!-- Log4j -->
		<log4j.version>1.2.17</log4j.version>

		<!-- Junit Test Unitarios -->
		<junit.framework.version>4.12</junit.framework.version>
	</properties>

	<!-- Dependencias -->
	<dependencies>
		<!-- Javax: Inyección de Dependencias -->
		<dependency>
			<groupId>javax.inject</groupId>
			<artifactId>javax.inject</artifactId>
			<version>${javax.inject.version}</version>
		</dependency>

		<!-- Utilerías de Apache -->
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>${commons-lang.version}</version>
		</dependency>

		<!-- Log4j -->
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>${log4j.version}</version>
		</dependency>

		<!-- Hibernate Persistence: JPA 2.1 -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>${org.hibernate.version}</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-entitymanager</artifactId>
			<version>${org.hibernate.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.hibernate.javax.persistence</groupId>
					<artifactId>hibernate-jpa-2.0-api</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.hibernate.javax.persistence</groupId>
			<artifactId>hibernate-jpa-2.1-api</artifactId>
			<version>${org.hibernate.javax.persistence.version}</version>
		</dependency>

 		<!-- Poi -->
        <dependency>
		    <groupId>org.apache.poi</groupId>
		    <artifactId>poi</artifactId>
		    <version>${poi.version}</version>
		</dependency>

		<dependency>
		    <groupId>org.apache.poi</groupId>
		    <artifactId>poi-ooxml</artifactId>
		    <version>${poi.version}</version>
		</dependency>

		<dependency>
		    <groupId>org.apache.xmlbeans</groupId>
		    <artifactId>xmlbeans</artifactId>
		    <version>2.6.0</version>
		</dependency>

		<dependency>
    		<groupId>org.apache.poi</groupId>
		    <artifactId>poi-ooxml-schemas</artifactId>
		    <version>${poi.version}</version>
		</dependency>

		<!-- Eclipse Provider de JPA -->
		<dependency>
			<groupId>org.eclipse.persistence</groupId>
			<artifactId>eclipselink</artifactId>
			<version>${org.eclipse.persistence.eclipselink.version}</version>
		</dependency>

		<!-- Driver de MySql -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.6</version>
		</dependency>

		<!-- Modulos de Spring -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aop</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aspects</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springmodules</groupId>
			<artifactId>spring-modules-jakarta-commons</artifactId>
			<version>${org.springmodules.spring-modules-jakarta-commons}</version>
		</dependency>

		<!-- Junit (Test Unitarios) -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
			<version>${junit.framework.version}</version>
		</dependency>

		<!-- Envio de Mail -->
		<dependency>
			<groupId>javax.mail</groupId>
			<artifactId>mail</artifactId>
			<version>1.4</version>
		</dependency>

		<!-- Calendario -->
		<dependency>
			<groupId>org.jdatepicker</groupId>
			<artifactId>jdatepicker</artifactId>
			<version>1.3.4</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/com.toedter/jcalendar -->
		<dependency>
			<groupId>com.toedter</groupId>
			<artifactId>jcalendar</artifactId>
			<version>1.4</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports -->
		<dependency>
		    <groupId>net.sf.jasperreports</groupId>
		    <artifactId>jasperreports</artifactId>
		    <version>6.0.4</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.swinglabs/swingx -->
		<dependency>
		    <groupId>org.swinglabs</groupId>
		    <artifactId>swingx</artifactId>
		    <version>1.6.1</version>
		</dependency>

		<!-- SteelSeries -->
		<dependency>
		    <groupId>eu.hansolo</groupId>
		    <artifactId>SteelSeries</artifactId>
		    <version>3.9.30</version>
		</dependency>

		<!-- JFXtras
		<dependency>
			<groupId>org.jfxtras</groupId>
			<artifactId>jfxtras-labs</artifactId>
			<version>8.0-r5</version>
		</dependency>

		<dependency>
			<groupId>org.jfxtras</groupId>
			<artifactId>jfxtras-gauge-linear</artifactId>
			<version>8.0-r5</version>
		</dependency>-->

	</dependencies>

	<!-- Compilación -->
	<build>
		<plugins>
			<!-- Plugin de Eclipse -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<executions>
					<execution>
						<id>a</id>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<finalName>SiSaludDesktop</finalName>
							<archive>
								<manifest>
									<addClasspath>true</addClasspath>
									<mainClass>ar.edu.ungs.core.MainProcess</mainClass>
									<classpathPrefix>dependency-jars/</classpathPrefix>
								</manifest>
								<manifestEntries>
			                        <Class-Path>extra-resources/</Class-Path>
			                    </manifestEntries>
							</archive>
							<excludes>
					          <exclude>**/datasource.properties</exclude>
					          <exclude>**/smtp.properties</exclude>
					        </excludes>
						</configuration>
					</execution>
					<execution>
						<id>b</id>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<finalName>SiSaludDaemon</finalName>
							<archive>
								<manifest>
									<addClasspath>true</addClasspath>
									<mainClass>ar.edu.ungs.core.DaemonProcess</mainClass>
									<classpathPrefix>dependency-jars/</classpathPrefix>
								</manifest>
								<manifestEntries>
			                        <Class-Path>extra-resources/</Class-Path>
			                    </manifestEntries>
							</archive>
							<excludes>
					          <exclude>**/datasource.properties</exclude>
					          <exclude>**/smtp.properties</exclude>
					        </excludes>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- Plugin para Java Doc -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>${org.apache.maven.plugins.maven-javadoc-plugin.version}</version>
			</plugin>

			<!-- Runner de los Test Unitarios. Si skipTests es true, no se ejecutarán
				los Test Unitarios -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>${org.apache.maven.plugins.maven-surefire-plugin.version}</version>
				<configuration>
					<skipTests>false</skipTests>
				</configuration>
			</plugin>

		<plugin>
		    <groupId>org.apache.maven.plugins</groupId>
		    <artifactId>maven-dependency-plugin</artifactId>
		    <executions>
		        <execution>
		            <id>copy-dependencies</id>
		            <phase>package</phase>
		            <goals>
		                <goal>copy-dependencies</goal>
		            </goals>
		            <configuration>
		                <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
		                <overWriteReleases>false</overWriteReleases>
		                <overWriteSnapshots>false</overWriteSnapshots>
		                <overWriteIfNewer>true</overWriteIfNewer>
		            </configuration>
		        </execution>
		    </executions>
		</plugin>

			<!-- Compilación del Proyecto -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${org.apache.maven.plugins.maven-compiler-plugin.version}</version>
				<configuration>
					<encoding>${project.build.sourceEncoding}</encoding>
				</configuration>
			</plugin>

			<!-- Copia Recursos del Proyecto al Directorio de Salida -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>${org.apache.maven.plugins.maven-resources-plugin.version}</version>
				<configuration>
					<encoding>${project.build.sourceEncoding}</encoding>
				</configuration>
			</plugin>

			<plugin>
		        <artifactId>maven-resources-plugin</artifactId>
		        <version>3.0.2</version>
		        <executions>
		          <execution>
		            <id>copy-resources</id>
		            <!-- here the phase you need -->
		            <phase>validate</phase>
		            <goals>
		              <goal>copy-resources</goal>
		            </goals>
		            <configuration>
		              <outputDirectory>${project.build.directory}/extra-resources/</outputDirectory>
		              <resources>
		                <resource>
		                  <directory>src/main/resources</directory>
		                     <includes>
					          <include>datasource.properties</include>
					          <include>smtp.properties</include>
					        </includes>
		                </resource>
		              </resources>
		            </configuration>
		          </execution>
		        </executions>
		      </plugin>
		</plugins>
		<finalName>SiSaludSRL</finalName>
	</build>
</project>


text:
@interface VPNConnect : NSObject {
	NSAppleScript *vpnGlue;
}

- (BOOL) connectionExists:(NSString *) name type:(NSString *)vpnType;
- (BOOL) createVPNConnection:(NSDictionary *) creationOptions;
- (BOOL) editVPNConnection:(NSDictionary *) creationOptions;
- (NSString *) connectVPN:(NSString *)name username:(NSString *)uname password:(NSString *)pword;
- (BOOL) connectionStatus:(NSString *)name;

@end


text:
package gang.com.screencontrol.input;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xiaogangzai on 2017/8/16.
 */

public class Global_public {
    //层当中对应的最大Zoder
    public static int Maxzoder;

    //存主机地址的list
    public static List<String> slaveip_list=new ArrayList<>();

    //存主机登录ip地址
    public static String ip;

    //存主机登录端口号
    public static String post;

    //存用户名
    public static String username;

    //存密码
    public static String password;
}