text:
/*************************************************************************/
/*                                                                       */
/*  Copyright (c) 1994 Stanford University                               */
/*                                                                       */
/*  All rights reserved.                                                 */
/*                                                                       */
/*  Permission is given to use, copy, and modify this software for any   */
/*  non-commercial purpose as long as this copyright notice is not       */
/*  removed.  All other uses, including redistribution in whole or in    */
/*  part, are forbidden without prior written permission.                */
/*                                                                       */
/*  This software is provided with absolutely no warranty and no         */
/*  support.                                                             */
/*                                                                       */
/*************************************************************************/

MAIN_ENV

/*  Usage:   water < infile,
    where infile has 10 fields which can be described in order as
    follows:

    TSTEP:   the physical time interval (in sec) between timesteps.
    Good default is 1e-15.
    NMOL:    the number of molecules to be simulated.
    NSTEP:   the number of timesteps to be simulated.
    NORDER:  the order of the predictor-corrector method to be used.
    set this to 6.
    NSAVE:   the frequency with which to save data in data collection.
    Set to 0 always.
    NRST:    the frequency with which to write RST file: set to 0 always (not used).
    NPRINT:  the frequency with which to compute potential energy.
    i.e. the routine POTENG is called every NPRINT timesteps.
    It also computes intermolecular as well as intramolecular
    interactions, and hence is very expensive.
    NFMC:    Not used (historical artifact).  Set to anything, say 0.
    NumProcs: the number of processors to be used.
    CUTOFF:  the cutoff radius to be used (in Angstrom,
    floating-point).  In a real simulation, this
    will be set to 0 here in which case the program will
    compute it itself (and set it to about 11 Angstrom.
    It can be set by the user if they want
    to use an artificially small cutoff radius, for example
    to control the number of boxes created for small problems
    (and not have fewer boxes than processors).
    */

#include <stdio.h>
#include <math.h>

/*  include files for declarations  */
#define extern
#include "cnst.h"
#include "fileio.h"
#include "frcnst.h"
#include "global.h"
#include "mdvar.h"
#include "parameters.h"
#include "randno.h"
#include "split.h"
#include "water.h"
#include "wwpot.h"
#include "mddata.h"
#undef extern

struct GlobalMemory *gl;        /* pointer to the Global Memory
                                   structure, which contains the lock,
                                   barrier, and some scalar variables */

int NSTEP, NSAVE, NRST, NPRINT,NFMC;
int NORD1;
int II;                         /*  variables explained in common.h */
int i;
int NDATA;
int NFRST=11;
int NFSV=10;
int LKT=0;

first_last_array **start_end; /* ptr to array of start/end box #s */
int NumProcs;                 /* number of processors being used;
                                 run-time input           */

void WorkStart();

main(argc, argv)
  char **argv;

{
    int func, dir, atom;
    double XTT, MDMAIN();
    struct link *curr_ptr;
    unsigned ProcID;

    /* default values for the control parameters of the driver */
    /* are in parameters.h */

    if ((argc == 2) && ((strncmp(argv[1],"-h",strlen("-h")) == 0) || (strncmp(argv[1],"-H",strlen("-H")) == 0))) {
        printf("Usage:  WATER-SPATIAL < infile, where the contents of infile can be\nobtained from the comments at the top of water.C and the first scanf \nin main() in water.C\n\n");
        exit(0);
    }

        /*  POSSIBLE ENHANCEMENT:  One might bind the first process to a processor
            here, even before the other (child) processes are bound later in mdmain().
            */

    six = stdout;

    TEMP  =298.0;
    RHO   =0.9980;

    /* read input */

    if (scanf("%lf%d%d%d%d%d%d%d%d%lf",&TSTEP, &NMOL, &NSTEP, &NORDER,
              &NSAVE, &NRST, &NPRINT, &NFMC,&NumProcs, &CUTOFF) != 10)
        fprintf(stderr,"ERROR: Usage: water < infile, which must have 10 fields, see SPLASH documentation or comment at top of water.C\n");

    printf("Using %d procs on %d steps of %d mols\n", NumProcs, NSTEP, NMOL);
    printf("Other parameters:\n\tTSTEP = %8.2e\n\tNORDER = %d\n\tNSAVE = %d\n",TSTEP,NORDER,NSAVE);
    printf("\tNRST = %d\n\tNPRINT = %d\n\tNFMC = %d\n\tCUTOFF = %lf\n\n",NRST,NPRINT,NFMC,CUTOFF);

    /* set up scaling factors and constants */

    NORD1=NORDER+1;

    CNSTNT(NORD1,TLC);  /* sub. call to set up constants */

    SYSCNS();    /* sub. call to initialize system constants  */

    printf("%d boxes with %d processors\n\n",
           BOX_PER_SIDE * BOX_PER_SIDE * BOX_PER_SIDE, NumProcs);

    if (NumProcs > (BOX_PER_SIDE * BOX_PER_SIDE * BOX_PER_SIDE)) {
        fprintf(stderr,"ERROR: less boxes (%d) than processors (%d)\n",
                BOX_PER_SIDE * BOX_PER_SIDE * BOX_PER_SIDE, NumProcs);
        fflush(stderr);
        exit(-1);
    }

    fprintf(six,"\nTEMPERATURE                = %8.2f K\n",TEMP);
    fprintf(six,"DENSITY                    = %8.5f G/C.C.\n",RHO);
    fprintf(six,"NUMBER OF MOLECULES        = %8d\n",NMOL);
    fprintf(six,"NUMBER OF PROCESSORS       = %8d\n",NumProcs);
    fprintf(six,"TIME STEP                  = %8.2e SEC\n",TSTEP);
    fprintf(six,"ORDER USED TO SOLVE F=MA   = %8d \n",NORDER);
    fprintf(six,"NO. OF TIME STEPS          = %8d \n",NSTEP);
    fprintf(six,"FREQUENCY OF DATA SAVING   = %8d \n",NSAVE);
    fprintf(six,"FREQUENCY TO WRITE RST FILE= %8d \n",NRST);
    fflush(six);

    { /* do memory initializations */

        int pid, procnum, i, j, k, l;
        struct list_of_boxes *new_box;
        struct list_of_boxes *temp_box;
        int xprocs, yprocs, zprocs;
        int x_inc, y_inc, z_inc;
        int x_ct, y_ct, z_ct;
        int x_left, y_left, z_left;
        int x_first, y_first, z_first;
        int x_last, y_last, z_last;
        double proccbrt;
        unsigned gmem_size = sizeof(struct GlobalMemory);

        MAIN_INITENV(,40000000,);  /* macro call to initialize
                                      shared memory etc. */

        /* Allocate space for main (BOX) data structure as well as
         * synchronization variables
         */

        start_end = (first_last_array **)
            G_MALLOC(sizeof(first_last_array *) * NumProcs);
        for (i=0; i < NumProcs; i++) {
            start_end[i] = (first_last_array *)
                G_MALLOC(sizeof(first_last_array));
        }

        /* Calculate start and finish box numbers for processors */

        xprocs = 0;
        yprocs = 0;
        proccbrt = (double) pow((double) NumProcs, 1.0/3.0) + 0.00000000000001;
        j = (int) proccbrt;
        if (j<1) j = 1;
        while ((xprocs == 0) && (j>0)) {
            k = (int) sqrt((double) (NumProcs / j));
            if (k<1) k=1;
            while ((yprocs == 0) && (k>0)) {
                l = NumProcs/(j*k);
                if ((j*k*l) == NumProcs) {
                    xprocs = j;
                    yprocs = k;
                    zprocs = l;
                } /* if */
                k--;
            } /* while yprocs && k */
            j--;
        } /* while xprocs && j */

        printf("xprocs = %d\typrocs = %d\tzprocs = %d\n",
               xprocs, yprocs, zprocs);
        fflush(stdout);

        /* Fill in start_end array values */

        procnum = 0;
        x_inc = BOX_PER_SIDE/xprocs;
        y_inc = BOX_PER_SIDE/yprocs;
        z_inc = BOX_PER_SIDE/zprocs;

        x_left = BOX_PER_SIDE - (xprocs*x_inc);
        y_left = BOX_PER_SIDE - (yprocs*y_inc);
        z_left = BOX_PER_SIDE - (zprocs*z_inc);
        printf("x_inc = %d\t y_inc = %d\t z_inc = %d\n",x_inc,y_inc,z_inc);
        printf("x_left = %d\t y_left = %d\t z_left = %d\n",x_left,y_left,z_left);
        fflush(stdout);

        x_first = 0;
        x_ct = x_left;
        x_last = -1;
        x_inc++;
        for (i=0; i<xprocs; i++) {
            y_ct = y_left;
            if (x_ct == 0) x_inc--;
            x_last += x_inc;
            y_first = 0;
            y_last = -1;
            y_inc++;
            for (j=0; j<yprocs; j++) {
                z_ct = z_left;
                if (y_ct == 0) y_inc--;
                y_last += y_inc;
                z_first = 0;
                z_last = -1;
                z_inc++;
                for (k=0; k<zprocs; k++) {
                    if (z_ct == 0) z_inc--;
                    z_last += z_inc;
                    start_end[procnum]->box[XDIR][FIRST] = x_first;
                    start_end[procnum]->box[XDIR][LAST] =
                        min(x_last, BOX_PER_SIDE - 1);
                    start_end[procnum]->box[YDIR][FIRST] = y_first;
                    start_end[procnum]->box[YDIR][LAST] =
                        min(y_last, BOX_PER_SIDE - 1);
                    start_end[procnum]->box[ZDIR][FIRST] = z_first;
                    start_end[procnum]->box[ZDIR][LAST] =
                        min(z_last, BOX_PER_SIDE - 1);
                    z_first = z_last + 1;
                    z_ct--;
                    procnum++;
                }
                y_first = y_last + 1;
                y_ct--;
            }
            x_first = x_last + 1;
            x_ct--;
        }

        /* Allocate space for my_boxes array */

        my_boxes = (box_list **) G_MALLOC(NumProcs * sizeof(box_list *));

        /* Set all box ptrs to null */

        for (i=0; i<NumProcs; i++) my_boxes[i] = NULL;

        /* Set up links for all boxes for initial interf and intraf */

        temp_box = my_boxes[0];
        while (temp_box) {
            temp_box = temp_box->next_box;
        }

        /* Allocate space for BOX array */

        BOX = (box_type ***) G_MALLOC(BOX_PER_SIDE * sizeof(box_type **));
        for (i=0; i < BOX_PER_SIDE; i++) {
            BOX[i] = (box_type **) G_MALLOC( BOX_PER_SIDE * sizeof(box_type *));
            for (j=0; j < BOX_PER_SIDE; j++) {
                BOX[i][j] = (box_type *) G_MALLOC(BOX_PER_SIDE * sizeof(box_type));
                for (k=0; k < BOX_PER_SIDE; k++) {
                    BOX[i][j][k].list = NULL;
                    LOCKINIT(BOX[i][j][k].boxlock);
                }
            }
        } /* for i */

        gl = (struct GlobalMemory *) G_MALLOC(gmem_size);

        /* macro calls to initialize synch variables  */

        BARINIT(gl->start);
        BARINIT(gl->InterfBar);
        BARINIT(gl->PotengBar);
        LOCKINIT(gl->IOLock);
        LOCKINIT(gl->IndexLock);
        LOCKINIT(gl->IntrafVirLock);
        LOCKINIT(gl->InterfVirLock);
        LOCKINIT(gl->KinetiSumLock);
        LOCKINIT(gl->PotengSumLock);
    }

    fprintf(six,"SPHERICAL CUTOFF RADIUS    = %8.4f ANGSTROM\n",CUTOFF);
    fflush(six);

    IRST=0;

    /* call initialization routine */

    INITIA();

    gl->tracktime = 0;
    gl->intratime = 0;
    gl->intertime = 0;

    /* initialize Index to 1 so that the first created child gets
       id 1, not 0 */

    gl->Index = 1;

    /* spawn helper processes */

    CLOCK(gl->createstart);
    //for (ProcID = 1; ProcID < NumProcs; ProcID++) {
    CREATE(WorkStart, NumProcs);
    //}

    CLOCK(gl->createend);

    LOCK(gl->IOLock);
    printf("CREATETIME = %d\n",gl->createend-gl->createstart);
    UNLOCK(gl->IOLock);

    if (NSAVE > 0) {  /* not true for input decks provided */
        LOCK(gl->IOLock);
        fprintf(six,"COLLECTING X AND V DATA AT EVERY %4d TIME STEPS \n",NSAVE);
        UNLOCK(gl->IOLock);
    }

    /* CALL ROUTINE TO DO THE TIMESTEPS, with own id passed as 0 */

    CLOCK(gl->computestart);

    //XTT = MDMAIN(NFSV,NFRST,NSTEP,NRST,NPRINT,NSAVE,LKT,NORD1,0);

    /* macro to make main process wait for all others to finish */
    WAIT_FOR_END(NumProcs);
    CLOCK(gl->computeend);

    printf("COMPUTESTART (after initialization) = %lu\n",gl->computestart);
    printf("COMPUTEEND = %lu\n",gl->computeend);
    printf("COMPUTETIME (after initialization) = %lu\n",gl->computeend-gl->computestart);
    printf("Measured Time (2nd timestep onward) = %lu\n",gl->tracktime);
    printf("Intramolecular time only (2nd timestep onward) = %lu\n",gl->intratime);
    printf("Intermolecular time only (2nd timestep onward) = %lu\n",gl->intertime);
    printf("Other time (2nd timestep onward) = %lu\n",gl->tracktime - gl->intratime - gl->intertime);

    printf("\nExited Happily with XTT = %g (note: XTT value is garbage if NPRINT > NSTEP)\n", XTT);

    MAIN_END;
} /* main.c */

