text:
package com.gs.obevo.util.knex;

import java.lang.ref.WeakReference;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicLong;

/**
 * Description: A repository for interned data - saves memory by serving out references to shared
 * instances of immutable objects - Strings in particular and also zero value numerics.
 * The zero value in numeric data is very inputreader but other values will rarely coincide
 * so only zero is interned for these objects.
 */
public final class InternMap {
    private static final int SEGMENTS = 64;               // Must be a power of 2. Represents likely concurrency.
    private static final int SEGMENT_SHIFT = 26;               // 32 minus number of bits representing segment value
    private static final InternMap instance = new InternMap();
    private static final Integer zeroInteger = Integer.valueOf(0);
    private static final Long zeroLong = Long.valueOf(0);
    private static final Float zeroFloat = Float.valueOf(0);
    private static final Double zeroDouble = Double.valueOf(0);
    private static final BigDecimal zeroDecimal = BigDecimal.ZERO;

    private final WeakHashMap<String, WeakReference<String>>[] stringCache;
    private final WeakHashMap<Timestamp, WeakReference<Timestamp>>[] timestampCache;
    private final AtomicLong[] accesses;
    private final AtomicLong[] misses;

    /**
     * Singleton pattern - we really want to have only one cache per JVM
     *
     * @return The one and only instance of InternMap
     */
    public static InternMap instance() {
        return instance;
    }

    @SuppressWarnings("unchecked")
    private InternMap() {
        this.stringCache = new WeakHashMap[SEGMENTS];
        this.timestampCache = new WeakHashMap[SEGMENTS];
        this.accesses = new AtomicLong[SEGMENTS];
        this.misses = new AtomicLong[SEGMENTS];
        for (int i = 0; i < SEGMENTS; i++) {
            this.stringCache[i] = new WeakHashMap<String, WeakReference<String>>();
            this.timestampCache[i] = new WeakHashMap<Timestamp, WeakReference<Timestamp>>();
            this.accesses[i] = new AtomicLong();
            this.misses[i] = new AtomicLong();
        }
    }

    /**
     * Store a String in the internal cache if not already present and return a reference to the instance held in the
     * cache.
     *
     * @param s The String to intern
     * @return The instance now held in the cache
     */
    public String intern(String s) {
        if (s == null) {
            return s;
        }
        int segment = s.hashCode() >>> SEGMENT_SHIFT;
        synchronized (this.stringCache[segment]) {
            this.accesses[segment].incrementAndGet();
            String retVal = null;
            WeakReference<String> ref = this.stringCache[segment].get(s);
            if (ref != null) {
                retVal = ref.get();
            }
            if (retVal == null) {
                retVal = s;
                this.misses[segment].incrementAndGet();
                this.stringCache[segment].put(s, new WeakReference<String>(s));
            }
            return retVal;
        }
    }

    /**
     * Store a LocalDate in the internal cache if not already present and return a reference to the instance held in the
     * cache.
     *
     * @param d The LocalDate to intern
     * @return The instance now held in the cache
     */
    public Timestamp intern(Timestamp d) {
        if (d == null) {
            return d;
        }
        int segment = d.hashCode() >>> SEGMENT_SHIFT;
        synchronized (this.timestampCache[segment]) {
            this.accesses[segment].incrementAndGet();
            Timestamp retVal = null;
            WeakReference<Timestamp> ref = this.timestampCache[segment].get(d);
            if (ref != null) {
                retVal = ref.get();
            }
            if (retVal == null) {
                retVal = d;
                this.misses[segment].incrementAndGet();
                this.timestampCache[segment].put(d, new WeakReference<Timestamp>(d));
            }
            return retVal;
        }
    }

    /**
     * Convenience method for Object which checks the run-time type and delegates to the appropriate method.
     * Useful to support future additional object types without necessarily having to change client code.
     *
     * @param o The object to intern
     * @return The instance now held in the cache
     */
    public Object intern(Object o) {
        if (o instanceof String) {
            return this.intern((String) o);
        } else if (o instanceof BigDecimal) {
            return this.intern((BigDecimal) o);
        } else if (o instanceof Double) {
            return this.intern((Double) o);
        } else if (o instanceof Float) {
            return this.intern((Float) o);
        } else if (o instanceof Long) {
            return this.intern((Long) o);
        } else if (o instanceof Integer) {
            return this.intern((Integer) o);
        } else {
            return o;
        }
    }

    /**
     * Return a reference to a shared Integer object if the cache holds one of the same value as the Integer passed in.
     * Currently the only Integer cached is zero.
     *
     * @param i The Integer to intern
     * @return A reference to a shared Integer object if the cache holds one of the same value as the Integer passed in.
     */
    private Integer intern(Integer i) {
        if (i == null) {
            return i;
        } else if (i.equals(zeroInteger)) {
            return zeroInteger;
        } else {
            return Integer.valueOf(i);
        }
    }

    /**
     * Return a reference to a shared Long object if the cache holds one of the same value as the Long passed in.
     * Currently the only Long cached is zero.
     *
     * @param l The Long to intern
     * @return A reference to a shared Long object if the cache holds one of the same value as the Long passed in.
     */
    private Long intern(Long l) {
        if (l == null) {
            return l;
        } else if (l.equals(zeroLong)) {
            return zeroLong;
        } else {
            return Long.valueOf(l);
        }
    }

    /**
     * Return a reference to a shared Float object if the cache holds one of the same value as the Float passed in.
     * Currently the only Float cached is zero.
     *
     * @param f The Float to intern
     * @return A reference to a shared Float object if the cache holds one of the same value as the Float passed in.
     */
    private Float intern(Float f) {
        if (f == null) {
            return f;
        } else if (f.equals(zeroFloat)) {
            return zeroFloat;
        } else {
            return Float.valueOf(f);
        }
    }

    /**
     * Return a reference to a shared Double object if the cache holds one of the same value as the Double passed in.
     * Currently the only Double cached is zero.
     *
     * @param d The Double to intern
     * @return A reference to a shared Double object if the cache holds one of the same value as the Double passed in.
     */
    private Double intern(Double d) {
        if (d == null) {
            return d;
        } else if (d.equals(zeroDouble)) {
            return zeroDouble;
        } else {
            return Double.valueOf(d);
        }
    }

    /**
     * Return a reference to a shared BigDecimal object if the cache holds one of the same value as the BigDecimal
     * passed in.
     * Currently the only BigDecimal cached is zero.
     *
     * @param d The BigDecimal to intern
     * @return A reference to a shared BigDecimal object if the cache holds one of the same value as the BigDecimal
     * passed in.
     */
    private BigDecimal intern(BigDecimal d) {
        if (d == null) {
            return d;
        } else if (d.equals(zeroDecimal)) {
            return zeroDecimal;
        } else {
            return d;
        }
    }

