// Copyright (c) 2007-2020 Pivotal Software, Inc.  All rights reserved.
//
// This software, the RabbitMQ Java client library, is triple-licensed under the
// Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2
// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2.  For the ASL,
// please see LICENSE-APACHE2.
//
// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
// either express or implied. See the LICENSE file for specific language governing
// rights and limitations of this software.
//
// If you have any questions regarding licensing, please contact us at
// info@rabbitmq.com.

package com.rabbitmq.perf;

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.ConfirmListener;
import com.rabbitmq.client.ReturnListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import java.util.concurrent.ConcurrentNavigableMap;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.function.Supplier;

import static java.util.stream.Collectors.toMap;

public class Producer extends AgentBase implements Runnable, ReturnListener,
        ConfirmListener
{

    private static final Logger LOGGER = LoggerFactory.getLogger(Producer.class);

    public static final String TIMESTAMP_PROPERTY = "timestamp";
    public static final String CONTENT_TYPE_PROPERTY = "contentType";
    public static final String CONTENT_ENCODING_PROPERTY = "contentEncoding";
    public static final String DELIVERY_MODE_PROPERTY = "deliveryMode";
    public static final String PRIORITY_PROPERTY = "priority";
    public static final String CORRELATION_ID_PROPERTY = "correlationId";
    public static final String REPLY_TO_PROPERTY = "replyTo";
    public static final String EXPIRATION_PROPERTY = "expiration";
    public static final String MESSAGE_ID_PROPERTY = "messageId";
    public static final String TYPE_PROPERTY = "type";
    public static final String USER_ID_PROPERTY = "userId";
    public static final String APP_ID_PROPERTY = "appId";
    public static final String CLUSTER_ID_PROPERTY = "clusterId";
    public static final String TIMESTAMP_HEADER = TIMESTAMP_PROPERTY;
    static final String STOP_REASON_PRODUCER_MESSAGE_LIMIT = "Producer reached message limit";
    static final String STOP_REASON_PRODUCER_THREAD_INTERRUPTED = "Producer thread interrupted";
    static final String STOP_REASON_ERROR_IN_PRODUCER = "Error in producer";
    private final Channel channel;
    private final String  exchangeName;
    private final String  id;
    private final boolean mandatory;
    private final boolean persistent;
    private final int     txSize;
    private final int     msgLimit;

    private final Stats   stats;

    private final MessageBodySource messageBodySource;

    private final Function<AMQP.BasicProperties.Builder, AMQP.BasicProperties.Builder> propertiesBuilderProcessor;
    private final Semaphore confirmPool;
    private final int confirmTimeout;
    private final int maxOutstandingConfirms;

    private final ConcurrentNavigableMap<Long, Long> unconfirmed = new ConcurrentSkipListMap<>();

    private final MulticastSet.CompletionHandler completionHandler;
    private final AtomicBoolean completed = new AtomicBoolean(false);

    private final Supplier<String> routingKeyGenerator;

    private final int randomStartDelay;

    private final Recovery.RecoveryProcess recoveryProcess;

    private final boolean shouldTrackPublishConfirms;

    private final TimestampProvider timestampProvider;

    private final ValueIndicator<Float> rateIndicator;

    public Producer(ProducerParameters parameters) {
        this.channel           = parameters.getChannel();
        this.exchangeName      = parameters.getExchangeName();
        this.id                = parameters.getId();
        this.mandatory         = parameters.getFlags().contains("mandatory");
        this.persistent        = parameters.getFlags().contains("persistent");

        Function<AMQP.BasicProperties.Builder, AMQP.BasicProperties.Builder> builderProcessor = Function.identity();
        this.txSize            = parameters.getTxSize();
        this.msgLimit          = parameters.getMsgLimit();
        this.messageBodySource = parameters.getMessageBodySource();
        this.timestampProvider = parameters.getTsp();
        if (this.timestampProvider.isTimestampInHeader()) {
            builderProcessor = builderProcessor.andThen(builder -> builder.headers(Collections.singletonMap(TIMESTAMP_HEADER, parameters.getTsp().getCurrentTime())));
        }
        if (parameters.getMessageProperties() != null && !parameters.getMessageProperties().isEmpty()) {
            builderProcessor = builderProcessorWithMessageProperties(parameters.getMessageProperties(), builderProcessor);
        }

        this.shouldTrackPublishConfirms = shouldTrackPublishConfirm(parameters);

        if (parameters.getConfirm() > 0) {
            this.confirmPool = new Semaphore((int) parameters.getConfirm());
            this.confirmTimeout = parameters.getConfirmTimeout();
            this.maxOutstandingConfirms = (int) parameters.getConfirm();
        } else {
            this.confirmPool = null;
            this.confirmTimeout = -1;
            this.maxOutstandingConfirms = -1;
        }
        this.stats = parameters.getStats();
        this.completionHandler = parameters.getCompletionHandler();
        this.propertiesBuilderProcessor = builderProcessor;
        if (parameters.isRandomRoutingKey() || parameters.getRoutingKeyCacheSize() > 0) {
            if (parameters.getRoutingKeyCacheSize() > 0) {
                this.routingKeyGenerator = new CachingRoutingKeyGenerator(parameters.getRoutingKeyCacheSize());
            } else {
                this.routingKeyGenerator = () -> UUID.randomUUID().toString();
            }
        } else {
            this.routingKeyGenerator = () -> this.id;
        }
        this.randomStartDelay = parameters.getRandomStartDelayInSeconds();

        this.rateIndicator = parameters.getRateIndicator();
        this.recoveryProcess = parameters.getRecoveryProcess();
        this.recoveryProcess.init(this);

    }

    private Function<AMQP.BasicProperties.Builder, AMQP.BasicProperties.Builder> builderProcessorWithMessageProperties(
            Map<String, Object> messageProperties,
            Function<AMQP.BasicProperties.Builder, AMQP.BasicProperties.Builder> builderProcessor) {
        if (messageProperties.containsKey(CONTENT_TYPE_PROPERTY)) {
            String value = messageProperties.get(CONTENT_TYPE_PROPERTY).toString();
            builderProcessor = builderProcessor.andThen(builder -> builder.contentType(value));
        }
        if (messageProperties.containsKey(CONTENT_ENCODING_PROPERTY)) {
            String value = messageProperties.get(CONTENT_ENCODING_PROPERTY).toString();
            builderProcessor = builderProcessor.andThen(builder -> builder.contentEncoding(value));
        }
        if (messageProperties.containsKey(DELIVERY_MODE_PROPERTY)) {
            Integer value = ((Number) messageProperties.get(DELIVERY_MODE_PROPERTY)).intValue();
            builderProcessor = builderProcessor.andThen(builder -> builder.deliveryMode(value));
        }
        if (messageProperties.containsKey(PRIORITY_PROPERTY)) {
            Integer value = ((Number) messageProperties.get(PRIORITY_PROPERTY)).intValue();
            builderProcessor = builderProcessor.andThen(builder -> builder.priority(value));
        }
        if (messageProperties.containsKey(CORRELATION_ID_PROPERTY)) {
            String value = messageProperties.get(CORRELATION_ID_PROPERTY).toString();
            builderProcessor = builderProcessor.andThen(builder -> builder.correlationId(value));
        }
        if (messageProperties.containsKey(REPLY_TO_PROPERTY)) {
            String value = messageProperties.get(REPLY_TO_PROPERTY).toString();
            builderProcessor = builderProcessor.andThen(builder -> builder.replyTo(value));
        }
        if (messageProperties.containsKey(EXPIRATION_PROPERTY)) {
            String value = messageProperties.get(EXPIRATION_PROPERTY).toString();
            builderProcessor = builderProcessor.andThen(builder -> builder.expiration(value));
        }
        if (messageProperties.containsKey(MESSAGE_ID_PROPERTY)) {
            String value = messageProperties.get(MESSAGE_ID_PROPERTY).toString();
            builderProcessor = builderProcessor.andThen(builder -> builder.messageId(value));
        }
        if (messageProperties.containsKey(TIMESTAMP_PROPERTY)) {
            String value = messageProperties.get(TIMESTAMP_PROPERTY).toString();
            Date timestamp = Date.from(OffsetDateTime.parse(value).toInstant());
            builderProcessor = builderProcessor.andThen(builder -> builder.timestamp(timestamp));
        }
        if (messageProperties.containsKey(TYPE_PROPERTY)) {
            String value = messageProperties.get(TYPE_PROPERTY).toString();
            builderProcessor = builderProcessor.andThen(builder -> builder.type(value));
        }
        if (messageProperties.containsKey(USER_ID_PROPERTY)) {
            String value = messageProperties.get(USER_ID_PROPERTY).toString();
            builderProcessor = builderProcessor.andThen(builder -> builder.userId(value));
        }
        if (messageProperties.containsKey(APP_ID_PROPERTY)) {
            String value = messageProperties.get(APP_ID_PROPERTY).toString();
            builderProcessor = builderProcessor.andThen(builder -> builder.appId(value));
        }
        if (messageProperties.containsKey(CLUSTER_ID_PROPERTY)) {
            String value = messageProperties.get(CLUSTER_ID_PROPERTY).toString();
            builderProcessor = builderProcessor.andThen(builder -> builder.clusterId(value));
        }

        final Map<String, Object> headers = messageProperties.entrySet().stream()
            .filter(entry -> !isPropertyKey(entry.getKey()))
            .collect(toMap(e -> e.getKey(), e -> e.getValue()));

        if (!headers.isEmpty()) {
            builderProcessor = builderProcessor.andThen(builder -> {
                // we merge if there are already some headers
                AMQP.BasicProperties properties = builder.build();
                Map<String, Object> existingHeaders = properties.getHeaders();
                if (existingHeaders != null && !existingHeaders.isEmpty()) {
                    Map<String, Object> newHeaders = new HashMap<>();
                    newHeaders.putAll(existingHeaders);
                    newHeaders.putAll(headers);
                    builder = builder.headers(newHeaders);
                } else {
                    builder = builder.headers(headers);
                }
                return builder;
            });
        }

        return builderProcessor;
    }

    private static final Collection<String> MESSAGE_PROPERTIES_KEYS = Arrays.asList(
            CONTENT_TYPE_PROPERTY,
            CONTENT_ENCODING_PROPERTY,
            "headers",
            DELIVERY_MODE_PROPERTY,
            PRIORITY_PROPERTY,
            CORRELATION_ID_PROPERTY,
            REPLY_TO_PROPERTY,
            EXPIRATION_PROPERTY,
            MESSAGE_ID_PROPERTY,
            TIMESTAMP_HEADER,
            TYPE_PROPERTY,
            USER_ID_PROPERTY,
            APP_ID_PROPERTY,
            CLUSTER_ID_PROPERTY
    );

    private boolean isPropertyKey(String key) {
        return MESSAGE_PROPERTIES_KEYS.contains(key);
    }

    private boolean shouldTrackPublishConfirm(ProducerParameters parameters) {
        return parameters.getConfirm() > 0;
    }

    public void handleReturn(int replyCode,
                             String replyText,
                             String exchange,
                             String routingKey,
                             AMQP.BasicProperties properties,
                             byte[] body) {
        stats.handleReturn();
    }

    public void handleAck(long seqNo, boolean multiple) {
        handleAckNack(seqNo, multiple, false);
    }

    public void handleNack(long seqNo, boolean multiple) {
        handleAckNack(seqNo, multiple, true);
    }

    private void handleAckNack(long seqNo, boolean multiple,
                               boolean nack) {
        int numConfirms;

        if (nack) {
            numConfirms = processNack(seqNo, multiple);
        } else {
            numConfirms = processAck(seqNo, multiple);
        }

        if (confirmPool != null && numConfirms > 0) {
            confirmPool.release(numConfirms);
        }
    }

    private int processAck(long seqNo, boolean multiple) {
        int numConfirms;
        long currentTime = this.timestampProvider.getCurrentTime();
        long[] latencies;
        if (multiple) {
            ConcurrentNavigableMap<Long, Long> confirmed = unconfirmed.headMap(seqNo, true);
            numConfirms = confirmed.size();
            latencies = new long[numConfirms];
            int index = 0;
            for (Map.Entry<Long, Long> entry : confirmed.entrySet()) {
                latencies[index] = this.timestampProvider.getDifference(currentTime, entry.getValue());
                index++;
            }
            confirmed.clear();
        } else {
            Long messageTimestamp = unconfirmed.remove(seqNo);
            if (messageTimestamp != null) {
                latencies = new long[] {this.timestampProvider.getDifference(currentTime, messageTimestamp)};
            } else {
                latencies = new long[0];
            }
            numConfirms = 1;
        }
        stats.handleConfirm(numConfirms, latencies);
        return numConfirms;
    }

    private int processNack(long seqNo, boolean multiple) {
        int numConfirms;
        if (multiple) {
            ConcurrentNavigableMap<Long, Long> confirmed = unconfirmed.headMap(seqNo, true);
            numConfirms = confirmed.size();
            confirmed.clear();
        } else {
            unconfirmed.remove(seqNo);
            numConfirms = 1;
        }
        stats.handleNack(numConfirms);
        return numConfirms;
    }

    public void run() {
        if (randomStartDelay > 0) {
            int delay = new Random().nextInt(randomStartDelay) + 1;
            try {
                Thread.sleep((long) delay * 1000);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                throw new RuntimeException(e);
            }
        }
        long now;
        final long startTime;
        startTime = now = System.currentTimeMillis();
        ProducerState state = new ProducerState(this.rateIndicator);
        state.setLastStatsTime(startTime);
        state.setMsgCount(0);
        final boolean variableRate = this.rateIndicator.isVariable();
        try {
            while (keepGoing(state)) {
                delay(now, state);
                if (variableRate && this.rateIndicator.getValue() == 0.0f) {
                    // instructed not to publish, so waiting
                    waitForOneSecond();
                } else {
                    handlePublish(state);
                }
                now = System.currentTimeMillis();
                // if rate is variable, we need to reset producer stats every second
                // otherwise pausing to throttle rate will be based on the whole history
                // which is broken when rate varies
                if (variableRate && now - state.getLastStatsTime() > 1000) {
                    state.setLastStatsTime(now);
                    state.setMsgCount(0);
                }
            }
        } catch (PerfTestException pte) {
            countDown(pte.getMessage());
            throw pte;
        } catch (Exception e) {
            LOGGER.debug("Error in publisher", e);
            String reason;
            if (e.getCause() instanceof InterruptedException && this.rateIndicator.getValue() != 0.0f) {
                // likely to have been interrupted while sleeping to honor rate limit
                reason = STOP_REASON_PRODUCER_THREAD_INTERRUPTED;
            } else {
                reason = STOP_REASON_ERROR_IN_PRODUCER + " (" + e.getMessage() + ")";
            }
            // failing, we don't want to block the whole process, so counting down
            countDown(reason);
            throw e;
        }
        if (state.getMsgCount() >= msgLimit) {
            String reason;
            if (msgLimit == 0) {
                reason = STOP_REASON_PRODUCER_THREAD_INTERRUPTED;
            } else {
                reason = STOP_REASON_PRODUCER_MESSAGE_LIMIT;
            }
            countDown(reason);
        }
    }

    private void waitForOneSecond() {
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RuntimeException(e);
        }
    }

    private boolean keepGoing(AgentState state) {
        return (msgLimit == 0 || state.getMsgCount() < msgLimit) && !Thread.interrupted();
    }

    public Runnable createRunnableForScheduling() {
        final AtomicBoolean initialized = new AtomicBoolean(false);
        // make the producer state thread-safe for what we use in this case
        final ProducerState state = new ProducerState(this.rateIndicator) {
            final AtomicInteger messageCount = new AtomicInteger(0);
            @Override
            protected void setMsgCount(int msgCount) {
                messageCount.set(msgCount);
            }
            @Override
            public int getMsgCount() {
                return messageCount.get();
            }

            @Override
            public int incrementMessageCount() {
                return messageCount.incrementAndGet();
            }
        };
        return () -> {
            if (initialized.compareAndSet(false, true)) {
                state.setLastStatsTime(System.currentTimeMillis());
                state.setMsgCount(0);
            }
            try {
                maybeHandlePublish(state);
            } catch(PerfTestException pte) {
                // failing, we don't want to block the whole process, so counting down
                countDown(pte.getMessage());
                throw pte;
            } catch (Exception e) {
                // failing, we don't want to block the whole process, so counting down
                countDown("Error in scheduled producer (" + e.getMessage() + ")");
                throw e;
            }
        };
    }

    public void maybeHandlePublish(AgentState state) {
        if (keepGoing(state)) {
            handlePublish(state);
        } else {
            String reason;
            if (messageLimitReached(state)) {
                reason = STOP_REASON_PRODUCER_MESSAGE_LIMIT;
            } else {
                reason = STOP_REASON_PRODUCER_THREAD_INTERRUPTED;
            }
            countDown(reason);
        }
    }

    private boolean messageLimitReached(AgentState state) {
        if (msgLimit == 0) {
            return false;
        } else {
            return state.getMsgCount() >= msgLimit;
        }
    }

    public void handlePublish(AgentState currentState) {
        if (!this.recoveryProcess.isRecoverying()) {
            try {
                maybeWaitIfTooManyOutstandingPublishConfirms();

                dealWithWriteOperation(() -> publish(messageBodySource.create(currentState.getMsgCount())), this.recoveryProcess);

                int messageCount = currentState.incrementMessageCount();

                commitTransactionIfNecessary(messageCount);
                stats.handleSend();
            } catch (IOException e) {
                throw new RuntimeException(e);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                throw new RuntimeException (e);
            }
        } else {
            // The connection is recovering, waiting a bit.
            // The duration is arbitrary: don't want to empty loop
            // too much and don't want to catch too late with recovery
            try {
                LOGGER.debug("Recovery in progress, sleeping for a sec");
                Thread.sleep(1000L);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        }
    }

    private void maybeWaitIfTooManyOutstandingPublishConfirms() throws InterruptedException {
        if (confirmPool != null) {
            if (confirmTimeout < 0) {
                confirmPool.acquire();
            } else {
                boolean acquired = confirmPool.tryAcquire(confirmTimeout, TimeUnit.SECONDS);
                if (!acquired) {
                    // waiting for too long, broker may be gone, stopping thread
                    throw new PerfTestException("Waiting for publisher confirms for too long");
                }
            }
        }
    }

    private void commitTransactionIfNecessary(int messageCount) throws IOException {
        if (txSize != 0 && messageCount % txSize == 0) {
            dealWithWriteOperation(() -> channel.txCommit(), this.recoveryProcess);
        }
    }

    private void publish(MessageBodySource.MessageEnvelope messageEnvelope)
        throws IOException {

        AMQP.BasicProperties.Builder propertiesBuilder = new AMQP.BasicProperties.Builder();
        if (persistent) {
            propertiesBuilder.deliveryMode(2);
        }

        if (messageEnvelope.getContentType() != null) {
            propertiesBuilder.contentType(messageEnvelope.getContentType());
        }

        propertiesBuilder = this.propertiesBuilderProcessor.apply(propertiesBuilder);

        AMQP.BasicProperties messageProperties = propertiesBuilder.build();

        if (shouldTrackPublishConfirms) {
            if (this.timestampProvider.isTimestampInHeader()) {
                Long timestamp = (Long) messageProperties.getHeaders().get(TIMESTAMP_HEADER);
                unconfirmed.put(channel.getNextPublishSeqNo(), timestamp);
            } else {
                unconfirmed.put(channel.getNextPublishSeqNo(), messageEnvelope.getTime());
            }
        }
        channel.basicPublish(exchangeName, routingKeyGenerator.get(),
                             mandatory, false,
                             messageProperties,
                             messageEnvelope.getBody());
    }

    private void countDown(String reason) {
        if (completed.compareAndSet(false, true)) {
            completionHandler.countDown(reason);
        }
    }

    @Override
    public void recover(TopologyRecording topologyRecording) {
        maybeResetConfirmPool();
    }

    private void maybeResetConfirmPool() {
        if (this.confirmPool != null) {
            // reset confirm pool. If the producer is waiting for confirms,
            // it will move on without failing because of a confirm timeout, which is good,
            // considering there has been a re-connection.
            int usedPermits = maxOutstandingConfirms - this.confirmPool.availablePermits();
            this.confirmPool.release(usedPermits);
            LOGGER.debug("Resetting confirm pool in producer, used permit(s) {}, now {} available", usedPermits, this.confirmPool.availablePermits());
        }
    }

    /**
     * Not thread-safe (OK for non-scheduled Producer, as it runs inside the same thread).
     */
    private static class ProducerState implements AgentState {

        private final ValueIndicator<Float> rateIndicator;
        private long  lastStatsTime;
        private int msgCount = 0;

        protected ProducerState(ValueIndicator<Float> rateIndicator) {
            this.rateIndicator = rateIndicator;
        }

        public float getRateLimit() {
            return rateIndicator.getValue();
        }

        public long getLastStatsTime() {
            return lastStatsTime;
        }

        protected void setLastStatsTime(long lastStatsTime) {
            this.lastStatsTime = lastStatsTime;
        }

        public int getMsgCount() {
            return msgCount;
        }

        protected void setMsgCount(int msgCount) {
            this.msgCount = msgCount;
        }

        public int incrementMessageCount() {
            return ++this.msgCount;
        }

    }

    static class CachingRoutingKeyGenerator implements Supplier<String> {

        private final String [] keys;
        private int count = 0;

        public CachingRoutingKeyGenerator(int cacheSize) {
            if (cacheSize <= 0) {
                throw new IllegalArgumentException(String.valueOf(cacheSize));
            }
            this.keys = new String[cacheSize];
            for (int i = 0; i < cacheSize; i++) {
                this.keys[i] = UUID.randomUUID().toString();
            }
        }

        @Override
        public String get() {
            if (count == keys.length) {
                count = 0;
            }
            return keys[count++ % keys.length];
        }
    }
}