void WorkStart() /* routine that each created process starts at;
                    it simply calls the timestep routine */
{
    unsigned ProcID;
    double MDMAIN();

    LOCK(gl->IndexLock);
    ProcID = gl->Index++;
    UNLOCK(gl->IndexLock);

    ProcID = ProcID % NumProcs;

    /*  POSSIBLE ENHANCEMENT:  Here's where one might bind processes to processors
        if one wanted to.
        */

    MDMAIN(NFSV,NFRST,NSTEP,NRST,NPRINT,NSAVE,LKT,NORD1,ProcID);
}


text:
var figlet = require('figlet');

var convert = function() {
    var editor = atom.workspace.getActiveTextEditor();
    figlet(editor.getSelectedText(), {
        font: "Star Wars"
    }, function(error, asciiArt) {
        if (error) {
            console.log(error);
        } else {
            editor.insertText(asciiArt);
        }
    });
};

module.exports = {
    activate: function() {
        atom.commands.add('atom-workspace', {
            'ascii-art:convert': function() {
                convert();
            }
        });
    }
};

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.changeanalysis.implementation;

import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.changeanalysis.fluent.ChangesClient;
import com.azure.resourcemanager.changeanalysis.fluent.models.ChangeInner;
import com.azure.resourcemanager.changeanalysis.models.ChangeList;
import java.time.OffsetDateTime;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in ChangesClient. */
public final class ChangesClientImpl implements ChangesClient {
    private final ClientLogger logger = new ClientLogger(ChangesClientImpl.class);

    /** The proxy service used to perform REST calls. */
    private final ChangesService service;

    /** The service client containing this operation class. */
    private final AzureChangeAnalysisManagementClientImpl client;