    /**
     * Show a summary of the cache state including current size and hit and miss statistics.
     */
    @Override
    public synchronized String toString() {
        StringBuilder s = new StringBuilder();
        long totalSize = 0;
        long totalAccesses = 0;
        long totalHits = 0;
        long totalMisses = 0;
        for (int i = 0; i < SEGMENTS; i++) {
            synchronized (this.stringCache[i]) {
                synchronized (this.timestampCache[i]) {
                    totalSize += this.stringCache[i].size() + this.timestampCache[i].size();
                    totalAccesses += this.accesses[i].get();
                    totalHits += this.accesses[i].get() - this.misses[i].get();
                    totalMisses += this.misses[i].get();
                }
            }
        }
        s.append("CacheSize=").append(totalSize);
        s.append(" Accesses=").append(totalAccesses);
        s.append(" Hits=").append(totalHits);
        s.append(" Misses=").append(totalMisses);
        return s.toString();
    }
}


text:
namespace astra {

    stream_reader* streamset_connection::create_reader()
    {
        ReaderPtr reader = astra::make_unique<stream_reader>(*this);
        stream_reader* rawPtr = reader.get();

        readers_.push_back(std::move(reader));
        return rawPtr;
    }

    bool streamset_connection::destroy_reader(astra::stream_reader* reader)
    {
        return true;
    }
}

redpajama_set_name: RedPajamaGithub


text:
    <title>Submit a new proposal</title>

Submit a talk proposal

        <form class="form-horizontal well bs-component col-lg-10 col-lg-offset-1"
              method="post" th:action="@{/submit}"  th:object="${submissionForm}">
            <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
            <fieldset>

                    Title

                        <input type="text" class="form-control" id="title" name="title" th:field="*{title}" placeholder="Title"/>
                        Incorrect title

                    Summary

                        <textarea class="form-control" rows="3" id="summary" name="summary" th:field="*{summary}"></textarea>
                        Describe your talk proposal here.
                        Incorrect Summary

                    Notes

                        <textarea class="form-control" rows="3" id="notes" name="notes" th:field="*{notes}"></textarea>
                        A message for the selection committee.

                    Track

                        <select class="form-control" id="track" name="track" th:field="*{track}">
                            <option th:each="track : ${tracks}" th:value="${track.id}" th:text="${track.displayName}">Category</option>
                        </select>

                        <button type="reset" class="btn btn-default">Cancel</button>
                        <button type="submit" class="btn btn-primary">Submit</button>

            </fieldset>
        </form>


text:
@interface PodsDummy_Pods_AdtradeSDKTests : NSObject
@end
@implementation PodsDummy_Pods_AdtradeSDKTests
@end


text:
arcflt
======

Library for reading and writing ESRI ArcMap ".flt" raster files.


text:
package org.easyrec.controller.dev;

import com.google.common.base.Function;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.easyrec.model.core.web.RemoteTenant;
import org.easyrec.model.plugin.NamedConfiguration;
import org.easyrec.model.plugin.PluginVO;
import org.easyrec.model.web.EasyRecSettings;
import org.easyrec.model.web.PluginParamDetails;
import org.easyrec.plugin.Plugin.LifecyclePhase;
import org.easyrec.plugin.configuration.ConfigurationHelper;
import org.easyrec.plugin.container.PluginRegistry;
import org.easyrec.plugin.generator.Generator;
import org.easyrec.plugin.generator.GeneratorConfiguration;
import org.easyrec.plugin.model.PluginId;
import org.easyrec.plugin.stats.GeneratorStatistics;
import org.easyrec.service.core.TenantService;
import org.easyrec.service.domain.DomainActionService;
import org.easyrec.service.domain.DomainItemAssocService;
import org.easyrec.service.domain.TypeMappingService;
import org.easyrec.service.web.PluginScheduler;
import org.easyrec.service.web.RemoteTenantService;
import org.easyrec.service.web.nodomain.ShopRecommenderService;
import org.easyrec.store.dao.core.types.AssocTypeDAO;
import org.easyrec.store.dao.plugin.LogEntryDAO;
import org.easyrec.store.dao.plugin.NamedConfigurationDAO;
import org.easyrec.store.dao.plugin.PluginDAO;
import org.easyrec.store.dao.web.BackTrackingDAO;
import org.easyrec.store.dao.web.RemoteTenantDAO;
import org.easyrec.util.core.MessageBlock;
import org.easyrec.util.core.Security;
import org.easyrec.utils.MyUtils;
import org.easyrec.utils.PageStringGenerator;
import org.easyrec.utils.servlet.ServletUtils;
import org.easyrec.vocabulary.MSG;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;
import org.springframework.web.util.HtmlUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;

/**
 * @author dmann
 */
public class TenantsController extends MultiActionController {

    private RemoteTenantDAO remoteTenantDAO;
    private DomainItemAssocService itemAssocService;
    private DomainActionService actionService;
    private TenantService tenantService;
    private PluginScheduler pluginScheduler;
    private LogEntryDAO logEntryDAO;
    private BackTrackingDAO backTrackingDAO;
    private ShopRecommenderService shopRecommenderService;
    private RemoteTenantService remoteTenantService;
    private PluginDAO pluginDAO;
    private PluginRegistry pluginRegistry;
    private TypeMappingService typeMappingService;
    private AssocTypeDAO assocTypeDAO;
    private NamedConfigurationDAO namedConfigurationDAO;
    private EasyRecSettings easyrecSettings;

    public void setEasyrecSettings(EasyRecSettings easyrecSettigs) {
        this.easyrecSettings = easyrecSettigs;
    }

    public void setBackTrackingDAO(BackTrackingDAO backTrackingDAO) {
        this.backTrackingDAO = backTrackingDAO;
    }

    public void setLogEntryDAO(LogEntryDAO logEntryDAO) {
        this.logEntryDAO = logEntryDAO;
    }

    public void setPluginScheduler(PluginScheduler pluginScheduler) {
        this.pluginScheduler = pluginScheduler;
    }

    public void setRemoteTenantDAO(RemoteTenantDAO remoteTenantDAO) {
        this.remoteTenantDAO = remoteTenantDAO;
    }

    public void setActionService(DomainActionService actionService) {
        this.actionService = actionService;
    }

    public void setItemAssocService(DomainItemAssocService itemAssocService) {
        this.itemAssocService = itemAssocService;
    }

    public void setTenantService(TenantService tenantService) {
        this.tenantService = tenantService;
    }

    public void setShopRecommenderService(ShopRecommenderService shopRecommenderService) {
        this.shopRecommenderService = shopRecommenderService;
    }

