text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
using Azure.ResourceManager.Monitor.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Monitor;
using Azure.ResourceManager.Resources.Models;
using NUnit.Framework;
using Azure.Core;
using System;

namespace Azure.ResourceManager.Monitor.Tests
{
    public static class ResourceDataHelper
    {
        private const string dummySSHKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com";

        // Temporary solution since the one in Azure.ResourceManager.Monitor is internal
        public static IDictionary<string, string> ReplaceWith(this IDictionary<string, string> dest, IDictionary<string, string> src)
        {
            dest.Clear();
            foreach (var kv in src)
            {
                dest.Add(kv);
            }

            return dest;
        }

        public static void AssertTrackedResource(TrackedResourceData r1, TrackedResourceData r2)
        {
            Assert.AreEqual(r1.Name, r2.Name);
            Assert.AreEqual(r1.Id, r2.Id);
            Assert.AreEqual(r1.ResourceType, r2.ResourceType);
            Assert.AreEqual(r1.Location, r2.Location);
            Assert.AreEqual(r1.Tags, r2.Tags);
        }
        #region ActionGroup
        public static void AssertActionGroup(ActionGroupData group1, ActionGroupData group2)
        {
            AssertTrackedResource(group1, group2);
            Assert.AreEqual(group1.AzureFunctionReceivers, group2.AzureFunctionReceivers);
        }

        public static ActionGroupData GetBasicActionGroupData(AzureLocation location)
        {
            var data = new ActionGroupData(location)
            {
                EmailReceivers =
                {
                    new MonitorEmailReceiver("name", "a@b.c")
                },
                IsEnabled = true,
                GroupShortName = "name"
            };
            return data;
        }
        #endregion

        #region ActivityLogAlert
        public static void AssertActivityLogAlert(ActivityLogAlertData data1, ActivityLogAlertData data2)
        {
            AssertTrackedResource(data1, data2);
            Assert.AreEqual(data1.Description, data2.Description);
        }

        public static ActivityLogAlertData GetBasicActivityLogAlertData(AzureLocation location, string subID)
        {
            var data = new ActivityLogAlertData(location)
            {
                Scopes =
                {
                    subID
                },
                ConditionAllOf = new List<ActivityLogAlertAnyOfOrLeafCondition>()
                {
                    new()
                    {
                        Field = "category",
                        EqualsValue = "Administrative"
                    },
                    new()
                    {
                        Field = "level",
                        EqualsValue = "Error"
                    }
                }
            };
            return data;
        }
        #endregion

        #region AlertRule
        public static void AssertAlertRule(AlertRuleData data1, AlertRuleData data2)
        {
            AssertTrackedResource(data1, data2);
            Assert.AreEqual(data1.Description, data2.Description);
        }

        public static AlertRuleData GetBasicAlertRuleData(AzureLocation location)
        {
            var ruleWebhookAction = new RuleWebhookAction()
            {
                ServiceUri = new Uri("https://www.contoso.com/alerts?type=HighCPU"),
                Properties = { new KeyValuePair<string, string>("key1", "value1") }
            };
            //RuleMetricDataSource ruleDataSource = new RuleMetricDataSource(
            //    "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
            //    "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/Default-EventHub-1375/providers/Microsoft.EventHub/namespaces/sdk-eventhub-Namespace-8280",
            //    "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/Default-EventHub-1375/providers/microsoft.insights/metricalerts/testAlertRule",
            //    "global",
            //    "Microsoft.EventHub/namespaces",
            //    "ActiveConnections");
            RuleMetricDataSource ruleDataSource = new RuleMetricDataSource()
            {
                //LegacyResourceId = "",
                MetricName = "testrulemetric",
                MetricNamespace = "Microsoft.Compute/virtualMachines",
                ResourceLocation = location,
                ResourceId = new ResourceIdentifier("/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/deleteme0122/providers/Microsoft.Compute/virtualMachines/MetricAlertActionTestVM01")
            };
            //var ruleCondition = new ThresholdRuleCondition(
            //    "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
            //    ruleDataSource,
            //    ConditionOperator.GreaterThan,
            //    3.0,
            //    TimeSpan.FromMinutes(15),
            //    TimeAggregationOperator.Average);
            var ruleCondition = new ThresholdRuleCondition(MonitorConditionOperator.GreaterThan, 3.0)
            {
                WindowSize = TimeSpan.FromMinutes(15),
                TimeAggregation = ThresholdRuleConditionTimeAggregationType.Average,
                DataSource = ruleDataSource
            };
            var data = new AlertRuleData(location, "testAlertRule", true, ruleCondition)
            {
                Actions = { ruleWebhookAction }
            };
            return data;
        }
        #endregion

        #region AutoscaleSetting
        public static void AssertAutoscaleSetting(AutoscaleSettingData setting1, AutoscaleSettingData setting2)
        {
            AssertTrackedResource(setting1, setting2);
            Assert.AreEqual(setting1.AutoscaleSettingName, setting2.AutoscaleSettingName);
        }

        public static AutoscaleSettingData GetBasicAutoscaleSettingData(AzureLocation location)
        {
            var fixDate = new MonitorTimeWindow(DateTime.Parse("2014-04-15T21:06:11.7882792Z"), DateTime.Parse("2014-04-15T21:06:11.7882792Z"))
            {
                TimeZone = "UTC"
            };
            var Schedule = new RecurrentSchedule("UTC-11", new MonitorDayOfWeek[] { "Monday" }, new[] { 0 }, new[] { 10 });
            var recurrence = new MonitorRecurrence(RecurrenceFrequency.Week, Schedule);
            var scaleCapacity = new MonitorScaleCapacity(1, 1, 1);
            var metricTrigger = new MetricTrigger("AbandonMessage", new ResourceIdentifier("/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testservicebusRG-9432/providers/Microsoft.ServiceBus/namespaces/testnamespacemgmt7892"), TimeSpan.FromMinutes(1), MetricStatisticType.Average, TimeSpan.FromMinutes(10), MetricTriggerTimeAggregationType.Average, MetricTriggerComparisonOperation.GreaterThan, 70)
            {
                MetricNamespace = "microsoft.servicebus/namespaces",
                MetricResourceLocation = AzureLocation.EastUS2,
                IsDividedPerInstance = false
            };
            var rules = new List<AutoscaleRule>()
                {
                    new(
                        metricTrigger,
                        new MonitorScaleAction(MonitorScaleDirection.Increase, MonitorScaleType.ServiceAllowedNextValue, TimeSpan.FromMinutes(5)) { Value = "1" }
                    )
                };
            var profiles = new List<AutoscaleProfile>()
                {
                    //new AutoscaleProfile("Profiles2", scaleCapacity, rules)
                    new AutoscaleProfile("Profiles2", scaleCapacity, rules, fixDate, null),
                    new AutoscaleProfile("Profiles3", scaleCapacity, rules,null, recurrence),
                };
            var data = new AutoscaleSettingData(location, profiles)
            {
                IsEnabled = true,
                TargetResourceLocation = location,
                TargetResourceId = new ResourceIdentifier("/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testservicebusRG-9432/providers/Microsoft.ServiceBus/namespaces/testnamespacemgmt7892"),
                /*Notifications =
                {
                    new AutoscaleNotification()
                    {
                        Operation = "Scale",
                        Email = new EmailNotification()
                        {
                            SendToSubscriptionAdministrator = true,
                            SendToSubscriptionCoAdministrators = true,
                            CustomEmails =
                            {
                                "gu@ms.com",
                                "ge@ns.net"
                            }
                        },
                        Webhooks =
                        {
                            new WebhookNotification()
                            {
                                ServiceUri = "http://myservice.com",
                                Properties = {}
                            }
                        }
                    },
                },*/
                Tags = { },
            };
            return data;
        }
        #endregion

        #region DiagnosticSettings
        public static void AssertDiagnosticSetting(DiagnosticSettingData data1, DiagnosticSettingData data2)
        {
            //AssertTrackedResource(data1, data2);
            Assert.AreEqual(data1.Id, data2.Id);
            Assert.AreEqual(data1.Name, data2.Name);
        }

        public static DiagnosticSettingData GetBasicDiagnosticSettingsData()
        {
            var data = new DiagnosticSettingData()
            {
                StorageAccountId = new ResourceIdentifier("/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/lockformonitor/providers/Microsoft.Storage/storageAccounts/testaccountforlog2"),
                //ServiceBusRuleId = "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testservicebusRG-9432/providers/Microsoft.ServiceBus/namespaces/testnamespacemgmt7892/AuthorizationRules/testfordiagnostic",
                //EventHubAuthorizationRuleId = "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/Default-EventHub-1375/providers/Microsoft.EventHub/namespaces/sdk-eventhub-Namespace-8280/eventhubs/testfordiagnosticsetting/authorizationRules/testfordiagonst",
                //EventHubName = "myeventhub",
                //WorkspaceId = "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/default-eventhub-1375/providers/microsoft.operationalinsights/workspaces/myworkspace",
                LogAnalyticsDestinationType = "Dedicated",
                Metrics =
                {
                    new MetricSettings(true)
                {
                    Category = "WorkflowMetrics",
                    RetentionPolicy = new RetentionPolicy(false, 0),
                }
                },
                Logs =
                {
                    new LogSettings(true)
                {
                    Category = "Alert",
                    RetentionPolicy= new RetentionPolicy(false, 0)
                }
                }
            };
            //var data = new DiagnosticSettingsData(ResourceIdentifier.Root, "mysetting", "Microsoft.Insights/diagnosticSettings", "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/teststorageRG-5335/providers/Microsoft.Storage/storageAccounts/teststoragemgmt8010", "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testservicebusRG-9432/providers/Microsoft.ServiceBus/namespaces/testnamespacemgmt7892", "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/default-eventhub-1375/providers/microsoft.eventhub/namespaces/testnamespacemgmt1412", "myeventhub", metricSettings, logSettings, "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", "Dedicated");
            return data;
        }
        #endregion

        #region LogProfile
        public static void AssertLogProfile(LogProfileData data1, LogProfileData data2)
        {
            AssertTrackedResource(data1, data2);
            Assert.AreEqual(data1.ServiceBusRuleId, data2.ServiceBusRuleId);
        }

        public static LogProfileData GetBasicLogProfileData(AzureLocation location)
        {
            var locations = new List<AzureLocation>()
            {
                "global",
                "eastus"
            };
            var categories = new List<string>()
            {
                "Delete",
                "write"
            };
            RetentionPolicy retentionPolicy = new RetentionPolicy(true, 4);
            var data = new LogProfileData(location, locations, categories, retentionPolicy)
            {
                //ServiceBusRuleId = "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testservicebusRG-9432/providers/Microsoft.ServiceBus/namespaces/testnamespacemgmt7892",
                StorageAccountId = new ResourceIdentifier("/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/deleteme0122/providers/Microsoft.Storage/storageAccounts/testlogaccount0129")
            };
            return data;
        }
        #endregion

        #region MetricAlert
        public static void AssertMetricAlert(MetricAlertData data1, MetricAlertData data2)
        {
            AssertTrackedResource(data1, data2);
            Assert.AreEqual(data1.Description, data2.Description);
        }

        public static MetricAlertData GetBasicMetricAlertData(AzureLocation location, ActionGroupResource actionGroup)
        {
            IEnumerable<string> scopes = new List<string>()
            {
                "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/deleteme0122/providers/Microsoft.Compute/virtualMachines/MetricAlertActionTestVM01",
                // "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/deleteme0122/providers/Microsoft.Compute/virtualMachines/MetricAlertActionTestVM02"
            };
            var metricAlertAction = new MetricAlertAction()
            {
                ActionGroupId = actionGroup.Id,
                WebHookProperties = { new KeyValuePair<string, string>("key1", "value1") }
            };
            var metricCriteria = new MetricCriteria("High_CPU_80", "Percentage CPU", MetricCriteriaTimeAggregationType.Average, MetricCriteriaOperator.GreaterThan, 80.50) { };
            return new MetricAlertData(
                location,
                3,
                true,
                scopes,
                new TimeSpan(0, 1, 0),
                new TimeSpan(0, 5, 0),
                new MetricAlertSingleResourceMultipleMetricCriteria() { AllOf = { metricCriteria } })
            { Actions = { metricAlertAction } };
        }
        #endregion
    }
}


text:
/* globals PruneCluster, PruneClusterForLeaflet */
/**
 * Exports the PruneCluster library.
 *
 * See [PruneCluster](https://github.com/SINTEF-9012/PruneCluster)
 * documentation for more details about this plugin.
 *
 * @alternateClassName PruneCluster
 * @alternateClassName ext.kartographer.prunecluster
 * @class Kartographer.PruneCluster
 * @singleton
 */
module.exports = {
	/**
	 * @type {PruneCluster}
	 */
	PruneCluster: PruneCluster,

	/**
	 * See [PruneClusterForLeaflet](https://github.com/SINTEF-9012/PruneCluster#pruneclusterforleaflet-constructor)
	 * documentation for more details about this class.
	 *
	 * @type {PruneClusterForLeaflet}
	 */
	PruneClusterForLeaflet: PruneClusterForLeaflet
};

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using SlackConnector.Models;