<?xml version="1.0"?>
<!-- Copyright 2017 IBM Corp.

     This work is licensed under the terms of the GNU GPL, version 2 or
     (at your option) any later version. See the COPYING file in the
     top-level directory. -->

<!DOCTYPE feature SYSTEM "gdb-target.dtd">
<feature name="org.gnu.gdb.s390.gs">
  <reg name="gs_reserved" bitsize="64" type="uint64" group="system"/>
  <reg name="gsd" bitsize="64" type="uint64" group="system"/>
  <reg name="gssm" bitsize="64" type="uint64" group="system"/>
  <reg name="gsepla" bitsize="64" type="data_ptr" group="system"/>
</feature>


/*  GRBL-Plotter. Another GCode sender for GRBL.
    This file is part of the GRBL-Plotter application.

    Copyright (C) 2015-2020 Sven Hasemann contact: svenhb@web.de

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

// 2020-01-10 line 113 set x,y,z=null

using System;
using System.Windows.Forms;

namespace GRBL_Plotter
{
    /// <summary>
    /// Hold absolute work coordinate for given linenumber of GCode program
    /// </summary>
    class coordByLine
    {   public int lineNumber;          // line number in fCTBCode
        public int figureNumber;
        public xyPoint actualPos;       // accumulates position
        public double alpha;            // angle between old and this position
        public double distance;         // distance to specific point
        public bool isArc;

        public coordByLine(int line, int figure, xyPoint p, double a, bool isarc)
        { lineNumber = line; figureNumber = figure; actualPos = p; alpha = a; distance = -1; isArc = isarc; }

        public coordByLine(int line, int figure, xyPoint p, double a, double dist)
        { lineNumber = line; figureNumber = figure; actualPos = p; alpha = a; distance = dist; isArc = false; }

        public void calcDistance(xyPoint tmp)
        {   xyPoint delta = new xyPoint(tmp - actualPos);
            distance = Math.Sqrt(delta.X * delta.X + delta.Y * delta.Y);
        }
    }

    public struct xyzabcuvwPoint
    {
        public double X, Y, Z, A,B,C,U,V,W;
        public xyzabcuvwPoint(xyzPoint tmp)
        { X = tmp.X; Y = tmp.Y; Z = tmp.Z;  A = tmp.A; B = 0;C = 0;U = 0;V = 0;W = 0; }

        public static explicit operator xyPoint(xyzabcuvwPoint tmp)
        { return new xyPoint(tmp.X,tmp.Y); }
        public static explicit operator xyArcPoint(xyzabcuvwPoint tmp)
        { return new xyArcPoint(tmp.X, tmp.Y,0 ,0 ,0); }
    }

    /// <summary>
    /// Hold parsed GCode line and absolute work coordinate for given linenumber of GCode program
    /// </summary>
    class gcodeByLine
    {   // ModalGroups
        public int lineNumber;          // line number in fCTBCode
        public int figureNumber;
        public string codeLine;         // copy of original gcode line
        public byte motionMode;         // G0,1,2,3
        public bool isdistanceModeG90;  // G90,91
        public bool ismachineCoordG53;  // don't apply transform to machine coordinates
        public bool isSubroutine;
        public bool isSetCoordinateSystem;  // don't process x,y,z if set coordinate system

        public byte spindleState;       // M3,4,5
        public byte coolantState;       // M7,8,9
        public int spindleSpeed;        // actual spindle spped
        public int feedRate;            // actual feed rate
        public double? x, y, z, a, b, c, u, v, w, i, j; // current parameters
        public xyzabcuvwPoint actualPos;      // accumulates position
        public double alpha;            // angle between old and this position
        public double distance;         // distance to specific point
        public string otherCode;
        public string info;

        // Trace, Debug, Info, Warn, Error, Fatal
        private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger();

        public gcodeByLine()
        {   resetAll(); }
        public gcodeByLine(gcodeByLine tmp)
        {
            resetAll();
            lineNumber = tmp.lineNumber; figureNumber = tmp.figureNumber; codeLine = tmp.codeLine;
            motionMode = tmp.motionMode; isdistanceModeG90 = tmp.isdistanceModeG90; ismachineCoordG53 = tmp.ismachineCoordG53;
            isSubroutine = tmp.isSubroutine; spindleState = tmp.spindleState; coolantState = tmp.coolantState;
            spindleSpeed = tmp.spindleSpeed; feedRate = tmp.feedRate;
            x = tmp.x; y = tmp.y; z = tmp.z; i = tmp.i; j = tmp.j; a = tmp.a; b = tmp.b; c = tmp.c; u = tmp.u; v = tmp.v; w = tmp.w;
            actualPos = tmp.actualPos; distance = tmp.distance; alpha = tmp.alpha;
            isSetCoordinateSystem = tmp.isSetCoordinateSystem;  otherCode = tmp.otherCode;
        }

        public string listData()
        { return string.Format("{0} mode {1} figure {2}\r", lineNumber, motionMode, figureNumber); }

        /// <summary>
        /// Reset coordinates and set G90, M5, M9
        /// </summary>
        public void resetAll()
        {
            lineNumber = 0; figureNumber = 0; codeLine = "";
            motionMode = 0; isdistanceModeG90 = true; ismachineCoordG53 = false; isSubroutine = false;
            isSetCoordinateSystem = false; spindleState = 5; coolantState = 9; spindleSpeed = 0; feedRate = 0;

            actualPos.X = 0; actualPos.Y = 0; actualPos.Z = 0; actualPos.A = 0; actualPos.B = 0; actualPos.C = 0;
            actualPos.U = 0; actualPos.V = 0; actualPos.W = 0;
            distance = -1; otherCode = ""; info = ""; alpha = 0;

            x = y = z = a = b = c = u = v = w = i = j = null;

            resetCoordinates();
        }
        public void resetAll(xyzPoint tmp)
        {   resetAll();
            actualPos = new xyzabcuvwPoint( tmp);
        }
        /// <summary>
        /// Reset coordinates
        /// </summary>
        public void resetCoordinates()
        {   x = null; y = null; z = null; a = null; b = null; c = null; u = null; v = null; w = null; i = null; j = null;
        }
        public void presetParsing(int lineNr, string line)
        {   resetCoordinates();
            ismachineCoordG53 = false; isSubroutine = false;
            otherCode = "";
            lineNumber = lineNr;
            codeLine = line;
        }

        /// <summary>
        /// parse gcode line
        /// </summary>
        public void parseLine(int lineNr, string line, ref modalGroup modalState)
        {
            presetParsing(lineNr,line);
            char cmd = '\0';
            string num = "";
            bool comment = false;
            double value = 0;
            line = line.ToUpper().Trim();   // 2020-07-26
            isSetCoordinateSystem = false;
            #region parse
            if ((!(line.StartsWith("$") || line.StartsWith("("))) && (line.Length > 1))//do not parse grbl comments
            {
                try
                {
                    foreach (char c in line)
                    {
                        if (c == ';')                                   // comment?
                            break;
                        if (c == '(')                                   // comment starts
                        {   comment = true;  }
                        if (!comment)
                        {
                            if (Char.IsLetter(c))                       // if char is letter
                            {
                                if (cmd != '\0')                        // and command is set
                                {
                                    if (double.TryParse(num, System.Globalization.NumberStyles.Float, System.Globalization.NumberFormatInfo.InvariantInfo, out value))
                                        parseGCodeToken(cmd, value, ref modalState);
                                }
                                cmd = c;                                // char is a command
                                num = "";
                            }
                            else if (Char.IsNumber(c) || c == '.' || c == '-')  // char is not letter but number
                            {
                                num += c;
                            }
                        }

                        if (c == ')')                                   // comment ends
                        {   comment = false;  }
                    }
                    if (cmd != '\0')                                    // finally after for-each process final command and number
                    {
                        if (double.TryParse(num, System.Globalization.NumberStyles.Float, System.Globalization.NumberFormatInfo.InvariantInfo, out value))
                            parseGCodeToken(cmd, value, ref modalState);
                    }
                }
                catch (Exception er) { Logger.Error(er, "parseLine"); }
            }
            #endregion
            if (isSetCoordinateSystem)
                resetCoordinates();
        }

        /// <summary>
        /// fill current gcode line structure
        /// </summary>
        private void parseGCodeToken(char cmd, double value, ref modalGroup modalState)
        {
            switch (Char.ToUpper(cmd))
            {
                case 'X':
                    x = value;
                    break;
                case 'Y':
                    y = value;
                    break;
                case 'Z':
                    z = value;
                    break;
                case 'A':
                    a = value;
                    break;
                case 'B':
                    b = value;
                    break;
                case 'C':
                    c = value;
                    break;
                case 'U':
                    u = value;
                    break;
                case 'V':
                    v = value;
                    break;
                case 'W':
                    w = value;
                    break;
                case 'I':
                    i = value;
                    break;
                case 'J':
                    j = value;
                    break;
                case 'F':
                    modalState.feedRate = feedRate = (int)value;
                    break;
                case 'S':
                    modalState.spindleSpeed = spindleSpeed = (int)value;
                    break;
                case 'G':
                    if (value <= 3)                                 // Motion Mode 0-3 c
                    {   modalState.motionMode = motionMode = (byte)value;
                        if (value >= 2)
                            modalState.containsG2G3 = true;
                    }
                    else
                    {   otherCode += "G"+((int)value).ToString()+" ";
                    }

                    if (value == 10)
                    { isSetCoordinateSystem = true; }

                    else if ((value == 20) || (value == 21))             // Units Mode
                    { modalState.unitsMode = (byte)value; }

                    else if (value == 53)                                // move in machine coord.
                    { ismachineCoordG53 = true; }

                    else if ((value >= 54) && (value <= 59))             // Coordinate System Select
                    { modalState.coordinateSystem = (byte)value; }

                    else if (value == 90)                                // Distance Mode
                    { modalState.distanceMode = (byte)value; modalState.isdistanceModeG90 = true; }
                    else if (value == 91)
                    { modalState.distanceMode = (byte)value; modalState.isdistanceModeG90 = false;
                      modalState.containsG91 = true;
                    }
                    else if ((value == 93) || (value == 94))             // Feed Rate Mode
                    { modalState.feedRateMode = (byte)value; }
                    break;
                case 'M':
                    if ((value < 3) || (value == 30))                   // Program Mode 0, 1 ,2 ,30
                    { modalState.programMode = (byte)value; }
                    else if (value >= 3 && value <= 5)                   // Spindle State
                    {   modalState.spindleState = spindleState = (byte)value; }
                    else if (value >= 7 && value <= 9)                   // Coolant State
                    {   modalState.coolantState = coolantState = (byte)value;                    }
                    modalState.mWord = (byte)value;
                    if ((value < 3) || (value > 9))
                        otherCode += "M" + ((int)value).ToString() + " ";
                    break;
                case 'T':
                    modalState.tool = (byte)value;
                    otherCode += "T" + ((int)value).ToString() + " ";
                    break;
                case 'P':
                    modalState.pWord = (int)value;
                    otherCode += "P" + value.ToString() + " ";
                    break;
                case 'O':
                    modalState.oWord = (int)value;
                    break;
                case 'L':
                    modalState.lWord = (int)value;
                    break;
            }
            isdistanceModeG90 = modalState.isdistanceModeG90;
        }
    };

    class modalGroup
    {
        public byte motionMode;           // G0, G1, G2, G3, //G38.2, G38.3, G38.4, G38.5, G80
        public byte coordinateSystem;     // G54, G55, G56, G57, G58, G59
        public byte planeSelect;          // G17, G18, G19
        public byte distanceMode;         // G90, G91
        public byte feedRateMode;         // G93, G94
        public byte unitsMode;            // G20, G21
        public byte programMode;          // M0, M1, M2, M30
        public byte spindleState;         // M3, M4, M5
        public byte coolantState;         // M7, M8, M9
        public byte tool;                 // T
        public int spindleSpeed;          // S
        public int feedRate;              // F
        public int mWord;
        public int pWord;
        public int oWord;
        public int lWord;
        public bool containsG2G3;
        public bool ismachineCoordG53;
        public bool isdistanceModeG90;
        public bool containsG91;

        public modalGroup()     // reset state
        { reset(); }

        public void reset()
        {   motionMode = 0;             // G0, G1, G2, G3, G38.2, G38.3, G38.4, G38.5, G80
            coordinateSystem = 54;      // G54, G55, G56, G57, G58, G59
            planeSelect = 17;           // G17, G18, G19
            distanceMode = 90;          // G90, G91
            feedRateMode = 94;          // G93, G94
            unitsMode = 21;             // G20, G21
            programMode = 0;            // M0, M1, M2, M30
            spindleState = 5;           // M3, M4, M5
            coolantState = 9;           // M7, M8, M9
            tool = 0;                   // T
            spindleSpeed = 0;           // S
            feedRate = 0;               // F
            mWord = 0;
            pWord = 0;
            oWord = 0;
            lWord = 1;
            containsG2G3 = false;
            ismachineCoordG53 = false;
            isdistanceModeG90 = true;
            containsG91 = false;
        }
        public void resetSubroutine()
        {   mWord = 0;
            pWord = 0;
            oWord = 0;
            lWord = 1;
        }
    }

    struct ArcProperties
    {   public double angleStart, angleEnd, angleDiff, radius;
        public xyPoint center;
    };

    class gcodeMath
    {   private static double precision = 0.00001;

        public static bool isEqual(System.Windows.Point a, System.Windows.Point b)
        {   return ((Math.Abs(a.X - b.X) < precision) && (Math.Abs(a.Y - b.Y) < precision));    }
        public static bool isEqual(xyPoint a, xyPoint b)
        {   return ((Math.Abs(a.X - b.X) < precision) && (Math.Abs(a.Y - b.Y) < precision));    }

        public static double distancePointToPoint(System.Windows.Point a, System.Windows.Point b)
        {   return Math.Sqrt(((a.X - b.X) * (a.X - b.X)) + ((a.Y - b.Y) * (a.Y - b.Y)));        }

        public static ArcProperties getArcMoveProperties(System.Windows.Point pOld, System.Windows.Point pNew, System.Windows.Point centerIJ, bool isG2)
        { return getArcMoveProperties(new xyPoint(pOld), new xyPoint(pNew), centerIJ.X, centerIJ.Y, isG2); }
        public static ArcProperties getArcMoveProperties(xyPoint pOld, xyPoint pNew, xyPoint center, bool isG2)
        {   return getArcMoveProperties(pOld, pNew, pOld.X - center.X, pOld.Y - center.Y, isG2);}

        public static ArcProperties getArcMoveProperties(xyPoint pOld, xyPoint pNew, double? I, double? J, bool isG2)
        {
            ArcProperties tmp = getArcMoveAngle(pOld, pNew, I, J);
            if (!isG2) { tmp.angleDiff = Math.Abs(tmp.angleEnd - tmp.angleStart + 2 * Math.PI); }
            if (tmp.angleDiff > (2 * Math.PI)) { tmp.angleDiff -= (2 * Math.PI); }
            if (tmp.angleDiff < (-2 * Math.PI)) { tmp.angleDiff += (2 * Math.PI); }

            if ((pOld.X == pNew.X) && (pOld.Y == pNew.Y))
            {   if (isG2) { tmp.angleDiff = -2 * Math.PI; }
                else { tmp.angleDiff = 2 * Math.PI; }
            }
            return tmp;
        }

        public static ArcProperties getArcMoveAngle(xyPoint pOld, xyPoint pNew, double? I, double? J)
        {
            ArcProperties tmp;
			if (I==null) {I=0;}
			if (J==null) {J=0;}
            double i = (double)I;
            double j = (double)J;
            tmp.radius = Math.Sqrt(i * i + j * j);  // get radius of circle
            tmp.center.X = pOld.X + i;
            tmp.center.Y = pOld.Y + j;
            tmp.angleStart = tmp.angleEnd = tmp.angleDiff = 0;
            if (tmp.radius == 0)
                return tmp;

            double cos1 = i / tmp.radius;
            if (cos1 > 1) cos1 = 1;
            if (cos1 < -1) cos1 = -1;
            tmp.angleStart = Math.PI - Math.Acos(cos1);
            if (j > 0) { tmp.angleStart = -tmp.angleStart; }

            double cos2 = (tmp.center.X - pNew.X) / tmp.radius;
            if (cos2 > 1) cos2 = 1;
            if (cos2 < -1) cos2 = -1;
            tmp.angleEnd = Math.PI - Math.Acos(cos2);
            if ((tmp.center.Y - pNew.Y) > 0) { tmp.angleEnd = -tmp.angleEnd; }

            tmp.angleDiff = tmp.angleEnd - tmp.angleStart - 2 * Math.PI;
            return tmp;
        }

        public static double getAlpha(System.Windows.Point pOld, double P2x, double P2y)
        { return getAlpha(pOld.X, pOld.Y, P2x, P2y); }
        public static double getAlpha(System.Windows.Point pOld, System.Windows.Point pNew)
        { return getAlpha(pOld.X, pOld.Y, pNew.X, pNew.Y); }
        public static double getAlpha(xyPoint pOld, xyPoint pNew)
        {   return getAlpha(pOld.X, pOld.Y, pNew.X, pNew.Y); }
        public static double getAlpha(double P1x, double P1y, double P2x, double P2y)
        {
            double s = 1, a = 0;
            double dx = P2x - P1x;
            double dy = P2y - P1y;
            if (dx == 0)
            {
                if (dy > 0)
                    a = Math.PI / 2;
                else
                    a = 3 * Math.PI / 2;
                if (dy == 0)
                    return 0;
            }
            else if (dy == 0)
            {
                if (dx > 0)
                    a = 0;
                else
                    a = Math.PI;
                if (dx == 0)
                    return 0;
            }
            else
            {
                s = dy / dx;
                a = Math.Atan(s);
                if (dx < 0)
                    a += Math.PI;
            }
            return a;
        }

        public static double cutAngle=0, cutAngleLast=0, angleOffset = 0;
        public static void resetAngles()
        {   angleOffset = cutAngle = cutAngleLast = 0.0;  }
        public static double getAngle(System.Windows.Point a, System.Windows.Point b, double offset, int dir)
        {   return monitorAngle(getAlpha(a, b) + offset, dir);  }
        private static double monitorAngle(double angle, int direction)		// take care of G2 cw G3 ccw direction
        {   double diff = angle - cutAngleLast + angleOffset;
            if (direction == 2)
            { if (diff > 0) { angleOffset -= 2 * Math.PI; } }    // clock wise, more negative
            else if (direction == 3)
            {   if (diff < 0) { angleOffset += 2 * Math.PI; } }    // counter clock wise, more positive
            else
            {   if (diff > Math.PI)
                    angleOffset -= 2 * Math.PI;
                if (diff < -Math.PI)
                    angleOffset += 2 * Math.PI;
            }
            angle += angleOffset;
            return angle;
        }
    }
}


# This file is distributed under the same license as the Django package.
#
# Translators:
# Jannis Leidel <jannis@leidel.info>, 2011.
# Michael Thornhill <michael@maithu.com>, 2011, 2012.
msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-03-23 02:37+0100\n"
"PO-Revision-Date: 2012-03-16 12:20+0000\n"
"Last-Translator: Michael Thornhill <michael@maithu.com>\n"
"Language-Team: Irish (http://www.transifex.net/projects/p/django/language/"
"ga/)\n"
"Language: ga\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : "
"4)\n"

#: admin.py:10
msgid "Advanced options"
msgstr "Ard-rogha"

#: forms.py:7 models.py:7
msgid "URL"
msgstr "URL"

#: forms.py:8
msgid ""
"Example: '/about/contact/'. Make sure to have leading and trailing slashes."
msgstr ""
"Sampla '/about/contact/' Déan cinnte go bhfuil príomhslaid agus cúlslais "
"agat."

#: forms.py:10
msgid ""
"This value must contain only letters, numbers, dots, underscores, dashes, "
"slashes or tildes."
msgstr ""
"Ní mór an luach a bhfuil ach litreacha, uimhreacha, poncanna, béim, dashes, "
"slaiseanna nó thilde."

#: forms.py:19
msgid "URL is missing a leading slash."
msgstr "Tá slais tosaigh in easnamh ag an URL."

#: forms.py:23
msgid "URL is missing a trailing slash."
msgstr "Tá slais deireanach in easnamh ag an URL."

#: forms.py:38
#, python-format
msgid "Flatpage with url %(url)s already exists for site %(site)s"
msgstr "Tá flatpage le url %(url)s ann cheana le suíomh %(site)s."

#: models.py:8
msgid "title"
msgstr "teideal"

#: models.py:9
msgid "content"
msgstr "inneachar"

#: models.py:10
msgid "enable comments"
msgstr "Cuir nótaí tráchta ar chumas"

#: models.py:11
msgid "template name"
msgstr "ainm an teimpléid"

#: models.py:12
msgid ""
"Example: 'flatpages/contact_page.html'. If this isn't provided, the system "
"will use 'flatpages/default.html'."
msgstr ""
"Sampla: 'flatpages/contact_page.html'. Muna bhfuil sé ar soláthair, bainfidh "
"an córás úsáid as 'flatpages/default.html'."

#: models.py:13
msgid "registration required"
msgstr "clárúchán riachtanach"

#: models.py:13
msgid "If this is checked, only logged-in users will be able to view the page."
msgstr ""
"Dá mbéadh é seo seicailte, ní beidh ach úsáideora logáilte isteach in ann an "
"leathanach seo a fheiceail"

#: models.py:18
msgid "flat page"
msgstr "leacleathanach"

#: models.py:19
msgid "flat pages"
msgstr "leacleathanaigh"


The [NETWIRE](https://attack.mitre.org/software/S0198) client has been signed by fake and invalid digital certificates.(Citation: McAfee Netwire Mar 2015)

McAfee. (2015, March 2). Netwire RAT Behind Recent Targeted Attacks. Retrieved February 15, 2018.


<!DOCTYPE html>

<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

<title>class Jekyll::Tags::Link - jekyll-3.2.1 Documentation</title>

<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">

    Home
    Classes
    Methods

  <form action="#" method="get" accept-charset="utf-8">

      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">

  </form>

Defined In

lib/jekyll/tags/link.rb

Parent

Liquid::Tag

Methods

::new

::tag_name

#render

Pages

LICENSE

README.markdown

mime.types

about

main.scss

feed.xml

index.html

Gemfile

default.html

page.html

post.html

_post

index.html

style.scss

Class and Module Index

Jekyll

Jekyll::Cleaner

Jekyll::Collection

Jekyll::CollectionReader

Jekyll::Command

Jekyll::Commands

Jekyll::Commands::Build

Jekyll::Commands::Clean

Jekyll::Commands::Doctor

Jekyll::Commands::Help

Jekyll::Commands::New

Jekyll::Commands::NewTheme

Jekyll::Commands::Serve

Jekyll::Commands::Serve::Servlet

Jekyll::Configuration

Jekyll::Converter

Jekyll::Converters

Jekyll::Converters::Identity

Jekyll::Converters::Markdown

Jekyll::Converters::Markdown::KramdownParser

Jekyll::Converters::Markdown::RDiscountParser

Jekyll::Converters::Markdown::RedcarpetParser

Jekyll::Converters::Markdown::RedcarpetParser::CommonMethods

Jekyll::Converters::Markdown::RedcarpetParser::WithPygments

Jekyll::Converters::Markdown::RedcarpetParser::WithRouge

Jekyll::Converters::Markdown::RedcarpetParser::WithoutHighlighting

Jekyll::Converters::SmartyPants

Jekyll::Convertible

Jekyll::DataReader

Jekyll::Deprecator

Jekyll::Document

Jekyll::Drops

Jekyll::Drops::CollectionDrop

Jekyll::Drops::DocumentDrop

Jekyll::Drops::Drop

Jekyll::Drops::ExcerptDrop

Jekyll::Drops::JekyllDrop

Jekyll::Drops::SiteDrop

Jekyll::Drops::UnifiedPayloadDrop

Jekyll::Drops::UrlDrop

Jekyll::EntryFilter

Jekyll::Errors

Jekyll::Excerpt

Jekyll::External

Jekyll::Filters

Jekyll::FrontmatterDefaults

Jekyll::Hooks

Jekyll::Layout

Jekyll::LayoutReader

Jekyll::LiquidExtensions

Jekyll::LiquidRenderer

Jekyll::LiquidRenderer::File

Jekyll::LiquidRenderer::Table

Jekyll::LogAdapter

Jekyll::Page

Jekyll::PageReader

Jekyll::Plugin

Jekyll::PluginManager

Jekyll::PostReader

Jekyll::Publisher

Jekyll::Reader

Jekyll::Regenerator

Jekyll::RelatedPosts

Jekyll::Renderer

Jekyll::Site

Jekyll::StaticFile

Jekyll::StaticFileReader

Jekyll::Stevenson

Jekyll::Tags

Jekyll::Tags::HighlightBlock

Jekyll::Tags::IncludeRelativeTag

Jekyll::Tags::IncludeTag

Jekyll::Tags::IncludeTagError

Jekyll::Tags::Link

Jekyll::Tags::PostComparer

Jekyll::Tags::PostUrl

Jekyll::Theme

Jekyll::ThemeBuilder

Jekyll::ThemeBuilder::ERBRenderer

Jekyll::URL

Jekyll::Utils

Jekyll::Utils::Ansi

Jekyll::Utils::Platforms

Jekyll::Utils::Platforms::RbConfig

Kramdown

Kramdown::Parser

Kramdown::Parser::SmartyPants

Liquid

Object

SafeYAML

class Jekyll::Tags::Link

Public Class Methods

          new(tag_name, relative_path, tokens)

          click to toggle source

              Calls superclass method

# File lib/jekyll/tags/link.rb, line 10
def initialize(tag_name, relative_path, tokens)
  super

  @relative_path = relative_path.strip
end

          tag_name()

          click to toggle source

# File lib/jekyll/tags/link.rb, line 5
def tag_name
  self.name.split("::").last.downcase
end

Public Instance Methods

          render(context)

          click to toggle source

# File lib/jekyll/tags/link.rb, line 16
      def render(context)
        site = context.registers[:site]

        site.docs_to_write.each do |document|
          return document.url if document.relative_path == @relative_path
        end

        raise ArgumentError, <<eos
Could not find document '#{@relative_path}' in tag '#{self.class.tag_name}'.

Make sure the document exists and the path is correct.
eos
      end

[Validate]

Generated by RDoc 4.0.0.

Generated with the Darkfish Rdoc Generator 3.


<?php
/**
 * This file implements the UI view for Tools > Email > Sent
 *
 * This file is part of the evoCore framework - {@link http://evocore.net/}
 * See also {@link https://github.com/b2evolution/b2evolution}.
 *
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @copyright (c)2003-2020 by Francois Planque - {@link http://fplanque.com/}
 *
 * @package admin
 */
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );

