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

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;

import org.apache.camel.CamelExchangeException;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.component.file.GenericFile;
import org.apache.camel.component.http4.helper.HttpMethodHelper;
import org.apache.camel.converter.stream.CachedOutputStream;
import org.apache.camel.http.common.HttpHelper;
import org.apache.camel.http.common.HttpOperationFailedException;
import org.apache.camel.http.common.HttpProtocolHeaderFilterStrategy;
import org.apache.camel.impl.DefaultProducer;
import org.apache.camel.spi.HeaderFilterStrategy;
import org.apache.camel.support.SynchronizationAdapter;
import org.apache.camel.util.ExchangeHelper;
import org.apache.camel.util.GZIPHelper;
import org.apache.camel.util.IOHelper;
import org.apache.camel.util.MessageHelper;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.URISupport;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.FileEntity;
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.auth.BasicScheme;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.HTTP;
import org.apache.http.protocol.HttpContext;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @version
 */
public class HttpProducer extends DefaultProducer {
    private static final Logger LOG = LoggerFactory.getLogger(HttpProducer.class);
    private HttpClient httpClient;
    private HttpContext httpContext;
    private boolean throwException;
    private boolean transferException;
    private HeaderFilterStrategy httpProtocolHeaderFilterStrategy = new HttpProtocolHeaderFilterStrategy();

    public HttpProducer(HttpEndpoint endpoint) {
        super(endpoint);
        this.httpClient = endpoint.getHttpClient();
        this.httpContext = endpoint.getHttpContext();
        this.throwException = endpoint.isThrowExceptionOnFailure();
        this.transferException = endpoint.isTransferException();
    }

    public void process(Exchange exchange) throws Exception {

        if (getEndpoint().isClearExpiredCookies() && !getEndpoint().isBridgeEndpoint()) {
            // create the cookies before the invocation
            getEndpoint().getCookieStore().clearExpired(new Date());
        }

        // if we bridge endpoint then we need to skip matching headers with the HTTP_QUERY to avoid sending
        // duplicated headers to the receiver, so use this skipRequestHeaders as the list of headers to skip
        Map<String, Object> skipRequestHeaders = null;

        if (getEndpoint().isBridgeEndpoint()) {
            exchange.setProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.TRUE);
            String queryString = exchange.getIn().getHeader(Exchange.HTTP_QUERY, String.class);
            if (queryString != null) {
                skipRequestHeaders = URISupport.parseQuery(queryString, false, true);
            }
        }
        HttpRequestBase httpRequest = createMethod(exchange);
        Message in = exchange.getIn();
        String httpProtocolVersion = in.getHeader(Exchange.HTTP_PROTOCOL_VERSION, String.class);
        if (httpProtocolVersion != null) {
            // set the HTTP protocol version
            int[] version = HttpHelper.parserHttpVersion(httpProtocolVersion);
            httpRequest.setProtocolVersion(new HttpVersion(version[0], version[1]));
        }
        HeaderFilterStrategy strategy = getEndpoint().getHeaderFilterStrategy();

        // propagate headers as HTTP headers
        for (Map.Entry<String, Object> entry : in.getHeaders().entrySet()) {
            String key = entry.getKey();
            Object headerValue = in.getHeader(key);

            if (headerValue != null) {
                // use an iterator as there can be multiple values. (must not use a delimiter, and allow empty values)
                final Iterator<?> it = ObjectHelper.createIterator(headerValue, null, true);

                // the value to add as request header
                final List<String> values = new ArrayList<>();

                // if its a multi value then check each value if we can add it and for multi values they
                // should be combined into a single value
                while (it.hasNext()) {
                    String value = exchange.getContext().getTypeConverter().convertTo(String.class, it.next());

                    // we should not add headers for the parameters in the uri if we bridge the endpoint
                    // as then we would duplicate headers on both the endpoint uri, and in HTTP headers as well
                    if (skipRequestHeaders != null && skipRequestHeaders.containsKey(key)) {
                        continue;
                    }
                    if (value != null && strategy != null && !strategy.applyFilterToCamelHeaders(key, value, exchange)) {
                        values.add(value);
                    }
                }

                // add the value(s) as a http request header
                if (values.size() > 0) {
                    // use the default toString of a ArrayList to create in the form [xxx, yyy]
                    // if multi valued, for a single value, then just output the value as is
                    String s =  values.size() > 1 ? values.toString() : values.get(0);
                    httpRequest.addHeader(key, s);
                }
            }
        }

        if (getEndpoint().getCookieHandler() != null) {
            Map<String, List<String>> cookieHeaders = getEndpoint().getCookieHandler().loadCookies(exchange, httpRequest.getURI());
            for (Map.Entry<String, List<String>> entry : cookieHeaders.entrySet()) {
                String key = entry.getKey();
                if (entry.getValue().size() > 0) {
                    // join multi-values separated by semi-colon
                    httpRequest.addHeader(key, entry.getValue().stream().collect(Collectors.joining(";")));
                }
            }
        }

        //In reverse proxy applications it can be desirable for the downstream service to see the original Host header
        //if this option is set, and the exchange Host header is not null, we will set it's current value on the httpRequest
        if (getEndpoint().isPreserveHostHeader()) {
            String hostHeader = exchange.getIn().getHeader("Host", String.class);
            if (hostHeader != null) {
                //HttpClient 4 will check to see if the Host header is present, and use it if it is, see org.apache.http.protocol.RequestTargetHost in httpcore
                httpRequest.setHeader("Host", hostHeader);
            }
        }

        if (getEndpoint().isConnectionClose()) {
            httpRequest.addHeader("Connection", HTTP.CONN_CLOSE);
        }

        // lets store the result in the output message.
        HttpResponse httpResponse = null;
        try {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Executing http {} method: {}", httpRequest.getMethod(), httpRequest.getURI().toString());
            }
            httpResponse = executeMethod(httpRequest);
            int responseCode = httpResponse.getStatusLine().getStatusCode();
            LOG.debug("Http responseCode: {}", responseCode);