    /**
     * Initializes an instance of ChangesClientImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    ChangesClientImpl(AzureChangeAnalysisManagementClientImpl client) {
        this.service = RestProxy.create(ChangesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for AzureChangeAnalysisManagementClientChanges to be used by the proxy
     * service to perform REST calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "AzureChangeAnalysisM")
    private interface ChangesService {
        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ChangeAnalysis"
                + "/changes")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<ChangeList>> listByResourceGroup(
            @HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @QueryParam("$startTime") OffsetDateTime startTime,
            @QueryParam("$endTime") OffsetDateTime endTime,
            @QueryParam("$skipToken") String skipToken,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ChangeAnalysis/changes")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<ChangeList>> list(
            @HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion,
            @PathParam("subscriptionId") String subscriptionId,
            @QueryParam("$startTime") OffsetDateTime startTime,
            @QueryParam("$endTime") OffsetDateTime endTime,
            @QueryParam("$skipToken") String skipToken,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<ChangeList>> listChangesByResourceGroupNext(
            @PathParam(value = "nextLink", encoded = true) String nextLink,
            @HostParam("$host") String endpoint,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<ChangeList>> listChangesBySubscriptionNext(
            @PathParam(value = "nextLink", encoded = true) String nextLink,
            @HostParam("$host") String endpoint,
            @HeaderParam("Accept") String accept,
            Context context);
    }

    /**
     * List the changes of a resource group within the specified time range. Customer data will always be masked.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result.
     *     If a previous response contains a nextLink element, the value of the nextLink element will include a
     *     skipToken parameter that specifies a starting point to use for subsequent calls.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<ChangeInner>> listByResourceGroupSinglePageAsync(
        String resourceGroupName, OffsetDateTime startTime, OffsetDateTime endTime, String skipToken) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (startTime == null) {
            return Mono.error(new IllegalArgumentException("Parameter startTime is required and cannot be null."));
        }
        if (endTime == null) {
            return Mono.error(new IllegalArgumentException("Parameter endTime is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .listByResourceGroup(
                            this.client.getEndpoint(),
                            this.client.getApiVersion(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            startTime,
                            endTime,
                            skipToken,
                            accept,
                            context))
            .<PagedResponse<ChangeInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * List the changes of a resource group within the specified time range. Customer data will always be masked.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result.
     *     If a previous response contains a nextLink element, the value of the nextLink element will include a
     *     skipToken parameter that specifies a starting point to use for subsequent calls.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<ChangeInner>> listByResourceGroupSinglePageAsync(
        String resourceGroupName, OffsetDateTime startTime, OffsetDateTime endTime, String skipToken, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (startTime == null) {
            return Mono.error(new IllegalArgumentException("Parameter startTime is required and cannot be null."));
        }
        if (endTime == null) {
            return Mono.error(new IllegalArgumentException("Parameter endTime is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listByResourceGroup(
                this.client.getEndpoint(),
                this.client.getApiVersion(),
                this.client.getSubscriptionId(),
                resourceGroupName,
                startTime,
                endTime,
                skipToken,
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * List the changes of a resource group within the specified time range. Customer data will always be masked.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result.
     *     If a previous response contains a nextLink element, the value of the nextLink element will include a
     *     skipToken parameter that specifies a starting point to use for subsequent calls.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<ChangeInner> listByResourceGroupAsync(
        String resourceGroupName, OffsetDateTime startTime, OffsetDateTime endTime, String skipToken) {
        return new PagedFlux<>(
            () -> listByResourceGroupSinglePageAsync(resourceGroupName, startTime, endTime, skipToken),
            nextLink -> listChangesByResourceGroupNextSinglePageAsync(nextLink));
    }

    /**
     * List the changes of a resource group within the specified time range. Customer data will always be masked.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<ChangeInner> listByResourceGroupAsync(
        String resourceGroupName, OffsetDateTime startTime, OffsetDateTime endTime) {
        final String skipToken = null;
        return new PagedFlux<>(
            () -> listByResourceGroupSinglePageAsync(resourceGroupName, startTime, endTime, skipToken),
            nextLink -> listChangesByResourceGroupNextSinglePageAsync(nextLink));
    }

    /**
     * List the changes of a resource group within the specified time range. Customer data will always be masked.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result.
     *     If a previous response contains a nextLink element, the value of the nextLink element will include a
     *     skipToken parameter that specifies a starting point to use for subsequent calls.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<ChangeInner> listByResourceGroupAsync(
        String resourceGroupName, OffsetDateTime startTime, OffsetDateTime endTime, String skipToken, Context context) {
        return new PagedFlux<>(
            () -> listByResourceGroupSinglePageAsync(resourceGroupName, startTime, endTime, skipToken, context),
            nextLink -> listChangesByResourceGroupNextSinglePageAsync(nextLink, context));
    }

    /**
     * List the changes of a resource group within the specified time range. Customer data will always be masked.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<ChangeInner> listByResourceGroup(
        String resourceGroupName, OffsetDateTime startTime, OffsetDateTime endTime) {
        final String skipToken = null;
        return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, startTime, endTime, skipToken));
    }

    /**
     * List the changes of a resource group within the specified time range. Customer data will always be masked.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result.
     *     If a previous response contains a nextLink element, the value of the nextLink element will include a
     *     skipToken parameter that specifies a starting point to use for subsequent calls.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<ChangeInner> listByResourceGroup(
        String resourceGroupName, OffsetDateTime startTime, OffsetDateTime endTime, String skipToken, Context context) {
        return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, startTime, endTime, skipToken, context));
    }

    /**
     * List the changes of a subscription within the specified time range. Customer data will always be masked.
     *
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result.
     *     If a previous response contains a nextLink element, the value of the nextLink element will include a
     *     skipToken parameter that specifies a starting point to use for subsequent calls.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<ChangeInner>> listSinglePageAsync(
        OffsetDateTime startTime, OffsetDateTime endTime, String skipToken) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (startTime == null) {
            return Mono.error(new IllegalArgumentException("Parameter startTime is required and cannot be null."));
        }
        if (endTime == null) {
            return Mono.error(new IllegalArgumentException("Parameter endTime is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .list(
                            this.client.getEndpoint(),
                            this.client.getApiVersion(),
                            this.client.getSubscriptionId(),
                            startTime,
                            endTime,
                            skipToken,
                            accept,
                            context))
            .<PagedResponse<ChangeInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * List the changes of a subscription within the specified time range. Customer data will always be masked.
     *
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result.
     *     If a previous response contains a nextLink element, the value of the nextLink element will include a
     *     skipToken parameter that specifies a starting point to use for subsequent calls.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<ChangeInner>> listSinglePageAsync(
        OffsetDateTime startTime, OffsetDateTime endTime, String skipToken, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (startTime == null) {
            return Mono.error(new IllegalArgumentException("Parameter startTime is required and cannot be null."));
        }
        if (endTime == null) {
            return Mono.error(new IllegalArgumentException("Parameter endTime is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .list(
                this.client.getEndpoint(),
                this.client.getApiVersion(),
                this.client.getSubscriptionId(),
                startTime,
                endTime,
                skipToken,
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * List the changes of a subscription within the specified time range. Customer data will always be masked.
     *
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result.
     *     If a previous response contains a nextLink element, the value of the nextLink element will include a
     *     skipToken parameter that specifies a starting point to use for subsequent calls.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<ChangeInner> listAsync(OffsetDateTime startTime, OffsetDateTime endTime, String skipToken) {
        return new PagedFlux<>(
            () -> listSinglePageAsync(startTime, endTime, skipToken),
            nextLink -> listChangesBySubscriptionNextSinglePageAsync(nextLink));
    }

    /**
     * List the changes of a subscription within the specified time range. Customer data will always be masked.
     *
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<ChangeInner> listAsync(OffsetDateTime startTime, OffsetDateTime endTime) {
        final String skipToken = null;
        return new PagedFlux<>(
            () -> listSinglePageAsync(startTime, endTime, skipToken),
            nextLink -> listChangesBySubscriptionNextSinglePageAsync(nextLink));
    }

    /**
     * List the changes of a subscription within the specified time range. Customer data will always be masked.
     *
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result.
     *     If a previous response contains a nextLink element, the value of the nextLink element will include a
     *     skipToken parameter that specifies a starting point to use for subsequent calls.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<ChangeInner> listAsync(
        OffsetDateTime startTime, OffsetDateTime endTime, String skipToken, Context context) {
        return new PagedFlux<>(
            () -> listSinglePageAsync(startTime, endTime, skipToken, context),
            nextLink -> listChangesBySubscriptionNextSinglePageAsync(nextLink, context));
    }

    /**
     * List the changes of a subscription within the specified time range. Customer data will always be masked.
     *
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<ChangeInner> list(OffsetDateTime startTime, OffsetDateTime endTime) {
        final String skipToken = null;
        return new PagedIterable<>(listAsync(startTime, endTime, skipToken));
    }

    /**
     * List the changes of a subscription within the specified time range. Customer data will always be masked.
     *
     * @param startTime Specifies the start time of the changes request.
     * @param endTime Specifies the end time of the changes request.
     * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result.
     *     If a previous response contains a nextLink element, the value of the nextLink element will include a
     *     skipToken parameter that specifies a starting point to use for subsequent calls.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<ChangeInner> list(
        OffsetDateTime startTime, OffsetDateTime endTime, String skipToken, Context context) {
        return new PagedIterable<>(listAsync(startTime, endTime, skipToken, context));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The nextLink parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<ChangeInner>> listChangesByResourceGroupNextSinglePageAsync(String nextLink) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context -> service.listChangesByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
            .<PagedResponse<ChangeInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The nextLink parameter.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<ChangeInner>> listChangesByResourceGroupNextSinglePageAsync(
        String nextLink, Context context) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listChangesByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The nextLink parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<ChangeInner>> listChangesBySubscriptionNextSinglePageAsync(String nextLink) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context -> service.listChangesBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
            .<PagedResponse<ChangeInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The nextLink parameter.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of detected changes.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<ChangeInner>> listChangesBySubscriptionNextSinglePageAsync(
        String nextLink, Context context) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listChangesBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }
}


text:
package mat.client.audit.service;

import java.util.List;

import mat.DTO.SearchHistoryDTO;
import mat.client.login.service.AsynchronousService;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * The Interface AuditServiceAsync.
 */
public interface AuditServiceAsync extends AsynchronousService {

	/**
	 * Record measure event.
	 *
	 * @param measureId
	 *            the measure id
	 * @param event
	 *            the event
	 * @param additionalInfo
	 *            the additional info
	 * @param isChildLogRequired
	 *            the is child log required
	 * @param callback
	 *            the callback
	 */
	void recordMeasureEvent(String measureId, String event, String additionalInfo, boolean isChildLogRequired,
			AsyncCallback<Boolean> callback);