    public void setRemoteTenantService(RemoteTenantService remoteTenantService) {
        this.remoteTenantService = remoteTenantService;
    }

    public void setPluginDAO(PluginDAO pluginDAO) {
        this.pluginDAO = pluginDAO;
    }

    public void setPluginRegistry(PluginRegistry pluginRegistry) {
        this.pluginRegistry = pluginRegistry;
    }

    public void setTypeMappingService(TypeMappingService typeMappingService) {
        this.typeMappingService = typeMappingService;
    }

    public void setAssocTypeDAO(AssocTypeDAO assocTypeDAO) {
        this.assocTypeDAO = assocTypeDAO;
    }

    public void setNamedConfigurationDAO(NamedConfigurationDAO namedConfigurationDAO) {
        this.namedConfigurationDAO = namedConfigurationDAO;
    }

    private static final String REMOVE_TENANT = "removeTenant";
    private static final String RESET_TENANT = "resetTenant";
    private static final String VIEW_ALL_TENANTS = "viewAllTenants";
    private static final String VIEW_TENANTS = "viewTenants";
    private static final String VIEW_PLUGIN_CONFIG = "viewPluginConfig";
    private static final String VIEW_PLUGIN_DETAILS = "viewPluginDetails";
    private static final String STORE_SCHEDULER = "storeScheduler";
    private static final String STORE_BACKTRACKING = "storeBackTracking";
    private static final String STORE_MAXACTIONS = "storeMaxActions";
    private static final String STORE_ARCHIVE = "storeArchive";
    private static final String SESSION_MAPPING = "sessionMapping";
    private static final String STORE_PLUGIN_CONFIG = "storePluginConfig";
    private static final String STORE_PLUGINS_ACTIVE = "storePluginsActive";

    public ModelAndView removetenant(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);