            if (!throwException) {
                // if we do not use failed exception then populate response for all response codes
                populateResponse(exchange, httpRequest, httpResponse, in, strategy, responseCode);
            } else {
                boolean ok = HttpHelper.isStatusCodeOk(responseCode, getEndpoint().getOkStatusCodeRange());
                if (ok) {
                    // only populate response for OK response
                    populateResponse(exchange, httpRequest, httpResponse, in, strategy, responseCode);
                } else {
                    // operation failed so populate exception to throw
                    throw populateHttpOperationFailedException(exchange, httpRequest, httpResponse, responseCode);
                }
            }
        } finally {
            final HttpResponse response = httpResponse;
            if (httpResponse != null && getEndpoint().isDisableStreamCache()) {
                // close the stream at the end of the exchange to ensure it gets eventually closed later
                exchange.addOnCompletion(new SynchronizationAdapter() {
                    @Override
                    public void onDone(Exchange exchange) {
                        try {
                            EntityUtils.consume(response.getEntity());
                        } catch (Throwable e) {
                            // ignore
                        }
                    }
                });
            } else if (httpResponse != null) {
                // close the stream now
                try {
                    EntityUtils.consume(response.getEntity());
                } catch (Throwable e) {
                    // ignore
                }
            }
        }
    }

    @Override
    public HttpEndpoint getEndpoint() {
        return (HttpEndpoint) super.getEndpoint();
    }

    protected void populateResponse(Exchange exchange, HttpRequestBase httpRequest, HttpResponse httpResponse,
                                    Message in, HeaderFilterStrategy strategy, int responseCode) throws IOException, ClassNotFoundException {
        // We just make the out message is not create when extractResponseBody throws exception
        Object response = extractResponseBody(httpRequest, httpResponse, exchange, getEndpoint().isIgnoreResponseBody());
        Message answer = exchange.getOut();

        answer.setHeader(Exchange.HTTP_RESPONSE_CODE, responseCode);
        if (httpResponse.getStatusLine() != null) {
            answer.setHeader(Exchange.HTTP_RESPONSE_TEXT, httpResponse.getStatusLine().getReasonPhrase());
        }
        answer.setBody(response);

        // propagate HTTP response headers
        Header[] headers = httpResponse.getAllHeaders();
        Map<String, List<String>> m = new HashMap<>();
        for (Header header : headers) {
            String name = header.getName();
            String value = header.getValue();
            m.computeIfAbsent(name, k -> new ArrayList<>()).add(value);
            if (name.toLowerCase().equals("content-type")) {
                name = Exchange.CONTENT_TYPE;
                exchange.setProperty(Exchange.CHARSET_NAME, IOHelper.getCharsetNameFromContentType(value));
            }
            // use http helper to extract parameter value as it may contain multiple values
            Object extracted = HttpHelper.extractHttpParameterValue(value);
            if (strategy != null && !strategy.applyFilterToExternalHeaders(name, extracted, exchange)) {
                HttpHelper.appendHeader(answer.getHeaders(), name, extracted);
            }
        }
        // handle cookies
        if (getEndpoint().getCookieHandler() != null) {
            getEndpoint().getCookieHandler().storeCookies(exchange, httpRequest.getURI(), m);
        }
        // endpoint might be configured to copy headers from in to out
        // to avoid overriding existing headers with old values just
        // filter the http protocol headers
        if (getEndpoint().isCopyHeaders()) {
            MessageHelper.copyHeaders(exchange.getIn(), answer, httpProtocolHeaderFilterStrategy, false);
        }
    }

    protected Exception populateHttpOperationFailedException(Exchange exchange, HttpRequestBase httpRequest, HttpResponse httpResponse, int responseCode) throws IOException, ClassNotFoundException {
        Exception answer;

        String uri = httpRequest.getURI().toString();
        String statusText = httpResponse.getStatusLine() != null ? httpResponse.getStatusLine().getReasonPhrase() : null;
        Map<String, String> headers = extractResponseHeaders(httpResponse.getAllHeaders());
        // handle cookies
        if (getEndpoint().getCookieHandler() != null) {
            Map<String, List<String>> m = new HashMap<>();
            for (Entry<String, String> e : headers.entrySet()) {
                m.put(e.getKey(), Collections.singletonList(e.getValue()));
            }
            getEndpoint().getCookieHandler().storeCookies(exchange, httpRequest.getURI(), m);
        }

        Object responseBody = extractResponseBody(httpRequest, httpResponse, exchange, getEndpoint().isIgnoreResponseBody());
        if (transferException && responseBody != null && responseBody instanceof Exception) {
            // if the response was a serialized exception then use that
            return (Exception) responseBody;
        }

        // make a defensive copy of the response body in the exception so its detached from the cache
        String copy = null;
        if (responseBody != null) {
            copy = exchange.getContext().getTypeConverter().convertTo(String.class, exchange, responseBody);
        }

        Header locationHeader = httpResponse.getFirstHeader("location");
        if (locationHeader != null && (responseCode >= 300 && responseCode < 400)) {
            answer = new HttpOperationFailedException(uri, responseCode, statusText, locationHeader.getValue(), headers, copy);
        } else {
            answer = new HttpOperationFailedException(uri, responseCode, statusText, null, headers, copy);
        }

        return answer;
    }

    /**
     * Strategy when executing the method (calling the remote server).
     *
     * @param httpRequest the http Request to execute
     * @return the response
     * @throws IOException can be thrown
     */
    protected HttpResponse executeMethod(HttpUriRequest httpRequest) throws IOException {
        HttpContext localContext = new BasicHttpContext();
        if (getEndpoint().isAuthenticationPreemptive()) {
            BasicScheme basicAuth = new BasicScheme();
            localContext.setAttribute("preemptive-auth", basicAuth);
        }
        if (httpContext != null) {
            localContext = new BasicHttpContext(httpContext);
        }
        return httpClient.execute(httpRequest, localContext);
    }

    /**
     * Extracts the response headers
     *
     * @param responseHeaders the headers
     * @return the extracted headers or <tt>null</tt> if no headers existed
     */
    protected static Map<String, String> extractResponseHeaders(Header[] responseHeaders) {
        if (responseHeaders == null || responseHeaders.length == 0) {
            return null;
        }

        Map<String, String> answer = new HashMap<>();
        for (Header header : responseHeaders) {
            answer.put(header.getName(), header.getValue());
        }

        return answer;
    }

    /**
     * Extracts the response from the method as a InputStream.
     */
    protected Object extractResponseBody(HttpRequestBase httpRequest, HttpResponse httpResponse, Exchange exchange, boolean ignoreResponseBody) throws IOException, ClassNotFoundException {
        HttpEntity entity = httpResponse.getEntity();
        if (entity == null) {
            return null;
        }

        InputStream is = entity.getContent();
        if (is == null) {
            return null;
        }

        Header header = httpResponse.getFirstHeader(Exchange.CONTENT_ENCODING);
        String contentEncoding = header != null ? header.getValue() : null;

        if (!exchange.getProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.FALSE, Boolean.class)) {
            is = GZIPHelper.uncompressGzip(contentEncoding, is);
        }
        // Honor the character encoding
        String contentType = null;
        header = httpResponse.getFirstHeader("content-type");
        if (header != null) {
            contentType = header.getValue();
            // find the charset and set it to the Exchange
            HttpHelper.setCharsetFromContentType(contentType, exchange);
        }
        // if content type is a serialized java object then de-serialize it back to a Java object
        if (contentType != null && contentType.equals(HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT)) {
            // only deserialize java if allowed
            if (getEndpoint().getComponent().isAllowJavaSerializedObject() || getEndpoint().isTransferException()) {
                return HttpHelper.deserializeJavaObjectFromStream(is, exchange.getContext());
            } else {
                // empty response
                return null;
            }
        } else {
            if (!getEndpoint().isDisableStreamCache()) {
                // wrap the response in a stream cache so its re-readable
                InputStream response = null;
                if (!ignoreResponseBody) {
                    response = doExtractResponseBodyAsStream(is, exchange);
                }
                return response;
            } else {
                // use the response stream as-is
                return is;
            }
        }
    }

    private static InputStream doExtractResponseBodyAsStream(InputStream is, Exchange exchange) throws IOException {
        // As httpclient is using a AutoCloseInputStream, it will be closed when the connection is closed
        // we need to cache the stream for it.
        CachedOutputStream cos = null;
        try {
            // This CachedOutputStream will not be closed when the exchange is onCompletion
            cos = new CachedOutputStream(exchange, false);
            IOHelper.copy(is, cos);
            // When the InputStream is closed, the CachedOutputStream will be closed
            return cos.getWrappedInputStream();
        } catch (IOException ex) {
            // try to close the CachedOutputStream when we get the IOException
            try {
                cos.close();
            } catch (IOException ignore) {
                //do nothing here
            }
            throw ex;
        } finally {
            IOHelper.close(is, "Extracting response body", LOG);
        }
    }

    /**
     * Creates the HttpMethod to use to call the remote server, either its GET or POST.
     *
     * @param exchange the exchange
     * @return the created method as either GET or POST
     * @throws URISyntaxException is thrown if the URI is invalid
     * @throws Exception is thrown if error creating RequestEntity
     */
    protected HttpRequestBase createMethod(Exchange exchange) throws Exception {
        // creating the url to use takes 2-steps
        String url = HttpHelper.createURL(exchange, getEndpoint());
        URI uri = HttpHelper.createURI(exchange, url, getEndpoint());
        // get the url from the uri
        url = uri.toASCIIString();

        // execute any custom url rewrite
        String rewriteUrl = HttpHelper.urlRewrite(exchange, url, getEndpoint(), this);
        if (rewriteUrl != null) {
            // update url and query string from the rewritten url
            url = rewriteUrl;
            uri = new URI(url);
        }

        // create http holder objects for the request
        HttpEntity requestEntity = createRequestEntity(exchange);
        HttpMethods methodToUse = HttpMethodHelper.createMethod(exchange, getEndpoint(), requestEntity != null);
        HttpRequestBase method = methodToUse.createMethod(url);

        // special for HTTP DELETE if the message body should be included
        if (getEndpoint().isDeleteWithBody() && "DELETE".equals(method.getMethod())) {
            method = new HttpDeleteWithBodyMethod(url, requestEntity);
        }

        LOG.trace("Using URL: {} with method: {}", url, method);

        if (methodToUse.isEntityEnclosing()) {
            ((HttpEntityEnclosingRequestBase) method).setEntity(requestEntity);
            if (requestEntity != null && requestEntity.getContentType() == null) {
                LOG.debug("No Content-Type provided for URL: {} with exchange: {}", url, exchange);
            }
        }

        // there must be a host on the method
        if (method.getURI().getScheme() == null || method.getURI().getHost() == null) {
            throw new IllegalArgumentException("Invalid uri: " + uri
                    + ". If you are forwarding/bridging http endpoints, then enable the bridgeEndpoint option on the endpoint: " + getEndpoint());
        }

        return method;
    }

    /**
     * Creates a holder object for the data to send to the remote server.
     *
     * @param exchange the exchange with the IN message with data to send
     * @return the data holder
     * @throws CamelExchangeException is thrown if error creating RequestEntity
     */
    protected HttpEntity createRequestEntity(Exchange exchange) throws CamelExchangeException {
        Message in = exchange.getIn();
        if (in.getBody() == null) {
            return null;
        }

        HttpEntity answer = in.getBody(HttpEntity.class);
        if (answer == null) {
            try {
                Object data = in.getBody();
                if (data != null) {
                    String contentTypeString = ExchangeHelper.getContentType(exchange);
                    ContentType contentType = null;

                    //Check the contentType is valid or not, If not it throws an exception.
                    //When ContentType.parse parse method parse "multipart/form-data;boundary=---------------------------j2radvtrk",
                    //it removes "boundary" from Content-Type; I have to use contentType.create method.
                    if (contentTypeString != null) {
                        // using ContentType.parser for charset
                        if (contentTypeString.indexOf("charset") > 0 || contentTypeString.indexOf(";") > 0) {
                            contentType = ContentType.parse(contentTypeString);
                        } else {
                            contentType = ContentType.create(contentTypeString);
                        }
                    }

                    if (contentTypeString != null && HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT.equals(contentTypeString)) {
                        if (!getEndpoint().getComponent().isAllowJavaSerializedObject()) {
                            throw new CamelExchangeException("Content-type " + org.apache.camel.http.common.HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT + " is not allowed", exchange);
                        }
                        // serialized java object
                        Serializable obj = in.getMandatoryBody(Serializable.class);
                        // write object to output stream
                        ByteArrayOutputStream bos = new ByteArrayOutputStream();
                        HttpHelper.writeObjectToStream(bos, obj);
                        ByteArrayEntity entity = new ByteArrayEntity(bos.toByteArray());
                        entity.setContentType(HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT);
                        IOHelper.close(bos);
                        answer = entity;
                    } else if (data instanceof File || data instanceof GenericFile) {
                        // file based (could potentially also be a FTP file etc)
                        File file = in.getBody(File.class);
                        if (file != null) {
                            if (contentType != null) {
                                answer = new FileEntity(file, contentType);
                            } else {
                                answer = new FileEntity(file);
                            }
                        }
                    } else if (data instanceof String) {
                        // be a bit careful with String as any type can most likely be converted to String
                        // so we only do an instanceof check and accept String if the body is really a String
                        // do not fallback to use the default charset as it can influence the request
                        // (for example application/x-www-form-urlencoded forms being sent)
                        String charset = IOHelper.getCharsetName(exchange, false);
                        if (charset == null && contentType != null) {
                            // okay try to get the charset from the content-type
                            Charset cs = contentType.getCharset();
                            if (cs != null) {
                                charset = cs.name();
                            }
                        }
                        StringEntity entity = new StringEntity((String) data, charset);
                        if (contentType != null) {
                            entity.setContentType(contentType.toString());
                        }
                        answer = entity;
                    }

                    // fallback as input stream
                    if (answer == null) {
                        // force the body as an input stream since this is the fallback
                        InputStream is = in.getMandatoryBody(InputStream.class);
                        String length = in.getHeader(Exchange.CONTENT_LENGTH, String.class);
                        InputStreamEntity entity = null;
                        if (ObjectHelper.isEmpty(length)) {
                            entity = new InputStreamEntity(is, -1);
                        } else {
                            entity = new InputStreamEntity(is, Long.parseLong(length));
                        }
                        if (contentType != null) {
                            entity.setContentType(contentType.toString());
                        }
                        answer = entity;
                    }
                }
            } catch (UnsupportedEncodingException e) {
                throw new CamelExchangeException("Error creating RequestEntity from message body", exchange, e);
            } catch (IOException e) {
                throw new CamelExchangeException("Error serializing message body", exchange, e);
            }
        }
        return answer;
    }

    public HttpClient getHttpClient() {
        return httpClient;
    }

    public void setHttpClient(HttpClient httpClient) {
        this.httpClient = httpClient;
    }

}