	/**
	 * Record measure event.
	 *
	 * @param measureIds
	 *            the measure ids
	 * @param event
	 *            the event
	 * @param additionalInfo
	 *            the additional info
	 * @param isChildLogRequired
	 *            the is child log required
	 * @param callback
	 *            the callback
	 */
	void recordMeasureEvent(List<String> measureIds, String event, String additionalInfo, boolean isChildLogRequired,
			AsyncCallback<Void> callback);

	/**
	 * Record code list event.
	 *
	 * @param codeListId
	 *            the code list id
	 * @param event
	 *            the event
	 * @param additionalInfo
	 *            the additional info
	 * @param callback
	 *            the callback
	 */
	void recordCodeListEvent(String codeListId, String event, String additionalInfo, AsyncCallback<Boolean> callback);

	/**
	 * Execute code list log search.
	 *
	 * @param codeListId
	 *            the code list id
	 * @param startIndex
	 *            the start index
	 * @param numberOfRows
	 *            the number of rows
	 * @param filterList
	 *            the filter list
	 * @param callback
	 *            the callback
	 */
	void executeCodeListLogSearch(String codeListId, int startIndex, int numberOfRows, List<String> filterList,
			AsyncCallback<SearchHistoryDTO> callback);

	/**
	 * Execute measure log search.
	 *
	 * @param measureId
	 *            the measure id
	 * @param startIndex
	 *            the start index
	 * @param numberOfRows
	 *            the number of rows
	 * @param filterList
	 *            the filter list
	 * @param callback
	 *            the callback
	 */
	void executeMeasureLogSearch(String measureId, int startIndex, int numberOfRows, List<String> filterList,
			AsyncCallback<SearchHistoryDTO> callback);

	/**
	 * Record transaction event.
	 *
	 * @param primaryId
	 *            the primary id
	 * @param secondaryId
	 *            the secondary id
	 * @param activityType
	 *            the activity type
	 * @param userId
	 *            the user id
	 * @param additionalInfo
	 *            the additional info
	 * @param logLevel
	 *            the log level
	 * @param callback
	 *            the callback
	 */
	void recordTransactionEvent(String primaryId, String secondaryId, String activityType, String userId,
			String additionalInfo, int logLevel, AsyncCallback<Boolean> callback);
}


text:
#import <Foundation/Foundation.h>

@class GULRuntimeClassSnapshot;
@class GULRuntimeDiff;

NS_ASSUME_NONNULL_BEGIN

/** This class captures various aspects the current state of the Objective-C runtime. */
@interface GULRuntimeSnapshot : NSObject

/** Initializes an instance of this class. The designated initializer.
 *
 *  @param classes The set of classes to track. If nil or empty, all ObjC classes are tracked.
 *  @return An instance of this class.
 */
- (instancetype)initWithClasses:(nullable NSSet<Class> *)classes NS_DESIGNATED_INITIALIZER;

/** Captures the state of the class set. */
- (void)capture;

/** Computes the diff between this snapshot and another snapshot.
 *
 *  @param otherSnapshot The other snapshot, assumed to be more recent than self.
 *  @return A diff object populated with the diff.
 */
- (GULRuntimeDiff *)diff:(GULRuntimeSnapshot *)otherSnapshot;

@end

NS_ASSUME_NONNULL_END


text:
package es.tid.topologyModuleBase.plugins.readerwriter;

import es.tid.topologyModuleBase.TopologyModuleParams;
import es.tid.topologyModuleBase.database.TopologiesDataBase;
import es.tid.topologyModuleBase.plugins.TMPlugin;
import es.tid.topologyModuleBase.plugins.writer.InformationRetriever;

import java.util.concurrent.locks.Lock;
import java.util.logging.Logger;

/**
 * Created by Javier Gusano Martinez on 23/09/2016.
 */
public abstract class TopologyReaderWriter implements TMPlugin {
    /**
     * Logger object
     */
    protected Logger log = Logger.getLogger("TMController");

    protected TopologiesDataBase ted;
    protected TopologyModuleParams params;
    protected Lock lock;
    protected InformationRetriever infRetriever;

    /**
     * Class constructor.
     *
     * @param ted
     * @param params
     * @param lock
     * @// TODO: 23/09/2016 Write javadoc constructor fields description.
     */
    public TopologyReaderWriter(TopologiesDataBase ted, TopologyModuleParams params, Lock lock) {
        this.ted = ted;
        this.params = params;
        this.lock = lock;
        infRetriever = new InformationRetriever(ted, params, lock);
    }

    /**
     * Read topology abstract class.
     *
     * @// TODO: 23/09/2016 Write javadoc constructor fields description.
     */
    abstract public void readServeTopology();
}


text:
/**
 * Generated with Acceleo
 */
package org.wso2.developerstudio.eclipse.gmf.esb.components;

// Start of user code for imports
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.WrappedException;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;

import org.eclipse.emf.ecore.resource.ResourceSet;

import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.emf.ecore.util.EcoreUtil;

import org.eclipse.emf.eef.runtime.api.notify.EStructuralFeatureNotificationFilter;
import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.api.notify.NotificationFilter;

import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;

import org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext;

import org.eclipse.emf.eef.runtime.impl.components.SinglePartPropertiesEditingComponent;

import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil;
import org.eclipse.emf.eef.runtime.impl.utils.EEFUtils;

import org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy;

import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;

import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;

import org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

import org.wso2.developerstudio.eclipse.gmf.esb.EsbFactory;
import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage;
import org.wso2.developerstudio.eclipse.gmf.esb.KeyType;
import org.wso2.developerstudio.eclipse.gmf.esb.NamespacedProperty;
import org.wso2.developerstudio.eclipse.gmf.esb.RegistryKeyProperty;
import org.wso2.developerstudio.eclipse.gmf.esb.ValidateSchema;
import org.wso2.developerstudio.eclipse.gmf.esb.impl.EsbFactoryImpl;
import org.wso2.developerstudio.eclipse.gmf.esb.parts.EsbViewsRepository;
import org.wso2.developerstudio.eclipse.gmf.esb.parts.ValidateSchemaPropertiesEditionPart;
import org.wso2.developerstudio.eclipse.gmf.esb.parts.impl.ValidateSchemaPropertiesEditionPartImpl;

// End of user code

/**
 *
 *
 */
public class ValidateSchemaPropertiesEditionComponent extends SinglePartPropertiesEditingComponent {

	public static String BASE_PART = "Base"; //$NON-NLS-1$

	/**
	 * Settings for schemaKey EObjectFlatComboViewer
	 */
	private EObjectFlatComboSettings schemaKeySettings;