global $edited_EmailLog, $admin_url;

$Form = new Form( NULL, 'mail_log', 'post', 'compact' );

$Form->global_icon( T_('Cancel viewing!'), 'close', regenerate_url( 'blog' ) );

$Form->begin_form( 'fform', sprintf( T_('Mail log ID#%s'), $edited_EmailLog->ID ) );

$Form->begin_line( T_('Result'), NULL );
$result = emlog_result_info( $edited_EmailLog->result, array(), $edited_EmailLog->last_open_ts, $edited_EmailLog->last_click_ts );
$result .= '  'email', 'tab' => 'return', 'email' => $edited_EmailLog->to ) ).'" class="'.button_class().' middle" title="'.format_to_output( T_('Go to return log'), 'htmlattr' ).'">'
		.get_icon( 'magnifier', 'imgtag', array( 'title' => T_('Go to return log') ) ).' '.T_('Returns').'';
$Form->info_field( '', $result );
$Form->end_line( NULL );

$Form->info( T_('Date'), mysql2localedatetime_spans( $edited_EmailLog->timestamp ) );

$deleted_user_note = '';
if( $edited_EmailLog->user_ID > 0 )
{
	$UserCache = & get_UserCache();
	if( $User = $UserCache->get_by_ID( $edited_EmailLog->user_ID, false ) )
	{
		$Form->info( T_('To User'), $User->get_identity_link() );
	}
	else
	{
		$deleted_user_note = '( '.T_( 'Deleted user' ).' )';
	}
}