        if (Security.isDeveloper(request)) {
            RemoteTenant remoteTenant = remoteTenantDAO.get(operatorId, tenantId);

            if (remoteTenant != null) {
                remoteTenantService.removeTenant(remoteTenant.getId());

                Security.setAttribute(request, "tenantId", null);
                return MessageBlock.createSingle(mav, MSG.TENANT_REMOVED, REMOVE_TENANT, MSG.SUCCESS);
            }

            return MessageBlock.createSingle(mav, MSG.TENANT_REMOVE_FAILED, REMOVE_TENANT, MSG.ERROR);
        } else {
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, REMOVE_TENANT, MSG.ERROR);
        }
    }

    public ModelAndView resettenant(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);

        if (Security.isDeveloper(request)) {
            RemoteTenant remoteTenant = remoteTenantDAO.get(operatorId, tenantId);

            if (remoteTenant != null)
                try {
                    itemAssocService.removeAllItemAssocsFromTenant(remoteTenant.getId());
                    actionService.removeActionsByTenant(remoteTenant.getId());
                    backTrackingDAO.clear(remoteTenant.getId());
                    remoteTenantService.resetTenant(remoteTenant.getId());
                    return MessageBlock.createSingle(mav, MSG.TENANT_RESET, RESET_TENANT, MSG.SUCCESS);
                } catch (Exception e) {
                    logger.debug(e);
                }

            return MessageBlock.createSingle(mav, MSG.TENANT_RESET_FAILED, RESET_TENANT, MSG.ERROR);
        } else {
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, RESET_TENANT, MSG.ERROR);
        }
    }

    public ModelAndView viewalltenants(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
        String searchString = ServletUtils.getSafeParameter(request, "searchString", "");

        int siteNumber = ServletUtils.getSafeParameter(request, "siteNumber", 0);
        boolean filterDemoTenants = (ServletUtils.getSafeParameter(request, "filterDemoTenants", 1) == 1);

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);
        mav.addObject("searchString", searchString);
        mav.addObject("url", request.getRequestURL());

        if (Security.isDeveloper(request)) {
            PageStringGenerator psg = new PageStringGenerator(
                    request.getRequestURL() + "?" + request.getQueryString());

            List<RemoteTenant> remoteTenants = remoteTenantDAO.getTenants(siteNumber * psg.getNumberOfItemsPerPage(),
                    psg.getNumberOfItemsPerPage(), filterDemoTenants, searchString);

            if (remoteTenants.isEmpty()) {
                remoteTenants = remoteTenantDAO.getTenants(siteNumber * psg.getNumberOfItemsPerPage(),
                        psg.getNumberOfItemsPerPage(), false, searchString);
                filterDemoTenants = false;
            }

            List<Integer> runningTenants = logEntryDAO.getRunningTenants();
            Integer runningTenantId = runningTenants.size() > 0 ? runningTenants.get(0) : null;

            mav.addObject("runningTenantId", runningTenantId);

            int remoteTenantsTotal = remoteTenantDAO.count(filterDemoTenants, searchString);
            mav.addObject("filterDemoTenants", filterDemoTenants);
            mav.addObject("remoteTenantsTotal", remoteTenantsTotal);
            mav.addObject("pageMenuString", psg.getPageMenuString(remoteTenantsTotal, siteNumber));

            mav.setViewName("dev/page");
            mav.addObject("page", "viewalltenants");
            mav.addObject("dbname", remoteTenantDAO.getDbName());
            mav.addObject("remoteTenants", MyUtils.sizeOf(remoteTenants) > 0 ? remoteTenants : null);

            return mav;
        } else {
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, VIEW_ALL_TENANTS, MSG.ERROR);
        }
    }

    public ModelAndView viewtenants(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);

        if (Security.isDeveloper(request)) {
            List<RemoteTenant> remoteTenants = remoteTenantDAO.getTenantsFromOperator(operatorId);

            List<Integer> runningTenants = logEntryDAO.getRunningTenants();
            Integer runningTenantId = runningTenants.size() > 0 ? runningTenants.get(0) : null;

            mav.setViewName("dev/page");
            mav.addObject("page", "viewtenants");
            mav.addObject("remoteTenants", MyUtils.sizeOf(remoteTenants) > 0 ? remoteTenants : null);
            mav.addObject("dbname", remoteTenantDAO.getDbName());
            mav.addObject("runningTenantId", runningTenantId);

            return mav;
        } else {
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, VIEW_TENANTS, MSG.ERROR);
        }
    }

    @RequestMapping
    public ModelAndView viewpluginconfig(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);

        if (Security.isDeveloper(request)) {
            mav.setViewName("dev/page");
            mav.addObject("page", "viewpluginconfig");

            final RemoteTenant remoteTenant = remoteTenantDAO.get(operatorId, tenantId);

            if (remoteTenant != null) {
                Properties tenantConfig = tenantService.getTenantConfig(remoteTenant.getId());
                if (tenantConfig != null) {
                    mav.addObject("schedulerEnabled",
                            tenantConfig.getProperty(RemoteTenant.SCHEDULER_ENABLED));
                    mav.addObject("schedulerExecutionTime",
                            tenantConfig.getProperty(RemoteTenant.SCHEDULER_EXECUTION_TIME));
                    mav.addObject("backtrackingEnabled", tenantConfig.getProperty(RemoteTenant.BACKTRACKING));
                    mav.addObject("backtrackingURL", tenantConfig.getProperty(RemoteTenant.BACKTRACKING_URL));
                    mav.addObject("archivingEnabled", tenantConfig.getProperty(RemoteTenant.AUTO_ARCHIVER_ENABLED));
                    mav.addObject("archivingTime", tenantConfig.getProperty(RemoteTenant.AUTO_ARCHIVER_TIME_RANGE));
                    mav.addObject("sessionToUserMappingEnabled", tenantConfig.getProperty(RemoteTenant.SESSION_TO_USER_MAPPING_ENABLED));
                    mav.addObject("maxActions", tenantConfig.getProperty(RemoteTenant.MAXACTIONS));
                    logger.info("DevController - view generators config - tenantConfig found!!!!!!!!!!!!!!!!");
                    mav.addObject("selectedPlugin", tenantConfig.getProperty(PluginRegistry.GENERATOR_PROP));
                } else {
                    mav.addObject("schedulerEnabled", "false");
                    mav.addObject("backtrackingEnabled", "false");
                    mav.addObject("pluginsActive", "false");
                    logger.info("DevController - view generators config - tenantConfig NOT found!!!!!!!!!!!!!!!!");
                }

                Map<String, Integer> assocTypes = assocTypeDAO.getMapping(remoteTenant.getId(), true);
                mav.addObject("assocTypes", assocTypes);

                Map<String, PluginId> activePlugins =
                        Maps.transformValues(assocTypes, new Function<Integer, PluginId>() {
                            @Override
                            public PluginId apply(Integer input) {
                                NamedConfiguration namedConfiguration =
                                        namedConfigurationDAO.readActiveConfiguration(remoteTenant.getId(), input);

                                return namedConfiguration != null ? namedConfiguration.getPluginId()
                                        : new PluginId("http://www.easyrec.org/plugins/ARM/",
                                        easyrecSettings.getVersion());
                            }
                        });
                mav.addObject("activePlugins", activePlugins);

                List<PluginVO> pluginList = pluginDAO.loadPluginInfos(LifecyclePhase.INITIALIZED.toString());
                mav.addObject("pluginList", pluginList);
            }

            mav.addObject("tenantId", tenantId);
            return mav;
        } else {
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, VIEW_PLUGIN_CONFIG, MSG.ERROR);
        }
    }

    public ModelAndView storebacktracking(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
        String backtracking = ServletUtils.getSafeParameter(request, "backtracking", "");
        String backtrackingURL = ServletUtils.getSafeParameter(request, "backtrackingURL", null);

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);

        if (Security.isDeveloper(request)) {
            RemoteTenant r = remoteTenantDAO.get(operatorId, tenantId);
            if (r != null) {

                if (!"".equals(backtracking)) {
                    tenantService.updateConfigProperty(r.getId(), RemoteTenant.BACKTRACKING, backtracking);
                    r.setBacktracking(backtracking);
                    shopRecommenderService.emptyCache();
                }
                if (backtrackingURL != null) {
                    tenantService.updateConfigProperty(r.getId(), RemoteTenant.BACKTRACKING_URL, backtrackingURL);
                    r.setBackTrackingURL(backtrackingURL);
                    shopRecommenderService.emptyCache();
                }

            }
            return MessageBlock.createSingle(mav, MSG.TENANT_UPDATED, STORE_BACKTRACKING, MSG.SUCCESS);
        } else {
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, STORE_BACKTRACKING, MSG.ERROR);
        }
    }

    public ModelAndView storemaxactions(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");

        String maxactions = ServletUtils.getSafeParameter(request, "maxactions", "");

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);

        if (Security.isDeveloper(request)) {

            RemoteTenant r = remoteTenantDAO.get(operatorId, tenantId);
            if (r != null) {
                tenantService.updateConfigProperty(r.getId(), RemoteTenant.MAXACTIONS, maxactions);
                r.setMaxActions(maxactions);
                shopRecommenderService.emptyCache();
                remoteTenantDAO.updateTenantInCache(r);

            }
            return MessageBlock.createSingle(mav, MSG.OPERATION_SUCCESSFUL, STORE_MAXACTIONS, MSG.SUCCESS);
        } else {
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, STORE_MAXACTIONS, MSG.ERROR);
        }
    }

    public ModelAndView scheduler(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
        String enabled = ServletUtils.getSafeParameter(request, "enabled", "");
        String executionTime = ServletUtils.getSafeParameter(request, "executiontime", "");

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);

        if (!Security.isDeveloper(request))
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, STORE_SCHEDULER, MSG.ERROR);

        RemoteTenant remoteTenant = remoteTenantDAO.get(operatorId, tenantId);

        if (remoteTenant != null) {
            remoteTenant.setSchedulingEnabled(enabled);
            String previousTime = remoteTenant.getSchedulerExecutionTime();
            remoteTenant.setSchedulerExecutionTime(executionTime);

            tenantService.storeTenantConfig(remoteTenant.getId(), remoteTenant.getTenantConfigProperties());

            // always update! tenant is removed on update if scheduling is disabled
            //if (!Strings.isNullOrEmpty(executionTime)) {
                pluginScheduler.addTask(remoteTenant, previousTime);
            //}
        }

        return MessageBlock.createSingle(mav, MSG.PLUGIN_CONFIG_CHANGED, STORE_SCHEDULER, MSG.SUCCESS);
    }

    public ModelAndView storearchive(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
        String archiving = ServletUtils.getSafeParameter(request, "archiving", "");
        String archivingtime = ServletUtils.getSafeParameter(request, "archivingtime", "");

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);

        if (Security.isDeveloper(request)) {
            RemoteTenant r = remoteTenantDAO.get(operatorId, tenantId);
            if (r != null) {

                r.setAutoArchiving(archiving);
                if (!Strings.isNullOrEmpty(archivingtime)) {
                    r.setAutoArchiverTimeRange(archivingtime);
                }

                tenantService.storeTenantConfig(r.getId(), r.getTenantConfigProperties());

            }
            return MessageBlock.createSingle(mav, MSG.ARCHIVE_CONFIG_CHANGED, STORE_ARCHIVE, MSG.SUCCESS);
        } else {
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, STORE_ARCHIVE, MSG.ERROR);
        }
    }

    public ModelAndView storesessionmapping(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
        String sessionmapping = ServletUtils.getSafeParameter(request, "sessionmapping", "");

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);

        if (Security.isDeveloper(request)) {
            RemoteTenant r = remoteTenantDAO.get(operatorId, tenantId);
            if (r != null) {

                r.setSessionMapping(sessionmapping);
                tenantService.storeTenantConfig(r.getId(), r.getTenantConfigProperties());

            }
            return MessageBlock.createSingle(mav, MSG.SESSIONMAPPING_CONFIG_CHANGED, SESSION_MAPPING, MSG.SUCCESS);
        } else {
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, SESSION_MAPPING, MSG.ERROR);
        }
    }

    public ModelAndView viewpluginconfigdetails(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
        int assocTypeId = ServletUtils.getSafeParameter(request, "assocTypeId", -1);

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);
        mav.addObject("assocTypeId", assocTypeId);

        if (!Security.isDeveloper(request)) {
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, VIEW_PLUGIN_DETAILS, MSG.ERROR);
        }

        mav.setViewName("dev/pluginconfigdetails");
        mav.addObject("signedinOperatorId", Security.signedInOperatorId(request));
        RemoteTenant remoteTenant = remoteTenantDAO.get(operatorId, tenantId);
        String pluginIdStr = ServletUtils.getSafeParameter(request, "pluginId", "");
        if (assocTypeId < 0) {
            logger.info("invalid assoc type.");
            return mav;
        }
        Map<String, List<PluginParamDetails>> params = null;
        if (pluginIdStr.equals("")) {
            namedConfigurationDAO.deactivateByAssocType(remoteTenant.getId(), assocTypeId);
            params = new HashMap<String, List<PluginParamDetails>>();
        } else {
            PluginId pluginId = PluginId.parsePluginId(pluginIdStr);
            logger.info("pluginId: " + pluginId);

            Properties pluginConfig = null;

            if (remoteTenant != null) {
                pluginConfig = tenantService.getTenantConfig(remoteTenant.getId());
            }

            try {
                Generator<GeneratorConfiguration, GeneratorStatistics> generator =
                        pluginRegistry.getGenerators().get(pluginId);

                if (generator == null) {
                    logger.info("no generator found!");
                    return mav;
                }

                // make sure the plugin is registered as a valid source for the tenant
                try {
                    typeMappingService.getIdOfSourceType(remoteTenant.getId(), pluginId.toString());
                } catch (IllegalArgumentException iae) {
                    tenantService.insertSourceTypeForTenant(remoteTenant.getId(), pluginId.toString());
                    logger.debug("added new sourceType");
                }

                List<NamedConfiguration> namedConfigurations =
                        namedConfigurationDAO.readConfigurations(remoteTenant.getId(), assocTypeId,
                            generator.getId());

                if (namedConfigurations.isEmpty()) {
                    GeneratorConfiguration defaultConfiguration = generator.newConfiguration();
                    defaultConfiguration.setAssociationType(
                            typeMappingService.getAssocTypeById(remoteTenant.getId(), assocTypeId));

                    // when there is no active configuration for <tenant, assocType> then set the newly created
                    // configuration as the active one
                    boolean isActive = namedConfigurationDAO.readActiveConfiguration(remoteTenant.getId(),
                            assocTypeId) == null;
                    // more intuitive semantics? select configuration -> is instantly active
                    isActive = true;

                    NamedConfiguration namedConfiguration =
                            new NamedConfiguration(remoteTenant.getId(), assocTypeId, generator.getId(),
                                defaultConfiguration.getConfigurationName(), defaultConfiguration, isActive);

                    int rowsModified = namedConfigurationDAO.createConfiguration(namedConfiguration);
                    if (rowsModified == 0) {
                        logger.error("could not store named configuration");
                        return mav;
                    }

                    namedConfigurations.add(namedConfiguration);
                } else {
                    // TODO currently a workaround for setting the first of the named configurations as active when the
                    // plugin changes
                    namedConfigurations.get(0).setActive(true);
                    namedConfigurationDAO.updateConfiguration(namedConfigurations.get(0));
                }

                params = Maps.newHashMapWithExpectedSize(namedConfigurations.size());
                String activeConfiguration = null;

                for (NamedConfiguration namedConfiguration : namedConfigurations) {
                    if (namedConfiguration.isActive()) activeConfiguration = namedConfiguration.getName();

                    final ConfigurationHelper configurationHelper =
                        new ConfigurationHelper(namedConfiguration.getConfiguration());
                    List<PluginParamDetails> parameters = Lists.newArrayList();
                    Set<String> paramNames = configurationHelper.getParameterNames();
                    List<String> orderedParameterNames = new ArrayList<String>(paramNames);
                    Collections.sort(orderedParameterNames, new Comparator<String>(){

                        @Override
                        public int compare(String o1, String o2) {
                            int diff = configurationHelper.getParameterDisplayOrder(o1) - configurationHelper.getParameterDisplayOrder(o2);
                            if (diff != 0) return diff;
                            return o1.compareTo(o2);
                        }
                    });
                    for (String param : orderedParameterNames) {
                        if (param.equals("associationType") || param.equals("configurationName")) continue;

                        Object valueObject = configurationHelper.getParameterValue(param);
                        if (valueObject instanceof String) {
                            valueObject = HtmlUtils.htmlEscape((String)valueObject);
                        }

                        PluginParamDetails pluginParamDetails = new PluginParamDetails(param,
                            configurationHelper.getParameterDisplayName(param),
                            configurationHelper.getParameterDescription(param),
                            configurationHelper.getParameterShortDescription(param),
                            valueObject,
                            configurationHelper.getParameterStringValue(param),
                            configurationHelper.getParameterOptional(param),
                            configurationHelper.getParameterAsTextArea(param));

                        parameters.add(pluginParamDetails);

                        // TODO check if sourceType needs to be treated in a similar way
                        if (param.equals("associationType")) {
                            try {
                                typeMappingService.getIdOfAssocType(remoteTenant.getId(),
                                    pluginParamDetails.getStringValue());
                            } catch (IllegalArgumentException iae) {
                                tenantService.insertAssocTypeForTenant(remoteTenant.getId(),
                                    pluginParamDetails.getStringValue());
                                logger.debug("added new assocType");
                            }
                        }
                    }

                    params.put(namedConfiguration.getName(), parameters);
                }

                mav.addObject("activeConfiguration", activeConfiguration);

                mav.addObject("generator", generator);

            /*
            pluginConfig = configurationHelper.getValuesAsProperties(pluginConfig, pluginId);
            pluginConfig.setProperty(PluginRegistry.GENERATOR_PROP, pluginId);
            tenantService.storeTenantConfig(remoteTenant.getId(), pluginConfig);
            remoteTenant.setGeneratorConfig(configuration);
            */
            } catch (Exception e) {
                logger.error("An error occurred trying to get the generator parameters", e);
            }
        }

        mav.addObject("paramList", params);
        return mav;
    }

    public ModelAndView storepluginconfig(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
        String key = ServletUtils.getSafeParameter(request, "key", "");
        String value = ServletUtils.getSafeParameter(request, "value", "");
        value = HtmlUtils.htmlUnescape(value);
        String configurationName = ServletUtils.getSafeParameter(request, "configurationName", "");
        int assocTypeId = ServletUtils.getSafeParameter(request, "assocTypeId", -1);

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);
        mav.addObject("assocTypeId", assocTypeId);
        mav.addObject("configurationName", configurationName);

        if (!Security.isDeveloper(request))
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, STORE_PLUGIN_CONFIG, MSG.ERROR);

        RemoteTenant remoteTenant = remoteTenantDAO.get(operatorId, tenantId);

        if (remoteTenant == null)
            return MessageBlock.createSingle(mav, MSG.PLUGIN_CONFIG_CHANGED, STORE_PLUGIN_CONFIG, MSG.ERROR);

        // skip configuration renaming
        if (key.equals("configurationName"))
            return MessageBlock.createSingle(mav, MSG.PLUGIN_CONFIG_CHANGED, STORE_PLUGIN_CONFIG, MSG.SUCCESS);

        if (key.equals("associationType"))
            try {
                typeMappingService.getIdOfAssocType(remoteTenant.getId(), value);
            } catch (IllegalArgumentException iae) {
                tenantService.insertAssocTypeForTenant(remoteTenant.getId(), value);
                logger.debug("added new assocType");
            }

        if (key.equals("sourceType"))
            try {
                typeMappingService.getIdOfSourceType(remoteTenant.getId(), value);
            } catch (IllegalArgumentException iae) {
                tenantService.insertSourceTypeForTenant(remoteTenant.getId(), value);
                logger.debug("added new sourceType");
            }

        String pluginIdStr = ServletUtils.getSafeParameter(request, "pluginId", "");
        PluginId pluginId = PluginId.parsePluginId(pluginIdStr);
        Properties pluginConfig = tenantService.getTenantConfig(remoteTenant.getId());

        try {
            Generator<GeneratorConfiguration, GeneratorStatistics> generator =
                    pluginRegistry.getGenerators().get(pluginId);

            if (generator == null)
                return MessageBlock.createSingle(mav, MSG.PLUGIN_CONFIG_CHANGED, STORE_PLUGIN_CONFIG, MSG.ERROR);

            NamedConfiguration namedConfiguration =
                    namedConfigurationDAO.readConfiguration(remoteTenant.getId(), assocTypeId, pluginId,
                            configurationName);

            if (namedConfiguration == null)
                return MessageBlock.createSingle(mav, MSG.PLUGIN_CONFIG_CHANGED, STORE_PLUGIN_CONFIG, MSG.ERROR);

            ConfigurationHelper configurationHelper =
                    new ConfigurationHelper(namedConfiguration.getConfiguration());

            MutablePropertyValues values = new MutablePropertyValues();
            values.addPropertyValue(key, value);
            BindingResult bindingResult = configurationHelper.setValues(values);

            if (!bindingResult.hasErrors())
                namedConfigurationDAO.updateConfiguration(namedConfiguration);
            else
                return MessageBlock.createSingle(mav, MSG.PLUGIN_PARAM_INVALID.replace(
                        bindingResult.getFieldError().getDefaultMessage()), STORE_PLUGIN_CONFIG, MSG.ERROR);
        } catch (Exception e) {
            logger.error("An error occurred storing the plugin configuration! " + e);
        }

        return MessageBlock.createSingle(mav, MSG.PLUGIN_CONFIG_CHANGED, STORE_PLUGIN_CONFIG, MSG.SUCCESS);
    }

    public ModelAndView storepluginsactive(HttpServletRequest request, HttpServletResponse httpServletResponse) {
        String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
        String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
        String pluginsactive = ServletUtils.getSafeParameter(request, "pluginsactive", "");

        ModelAndView mav = new ModelAndView("page");

        mav.addObject("title", "easyrec :: administration");

        mav.addObject("operatorId", operatorId);
        mav.addObject("tenantId", tenantId);

        if (Security.isDeveloper(request)) {
            mav.setViewName("dev/page");
            RemoteTenant r = remoteTenantDAO.get(operatorId, tenantId);
            if (r != null) {
                tenantService.updateConfigProperty(r.getId(), PluginRegistry.PLUGINS_ENABLED_PROP, pluginsactive);
                r.setPlugins(pluginsactive);
                remoteTenantDAO.updateTenantInCache(r);
            }
            return MessageBlock.createSingle(mav, MSG.OPERATION_SUCCESSFUL, STORE_PLUGINS_ACTIVE, MSG.SUCCESS);
        } else {
            return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, STORE_PLUGINS_ACTIVE, MSG.ERROR);
        }
    }

}