namespace Noobot.Core.Extensions
{
    internal static class UserDictionaryExtensions
    {
        public static IReadOnlyDictionary<string, SlackUser> WithEmailSet(
            this IReadOnlyDictionary<string, SlackUser> userCache)
        {
            return userCache.Where(x => x.Value.Email != null)
                .ToDictionary(z => z.Key, z => z.Value);
        }

        public static SlackUser FindByEmail(
            this IReadOnlyDictionary<string, SlackUser> userCache,
            string email)
        {
            return userCache
                .FirstOrDefault(x => (x.Value.Email ?? "").Equals(email, StringComparison.OrdinalIgnoreCase)).Value;
        }
    }
}


text:
package com.harmazing.openbridge.paasos.resource.service.impl;

import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.harmazing.framework.common.Page;
import com.harmazing.framework.util.ConfigUtil;
import com.harmazing.framework.util.PaasAPIUtil;
import com.harmazing.framework.util.PaasAPIUtil.DataType;
import com.harmazing.framework.util.StringUtil;
import com.harmazing.openbridge.paas.util.StorageUtil;
import com.harmazing.openbridge.paasos.manager.model.vo.ResourceQuota;
import com.harmazing.openbridge.paasos.project.model.vo.TwoTuple;
import com.harmazing.openbridge.paasos.resource.dao.PaasRedisMapper;
import com.harmazing.openbridge.paasos.resource.model.PaasRedis;
import com.harmazing.openbridge.paasos.resource.service.IPaasRedisService;
import com.harmazing.openbridge.paasos.resource.util.ResourceQuotaUtil;

@Service
public class PaasRedislServiceImpl implements IPaasRedisService {
	@Autowired
	private PaasRedisMapper redisMapper;

	private Map<String,Object> lock = Collections.synchronizedMap(new HashMap<String,Object>());

	private String getPassRedisRestUrlPrefix(){
		String paasOsRestfulUrl = ConfigUtil.getConfigString("paasos.resRestfulUrl");
		StringBuilder paasRestfulFinalUrl = new StringBuilder(paasOsRestfulUrl);
		if(!StringUtil.endsWithIgnoreCase(paasOsRestfulUrl, "/")){
			paasRestfulFinalUrl.append("/");
		}
		paasRestfulFinalUrl.append("db/redis/instances");
		return paasRestfulFinalUrl.toString();
	}

	@Override
	@Transactional(readOnly = true)
	public List<PaasRedis> queryPaasRedissByParams(Map<String, Object> params) {
		Page<PaasRedis> PaasRedis = Page.create(params);
		PaasRedis.setRecordCount(redisMapper.QueryPaasRedissByParamsCount(params));
		PaasRedis.addAll(redisMapper.QueryPaasRedissByParams(params));
		return PaasRedis;
	}

	@Override
//	@Transactional(propagation = Propagation.REQUIRED)
	public void addPaasRedisResource(PaasRedis redis) {

		if(redis.getMemory()==null){
			JSONObject mysqlConfig = JSONObject.parseObject(redis.getApplyContent());
			String memory = mysqlConfig.getString("memory");
			redis.setMemory(StorageUtil.getMemory(memory));
		}

		ResourceQuota apply = new ResourceQuota();
		apply.setCpu(redis.getCpu());
		apply.setMemory(redis.getMemory());
		apply.setStorage(redis.getStorage());
		apply.setCount(1L);

		if(!lock.containsKey(redis.getTenantId())){
			lock.put(redis.getTenantId(), new Object());
		}

		synchronized(lock.get(redis.getTenantId())){
			Map<String, Object> params = new HashMap<String, Object>();
			params.put("tenantId", redis.getTenantId());
			ResourceQuota used = redisMapper.getAlreadyUsed(params);
			TwoTuple<Boolean, String> result = ResourceQuotaUtil.isSatisfy(apply, used, null, false,
					redis.getEnvType(), redis.getTenantId(), "cache","redis");
			if(!result.a){
				throw new RuntimeException("租户配额不足:"+result.b);
			}

			redisMapper.addPaasRedis(redis);
			addPaasRedisValRest(redis);
		}

	}

	/**
	 * 新开事务发起rest请求创建Redis
	 * @param redis
	 */
	@Transactional(propagation = Propagation.REQUIRES_NEW)
	private void addPaasRedisValRest(PaasRedis redis){
		String restResponse = "";
		try {
			String paasOsRestfulUrl = getPassRedisRestUrlPrefix();
			Map<String,String> headers = new HashMap<String,String>();
			headers.put("paasos-user-id", redis.getCreater());
			headers.put("paasos-tenant-id", redis.getTenantId());
			restResponse = PaasAPIUtil.post(redis.getCreater(), paasOsRestfulUrl, headers, DataType.JSON, redis.getApplyContent());
		} catch (Exception e) {
			redisMapper.deletePaasRedisById(redis.getRedisId());
			throw new RuntimeException("添加实例失败");
		}
		JSONObject JSONRedis = JSONObject.parseObject(restResponse);
		redis.setUpdateDate(new Date());
		redis.setAllocateContent(JSONRedis.toJSONString());
		redis.setOnReady(true);
		redisMapper.updatePaasRedisInfo(redis);
	}