$Form->begin_line( T_('To'), NULL );
$to_address = htmlspecialchars($edited_EmailLog->to).$deleted_user_note;
$to_address .= '  'email', 'tab' => 'sent', 'email' => $edited_EmailLog->to ) ).'" class="'.button_class().' middle" title="'.format_to_output( T_('Go to return log'), 'htmlattr' ).'">'
		.get_icon( 'magnifier', 'imgtag', array( 'title' => T_('Go to send log') ) ).' '.T_('Send Log').'';
$Form->info_field( '', $to_address );
$Form->end_line( NULL );

$Form->info( T_('Subject'), '
'.htmlspecialchars($edited_EmailLog->subject).'
' );

$Form->info( T_('Headers'), '
'.htmlspecialchars($edited_EmailLog->headers).'
' );

$mail_contents = mail_log_parse_message( $edited_EmailLog->headers, $edited_EmailLog->message );

if( !empty( $mail_contents ) )
{
	if( !empty( $mail_contents['text'] ) )
	{ // Display Plain Text content
		$plain_text_content = preg_replace( '~\$secret_content_start\$.*?\$secret_content_end\$~', '***secret-content-removed***', $mail_contents['text']['content'] );
		$plain_text_content = preg_replace( '~\$email_key_start\$(.*?)\$email_key_end\$~', '***prevent-tracking-through-log***$1', $plain_text_content );

		$Form->info( T_('Text content'), $mail_contents['text']['type']
				.'
'.htmlspecialchars( $plain_text_content ).'
' );
	}

	if( !empty( $mail_contents['html'] ) )
	{ // Display HTML content

		$html_content = preg_replace( '~\$secret_content_start\$.*?\$secret_content_end\$~', '***secret-content-removed***', $mail_contents['html']['content'] );
		$html_content = preg_replace( '~\$email_key_start\$(.*?)\$email_key_end\$~', '***prevent-tracking-through-log***$1', $html_content );

		if( ! empty( $mail_contents['html']['head_style'] ) )
		{ // Print out all styles of email message
			echo '';
		}
		$div_html_class = empty( $mail_contents['html']['body_class'] ) ? '' : ' '.$mail_contents['html']['body_class'];
		$div_html_style = empty( $mail_contents['html']['body_style'] ) ? '' : ' style="'.$mail_contents['html']['body_style'].'"';
		$Form->info( T_('HTML content'), $mail_contents['html']['type']
				.'
'.$html_content.'
' );
	}
}
$emlog_message = preg_replace( '~\$secret_content_start\$.*?\$secret_content_end\$~', '***secret-content-removed***', $edited_EmailLog->message );
$emlog_message = preg_replace( '~\$email_key_start\$(.*?)\$email_key_end\$~', '***prevent-tracking-through-log***$1', $emlog_message );
$Form->info( T_('Raw email source'), '
'.htmlspecialchars( $emlog_message ).'
' );

$Form->end_form();

?>


Tree

Changed the MaxTreeSize default from 1.9 GBytes to 100 GBytes.

Add new special functions in TTreeFormula (and hence TTree::Draw and TTree::Scan) to calculate the minimun and maximum with an entry:

Min$(formula),Max$(formula):
return the minimun/maximum (within one TTree entry) of the value of the
                       elements of the formula given as a parameter.

MinIf$(formula,condition),MaxIf$(formula,condition):
return the minimum (maximum) (within one TTree entry)
                       of the value of the elements of the formula given as a parameter
                      if they match the condition. If not element match the condition, the result is zero.  To avoid the
                       the result is zero.  To avoid the consequent peak a zero, use the
                       pattern:

tree->Draw("MinIf$(formula,condition)","condition");

                       which will avoid calculation MinIf$ for the entries that have no match
                       for the condition.

Add support in TTreeFormula (and hence TTree::Draw and TTree::Scan) for the ternary condition operator ( cond ? if_expr : else_expr ).

Significantly (by 2 order of magnitude) improved the performance of TTree::Draw calling C++ functions.

Replace the function <tt>TSelectorDraw::MakeIndex</tt> and <tt>TSelectorDraw::GetNameByIndex</tt>
     with the function <tt>TSelectorDraw::SplitNames.</tt>

Add a return value to SetBranchAddress, a return value greater or equal to zero indicate success, a negative
value indicates failure (in both case, the address is still updated).  Example:

if (tree->SetBranchAddress(mybranch,&myvar) < 0) {
   cerr << "Something went wrong\n";
   return;
}

The possible return values are:

kMissingBranch (-5) : Missing branch

kInternalError (-4) : Internal error (could not find the type corresponding to a data type number.

kMissingCompiledCollectionProxy (-3) : Missing compiled collection proxy for a compiled collection.

kMismatch (-2) : Non-Class Pointer type given does not match the type expected by the branch.

kClassMismatch (-1) : Class Pointer type given does not match the type expected by the branch.

kMatch (0) : perfect match.

kMatchConversion (1) : match with (I/O) conversion.

kMatchConversionCollection (2) : match with (I/O) conversion of the content of a collection.

kMakeClass (3) : MakeClass mode so we can not check.

kVoidPtr (4) : void* passed so no check was made.

kNoCheck (5) : Underlying TBranch not yet available so no check was made.

Insure that the TTreeCloner (fast merging) is able to also copy 'uninitialized' TStreamerInfo describing abstract classes.

Repair several use case of splitting collection of pointers (especially when their split level is 1).

Several run-time performance improvements.

In TTree::Fill use fZipBytes instead of fTotBytes for deciding when to flush or autosave.

Properly handle TTree aliases containing array indices.

Fix the default sorting order of baskets when the TTree is an older in-memory TTree.
Enhance the sort order to use the 'entry number' when the seek position are equal.
Consequently the default sort order for an older in-memory TTree is now
essentially kSortBasketsByEntry rather than kSortBasketsByBranch (old 'correct' sort
order) or 'random' (the 'broken' sort order prior to this release).

IMPORTANT enhancement in TTree::Fill:

Slides from a recent seminar describing the main features of ROOT IO and Trees  and the recent
improvements described below are available at
 http://root.cern.ch/files/brun_lcgapp09.pptx
or
 http://root.cern.ch/files/brun_lcgapp09.pdf .

The baskets are flushed and the Tree header saved at regular intervals (See AutoFlush and OptimizeBaskets)

When the amount of data written so far (fTotBytes) is greater than fAutoFlush (see SetAutoFlush) all the baskets are flushed to disk.
This makes future reading faster as it guarantees that baskets belonging to nearby entries will be on the same disk region.

When the first call to flush the baskets happens, we also take this opportunity to optimize the baskets buffers.
We also check if the number of bytes written is greater than fAutoSave (see SetAutoSave).
In this case we also write the Tree header. This makes the Tree recoverable up to this point in case the program writing the Tree crashes.

Note that the user can also decide to call FlushBaskets and AutoSave in her event loop on the base of the number of events written instead of the number of bytes written.

New function TTree::OptimizeBaskets

void TTree::OptimizeBaskets(Int_t maxMemory, Float_t minComp, Option_t *option)

This function may be called after having filled some entries in a Tree
using the information in the existing branch buffers, it will reassign
new branch buffer sizes to optimize time and memory.

The function computes the best values for branch buffer sizes such that
the total buffer sizes is less than maxMemory and nearby entries written
at the same time.
In case the branch compression factor for the data written so far is less
than compMin, the compression is disabled.

if option ="d" an analysis report is printed.

This function may also be called on an existing Tree to figure out the best values
given the information in the Tree header

   TFile f("myfile.root");
   TTree *T = (TTree*)f.Get("mytreename");
   T->Print();  //show the branch buffer sizes before optimization
   T->OptimizeBaskets(10000000,1,"d");
   T->Print();  //show the branch buffer sizes after optimization

New interface functions to customize the TreeCache

   virtual void  AddBranchToCache(const char *bname, Bool_t subbranches = kFALSE);
   virtual void  AddBranchToCache(TBranch *branch,   Bool_t subbranches = kFALSE);
   virtual void  PrintCacheStats(Option_t* option = "") const;
   virtual void  SetParallelUnzip(Bool_t opt=kTRUE);
   virtual void  SetCacheEntryRange(Long64_t first, Long64_t last);
   virtual void  SetCacheLearnEntries(Int_t n=10);
   virtual void  StopCacheLearningPhase();

New functionality AutoFlush (and changes to AutoSave)

Implement a new member fAutoFlush in TTree with its getter and setter:

void TTree::SetAutoFlush(Long64_t autof)

The logic of the AutoFlush mechanism is optimized such that the TreeCache
will read always up to the point where FlushBaskets has been called.
This minimizes the number of cases where one has to seek backward when reading.

This function may be called at the start of a program to change
the default value for fAutoFlush.

CASE 1 : autof > 0

 autof is the number of consecutive entries after which TTree::Fill will
 flush all branch buffers to disk.

     CASE 2 : autof < 0

 When filling the Tree the branch buffers will be flushed to disk when
 more than autof bytes have been written to the file. At the first FlushBaskets
 TTree::Fill will replace fAutoFlush by the current value of fEntries.

 Calling this function with autof < 0 is interesting when it is hard to estimate
 the size of one entry. This value is also independent of the Tree.

 When calling SetAutoFlush with no arguments, the
 default value is -30000000, ie that the first AutoFlush will be done when
 30 MBytes of data are written to the file.

      CASE 3 : autof = 0

 The AutoFlush mechanism is disabled.

 Flushing the buffers at regular intervals optimize the location of
 consecutive entries on the disk.

Changed the default value of AutoSave from 10 to 30 MBytes.

New class TTreePerfStats

This new class is an important tool to measure the I/O performance of a Tree.
It shows the locations in the file when reading a Tree. In particular it is easy
to see the performance of the Tree Cache. The results can be:

drawn in a canvas.

printed on standard output.

saved to a file for processing later.

       Example of use
 {
   TFile *f = TFile::Open("RelValMinBias-GEN-SIM-RECO.root");
   T = (TTree*)f->Get("Events");
   Long64_t nentries = T->GetEntries();
   T->SetCacheSize(10000000);
   T->AddBranchToCache("*");

   TTreePerfStats *ps= new TTreePerfStats("ioperf",T);

   for (Int_t i=0;i<nentries;i++) {
      T->GetEntry(i);
   }
   ps->SaveAs("atlas_perf.root");
 }

then, in a root interactive session, one can do:

    root > TFile f("atlas_perf.root");
    root > ioperf->Draw();
    root > ioperf->Print();

 The Draw or Print functions print the following information:

   TreeCache = TTree cache size in MBytes
   N leaves  = Number of leaves in the TTree
   ReadTotal = Total number of zipped bytes read
   ReadUnZip = Total number of unzipped bytes read
   ReadCalls = Total number of disk reads
   ReadSize  = Average read size in KBytes
   Readahead = Readahead size in KBytes
   Readextra = Readahead overhead in percent
   Real Time = Real Time in seconds
   CPU  Time = CPU Time in seconds
   Disk Time = Real Time spent in pure raw disk IO
   Disk IO   = Raw disk IO speed in MBytes/second
   ReadUZRT  = Unzipped MBytes per RT second
   ReadUZCP  = Unipped MBytes per CP second
   ReadRT    = Zipped MBytes per RT second
   ReadCP    = Zipped MBytes per CP second

The Figure below shows the result for an original non optimized file when
the Tree Cache is not used.

The Figure below shows the result for the above data file written with the
new version of ROOT and when the Tree cache is activated.


/*
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package app.tivi.tmdb

private val IMAGE_SIZE_PATTERN = "w(\\d+)$".toRegex()

data class TmdbImageUrlProvider(
    private val baseImageUrl: String = TmdbImageSizes.baseImageUrl,
    private val posterSizes: List<String> = TmdbImageSizes.posterSizes,
    private val backdropSizes: List<String> = TmdbImageSizes.backdropSizes,
    private val logoSizes: List<String> = TmdbImageSizes.logoSizes
) {
    fun getPosterUrl(path: String, imageWidth: Int): String {
        return "$baseImageUrl${selectSize(posterSizes, imageWidth)}$path"
    }

    fun getBackdropUrl(path: String, imageWidth: Int): String {
        return "$baseImageUrl${selectSize(backdropSizes, imageWidth)}$path"
    }

    fun getLogoUrl(path: String, imageWidth: Int): String {
        return "$baseImageUrl${selectSize(logoSizes, imageWidth)}$path"
    }

    private fun selectSize(sizes: List<String>, imageWidth: Int): String {
        var previousSize: String? = null
        var previousWidth = 0

        for (i in sizes.indices) {
            val size = sizes[i]
            val sizeWidth = extractWidthAsIntFrom(size) ?: continue

            if (sizeWidth > imageWidth) {
                if (previousSize != null && imageWidth > (previousWidth + sizeWidth) / 2) {
                    return size
                } else if (previousSize != null) {
                    return previousSize
                }
            } else if (i == sizes.size - 1) {
                // If we get here then we're larger than the last bucket
                if (imageWidth < sizeWidth * 2) {
                    return size
                }
            }

            previousSize = size
            previousWidth = sizeWidth
        }

        return previousSize ?: sizes.last()
    }

    private fun extractWidthAsIntFrom(size: String): Int? {
        return IMAGE_SIZE_PATTERN.matchEntire(size)?.groups?.get(1)?.value?.toInt()
    }
}


// -------------------------------------------------------------------------------------------
// <copyright file="LayoutElementCollection.cs" company="MapWindow OSS Team - www.mapwindow.org">
//  MapWindow OSS Team - 2015
// </copyright>
// -------------------------------------------------------------------------------------------

using System.Collections;
using System.Collections.Generic;
using MW5.Plugins.Printing.Model.Elements;

namespace MW5.Plugins.Printing.Model
{
    internal class LayoutElementCollection : IEnumerable<LayoutElement>
    {
        private readonly List<LayoutElement> _elements;

        public LayoutElementCollection()
        {
            _elements = new List<LayoutElement>();
        }

        /// <summary>
        /// Returns an enumerator that iterates through the collection.
        /// </summary>
        public IEnumerator<LayoutElement> GetEnumerator()
        {
            return _elements.GetEnumerator();
        }

        /// <summary>
        /// Returns an enumerator that iterates through a collection.
        /// </summary>
        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}


/// @ref core
/// @file glm/detail/func_common_simd.inl

#if GLM_ARCH & GLM_ARCH_SSE2_BIT

#include "../simd/common.h"

#include <immintrin.h>

namespace glm{
namespace detail
{
	template<qualifier Q>
	struct compute_abs_vector<4, float, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
		{
			vec<4, float, Q> result;
			result.data = glm_vec4_abs(v.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_abs_vector<4, int, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v)
		{
			vec<4, int, Q> result;
			result.data = glm_ivec4_abs(v.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_floor<4, float, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
		{
			vec<4, float, Q> result;
			result.data = glm_vec4_floor(v.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_ceil<4, float, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
		{
			vec<4, float, Q> result;
			result.data = glm_vec4_ceil(v.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_fract<4, float, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
		{
			vec<4, float, Q> result;
			result.data = glm_vec4_fract(v.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_round<4, float, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
		{
			vec<4, float, Q> result;
			result.data = glm_vec4_round(v.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_mod<4, float, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y)
		{
			vec<4, float, Q> result;
			result.data = glm_vec4_mod(x.data, y.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_min_vector<4, float, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2)
		{
			vec<4, float, Q> result;
			result.data = _mm_min_ps(v1.data, v2.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_min_vector<4, int, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2)
		{
			vec<4, int, Q> result;
			result.data = _mm_min_epi32(v1.data, v2.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_min_vector<4, uint, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2)
		{
			vec<4, uint, Q> result;
			result.data = _mm_min_epu32(v1.data, v2.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_max_vector<4, float, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2)
		{
			vec<4, float, Q> result;
			result.data = _mm_max_ps(v1.data, v2.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_max_vector<4, int, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2)
		{
			vec<4, int, Q> result;
			result.data = _mm_max_epi32(v1.data, v2.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_max_vector<4, uint, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2)
		{
			vec<4, uint, Q> result;
			result.data = _mm_max_epu32(v1.data, v2.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_clamp_vector<4, float, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& minVal, vec<4, float, Q> const& maxVal)
		{
			vec<4, float, Q> result;
			result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_clamp_vector<4, int, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& x, vec<4, int, Q> const& minVal, vec<4, int, Q> const& maxVal)
		{
			vec<4, int, Q> result;
			result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_clamp_vector<4, uint, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& x, vec<4, uint, Q> const& minVal, vec<4, uint, Q> const& maxVal)
		{
			vec<4, uint, Q> result;
			result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data);
			return result;
		}
	};

	template<qualifier Q>
	struct compute_mix_vector<4, float, bool, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y, vec<4, bool, Q> const& a)
		{
			__m128i const Load = _mm_set_epi32(-static_cast<int>(a.w), -static_cast<int>(a.z), -static_cast<int>(a.y), -static_cast<int>(a.x));
			__m128 const Mask = _mm_castsi128_ps(Load);

			vec<4, float, Q> Result;
#			if 0 && GLM_ARCH & GLM_ARCH_AVX
				Result.data = _mm_blendv_ps(x.data, y.data, Mask);
#			else
				Result.data = _mm_or_ps(_mm_and_ps(Mask, y.data), _mm_andnot_ps(Mask, x.data));
#			endif
			return Result;
		}
	};
/* FIXME
	template<qualifier Q>
	struct compute_step_vector<float, Q, tvec4>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge, vec<4, float, Q> const& x)
		{
			vec<4, float, Q> Result;
			result.data = glm_vec4_step(edge.data, x.data);
			return result;
		}
	};
*/
	template<qualifier Q>
	struct compute_smoothstep_vector<4, float, Q, true>
	{
		GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge0, vec<4, float, Q> const& edge1, vec<4, float, Q> const& x)
		{
			vec<4, float, Q> Result;
			Result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data);
			return Result;
		}
	};
}//namespace detail
}//namespace glm

#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT


powered by CakePHP and CakePlate

TM + ©<?php echo date('Y')?> YourCo. All rights reserved. Privacy Policy - Terms


module Side {
    'use strict';

    import Paths = Constants.Paths;
    let Page = Paths.Side;

    angular.module(Page.Base, [])
        .config(statesConfiguration);

    function statesConfiguration(
        $stateProvider: ng.ui.IStateProvider
    ): void {

        $stateProvider
            .state(Paths.Tabs + '.' + Page.Left, {
                url: '/' + Page.Left,
                views: {
                    'left-tab': {
                        templateUrl: Paths.Modules + 'side/views/left.html'
                    }
                }
            }
        );
    }
}


<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2016 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical">

    <!-- This TextView holds the weather data for one particular day in the forecast -->
    <TextView
        android:id="@+id/tv_weather_data"
        style="@style/TextAppearance.AppCompat.Large"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="16dp"/>

    <!-- This View serves as a visual divider between list items -->
    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#dadada"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp" />

</LinearLayout>


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

    <title> </title>

    <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"/>

	    Scilab Enterprises

	    Copyright (c) 2011-2014 (Scilab Enterprises)

	    Copyright (c) 1989-2012 (INRIA)

	    Copyright (c) 1989-2007 (ENPC)

	    with contributors

	    Last updated:


//
//     Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).
//
//     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//

#import <ConfigurationEngineModel/CEMPayloadBase.h>

@class NSNumber, NSString;

@interface CEMSystemNotificationsDeclaration_NotificationSettingsItem : CEMPayloadBase
{
    NSString *_payloadBundleIdentifier;
    NSNumber *_payloadNotificationsEnabled;
    NSNumber *_payloadShowInNotificationCenter;
    NSNumber *_payloadShowInLockScreen;
    NSNumber *_payloadAlertType;
    NSNumber *_payloadBadgesEnabled;
    NSNumber *_payloadSoundsEnabled;
    NSNumber *_payloadShowInCarPlay;
    NSNumber *_payloadEmergencyEnabled;
    NSNumber *_payloadCriticalAlertEnabled;
    NSNumber *_payloadGroupingType;
}

+ (id)buildRequiredOnlyWithBundleIdentifier:(id)arg1;
+ (id)buildWithBundleIdentifier:(id)arg1 withNotificationsEnabled:(id)arg2 withShowInNotificationCenter:(id)arg3 withShowInLockScreen:(id)arg4 withAlertType:(id)arg5 withBadgesEnabled:(id)arg6 withSoundsEnabled:(id)arg7 withShowInCarPlay:(id)arg8 withEmergencyEnabled:(id)arg9 withCriticalAlertEnabled:(id)arg10 withGroupingType:(id)arg11;
+ (id)allowedPayloadKeys;
- (void).cxx_destruct;
@property(copy, nonatomic) NSNumber *payloadGroupingType; // @synthesize payloadGroupingType=_payloadGroupingType;
@property(copy, nonatomic) NSNumber *payloadCriticalAlertEnabled; // @synthesize payloadCriticalAlertEnabled=_payloadCriticalAlertEnabled;
@property(copy, nonatomic) NSNumber *payloadEmergencyEnabled; // @synthesize payloadEmergencyEnabled=_payloadEmergencyEnabled;
@property(copy, nonatomic) NSNumber *payloadShowInCarPlay; // @synthesize payloadShowInCarPlay=_payloadShowInCarPlay;
@property(copy, nonatomic) NSNumber *payloadSoundsEnabled; // @synthesize payloadSoundsEnabled=_payloadSoundsEnabled;
@property(copy, nonatomic) NSNumber *payloadBadgesEnabled; // @synthesize payloadBadgesEnabled=_payloadBadgesEnabled;
@property(copy, nonatomic) NSNumber *payloadAlertType; // @synthesize payloadAlertType=_payloadAlertType;
@property(copy, nonatomic) NSNumber *payloadShowInLockScreen; // @synthesize payloadShowInLockScreen=_payloadShowInLockScreen;
@property(copy, nonatomic) NSNumber *payloadShowInNotificationCenter; // @synthesize payloadShowInNotificationCenter=_payloadShowInNotificationCenter;
@property(copy, nonatomic) NSNumber *payloadNotificationsEnabled; // @synthesize payloadNotificationsEnabled=_payloadNotificationsEnabled;
@property(copy, nonatomic) NSString *payloadBundleIdentifier; // @synthesize payloadBundleIdentifier=_payloadBundleIdentifier;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (id)serializePayloadWithAssetProviders:(id)arg1;
- (BOOL)loadPayload:(id)arg1 error:(id *)arg2;

@end