text:
package com.bwsw.sj.crud.rest.utils

import com.bwsw.common.exceptions._
import com.bwsw.sj.common.utils.MessageResourceUtils
import scaldi.Injectable.inject
import scaldi.Injector

/**
  * Creates message for [[com.bwsw.common.exceptions.JsonDeserializationException JsonDeserializationException]].
  *
  * @author Pavel Tomskikh
  */
class JsonDeserializationErrorMessageCreator(implicit injector: Injector) {

  def apply(exception: JsonDeserializationException,
            attributeRequiredMessage: String = "entity.error.attribute.required"): String = {
    val messageResourceUtils = inject[MessageResourceUtils]
    import messageResourceUtils.createMessage

    createMessage(exception match {
      case _: JsonUnrecognizedPropertyException => "json.deserialization.error.unrecognized.property"
      case _: JsonIncorrectValueException => "json.deserialization.error.incorrect.value"
      case _: JsonNotParsedException => "json.deserialization.error.not.parsed"
      case _: JsonMissedPropertyException => attributeRequiredMessage
      case _ => "json.deserialization.error"
    }, exception.getMessage)
  }
}


text:
<?php
/** @var Simples\Template\View $this */
?>
<!DOCTYPE html>
<html>
<?php
$this->append('_layout/basic/head.php');
$this->append('_layout/basic/body.php');
?>
</html>