text:
FROM alpine:3.11

ENV TEST_REPO=${TEST_REPO:-https://github.com/jonas27/workflow-testing} \
    TEST_RELEASE=${TEST_RELEASE:-20.09-comment-filetype}

RUN apk add --no-cache bash python3 curl \
    && apk add --no-cache --virtual build-dep gcc libxml2-dev libxslt-dev musl-dev linux-headers python3-dev \
    && pip3 install planemo \
    && mkdir /src && cd /src \
    && curl -L -s $TEST_REPO/archive/$TEST_RELEASE.tar.gz | tar xzf - --strip-components=1 \
    && apk del build-dep

# Make Python3 standard
RUN ln /usr/bin/python3 /usr/bin/python && ln /usr/bin/python3 /usr/bin/python2

ADD ./run.sh /usr/bin/run.sh

WORKDIR /src

ENTRYPOINT /usr/bin/run.sh

redpajama_set_name: RedPajamaGithub


text:
using Restup.HttpMessage.Models.Contracts;

namespace Restup.HttpMessage.Headers
{
    public abstract class HttpHeaderBase : IHttpHeader
    {
        public string Name { get; }
        public string Value { get; }

        protected HttpHeaderBase(string name, string value)
        {
            Name = name;
            Value = value;
        }
    }
}


text:
`ndb` is a client library for use with [Google Cloud Datastore][0].
It was designed specifically to be used from within the
[Google App Engine][1] Python runtime.

## Overview

Learn how to use the `ndb` library by visiting the Google Cloud Platform
[documentation][2].

[0]: https://cloud.google.com/datastore
[1]: https://cloud.google.com/appengine
[2]: https://cloud.google.com/appengine/docs/python/ndb/


text:
package pipe.historyActions;

import uk.ac.imperial.pipe.models.petrinet.Transition;

import java.util.List;

/**
 * History manager for stepping through animation actions when the Petri net is in animation mode
 */
public interface AnimationHistory {
    /**
     * Cannot step forward if head of the list
     * @return true if stepping forward within the animation is allowed, that is if there are transition firings to redo
     */
    boolean isStepForwardAllowed();

    /**
     * Can step back if currentPosition points to any transitions
     * @return  true if stepping backward within the animation is allowed, that is if there are transition firings to undo
     */
    boolean isStepBackAllowed();

    /**
     * Steps forward, updating the current item
     */
    void stepForward();

    /**
     * Steps backward, updating the current item
     */
    void stepBackwards();

    /**
     * Remove all steps past the current step
     */
    void clearStepsForward();

    /**
     *
     * @return a list of transitions fired
     */
    List<Transition> getFiringSequence();

    /**
     *
     * @return current position in the firing sequence
     */
    int getCurrentPosition();

    /**
     *
     * Register that this transition has been fired and create a history item for it
     * @param transition that was added
     */
    void addHistoryItem(Transition transition);

    /**
     *
     * @return transition at current position in the firing sequence
     */
    Transition getCurrentTransition();

    /**
     *
     * @param index of the transition
     * @return transition at this index in the firing sequence
     */
    Transition getTransition(int index);

    void clear();
}


text:
//
//  SKTransitionController.m
//  Skim
//
//  Created by Christiaan Hofman on 7/15/07.

/*
 This code is based partly on Apple's AnimatingTabView example code
 and Ankur Kothari's AnimatingTabsDemo application <http://dev.lipidity.com>
*/

#import "SKTransitionController.h"
#import "NSBitmapImageRep_SKExtensions.h"
#import "NSView_SKExtensions.h"
#import <CoreFoundation/CoreFoundation.h>
#import <Quartz/Quartz.h>
#include <unistd.h>
#import <OpenGL/OpenGL.h>
#import <OpenGL/gl.h>

NSString *SKStyleNameKey = @"styleName";
NSString *SKDurationKey = @"duration";
NSString *SKShouldRestrictKey = @"shouldRestrict";

#define kCIInputBacksideImageKey @"inputBacksideImage"
#define kCIInputRectangleKey @"inputRectangle"

#define WEAK_NULL NULL

#pragma mark Private Core Graphics types and functions

typedef int CGSConnection;
typedef int CGSWindow;

typedef enum _CGSTransitionType {
    CGSNone,
    CGSFade,
    CGSZoom,
    CGSReveal,
    CGSSlide,
    CGSWarpFade,
    CGSSwap,
    CGSCube,
    CGSWarpSwitch,
    CGSFlip
} CGSTransitionType;

typedef enum _CGSTransitionOption {
    CGSDown,
    CGSLeft,
    CGSRight,
    CGSInRight,
    CGSBottomLeft = 5,
    CGSBottomRight,
    CGSDownTopRight,
    CGSUp,
    CGSTopLeft,
    CGSTopRight,
    CGSUpBottomRight,
    CGSInBottom,
    CGSLeftBottomRight,
    CGSRightBottomLeft,
    CGSInBottomRight,
    CGSInOut
} CGSTransitionOption;

typedef struct _CGSTransitionSpec {
    uint32_t unknown1;
    CGSTransitionType type;
    CGSTransitionOption option;
    CGSWindow wid; // Can be 0 for full-screen
    float *backColour; // Null for black otherwise pointer to 3 CGFloat array with RGB value
} CGSTransitionSpec;

extern CGSConnection _CGSDefaultConnection(void) __attribute__((weak_import));

extern OSStatus CGSNewTransition(const CGSConnection cid, const CGSTransitionSpec* spec, int *pTransitionHandle) __attribute__((weak_import));
extern OSStatus CGSInvokeTransition(const CGSConnection cid, int transitionHandle, float duration) __attribute__((weak_import));
extern OSStatus CGSReleaseTransition(const CGSConnection cid, int transitionHandle) __attribute__((weak_import));

#pragma mark Check whether the above functions are actually defined at run time

static BOOL CoreGraphicsServicesTransitionsDefined() {
    return _CGSDefaultConnection != WEAK_NULL &&
           CGSNewTransition != WEAK_NULL &&
           CGSInvokeTransition != WEAK_NULL &&
           CGSReleaseTransition != WEAK_NULL;
}

#pragma mark -

typedef void(^SKTransitionAnimationProgressHandler)(CGFloat);

@interface SKTransitionAnimation : NSAnimation {
    SKTransitionAnimationProgressHandler progressHandler;
}
@property (nonatomic, copy) SKTransitionAnimationProgressHandler progressHandler;
@end

#pragma mark -

#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_6
@interface NSOpenGLView (SKLionDeclarations)
- (BOOL)wantsBestResolutionOpenGLSurface;
- (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag;
@end
#endif

@interface SKTransitionView : NSOpenGLView {
    CIImage *image;
    CGFloat imageScale;
    CIContext *context;
    BOOL needsReshape;
}
@property (nonatomic, retain) CIImage *image;
@property (nonatomic) CGFloat imageScale;
@end

#pragma mark -

@implementation SKTransitionController

@synthesize view, transitionStyle, duration, shouldRestrict, pageTransitions;
@dynamic hasTransition;

+ (NSArray *)transitionNames {
    static NSArray *transitionNames = nil;

    if (transitionNames == nil) {
        transitionNames = [NSArray arrayWithObjects:
            @"",
            @"CoreGraphics SKFadeTransition",
            @"CoreGraphics SKZoomTransition",
            @"CoreGraphics SKRevealTransition",
            @"CoreGraphics SKSlideTransition",
            @"CoreGraphics SKWarpFadeTransition",
            @"CoreGraphics SKSwapTransition",
            @"CoreGraphics SKCubeTransition",
            @"CoreGraphics SKWarpSwitchTransition",
            @"CoreGraphics SKWarpFlipTransition", nil];
        // get all the transition filters
		[CIPlugIn loadAllPlugIns];
        transitionNames = [[transitionNames arrayByAddingObjectsFromArray:[CIFilter filterNamesInCategory:kCICategoryTransition]] copy];
    }

    return transitionNames;
}

+ (NSString *)nameForStyle:(SKAnimationTransitionStyle)style {
    if (style > SKNoTransition && style < [[self transitionNames] count])
        return [[self transitionNames] objectAtIndex:style];
    else
        return nil;
}

+ (SKAnimationTransitionStyle)styleForName:(NSString *)name {
    NSUInteger idx = [[self transitionNames] indexOfObject:name];
    return idx == NSNotFound ? SKNoTransition : idx;
}

+ (NSString *)localizedNameForStyle:(SKAnimationTransitionStyle)style {
    switch (style) {
        case SKNoTransition:         return NSLocalizedString(@"No Transition", @"Transition name");
        case SKFadeTransition:       return NSLocalizedString(@"Fade", @"Transition name");
        case SKZoomTransition:       return NSLocalizedString(@"Zoom", @"Transition name");
        case SKRevealTransition:     return NSLocalizedString(@"Reveal", @"Transition name");
        case SKSlideTransition:      return NSLocalizedString(@"Slide", @"Transition name");
        case SKWarpFadeTransition:   return NSLocalizedString(@"Warp Fade", @"Transition name");
        case SKSwapTransition:       return NSLocalizedString(@"Swap", @"Transition name");
        case SKCubeTransition:       return NSLocalizedString(@"Cube", @"Transition name");
        case SKWarpSwitchTransition: return NSLocalizedString(@"Warp Switch", @"Transition name");
        case SKWarpFlipTransition:   return NSLocalizedString(@"Flip", @"Transition name");
        default:                     return [CIFilter localizedNameForFilterName:[self nameForStyle:style]];
    };
}

- (id)initForView:(NSView *)aView {
    self = [super init];
    if (self) {
        view = aView; // don't retain as it may retain us
        imageRect = NSZeroRect;

        transitionStyle = SKNoTransition;
        duration = 1.0;
        shouldRestrict = YES;
        currentTransitionStyle = SKNoTransition;
        currentDuration = 1.0;
        currentShouldRestrict = YES;
        currentForward = YES;
    }
    return self;
}

- (void)dealloc {
    view = nil;
    SKDESTROY(window);
    SKDESTROY(initialImage);
    SKDESTROY(pageTransitions);
    [super dealloc];
}

- (BOOL)hasTransition {
    return transitionStyle != SKNoTransition || pageTransitions != nil;
}

static inline CGRect scaleRect(NSRect rect, CGFloat scale) {
    return CGRectMake(scale * NSMinX(rect), scale * NSMinY(rect), scale * NSWidth(rect), scale * NSHeight(rect));
}

// rect and bounds are in pixels
- (CIFilter *)transitionFilterForRect:(CGRect)rect bounds:(CGRect)bounds forward:(BOOL)forward initialCIImage:(CIImage *)initialCIImage finalCIImage:(CIImage *)finalCIImage {
    NSString *filterName = [[self class] nameForStyle:currentTransitionStyle];
    CIFilter *transitionFilter = [CIFilter filterWithName:filterName];

    [transitionFilter setDefaults];

    for (NSString *key in [transitionFilter inputKeys]) {
        id value = nil;
        if ([key isEqualToString:kCIInputExtentKey]) {
            CGRect extent = currentShouldRestrict ? rect : bounds;
            value = [CIVector vectorWithX:CGRectGetMinX(extent) Y:CGRectGetMinY(extent) Z:CGRectGetWidth(extent) W:CGRectGetHeight(extent)];
        } else if ([key isEqualToString:kCIInputAngleKey]) {
            CGFloat angle = forward ? 0.0 : M_PI;
            if ([filterName isEqualToString:@"CIPageCurlTransition"])
                angle = forward ? -M_PI_4 : -3.0 * M_PI_4;
            value = [NSNumber numberWithDouble:angle];
        } else if ([key isEqualToString:kCIInputCenterKey]) {
            value = [CIVector vectorWithX:CGRectGetMidX(rect) Y:CGRectGetMidY(rect)];
        } else if ([key isEqualToString:kCIInputImageKey]) {
            value = initialCIImage;
            if (CGRectEqualToRect(rect, bounds) == NO)
                value = [value imageByCroppingToRect:rect];
        } else if ([key isEqualToString:kCIInputTargetImageKey]) {
            value = finalCIImage;
            if (CGRectEqualToRect(rect, bounds) == NO)
                value = [value imageByCroppingToRect:rect];
        } else if ([key isEqualToString:kCIInputShadingImageKey]) {
            static CIImage *inputShadingImage = nil;
            if (inputShadingImage == nil)
                inputShadingImage = [[CIImage alloc] initWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"TransitionShading" withExtension:@"tiff"]];
            value = inputShadingImage;
        } else if ([key isEqualToString:kCIInputBacksideImageKey]) {
            value = initialCIImage;
            if (CGRectEqualToRect(rect, bounds) == NO)
                value = [value imageByCroppingToRect:rect];
        } else if ([[[[transitionFilter attributes] objectForKey:key] objectForKey:kCIAttributeClass] isEqualToString:@"CIImage"]) {
            // Scale and translate our mask image to match the transition area size.
            static CIImage *inputMaskImage = nil;
            if (inputMaskImage == nil)
                inputMaskImage = [[CIImage alloc] initWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"TransitionMask" withExtension:@"jpg"]];
            CGRect extent = [inputMaskImage extent];
            CGAffineTransform transform;
            if ((CGRectGetWidth(extent) < CGRectGetHeight(extent)) != (CGRectGetWidth(rect) < CGRectGetHeight(rect))) {
                transform = CGAffineTransformMake(0.0, 1.0, 1.0, 0.0, 0.0, 0.0);
                transform = CGAffineTransformTranslate(transform, CGRectGetMinY(rect) - CGRectGetMinY(bounds), CGRectGetMinX(rect) - CGRectGetMinX(bounds));
                transform = CGAffineTransformScale(transform, CGRectGetHeight(rect) / CGRectGetWidth(extent), CGRectGetWidth(rect) / CGRectGetHeight(extent));
            } else {
                transform = CGAffineTransformMakeTranslation(CGRectGetMinX(rect) - CGRectGetMinX(bounds), CGRectGetMinY(rect) - CGRectGetMinY(bounds));
                transform = CGAffineTransformScale(transform, CGRectGetWidth(rect) / CGRectGetWidth(extent), CGRectGetHeight(rect) / CGRectGetHeight(extent));
            }
            value = [inputMaskImage imageByApplyingTransform:transform];
        } else continue;
        [transitionFilter setValue:value forKey:key];
    }

    return transitionFilter;
}