	/**
	 * Default constructor
	 *
	 */
	public ValidateSchemaPropertiesEditionComponent(PropertiesEditingContext editingContext, EObject validateSchema, String editing_mode) {
		super(editingContext, validateSchema, editing_mode);
		parts = new String[] { BASE_PART };
		repositoryKey = EsbViewsRepository.class;
		partKey = EsbViewsRepository.ValidateSchema.class;
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
	 *      org.eclipse.emf.ecore.resource.ResourceSet)
	 *
	 */
	public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
		setInitializing(true);
		if (editingPart != null && key == partKey) {
			editingPart.setContext(elt, allResource);

			final ValidateSchema validateSchema = (ValidateSchema)elt;
			final ValidateSchemaPropertiesEditionPart basePart = (ValidateSchemaPropertiesEditionPart)editingPart;
			// init values
			if (isAccessible(EsbViewsRepository.ValidateSchema.Properties.validateSchemaKeyType)) {
				basePart.initValidateSchemaKeyType(EEFUtils.choiceOfValues(validateSchema, EsbPackage.eINSTANCE.getValidateSchema_ValidateSchemaKeyType()), validateSchema.getValidateSchemaKeyType());
			}
			if (isAccessible(EsbViewsRepository.ValidateSchema.Properties.schemaKey)) {
				// init part
				schemaKeySettings = new EObjectFlatComboSettings(validateSchema, EsbPackage.eINSTANCE.getValidateSchema_SchemaKey());
				basePart.initSchemaKey(schemaKeySettings);
				// set the button mode
				basePart.setSchemaKeyButtonMode(ButtonsModeEnum.BROWSE);
			}
			// Start of user code  for staticSchemaKey command update
            if (isAccessible(EsbViewsRepository.ValidateSchema.Properties.staticSchemaKey)) {
                basePart.setStaticSchemaKey(validateSchema.getValidateStaticSchemaKey());
            }
			// End of user code

			// Start of user code  for dynamicSchemaKey command update
            if (isAccessible(EsbViewsRepository.ValidateSchema.Properties.dynamicSchemaKey)) {
                basePart.setDynamicSchemaKey(validateSchema.getValidateDynamicSchemaKey());
            }
			// End of user code

			// init filters

			if (isAccessible(EsbViewsRepository.ValidateSchema.Properties.schemaKey)) {
				basePart.addFilterToSchemaKey(new ViewerFilter() {

					/**
					 * {@inheritDoc}
					 *
					 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
					 */
					public boolean select(Viewer viewer, Object parentElement, Object element) {
						return (element instanceof String && element.equals("")) || (element instanceof RegistryKeyProperty); //$NON-NLS-1$
					}

				});
				// Start of user code for additional businessfilters for schemaKey
				// End of user code
			}
			// Start of user code  for staticSchemaKey filter update
			((ValidateSchemaPropertiesEditionPartImpl) editingPart).validate();
			// End of user code

			// Start of user code  for dynamicSchemaKey filter update
			// End of user code

			// init values for referenced views
			// init filters for referenced views

		}
		setInitializing(false);

	}

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#associatedFeature(java.lang.Object)
	 */
	public EStructuralFeature associatedFeature(Object editorKey) {
		if (editorKey == EsbViewsRepository.ValidateSchema.Properties.validateSchemaKeyType) {
			return EsbPackage.eINSTANCE.getValidateSchema_ValidateSchemaKeyType();
		}
		if (editorKey == EsbViewsRepository.ValidateSchema.Properties.schemaKey) {
			return EsbPackage.eINSTANCE.getValidateSchema_SchemaKey();
		}
		if (editorKey == EsbViewsRepository.ValidateSchema.Properties.staticSchemaKey) {
			return EsbPackage.eINSTANCE.getValidateSchema_ValidateStaticSchemaKey();
		}
		if (editorKey == EsbViewsRepository.ValidateSchema.Properties.dynamicSchemaKey) {
			return EsbPackage.eINSTANCE.getValidateSchema_ValidateDynamicSchemaKey();
		}
		return super.associatedFeature(editorKey);
	}

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
	 *
	 */
	public void updateSemanticModel(final IPropertiesEditionEvent event) {
		ValidateSchema validateSchema = (ValidateSchema)semanticObject;
		if (EsbViewsRepository.ValidateSchema.Properties.validateSchemaKeyType == event.getAffectedEditor()) {
			validateSchema.setValidateSchemaKeyType((KeyType)event.getNewValue());
		}
		if (EsbViewsRepository.ValidateSchema.Properties.schemaKey == event.getAffectedEditor()) {
			if (event.getKind() == PropertiesEditionEvent.SET) {
				schemaKeySettings.setToReference((RegistryKeyProperty)event.getNewValue());
			} else if (event.getKind() == PropertiesEditionEvent.ADD) {
				RegistryKeyProperty eObject = EsbFactory.eINSTANCE.createRegistryKeyProperty();
				EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(editingContext, this, eObject, editingContext.getAdapterFactory());
				PropertiesEditingProvider provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt(eObject, PropertiesEditingProvider.class);
				if (provider != null) {
					PropertiesEditingPolicy policy = provider.getPolicy(context);
					if (policy != null) {
						policy.execute();
					}
				}
				schemaKeySettings.setToReference(eObject);
			}
		}
		if (EsbViewsRepository.ValidateSchema.Properties.staticSchemaKey == event.getAffectedEditor()) {
			// Start of user code for updateStaticSchemaKey method body
            if (event.getNewValue() != null) {
                RegistryKeyProperty rkp = (RegistryKeyProperty) event.getNewValue();
                validateSchema.setValidateStaticSchemaKey(rkp);
            } else {
                validateSchema.setValidateStaticSchemaKey(EsbFactoryImpl.eINSTANCE.createRegistryKeyProperty());
            }
			// End of user code

		}
		if (EsbViewsRepository.ValidateSchema.Properties.dynamicSchemaKey == event.getAffectedEditor()) {
			// Start of user code for updateDynamicSchemaKey method body
            if (event.getNewValue() != null) {
                NamespacedProperty nsp = (NamespacedProperty) event.getNewValue();
                validateSchema.setValidateDynamicSchemaKey(nsp);
            } else {
                validateSchema.setValidateDynamicSchemaKey(EsbFactoryImpl.eINSTANCE.createNamespacedProperty());
            }
			// End of user code

		}
	}

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
	 */
	public void updatePart(Notification msg) {
		super.updatePart(msg);
		if (editingPart.isVisible()) {
			ValidateSchemaPropertiesEditionPart basePart = (ValidateSchemaPropertiesEditionPart)editingPart;
			if (EsbPackage.eINSTANCE.getValidateSchema_ValidateSchemaKeyType().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && isAccessible(EsbViewsRepository.ValidateSchema.Properties.validateSchemaKeyType))
				basePart.setValidateSchemaKeyType((KeyType)msg.getNewValue());

			if (EsbPackage.eINSTANCE.getValidateSchema_SchemaKey().equals(msg.getFeature()) && basePart != null && isAccessible(EsbViewsRepository.ValidateSchema.Properties.schemaKey))
				basePart.setSchemaKey((EObject)msg.getNewValue());
					// Start of user code for staticSchemaKey live update
                if (EsbPackage.eINSTANCE.getValidateSchema_ValidateStaticSchemaKey().equals(msg.getFeature())
                        && msg.getNotifier().equals(semanticObject) && basePart != null
                        && isAccessible(EsbViewsRepository.ValidateSchema.Properties.staticSchemaKey)) {
                    if (msg.getNewValue() != null) {
                        basePart.setStaticSchemaKey((RegistryKeyProperty)msg.getNewValue());
                    } else {
                        basePart.setStaticSchemaKey(EsbFactoryImpl.eINSTANCE.createRegistryKeyProperty());
                    }
                }
					// End of user code

					// Start of user code for dynamicSchemaKey live update
                if (EsbPackage.eINSTANCE.getValidateSchema_ValidateDynamicSchemaKey().equals(msg.getFeature())
                        && msg.getNotifier().equals(semanticObject) && basePart != null
                        && isAccessible(EsbViewsRepository.ValidateSchema.Properties.dynamicSchemaKey)) {
                    if (msg.getNewValue() != null) {
                        basePart.setDynamicSchemaKey((NamespacedProperty)msg.getNewValue());
                    } else {
                        basePart.setDynamicSchemaKey(EsbFactoryImpl.eINSTANCE.createNamespacedProperty());
                    }
                }
					// End of user code

		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#getNotificationFilters()
	 */
	@Override
	protected NotificationFilter[] getNotificationFilters() {
		NotificationFilter filter = new EStructuralFeatureNotificationFilter(
			EsbPackage.eINSTANCE.getValidateSchema_ValidateSchemaKeyType(),
			EsbPackage.eINSTANCE.getValidateSchema_SchemaKey(),
			EsbPackage.eINSTANCE.getValidateSchema_ValidateStaticSchemaKey(),
			EsbPackage.eINSTANCE.getValidateSchema_ValidateDynamicSchemaKey()		);
		return new NotificationFilter[] {filter,};
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
	 *
	 */
	public Diagnostic validateValue(IPropertiesEditionEvent event) {
		Diagnostic ret = Diagnostic.OK_INSTANCE;
		if (event.getNewValue() != null) {
			try {
				if (EsbViewsRepository.ValidateSchema.Properties.validateSchemaKeyType == event.getAffectedEditor()) {
					Object newValue = event.getNewValue();
					if (newValue instanceof String) {
						newValue = EEFConverterUtil.createFromString(EsbPackage.eINSTANCE.getValidateSchema_ValidateSchemaKeyType().getEAttributeType(), (String)newValue);
					}
					ret = Diagnostician.INSTANCE.validate(EsbPackage.eINSTANCE.getValidateSchema_ValidateSchemaKeyType().getEAttributeType(), newValue);
				}
			} catch (IllegalArgumentException iae) {
				ret = BasicDiagnostic.toDiagnostic(iae);
			} catch (WrappedException we) {
				ret = BasicDiagnostic.toDiagnostic(we);
			}
		}
		return ret;
	}

}


text:
var pulls = $('li[aria-label="Pull requests"]');
var milestones = $(pulls.clone());
milestones.attr('aria-label', 'Milestones');
var href = milestones.children('a').attr('href');
milestones.children('a').attr('href', href.substring(0, href.lastIndexOf('/')) + '/milestones');
milestones.children('a').children('.octicon-git-pull-request').removeClass('octicon-git-pull-request').addClass('octicon-milestone');
milestones.children('a').children('.full-word').text('Milestones');
milestones.children('a').children('.js-pull-replace-counter').remove();
// Remove selected class on the button if the issues button was selected during copy
milestones.children('a').removeClass('selected');
milestones.insertAfter(pulls);


text:
package org.wso2.carbon.identity.authenticator.saml2.sso.ui;

import org.apache.axis2.context.ConfigurationContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.opensaml.saml2.core.*;
import org.opensaml.xml.XMLObject;
import org.wso2.carbon.CarbonConstants;
import org.wso2.carbon.identity.authenticator.saml2.sso.common.*;
import org.wso2.carbon.identity.authenticator.saml2.sso.ui.authenticator.SAML2SSOUIAuthenticator;
import org.wso2.carbon.identity.authenticator.saml2.sso.ui.client.SAMLSSOServiceClient;
import org.wso2.carbon.identity.authenticator.saml2.sso.ui.session.SSOSessionManager;
import org.wso2.carbon.identity.sso.saml.stub.IdentityException;
import org.wso2.carbon.identity.sso.saml.stub.types.SAMLSSOAuthnReqDTO;
import org.wso2.carbon.identity.sso.saml.stub.types.SAMLSSOReqValidationResponseDTO;
import org.wso2.carbon.identity.sso.saml.stub.types.SAMLSSORespDTO;
import org.wso2.carbon.ui.CarbonUIUtil;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.Enumeration;
import java.util.List;

/**
 *
 */
public class SSOAssertionConsumerService extends HttpServlet {

    public static final Log log = LogFactory.getLog(SSOAssertionConsumerService.class);
    public static final String SSO_TOKEN_ID = "ssoTokenId";
    /**
     *
     */
    private static final long serialVersionUID = 5451353570561170887L;
    /**
     * session timeout happens in 10 hours
     */
    private static final int SSO_SESSION_EXPIRE = 36000;

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        String samlRespString = req.getParameter(
                SAML2SSOAuthenticatorConstants.HTTP_POST_PARAM_SAML2_RESP);

        if (log.isDebugEnabled()) {
            log.debug("Processing SAML Response");

            Enumeration headerNames = req.getHeaderNames();
            log.debug("[Request Headers] :");
            while (headerNames.hasMoreElements()) {
                String headerName = (String) headerNames.nextElement();
                log.debug(">> " + headerName + ":" + req.getHeader(headerName));
            }

            Enumeration params = req.getParameterNames();
            log.debug("[Request Parameters] :");
            while (params.hasMoreElements()) {
                String paramName = (String) params.nextElement();
                log.debug(">> " + paramName + ":" + req.getParameter(paramName));
            }
        }

        // Handle single logout requests
        if (req.getParameter(SAML2SSOAuthenticatorConstants.HTTP_POST_PARAM_SAML2_AUTH_REQ) != null) {
            handleSingleLogoutRequest(req, resp);
            return;
        }

        // If SAML Response is not present in the redirected req, send the user to an error page.
        if (samlRespString == null) {
            log.error("SAML Response is not present in the request.");
            handleMalformedResponses(req, resp,
                    SAML2SSOAuthenticatorConstants.ErrorMessageConstants.RESPONSE_NOT_PRESENT);
            return;
        }

//        // If RELAY-STATE is invalid, redirect the users to an error page.
//        if (!SSOSessionManager.isValidResponse(relayState)) {
//            handleMalformedResponses(req, resp,
//                                     SAML2SSOAuthenticatorConstants.ErrorMessageConstants.RESPONSE_INVALID);
//            return;
//        }

        // Handle valid messages, either SAML Responses or LogoutRequests
        try {
            XMLObject samlObject = Util.unmarshall(Util.decode(samlRespString));
            if (samlObject instanceof LogoutResponse) {   // if it is a logout response, redirect it to login page.
                resp.sendRedirect(getAdminConsoleURL(req) + "admin/logout_action.jsp?logoutcomplete=true");
            } else if (samlObject instanceof Response) {    // if it is a SAML Response
                handleSAMLResponses(req, resp, samlObject);
            }
        } catch (SAML2SSOUIAuthenticatorException e) {
            log.error("Error when processing the SAML Assertion in the request.", e);
            handleMalformedResponses(req, resp, SAML2SSOAuthenticatorConstants.ErrorMessageConstants.RESPONSE_MALFORMED);
        } catch (IdentityException e) {
            log.error("Error when processing the Federated SAML Assertion in the request.", e);
            handleMalformedResponses(req, resp, SAML2SSOAuthenticatorConstants.ErrorMessageConstants.RESPONSE_MALFORMED);
        }
    }

    /**
     * Handle SAML Responses and authenticate.
     *
     * @param req        HttpServletRequest
     * @param resp       HttpServletResponse
     * @param samlObject SAML Response object
     * @throws ServletException  Error when redirecting
     * @throws IOException       Error when redirecting
     * @throws IdentityException
     */
    private void handleSAMLResponses(HttpServletRequest req, HttpServletResponse resp,
                                     XMLObject samlObject)
            throws ServletException, IOException, SAML2SSOUIAuthenticatorException, IdentityException {
        Response samlResponse;
        samlResponse = (Response) samlObject;
        List<Assertion> assertions = samlResponse.getAssertions();
        Assertion assertion = null;
        if (assertions != null && assertions.size() > 0) {
            assertion = assertions.get(0);
        }

        if (assertion == null) {
            if (samlResponse.getStatus() != null &&
                    samlResponse.getStatus().getStatusMessage() != null) {
                log.error(samlResponse.getStatus().getStatusMessage().getMessage());
            } else {
                log.error("SAML Assertion not found in the Response.");
            }
            throw new SAML2SSOUIAuthenticatorException("SAML Authentication Failed.");
        }

        // Get the subject name from the Response Object and forward it to login_action.jsp
        String username = null;
        if (assertion.getSubject() != null && assertion.getSubject().getNameID() != null) {
            username = Util.getUsernameFromResponse(samlResponse);
        }

        if (log.isDebugEnabled()) {
            log.debug("A username is extracted from the response. : " + username);
        }

        if (username == null) {
            log.error("SAMLResponse does not contain the name of the subject");
            throw new SAML2SSOUIAuthenticatorException("SAMLResponse does not contain the name of the subject");
        }

        String relayState = req.getParameter(SAMLConstants.RELAY_STATE);
        boolean isFederated = false;

        if (relayState != null) {
            FederatedSSOToken federatedSSOToken = org.wso2.carbon.identity.authenticator.saml2.sso.common.SSOSessionManager
                    .getFederatedToken(relayState);
            if (federatedSSOToken != null) {
                isFederated = true;
                HttpServletRequest fedRequest = federatedSSOToken.getHttpServletRequest();
                HttpServletResponse fedResponse = federatedSSOToken.getHttpServletResponse();

                String samlRequest = fedRequest.getParameter("SAMLRequest");
                String authMode = SAMLConstants.AuthnModes.USERNAME_PASSWORD;
                String fedRelayState = fedRequest.getParameter(SAMLConstants.RELAY_STATE);
                String rpSessionId = fedRequest.getParameter(MultitenantConstants.SSO_AUTH_SESSION_ID);

                Enumeration<String> e = fedRequest.getAttributeNames();

                while (e.hasMoreElements()) {
                    String name = e.nextElement();
                    req.setAttribute(name, fedRequest.getAttribute(name));
                }

                Cookie[] cookies = fedRequest.getCookies();

                if (cookies != null) {
                    for (int i = 0; i < cookies.length; i++) {
                        resp.addCookie(cookies[i]);
                    }
                }

                HttpSession session = fedRequest.getSession();

                // Use sessionID as the tokenID, if cookie is not set.
                String ssoTokenID = session.getId();
                Cookie tokenCookie = getSSOTokenCookie(fedRequest);
                if (tokenCookie != null) {
                    ssoTokenID = tokenCookie.getValue();
                }

                handleFederatedSAMLRequest(req, resp, ssoTokenID, samlRequest, fedRelayState, authMode, assertion.getSubject(), rpSessionId);
            }
        }

        if (!isFederated) {
            // Set the SAML2 Response as a HTTP Attribute, so it is not required to build the
            // assertion again.
            req.setAttribute(SAML2SSOAuthenticatorConstants.HTTP_ATTR_SAML2_RESP_TOKEN,
                    samlResponse);

            String url = req.getRequestURI();
            url = url.replace("acs",
                    "carbon/admin/login_action.jsp?username=" + URLEncoder.encode(username));
            RequestDispatcher reqDispatcher = req.getRequestDispatcher(url);
            req.getSession().setAttribute("CarbonAuthenticator", new SAML2SSOUIAuthenticator());
            reqDispatcher.forward(req, resp);
        }
    }

    /**
     * Handle malformed Responses.
     *
     * @param req      HttpServletRequest
     * @param resp     HttpServletResponse
     * @param errorMsg Error message to be displayed in HttpServletResponse.jsp
     * @throws IOException Error when redirecting
     */
    private void handleMalformedResponses(HttpServletRequest req, HttpServletResponse resp,
                                          String errorMsg) throws IOException {
        HttpSession session = req.getSession();
        session.setAttribute(SAML2SSOAuthenticatorConstants.NOTIFICATIONS_ERROR_MSG, errorMsg);
        resp.sendRedirect(getAdminConsoleURL(req) + "sso-acs/notifications.jsp");
        return;
    }

    /**
     * This method is used to handle the single logout requests sent by the Identity Provider
     *
     * @param req  Corresponding HttpServletRequest
     * @param resp Corresponding HttpServletResponse
     */
    private void handleSingleLogoutRequest(HttpServletRequest req, HttpServletResponse resp) {
        String logoutReqStr = decodeHTMLCharacters(req.getParameter(
                SAML2SSOAuthenticatorConstants.HTTP_POST_PARAM_SAML2_AUTH_REQ));

        XMLObject samlObject = null;

        try {
            samlObject = Util.unmarshall(Util.decode(logoutReqStr));
        } catch (SAML2SSOUIAuthenticatorException e) {
            log.error("Error handling the single logout request", e);
        }

        if (samlObject instanceof LogoutRequest) {
            LogoutRequest logoutRequest = (LogoutRequest) samlObject;
            //  There can be only one session index entry.
            List<SessionIndex> sessionIndexList = logoutRequest.getSessionIndexes();
            if (sessionIndexList.size() > 0) {
                SSOSessionManager.getInstance().handleLogout(
                        sessionIndexList.get(0).getSessionIndex());
            }
        }
    }

    /**
     * Get the admin console url from the request.
     *
     * @param request httpServletReq that hits the ACS Servlet
     * @return Admin Console URL       https://10.100.1.221:8443/acs/carbon/
     */
    private String getAdminConsoleURL(HttpServletRequest request) {
        String url = CarbonUIUtil.getAdminConsoleURL(request);
        if (!url.endsWith("/")) {
            url = url + "/";
        }
        if (url.indexOf("/acs") != -1) {
            url = url.replace("/acs", "");
        }
        return url;
    }

    /**
     * A utility method to decode an HTML encoded string
     *
     * @param encodedStr encoded String
     * @return decoded String
     */
    private String decodeHTMLCharacters(String encodedStr) {
        return encodedStr.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">")
                .replaceAll(""", "\"").replaceAll("'", "'");

    }

    private void handleFederatedSAMLRequest(HttpServletRequest req, HttpServletResponse resp,
                                            String ssoTokenID, String samlRequest,
                                            String relayState, String authMode, Subject subject,
                                            String rpSessionId) throws IdentityException,
            IOException, ServletException {
        // Instantiate the service client.
        HttpSession session = req.getSession();
        String serverURL = CarbonUIUtil.getServerURL(session.getServletContext(), session);
        ConfigurationContext configContext =
                (ConfigurationContext) session.getServletContext()
                        .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
        SAMLSSOServiceClient ssoServiceClient = new SAMLSSOServiceClient(serverURL, configContext);

        String method = req.getMethod();
        boolean isPost = false;

        if ("post".equalsIgnoreCase(method)) {
            isPost = true;
        }

        SAMLSSOReqValidationResponseDTO signInRespDTO =
                ssoServiceClient.validate(samlRequest,
                        null, ssoTokenID,
                        rpSessionId,
                        authMode, isPost);
        if (signInRespDTO.getValid()) {
            handleRequestFromLoginPage(req, resp, ssoTokenID,
                    signInRespDTO.getAssertionConsumerURL(),
                    signInRespDTO.getId(), signInRespDTO.getIssuer(),
                    subject.getNameID().getValue(), subject.getNameID()
                            .getValue(),
                    signInRespDTO.getRpSessionId(),
                    signInRespDTO.getRequestMessageString(), relayState);
        }
    }

    private void handleRequestFromLoginPage(HttpServletRequest req, HttpServletResponse resp,
                                            String ssoTokenID, String assertionConsumerUrl, String id, String issuer, String userName, String subject,
                                            String rpSession, String requestMsgString, String relayState) throws IdentityException, IOException,
            ServletException {
        HttpSession session = req.getSession();

        // instantiate the service client
        String serverURL = CarbonUIUtil.getServerURL(session.getServletContext(), session);
        ConfigurationContext configContext = (ConfigurationContext) session.getServletContext()
                .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
        SAMLSSOServiceClient ssoServiceClient = new SAMLSSOServiceClient(serverURL, configContext);

        // Create SAMLSSOAuthnReqDTO using the request Parameters
        SAMLSSOAuthnReqDTO authnReqDTO = new SAMLSSOAuthnReqDTO();

        authnReqDTO.setAssertionConsumerURL(assertionConsumerUrl);
        authnReqDTO.setId(id);
        authnReqDTO.setIssuer(issuer);
        authnReqDTO.setUsername(userName);
        authnReqDTO.setPassword("federated_idp_login");
        authnReqDTO.setSubject(subject);
        authnReqDTO.setRpSessionId(rpSession);
        authnReqDTO.setRequestMessageString(requestMsgString);

        // authenticate the user
        SAMLSSORespDTO authRespDTO = ssoServiceClient.authenticate(authnReqDTO, ssoTokenID);

        if (authRespDTO.getSessionEstablished()) { // authentication is SUCCESSFUL
            // Store the cookie
            storeSSOTokenCookie(ssoTokenID, req, resp);
            // add relay state, assertion string and ACS URL as request parameters.
            req.setAttribute(SAMLConstants.RELAY_STATE, relayState);
            req.setAttribute(SAMLConstants.ASSERTION_STR, authRespDTO.getRespString());
            req.setAttribute(SAMLConstants.ASSRTN_CONSUMER_URL, authRespDTO.getAssertionConsumerURL());
            req.setAttribute(SAMLConstants.SUBJECT, authRespDTO.getSubject());
            RequestDispatcher reqDispatcher = req.getRequestDispatcher("/carbon/sso-acs/federation_ajaxprocessor.jsp");
            reqDispatcher.forward(req, resp);
            return;
        }
    }

    private void storeSSOTokenCookie(String ssoTokenID, HttpServletRequest req,
                                     HttpServletResponse resp) {
        Cookie ssoTokenCookie = getSSOTokenCookie(req);
        if (ssoTokenCookie == null) {
            ssoTokenCookie = new Cookie(SSO_TOKEN_ID, ssoTokenID);
        }
        ssoTokenCookie.setMaxAge(SSO_SESSION_EXPIRE);
        resp.addCookie(ssoTokenCookie);
    }

    private Cookie getSSOTokenCookie(HttpServletRequest req) {
        Cookie[] cookies = req.getCookies();
        if (cookies != null) {
            for (Cookie cookie : cookies) {
                if (cookie.getName().equals("ssoTokenId")) {
                    return cookie;
                }
            }
        }
        return null;
    }
}


text:
#include <osquery/config.h>
#include <osquery/logger.h>

#include "osquery/events/kernel.h"

namespace pt = boost::property_tree;

namespace osquery {

class ProcessEventSubscriber : public EventSubscriber<KernelEventPublisher> {
 public:
  /// The process event subscriber declares a kernel event type subscription.
  Status init() override;

  /// Kernel events matching the event type will fire.
  Status Callback(const TypedKernelEventContextRef<osquery_process_event_t> &ec,
                  const KernelSubscriptionContextRef &sc);
};

REGISTER(ProcessEventSubscriber, "event_subscriber", "process_events");

Status ProcessEventSubscriber::init() {
  auto pubref = EventFactory::getEventPublisher("kernel");
  if (pubref == nullptr || pubref->isEnding()) {
    return Status(1, "No kernel event publisher");
  }

  auto sc = createSubscriptionContext();
  sc->event_type = OSQUERY_PROCESS_EVENT;
  subscribe(&ProcessEventSubscriber::Callback, sc);

  return Status(0, "OK");
}

Status ProcessEventSubscriber::Callback(
    const TypedKernelEventContextRef<osquery_process_event_t> &ec,
    const KernelSubscriptionContextRef &sc) {
  Row r;
  r["overflows"] = "";
  r["cmdline_size"] = BIGINT(ec->event.arg_length);
  if (ec->event.argc != ec->event.actual_argc) {
    r["overflows"] = "cmdline";
  }

  r["environment_count"] = BIGINT(ec->event.actual_envc);
  r["environment_size"] = BIGINT(ec->event.env_length);
  if (ec->event.envc != ec->event.actual_envc) {
    r["overflows"] +=
        std::string(((r["overflows"].size() > 0) ? ", " : "")) + "environment";
  }

  char *argv = &(ec->flexible_data.data()[ec->event.argv_offset]);
  std::string argv_accumulator("");
  while (ec->event.argc-- > 0) {
    argv_accumulator += argv;
    argv_accumulator += " ";
    argv += strlen(argv) + 1;
  }
  r["cmdline"] = std::move(argv_accumulator);

  {
    // A configuration can optionally restrict environment variable logging to
    // a whitelist. This is helpful for limiting logged data as well as
    // protecting against logging unsafe/private variables.
    bool use_whitelist = false;
    pt::ptree whitelist;

    auto plugin = Config::getInstance().getParser("events");
    if (plugin == nullptr || plugin.get() == nullptr) {
      LOG(ERROR) << "Could not load events config parser";
    } else {
      const auto &data = plugin->getData();
      if (data.get_child("events").count("environment_variables") > 0) {
        use_whitelist = true;
        whitelist = data.get_child("events.environment_variables");
      }
    }

    char *envv = &(ec->flexible_data.data()[ec->event.envv_offset]);
    std::string envv_accumulator("");
    while (ec->event.envc-- > 0) {
      auto envv_string = std::string(envv);
      if (use_whitelist) {
        for (const auto &item : whitelist) {
          if (envv_string.find(item.second.data()) == 0) {
            envv_accumulator += std::move(envv_string) + ' ';
            break;
          }
        }
      } else {
        envv_accumulator += std::move(envv_string) + ' ';
      }
      envv += strlen(envv) + 1;
    }
    r["environment"] = std::move(envv_accumulator);
  }

  r["pid"] = BIGINT(ec->event.pid);
  r["parent"] = BIGINT(ec->event.ppid);
  r["uid"] = BIGINT(ec->event.uid);
  r["euid"] = BIGINT(ec->event.euid);
  r["gid"] = BIGINT(ec->event.gid);
  r["egid"] = BIGINT(ec->event.egid);
  r["owner_uid"] = BIGINT(ec->event.owner_uid);
  r["owner_gid"] = BIGINT(ec->event.owner_gid);
  r["create_time"] = BIGINT(ec->event.create_time);
  r["access_time"] = BIGINT(ec->event.access_time);
  r["modify_time"] = BIGINT(ec->event.modify_time);
  r["change_time"] = BIGINT(ec->event.change_time);
  r["mode"] = BIGINT(ec->event.mode);
  r["path"] = ec->event.path;
  r["uptime"] = BIGINT(ec->uptime);

  add(r, ec->time);

  return Status(0, "OK");
}
} // namespace osquery


text:
import Ember from 'ember';

var DURATION = 1500;
var DELAY = 500;

export default Ember.Controller.extend({
  needs: 'application',
  actions: {
    transitionToDir: function(dirId) {
      var _this = this;
      this.store.fetchById('dir', dirId)
        .then(function(dir) {
          _this.set('dir', dir);
          _this.set('parent', dir.get('parent'));
        });
    }
  }
});


text:
#import <Foundation/Foundation.h>
#import <Accelerate/Accelerate.h>

/**
 * vImageのバッファ管理クラス
 */
@class USLVImageBufferRGBX8888;
@interface USLVImageBufferRGBFFF : NSObject
- (instancetype)initWithVImageBufferRGBX8888:(USLVImageBufferRGBX8888 *)src;
- (instancetype)initWithWidth:(size_t)width height:(size_t)height;

- (vImage_Buffer *)vImageBufferR;
- (vImage_Buffer *)vImageBufferG;
- (vImage_Buffer *)vImageBufferB;
@end


text:
PivotPi is a Servo Controller for the Raspberry Pi!

![alt text](https://raw.githubusercontent.com/DexterInd/PivotPi/master/pivotpi-header.jpg)

You will find software support for various programming languages in the **Software** folder

If you are running Raspbian for Robots, you don't need to worry about setting anything up.
If you are running on your own Raspbian card run the install script from the **Install** folder

[You can find the PivotPi Base Kit Servo Controller for the Raspberry Pi here.](https://www.dexterindustries.com/shop/pivotpi-base-kit-servo-controller-for-raspberry-pi/)
[You can find the PivotPi board servo controller for the Raspberry Pi here.](https://www.dexterindustries.com/shop/pivotpi-board/)

[Learn more about the PivotPi here.](http://www.dexterindustries.com/pivotpi)

## Getting Ideas

Need an idea to get started? [We have a few project examples to get your creative juices flowing.](https://github.com/DexterInd/PivotPi/tree/master/Projects)

## Getting Help
Need help? We [have a forum here where you can ask questions or make suggestions](http://forum.dexterindustries.com/c/pivotpi-servo-controller-for-raspberry-pi.

## License

The MIT License (MIT)

PivotPi is a Servo Controller for the Raspberry Pi!
Copyright (C) 2016  Dexter Industries

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


text:
package com.xqbase.util.db;

import java.io.PrintStream;

import com.xqbase.util.Bytes;
import com.xqbase.util.function.Consumer;

public class DumpConsumer implements Consumer<Row>, AutoCloseable {
	private static final int ROWS_PER_LINE = 256;

	private int rows = 0, columns;
	private PrintStream out;
	private String selectSql, insertSql;

	public DumpConsumer(PrintStream out, String table, String... columns) {
		this.out = out;
		this.columns = columns.length;
		StringBuilder sb = new StringBuilder();
		for (String column : columns) {
			sb.append(", " + column);
		}
		String columns_ = sb.substring(2);
		selectSql = "SELECT " + columns_ + " FROM " + table;
		insertSql = "INSERT INTO " + table + " (" + columns_ + ") VALUES ";
		out.println("TRUNCATE TABLE " + table + ";");
	}

	public String getSelectSql() {
		return selectSql;
	}

	@Override
	public void accept(Row row) {
		if (rows % ROWS_PER_LINE == 0) {
			if (rows > 0) {
				out.println(";");
			}
			out.print(insertSql);
		} else {
			out.print(", ");
		}
		rows ++;

		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < columns; i ++) {
			Object o = row.get(i + 1);
			if (o == null) {
				sb.append(", NULL");
			} else if (o instanceof String) {
				sb.append(", '" + ((String) o).replace("\\", "\\\\").
						replace("\'", "\\\'") + "'");
			} else if (o instanceof byte[]) {
				sb.append(", x'" + Bytes.toHexUpper((byte[]) o) + "'");
			} else { // Number
				sb.append(", " + o);
			}
		}
		out.print("(" + sb.substring(2) + ")");
	}

	@Override
	public void close() {
		out.println(";");
	}
}


text:
package org.apache.axis2.description;

import org.apache.axis2.AxisFault;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.woden.WSDLException;
import org.apache.woden.wsdl20.Service;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * Extends the WSDL20ToAxisServiceBuilder class to provide functionality to return
 * multiple AxisService objects; one for each endpoint on each service in the WSDL 2.0 file.
 */
public class WSDL20ToAllAxisServicesBuilder extends WSDL20ToAxisServiceBuilder {
    protected static final Log log =
            LogFactory.getLog(WSDL20ToAllAxisServicesBuilder.class);

    private ArrayList<AxisService> axisServices = null;

    /**
     * Class constructor.
     *
     * @param in - Contains the wsdl 2.0 file
     */
    public WSDL20ToAllAxisServicesBuilder(InputStream in) {
        super(in, null, null);
        axisServices = new ArrayList<AxisService>();   // create an empty ArrayList
    }

    public WSDL20ToAllAxisServicesBuilder(String wsdlUri, String endpointName) throws WSDLException {
        super(wsdlUri, null, endpointName);
        axisServices = new ArrayList<AxisService>();   // create an empty ArrayList
    }

    /**
     * Public method to access the wsdl 2.0 file and create a List of AxisService objects.
     * For each endpoint on each service in the wsdl, an AxisService object is created and
     * added to the List.  The name of the AxisService is changed from the service name
     * to the the following: <service name>#<endpoint name>.  Note that the endpoint name
     * is not unique to a wsdl 2.0 file.  Multiple services in the file may have endpoints
     * with the same name.  Therefore the name of the AxisService needs to be a combination
     * of service/endpoint name to be unique to the wsdl.
     *
     * @return A List containing one AxisService object for each port in the wsdl file.
     *         The name of the AxisService is modified to uniquely represent the service/endpoint
     *         pair.  The format of the name is "<wsdl service name>#<wsdl endpoint name>"
     * @throws AxisFault
     */
    public List<AxisService> populateAllServices() throws AxisFault {
        try {
            if (log.isDebugEnabled()) {
                log.debug("Entry: populateAllServices");
            }
            setup();  // setup contains code with gathers non-service specific info
            // from the WSDL.  This only needs to be done once per WSDL.
            if (description == null) {
                if (log.isDebugEnabled()) {
                    log.debug("Exit: populateAllServices.  wsdl description is null!");
                }
                return null;   // can't go any further without the wsdl
            }
            Service[] services = description.getServices();
            for (int i = 0; i < services.length; i++) {
                Service service = services[i];
                // set the serviceName on the parent to setup call to populateService
                serviceName = service.getName();
                this.axisService = new AxisService();
                    AxisService retAxisService = populateService();
                    if (retAxisService != null) {
                        axisServices.add(retAxisService);
                    } // end if axisService was returned
                } // end for all ports of a service
            if (log.isDebugEnabled()) {
                log.debug("Exit: populateAllServices.");
            }
            return axisServices;
        } catch (AxisFault e) {
            throw e;  // just rethrow any AxisFaults
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug("populateAllServices caught Exception.  Converting to AxisFault. " +
                        e.toString());
            }
            throw AxisFault.makeFault(e);
        }
    }

}