text:
package com.h6ah4i.android.widget.advrecyclerview.animator;

import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;

import com.h6ah4i.android.widget.advrecyclerview.animator.impl.ItemRemoveAnimationManager;
import com.h6ah4i.android.widget.advrecyclerview.animator.impl.RemoveAnimationInfo;
import com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager;
import com.h6ah4i.android.widget.advrecyclerview.swipeable.SwipeableItemViewHolder;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import androidx.core.view.ViewPropertyAnimatorCompat;
import androidx.recyclerview.widget.RecyclerView;

public class SwipeDismissItemAnimator extends DraggableItemAnimator {

    public static final Interpolator MOVE_INTERPOLATOR = new AccelerateDecelerateInterpolator();

    @Override
    protected void onSetup() {
        setItemAddAnimationsManager(new DefaultItemAddAnimationManager(this));
        setItemRemoveAnimationManager(new SwipeDismissItemRemoveAnimationManager(this));
        setItemChangeAnimationsManager(new DefaultItemChangeAnimationManager(this));
        setItemMoveAnimationsManager(new DefaultItemMoveAnimationManager(this));

        setRemoveDuration(150);
        setMoveDuration(150);
    }

    /**
     * Item Animation manager for REMOVE operation  (Same behavior as DefaultItemAnimator class)
     */
    protected static class SwipeDismissItemRemoveAnimationManager extends ItemRemoveAnimationManager {
        protected static final Interpolator DEFAULT_INTERPOLATOR = new AccelerateDecelerateInterpolator();