- (CIImage *)newCurrentImage {
    NSRect bounds = [view bounds];
    NSBitmapImageRep *contentBitmap = [view bitmapImageRepForCachingDisplayInRect:bounds];

    [contentBitmap clear];
    [view cacheDisplayInRect:bounds toBitmapImageRep:contentBitmap];

    return [[CIImage alloc] initWithBitmapImageRep:contentBitmap];
}

- (SKTransitionView *)transitionViewForRect:(NSRect)rect image:(CIImage *)image scale:(CGFloat)imageScale {
    SKTransitionView *transitionView = nil;

    if (window == nil) {
        transitionView = [[[SKTransitionView alloc] init] autorelease];
        if ([transitionView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])
            [transitionView setWantsBestResolutionOpenGLSurface:YES];
        window = [[NSWindow alloc] initWithContentRect:NSZeroRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
        [window setReleasedWhenClosed:NO];
        [window setIgnoresMouseEvents:YES];
        [window setContentView:transitionView];
    } else {
        transitionView = (SKTransitionView *)[window contentView];
    }

    [transitionView setImageScale:imageScale];
    [transitionView setImage:image];
    [transitionView setNeedsDisplay:YES];

    NSRect frame = [view convertRect:rect toView:nil];
    frame.origin = [[view window] convertBaseToScreen:frame.origin];
    [window setFrame:frame display:NO];
    [window orderBack:nil];
    [[view window] addChildWindow:window ordered:NSWindowAbove];

    return transitionView;
}

- (void)prepareAnimationForRect:(NSRect)rect from:(NSUInteger)fromIndex to:(NSUInteger)toIndex {
    currentTransitionStyle = transitionStyle;
    currentDuration = duration;
    currentShouldRestrict = shouldRestrict;
    currentForward = (toIndex >= fromIndex);

    NSUInteger idx = MIN(fromIndex, toIndex);
    if (fromIndex != NSNotFound && toIndex != NSNotFound && idx < [pageTransitions count]) {
        NSDictionary *info = [pageTransitions objectAtIndex:idx];
        id value;
        if ((value = [info objectForKey:SKStyleNameKey]))
            currentTransitionStyle = [[self class] styleForName:value];
        if ((value = [info objectForKey:SKDurationKey]) && [value respondsToSelector:@selector(doubleValue)])
            currentDuration = [value doubleValue];
        if ((value = [info objectForKey:SKShouldRestrictKey]) && [value respondsToSelector:@selector(boolValue)])
            currentShouldRestrict = [value boolValue];
    }

	if (currentTransitionStyle >= SKCoreImageTransition) {
        [initialImage release];
        initialImage = [self newCurrentImage];
        // We don't want the window to draw the next state before the animation is run
        [[view window] disableFlushWindow];
    } else if (currentTransitionStyle > SKNoTransition && CoreGraphicsServicesTransitionsDefined()) {
        if (currentShouldRestrict) {
            [initialImage release];
            initialImage = [self newCurrentImage];
        }
        // We don't want the window to draw the next state before the animation is run
        [[view window] disableFlushWindow];
    }
    imageRect = rect;
}

- (void)animateUsingCoreGraphics {
    CIImage *finalImage = nil;
    NSWindow *viewWindow = [view window];
    SKTransitionView *transitionView = nil;

    if (currentShouldRestrict) {
        NSRect bounds = [view bounds];
        CGFloat imageScale = CGRectGetWidth([initialImage extent]) / NSWidth(bounds);

        finalImage = [self newCurrentImage];

        CGAffineTransform transform = CGAffineTransformMakeTranslation(-imageScale * NSMinX(imageRect), -imageScale * NSMinY(imageRect));
        initialImage = [[initialImage autorelease] imageByApplyingTransform:transform];
        finalImage = [[finalImage autorelease] imageByApplyingTransform:transform];

        transitionView = [self transitionViewForRect:imageRect image:initialImage scale:imageScale];
        initialImage = nil;
    }

    // declare our variables
    int handle = -1;
    CGSTransitionSpec spec;
    // specify our specifications
    spec.unknown1 = 0;
    spec.type =  currentTransitionStyle;
    spec.option = currentForward ? CGSLeft : CGSRight;
    spec.backColour = NULL;
    spec.wid = [(currentShouldRestrict ? window : viewWindow) windowNumber];

    // Let's get a connection
    CGSConnection cgs = _CGSDefaultConnection();

    // Create a transition
    CGSNewTransition(cgs, &spec, &handle);

    if (currentShouldRestrict) {
        [transitionView setImage:finalImage];
        [transitionView display];
    }

    // Redraw the window
    [viewWindow display];
    // Remember we disabled flushing in the previous method, we need to balance that.
    [viewWindow enableFlushWindow];
    [viewWindow flushWindow];

    CGSInvokeTransition(cgs, handle, currentDuration);
    // We need to wait for the transition to finish before we get rid of it, otherwise we'll get all sorts of nasty errors... or maybe not.
    [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:currentDuration]];

    CGSReleaseTransition(cgs, handle);
    handle = 0;

    if (currentShouldRestrict) {
        [viewWindow removeChildWindow:window];
        [window orderOut:nil];
        [transitionView setImage:nil];
    }
}