	@Override
	public PaasRedis getPaasRedisInfoById(String redisId) {
		return redisMapper.getPaasRedisInfoById(redisId);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public JSONObject deletePaasRedisById(String redisId,String userId, String tenantId) {
		try{
			PaasRedis redis = redisMapper.getPaasRedisInfoById(redisId);
			redisMapper.deletePaasRedisById(redisId);
			//调用paasOS接口删除数据库
			String paasOsRestfulUrl = getPassRedisRestUrlPrefix()+"/"+redis.getResId()+"/delete";
			Map<String,String> headers = new HashMap<String,String>();
			headers.put("paasos-user-id", userId);
			headers.put("paasos-tenant-id", tenantId);
			String deleteRes = PaasAPIUtil.post(userId, paasOsRestfulUrl, headers, null, null);
			return JSONObject.parseObject(deleteRes);
		}catch(Exception e){
			throw new RuntimeException(e.getMessage());
		}
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public void updatePaasRedisInfo(PaasRedis redis) {
		//调用paasOS接口更新数据库
		redisMapper.updatePaasRedisInfo(redis);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public JSONObject queryRedisInfo(String redisId, String userId,
			String tenantId) {
		try{
			PaasRedis redis = redisMapper.getPaasRedisInfoById(redisId);
			String paasOsRestfulUrl = getPassRedisRestUrlPrefix()+"/"+redis.getResId();
			Map<String,String> headers = new HashMap<String,String>();
			headers.put("paasos-user-id", userId);
			headers.put("paasos-tenant-id", tenantId);
			String restResponse =PaasAPIUtil.get(userId, paasOsRestfulUrl, headers);
			JSONObject MySQLObj = JSONObject.parseObject(restResponse);
			return MySQLObj;
		}catch(Exception e){
			throw new RuntimeException(e.getMessage());
		}
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public JSONObject startPaasRedis(String redisId, String userId,
			String tenantId) {
		try{
			PaasRedis redis = redisMapper.getPaasRedisInfoById(redisId);
			String paasOsRestfulUrl = getPassRedisRestUrlPrefix()+"/"+redis.getResId()+"/start";
			Map<String,String> headers = new HashMap<String,String>();
			headers.put("paasos-user-id", userId);
			headers.put("paasos-tenant-id", tenantId);
			String startRes = PaasAPIUtil.post(userId, paasOsRestfulUrl, headers, null, null);
			return JSONObject.parseObject(startRes);
		}catch(Exception e){
			throw new RuntimeException(e.getMessage());
		}
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public JSONObject stopPaasRedis(String redisId, String userId,
			String tenantId) {
		try{
			PaasRedis redis = redisMapper.getPaasRedisInfoById(redisId);
			String paasOsRestfulUrl = getPassRedisRestUrlPrefix()+"/"+redis.getResId()+"/stop";
			Map<String,String> headers = new HashMap<String,String>();
			headers.put("paasos-user-id", userId);
			headers.put("paasos-tenant-id", tenantId);
			String stopRes = PaasAPIUtil.post(userId, paasOsRestfulUrl, headers, null, null);
			return JSONObject.parseObject(stopRes);
		}catch(Exception e){
			throw new RuntimeException(e.getMessage());
		}
	}

	@Override
	public JSONObject getPaasRedisOptions(String userId, String tenantId) {
		try{
			String paasOsRestfulUrl = ConfigUtil.getConfigString("paasos.resRestfulUrl");
			if(!StringUtil.endsWithIgnoreCase(paasOsRestfulUrl, "/")){
				paasOsRestfulUrl = paasOsRestfulUrl+"/";
			}
			paasOsRestfulUrl= paasOsRestfulUrl+"db/redis/options";
			Map<String,String> headers = new HashMap<String,String>();
			headers.put("paasos-user-id", userId);
			headers.put("paasos-tenant-id", tenantId);
			String RedisOptionStr = PaasAPIUtil.get(userId, paasOsRestfulUrl, headers);
			return JSONObject.parseObject(RedisOptionStr);
		}catch(Exception e){
			throw new RuntimeException(e.getMessage());
		}
	}

	@Override
	public JSONObject getPaasRedisConfig(String redisId) {
		PaasRedis redis = redisMapper.getPaasRedisInfoById(redisId);
		JSONObject obj = new JSONObject();
		JSONObject allocateJson = JSONObject.parseObject(redis.getAllocateContent());
		JSONObject connection = allocateJson.getJSONObject("connection");
		obj.put("username", connection.getString("account"));
		obj.put("password", connection.getString("password"));
		JSONObject serverJson = connection.getJSONObject("server");
		obj.put("externalIP", serverJson.getString("externalIP"));
		obj.put("externalPort", serverJson.getString("externalPort"));
		obj.put("clusterIP", serverJson.getString("clusterIP"));
		obj.put("clusterPort", serverJson.getString("port"));
		JSONObject manageJson = connection.getJSONObject("management");
		obj.put("manage.externalIP", manageJson.getString("externalIP"));
		obj.put("manage.externalPort", manageJson.getString("externalPort"));
		obj.put("manage.clusterIP", manageJson.getString("clusterIP"));
		obj.put("manage.clusterPort", manageJson.getString("port"));
		return obj;
	}

	@Override
	public List<PaasRedis> queryPaasRediss(Map<String, Object> params) {
		Page<PaasRedis> PaasRedis = Page.create(params);
		PaasRedis.setRecordCount(redisMapper.QueryPaasRedissCount(params));
		PaasRedis.addAll(redisMapper.QueryPaasRediss(params));
		return PaasRedis;
	}

	@Override
	public JSONObject queryPaasRedisWithStatus(Map<String, Object> params,
			StringBuilder sb) {
		List<PaasRedis> rediss = redisMapper.QueryPaasRediss(params);
		String userId = (String) params.get("userId");
		String tenantId = (String) params.get("tenantId");
		JSONObject mysqlJSON = new JSONObject();
		int running=0, others=0;
		JSONArray runData = new JSONArray();
		JSONArray otherData = new JSONArray();
		if(rediss!=null && rediss.size()>0){
			for(PaasRedis redis: rediss){
				try{
					String paasOsRestfulUrl = getPassRedisRestUrlPrefix()+"/"+redis.getResId();
					Map<String,String> headers = new HashMap<String,String>();
					headers.put("paasos-user-id", userId);
					headers.put("paasos-tenant-id", tenantId);
					String restResponse = PaasAPIUtil.get(userId, paasOsRestfulUrl, headers);
					JSONObject restObj = JSONObject.parseObject(restResponse);
					String status = restObj.getString("status");
					if("running".equals(status)){
						running++;
						JSONObject temp = new JSONObject();
						temp.put("id", redis.getRedisId());
						runData.add(temp);
					}else{
						others++;
						JSONObject temp = new JSONObject();
						temp.put("id", redis.getRedisId());
						otherData.add(temp);
					}
				}catch(Exception e){
					sb.append("\t查询状态出错:"+redis.getRedisId());
					others++;
					JSONObject temp = new JSONObject();
					temp.put("id", redis.getRedisId());
					otherData.add(temp);
				}
			}
			mysqlJSON.put("runningCount", running);
			mysqlJSON.put("runningData", runData);
			mysqlJSON.put("stoppedCount", others);
			mysqlJSON.put("stoppedData", otherData);
		}
		return mysqlJSON;
	}
}


text:
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import { _AbstractConstructor } from '@angular/material/core';
import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
import { AfterContentInit } from '@angular/core';
import { AfterViewInit } from '@angular/core';
import { BooleanInput } from '@angular/cdk/coercion';
import { CanDisableRipple } from '@angular/material/core';
import { ChangeDetectorRef } from '@angular/core';
import { _Constructor } from '@angular/material/core';
import { ControlValueAccessor } from '@angular/forms';
import { Directionality } from '@angular/cdk/bidi';
import { ElementRef } from '@angular/core';
import { EventEmitter } from '@angular/core';
import * as i0 from '@angular/core';
import * as i4 from '@angular/cdk/overlay';
import * as i5 from '@angular/material/core';
import * as i6 from '@angular/common';
import * as i7 from '@angular/cdk/scrolling';
import { InjectionToken } from '@angular/core';
import { MatFormField } from '@angular/material/form-field';
import { MatOptgroup } from '@angular/material/core';
import { _MatOptgroupBase } from '@angular/material/core';
import { MatOption } from '@angular/material/core';
import { _MatOptionBase } from '@angular/material/core';
import { MatOptionSelectionChange } from '@angular/material/core';
import { NgZone } from '@angular/core';
import { Observable } from 'rxjs';
import { OnChanges } from '@angular/core';
import { OnDestroy } from '@angular/core';
import { Overlay } from '@angular/cdk/overlay';
import { Platform } from '@angular/cdk/platform';
import { QueryList } from '@angular/core';
import { ScrollStrategy } from '@angular/cdk/overlay';
import { SimpleChanges } from '@angular/core';
import { TemplateRef } from '@angular/core';
import { ThemePalette } from '@angular/material/core';
import { ViewContainerRef } from '@angular/core';
import { ViewportRuler } from '@angular/cdk/scrolling';

// @public
export function getMatAutocompleteMissingPanelError(): Error;

// @public
export const MAT_AUTOCOMPLETE_DEFAULT_OPTIONS: InjectionToken<MatAutocompleteDefaultOptions>;

// @public
export function MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY(): MatAutocompleteDefaultOptions;

// @public
export const MAT_AUTOCOMPLETE_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;

// @public
export function MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY(overlay: Overlay): () => ScrollStrategy;

// @public
export const MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER: {
    provide: InjectionToken<() => ScrollStrategy>;
    deps: (typeof Overlay)[];
    useFactory: typeof MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY;
};

// @public
export const MAT_AUTOCOMPLETE_VALUE_ACCESSOR: any;

// @public (undocumented)
export class MatAutocomplete extends _MatAutocompleteBase {
    // (undocumented)
    protected _hiddenClass: string;
    optionGroups: QueryList<MatOptgroup>;
    options: QueryList<MatOption>;
    // (undocumented)
    protected _visibleClass: string;
    // (undocumented)
    static ɵcmp: i0.ɵɵComponentDeclaration<MatAutocomplete, "mat-autocomplete", ["matAutocomplete"], { "disableRipple": "disableRipple"; }, {}, ["optionGroups", "options"], ["*"], false, never>;
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<MatAutocomplete, never>;
}

// @public
export interface MatAutocompleteActivatedEvent {
    option: _MatOptionBase | null;
    source: _MatAutocompleteBase;
}

// @public
export abstract class _MatAutocompleteBase extends _MatAutocompleteMixinBase implements AfterContentInit, CanDisableRipple, OnDestroy {
    constructor(_changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, defaults: MatAutocompleteDefaultOptions, platform?: Platform);
    ariaLabel: string;
    ariaLabelledby: string;
    get autoActiveFirstOption(): boolean;
    set autoActiveFirstOption(value: BooleanInput);
    get autoSelectActiveOption(): boolean;
    set autoSelectActiveOption(value: BooleanInput);
    set classList(value: string | string[]);
    // (undocumented)
    _classList: {
        [key: string]: boolean;
    };
    readonly closed: EventEmitter<void>;
    displayWith: ((value: any) => string) | null;
    _emitSelectEvent(option: _MatOptionBase): void;
    _getPanelAriaLabelledby(labelId: string | null): string | null;
    _getScrollTop(): number;
    protected abstract _hiddenClass: string;
    id: string;
    readonly inertGroups: boolean;
    get isOpen(): boolean;
    // (undocumented)
    _isOpen: boolean;
    _keyManager: ActiveDescendantKeyManager<_MatOptionBase>;
    // (undocumented)
    ngAfterContentInit(): void;
    // (undocumented)
    ngOnDestroy(): void;
    readonly opened: EventEmitter<void>;
    readonly optionActivated: EventEmitter<MatAutocompleteActivatedEvent>;
    abstract optionGroups: QueryList<_MatOptgroupBase>;
    abstract options: QueryList<_MatOptionBase>;
    readonly optionSelected: EventEmitter<MatAutocompleteSelectedEvent>;
    panel: ElementRef;
    panelWidth: string | number;
    _setColor(value: ThemePalette): void;
    _setScrollTop(scrollTop: number): void;
    _setVisibility(): void;
    showPanel: boolean;
    template: TemplateRef<any>;
    protected abstract _visibleClass: string;
    // (undocumented)
    static ɵdir: i0.ɵɵDirectiveDeclaration<_MatAutocompleteBase, never, never, { "ariaLabel": "aria-label"; "ariaLabelledby": "aria-labelledby"; "displayWith": "displayWith"; "autoActiveFirstOption": "autoActiveFirstOption"; "autoSelectActiveOption": "autoSelectActiveOption"; "panelWidth": "panelWidth"; "classList": "class"; }, { "optionSelected": "optionSelected"; "opened": "opened"; "closed": "closed"; "optionActivated": "optionActivated"; }, never, never, false, never>;
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<_MatAutocompleteBase, never>;
}

// @public
export interface MatAutocompleteDefaultOptions {
    autoActiveFirstOption?: boolean;
    autoSelectActiveOption?: boolean;
    overlayPanelClass?: string | string[];
}

// @public (undocumented)
export class MatAutocompleteModule {
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<MatAutocompleteModule, never>;
    // (undocumented)
    static ɵinj: i0.ɵɵInjectorDeclaration<MatAutocompleteModule>;
    // (undocumented)
    static ɵmod: i0.ɵɵNgModuleDeclaration<MatAutocompleteModule, [typeof i1.MatAutocomplete, typeof i2.MatAutocompleteTrigger, typeof i3.MatAutocompleteOrigin], [typeof i4.OverlayModule, typeof i5.MatOptionModule, typeof i5.MatCommonModule, typeof i6.CommonModule], [typeof i7.CdkScrollableModule, typeof i1.MatAutocomplete, typeof i5.MatOptionModule, typeof i5.MatCommonModule, typeof i2.MatAutocompleteTrigger, typeof i3.MatAutocompleteOrigin]>;
}

// @public
export class MatAutocompleteOrigin extends _MatAutocompleteOriginBase {
    // (undocumented)
    static ɵdir: i0.ɵɵDirectiveDeclaration<MatAutocompleteOrigin, "[matAutocompleteOrigin]", ["matAutocompleteOrigin"], {}, {}, never, never, false, never>;
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<MatAutocompleteOrigin, never>;
}

// @public
export abstract class _MatAutocompleteOriginBase {
    constructor(
    elementRef: ElementRef<HTMLElement>);
    elementRef: ElementRef<HTMLElement>;
    // (undocumented)
    static ɵdir: i0.ɵɵDirectiveDeclaration<_MatAutocompleteOriginBase, never, never, {}, {}, never, never, false, never>;
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<_MatAutocompleteOriginBase, never>;
}

// @public
export class MatAutocompleteSelectedEvent {
    constructor(
    source: _MatAutocompleteBase,
    option: _MatOptionBase);
    option: _MatOptionBase;
    source: _MatAutocompleteBase;
}

// @public (undocumented)
export class MatAutocompleteTrigger extends _MatAutocompleteTriggerBase {
    // (undocumented)
    protected _aboveClass: string;
    // (undocumented)
    static ɵdir: i0.ɵɵDirectiveDeclaration<MatAutocompleteTrigger, "input[matAutocomplete], textarea[matAutocomplete]", ["matAutocompleteTrigger"], {}, {}, never, never, false, never>;
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<MatAutocompleteTrigger, never>;
}

// @public
export abstract class _MatAutocompleteTriggerBase implements ControlValueAccessor, AfterViewInit, OnChanges, OnDestroy {
    constructor(_element: ElementRef<HTMLInputElement>, _overlay: Overlay, _viewContainerRef: ViewContainerRef, _zone: NgZone, _changeDetectorRef: ChangeDetectorRef, scrollStrategy: any, _dir: Directionality, _formField: MatFormField, _document: any, _viewportRuler: ViewportRuler, _defaults?: MatAutocompleteDefaultOptions | undefined);
    protected abstract _aboveClass: string;
    get activeOption(): _MatOptionBase | null;
    autocomplete: _MatAutocompleteBase;
    autocompleteAttribute: string;
    get autocompleteDisabled(): boolean;
    set autocompleteDisabled(value: BooleanInput);
    closePanel(): void;
    connectedTo: _MatAutocompleteOriginBase;
    // (undocumented)
    _handleClick(): void;
    // (undocumented)
    _handleFocus(): void;
    // (undocumented)
    _handleInput(event: KeyboardEvent): void;
    // (undocumented)
    _handleKeydown(event: KeyboardEvent): void;
    // (undocumented)
    ngAfterViewInit(): void;
    // (undocumented)
    ngOnChanges(changes: SimpleChanges): void;
    // (undocumented)
    ngOnDestroy(): void;
    _onChange: (value: any) => void;
    _onTouched: () => void;
    openPanel(): void;
    readonly optionSelections: Observable<MatOptionSelectionChange>;
    get panelClosingActions(): Observable<MatOptionSelectionChange | null>;
    get panelOpen(): boolean;
    position: 'auto' | 'above' | 'below';
    // (undocumented)
    registerOnChange(fn: (value: any) => {}): void;
    // (undocumented)
    registerOnTouched(fn: () => {}): void;
    // (undocumented)
    setDisabledState(isDisabled: boolean): void;
    updatePosition(): void;
    // (undocumented)
    writeValue(value: any): void;
    // (undocumented)
    static ɵdir: i0.ɵɵDirectiveDeclaration<_MatAutocompleteTriggerBase, never, never, { "autocomplete": "matAutocomplete"; "position": "matAutocompletePosition"; "connectedTo": "matAutocompleteConnectedTo"; "autocompleteAttribute": "autocomplete"; "autocompleteDisabled": "matAutocompleteDisabled"; }, {}, never, never, false, never>;
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<_MatAutocompleteTriggerBase, [null, null, null, null, null, null, { optional: true; }, { optional: true; host: true; }, { optional: true; }, null, { optional: true; }]>;
}

// (No @packageDocumentation comment for this package)

```


text:
package org.mapfish.print.processor.map;

import org.json.JSONObject;
import org.junit.Test;
import org.mapfish.print.AbstractMapfishSpringTest;
import org.mapfish.print.TestHttpClientFactory;
import org.mapfish.print.config.Configuration;
import org.mapfish.print.config.ConfigurationFactory;
import org.mapfish.print.config.Template;
import org.mapfish.print.output.Values;
import org.mapfish.print.test.util.ImageSimilarity;
import org.mapfish.print.wrapper.json.PJsonObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.List;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

import static org.junit.Assert.assertEquals;

/**
 * Basic test of the Map processor.
 *
 * Created by Jesse on 3/26/14.
 */
public class CreateMapProcessorFlexibleScaleBBoxGmlTest extends AbstractMapfishSpringTest {
    public static final String BASE_DIR = "center_gml_flexible_scale/";

    @Autowired
    private ConfigurationFactory configurationFactory;
    @Autowired
    private TestHttpClientFactory requestFactory;
    @Autowired
    private ForkJoinPool forkJoinPool;

    private static PJsonObject loadJsonRequestData() throws IOException {
        return parseJSONObjectFromFile(CreateMapProcessorFlexibleScaleBBoxGmlTest.class,
                                       BASE_DIR + "requestData.json");
    }

    @Test
    @DirtiesContext
    public void testExecute() throws Exception {
        final String host = "center_gml_flexible_scale.com";
        requestFactory.registerHandler(
                input -> (("" + input.getHost()).contains(host)) || input.getAuthority().contains(host),
                createFileHandler(uri -> "/map-data" + uri.getPath())
        );
        final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "config.yaml"));
        final Template template = config.getTemplate("main");

        PJsonObject requestData = loadJsonRequestData();
        final JSONObject jsonLayer = requestData.getJSONObject("attributes").getJSONObject("map")
                .getJSONArray("layers").getJSONObject(0).getInternalObj();

        for (String gmlDataName: new String[]{"spearfish-streams-v2.gml", "spearfish-streams-v311.gml"}) {
            jsonLayer.remove("url");
            jsonLayer.accumulate("url", "http://" + host + ":23432" + "/gml/" + gmlDataName);

            Values values = new Values("test", requestData, template, getTaskDirectory(),
                                       this.requestFactory, new File("."));

            final ForkJoinTask<Values> taskFuture = this.forkJoinPool.submit(
                    template.getProcessorGraph().createTask(values));
            taskFuture.get();

            @SuppressWarnings("unchecked")
            List<URI> layerGraphics = (List<URI>) values.getObject("layerGraphics", List.class);
            assertEquals(1, layerGraphics.size());

            new ImageSimilarity(getFile(String.format("%sexpected%s.png", BASE_DIR, gmlDataName)))
                    .assertSimilarity(new File(layerGraphics.get(0)), 20);
        }

    }
}


text:
.cd-title { position: relative; height: 160px; line-height: 230px; text-align: center; }
.cd-title h1 { font-size: 2.4rem; font-weight: 700; }
@media only screen and (min-width: 768px) {
 .cd-title {
 line-height: 250px;
}
}
@media only screen and (min-width: 1170px) {
 .cd-title {
 height: 200px;
 line-height: 300px;
}
 .cd-title h1 {
 font-size: 3rem;
}
}
.cd-intro { width: 90%; max-width: 768px; text-align: center; }
.cd-intro { margin: 4em auto; }
@media only screen and (min-width: 768px) {
 .cd-intro {
 margin: 5em auto;
}
}
@media only screen and (min-width: 1170px) {
 .cd-intro {
 margin: 6em auto;
}
}

@media only screen and (min-width: 768px) {

}
@media only screen and (min-width: 1170px) {

}
.cd-words-wrapper { display: inline-block; position: relative; text-align: left; }
.cd-words-wrapper b { display: inline-block; position: absolute; white-space: nowrap; left: 0; top: 0; }
.cd-words-wrapper b.is-visible { position: relative; }
.no-js .cd-words-wrapper b { opacity: 0; }
.no-js .cd-words-wrapper b.is-visible { opacity: 1; }
/* --------------------------------

xrotate-1

-------------------------------- */
.cd-headline.rotate-1 .cd-words-wrapper { -webkit-perspective: 300px; -moz-perspective: 300px; perspective: 300px; }
.cd-headline.rotate-1 b { opacity: 0; -webkit-transform-origin: 50% 100%; -moz-transform-origin: 50% 100%; -ms-transform-origin: 50% 100%; -o-transform-origin: 50% 100%; transform-origin: 50% 100%; -webkit-transform: rotateX(180deg); -moz-transform: rotateX(180deg); -ms-transform: rotateX(180deg); -o-transform: rotateX(180deg); transform: rotateX(180deg); }
.cd-headline.rotate-1 b.is-visible { opacity: 1; -webkit-transform: rotateX(0deg); -moz-transform: rotateX(0deg); -ms-transform: rotateX(0deg); -o-transform: rotateX(0deg); transform: rotateX(0deg); -webkit-animation: cd-rotate-1-in 1.2s; -moz-animation: cd-rotate-1-in 1.2s; animation: cd-rotate-1-in 1.2s; }
.cd-headline.rotate-1 b.is-hidden { -webkit-transform: rotateX(180deg); -moz-transform: rotateX(180deg); -ms-transform: rotateX(180deg); -o-transform: rotateX(180deg); transform: rotateX(180deg); -webkit-animation: cd-rotate-1-out 1.2s; -moz-animation: cd-rotate-1-out 1.2s; animation: cd-rotate-1-out 1.2s; }
 @-webkit-keyframes cd-rotate-1-in {  0% {
 -webkit-transform: rotateX(180deg);
 opacity: 0;
}
 35% {
 -webkit-transform: rotateX(120deg);
 opacity: 0;
}
 65% {
 opacity: 0;
}
 100% {
 -webkit-transform: rotateX(360deg);
 opacity: 1;
}
}
@-moz-keyframes cd-rotate-1-in {  0% {
 -moz-transform: rotateX(180deg);
 opacity: 0;
}
 35% {
 -moz-transform: rotateX(120deg);
 opacity: 0;
}
 65% {
 opacity: 0;
}
 100% {
 -moz-transform: rotateX(360deg);
 opacity: 1;
}
}
@keyframes cd-rotate-1-in {  0% {
 -webkit-transform: rotateX(180deg);
 -moz-transform: rotateX(180deg);
 -ms-transform: rotateX(180deg);
 -o-transform: rotateX(180deg);
 transform: rotateX(180deg);
 opacity: 0;
}
 35% {
 -webkit-transform: rotateX(120deg);
 -moz-transform: rotateX(120deg);
 -ms-transform: rotateX(120deg);
 -o-transform: rotateX(120deg);
 transform: rotateX(120deg);
 opacity: 0;
}
 65% {
 opacity: 0;
}
 100% {
 -webkit-transform: rotateX(360deg);
 -moz-transform: rotateX(360deg);
 -ms-transform: rotateX(360deg);
 -o-transform: rotateX(360deg);
 transform: rotateX(360deg);
 opacity: 1;
}
}
@-webkit-keyframes cd-rotate-1-out {  0% {
 -webkit-transform: rotateX(0deg);
 opacity: 1;
}
 35% {
 -webkit-transform: rotateX(-40deg);
 opacity: 1;
}
 65% {
 opacity: 0;
}
 100% {
 -webkit-transform: rotateX(180deg);
 opacity: 0;
}
}
@-moz-keyframes cd-rotate-1-out {  0% {
 -moz-transform: rotateX(0deg);
 opacity: 1;
}
 35% {
 -moz-transform: rotateX(-40deg);
 opacity: 1;
}
 65% {
 opacity: 0;
}
 100% {
 -moz-transform: rotateX(180deg);
 opacity: 0;
}
}
@keyframes cd-rotate-1-out {  0% {
 -webkit-transform: rotateX(0deg);
 -moz-transform: rotateX(0deg);
 -ms-transform: rotateX(0deg);
 -o-transform: rotateX(0deg);
 transform: rotateX(0deg);
 opacity: 1;
}
 35% {
 -webkit-transform: rotateX(-40deg);
 -moz-transform: rotateX(-40deg);
 -ms-transform: rotateX(-40deg);
 -o-transform: rotateX(-40deg);
 transform: rotateX(-40deg);
 opacity: 1;
}
 65% {
 opacity: 0;
}
 100% {
 -webkit-transform: rotateX(180deg);
 -moz-transform: rotateX(180deg);
 -ms-transform: rotateX(180deg);
 -o-transform: rotateX(180deg);
 transform: rotateX(180deg);
 opacity: 0;
}
}
/* --------------------------------

xtype

-------------------------------- */
.cd-headline.type .cd-words-wrapper { vertical-align: top; overflow: hidden; }
.cd-headline.type .cd-words-wrapper::after {
  /* vertical bar */
  content: '';
 position: absolute;
 right: 0;
 top: 50%;
 bottom: auto;
 -webkit-transform: translateY(-50%);
 -moz-transform: translateY(-50%);
 -ms-transform: translateY(-50%);
 -o-transform: translateY(-50%);
 transform: translateY(-50%);
 height: 90%;
 width: 1px;
 background-color: #aebcb9;
}
.cd-headline.type .cd-words-wrapper.waiting::after {
 -webkit-animation: cd-pulse 1s infinite;
 -moz-animation: cd-pulse 1s infinite;
 animation: cd-pulse 1s infinite;
}
.cd-headline.type .cd-words-wrapper.selected { background-color: #aebcb9; }
.cd-headline.type .cd-words-wrapper.selected::after {
 visibility: hidden;
}
.cd-headline.type .cd-words-wrapper.selected b { color: #0d0d0d; }
.cd-headline.type b { visibility: hidden; }
.cd-headline.type b.is-visible { visibility: visible; }
.cd-headline.type i { position: absolute; visibility: hidden; }
.cd-headline.type i.in { position: relative; visibility: visible; }
 @-webkit-keyframes cd-pulse {  0% {
 -webkit-transform: translateY(-50%) scale(1);
 opacity: 1;
}
 40% {
 -webkit-transform: translateY(-50%) scale(0.9);
 opacity: 0;
}
 100% {
 -webkit-transform: translateY(-50%) scale(0);
 opacity: 0;
}
}
@-moz-keyframes cd-pulse {  0% {
 -moz-transform: translateY(-50%) scale(1);
 opacity: 1;
}
 40% {
 -moz-transform: translateY(-50%) scale(0.9);
 opacity: 0;
}
 100% {
 -moz-transform: translateY(-50%) scale(0);
 opacity: 0;
}
}
@keyframes cd-pulse {  0% {
 -webkit-transform: translateY(-50%) scale(1);
 -moz-transform: translateY(-50%) scale(1);
 -ms-transform: translateY(-50%) scale(1);
 -o-transform: translateY(-50%) scale(1);
 transform: translateY(-50%) scale(1);
 opacity: 1;
}
 40% {
 -webkit-transform: translateY(-50%) scale(0.9);
 -moz-transform: translateY(-50%) scale(0.9);
 -ms-transform: translateY(-50%) scale(0.9);
 -o-transform: translateY(-50%) scale(0.9);
 transform: translateY(-50%) scale(0.9);
 opacity: 0;
}
 100% {
 -webkit-transform: translateY(-50%) scale(0);
 -moz-transform: translateY(-50%) scale(0);
 -ms-transform: translateY(-50%) scale(0);
 -o-transform: translateY(-50%) scale(0);
 transform: translateY(-50%) scale(0);
 opacity: 0;
}
}
/* --------------------------------

xrotate-2

-------------------------------- */
.cd-headline.rotate-2 .cd-words-wrapper { -webkit-perspective: 300px; -moz-perspective: 300px; perspective: 300px; }
.cd-headline.rotate-2 i, .cd-headline.rotate-2 em { display: inline-block; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.cd-headline.rotate-2 b { opacity: 0; }
.cd-headline.rotate-2 i { -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; -o-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transform: translateZ(-20px) rotateX(90deg); -moz-transform: translateZ(-20px) rotateX(90deg); -ms-transform: translateZ(-20px) rotateX(90deg); -o-transform: translateZ(-20px) rotateX(90deg); transform: translateZ(-20px) rotateX(90deg); opacity: 0; }
.is-visible .cd-headline.rotate-2 i { opacity: 1; }
.cd-headline.rotate-2 i.in { -webkit-animation: cd-rotate-2-in 0.4s forwards; -moz-animation: cd-rotate-2-in 0.4s forwards; animation: cd-rotate-2-in 0.4s forwards; }
.cd-headline.rotate-2 i.out { -webkit-animation: cd-rotate-2-out 0.4s forwards; -moz-animation: cd-rotate-2-out 0.4s forwards; animation: cd-rotate-2-out 0.4s forwards; }
.cd-headline.rotate-2 em { -webkit-transform: translateZ(20px); -moz-transform: translateZ(20px); -ms-transform: translateZ(20px); -o-transform: translateZ(20px); transform: translateZ(20px); }
.no-csstransitions .cd-headline.rotate-2 i { -webkit-transform: rotateX(0deg); -moz-transform: rotateX(0deg); -ms-transform: rotateX(0deg); -o-transform: rotateX(0deg); transform: rotateX(0deg); opacity: 0; }
.no-csstransitions .cd-headline.rotate-2 i em { -webkit-transform: scale(1); -moz-transform: scale(1); -ms-transform: scale(1); -o-transform: scale(1); transform: scale(1); }
.no-csstransitions .cd-headline.rotate-2 .is-visible i { opacity: 1; }
 @-webkit-keyframes cd-rotate-2-in {  0% {
 opacity: 0;
 -webkit-transform: translateZ(-20px) rotateX(90deg);
}
 60% {
 opacity: 1;
 -webkit-transform: translateZ(-20px) rotateX(-10deg);
}
 100% {
 opacity: 1;
 -webkit-transform: translateZ(-20px) rotateX(0deg);
}
}
@-moz-keyframes cd-rotate-2-in {  0% {
 opacity: 0;
 -moz-transform: translateZ(-20px) rotateX(90deg);
}
 60% {
 opacity: 1;
 -moz-transform: translateZ(-20px) rotateX(-10deg);
}
 100% {
 opacity: 1;
 -moz-transform: translateZ(-20px) rotateX(0deg);
}
}
@keyframes cd-rotate-2-in {  0% {
 opacity: 0;
 -webkit-transform: translateZ(-20px) rotateX(90deg);
 -moz-transform: translateZ(-20px) rotateX(90deg);
 -ms-transform: translateZ(-20px) rotateX(90deg);
 -o-transform: translateZ(-20px) rotateX(90deg);
 transform: translateZ(-20px) rotateX(90deg);
}
 60% {
 opacity: 1;
 -webkit-transform: translateZ(-20px) rotateX(-10deg);
 -moz-transform: translateZ(-20px) rotateX(-10deg);
 -ms-transform: translateZ(-20px) rotateX(-10deg);
 -o-transform: translateZ(-20px) rotateX(-10deg);
 transform: translateZ(-20px) rotateX(-10deg);
}
 100% {
 opacity: 1;
 -webkit-transform: translateZ(-20px) rotateX(0deg);
 -moz-transform: translateZ(-20px) rotateX(0deg);
 -ms-transform: translateZ(-20px) rotateX(0deg);
 -o-transform: translateZ(-20px) rotateX(0deg);
 transform: translateZ(-20px) rotateX(0deg);
}
}
@-webkit-keyframes cd-rotate-2-out {  0% {
 opacity: 1;
 -webkit-transform: translateZ(-20px) rotateX(0);
}
 60% {
 opacity: 0;
 -webkit-transform: translateZ(-20px) rotateX(-100deg);
}
 100% {
 opacity: 0;
 -webkit-transform: translateZ(-20px) rotateX(-90deg);
}
}
@-moz-keyframes cd-rotate-2-out {  0% {
 opacity: 1;
 -moz-transform: translateZ(-20px) rotateX(0);
}
 60% {
 opacity: 0;
 -moz-transform: translateZ(-20px) rotateX(-100deg);
}
 100% {
 opacity: 0;
 -moz-transform: translateZ(-20px) rotateX(-90deg);
}
}
@keyframes cd-rotate-2-out {  0% {
 opacity: 1;
 -webkit-transform: translateZ(-20px) rotateX(0);
 -moz-transform: translateZ(-20px) rotateX(0);
 -ms-transform: translateZ(-20px) rotateX(0);
 -o-transform: translateZ(-20px) rotateX(0);
 transform: translateZ(-20px) rotateX(0);
}
 60% {
 opacity: 0;
 -webkit-transform: translateZ(-20px) rotateX(-100deg);
 -moz-transform: translateZ(-20px) rotateX(-100deg);
 -ms-transform: translateZ(-20px) rotateX(-100deg);
 -o-transform: translateZ(-20px) rotateX(-100deg);
 transform: translateZ(-20px) rotateX(-100deg);
}
 100% {
 opacity: 0;
 -webkit-transform: translateZ(-20px) rotateX(-90deg);
 -moz-transform: translateZ(-20px) rotateX(-90deg);
 -ms-transform: translateZ(-20px) rotateX(-90deg);
 -o-transform: translateZ(-20px) rotateX(-90deg);
 transform: translateZ(-20px) rotateX(-90deg);
}
}
/* --------------------------------

xloading-bar

-------------------------------- */
.cd-headline.loading-bar span { display: inline-block; padding: .2em 0; }
.cd-headline.loading-bar .cd-words-wrapper { overflow: hidden; vertical-align: top; }
.cd-headline.loading-bar .cd-words-wrapper::after {
  /* loading bar */
  content: '';
 position: absolute;
 left: 0;
 bottom: 0;
 height: 3px;
 width: 0;
 background: #0096a7;
 z-index: 2;
 -webkit-transition: width 0.3s -0.1s;
 -moz-transition: width 0.3s -0.1s;
 transition: width 0.3s -0.1s;
}
.cd-headline.loading-bar .cd-words-wrapper.is-loading::after {
 width: 100%;
 -webkit-transition: width 3s;
 -moz-transition: width 3s;
 transition: width 3s;
}
.cd-headline.loading-bar b { top: .2em; opacity: 0; -webkit-transition: opacity 0.3s; -moz-transition: opacity 0.3s; transition: opacity 0.3s; }
.cd-headline.loading-bar b.is-visible { opacity: 1; top: 0; }
/* --------------------------------

xslide

-------------------------------- */
.cd-headline.slide span { display: inline-block; padding: .2em 0; }
.cd-headline.slide .cd-words-wrapper { overflow: hidden; vertical-align: top; }
.cd-headline.slide b { opacity: 0; top: .2em; }
.cd-headline.slide b.is-visible { top: 0; opacity: 1; -webkit-animation: slide-in 0.6s; -moz-animation: slide-in 0.6s; animation: slide-in 0.6s; }
.cd-headline.slide b.is-hidden { -webkit-animation: slide-out 0.6s; -moz-animation: slide-out 0.6s; animation: slide-out 0.6s; }
 @-webkit-keyframes slide-in {  0% {
 opacity: 0;
 -webkit-transform: translateY(-100%);
}
 60% {
 opacity: 1;
 -webkit-transform: translateY(20%);
}
 100% {
 opacity: 1;
 -webkit-transform: translateY(0);
}
}
@-moz-keyframes slide-in {  0% {
 opacity: 0;
 -moz-transform: translateY(-100%);
}
 60% {
 opacity: 1;
 -moz-transform: translateY(20%);
}
 100% {
 opacity: 1;
 -moz-transform: translateY(0);
}
}
@keyframes slide-in {  0% {
 opacity: 0;
 -webkit-transform: translateY(-100%);
 -moz-transform: translateY(-100%);
 -ms-transform: translateY(-100%);
 -o-transform: translateY(-100%);
 transform: translateY(-100%);
}
 60% {
 opacity: 1;
 -webkit-transform: translateY(20%);
 -moz-transform: translateY(20%);
 -ms-transform: translateY(20%);
 -o-transform: translateY(20%);
 transform: translateY(20%);
}
 100% {
 opacity: 1;
 -webkit-transform: translateY(0);
 -moz-transform: translateY(0);
 -ms-transform: translateY(0);
 -o-transform: translateY(0);
 transform: translateY(0);
}
}
@-webkit-keyframes slide-out {  0% {
 opacity: 1;
 -webkit-transform: translateY(0);
}
 60% {
 opacity: 0;
 -webkit-transform: translateY(120%);
}
 100% {
 opacity: 0;
 -webkit-transform: translateY(100%);
}
}
@-moz-keyframes slide-out {  0% {
 opacity: 1;
 -moz-transform: translateY(0);
}
 60% {
 opacity: 0;
 -moz-transform: translateY(120%);
}
 100% {
 opacity: 0;
 -moz-transform: translateY(100%);
}
}
@keyframes slide-out {  0% {
 opacity: 1;
 -webkit-transform: translateY(0);
 -moz-transform: translateY(0);
 -ms-transform: translateY(0);
 -o-transform: translateY(0);
 transform: translateY(0);
}
 60% {
 opacity: 0;
 -webkit-transform: translateY(120%);
 -moz-transform: translateY(120%);
 -ms-transform: translateY(120%);
 -o-transform: translateY(120%);
 transform: translateY(120%);
}
 100% {
 opacity: 0;
 -webkit-transform: translateY(100%);
 -moz-transform: translateY(100%);
 -ms-transform: translateY(100%);
 -o-transform: translateY(100%);
 transform: translateY(100%);
}
}
/* --------------------------------

xclip

-------------------------------- */
.cd-headline.clip span { display: inline-block; }
.cd-headline.clip .cd-words-wrapper { overflow: hidden; vertical-align: top; }
.cd-headline.clip .cd-words-wrapper::after {
  /* line */
  content: '';
 position: absolute;
 top: 0;
 right: 0;
 width: 1px;
 height: 100%;
 background-color: #ef5c4b;
}
.cd-headline.clip b { opacity: 0; }
.cd-headline.clip b.is-visible { opacity: 1; }
/* --------------------------------

xzoom

--------------------------------
.cd-headline.zoom .cd-words-wrapper { -webkit-perspective: 300px; -moz-perspective: 300px; perspective: 300px; }
.cd-headline.zoom b { opacity: 0; }
.cd-headline.zoom b.is-visible { opacity: 1; -webkit-animation: zoom-in 0.8s; -moz-animation: zoom-in 0.8s; animation: zoom-in 0.8s; }
.cd-headline.zoom b.is-hidden { -webkit-animation: zoom-out 0.8s; -moz-animation: zoom-out 0.8s; animation: zoom-out 0.8s; }
 @-webkit-keyframes zoom-in {  0% {
 opacity: 0;
 -webkit-transform: translateZ(100px);
}
 100% {
 opacity: 1;
 -webkit-transform: translateZ(0);
}
}
@-moz-keyframes zoom-in {  0% {
 opacity: 0;
 -moz-transform: translateZ(100px);
}
 100% {
 opacity: 1;
 -moz-transform: translateZ(0);
}
}
@keyframes zoom-in {  0% {
 opacity: 0;
 -webkit-transform: translateZ(100px);
 -moz-transform: translateZ(100px);
 -ms-transform: translateZ(100px);
 -o-transform: translateZ(100px);
 transform: translateZ(100px);
}
 100% {
 opacity: 1;
 -webkit-transform: translateZ(0);
 -moz-transform: translateZ(0);
 -ms-transform: translateZ(0);
 -o-transform: translateZ(0);
 transform: translateZ(0);
}
}
@-webkit-keyframes zoom-out {  0% {
 opacity: 1;
 -webkit-transform: translateZ(0);
}
 100% {
 opacity: 0;
 -webkit-transform: translateZ(-100px);
}
}
@-moz-keyframes zoom-out {  0% {
 opacity: 1;
 -moz-transform: translateZ(0);
}
 100% {
 opacity: 0;
 -moz-transform: translateZ(-100px);
}
}
@keyframes zoom-out {  0% {
 opacity: 1;
 -webkit-transform: translateZ(0);
 -moz-transform: translateZ(0);
 -ms-transform: translateZ(0);
 -o-transform: translateZ(0);
 transform: translateZ(0);
}
 100% {
 opacity: 0;
 -webkit-transform: translateZ(-100px);
 -moz-transform: translateZ(-100px);
 -ms-transform: translateZ(-100px);
 -o-transform: translateZ(-100px);
 transform: translateZ(-100px);
}
}
/* --------------------------------

xrotate-3

-------------------------------- */
.cd-headline.rotate-3 .cd-words-wrapper { -webkit-perspective: 300px; -moz-perspective: 300px; perspective: 300px; }
.cd-headline.rotate-3 b { opacity: 0; }
.cd-headline.rotate-3 i { display: inline-block; -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180deg); -ms-transform: rotateY(180deg); -o-transform: rotateY(180deg); transform: rotateY(180deg); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.is-visible .cd-headline.rotate-3 i { -webkit-transform: rotateY(0deg); -moz-transform: rotateY(0deg); -ms-transform: rotateY(0deg); -o-transform: rotateY(0deg); transform: rotateY(0deg); }
.cd-headline.rotate-3 i.in { -webkit-animation: cd-rotate-3-in 0.6s forwards; -moz-animation: cd-rotate-3-in 0.6s forwards; animation: cd-rotate-3-in 0.6s forwards; }
.cd-headline.rotate-3 i.out { -webkit-animation: cd-rotate-3-out 0.6s forwards; -moz-animation: cd-rotate-3-out 0.6s forwards; animation: cd-rotate-3-out 0.6s forwards; }
.no-csstransitions .cd-headline.rotate-3 i { -webkit-transform: rotateY(0deg); -moz-transform: rotateY(0deg); -ms-transform: rotateY(0deg); -o-transform: rotateY(0deg); transform: rotateY(0deg); opacity: 0; }
.no-csstransitions .cd-headline.rotate-3 .is-visible i { opacity: 1; }
 @-webkit-keyframes cd-rotate-3-in {  0% {
 -webkit-transform: rotateY(180deg);
}
 100% {
 -webkit-transform: rotateY(0deg);
}
}
@-moz-keyframes cd-rotate-3-in {  0% {
 -moz-transform: rotateY(180deg);
}
 100% {
 -moz-transform: rotateY(0deg);
}
}
@keyframes cd-rotate-3-in {  0% {
 -webkit-transform: rotateY(180deg);
 -moz-transform: rotateY(180deg);
 -ms-transform: rotateY(180deg);
 -o-transform: rotateY(180deg);
 transform: rotateY(180deg);
}
 100% {
 -webkit-transform: rotateY(0deg);
 -moz-transform: rotateY(0deg);
 -ms-transform: rotateY(0deg);
 -o-transform: rotateY(0deg);
 transform: rotateY(0deg);
}
}
@-webkit-keyframes cd-rotate-3-out {  0% {
 -webkit-transform: rotateY(0);
}
 100% {
 -webkit-transform: rotateY(-180deg);
}
}
@-moz-keyframes cd-rotate-3-out {  0% {
 -moz-transform: rotateY(0);
}
 100% {
 -moz-transform: rotateY(-180deg);
}
}
@keyframes cd-rotate-3-out {  0% {
 -webkit-transform: rotateY(0);
 -moz-transform: rotateY(0);
 -ms-transform: rotateY(0);
 -o-transform: rotateY(0);
 transform: rotateY(0);
}
 100% {
 -webkit-transform: rotateY(-180deg);
 -moz-transform: rotateY(-180deg);
 -ms-transform: rotateY(-180deg);
 -o-transform: rotateY(-180deg);
 transform: rotateY(-180deg);
}
}
/* --------------------------------

xscale

-------------------------------- */
.cd-headline.scale b { opacity: 0; }
.cd-headline.scale i { display: inline-block; opacity: 0; -webkit-transform: scale(0); -moz-transform: scale(0); -ms-transform: scale(0); -o-transform: scale(0); transform: scale(0); }
.is-visible .cd-headline.scale i { opacity: 1; }
.cd-headline.scale i.in { -webkit-animation: scale-up 0.6s forwards; -moz-animation: scale-up 0.6s forwards; animation: scale-up 0.6s forwards; }
.cd-headline.scale i.out { -webkit-animation: scale-down 0.6s forwards; -moz-animation: scale-down 0.6s forwards; animation: scale-down 0.6s forwards; }
.no-csstransitions .cd-headline.scale i { -webkit-transform: scale(1); -moz-transform: scale(1); -ms-transform: scale(1); -o-transform: scale(1); transform: scale(1); opacity: 0; }
.no-csstransitions .cd-headline.scale .is-visible i { opacity: 1; }
 @-webkit-keyframes scale-up {  0% {
 -webkit-transform: scale(0);
 opacity: 0;
}
 60% {
 -webkit-transform: scale(1.2);
 opacity: 1;
}
 100% {
 -webkit-transform: scale(1);
 opacity: 1;
}
}
@-moz-keyframes scale-up {  0% {
 -moz-transform: scale(0);
 opacity: 0;
}
 60% {
 -moz-transform: scale(1.2);
 opacity: 1;
}
 100% {
 -moz-transform: scale(1);
 opacity: 1;
}
}
@keyframes scale-up {  0% {
 -webkit-transform: scale(0);
 -moz-transform: scale(0);
 -ms-transform: scale(0);
 -o-transform: scale(0);
 transform: scale(0);
 opacity: 0;
}
 60% {
 -webkit-transform: scale(1.2);
 -moz-transform: scale(1.2);
 -ms-transform: scale(1.2);
 -o-transform: scale(1.2);
 transform: scale(1.2);
 opacity: 1;
}
 100% {
 -webkit-transform: scale(1);
 -moz-transform: scale(1);
 -ms-transform: scale(1);
 -o-transform: scale(1);
 transform: scale(1);
 opacity: 1;
}
}
@-webkit-keyframes scale-down {  0% {
 -webkit-transform: scale(1);
 opacity: 1;
}
 60% {
 -webkit-transform: scale(0);
 opacity: 0;
}
}
@-moz-keyframes scale-down {  0% {
 -moz-transform: scale(1);
 opacity: 1;
}
 60% {
 -moz-transform: scale(0);
 opacity: 0;
}
}
@keyframes scale-down {  0% {
 -webkit-transform: scale(1);
 -moz-transform: scale(1);
 -ms-transform: scale(1);
 -o-transform: scale(1);
 transform: scale(1);
 opacity: 1;
}
 60% {
 -webkit-transform: scale(0);
 -moz-transform: scale(0);
 -ms-transform: scale(0);
 -o-transform: scale(0);
 transform: scale(0);
 opacity: 0;
}
}
/* --------------------------------

xpush

-------------------------------- */
.cd-headline.push b { opacity: 0; }
.cd-headline.push b.is-visible { opacity: 1; -webkit-animation: push-in 0.6s; -moz-animation: push-in 0.6s; animation: push-in 0.6s; }
.cd-headline.push b.is-hidden { -webkit-animation: push-out 0.6s; -moz-animation: push-out 0.6s; animation: push-out 0.6s; }
 @-webkit-keyframes push-in {  0% {
 opacity: 0;
 -webkit-transform: translateX(-100%);
}
 60% {
 opacity: 1;
 -webkit-transform: translateX(10%);
}
 100% {
 opacity: 1;
 -webkit-transform: translateX(0);
}
}
@-moz-keyframes push-in {  0% {
 opacity: 0;
 -moz-transform: translateX(-100%);
}
 60% {
 opacity: 1;
 -moz-transform: translateX(10%);
}
 100% {
 opacity: 1;
 -moz-transform: translateX(0);
}
}
@keyframes push-in {  0% {
 opacity: 0;
 -webkit-transform: translateX(-100%);
 -moz-transform: translateX(-100%);
 -ms-transform: translateX(-100%);
 -o-transform: translateX(-100%);
 transform: translateX(-100%);
}
 60% {
 opacity: 1;
 -webkit-transform: translateX(10%);
 -moz-transform: translateX(10%);
 -ms-transform: translateX(10%);
 -o-transform: translateX(10%);
 transform: translateX(10%);
}
 100% {
 opacity: 1;
 -webkit-transform: translateX(0);
 -moz-transform: translateX(0);
 -ms-transform: translateX(0);
 -o-transform: translateX(0);
 transform: translateX(0);
}
}
@-webkit-keyframes push-out {  0% {
 opacity: 1;
 -webkit-transform: translateX(0);
}
 60% {
 opacity: 0;
 -webkit-transform: translateX(110%);
}
 100% {
 opacity: 0;
 -webkit-transform: translateX(100%);
}
}
@-moz-keyframes push-out {  0% {
 opacity: 1;
 -moz-transform: translateX(0);
}
 60% {
 opacity: 0;
 -moz-transform: translateX(110%);
}
 100% {
 opacity: 0;
 -moz-transform: translateX(100%);
}
}
@keyframes push-out {  0% {
 opacity: 1;
 -webkit-transform: translateX(0);
 -moz-transform: translateX(0);
 -ms-transform: translateX(0);
 -o-transform: translateX(0);
 transform: translateX(0);
}
 60% {
 opacity: 0;
 -webkit-transform: translateX(110%);
 -moz-transform: translateX(110%);
 -ms-transform: translateX(110%);
 -o-transform: translateX(110%);
 transform: translateX(110%);
}
 100% {
 opacity: 0;
 -webkit-transform: translateX(100%);
 -moz-transform: translateX(100%);
 -ms-transform: translateX(100%);
 -o-transform: translateX(100%);
 transform: translateX(100%);
}
}


text:
describe('scaled (event)', () => {
  it('should trigger the `scaled` event', (done) => {
    const image = window.createImage();
    let viewer;

    image.addEventListener('viewed', () => {
      viewer.scale(-1);
    });

    image.addEventListener('scaled', (event) => {
      expect(event.type).to.equal('scaled');
      viewer.hide(true);
      done();
    });

    viewer = new Viewer(image);
    viewer.show();
  });

  it('should have expected properties in `event.detail`', (done) => {
    const image = window.createImage();
    let viewer;

    image.addEventListener('viewed', () => {
      viewer.scale(-1);
    });

    image.addEventListener('scaled', (event) => {
      const { detail } = event;

      expect(detail).to.be.an('object').that.has.all.keys('scaleX', 'scaleY', 'oldScaleX', 'oldScaleY');
      expect(detail.scaleX).to.be.a('number');
      expect(detail.scaleY).to.be.a('number');
      expect(detail.oldScaleX).to.be.a('number');
      expect(detail.oldScaleY).to.be.a('number');
      viewer.hide(true);
      done();
    });

    viewer = new Viewer(image);
    viewer.show();
  });

  it('should trigger the `scaled` event in inline mode', (done) => {
    const image = window.createImage();
    let viewer;

    image.addEventListener('viewed', () => {
      viewer.scale(-1);
    });

    image.addEventListener('scaled', (event) => {
      expect(event.type).to.equal('scaled');
      done();
    });

    viewer = new Viewer(image, {
      inline: true,
    });
  });

  it('should not cancel the `scaled` event', (done) => {
    const image = window.createImage();
    let viewer;

    image.addEventListener('viewed', () => {
      viewer.scale(-1);
    });

    image.addEventListener('scaled', (event) => {
      expect(event.defaultPrevented).to.false;
      event.preventDefault();
      expect(event.defaultPrevented).to.false;
      viewer.hide(true);
      done();
    });

    viewer = new Viewer(image);
    viewer.show();
  });
});


text:
package eu.df.jiffybox.builders;

import java.util.List;

/**
 * This class is used to build monitoring checks. Use any of the methods you
 * need and get the built object using the 'build' method.
 */
public interface MonitoringCheckBuilder {

    /**
     * Set the contact groups.
     *
     * @param contactgroups One or more contact group IDs to which e-mail
     *                      notifications should be sent. If this parameter is
     *                      missing the results can be checked only within the
     *                      control panel.
     * @return The same builder for method chaining.
     */
    MonitoringCheckBuilder withContactgroups(final List<Integer> contactgroups);

    /**
     * Set the check interval.
     *
     * @param checkInterval The check interval specifies in which period the
     *                      check is executed. Default: 5 minutes (300
     *                      Seconds).
     * @return The same builder for method chaining.
     */
    MonitoringCheckBuilder withCheckInterval(final int checkInterval);

    /**
     * Set the reminder interval.
     *
     * @param reminderInterval The reminder interval specifies in which period
     *                         e-mails are sent. Default: 1 Hour (3600
     *                         Seconds).
     * @return The same builder for method chaining.
     */
    MonitoringCheckBuilder withReminderInterval(final int reminderInterval);

    /**
     * Set the retry tolerance.
     *
     * @param retryTolerance The retry tolerance specifies how often a
     *                       monitoring check has to become critical before a
     *                       notification is sent. Default: 3.
     * @return The same builder for method chaining.
     */
    MonitoringCheckBuilder withRetryTolerance(final int retryTolerance);

    /**
     * Set the timeout.
     *
     * @param timeout The timeout value specifies after which time the check is
     *                aborted. Default: 30.
     * @return The same builder for method chaining.
     */
    MonitoringCheckBuilder withTimeout(final int timeout);

    /**
     * Set active.
     *
     * @param active Monitoring checks can be created as well active
     *               (asynchronous process), and checked after a reload of the
     *               monitoring configuration, as inactive and saved only.
     * @return The same builder for method chaining.
     */
    MonitoringCheckBuilder withActive(final boolean active);
}


text:
/**
* CTargetConnector.cpp: Defines the entry point for the console application.
*/

//precompiled header (MUST BE THE FIRST ENTRY IN EVERY CPP FILE)
#include "stdafx.h"

#include "CTargetConnector.h"
#include "dspreg_common.h"
#include "mcip_process.h"	//Entry points for IPC distributed functions (e.g. ssd(), jacobian())

#include "HPRPCCommon.h"
#include "CHPRPCRequestStoreImg.h"
#include "CHPRPCResponseStoreImg.h"
#include "CHPRPCRequestCalcSSDJacHess.h"
#include "CHPRPCResponseCalcSSDJacHess.h"
#include "CHPRPCResponseCalcSSD.h"

#include "cache_handling.h"

CTargetConnector::CTargetConnector()
: mbReceivingAnImageRequest(false),
  m_pHPRCPServer(0),
  mbInitNecessary(true)
{
	Reinitialize();
}

CTargetConnector::~CTargetConnector()
{
	//Note: Dtor unused in current design

	//Discard (only virtually allocated - in the background it is a static buffer) memory
	//Zero out image memory to have prepared bounding boxes for the first/next calculation
	mStoreImgRequest.Reinitialize();
}

/**
 * Initialize variables, zero memory that will be used for padding. (Will zero it only after boot time
 * and after the whole calculation finished).
 *
 * We will not allocate memory on the target system (e.g. to avoid heap fragmentation as the system might run for years and
 * no MMU is present). Hence the operations of discarding an old and creating a new instance can be executed here. The result
 * is the same as if the caller would drop an old and create a new instance.
 */
void CTargetConnector::Reinitialize(CHPRPCServer* HPRCPServer)
{
	#ifdef _TRACE_SOCK_
	logout("Reinitializing Target Connector.\n");
	#endif

	if(mbInitNecessary)
		Reinitialize();
	m_pHPRCPServer=HPRCPServer;
}

/**
 * Initialize variables, zero memory that will be used for padding. (Will zero it only after boot time
 * and after the whole calculation finished.
 *
 * We will not allocate memory on the target system (e.g. to avoid heap fragmentation as the system might run for years and
 * no MMU is present). Hence the operations of discarding an old and creating a new instance can be executed here. The result
 * is the same as if the caller would drop an old and create a new instance.
 */
void CTargetConnector::Reinitialize()
{
	mbInitNecessary = false;

	//Discard (only virtually allocated - in the background it is a static buffer) memory
	//Zero out image memory to have prepared bounding boxes for the first/next calculation
	mStoreImgRequest.Reinitialize();
}

/**
 * Process data coming from the remote PC
 * Passes receive buffer, payload length (without the initial 4 byte PCIe layer header)
 *
 * Flag NotifySenderWhenTransferFinished:
 * On of both parties (sender/reveiver) HAS to do busy waiting. This flag determines who does this (true=dsp, false=pc).
 *
 * If set to true, sending the data takes place in parallel (by DMA) to the execution of this command and we are responsible to detect when the transfer has been finished.
 * Then we have to notify the client (by an IRQ) about having received all data.
 *
 * If set to false, the client detected the transfer-finished-event and called us (by DMA) when all data already arrived at the DSP. Then we can just process the data.
 */
void CTargetConnector::ProcessIncomingCommand(const uint8_t* Buffer, const uint32_t BufferLen, bool NotifySenderWhenTransferFinished)
{
	//Ignore empty commands (can happen at startup when the memset(0)ized dummy_buffer will be used in a bogus irq-trigger ?)
	if(0 == BufferLen)
	{
		#ifdef _TRACE_HPRPC_VERBOSE_
		logout("Ignoring HPRPC command with length 0 (length incl. HPRPC header).\n");
		#endif
		return;
	}

	//Wait by busy waiting until the DMA transmission of the sender finished (explanation see method comment)
	uint32_t BufferLen_wo_EndToken = BufferLen;
	if(true == NotifySenderWhenTransferFinished)
	{
		const uint32_t ETL=4;	//End Token Length
		BufferLen_wo_EndToken -= ETL;	//We expect an end-token (only when NotifySenderWhenTransferFinished is set)

//Cache_inv((xdc_Ptr*) Buffer, BufferLen, Cache_Type_ALL, CACHE_BLOCKING);	//+-ETL: The first bytes were already made sure to have been received
//logout("Buffer=0x%X, Len=0x%X\n", Buffer, BufferLen);
//logout("EndToken at adr=0x%X is 0x%X.\n",  &Buffer[BufferLen_wo_EndToken], (uint32_t) *((uint8_t*)(&Buffer[BufferLen_wo_EndToken])));
//logout("EndToken at adr=0x%X is 0x%X.\n",  &Buffer[BufferLen_wo_EndToken+1], (uint32_t) *((uint8_t*)(&Buffer[BufferLen_wo_EndToken+1])));
//logout("EndToken at adr=0x%X is 0x%X.\n",  &Buffer[BufferLen_wo_EndToken+2], (uint32_t) *((uint8_t*)(&Buffer[BufferLen_wo_EndToken+2])));
//logout("EndToken at adr=0x%X is 0x%X.\n",  &Buffer[BufferLen_wo_EndToken+3], (uint32_t) *((uint8_t*)(&Buffer[BufferLen_wo_EndToken+3])));
//logout("PCIe header at adr=0x%X is 0x%X.\n",  &Buffer[-4], *((uint32_t*)(&Buffer[-4])));
//logout("Data at start adr=0x%X is 0x%X.\n",  &Buffer[0], *((uint32_t*)(&Buffer[0])));
//logout("Data at adr=0x%X is 0x%X.\n",  &Buffer[4], *((uint32_t*)(&Buffer[4])));

		#ifdef _TRACE_HPRPC_VERBOSE_
		logout("Wait for finished token of the sender on 0x%X.\n", &Buffer[BufferLen_wo_EndToken]);
		#endif

		//uint32_t uFinishedToken = 0xdeadbeef;
		do
		{
			Cache_inv((xdc_Ptr*) &Buffer[BufferLen_wo_EndToken], ETL, Cache_Type_ALL, CACHE_BLOCKING);
		}
		//while(0 == Buffer[BufferLen_wo_EndToken]); //todo: uFinishedToken == ... and (uint32_t)
		while(0 == (uint32_t) *((uint8_t*)(&Buffer[BufferLen_wo_EndToken])));

		#ifdef _TRACE_HPRPC_VERBOSE_
		logout("Finished token received, we can proceed ...\n");
		#endif

		Cache_inv((xdc_Ptr*) Buffer, BufferLen_wo_EndToken, Cache_Type_ALL, CACHE_BLOCKING);	//+-ETL: The first bytes were already made sure to have been received
	}

	//Remember that we possibly modified memory and are not initialized anymore
	mbInitNecessary = true;

	//While an incoming StoreImageRequest is received (which consists out of several incoming frames) no new command is expected
	if(true == mbReceivingAnImageRequest)
	{
		Process_HPRPC_StoreImage_Request(Buffer, BufferLen_wo_EndToken);
	}
	else
	{
		//This must be a new command with HPRPC header. Parse the header to find out about Request/Response/OpCode

		//Read first word from the protocol
		uint16_t iFirstHPRPCWord = *((uint16_t*)Buffer);

		//Parse and process
		if(0 != (iFirstHPRPCWord & 0x8000))
		{
			//Received a response on the target. This is not possible. In the current application version
			//no requests will be sent from the target to the PC, hence no response will be received on
			//the target.
			logout("ERROR:  HPRPCMalformedException()\n");
			exit(0);
		}

		//Check wether a new command arrives while a store image request was still in progress
		if((HPRPC_OP_STORE_IMG != iFirstHPRPCWord) && (true == mbReceivingAnImageRequest))
		{
			logout("ERROR: Received command with OpCode %u while an image store request (OpCode %u) was still in progress.\n", iFirstHPRPCWord, HPRPC_OP_STORE_IMG);
			logout("ERROR:  HPRPCMalformedException()\n");
			exit(0);
		}

		//Dump request memory (we do this here because we don't want to dump bulk image data)
		#ifdef _TRACE_HPRPC_VERBOSE_
		if(HPRPC_OP_STORE_IMG != iFirstHPRPCWord)	//don't log image store commands (also not the first image buffer)
		{
			DumpMemory("HPRPC_Req", Buffer, BufferLen_wo_EndToken);
		}
		#endif

		//This is a hprpc request (no response). The first word is the OpCode.
		//Act according to the OpCode.
		switch(iFirstHPRPCWord)
		{

			case HPRPC_OP_STORE_IMG:
				//Retreive image and bounding box data
				#ifdef _TRACE_HPRPC_
				logout("### Rcv StoreImage request\n");
				#endif
				Process_HPRPC_StoreImage_Request(Buffer, BufferLen_wo_EndToken);
				break;

			case HPRPC_OP_CALC_SSD_JAC_HESS:
				//Calculate SSD, Jacobian and Hessian
				#ifdef _TRACE_HPRPC_
				logout("### Rcv CalcSSDJacJess request\n");
				#endif
				Process_HPRPC_CalcSSDJacHess_Request(Buffer, BufferLen_wo_EndToken);
				break;

			case HPRPC_OP_CALC_SSD:
				//Calcuclate SSD only (used during Armijo line search)
				#ifdef _TRACE_HPRPC_
				logout("### Rcv CalcSSD request\n");
				#endif
				Process_HPRPC_CalcSSD_Request(Buffer, BufferLen_wo_EndToken);
				break;

			case HPRPC_OP_CALC_FINISHED:
				//We are allowed to free (zero out) memory and to prepare for another upcoming calculation
				#ifdef _TRACE_HPRPC_
				logout("### Rcv CalcFinished request\n");
				#endif
				Process_HPRPC_CalcFinished_Request(Buffer, BufferLen_wo_EndToken);
				break;

			default:
				logout("ERROR: Ignoring unknown HPRPC OpCode %u.\n", (uint32_t) iFirstHPRPCWord);
		}
	}
}

/**
* Parse an incoming HPRPC_OP_STORE_IMG HPRPC request, execute the command. Then assemble and send an HPRPC response message back to the client PC.
*/
void CTargetConnector::Process_HPRPC_StoreImage_Request(const uint8_t* Buffer, const uint32_t BufferLen)
{
	//Store image data and bounding boxes to RAM

	//Decide depending on the last incoming request whether this is a first or a subsequent store image call
	if(false == mbReceivingAnImageRequest)
	{
		//First incoming frame of a HPRPC store image request
		mbReceivingAnImageRequest = mStoreImgRequest.AssignFirstRcvBuffer(Buffer, BufferLen);
	}
	else
	{
		mbReceivingAnImageRequest = mStoreImgRequest.AssignSubsequentRcvBuffer(Buffer, BufferLen);
	}

	//When the mbReceivingAnImageRequest was set to false this means: All data avilable (not listening anymore).
	//Now an answer is expected by the caller. Furthermore the call can be processed (as all data is available).
	if(false == mbReceivingAnImageRequest)
	{
		uint32_t TimeForAddMargins=0;
		uint32_t TimeForPyramid=0;

		#ifdef _TRACE_PYRAMID_TIME_
			//Generate pyramid before sending ImageRcvNote to caller when we wnat to pass the timing values back for tracing purposes

			//Now we have all data we can generate the multilevel pyramid.
			mStoreImgRequest.GenerateMultilevelPyramid(TimeForAddMargins, TimeForPyramid);
		#endif

		//Send an answer to the remote peer about the fact that all images were stored correctly.
		//Assemble response (Returncode=ok)
		CHPRPCResponseStoreImg oResponse;

		oResponse.AssignValuesToBeSent(mStoreImgRequest.GetCallIndex(), TimeForAddMargins, TimeForPyramid);
		oResponse.SendToOtherPeer(*m_pHPRCPServer);
		#ifdef _TRACE_HPRPC_
		logout("### Snd StoreImage OK notification\n");
		#endif

		#ifndef _TRACE_PYRAMID_TIME_
			//See above (ifdef trace_pyramid), otherwise - if not defined - generate the pyramid here in parallel to the PC peer operation
			//Now we have all data we can generate the multilevel pyramid.
			mStoreImgRequest.GenerateMultilevelPyramid(TimeForAddMargins, TimeForPyramid);
		#endif
	}
	else
	{
		//The ethernet version was capable of receiving several packets. The current version should be compatible too if one extends the code a bit.
		//Here an IRQ must be set and in the host application the IRQ must be waited for. (There's allready a comment at that place.) One should
		//think about the performance for this procedure, do we loose parallelism ?
		//
		//If this will be implemented giTVecStaticMemorySize and giRVecStaticMemorySize should be big enough to fill all available DDR3 space.

		//else: Continue listening, data cannot be processed yet, tell client that we can receive more data
		logout("ERROR: HUGE MULTIPACKET TRANSFERS NOT IMPLEMENTED.\n");
		//we should give the sender an empty irq-answer here to tell him to continue to send.

		exit(0);
	}

}

/**
* Parse an incoming HPRPC_OP_CALC_SSD_JAC_HESS HPRPC request, execute the command. Then assemble and send an HPRPC response message back to the client PC.
*/
void CTargetConnector::Process_HPRPC_CalcSSDJacHess_Request(const uint8_t* Buffer, const uint32_t BufferLen)
{
	//Calculate SSD, Jacobian and Hessian
	CHPRPCRequestCalcSSDJacHess oRequest(CHPRPCRequestCalcSSDJacHess::CALC_SSD_JAC_HESS);
	oRequest.AssignRcvBuffer(Buffer, BufferLen);

	HPRPC_HDR_Request_CalcSSDJacHess* pHeader = oRequest.GetPayloadHeader();
	t_reg_real JD[3];
	t_reg_real JD2[9];

	t_reg_real fSSD = CalcSSDJacHess(pHeader->Level, pHeader->w, JD, JD2, pHeader->NumberOfCores);

	//Assemble response (Returncode=ok, SSD, JD, JD2)
	CHPRPCResponseCalcSSDJacHess oResponse;
	oResponse.AssignValuesToBeSent(oRequest.GetCallIndex(), fSSD, JD, JD2);
	oResponse.SendToOtherPeer(*m_pHPRCPServer);

	#ifdef _TRACE_HPRPC_
	logout("### Snd CalcSSDJacHess response\n");
	#endif
}

/**
* Parse an incoming HPRPC_OP_CALC_SSD request, execute the command. Then assemble and send an HPRPC response message back to the client PC.
*/
void CTargetConnector::Process_HPRPC_CalcSSD_Request(const uint8_t* Buffer, const uint32_t BufferLen)
{
	//Calculate SSD
	CHPRPCRequestCalcSSDJacHess oRequest(CHPRPCRequestCalcSSDJacHess::CALC_SSD_ONLY);
	oRequest.AssignRcvBuffer(Buffer, BufferLen);

	HPRPC_HDR_Request_CalcSSDJacHess* pHeader = oRequest.GetPayloadHeader();
	t_reg_real fSSD = CalcSSD(pHeader->Level, pHeader->w, pHeader->NumberOfCores);

	//Assemble response (Returncode=ok, SSD)
	CHPRPCResponseCalcSSD oResponse;
	oResponse.AssignValuesToBeSent(oRequest.GetCallIndex(), fSSD);
	oResponse.SendToOtherPeer(*m_pHPRCPServer);
	#ifdef _TRACE_HPRPC_
	logout("### Snd CalcSSD response\n");
	#endif
}

/**
* Parse an incoming HPRPC_OP_CALC_FINISHED request, execute the command.
*/
void CTargetConnector::Process_HPRPC_CalcFinished_Request(const uint8_t* Buffer, const uint32_t BufferLen)
{
	//Discard (only virtually allocated - in the background it is a static buffer) memory
	//Zero out image memory to have prepared bounding boxes for the next calculation
	//Performance doesn't matter here as this takes place between two independent calculations.
	Reinitialize();
}

t_reg_real CTargetConnector::CalcSSDJacHess(const uint32_t level, const t_reg_real w[3], t_reg_real JD[3], t_reg_real JD2[9], const uint32_T number_of_cores)
{
	//Extract values from multidimensional matlab arrays
	uint32_t BoundBox[4];
	uint32_t MarginAddon[3];
	t_reg_real DSPRange[4];
	uint32_t TOffset;
	uint32_t ROffset;
	ExtractLevel(level, BoundBox, MarginAddon, DSPRange, TOffset, ROffset);

	emxArray_uint8_T *TvecPtr=mStoreImgRequest.GetTVec()->GetMatlabArrayPtr();
	emxArray_uint8_T *RvecPtr=mStoreImgRequest.GetRVec()->GetMatlabArrayPtr();

	//Pass on call to matlab generated code
	t_reg_real rRetVal=0;
	jacobian(
		w,
		BoundBox,
		MarginAddon,
		DSPRange,
		TvecPtr,
		TOffset,
		RvecPtr,
		ROffset,
		mStoreImgRequest.GetD() / (0x1 << level),	//use d of this level (d divided by 2^level)
		&rRetVal,
		JD,
		JD2,
		number_of_cores
		);

	return rRetVal;
}

t_reg_real CTargetConnector::CalcSSD(const uint32_t level, const t_reg_real w[3], const uint32_T number_of_cores)
{
	//Extract values from multidimensional matlab arrays
	uint32_t BoundBox[4];
	uint32_t MarginAddon[3];
	t_reg_real DSPRange[4];
	uint32_t TOffset;
	uint32_t ROffset;
	ExtractLevel(level, BoundBox, MarginAddon, DSPRange, TOffset, ROffset);

	emxArray_uint8_T *TvecPtr=mStoreImgRequest.GetTVec()->GetMatlabArrayPtr();
	emxArray_uint8_T *RvecPtr=mStoreImgRequest.GetRVec()->GetMatlabArrayPtr();

	//Pass on call to matlab generated code
	t_reg_real rRetVal = ssd(
		w,
		BoundBox,
		MarginAddon,
		DSPRange,
		TvecPtr,
		TOffset,
		RvecPtr,
		ROffset,
		mStoreImgRequest.GetD() / (0x1 << level),	//use d of this level (d divided by 2^level)
		number_of_cores
		);

	return rRetVal;
}

/**
* Extract values for one specific level from the multilevel-enhanced arrays (which are 2 dimensional with the level as one additional parameter)
*/
void CTargetConnector::ExtractLevel(const uint32_t level, uint32_t BoundBox[4], uint32_t
             MarginAddon[3], t_reg_real DSPRange[4], uint32_t &TOffset, uint32_t &ROffset)
{
	//BoundBox
	for(int i=0; i<4; i++)	//todo: sizeof(a)/sizeof(b) ... also below
	{
		TMatlabArray_UInt32* pBoundBoxPerLvl = mStoreImgRequest.GetBoundBoxPerLvl();
		BoundBox[i] = pBoundBoxPerLvl->GetCMemoryArrayPtr()[pBoundBoxPerLvl->GetMatlabArrayPtr()->size[0] * i + level];
	}

	//MarginAddon
	for(int i=0; i<3; i++)
	{
		TMatlabArray_UInt32* pMarginAddonPerLvl = mStoreImgRequest.GetMarginAdditionPerLvl();
		MarginAddon[i] = pMarginAddonPerLvl->GetCMemoryArrayPtr()[pMarginAddonPerLvl->GetMatlabArrayPtr()->size[0] * i + level];
	}

	//DSPRange
	for(int i=0; i<4; i++)
	{
		TMatlabArray_Reg_Real* pDSPRangePerLvl = mStoreImgRequest.GetDSPRangePerLvl();
		DSPRange[i] = pDSPRangePerLvl->GetCMemoryArrayPtr()[pDSPRangePerLvl->GetMatlabArrayPtr()->size[0] * i + level];
	}

	//TOffset
	TMatlabArray_UInt32* pTLvlPtrs = mStoreImgRequest.GetTLvlPtrs();
	TOffset = pTLvlPtrs->GetCMemoryArrayPtr()[level] - 1;	//start offset (-1 because c++ uses 0, matlab 1 as start index)

	//ROffset
	TMatlabArray_UInt32* pRLvlPtrs = mStoreImgRequest.GetRLvlPtrs();
	ROffset = pRLvlPtrs->GetCMemoryArrayPtr()[level] - 1;	//start offset (-1 because c++ uses 0, matlab 1 as start index)
}


text:
package com.keybackup.fullscreenfragments.contactchooser.contactadapter;

import android.content.Context;
import android.os.Parcel;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageButton;

import com.android.secret.sharing.AndroidSecretSharing;
import com.android.secret.sharing.Contact;
import com.keybackup.R;
import com.keybackup.fullscreenfragments.contactchooser.ContactChooserFragment;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ItemAddContact implements Item {

    @Override
    public int getViewType() {
        return ContactsAdapter.RowType.ADD_ITEM.ordinal();
    }

    @Override
    public View getView(LayoutInflater inflater, View convertView, ViewGroup parent, final Context context, final ContactsAdapter adapter) {
        final ViewHolder holder;

        if (convertView == null) {
            convertView = inflater.inflate(R.layout.list_contact_add, parent, false);

            holder = new ViewHolder();
            ButterKnife.bind(holder, convertView);

            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        holder.add.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String name = holder.name.getText().toString();

                if (!TextUtils.isEmpty(name)) {
                    Contact androidContact = AndroidSecretSharing.newContact();
                    androidContact.setName(name);

                    ItemContact itemContact = new ItemContact(androidContact, true);
                    int position = adapter.addContact(itemContact);
                    adapter.click(position, ContactChooserFragment.REQUEST_KEY_SENT);

                    holder.name.setText("");
                }
            }
        });

        return convertView;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }

    public static class ViewHolder {
        @BindView(R.id.contact_chooser_add_name)
        EditText name;
        @BindView(R.id.contact_chooser_add)
        ImageButton add;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
    }

    public ItemAddContact() {
    }

    protected ItemAddContact(Parcel in) {
    }

    public static final Creator<ItemAddContact> CREATOR = new Creator<ItemAddContact>() {
        @Override
        public ItemAddContact createFromParcel(Parcel source) {
            return new ItemAddContact(source);
        }

        @Override
        public ItemAddContact[] newArray(int size) {
            return new ItemAddContact[size];
        }
    };
}


text:
import lacuna.bc

class Glyph(lacuna.bc.SubClass):
    """ Glyph base class """

class OwnedGlyph(Glyph):
    """ A single specific glyph on your planet.

    Object Attributes::

        id          12345,
        name        "bauxite"
        type        "bauxite"
        quantity    23

    name and type are always the same.  There's no longer such a thing as an
    individual glyph, only types of glyphs, which is why we have both an ID
    and a quantity.
    """

class AssembledArtifact(Glyph):
    """ One or more artifacts created by assembling glyphs.

    Object Attributes::

        item_name   "Halls of Vrbansk"
        quantity    10
    """
    def __init__(self, client, name:str, quan:int):
        self.client     = client
        self.item_name  = name
        self.quantity   = quan


text:
import { DataSource } from "../visualization"
import * as Rx from "rxjs"
import { Scheduler } from "rxjs/Scheduler"

type Response = { json(): Promise<any>, text(): Promise<string> }
declare const fetch: (url: string) => Promise<Response>

export default class LocalStorageCollector implements DataSource {
  public dataObs: Rx.Observable<any>
  public subscriptions: Rx.Subscription
  public topics: Rx.Observable<string[]> = Rx.Observable
    .fromEvent(window, "storage")
    .filter((e: StorageEvent) => e.key === "rxfiddle_topics")
    .map((e: StorageEvent) => e.newValue)
    .startWith(localStorage.getItem("rxfiddle_topics"))
    .map((json) => JSON.parse(json) as string[])
  private subject = new Rx.ReplaySubject()
  private topic: string

  constructor(topic?: string) {
    this.subscriptions = new Rx.Subscription()
    this.dataObs = this.subject.asObservable()
    if (!topic) {
      this.topics.subscribe(index => {
        console.log("Found topics", index, "starting", index.slice(-1)[0])
        this.start(index.slice(-1)[0])
      })
    } else {
      this.start(topic)
    }
  }

  public write: (data: any) => void = () => {
    // intentionally left blank
  }

  public restart(topic: string) {
    this.start(topic)
  }

  private start(topic: string) {
    this.topic = topic
    this.subscriptions.unsubscribe()
    this.subscriptions = new Rx.Subscription()
    this.subject.next("restart")

    let countKey = `rxfiddle_topic_${topic}_count`
    let sub = Rx.Observable.fromEvent(window, "storage")
      .filter((e: StorageEvent) => e.key === countKey)
      .debounceTime(10)
      .map((e: StorageEvent) => parseInt(e.newValue, 10))
      .scan((state: { prev: number, last: any[] }, next: number) => {
        let last = []
        console.log("Reading messages from", state.prev, "to", next)
        for (let i = state.prev; i < next; i++) {
          last.push(JSON.parse(localStorage.getItem(`rxfiddle_topic_${topic}_${i}`)))
        }
        return { last, prev: next }
      }, { last: [], prev: 0 })
      .flatMap(state => state.last)
      .subscribe(this.subject)

    this.subscriptions.add(sub)
  }
}

export class LocalStorageSender {
  private count: number = 0
  // tslint:disable-next-line:no-constructor-vars
  public constructor(private topic: string) {
    if (!localStorage) {
      throw new Error("LocalStorage support is required to use this RxFiddle MessageSender")
    }
    let topics = this.get("rxfiddle_topics") || []
    this.set("rxfiddle_topics", topics.concat([topic]))
  }
  public send(message: any) {
    this.count++
    try {
      this.set(`rxfiddle_topic_${this.topic}_count`, this.count)
      this.set(`rxfiddle_topic_${this.topic}_${this.count - 1}`, message)
    } catch (e) {
      this.clear()
    }
  }
  private get(key: string): any {
    return JSON.parse(localStorage.getItem(key))
  }
  private set(key: string, value: any) {
    try {
      localStorage.setItem(key, JSON.stringify(value))
    } catch (e) {
      console.warn("Cleared LocalStorage as it was full")
      this.clear()
    }
  }
  private clear() {
    Object.keys(localStorage).filter(k => k.startsWith("rxfiddle_topic")).forEach(key => localStorage.removeItem(key))
  }
}

// export class BatchedLocalStorageSender {
//   private subject: Rx.Subject<any>
//   private count: number = 0
//   private _send: number = 0
//   // tslint:disable-next-line:no-constructor-vars
//   public setup(topic: string, scheduler: Scheduler) {
//     let topics = JSON.parse(localStorage.getItem("rxfiddle_topics")) || []
//     localStorage.setItem("rxfiddle_topics", JSON.stringify(topics.concat([topic])))

//     this.subject = new Rx.ReplaySubject()
//     this.subject.bufferTime(1000, scheduler).subscribe(ms => {
//       this._send += ms.length
//       if (this.count !== this.count) {
//         console.log("count", this.count, this._send)
//       }
//       if (ms.length > 0) {
//         localStorage.setItem(`rxfiddle_topic_${topic}`, `${this.count}`)

//         console.log("Sending batch of ", ms.length)
//         postMessage({ message: { batch: ms }, topic }, window.location.origin)
//       }
//     }, e => console.warn(e))
//   }
//   public send(message: any) {
//     this.count++
//     this.subject.next(message)
//   }
// }


text:
A library to simplify the use of Java Mail API.

Currently, the library only contains a simplified API for reading a `javax.mail.Message`. Further work may add features to connect to mail stores or send messages.

Pull requests are welcome!

# How to use
Very simple - wrap a `javax.mail.Message` instance by creating a new `org.keylimebox.mail.EmailMessage`
and passing the message in the constructor.


text:
// ----------------------------------------------------------------------
//This code is developed as part of the Java CoG Kit project
//The terms of the license can be found at http://www.cogkit.org/license
//This message may not be removed or altered.
//----------------------------------------------------------------------

/*
 * Created on Feb 19, 2005
 */
package org.globus.cog.karajan.compiled.nodes.functions;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import k.rt.Channel;
import k.rt.ChannelOperator;
import k.rt.MemoryChannel;
import k.rt.Stack;
import k.thr.LWThread;

import org.globus.cog.karajan.analyzer.ChannelRef;
import org.globus.cog.karajan.analyzer.Signature;
import org.globus.cog.karajan.compiled.nodes.InternalFunction;

public class Unique extends InternalFunction {

	private ChannelRef<Object> c_vargs;
    private ChannelRef<Object> cr_vargs;
    private List<Object> initial;

    @Override
    protected Signature getSignature() {
        return new Signature(params("..."), returns(channel("...", DYNAMIC)));
    }

    private static class Op extends ChannelOperator<Object, Object> {
    	private Set<Object> set;
    	private Channel<Object> dest;

        public Op(List<Object> values, Channel<Object> dest) {
            super(null);
            this.dest = dest;
            if (values != null) {
            	addAll(values);
            }
            set = new HashSet<Object>();
        }

        @Override
        protected Object update(Object crt, Object value) {
            // this should be synchronized by now
			if (!set.contains(value)) {
				set.add(value);
				dest.add(value);
			}
			return null;
        }

        @Override
        public String toString() {
            return "uniqueop";
        }
    }

    @Override
    protected void initializeArgs(Stack stack) {
        c_vargs.set(stack, new Op(initial, cr_vargs.get(stack)));
    }

    @Override
    protected ChannelRef<?> makeStaticChannel(int index, List<Object> values) {
        uniqueStatic(values);
        return new ChannelRef.Static<Object>(new MemoryChannel<Object>(values));
    }

    private void uniqueStatic(List<Object> values) {
        initial = new ArrayList<Object>();
        Set<Object> s = new HashSet<Object>();
        for (Object o : values) {
        	if (!s.contains(o)) {
        		s.add(o);
        		initial.add(o);
        	}
        }
    }

    @Override
    protected ChannelRef<?> makeMixedChannel(int index, List<Object> staticValues) {
        uniqueStatic(staticValues);
        return new ChannelRef.Dynamic<Object>("...", index);
    }

    @Override
    protected ChannelRef<Object> makeDynamicChannel(String name, int index) {
        return new ChannelRef.Dynamic<Object>("...", index);
    }

    @Override
    protected void runBody(LWThread thr) {
    }
}