        public SwipeDismissItemRemoveAnimationManager(@NonNull BaseItemAnimator itemAnimator) {
            super(itemAnimator);
        }

        @Override
        protected void onCreateAnimation(@NonNull RemoveAnimationInfo info) {
            final ViewPropertyAnimatorCompat animator;

            if (isSwipeDismissed(info.holder)) {
                final View view = info.holder.itemView;
                animator = ViewCompat.animate(view);
                animator.setDuration(getDuration());
            } else {
                final View view = info.holder.itemView;
                animator = ViewCompat.animate(view);
                animator.setDuration(getDuration());
                animator.setInterpolator(DEFAULT_INTERPOLATOR);
                animator.alpha(0);
            }

            startActiveItemAnimation(info, info.holder, animator);
        }

        protected static boolean isSwipeDismissed(RecyclerView.ViewHolder item) {
            if (!(item instanceof SwipeableItemViewHolder)) {
                return false;
            }

            final SwipeableItemViewHolder item2 = (SwipeableItemViewHolder) item;
            final int result = item2.getSwipeResult();
            final int reaction = item2.getAfterSwipeReaction();

            return ((result == RecyclerViewSwipeManager.RESULT_SWIPED_LEFT) ||
                    (result == RecyclerViewSwipeManager.RESULT_SWIPED_UP) ||
                    (result == RecyclerViewSwipeManager.RESULT_SWIPED_RIGHT) ||
                    (result == RecyclerViewSwipeManager.RESULT_SWIPED_DOWN)) &&
                    (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM);
        }

        protected static boolean isSwipeDismissed(RemoveAnimationInfo info) {
            return (info instanceof SwipeDismissRemoveAnimationInfo);
        }

        @Override
        protected void onAnimationEndedSuccessfully(@NonNull RemoveAnimationInfo info, @NonNull RecyclerView.ViewHolder item) {
            final View view = item.itemView;

            if (isSwipeDismissed(info)) {
                view.setTranslationX(0);
                view.setTranslationY(0);
            } else {
                view.setAlpha(1);
            }
        }

        @Override
        protected void onAnimationEndedBeforeStarted(@NonNull RemoveAnimationInfo info, @Nullable RecyclerView.ViewHolder item) {
            final View view = item.itemView;

            if (isSwipeDismissed(info)) {
                view.setTranslationX(0);
                view.setTranslationY(0);
            } else {
                view.setAlpha(1);
            }
        }

        @Override
        protected void onAnimationCancel(@NonNull RemoveAnimationInfo info, @NonNull RecyclerView.ViewHolder item) {
        }

        @Override
        public boolean addPendingAnimation(@NonNull RecyclerView.ViewHolder holder) {
            if (isSwipeDismissed(holder)) {
                final View itemView = holder.itemView;
                final int prevItemX = (int) (itemView.getTranslationX() + 0.5f);
                final int prevItemY = (int) (itemView.getTranslationY() + 0.5f);

                endAnimation(holder);

                itemView.setTranslationX(prevItemX);
                itemView.setTranslationY(prevItemY);

                enqueuePendingAnimationInfo(new SwipeDismissRemoveAnimationInfo(holder));

                return true;
            } else {
                endAnimation(holder);

                enqueuePendingAnimationInfo(new RemoveAnimationInfo(holder));

                return true;
            }
        }
    }

    protected static class SwipeDismissRemoveAnimationInfo extends RemoveAnimationInfo {
        public SwipeDismissRemoveAnimationInfo(@NonNull RecyclerView.ViewHolder holder) {
            super(holder);
        }
    }
}


text:
from lib.box_connection import BoxConnection
from lib.tarantool_connection import TarantoolConnection
from tarantool import NetworkError
from tarantool.const import IPROTO_GREETING_SIZE, IPROTO_CODE, IPROTO_ERROR, \
    REQUEST_TYPE_ERROR
import socket
import msgpack

print """
 #
 # if on_connect() trigger raises an exception, the connection is dropped
 #
 """

# silence possible error of strict mode
server.admin("nosuchfunction = nil")
server.admin("function f1() nosuchfunction() end")
server.admin("type(box.session.on_connect(f1))")

unpacker = msgpack.Unpacker(use_list = False)

conn = TarantoolConnection(server.iproto.host, server.iproto.port)
conn.connect()
s = conn.socket

# Read greeting
print 'greeting: ', len(s.recv(IPROTO_GREETING_SIZE)) == IPROTO_GREETING_SIZE

# Read error packet
IPROTO_FIXHEADER_SIZE = 5
fixheader = s.recv(IPROTO_FIXHEADER_SIZE)
print 'fixheader: ', len(fixheader) == IPROTO_FIXHEADER_SIZE
unpacker.feed(fixheader)
packet_len = unpacker.unpack()
packet = s.recv(packet_len)
unpacker.feed(packet)

# Parse packet
header = unpacker.unpack()
body = unpacker.unpack()
print 'error code', (header[IPROTO_CODE] & (REQUEST_TYPE_ERROR - 1))
print 'error message: ', body[IPROTO_ERROR]
print 'eof:', len(s.recv(1024)) == 0
s.close()

server.admin("box.session.on_connect(nil, f1)")


text:
<?php

namespace Google\Service\Container;

class ConsumptionMeteringConfig extends \Google\Model
{
  /**
   * @var bool
   */
  public $enabled;

  /**
   * @param bool
   */
  public function setEnabled($enabled)
  {
    $this->enabled = $enabled;
  }
  /**
   * @return bool
   */
  public function getEnabled()
  {
    return $this->enabled;
  }
}

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