- (void)animateUsingCoreImage {
    NSRect bounds = [view bounds];
    CGFloat imageScale = CGRectGetWidth([initialImage extent]) / NSWidth(bounds);

    CIImage *finalImage = [self newCurrentImage];

    CIFilter *transitionFilter = [self transitionFilterForRect:scaleRect(imageRect, imageScale) bounds:scaleRect(bounds, imageScale) forward:currentForward initialCIImage:initialImage finalCIImage:finalImage];

    [finalImage release];

    SKTransitionView *transitionView = [self transitionViewForRect:bounds image:initialImage scale:imageScale];

    [initialImage release];
    initialImage = nil;

    SKTransitionAnimation *animation = [[SKTransitionAnimation alloc] initWithDuration:currentDuration animationCurve:NSAnimationEaseInOut];
    [animation setProgressHandler:^(CGFloat value){
            [transitionFilter setValue:[NSNumber numberWithDouble:value] forKey:kCIInputTimeKey];
            [transitionView setImage:[transitionFilter valueForKey:kCIOutputImageKey]];
            [transitionView display];
        }];
    [animation startAnimation];
    [animation release];

    // Update the view and its window, so it shows the correct state when it is shown.
    [view display];
    // Remember we disabled flushing in the previous method, we need to balance that.
    NSWindow *viewWindow = [view window];
    [viewWindow enableFlushWindow];
    [viewWindow flushWindow];

    [viewWindow removeChildWindow:window];
    [window orderOut:nil];
    [transitionView setImage:nil];
}