text:
namespace remoting {

namespace {
// Both input and output data are assumed to be RGBA32.
const int kBytesPerPixel = 4;
}  // namespace

VideoDecoderVerbatim::VideoDecoderVerbatim()
    : state_(kUninitialized),
      clip_(SkIRect::MakeEmpty()),
      row_pos_(0),
      row_y_(0),
      screen_size_(SkISize::Make(0, 0)) {
}

VideoDecoderVerbatim::~VideoDecoderVerbatim() {
}

bool VideoDecoderVerbatim::IsReadyForData() {
  switch (state_) {
    case kUninitialized:
    case kError:
      return false;
    case kReady:
    case kProcessing:
    case kPartitionDone:
    case kDone:
      return true;
  }
  NOTREACHED();
  return false;
}

void VideoDecoderVerbatim::Initialize(const SkISize& screen_size) {
  updated_region_.setEmpty();
  screen_buffer_.reset();

  screen_size_ = screen_size;
  // Allocate the screen buffer, if necessary.
  if (!screen_size_.isEmpty()) {
    screen_buffer_.reset(new uint8[
        screen_size_.width() * screen_size_.height() * kBytesPerPixel]);
  }

  state_ = kReady;
}

VideoDecoder::DecodeResult VideoDecoderVerbatim::DecodePacket(
    const VideoPacket* packet) {
  UpdateStateForPacket(packet);

  if (state_ == kError) {
    return DECODE_ERROR;
  }

  const uint8* in = reinterpret_cast<const uint8*>(packet->data().data());
  const int in_size = packet->data().size();
  const int row_size = clip_.width() * kBytesPerPixel;

  int out_stride = screen_size_.width() * kBytesPerPixel;
  uint8* out = screen_buffer_.get() + out_stride * (clip_.top() + row_y_) +
      kBytesPerPixel * clip_.left();

  // Consume all the data in the message.
  int used = 0;
  while (used < in_size) {
    if (row_y_ >= clip_.height()) {
      state_ = kError;
      LOG(WARNING) << "Too much data is received for the given rectangle.";
      return DECODE_ERROR;
    }

    int bytes_to_copy = std::min(in_size - used, row_size - row_pos_);
    memcpy(out + row_pos_, in + used, bytes_to_copy);

    used += bytes_to_copy;
    row_pos_ += bytes_to_copy;

    // If this row is completely filled then move onto the next row.
    if (row_pos_ == row_size) {
      ++row_y_;
      row_pos_ = 0;
      out += out_stride;
    }
  }

  if (state_ == kPartitionDone || state_ == kDone) {
    if (row_y_ < clip_.height()) {
      state_ = kError;
      LOG(WARNING) << "Received LAST_PACKET, but didn't get enough data.";
      return DECODE_ERROR;
    }

    updated_region_.op(clip_, SkRegion::kUnion_Op);
  }

  if (state_ == kDone) {
    return DECODE_DONE;
  } else {
    return DECODE_IN_PROGRESS;
  }
}

void VideoDecoderVerbatim::UpdateStateForPacket(const VideoPacket* packet) {
  if (state_ == kError) {
    return;
  }

  if (packet->flags() & VideoPacket::FIRST_PACKET) {
    if (state_ != kReady && state_ != kDone && state_ != kPartitionDone) {
      state_ = kError;
      LOG(WARNING) << "Received unexpected FIRST_PACKET.";
      return;
    }

    // Reset the buffer location status variables on the first packet.
    clip_.setXYWH(packet->format().x(), packet->format().y(),
                  packet->format().width(), packet->format().height());
    if (!SkIRect::MakeSize(screen_size_).contains(clip_)) {
      state_ = kError;
      LOG(WARNING) << "Invalid clipping area received.";
      return;
    }

    state_ = kProcessing;
    row_pos_ = 0;
    row_y_ = 0;
  }

  if (state_ != kProcessing) {
    state_ = kError;
    LOG(WARNING) << "Received unexpected packet.";
    return;
  }

  if (packet->flags() & VideoPacket::LAST_PACKET) {
    if (state_ != kProcessing) {
      state_ = kError;
      LOG(WARNING) << "Received unexpected LAST_PACKET.";
      return;
    }
    state_ = kPartitionDone;
  }

  if (packet->flags() & VideoPacket::LAST_PARTITION) {
    if (state_ != kPartitionDone) {
      state_ = kError;
      LOG(WARNING) << "Received unexpected LAST_PARTITION.";
      return;
    }
    state_ = kDone;
  }

  return;
}

VideoPacketFormat::Encoding VideoDecoderVerbatim::Encoding() {
  return VideoPacketFormat::ENCODING_VERBATIM;
}

void VideoDecoderVerbatim::Invalidate(const SkISize& view_size,
                                      const SkRegion& region) {
  updated_region_.op(region, SkRegion::kUnion_Op);
}

void VideoDecoderVerbatim::RenderFrame(const SkISize& view_size,
                                       const SkIRect& clip_area,
                                       uint8* image_buffer,
                                       int image_stride,
                                       SkRegion* output_region) {
  output_region->setEmpty();

  // TODO(alexeypa): scaling is not implemented.
  SkIRect clip_rect = SkIRect::MakeSize(screen_size_);
  if (!clip_rect.intersect(clip_area))
    return;

  int screen_stride = screen_size_.width() * kBytesPerPixel;

  for (SkRegion::Iterator i(updated_region_); !i.done(); i.next()) {
    SkIRect rect(i.rect());
    if (!rect.intersect(clip_rect))
      continue;

    CopyRGB32Rect(screen_buffer_.get(), screen_stride,
                  clip_rect,
                  image_buffer, image_stride,
                  clip_area,
                  rect);
    output_region->op(rect, SkRegion::kUnion_Op);
  }

  updated_region_.setEmpty();
}

}  // namespace remoting


text:
{-# LANGUAGE ExistentialQuantification #-}
module T12064 where
import T12064a
data D = forall n. K n => DCon n


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>MethodInvocationException xref</title>
<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />

View Javadoc

1
20  package org.apache.mina.statemachine.transition;
21
22  import java.lang.reflect.Method;
23
24  /**
25   * Thrown by {@link MethodTransition} if the target method couldn't be invoked
26   * or threw an exception.
27   *
28   * @author <a href="http://mina.apache.org">Apache MINA Project</a>
29   */
30  public class MethodInvocationException extends RuntimeException {
31      private static final long serialVersionUID = 4288548621384649704L;
32
33      /**
34       * Creates a new instance for the specified {@link Method} and
35       * {@link Throwable}.
36       *
37       * @param method the {@link Method}.
38       * @param cause the reason.
39       */
40      public MethodInvocationException(Method method, Throwable cause) {
41          super("Invoking method: " + method, cause);
42      }
43
44  }

This page was automatically generated by Maven