- (void)animateForRect:(NSRect)rect  {
    if (NSEqualRects(imageRect, NSZeroRect))
        [self prepareAnimationForRect:rect from:NSNotFound to:NSNotFound];
    imageRect = NSIntegralRect(NSIntersectionRect(NSUnionRect(imageRect, rect), [view bounds]));

    if (currentTransitionStyle >= SKCoreImageTransition)
        [self animateUsingCoreImage];
	else if (currentTransitionStyle > SKNoTransition && CoreGraphicsServicesTransitionsDefined())
        [self animateUsingCoreGraphics];

    currentTransitionStyle = transitionStyle;
    currentDuration = duration;
    currentShouldRestrict = shouldRestrict;
    currentForward = YES;

    imageRect = NSZeroRect;
}

@end

#pragma mark -

@implementation SKTransitionAnimation

@synthesize progressHandler;

- (void)dealloc {
    SKDESTROY(progressHandler);
    [super dealloc];
}

- (void)setCurrentProgress:(NSAnimationProgress)progress {
    [super setCurrentProgress:progress];
    if (progressHandler) progressHandler([self currentValue]);
}

@end

#pragma mark -

@implementation SKTransitionView

@synthesize image, imageScale;

+ (NSOpenGLPixelFormat *)defaultPixelFormat {
    static NSOpenGLPixelFormat *pf;

    if (pf == nil) {
        NSOpenGLPixelFormatAttribute attr[] = {
            NSOpenGLPFAAccelerated,
            NSOpenGLPFANoRecovery,
            NSOpenGLPFAColorSize,
            32,
            0
        };

        pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr];
    }

    return pf;
}

- (void)dealloc {
    SKDESTROY(image);
    SKDESTROY(context);
    [super dealloc];
}

- (void)reshape	{
    needsReshape = YES;
}

- (void)prepareOpenGL {
    // Enable beam-synced updates.
    GLint parm = 1;
    [[self openGLContext] setValues:&parm forParameter:NSOpenGLCPSwapInterval];

    // Make sure that everything we don't need is disabled.
    // Some of these are enabled by default and can slow down rendering.

    glDisable(GL_ALPHA_TEST);
    glDisable(GL_DEPTH_TEST);
    glDisable(GL_SCISSOR_TEST);
    glDisable(GL_BLEND);
    glDisable(GL_DITHER);
    glDisable(GL_CULL_FACE);
    glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
    glDepthMask(GL_FALSE);
    glStencilMask(0);
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
    glHint(GL_TRANSFORM_HINT_APPLE, GL_FASTEST);

    needsReshape = YES;
}

- (void)updateMatrices {
    NSRect bounds = [self bounds];
    CGFloat scale = ([self respondsToSelector:@selector(wantsBestResolutionOpenGLSurface)] && [self wantsBestResolutionOpenGLSurface]) ? [self backingScale] : 1.0;

    [[self openGLContext] update];

    glViewport(0, 0, scale * NSWidth(bounds), scale * NSHeight(bounds));

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(scale * NSMinX(bounds), scale * NSMaxX(bounds), scale * NSMinY(bounds), scale * NSMaxY(bounds), -1, 1);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    needsReshape = NO;
}

- (void)drawRect:(NSRect)rect {
    [[self openGLContext] makeCurrentContext];

    if (needsReshape)
        [self updateMatrices];

    glClearColor(0.0, 0.0, 0.0, 1.0);
    glClear(GL_COLOR_BUFFER_BIT);

    if (image) {
        CGFloat scale = ([self respondsToSelector:@selector(wantsBestResolutionOpenGLSurface)] && [self wantsBestResolutionOpenGLSurface]) ? [self backingScale] : 1.0;
        NSRect bounds = [self bounds];
        if (context == nil) {
            NSOpenGLPixelFormat *pf = [self pixelFormat] ?: [[self class] defaultPixelFormat];
            context = [[CIContext contextWithCGLContext:CGLGetCurrentContext() pixelFormat:[pf CGLPixelFormatObj] colorSpace:nil options:nil] retain];
        }
        [context drawImage:image inRect:scaleRect(bounds, scale) fromRect:scaleRect(bounds, imageScale)];
    }

    glFlush();
}

@end


text:
#include <bits/stdc++.h>

template<typename T> T gcd(T a, T b) {
    if(!b) return a;
    return gcd(b, a % b);
}
template<typename T> T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; }
template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; }
int in() { int x; scanf("%d", &x); return x; }

using namespace std;

typedef long long Int;
typedef unsigned long long uInt;
typedef unsigned uint;

/**
 * To think of the borders as graph nodes (N, S, E, W), and to
 * connect them with every sensor that touches it. Then, connect
 * every sensor which its area intersect with each other. On the
 * graph build, check whether a border node is connected to a
 * different border node. This means the picture is 'isolated'
 * on its corner. Also, it must be checked whether the initial
 * or picture points are intersected by a sensor area.
 */

int main(void) {
    return 0;
}


text:
exports.GetService  = function (name) {
	console.log('GetService>>', global.ServiceRegestry[name]);
	var Service = global.ServiceRegestry[name];
	var service = new Service;
    return service;
}

exports.AddService  = function (name, service) {
    global.ServiceRegestry[name] = service
    console.log('AddService>>', global.ServiceRegestry[name], service);
}


text:
<?php
$records_riwayat_pegawai_golongan = isset($records_riwayat_pegawai_golongan) ? $records_riwayat_pegawai_golongan : FALSE;
$keyword_riwayat_pegawai_golongan = isset($keyword_riwayat_pegawai_golongan) ? $keyword_riwayat_pegawai_golongan : FALSE;
$field_id_riwayat_pegawai_golongan = isset($field_id_riwayat_pegawai_golongan) ? $field_id_riwayat_pegawai_golongan : FALSE;
$paging_set_riwayat_pegawai_golongan = isset($paging_set_riwayat_pegawai_golongan) ? $paging_set_riwayat_pegawai_golongan : FALSE;
$active_modul = isset($active_modul) ? $active_modul : 'none';
$next_list_number_riwayat_pegawai_golongan = isset($next_list_number_riwayat_pegawai_golongan) ? $next_list_number_riwayat_pegawai_golongan : 1;
?>

Gunakan Formulir ini untuk melakukan pencarian pada halaman ini.

            <form class="form-horizontal">

                            <input type="text" name="keyword" value="<?php echo $keyword_riwayat_pegawai_golongan; ?>" class="form-control" placeholder="Silahkan masukkan kata kunci disini"/>

                                <button class="btn btn-primary">Cari</button>

            </form>

                                    No

                                    Pangkat Gol.

                                    Tanggal Ditetapkan

                                    Tanggal Berakhir

                            <?php if ($records_riwayat_pegawai_golongan != FALSE): ?>
                                <?php foreach ($records_riwayat_pegawai_golongan as $key => $record): ?>

                                            <?php echo $next_list_number_riwayat_pegawai_golongan; ?>

                                            <?php echo beautify_str($record->golongan) . " " . beautify_str($record->keterangan_golongan); ?>

                                            <?php echo beautify_str(show_date_with_format($record->tgl_ditetapkan), FALSE, "-"); ?>

                                            <?php echo beautify_str(show_date_with_format($record->tgl_berakhir), FALSE, "-"); ?>

                                    <?php $next_list_number_riwayat_pegawai_golongan++; ?>
                                <?php endforeach; ?>
                            <?php else: ?>

                                     Kosong / Data tidak ditemukan.

                            <?php endif; ?>

                    <?php /**
Showing 1 to 10 of 57 entries
 */ ?>
                    <?php
                    echo $paging_set_riwayat_pegawai_golongan;
                    ?>


text:
'use strict';

angular.module('myApp.welcome', [])
    .controller('WelcomeCtrl', ['$menu','$scope','CommonProp', '$firebase', function($menu, $scope, CommonProp, $firebase) {
        $menu.setShowMenu(false);
        $scope.username = CommonProp.getUser();

        var firebaseObj = new Firebase("https://db-myproject.firebaseio.com/Articles");
        var sync = $firebase(firebaseObj);
        var lst = sync.$asArray();
        $scope.articles = lst;
    }]);


text:
review-ops=review.openswitch.net
review-nos=

#validate number of arguments

if [ "$#" -ne 3 ]; then
    echo "Illegal number of parameters"
    echo "This script need two arguments as inputs, the first being users email address and the second being gerrit hostname"
    echo "Gerrit Hostname can be review-ops/review-nos"
    echo "Usage: script.sh krishna.cha.kurnala@hpe.com kkurnala review-ops"
    echo "Usage: script.sh krishna.cha.kurnala@hpe.com kkurnala review-nos"
    exit 1

fi

user_email=$1
unix_username=$2
gerrit_host=$3

#validate user arguments
if [ $my_error_flag == *.hp.com ] ||  [ $my_error_flag_o == *.hpe.com ]; then
      echo " Provided Email address is valid"
else
    echo "Please provide valid email address that ends in hp.com or hpe.com and try again"
fi

#Obtain Account id
account_id=`echo "select account_id from accounts where preferred_email='$user_email';" | ssh -p 29418 $review-ops gerrit gsql | tail -n 3 | head -n 1`
echo "Account id of user is $account_id "

echo "Account info of user $user_email"
echo "select * from account_external_ids where account_id=$account_id;" | ssh -p 29418 $review-ops gerrit gsql

echo "Inserting user's account id"
echo "INSERT INTO account_external_ids (account_id,external_id)VALUES($account_id,'username:$unix_username');" | ssh -p 29418 $review-ops gerrit gsql

echo "Account info of user $user_email after the insert "
echo "select * from account_external_ids where account_id=$account_id;" | ssh -p 29418 $review-ops gerrit gsql

echo "Re-starting gerrit"

ssh -i ~/Downloads/aws review-aws 'sudo service gerrit restart'


text:
@(queryForm: Form[views.formdata.QueryFormData],
	result: String,
	bottomLine: String,
	predefinedSystems: List[String],
	chosenPredefinedSystem: String,
	paralyzerOptions: List[String],
	rulesHeight: String
	 )

@import helper._

@Main("Index") {

    @form(routes.Application.postIndex(), 'class -> "form-horizontal") {
      @fieldset(queryForm, predefinedSystems, chosenPredefinedSystem, paralyzerOptions, rulesHeight)
    }

  @if(flash.containsKey("success")) {

      @flash.get("success")

  }
  @if(flash.containsKey("error")) {

      @flash.get("error")

  }

}


text:
namespace os {

////////////////////////////////////////////////////////////////////////

// Terminate the "process tree" rooted at the specified pid.
// Since there is no process tree concept on Windows,
// internally this function looks up the job object for the given pid
// and terminates the job. This is possible because `name_job`
// provides an idempotent one-to-one mapping from pid to name.
inline Try<std::list<ProcessTree>> killtree(
    pid_t pid,
    int signal,
    bool groups = false,
    bool sessions = false) {
  const Try<std::wstring> name = os::name_job(pid);
  if (name.isError()) {
    return Error("Failed to determine job object name: " + name.error());
  }

  Try<SharedHandle> handle =
      os::open_job(JOB_OBJECT_TERMINATE, false, name.get());
  if (handle.isError()) {
    return Error("Failed to open job object: " + handle.error());
  }

  Try<Nothing> killJobResult = os::kill_job(handle.get());
  if (killJobResult.isError()) {
    return Error("Failed to delete job object: " + killJobResult.error());
  }

  // NOTE: This return value is unused. A future refactor
  // may change the return type to `Try<None>`.
  std::list<ProcessTree> process_tree_list;
  return process_tree_list;
}

////////////////////////////////////////////////////////////////////////

} // namespace os

////////////////////////////////////////////////////////////////////////


text:
"""
Create symbolic links of yersinia and anthracis in a new folder.

sys.argv[1]: data/pathogens-to-samples.txt
sys.argv[2]: data/runs-to-samples.txt

mkdir sra-pathogens
mkdir sra-pathogens/anthracis
mkdir sra-pathogens/yersinia
"""
import os
import errno
import glob
import sys

def mkdir(directory):
    """ Make a directory using sample id and pthogen. """
    if not os.path.exists(directory):
        try:
            print 'Making {0}'.format(directory)
            os.makedirs(directory)
        except OSError as exception:
            if exception.errno != errno.EEXIST:
                raise

def symbolic_link(indir, outdir, run_acc, sample_id):
    """ Create symlink of the SRA fastq, and rename it with sample ID. """
    for run_file in glob.glob(indir):
        run_file = os.path.abspath(run_file)
        sample_file = outdir + os.path.basename(run_file)
        print 'Creating symlink: {0} -> {1}'.format(run_file, sample_file)
        os.symlink(run_file, sample_file)

# Make some directories
mkdir('sra-pathogens')
mkdir('sra-pathogens/anthracis')
mkdir('sra-pathogens/yersinia')

# Read sample ids and the pathogen
sample_ids = {}
fh = open(sys.argv[1], 'r')
for line in fh:
    line = line.rstrip()
    cols = line.split('\t')

    # cols[0]: Sample ID, cols[1]: Pathogen (anthracis|yersinia)
    sample_ids[cols[0]] = cols[1]
fh.close()

# Read sample ids and their run accessions
runs_to_samples = {}
fh = open(sys.argv[2], 'r')
for line in fh:
    line = line.rstrip()
    cols = line.split('\t')

    # cols[0]: Run accession, cols[1]: Sample ID
    if cols[1] in sample_ids:
        indir = 'sra-fastq/{0}/*'.format(cols[0])
        outdir = 'sra-pathogens/{0}/{1}/'.format(sample_ids[cols[1]], cols[1])
        mkdir(outdir)
        symbolic_link(indir, outdir, cols[0], cols[1])
fh.close()


text:
SYNONYM

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

#### Published in
Can. J. Bot. 63(2): 214 (1985)

#### Original name
Diheterospora microspora G.L. Barron, 1985

### Remarks
null


text:
package com.izforge.izpack.installer.unpacker;

import java.io.File;

import org.mockito.Mockito;

import com.izforge.izpack.api.handler.Prompt;
import com.izforge.izpack.util.os.FileQueue;

/**
 * Tests the {@link LooseFileUnpacker} class.
 *
 * @author Tim Anderson
 */
public class LooseFileUnpackerTest extends AbstractFileUnpackerTest
{

    /**
     * Helper to create an unpacker.
     *
     * @param sourceDir the source directory
     * @param queue     the file queue. May be {@code null}
     * @return a new unpacker
     */
    @Override
    protected FileUnpacker createUnpacker(File sourceDir, FileQueue queue)
    {
        Prompt prompt = Mockito.mock(Prompt.class);
        return new LooseFileUnpacker(getCancellable(), queue, prompt);
    }

}


text:
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)

using System;

namespace ICSharpCode.NRefactory.Parser
{
	public abstract class LexerMemento
	{
		public int Line { get; set; }
		public int Column { get; set; }
		public int PrevTokenKind { get; set; }
	}
}


text:
class Spree::Posts::PostsController < Spree::BaseController
  include Spree::Core::ControllerHelpers

  def index
    @posts = Post.where(:live => true).page(params[:page]).per(10).order('created_at desc')
  end

  def show
    @post = Post.find_by_slug(params[:slug])
  end

end