text:
package org.kie.workbench.common.stunner.forms.client.fields.colorPicker;

import javax.enterprise.context.Dependent;
import javax.inject.Inject;

import com.google.gwt.user.client.ui.IsWidget;
import org.kie.workbench.common.forms.dynamic.client.rendering.FieldRenderer;
import org.kie.workbench.common.forms.dynamic.client.rendering.formGroups.FormGroup;
import org.kie.workbench.common.forms.dynamic.client.rendering.formGroups.impl.def.DefaultFormGroup;
import org.kie.workbench.common.forms.dynamic.service.shared.RenderMode;
import org.kie.workbench.common.stunner.forms.model.ColorPickerFieldDefinition;

@Dependent
public class ColorPickerFieldRenderer extends FieldRenderer<ColorPickerFieldDefinition, DefaultFormGroup> {

    private ColorPickerWidget colorPicker;

    @Inject
    public ColorPickerFieldRenderer(final ColorPickerWidget colorPicker) {
        this.colorPicker = colorPicker;
    }

    @Override
    public String getName() {
        return ColorPickerFieldDefinition.FIELD_TYPE.getTypeName();
    }

    @Override
    protected FormGroup getFormGroup(RenderMode renderMode) {
        colorPicker.setReadOnly(!renderingContext.getRenderMode().equals(RenderMode.EDIT_MODE));

        DefaultFormGroup formGroup = formGroupsInstance.get();

        formGroup.render(colorPicker, field);

        return formGroup;
    }

    @Override
    public String getSupportedCode() {
        return ColorPickerFieldDefinition.FIELD_TYPE.getTypeName();
    }

    @Override
    protected void setReadOnly(boolean readOnly) {

    }
}

redpajama_set_name: RedPajamaGithub


text:
    <!-- Bootstrap core JavaScript
     ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <!--<script src="/assets/js/bootstrap.min.js"></script>-->
    <script src="/assets/js/app.js"></script>
</body>
</html>


text:
package com.intellij.dvcs.shelf;

import com.intellij.dvcs.repo.VcsRepositoryMappingListener;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.changes.shelf.ShelvedChangesViewManager;
import org.jetbrains.annotations.NotNull;

public final class ShelfViewUpdater implements VcsRepositoryMappingListener {
  private final Project myProject;

  public ShelfViewUpdater(@NotNull Project project) {
    myProject = project;
  }

  @Override
  public void mappingChanged() {
    ShelvedChangesViewManager.getInstance(myProject).updateOnVcsMappingsChanged();
  }
}


text:
package org.apache.geode.internal.admin.remote;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.geode.DataSerializer;
import org.apache.geode.admin.GemFireHealth;
import org.apache.geode.distributed.internal.DistributionManager;
import org.apache.geode.internal.i18n.LocalizedStrings;

/**
 * A message that is sent to a particular distribution manager to fetch its health diagnosis
 *
 * @since GemFire 3.5
 */
public class FetchHealthDiagnosisRequest extends AdminRequest {
  // instance variables
  private int id = 0;

  private GemFireHealth.Health healthCode = null;

  /**
   * Returns a FetchHealthDiagnosisRequest to be sent to the specified recipient.
   */
  public static FetchHealthDiagnosisRequest create(int id, GemFireHealth.Health healthCode) {
    FetchHealthDiagnosisRequest m = new FetchHealthDiagnosisRequest();
    m.init_(id, healthCode);
    return m;
  }

  public FetchHealthDiagnosisRequest() {
    init_(0, null);
  }

  /**
   * Must return a proper response to this request.
   */
  @Override
  protected AdminResponse createResponse(DistributionManager dm) {
    return FetchHealthDiagnosisResponse.create(dm, this.getSender(), this.id, this.healthCode);
  }

  public int getDSFID() {
    return FETCH_HEALTH_DIAGNOSIS_REQUEST;
  }

  @Override
  public void toData(DataOutput out) throws IOException {
    super.toData(out);
    out.writeInt(this.id);
    DataSerializer.writeObject(this.healthCode, out);
  }

  @Override
  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
    super.fromData(in);
    int i = in.readInt();
    GemFireHealth.Health oHC = (GemFireHealth.Health) DataSerializer.readObject(in);
    init_(i, oHC);
  }

  @Override
  public String toString() {
    return LocalizedStrings.FetchHealthDiagnosisRequest_FETCHHEALTHDIAGNOSISREQUEST_FROM_ID_1_HEALTHCODE_2
        .toLocalizedString(
            new Object[] {this.getRecipient(), Integer.valueOf(this.id), this.healthCode});
  }

  private void init_(int i, GemFireHealth.Health oHC) {
    this.id = i;
    this.healthCode = oHC;
    this.friendlyName =
        LocalizedStrings.FetchHealthDiagnosisRequest_FETCH_HEALTH_DIAGNOSIS_FOR_HEALTH_CODE_0
            .toLocalizedString(this.healthCode);
  }
}


text:
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\DistritoSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Distritos';
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

        <?= Html::a('Create Distrito', ['create'], ['class' => 'btn btn-success']) ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id_distrito',
            'nombre',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>


text:
=begin
    Copyright 2010-2012 Tasos Laskos <tasos.laskos@gmail.com>

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

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

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
=end

#
# Looks for sensitive common files on the server.
#
# @author Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
#
# @version 0.2.2
#
class Arachni::Modules::CommonFiles < Arachni::Module::Base

    def self.filenames
        @filenames ||= read_file( 'filenames.txt' )
    end

    def run
        path = get_path( page.url )
        return if audited?( path )

        self.class.filenames.each { |file| log_remote_file_if_exists( path + file ) }
        audited( path )
    end

    def self.info
        {
            name:        'CommonFiles',
            description: %q{Tries to find common sensitive files on the server.},
            elements:    [ Element::PATH ],
            author:      'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com> ',
            version:     '0.2.2',
            targets:     %w(Generic),
            references: {
                'Apache.org' => 'http://httpd.apache.org/docs/2.0/mod/mod_access.html'
            },
            issue:       {
                name:            %q{A common sensitive file exists on the server.},
                tags:            %w(common path file discovery),
                severity:        Severity::LOW,
                remedy_guidance: %q{Do not expose file and directory information to the user.}
            }
        }
    end

end


text:
package logs

import (
	"encoding/json"
	"fmt"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/request"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
	"github.com/pkg/errors"
	"github.com/stitchfix/flotilla-os/config"
	"github.com/stitchfix/flotilla-os/exceptions"
	"github.com/stitchfix/flotilla-os/state"
	"log"
	"net/http"
	"os"
	"sort"
	"strings"
	awstrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go/aws"
)

//
// EKSCloudWatchLogsClient corresponds with the aws logs driver
// for ECS and returns logs for runs
//
type EKSCloudWatchLogsClient struct {
	logRetentionInDays int64
	logNamespace       string
	logsClient         logsClient
	logger             *log.Logger
}

type EKSCloudWatchLog struct {
	Log string `json:"log"`
}

//
// Name returns the name of the logs client
//
func (lc *EKSCloudWatchLogsClient) Name() string {
	return "eks-cloudwatch"
}

//
// Initialize sets up the EKSCloudWatchLogsClient
//
func (lc *EKSCloudWatchLogsClient) Initialize(conf config.Config) error {
	//confLogOptions := conf.GetStringMapString("eks_log_driver_options")

	awsRegion := conf.GetString("eks_log_driver_options_awslogs_region")
	if len(awsRegion) == 0 {
		awsRegion = conf.GetString("aws_default_region")
	}

	if len(awsRegion) == 0 {
		return errors.Errorf(
			"EKSCloudWatchLogsClient needs one of [eks.log.driver.options.awslogs-region] or [aws_default_region] set in config")
	}

	//
	// log.namespace in conf takes precedence over log.driver.options.awslogs-group
	//
	lc.logNamespace = conf.GetString("eks_log_namespace")

	if len(lc.logNamespace) == 0 {
		return errors.Errorf(
			"EKSCloudWatchLogsClient needs one of [eks.log.driver.options.awslogs-group] or [eks.log.namespace] set in config")
	}

	lc.logRetentionInDays = int64(conf.GetInt("eks_log_retention_days"))
	if lc.logRetentionInDays == 0 {
		lc.logRetentionInDays = int64(30)
	}

	flotillaMode := conf.GetString("flotilla_mode")
	if flotillaMode != "test" {
		sess := awstrace.WrapSession(session.Must(session.NewSession(&aws.Config{
			Region: aws.String(awsRegion)})))

		lc.logsClient = cloudwatchlogs.New(sess)
	}
	lc.logger = log.New(os.Stderr, "[cloudwatchlogs] ",
		log.Ldate|log.Ltime|log.Lshortfile)
	return lc.createNamespaceIfNotExists()
}

//
// Logs returns all logs from the log stream identified by handle since lastSeen
//
func (lc *EKSCloudWatchLogsClient) Logs(executable state.Executable, run state.Run, lastSeen *string, role *string, facility *string) (string, *string, error) {
	startFromHead := true

	//Pod isn't there yet - dont return a 404
	if run.PodName == nil {
		return "", nil, nil
	}
	handle := lc.toStreamName(run)
	args := &cloudwatchlogs.GetLogEventsInput{
		LogGroupName:  &lc.logNamespace,
		LogStreamName: &handle,
		StartFromHead: &startFromHead,
	}

	if lastSeen != nil && len(*lastSeen) > 0 {
		args.NextToken = lastSeen
	}

	result, err := lc.logsClient.GetLogEvents(args)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			if aerr.Code() == cloudwatchlogs.ErrCodeResourceNotFoundException {
				return "", nil, exceptions.MissingResource{err.Error()}
			} else if request.IsErrorThrottle(err) {
				lc.logger.Printf(
					"thottled getting logs; executable_id: %v, run_id: %s, error: %+v\n",
					executable.GetExecutableID(), run.RunID, err)
				return "", lastSeen, nil
			}
		}
		return "", nil, errors.Wrap(err, "problem getting logs")
	}

	if len(result.Events) == 0 {
		return "", result.NextForwardToken, nil
	}

	message := lc.logsToMessage(result.Events)
	return message, result.NextForwardToken, nil
}

// This method doesn't return log string, it is a placeholder only.
func (lc *EKSCloudWatchLogsClient) LogsText(executable state.Executable, run state.Run, w http.ResponseWriter) error {
	return errors.Errorf("EKSCloudWatchLogsClient does not support LogsText method.")
}

// Generate stream name
func (lc *EKSCloudWatchLogsClient) toStreamName(run state.Run) string {
	return fmt.Sprintf("%s", *run.PodName)
}

// Convert Cloudwatch logs to strings
func (lc *EKSCloudWatchLogsClient) logsToMessage(events []*cloudwatchlogs.OutputLogEvent) string {
	sort.Sort(byTimestamp(events))

	messages := make([]string, len(events))
	for i, event := range events {
		var l EKSCloudWatchLog
		err := json.Unmarshal([]byte(*event.Message), &l)
		if err != nil {
			messages[i] = *event.Message
		}
		messages[i] = l.Log
	}
	return strings.Join(messages, "")
}

func (lc *EKSCloudWatchLogsClient) createNamespaceIfNotExists() error {
	exists, err := lc.namespaceExists()
	if err != nil {
		return errors.Wrapf(err, "problem checking if log namespace [%s] exists", lc.logNamespace)
	}
	if !exists {
		return lc.createNamespace()
	}
	return nil
}

// Check for the existence of a namespace.
func (lc *EKSCloudWatchLogsClient) namespaceExists() (bool, error) {
	result, err := lc.logsClient.DescribeLogGroups(&cloudwatchlogs.DescribeLogGroupsInput{
		LogGroupNamePrefix: &lc.logNamespace,
	})

	if err != nil {
		return false, errors.Wrapf(err, "problem describing log groups with prefix [%s]", lc.logNamespace)
	}
	if len(result.LogGroups) == 0 {
		return false, nil
	}
	for _, group := range result.LogGroups {
		if *group.LogGroupName == lc.logNamespace {
			return true, nil
		}
	}
	return false, nil
}

// Creates namespace is not present.
func (lc *EKSCloudWatchLogsClient) createNamespace() error {
	_, err := lc.logsClient.CreateLogGroup(&cloudwatchlogs.CreateLogGroupInput{
		LogGroupName: &lc.logNamespace,
	})
	if err != nil {
		return errors.Wrapf(err, "problem creating log group with log group name [%s]", lc.logNamespace)
	}

	_, err = lc.logsClient.PutRetentionPolicy(&cloudwatchlogs.PutRetentionPolicyInput{
		LogGroupName:    &lc.logNamespace,
		RetentionInDays: &lc.logRetentionInDays,
	})
	if err != nil {
		return errors.Wrapf(err, "problem setting log group retention policy for log group name [%s]", lc.logNamespace)
	}
	return nil
}


text:
"""`vCard <http://tools.ietf.org/html/rfc6350>`_ object that contains
the information in structured form."""
__version__ = '1.0'
__copyright__ = """Copyright 2011 Lance Finn Helsten (helsten@acm.org)"""
__license__ = """
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import sys
if sys.version_info < (3, 2):
    raise Exception("rfc6350 requires Python 3.2 or higher.")
import logging
import re
import string

from .property import *
from .parameter import *
import pyietflib.iso8601

__all__ = ['parse_vcard', 'vCard']
__log__ = logging.getLogger('rfc6350')

def parse_vcard(stream):
    """Given a binary `stream` that is UTF-8 encoded and RFC 6350
    folded parse and return a single vCard from that stream."""
    state = 'start'
    vcard = None
    contentline_parser = None
    for line, linenum in contentline_generator(stream):
        if state == 'content':
            if re.match('^END:VCARD\r\n$', line):
                state = 'end'
                contentline_parser = None
                vcard.validate()
                return vcard
            else:
                assert contentline_parser
                prop = contentline_parser(line, linenum)
                if prop.name not in vcard:
                    vcard[prop.name] = []
                vcard[prop.name].append(prop)

        elif state == 'start':
            if not re.match('^BEGIN:VCARD\r\n$', line):
                raise ValueError('Invalid vCard BEGIN content-line[{0}]: "{1:.30s}...".'.format(linenum, line))
            state = 'version'
            continue

        elif state == 'version':
            mo = re.match(r'^VERSION:(?P<version>.+)\r\n$', line)
            if not mo:
                raise ValueError('Invalid vCard VERSION content-line[{0}]: "{1:.30s}...".'.format(linenum, line))
            state = 'content'
            version = mo.group('version')
            if version == '4.0':
                vcard = vCard()
                contentline_parser = property_from_contentline
            else:
                raise ValueError('Invalid or unknown vCard version {0} on line {1}: "{2:.30s}...".'.format(version, linenum, line))
    raise ValueError('Invalid vCard stream END contentline not found before EOF.')

def contentline_generator(stream):
    """Generate unfolded and decoded content lines from the stream."""
    linenum = 0
    try:
        unfold = None
        unfoldline = 0
        for line in stream:
            linenum = linenum + 1
            if line[-2:] != b'\r\n':
                raise ValueError('Invalid line ending on line {0}: "{1:.30s}...".'.format(linenum, line))
            line = line[:-2]
            if not line[:-2]:
                continue

            if line[0] in b' \t':
                if not unfold:
                    raise ValueError('Invalid line folding on line {0}: "{1:.30s}...".'.format(linenum, line))
                while line[0] in b' \t':
                    line = line[1:]
                unfold.extend(line)
            elif not unfold:
                unfold = bytearray(line)
                unfoldline = linenum
            else:
                unfold.extend(b'\r\n')
                yield (unfold.decode("UTF-8"), unfoldline)
                unfold = bytearray(line)
                unfoldline = linenum
        else:
            if unfold:
                unfold.extend(b'\r\n')
                yield (unfold.decode("UTF-8"), unfoldline)
    except UnicodeDecodeError as err:
        print(line)
        raise ValueError('Invalid UTF-8 encoded stream on line {0}: "{1:.30s}...".'.format(linenum, line))

class vCard(dict):
    """Defines a structured vCard in accordance with `RFC 6350: vCard
    Format Specification <http://tools.ietf.org/html/rfc6350>`_
    that defines version 4 vCard.
    """
    def __init__(self, version='4.0'):
        self.version = version

    def __str__(self):
        raise NotImplementedError()

    def __repr__(self):
        return 'parse_vcard(r"""{0}""")'.format(str(self))

    def validate(self):
        """Check that the vCard is valid IAW RFC 6350."""
        if len(self) == 0:
            raise ValueError("Invalid vCard: a property is required.")


text:
.. tracking documentation documentation master file, created by
   sphinx-quickstart on Fri May 10 18:35:14 2013.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

tracking documentation
==========================

**Links:**
    * `GitHub/pymyinstall <https://github.com/sdpython/python_project_template/>`_
    * `documentation <http://www.xavierdupre.fr/site2013/index_code.html#python_project_template>`_

Introduction
------------

This project is a template to start a new project. See :ref:`l-README`.

Quick overview
--------------

* **Example**
    * example:  :class:`myclass <subproject.myexample.myclass>`

About this documentation
------------------------

.. toctree::
    :maxdepth: 1

    doctestunit
    generatedoc
    generatesetup
    installation
    all_example
    all_FAQ
    all_notebooks
    glossary
    index_module

Indices and tables
==================

+------------------+---------------------+--------------------+------------------+------------------------+---------------------+
| :ref:`l-modules` |  :ref:`l-functions` | :ref:`l-classes`   | :ref:`l-methods` | :ref:`l-staticmethods` | :ref:`l-properties` |
+------------------+---------------------+--------------------+------------------+------------------------+---------------------+
| :ref:`genindex`  |  :ref:`modindex`    | :ref:`search`      | :ref:`l-license` | :ref:`l-changes`       | :ref:`l-README`     |
+------------------+---------------------+--------------------+------------------+------------------------+---------------------+
| :ref:`l-example` |  :ref:`l-FAQ`       | :ref:`ext-tohelp`  |                  |                        |                     |
+------------------+---------------------+--------------------+------------------+------------------------+---------------------+


text:
all: rotor.stl stator.stl stator_hollow.stl nose.stl stator_rigid.stl \
  left_stator_rigid.stl right_stator_rigid.stl nema17_mount.stl \
  oldham_byj_shaft.stl oldham_m5_shaft.stl steel_rotor.stl

rotor.stl: rotor.scad moineau.scad
	openscad -o rotor.stl rotor.scad

steel_rotor.stl: steel_rotor.scad moineau.scad
	openscad -o steel_rotor.stl steel_rotor.scad

stator.stl: stator.scad moineau.scad
	openscad -o stator.stl stator.scad

stator_rigid.stl: stator_rigid.scad moineau.scad
	openscad -o stator_rigid.stl stator_rigid.scad

left_stator_rigid.stl: left_stator_rigid.scad moineau.scad
	openscad -o left_stator_rigid.stl left_stator_rigid.scad

right_stator_rigid.stl: right_stator_rigid.scad moineau.scad
	openscad -o right_stator_rigid.stl right_stator_rigid.scad

stator_hollow.stl: stator_hollow.scad moineau.scad
	openscad -o stator_hollow.stl stator_hollow.scad

nose.stl: nose.scad moineau.scad
	openscad -o nose.stl nose.scad

nema17_mount.stl: nema17_mount.scad
	openscad -o nema17_mount.stl nema17_mount.scad

oldham_byj_shaft.stl: oldham_byj_shaft.scad
	openscad -o oldham_byj_shaft.stl oldham_byj_shaft.scad

oldham_m5_shaft.stl: oldham_m5_shaft.scad
	openscad -o oldham_m5_shaft.stl oldham_m5_shaft.scad

.PHONY: clean all

clean:
	rm -f *.stl


text:
var express = require('express');
var routerP = express.Router(),
    routerU = express.Router();
var async = require('async');
var dateFormat = require('dateformat');

routerU.get('/', function(req, res, next) {
    res.redirect('/v2/dreamcloud/mf/workflows?users');
});

routerU.get('/:id', function(req, res, next) {
    res.redirect('/v2/dreamcloud/mf/workflows/' + req.params.id + '?users');
});

/**
 * @api {put} /users/:userID 1. Registers a new user
 * @apiVersion 2.0.0
 * @apiName PutUsers
 * @apiGroup Users
 *
 * @apiParam {String} userID identifier for a user, e.g. 'excess'
 *
 * @apiExample {curl} Example usage:
 *     curl -i http://mf.excess-project.eu:3030/v2/mf/users/hpcfapix
 *
 * @apiParamExample {json} Request-Example:
 *     {
 *       "name": "Fangli Pi",
 *       "affiliation": "HLRS",
 *       "applications": [
 *          "avx"
 *       ]
 *     }
 *
 * @apiParam {String} [name] name of the user
 * @apiParam {String} [affiliation] affiliation of the user
 * @apiParam {Array}  [applications] list of applications to be monitored
 *
 * @apiSuccess {String} href link to the data stored for the given user
 *
 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
 *     {
 *          "href":"http://mf.excess-project.eu:3030/v2/mf/users/hpcfapix"
 *     }
 *
 * @apiError DatabaseError The given user could not be registered at the database
 *
 * @apiErrorExample Error-Response:
 *     HTTP/1.1 500 Internal Server Error
 *     {
 *       "error": "Resource could not be stored."
 *     }
 */
routerP.put('/:id', function(req, res, next) {
    var id = req.params.id.toLowerCase(),
        mf_server = req.app.get('mf_server') + '/mf',
        client = req.app.get('elastic');

    client.index({
        index: 'mf',
        type: 'workflows',
        id: id,
        body: req.body
    }, function(error, response) {
        if (error) {
            var message = 'Resource could not be stored.';
            console.log(error);
            res.status(500);
            return next(message);
        }
        var json = {};
        json.href = mf_server + '/users/' + id;
        res.json(json);
    });
});

function is_defined(variable) {
    return (typeof variable !== 'undefined');
}

/**
 * @api {post} /users/:userID/create 2. Create a user and an associated experiment
 * @apiVersion 2.0.0
 * @apiName PostUsers
 * @apiGroup Users
 *
 * @apiParam {String} userID identifier for a user, e.g. 'excess'
 * @apiSuccess {String} experimentID unique identifier generated for the experiment
 *
 * @apiExample {curl} Example usage:
 *     curl -i http://mf.excess-project.eu:3030/v2/mf/users/hpcfapix/create
 *
 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
 *     AVX9O-3oz5chEwIt8_M9
 *
 */
routerP.post('/:id/create', function(req, res, next) {
    var id = req.params.id.toLowerCase(),
        client = req.app.get('elastic');

    var data = req.body;
    if (data.application) {
        data.application = data.application.replace(' ', '_');
    }
    var experiment_id;

    var created_on = {};
    var now = new Date();
    now = dateFormat(now, "yyyy-mm-dd'T'HH:MM:ss");
    created_on.created_on = now;

    if (!is_defined(data['@timestamp'])) {
        data['@timestamp'] = now;
    }

    async.series([
        /* (1) register workflow, if not exists yet */
        function(series_callback) {
            client.index({
                index: 'mf',
                type: 'workflows',
                id: id,
                body: created_on
            }, function(error, response) {
                if (error) {
                    return series_callback(error);
                }

                series_callback(null);
            });
        },
        /* (2) create experiment ID on the fly */
        function(series_callback) {
            client.index({
                index: 'mf',
                type: 'experiments',
                parent: id,
                body: data
            }, function(error, response) {
                if (error) {
                    res.json(error);
                } else {
                    experiment_id = response._id;
                    series_callback(null);
                }
            });
        },
    ], function(error) {
        if (error) {
            res.status(500);
            return next(error);
        }
        res.send(experiment_id);
    });
});

/**
 * @api {post} /users/:userID/:experimentID/create 3. Create a user and an associated experiment with given experiment ID
 * @apiVersion 2.0.0
 * @apiName PostUserExperiment
 * @apiGroup Users
 *
 * @apiParam {String} userID identifier for a user, e.g. 'excess'
 * @apiParam {String} experimentID identifier given for the experiment
 * @apiSuccess {String} experimentID identifier given for the experiment
 *
 * @apiExample {curl} Example usage:
 *     curl -i http://mf.excess-project.eu:3030/v2/mf/users/hpcfapix/AVX9O-3oz5chEwIt8_M9/create
 *
 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
 *
 *          AVX9O-3oz5chEwIt8_M9
 *
 *
 */
routerP.post('/:uid/:eid/create', function(req, res, next) {
    var uid = req.params.uid.toLowerCase(),
        eid = req.params.eid,
        client = req.app.get('elastic');

    var data = req.body;
    if (data.application) {
        data.application = data.application.replace(' ', '_');
    }
    var experiment_id;

    var created_on = {};
    var now = new Date();
    now = dateFormat(now, "yyyy-mm-dd'T'HH:MM:ss");
    created_on.created_on = now;

    if (!is_defined(data['@timestamp'])) {
        data['@timestamp'] = now;
    }

    async.series([
        /* (1) register workflow, if not exists yet */
        function(series_callback) {
            client.index({
                index: 'mf',
                type: 'workflows',
                id: uid,
                body: created_on
            }, function(error, response) {
                if (error) {
                    return series_callback(error);
                }

                series_callback(null);
            });
        },
        /* (2) create experiment ID on the fly */
        function(series_callback) {
            client.exists({
                index: 'mf',
                type: 'experiments',
                id: eid,
                routing: uid
            }, function (error, exists) {
                if (exists === true) {
                    experiment_id = eid;
                    series_callback(null);
                } else {
                    client.index({
                        index: 'mf',
                        type: 'experiments',
                        parent: uid,
                        id: eid,
                        body: data
                    }, function(error, response){
                        if(error) {
                            res.json(error);
                        } else {
                            experiment_id = response._id;
                            series_callback(null);
                        }
                    });
                }
            });
        }
    ], function(error) {
        if (error) {
            res.status(500);
            return next(error);
        }
        res.send(experiment_id);
    });
});

module.exports = {
    protected: routerP,
    unprotected: routerU
};


text:
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: release/9.1.0/sys/kern/subr_trap.c 237719 2012-06-28 18:38:24Z jhb $");

#include "opt_capsicum.h"
#include "opt_hwpmc_hooks.h"
#include "opt_ktrace.h"
#include "opt_kdtrace.h"
#include "opt_sched.h"

#include <sys/param.h>
#include <sys/bus.h>
#include <sys/capability.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/pmckern.h>
#include <sys/proc.h>
#include <sys/ktr.h>
#include <sys/pioctl.h>
#include <sys/ptrace.h>
#include <sys/resourcevar.h>
#include <sys/sched.h>
#include <sys/signalvar.h>
#include <sys/syscall.h>
#include <sys/syscallsubr.h>
#include <sys/sysent.h>
#include <sys/systm.h>
#include <sys/vmmeter.h>
#ifdef KTRACE
#include <sys/uio.h>
#include <sys/ktrace.h>
#endif
#include <security/audit/audit.h>

#include <machine/cpu.h>

#ifdef VIMAGE
#include <net/vnet.h>
#endif

#ifdef XEN
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
#endif

#ifdef	HWPMC_HOOKS
#include <sys/pmckern.h>
#endif

#include <security/mac/mac_framework.h>

/*
 * Define the code needed before returning to user mode, for trap and
 * syscall.
 */
void
userret(struct thread *td, struct trapframe *frame)
{
	struct proc *p = td->td_proc;

	CTR3(KTR_SYSC, "userret: thread %p (pid %d, %s)", td, p->p_pid,
            td->td_name);
	KASSERT((p->p_flag & P_WEXIT) == 0,
	    ("Exiting process returns to usermode"));
#if 0
#ifdef DIAGNOSTIC
	/* Check that we called signotify() enough. */
	PROC_LOCK(p);
	thread_lock(td);
	if (SIGPENDING(td) && ((td->td_flags & TDF_NEEDSIGCHK) == 0 ||
	    (td->td_flags & TDF_ASTPENDING) == 0))
		printf("failed to set signal flags properly for ast()\n");
	thread_unlock(td);
	PROC_UNLOCK(p);
#endif
#endif
#ifdef KTRACE
	KTRUSERRET(td);
#endif
	/*
	 * If this thread tickled GEOM, we need to wait for the giggling to
	 * stop before we return to userland
	 */
	if (td->td_pflags & TDP_GEOM)
		g_waitidle();

	/*
	 * Charge system time if profiling.
	 */
	if (p->p_flag & P_PROFIL)
		addupc_task(td, TRAPF_PC(frame), td->td_pticks * psratio);
	/*
	 * Let the scheduler adjust our priority etc.
	 */
	sched_userret(td);
	KASSERT(td->td_locks == 0,
	    ("userret: Returning with %d locks held.", td->td_locks));
#ifdef VIMAGE
	/* Unfortunately td_vnet_lpush needs VNET_DEBUG. */
	VNET_ASSERT(curvnet == NULL,
	    ("%s: Returning on td %p (pid %d, %s) with vnet %p set in %s",
	    __func__, td, p->p_pid, td->td_name, curvnet,
	    (td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A"));
#endif
#ifdef XEN
	PT_UPDATES_FLUSH();
#endif
}

/*
 * Process an asynchronous software trap.
 * This is relatively easy.
 * This function will return with preemption disabled.
 */
void
ast(struct trapframe *framep)
{
	struct thread *td;
	struct proc *p;
	int flags;
	int sig;

	td = curthread;
	p = td->td_proc;

	CTR3(KTR_SYSC, "ast: thread %p (pid %d, %s)", td, p->p_pid,
            p->p_comm);
	KASSERT(TRAPF_USERMODE(framep), ("ast in kernel mode"));
	WITNESS_WARN(WARN_PANIC, NULL, "Returning to user mode");
	mtx_assert(&Giant, MA_NOTOWNED);
	THREAD_LOCK_ASSERT(td, MA_NOTOWNED);
	td->td_frame = framep;
	td->td_pticks = 0;

	/*
	 * This updates the td_flag's for the checks below in one
	 * "atomic" operation with turning off the astpending flag.
	 * If another AST is triggered while we are handling the
	 * AST's saved in flags, the astpending flag will be set and
	 * ast() will be called again.
	 */
	thread_lock(td);
	flags = td->td_flags;
	td->td_flags &= ~(TDF_ASTPENDING | TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK |
	    TDF_NEEDRESCHED | TDF_ALRMPEND | TDF_PROFPEND | TDF_MACPEND);
	thread_unlock(td);
	PCPU_INC(cnt.v_trap);

	if (td->td_ucred != p->p_ucred)
		cred_update_thread(td);
	if (td->td_pflags & TDP_OWEUPC && p->p_flag & P_PROFIL) {
		addupc_task(td, td->td_profil_addr, td->td_profil_ticks);
		td->td_profil_ticks = 0;
		td->td_pflags &= ~TDP_OWEUPC;
	}
#ifdef HWPMC_HOOKS
	/* Handle Software PMC callchain capture. */
	if (PMC_IS_PENDING_CALLCHAIN(td))
		PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_USER_CALLCHAIN_SOFT, (void *) framep);
#endif
	if (flags & TDF_ALRMPEND) {
		PROC_LOCK(p);
		kern_psignal(p, SIGVTALRM);
		PROC_UNLOCK(p);
	}
	if (flags & TDF_PROFPEND) {
		PROC_LOCK(p);
		kern_psignal(p, SIGPROF);
		PROC_UNLOCK(p);
	}
#ifdef MAC
	if (flags & TDF_MACPEND)
		mac_thread_userret(td);
#endif
	if (flags & TDF_NEEDRESCHED) {
#ifdef KTRACE
		if (KTRPOINT(td, KTR_CSW))
			ktrcsw(1, 1, __func__);
#endif
		thread_lock(td);
		sched_prio(td, td->td_user_pri);
		mi_switch(SW_INVOL | SWT_NEEDRESCHED, NULL);
		thread_unlock(td);
#ifdef KTRACE
		if (KTRPOINT(td, KTR_CSW))
			ktrcsw(0, 1, __func__);
#endif
	}

	/*
	 * Check for signals. Unlocked reads of p_pendingcnt or
	 * p_siglist might cause process-directed signal to be handled
	 * later.
	 */
	if (flags & TDF_NEEDSIGCHK || p->p_pendingcnt > 0 ||
	    !SIGISEMPTY(p->p_siglist)) {
		PROC_LOCK(p);
		mtx_lock(&p->p_sigacts->ps_mtx);
		while ((sig = cursig(td, SIG_STOP_ALLOWED)) != 0)
			postsig(sig);
		mtx_unlock(&p->p_sigacts->ps_mtx);
		PROC_UNLOCK(p);
	}
	/*
	 * We need to check to see if we have to exit or wait due to a
	 * single threading requirement or some other STOP condition.
	 */
	if (flags & TDF_NEEDSUSPCHK) {
		PROC_LOCK(p);
		thread_suspend_check(0);
		PROC_UNLOCK(p);
	}

	if (td->td_pflags & TDP_OLDMASK) {
		td->td_pflags &= ~TDP_OLDMASK;
		kern_sigprocmask(td, SIG_SETMASK, &td->td_oldsigmask, NULL, 0);
	}

	userret(td, framep);
	mtx_assert(&Giant, MA_NOTOWNED);
}

const char *
syscallname(struct proc *p, u_int code)
{
	static const char unknown[] = "unknown";
	struct sysentvec *sv;

	sv = p->p_sysent;
	if (sv->sv_syscallnames == NULL || code >= sv->sv_size)
		return (unknown);
	return (sv->sv_syscallnames[code]);
}


text:
import sys
import argparse
import ConfigParser

from provision_bgp import BgpProvisioner
from vnc_api.vnc_api import *

class ControlProvisioner(object):

    def __init__(self, args_str=None):
        self._args = None
        if not args_str:
            args_str = ' '.join(sys.argv[1:])
        self._parse_args(args_str)

        if self._args.router_asn and not self._args.oper:
            self._vnc_lib = VncApi(
            self._args.admin_user, self._args.admin_password, self._args.admin_tenant_name,
            self._args.api_server_ip,
            self._args.api_server_port, '/')
            # Update global system config also with this ASN
            gsc_obj = self._vnc_lib.global_system_config_read(
                  fq_name=['default-global-system-config'])
            gsc_obj.set_autonomous_system(self._args.router_asn)
            if self._args.ibgp_auto_mesh is not None:
                gsc_obj.set_ibgp_auto_mesh(self._args.ibgp_auto_mesh)
            self._vnc_lib.global_system_config_update(gsc_obj)
            return

        bp_obj = BgpProvisioner(
            self._args.admin_user, self._args.admin_password,
            self._args.admin_tenant_name,
            self._args.api_server_ip, self._args.api_server_port)

        if self._args.oper == 'add':
            bp_obj.add_bgp_router('contrail', self._args.host_name,
                                  self._args.host_ip, self._args.router_asn)
        elif self._args.oper == 'del':
            bp_obj.del_bgp_router(self._args.host_name)
        else:
            print "Unknown operation %s. Only 'add' and 'del' supported"\
                % (self._args.oper)

    # end __init__

    def _parse_args(self, args_str):
        '''
        Eg. python provision_control.py --host_name a3s30.contrail.juniper.net
                                        --host_ip 10.1.1.1
                                        --router_asn 64512
                                        --ibgp_auto_mesh|--no_ibgp_auto_mesh
                                        --api_server_ip 127.0.0.1
                                        --api_server_port 8082
                                        --oper <add | del>
        '''

        # Source any specified config/ini file
        # Turn off help, so we print all options in response to -h
        conf_parser = argparse.ArgumentParser(add_help=False)

        conf_parser.add_argument("-c", "--conf_file",
                                 help="Specify config file", metavar="FILE")
        args, remaining_argv = conf_parser.parse_known_args(args_str.split())

        defaults = {
            'router_asn': '64512',
            'ibgp_auto_mesh': None,
            'api_server_ip': '127.0.0.1',
            'api_server_port': '8082',
            'oper': None,
            'admin_user': None,
            'admin_password': None,
            'admin_tenant_name': None
        }

        if args.conf_file:
            config = ConfigParser.SafeConfigParser()
            config.read([args.conf_file])
            defaults.update(dict(config.items("DEFAULTS")))

        # Override with CLI options
        # Don't surpress add_help here so it will handle -h
        parser = argparse.ArgumentParser(
            # Inherit options from config_parser
            parents=[conf_parser],
            # print script description with -h/--help
            description=__doc__,
            # Don't mess with format of description
            formatter_class=argparse.RawDescriptionHelpFormatter,
        )
        parser.set_defaults(**defaults)

        parser.add_argument(
            "--host_name", help="hostname name of control-node")
        parser.add_argument("--host_ip", help="IP address of control-node")
        parser.add_argument(
            "--router_asn", help="AS Number the control-node is in", required=True)
        parser.add_argument(
            "--ibgp_auto_mesh", help="Create iBGP mesh automatically", dest='ibgp_auto_mesh', action='store_true')
        parser.add_argument(
            "--no_ibgp_auto_mesh", help="Don't create iBGP mesh automatically", dest='ibgp_auto_mesh', action='store_false')
        parser.add_argument(
            "--api_server_ip", help="IP address of api server", required=True)
        parser.add_argument("--api_server_port", help="Port of api server", required=True)
        parser.add_argument(
            "--oper",
            help="Provision operation to be done(add or del)")
        parser.add_argument(
            "--admin_user", help="Name of keystone admin user")
        parser.add_argument(
            "--admin_password", help="Password of keystone admin user")
        parser.add_argument(
            "--admin_tenant_name", help="Tenamt name for keystone admin user")

        self._args = parser.parse_args(remaining_argv)

    # end _parse_args

# end class ControlProvisioner

def main(args_str=None):
    ControlProvisioner(args_str)
# end main

if __name__ == "__main__":
    main()


text:
from prometheus_client import Counter

# Prometheus metrics
failed_logins_total = Counter('failed_logins_total',
                              'Failed logins',
                              labelnames=['app_name', ])

succeeded_logins_total = Counter('succeeded_logins_total',
                                 'Succeeded logins',
                                 labelnames=['app_name', ])

password_reset_requests_total = Counter('password_reset_requests_total',
                                        'Password reset requests',
                                        labelnames=['app_name', ])

password_resets_total = Counter('password_resets_total',
                                'Password resets',
                                labelnames=['app_name', ])

impersonations_total = Counter('impersonations_total',
                               'Impersonations',
                               labelnames=['app_name', ])

logouts_total = Counter('logouts_total',
                               'Logouts',
                               labelnames=['app_name', ])

def _add_constant_context(context):
    context['app_name'] = "wiggum"
    return context

def inc_failed_login(context={}):
    context = _add_constant_context(context)
    failed_logins_total.labels(context).inc()

def inc_succeeded_login(context={}):
    context = _add_constant_context(context)
    succeeded_logins_total.labels(context).inc()

def inc_password_reset_requests(context={}):
    context = _add_constant_context(context)
    password_reset_requests_total.labels(context).inc()

def inc_password_resets(context={}):
    context = _add_constant_context(context)
    password_resets_total.labels(context).inc()

def inc_impersonations(context={}):
    context = _add_constant_context(context)
    impersonations_total.labels(context).inc()

def inc_logouts(context={}):
    context = _add_constant_context(context)
    logouts_total.labels(context).inc()


text:
.class Lorg/simpleframework/xml/transform/ClassTransform;
.super Ljava/lang/Object;
.source "ClassTransform.java"

# interfaces
.implements Lorg/simpleframework/xml/transform/Transform;

# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lorg/simpleframework/xml/transform/Transform",
        "<",
        "Ljava/lang/Class;",
        ">;"
    }
.end annotation

# static fields
.field private static final BOOLEAN:Ljava/lang/String; = "boolean"

.field private static final BYTE:Ljava/lang/String; = "byte"

.field private static final CHARACTER:Ljava/lang/String; = "char"

.field private static final DOUBLE:Ljava/lang/String; = "double"

.field private static final FLOAT:Ljava/lang/String; = "float"

.field private static final INTEGER:Ljava/lang/String; = "int"

.field private static final LONG:Ljava/lang/String; = "long"

.field private static final SHORT:Ljava/lang/String; = "short"

.field private static final VOID:Ljava/lang/String; = "void"

# direct methods
.method constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private getCallerClassLoader()Ljava/lang/ClassLoader;
    .locals 1

    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;

    move-result-object v0

    return-object v0
.end method

.method private static getClassLoader()Ljava/lang/ClassLoader;
    .locals 1

    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Thread;->getContextClassLoader()Ljava/lang/ClassLoader;

    move-result-object v0

    return-object v0
.end method

.method private readPrimitive(Ljava/lang/String;)Ljava/lang/Class;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    const-string/jumbo v0, "byte"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string/jumbo v0, "short"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_1

    const-string/jumbo v0, "int"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_2

    const-string/jumbo v0, "long"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_3

    const-string/jumbo v0, "char"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_4

    const-string/jumbo v0, "float"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_5

    const-string/jumbo v0, "double"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_6

    const-string/jumbo v0, "boolean"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_7

    const-string/jumbo v0, "void"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_8

    const/4 v0, 0x0

    return-object v0

    :cond_0
    sget-object v0, Ljava/lang/Byte;->TYPE:Ljava/lang/Class;

    return-object v0

    :cond_1
    sget-object v0, Ljava/lang/Short;->TYPE:Ljava/lang/Class;

    return-object v0

    :cond_2
    sget-object v0, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;

    return-object v0

    :cond_3
    sget-object v0, Ljava/lang/Long;->TYPE:Ljava/lang/Class;

    return-object v0

    :cond_4
    sget-object v0, Ljava/lang/Character;->TYPE:Ljava/lang/Class;

    return-object v0

    :cond_5
    sget-object v0, Ljava/lang/Float;->TYPE:Ljava/lang/Class;

    return-object v0

    :cond_6
    sget-object v0, Ljava/lang/Double;->TYPE:Ljava/lang/Class;

    return-object v0

    :cond_7
    sget-object v0, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;

    return-object v0

    :cond_8
    sget-object v0, Ljava/lang/Void;->TYPE:Ljava/lang/Class;

    return-object v0
.end method

# virtual methods
.method public read(Ljava/lang/String;)Ljava/lang/Class;
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    invoke-direct {p0, p1}, Lorg/simpleframework/xml/transform/ClassTransform;->readPrimitive(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v1

    if-eqz v1, :cond_0

    return-object v1

    :cond_0
    invoke-static {}, Lorg/simpleframework/xml/transform/ClassTransform;->getClassLoader()Ljava/lang/ClassLoader;

    move-result-object v0

    if-eqz v0, :cond_1

    :goto_0
    invoke-virtual {v0, p1}, Ljava/lang/ClassLoader;->loadClass(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v2

    return-object v2

    :cond_1
    invoke-direct {p0}, Lorg/simpleframework/xml/transform/ClassTransform;->getCallerClassLoader()Ljava/lang/ClassLoader;

    move-result-object v0

    goto :goto_0
.end method

.method public bridge synthetic read(Ljava/lang/String;)Ljava/lang/Object;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    invoke-virtual {p0, p1}, Lorg/simpleframework/xml/transform/ClassTransform;->read(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    return-object v0
.end method

.method public write(Ljava/lang/Class;)Ljava/lang/String;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    invoke-virtual {p1}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public bridge synthetic write(Ljava/lang/Object;)Ljava/lang/String;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    check-cast p1, Ljava/lang/Class;

    invoke-virtual {p0, p1}, Lorg/simpleframework/xml/transform/ClassTransform;->write(Ljava/lang/Class;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method


text:
// viewport.js
// Run the hexagram visualizer client.

import '/imports/lib/color';
import colorMix from '/imports/mapPage/color/colorMix';
import coords from '/imports/mapPage/viewport/coords';
import hexagons from '/imports/mapPage/viewport/hexagons';
import nodes from '/imports/mapPage/viewport/nodes'
import rx from '/imports/common/rx';
import tool from '/imports/mapPage/head/tool';

exports.create = function  () {

    // Set the map options.
    var mapOptions = {
        center: ctx.center,
        backgroundColor: rx.get('background'),
        zoom: rx.get('zoom'),
        mapTypeId: "blank",
        // Don't show a map type picker.
        mapTypeControlOptions: {
            mapTypeIds: []
        },
        minZoom: 2,
        /*
        use a data layer to draw polygons. faster per
        https://stackoverflow.com/questions/37109726/google-maps-polygons-slowing-down-the-browser
        map.data.add({
            geometry: new google.maps.Data.Polygon([coords])})
         */

        // Or a street view man that lets you walk around various Earth places.
        streetViewControl: false
    };

    // Create the actual map.
    GoogleMaps.create({
        name: 'googlemap',
        options: mapOptions,
        element: document.getElementById("visualization"),
    });
    googlemap = GoogleMaps.maps.googlemap.instance;

    // Attach the blank map type to the map
    googlemap.mapTypes.set("blank", new coords.BlankMap());

    // Set the proper transparency of nodes.
    if (rx.get('mapView') === 'xyCoords') {
        rx.set('transparent.on')
    }

    google.maps.event.addListener(googlemap, "center_changed", function() {
        ctx.center = googlemap.getCenter();
    });

    // We also have an event listener that checks when the zoom level changes,
    // and turns off hex borders if we zoom out far enough, and turns them on
    // again if we come back.
    google.maps.event.addListener(googlemap, "zoom_changed", function() {
        // Get the current zoom level (low is out)
        rx.set('zoom.set', {value: googlemap.getZoom()})
        nodes.zoomChanged();
    });

    // Listen to mouse events on this map
    tool.subscribe_listeners(googlemap);
};

exports.init = function () {

    // Initialize the google map and create the hexagon assignments
    exports.create();
    nodes.create();
    colorMix.refreshColors();
};


text:
package com.ibm.jbatch.tck.artifacts.specialized;

import java.util.logging.Logger;

import javax.batch.api.chunk.listener.RetryProcessListener;
import javax.batch.runtime.context.JobContext;
import javax.inject.Inject;

import org.testng.Reporter;

@javax.inject.Named("myRetryProcessListener")
public class MyRetryProcessListener implements RetryProcessListener {
	 private final static String sourceClass = MyRetryProcessListener.class.getName();
	    private final static Logger logger = Logger.getLogger(sourceClass);

	    @Inject
	    JobContext jobCtx;

	    @Override
	    public void onRetryProcessException(Object o, Exception e) {
	    	Reporter.log("In onRetryProcessException()" + e);
	    	jobCtx.setExitStatus("Retry listener invoked");
	    }
}


text:
// NOTE: This file was generated by the ServiceGenerator.

// ----------------------------------------------------------------------------
// API:
//   Google Keep API (keep/v1)
// Description:
//   The Google Keep API is used in an enterprise environment to manage Google
//   Keep content and resolve issues identified by cloud security software.
// Documentation:
//   https://developers.google.com/keep/api

#import <GoogleAPIClientForREST/GTLRObject.h>

#if GTLR_RUNTIME_VERSION != 3000
#error This file was generated by a different version of ServiceGenerator which is incompatible with this GTLR library source.
#endif

@class GTLRKeep_Attachment;
@class GTLRKeep_CreatePermissionRequest;
@class GTLRKeep_Family;
@class GTLRKeep_Group;
@class GTLRKeep_ListContent;
@class GTLRKeep_ListItem;
@class GTLRKeep_Note;
@class GTLRKeep_Permission;
@class GTLRKeep_Section;
@class GTLRKeep_TextContent;
@class GTLRKeep_User;

// Generated comments include content from the discovery document; avoid them
// causing warnings since clang's checks are some what arbitrary.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"

NS_ASSUME_NONNULL_BEGIN

// ----------------------------------------------------------------------------
// Constants - For some of the classes' properties below.

// ----------------------------------------------------------------------------
// GTLRKeep_Permission.role

/**
 *  A role granting full access. This role cannot be added or removed. Defined
 *  by the creator of the note.
 *
 *  Value: "OWNER"
 */
FOUNDATION_EXTERN NSString * const kGTLRKeep_Permission_Role_Owner;
/**
 *  An undefined role.
 *
 *  Value: "ROLE_UNSPECIFIED"
 */
FOUNDATION_EXTERN NSString * const kGTLRKeep_Permission_Role_RoleUnspecified;
/**
 *  A role granting the ability to contribute content and modify note
 *  permissions.
 *
 *  Value: "WRITER"
 */
FOUNDATION_EXTERN NSString * const kGTLRKeep_Permission_Role_Writer;

/**
 *  An attachment to a note.
 */
@interface GTLRKeep_Attachment : GTLRObject

/** The MIME types (IANA media types) in which the attachment is available. */
@property(nonatomic, strong, nullable) NSArray<NSString *> *mimeType;

/** The resource name; */
@property(nonatomic, copy, nullable) NSString *name;

@end

/**
 *  The request to add one or more permissions on the note. Currently, only the
 *  `WRITER` role may be specified. If adding a permission fails, then the
 *  entire request fails and no changes are made.
 */
@interface GTLRKeep_BatchCreatePermissionsRequest : GTLRObject

/** The request message specifying the resources to create. */
@property(nonatomic, strong, nullable) NSArray<GTLRKeep_CreatePermissionRequest *> *requests;

@end

/**
 *  The response for creating permissions on a note.
 */
@interface GTLRKeep_BatchCreatePermissionsResponse : GTLRObject

/** Permissions created. */
@property(nonatomic, strong, nullable) NSArray<GTLRKeep_Permission *> *permissions;

@end

/**
 *  The request to remove one or more permissions from a note. A permission with
 *  the `OWNER` role can't be removed. If removing a permission fails, then the
 *  entire request fails and no changes are made. Returns a 400 bad request
 *  error if a specified permission does not exist on the note.
 */
@interface GTLRKeep_BatchDeletePermissionsRequest : GTLRObject

/**
 *  Required. The names of the permissions to delete. Format:
 *  `notes/{note}/permissions/{permission}`
 */
@property(nonatomic, strong, nullable) NSArray<NSString *> *names;

@end

/**
 *  The request to add a single permission on the note.
 */
@interface GTLRKeep_CreatePermissionRequest : GTLRObject

/**
 *  Required. The parent note where this permission will be created. Format:
 *  `notes/{note}`
 */
@property(nonatomic, copy, nullable) NSString *parent;

/**
 *  Required. The permission to create. One of Permission.email, User.email or
 *  Group.email must be supplied.
 */
@property(nonatomic, strong, nullable) GTLRKeep_Permission *permission;

@end

/**
 *  A generic empty message that you can re-use to avoid defining duplicated
 *  empty messages in your APIs. A typical example is to use it as the request
 *  or the response type of an API method. For instance: service Foo { rpc
 *  Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
 */
@interface GTLRKeep_Empty : GTLRObject
@end

/**
 *  Describes a single Google Family.
 */
@interface GTLRKeep_Family : GTLRObject
@end

/**
 *  Describes a single Group.
 */
@interface GTLRKeep_Group : GTLRObject

/** The group email. */
@property(nonatomic, copy, nullable) NSString *email;

@end

/**
 *  The list of items for a single list note.
 */
@interface GTLRKeep_ListContent : GTLRObject

/** The items in the list. The number of items must be less than 1,000. */
@property(nonatomic, strong, nullable) NSArray<GTLRKeep_ListItem *> *listItems;

@end

/**
 *  A single list item in a note's list.
 */
@interface GTLRKeep_ListItem : GTLRObject

/**
 *  Whether this item has been checked off or not.
 *
 *  Uses NSNumber of boolValue.
 */
@property(nonatomic, strong, nullable) NSNumber *checked;

/**
 *  If set, list of list items nested under this list item. Only one level of
 *  nesting is allowed.
 */
@property(nonatomic, strong, nullable) NSArray<GTLRKeep_ListItem *> *childListItems;

/** The text of this item. Length must be less than 1,000 characters. */
@property(nonatomic, strong, nullable) GTLRKeep_TextContent *text;

@end

/**
 *  The response when listing a page of notes.
 *
 *  @note This class supports NSFastEnumeration and indexed subscripting over
 *        its "notes" property. If returned as the result of a query, it should
 *        support automatic pagination (when @c shouldFetchNextPages is
 *        enabled).
 */
@interface GTLRKeep_ListNotesResponse : GTLRCollectionObject

/** Next page's `page_token` field. */
@property(nonatomic, copy, nullable) NSString *nextPageToken;

/**
 *  A page of notes.
 *
 *  @note This property is used to support NSFastEnumeration and indexed
 *        subscripting on this class.
 */
@property(nonatomic, strong, nullable) NSArray<GTLRKeep_Note *> *notes;

@end

/**
 *  A single note.
 */
@interface GTLRKeep_Note : GTLRObject

/** Output only. The attachments attached to this note. */
@property(nonatomic, strong, nullable) NSArray<GTLRKeep_Attachment *> *attachments;

/** The body of the note. */
@property(nonatomic, strong, nullable) GTLRKeep_Section *body;

/** Output only. When this note was created. */
@property(nonatomic, strong, nullable) GTLRDateTime *createTime;

/**
 *  Output only. The resource name of this note. See general note on identifiers
 *  in KeepService.
 */
@property(nonatomic, copy, nullable) NSString *name;

/**
 *  Output only. The list of permissions set on the note. Contains at least one
 *  entry for the note owner.
 */
@property(nonatomic, strong, nullable) NSArray<GTLRKeep_Permission *> *permissions;

/** The title of the note. Length must be less than 1,000 characters. */
@property(nonatomic, copy, nullable) NSString *title;

/**
 *  Output only. `true` if this note has been trashed. If trashed, the note is
 *  eventually deleted.
 *
 *  Uses NSNumber of boolValue.
 */
@property(nonatomic, strong, nullable) NSNumber *trashed;

/**
 *  Output only. When this note was trashed. If `trashed`, the note is
 *  eventually deleted. If the note is not trashed, this field is not set (and
 *  the trashed field is `false`).
 */
@property(nonatomic, strong, nullable) GTLRDateTime *trashTime;

/** Output only. When this note was last modified. */
@property(nonatomic, strong, nullable) GTLRDateTime *updateTime;

@end

/**
 *  A single permission on the note. Associates a `member` with a `role`.
 */
@interface GTLRKeep_Permission : GTLRObject

/**
 *  Output only. Whether this member has been deleted. If the member is
 *  recovered, this value is set to false and the recovered member retains the
 *  role on the note.
 *
 *  Uses NSNumber of boolValue.
 */
@property(nonatomic, strong, nullable) NSNumber *deleted;

/**
 *  The email associated with the member. If set on create, the `email` field in
 *  the `User` or `Group` message must either be empty or match this field. On
 *  read, may be unset if the member does not have an associated email.
 */
@property(nonatomic, copy, nullable) NSString *email;

/** Output only. The Google Family to which this role applies. */
@property(nonatomic, strong, nullable) GTLRKeep_Family *family;

/** Output only. The group to which this role applies. */
@property(nonatomic, strong, nullable) GTLRKeep_Group *group;

/** Output only. The resource name. */
@property(nonatomic, copy, nullable) NSString *name;

/**
 *  The role granted by this permission. The role determines the entity's
 *  ability to read, write, and share notes.
 *
 *  Likely values:
 *    @arg @c kGTLRKeep_Permission_Role_Owner A role granting full access. This
 *        role cannot be added or removed. Defined by the creator of the note.
 *        (Value: "OWNER")
 *    @arg @c kGTLRKeep_Permission_Role_RoleUnspecified An undefined role.
 *        (Value: "ROLE_UNSPECIFIED")
 *    @arg @c kGTLRKeep_Permission_Role_Writer A role granting the ability to
 *        contribute content and modify note permissions. (Value: "WRITER")
 */
@property(nonatomic, copy, nullable) NSString *role;

/** Output only. The user to whom this role applies. */
@property(nonatomic, strong, nullable) GTLRKeep_User *user;

@end

/**
 *  The content of the note.
 */
@interface GTLRKeep_Section : GTLRObject

/** Used if this section's content is a list. */
@property(nonatomic, strong, nullable) GTLRKeep_ListContent *list;

/**
 *  Used if this section's content is a block of text. The length of the text
 *  content must be less than 20,000 characters.
 */
@property(nonatomic, strong, nullable) GTLRKeep_TextContent *text;

@end

/**
 *  The block of text for a single text section or list item.
 */
@interface GTLRKeep_TextContent : GTLRObject

/**
 *  The text of the note. The limits on this vary with the specific field using
 *  this type.
 */
@property(nonatomic, copy, nullable) NSString *text;

@end

/**
 *  Describes a single user.
 */
@interface GTLRKeep_User : GTLRObject

/** The user's email. */
@property(nonatomic, copy, nullable) NSString *email;

@end

NS_ASSUME_NONNULL_END

#pragma clang diagnostic pop


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Diagnostics;
using System.Text.Utf8;

namespace System.Text
{
    public static partial class PrimitiveParser
    {
        public static bool TryParseBoolean(ReadOnlySpan<byte> text, out bool value, out int bytesConsumed, EncodingData encoding = default(EncodingData))
        {
            bytesConsumed = 0;
            value = default(bool);

            if (encoding.IsInvariantUtf8)
            {
                return InvariantUtf8.TryParseBoolean(text, out value, out bytesConsumed);
            }
            if (encoding.IsInvariantUtf16)
            {
                ReadOnlySpan<char> textChars = text.Cast<byte, char>();
                int charactersConsumed;
                bool result = InvariantUtf16.TryParseBoolean(textChars, out value, out charactersConsumed);
                bytesConsumed = charactersConsumed * sizeof(char);
                return result;
            }

            return false;
        }
    }
}


text:
ngGridDirectives.directive('ngCellText', function () {
      return function(scope, elm) {
          function mouseover (evt) {
              evt.preventDefault();
          }
          elm.bind('mouseover', mouseover);

          function mouseleave(evt) {
              evt.preventDefault();
          }
          elm.bind('mouseleave', mouseleave);

          elm.on('$destroy', function() {
            elm.off('mouseover', mouseover);
            elm.off('mouseleave', mouseleave);
          });
      };
  });


text:
<?php

/**
 * Mock object to test Translatable behavior.
 *
 * The fake data is about William Shakespeare's plays.
 *
 * @package    jodeljodel
 * @subpackage jodeljodel.tradutore.test
 */

class Scenario extends AppModel
{
    var $name = 'Scenario';

	var $actsAs = array('Cascata.AguaCascata', 'Tradutore.TradTradutore', 'Containable');
	var $hasOne = array('ScenarioTranslation');

}

?>


text:
<#
.NOTES
     Created on:   4/10/2017
     Created by:   Andy Simmons
     Organization: St. Luke's Health System
     Filename:     Start-VDiskUpdateCleanupTasks.ps1

.SYNOPSIS
    Assists with getting and keeping users off of older vDisk versions, following
    an update to a non-persistent PVS image.

.DESCRIPTION
    Analyzes available machines to ensure they're all running the latest vDisk version,
    and reboots them as needed.

    Once all available machines are up to date, machines with sessions are analyzed.

    Whenever a session is found on a machine with an old vDisk, one of two actions will be
    taken, depending on the session state and the duration of that state. If a session was
    recently active, the user will be prompted to reboot.

    If the session has been inactive for a specified time period, the machine will be rebooted.

.LINK
    https://github.com/andysimmons/vdi-utils/blob/master/Start-VDiskUpdateCleanupTasks.ps1

.PARAMETER AdminAddress
    One or more delivery controllers.

.PARAMETER SearchScope
    Specifies which types of machines are in scope.

        AvailableMachines:
            Limit search to machines in an "Available" state.

        MachinesWithSessions:
            Limit search to machines associated with sessions.

        Both:
            Default option. Searches first for available machines, and if those
            are all up-to-date, looks for sessions on outdated vDisks.

.PARAMETER NagTitle
    Title of the nag message box.

.PARAMETER NagText
    Content of the nag message box.

.PARAMETER DeliveryGroup
    Pattern matching the delivery group name(s). Wildcards are supported, but
    regular expressions are not.

.PARAMETER RegistryKey
    Registry key (on the PVS target machine) containing a property that
    references the vDisk version in use.

.PARAMETER RegistryProperty
    Registry key property to inspect.

.PARAMETER AllVersionsPattern
    A pattern matching the naming convention for ANY version of the vDisk being updated.

    Regular expressions are supported.

.PARAMETER TargetVersionPattern
    A pattern describing the specific name of the target (updated) vDisk version.

    Regular expressions are supported.

.PARAMETER MaxRecordCount
    Maximum number of results per search, per site.

.PARAMETER MaxRestartActions
    Specifies the max number of reboots that can occur during script execution
    across all sites.

.PARAMETER TimeOut
    Timeout (sec) for querying vDisk information

.PARAMETER ThrottleLimit
    Max number of concurrent remote operations.

.PARAMETER MaxHoursIdle
    Maximum number of hours a session can be inactive before we forcefully shut it down.

.PARAMETER RunAsync
    Don't monitor reboot progress, just exit the script as soon as all tasks are queued on the DDCs.

.PARAMETER PowerActionTimeout
    Timeout (sec) for MONITORING the status of queued power actions.

.EXAMPLE
    Start-VDiskUpdateCleanupTasks.ps1 -AdminAddress ctxddc01,ctxddc02,sltctxddc01,sltctxddc02 -Verbose -WhatIf

    This would invoke the script against both of our production VDI sites with the default options, and
    describe in detail what would happen.

.EXAMPLE
    Start-VDiskUpdateCleanupTasks.ps1 -AdminAddress ctxddc01,sltctxddc01,ctxddc02,sltctxddc02 -Verbose -DeliveryGroup "XD*T07GCD" -Confirm:$false

    This would invoke the script against both of our VDI sites, targeting only the test delivery groups,
    and bypass confirmation prompts for any recommended actions.

.EXAMPLE
    Start-VDiskUpdateCleanupTasks.ps1 -AdminAddress ctxddc01,ctxddc02,sltctxddc01,sltctxddc02 -Verbose -DeliveryGroup "*PVS Shared Desktop" -MaxRestartActions 10

    This would invoke the script against both of our sites, targeting any Delivery Groups ending with the string "PVS Shared Desktop",
    and perform actions (with confirmation prompts) against a maximum of 10 machines/sessions total.

.EXAMPLE
    Start-VDiskUpdateCleanupTasks.ps1 -AdminAddress ctxddc01,ctxddc02,sltctxddc01,sltctxddc02 -Verbose -DeliveryGroup "*P07SLHS*" -SearchScope 'AvailableMachines' -Confirm:$false

    Ian's Example 1
.EXAMPLE
    Start-VDiskUpdateCleanupTasks.ps1 -AdminAddress ctxddc01,ctxddc02,sltctxddc01,sltctxddc02 -Verbose -DeliveryGroup "*P07CDR*" -SearchScope 'AvailableMachines' -Confirm:$false

    Ian's Example 2
#>
#Requires -Version 5
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
param (
    [Parameter(Mandatory)]
    [string[]]
    $AdminAddress,

    [string]
    [ValidateSet('AvailableMachines','MachinesWithSessions','Both')]
    $SearchScope = 'Both',

    [string]
    $NagTitle = 'RESTART REQUIRED',

    [string]
    $NagText = "Your system must be restarted to apply the latest Epic update.`n`n" +
    "Please save your work, then click 'Start' -> 'Log Off', and then wait`n" +
    'for the logoff operation to complete.',

    [string]
    $DeliveryGroup = "*",

    [string]
    $RegistryKey = 'HKLM:\System\CurrentControlSet\services\bnistack\PvsAgent',

    [string]
    $RegistryProperty = 'DiskName',

    [regex]
    $AllVersionsPattern = "XD[BT]?P07(GCD|SLHS)-\d{6}.vhd",

    [regex]
    $TargetVersionPattern = "XD[BT]?P07SLHS-yyMMdd.vhd",

    [int]
    $MaxRecordCount = ([int32]::MaxValue),

    [int]
    $MaxRestartActions = 1000,

    [int]
    $ThrottleLimit = 32,

    [int]
    $TimeOut = 120,

    [int]
    $MaxHoursIdle = 2,

    [switch]
    $RunAsync,

    [int]
    $PowerActionTimeout = 3600
)

[Collections.ArrayList]$asyncTasks = @()
[Collections.ArrayList]$whatIfTracker = @()
$scriptStart = Get-Date
$nagCount = 0
$nagFailCount = 0
$restartCount = 0
$restartFailCount = 0
$completedTaskCount = 0
$whatIfRestartCount = 0

enum UpdateStatus
{
    Ineligible
    Unknown
    RestartRequired
    UpdateCompleted
}

enum ProposedAction
{
    None
    Nag
    Restart
}

#region Functions
<#
.SYNOPSIS
    Pulls vDisk version information for a list of computers.

.DESCRIPTION
    Takes a list of computer names, checks which vDisk each one is currently running,
    and returns a hashtable with the results.

.PARAMETER TimeOut
    Timeout (sec) for querying vDisk information

.PARAMETER RegistryKey
    Registry key (on the PVS target machine) containing a property that
    references the vDisk version in use.

.PARAMETER RegistryProperty
    Registry key property to inspect.

.PARAMETER ComputerName
    The NetBIOS name, the IP address, or the fully qualified domain name of one or more computers.
#>
function Get-VDiskInfo
{
    [CmdletBinding()]
    [OutputType([hashtable])]
    param(
        [Parameter(Mandatory, ValueFromPipeline)]
        [string[]]
        $ComputerName,

        [Parameter(Mandatory)]
        [int]
        $TimeOut,

        [Parameter(Mandatory)]
        [string]
        $RegistryKey,

        [Parameter(Mandatory)]
        [string]
        $RegistryProperty
    )

    # The PVS management snap-in is pretty awful at the time of this writing, so we'll use PS remoting
    # to reach out to each virtual desktop, have them check a registry entry, and return an object
    # containing the HostedMachineName and its current VHD.
    [scriptblock]$getDiskName = {
        [pscustomobject]@{
            DiskName = (Get-ItemProperty -Path $using:RegistryKey -ErrorAction SilentlyContinue).$using:RegistryProperty
        }
    }

    # Get as much info as we can within the timeout window.
    $vDiskJob = Invoke-Command -ComputerName $ComputerName -ScriptBlock $getDiskName -AsJob -JobName 'vDiskJob'
    Wait-Job -Job $vDiskJob -Timeout $TimeOut > $null
    $vDisks = Receive-Job -Job $vDiskJob -ErrorAction SilentlyContinue
    Get-Job -Name 'vDiskJob' | Remove-Job -Force -WhatIf:$false

    # Create a hashtable mapping the computer name to the vDisk name
    $activity = "Comparing $($sessions.Length) desktops against $($vDisks.Length) vDisk results."
    Write-Progress -Activity $activity -Status $controller
    $vDiskLookup = @{ }
    foreach ($vDisk in $vDisks)
    {
        $vDiskLookup[$vDisk.PSComputerName] = $vDisk.DiskName
    }
    Write-Progress -Activity $activity -Completed

    # Return the lookup table
    $vDiskLookup
}

<#
.SYNOPSIS
    Determines the update status of a given vDisk.

.PARAMETER AllVersionsPattern
    A pattern matching the naming convention for ANY version of the vDisk being updated.

.PARAMETER TargetVersionPattern
    A pattern describing the specific name of the target (updated) vDisk version.

.PARAMETER DiskName
    The name of the vDisk.
#>
function Get-UpdateStatus
{
    [CmdletBinding()]
    [OutputType([UpdateStatus])]
    param(
        [string]$DiskName,

        [regex]$AllVersionsPattern,

        [regex]$TargetVersionPattern
    )

    # If we know the vDisk name
    if ($DiskName)
    {
        # and it's a vDisk we're updating
        if ($DiskName -match $AllVersionsPattern)
        {
            # see if we're on the target version.
            if ($DiskName -match $TargetVersionPattern)
            {
                $updateStatus = [UpdateStatus]::UpdateCompleted
            }
            else
            {
                $updateStatus = [UpdateStatus]::RestartRequired
            }
        }
        # we aren't trying to update this vDisk.
        else
        {
            $updateStatus = [UpdateStatus]::Ineligible
        }
    }

    # no disk name provided
    else
    {
        $updateStatus = [UpdateStatus]::Unknown
    }

    # return result
    $updateStatus
}

<#
.SYNOPSIS
    Underlines a string.

.PARAMETER Header
    Header text.

.PARAMETER Double
    Displays header text with both under and overlines.
#>
function Out-Header
{
    [CmdletBinding()]
    [OutputType([string])]
    param (
        [Parameter(Mandatory, ValueFromPipeline)]
        [string]$Header,

        [switch]$Double
    )
    process
    {
        $line = $Header -replace '.', '-'

        if ($Double)
        {
            ''
            $line
            $Header
            $line
        }
        else
        {
            ''
            $Header
            $line
        }
    }
}

<#
.SYNOPSIS
    Nag a VDI user with a popup.

.DESCRIPTION
    Generates a dialog box inside a VDI session.

.PARAMETER AdminAddress
    Controller address.

.PARAMETER HostedMachineName
    Hosted machine name associated with the session we're going to nag.

.PARAMETER Title
    Message dialog title text.

.PARAMETER Text
    Message dialog body text.

.PARAMETER MessageStyle
    Message dialog icon style.

.PARAMETER SessionUID
    Session UID.
#>
function Send-Nag
{
    [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
    param
    (
        [Parameter(Mandatory)]
        [string]$AdminAddress,

        [Parameter(Mandatory)]
        [string]$HostedMachineName,

        [Parameter(Mandatory)]
        [int]$SessionUID,

        [Parameter(Mandatory)]
        [string]$Text,

        [Parameter(Mandatory)]
        [string]$Title,

        [ValidateSet('Critical', 'Exclamation', 'Information', 'Question')]
        [string]$MessageStyle = 'Exclamation'
    )

    if ($PSCmdlet.ShouldProcess($HostedMachineName, "NAG USER"))
    {

        try
        {
            $session = Get-BrokerSession -AdminAddress $AdminAddress -Uid $SessionUID -ErrorAction Stop
        }
        catch
        {
            Write-Warning "Couldn't retrieve session ${AdminAddress}: ${SessionUID}"
            return
        }

        $nagParams = @{
            AdminAddress = $AdminAddress
            InputObject  = $session
            Title        = $Title
            Text         = $Text
            MessageStyle = $MessageStyle
            ErrorAction  = 'Stop'
        }

        try
        {
            Send-BrokerSessionMessage @nagParams
        }
        catch
        {
            Write-Warning $_.Exception.Message
            $script:nagFailCount++
        }

        $script:nagCount++
    }
}

<#
.SYNOPSIS
    Finds healthy Desktop Delivery Controllers (DDCs) from a list of candidates.

.DESCRIPTION
    Inspects each of the DDC names provided, verifies the services we'll be leveraging are
    responsive, and picks one healthy DDC per site.

.PARAMETER Candidates
    List of DDCs associated with one or more Citrix XenDesktop sites.
#>
function Get-HealthyDDC
{
    [CmdletBinding()]
    [OutputType([string[]])]
    param
    (
        [Parameter(Mandatory)]
        [string[]]$Candidates
    )

    $siteLookup = @{ }

    foreach ($candidate in $Candidates)
    {
        $candidateParams = @{
            AdminAddress = $candidate
            ErrorAction  = 'Stop'
        }

        # Check service states
        try   { $brokerStatus = (Get-BrokerServiceStatus @candidateParams).ServiceStatus }
        catch { $brokerStatus = 'BROKER_OFFLINE' }

        try   { $hypStatus = (Get-HypServiceStatus @candidateParams).ServiceStatus }
        catch { $hypStatus = 'HYPERVISOR_OFFLINE' }

        # If it's healthy, check the site ID.
        if (($brokerStatus -eq 'OK') -and ($hypStatus -eq 'OK'))
        {
            try   { $brokerSite = Get-BrokerSite @candidateParams }
            catch { $brokerSite = $null }

            # We only want one healthy DDC per site
            if ($brokerSite)
            {
                $siteUid = $brokerSite.BrokerServiceGroupUid

                if ($siteUid -notin $siteLookup.Keys)
                {
                    Write-Verbose "Using DDC $candidate for sessions in site $($brokerSite.Name)."
                    $siteLookup[$siteUid] = $candidate
                }

                else
                {
                    Write-Verbose "Already using $($siteLookup[$siteUid]) for site $($brokerSite.Name). Skipping $candidate."
                }
            }
        }

        else
        {
            Write-Warning "DDC '$candidate' broker service status: $brokerStatus, hypervisor service status: $hypStatus. Skipping."
        }
    }

    # Return only the names of the healthy DDCs from our site lookup hashtable
    $siteLookup.Values
}

<#
.SYNOPSIS
    Checks the current status of previously queued HostingPowerActions, and
    returns the task if it's still pending.

.PARAMETER Task
    String following the format "<task UID>@<admin address>".

.EXAMPLE
    Get-PendingPowerAction -Task '123456@ctxddc01'
#>
function Get-PendingPowerAction
{
    [OutputType([string])]
    [CmdletBinding()]
    param (
        [Parameter(ValueFromPipeline, Mandatory)]
        [string]
        $Task
    )

    process
    {
        if ($Task -notmatch '[0-9]+@.+')
        {
            Write-Error "Discarding task '${Task}' because it looks funny." -Category ParserError
        }
        else
        {
            $taskTokens   = $Task.ToUpper() -split '@'
            $taskUid      = $taskTokens[0]
            $adminAddress = $taskTokens[1]

            try
            {
                $taskInfo = Get-BrokerHostingPowerAction -AdminAddress $adminAddress -Uid $taskUid -ErrorAction 'Stop'
            }
            catch
            {
                Write-Warning $_.Exception.Message
                $taskInfo = $null
            }

            # Task is in its final state. Don't return it, just summarize.
            if ($taskInfo.ActionCompletionTime)
            {
                $action     = $taskInfo.Action
                $machine    = $taskInfo.HostedMachineName.ToString().ToUpper()
                $result     = $taskInfo.State.ToString().ToLower()
                $resultTime = $taskInfo.ActionCompletionTime

                if ($result -ne 'completed')
                {
                    $script:restartFailCount++
                }

                Write-Verbose "${machine} ${action} result: ${result} ($($adminAddress.ToUpper()): ${resultTime})"
            }

            # Still pending. Return it.
            else { $Task }
        }
    }
}
#endregion Functions

#region Initialization
Write-Verbose "$(Get-Date): Started as '$($MyInvocation.Line)'"

# Obnoxious workaround. We'll summarize all interesting parameters (anything assigned -
# both default and custom) inside a hashtable, and shoot that to verbose output.
$invocationParams = $PSBoundParameters
$supportedParams = (Get-Command -Name $MyInvocation.MyCommand.Source).Parameters

foreach ($key in $supportedParams.keys)
{
    $var = Get-Variable -Name $key -ErrorAction SilentlyContinue;
    if ($var)
    {
        $invocationParams[$var.name] = $var.value
    }
}
Write-Verbose "Parameter assignments...`n$($invocationParams | Format-Table -HideTableHeaders | Out-String)"

Write-Verbose 'Loading required Citrix snap-ins...'
[Collections.ArrayList]$missingSnapinList = @()
$requiredSnapins = @(
    'Citrix.Host.Admin.V2',
    'Citrix.Broker.Admin.V2'
)

foreach ($requiredSnapin in $requiredSnapins)
{
    Write-Verbose "Loading snap-in: $requiredSnapin"
    try   { Add-PSSnapin -Name $requiredSnapin -ErrorAction Stop }
    catch { $missingSnapinList.Add($requiredSnapin) > $null }
}

if ($missingSnapinList)
{
    Write-Error -Category NotImplemented -Message "Missing $($missingSnapinList -join ', ')"
    exit 1
}

Write-Verbose "Assessing DDCs: $($AdminAddress -join ', ')"
$controllers = @(Get-HealthyDDC -Candidates $AdminAddress)
if (!$controllers.Length)
{
    Write-Error -Category ResourceUnavailable -Message 'No healthy DDCs found.'
    exit 1
}
#endregion Initialization

#region Analysis

# Loop through the eligible controllers (one per site), analyze the AVAILABLE MACHINES on each to see
# what automated action should be taken, and store that report in a collection.
if ($SearchScope -eq 'MachinesWithSessions')
{
    # We're just targeting sessions this run, skip the available machine analysis.
    $availableMachineReport = @()
}

else
{
    [array]$availableMachineReport = foreach ($controller in $controllers)
    {
        $analysisStart = Get-Date

        Write-Verbose "Analyzing available machines' vDisks on $($controller.ToUpper()) (this may take a minute)..."
        Write-Progress -Activity 'Pulling available machine list' -Status $controller

        $availableParams = @{
            AdminAddress     = $controller
            DesktopGroupName = $DeliveryGroup
            DesktopKind      = 'Shared'
            SummaryState     = 'Available'
            MaxRecordCount   = $MaxRecordCount
        }

        $availableMachines = Get-BrokerMachine @availableParams

        Write-Progress -Activity 'Pulling available machine list' -Completed

        if ($availableMachines)
        {
            Write-Progress -Activity "Querying $($availableMachines.Length) desktops for vDisk information (${TimeOut} sec timeout)." -Status $controller

            $lookupParams = @{
                ComputerName     = $availableMachines.HostedMachineName
                Timeout          = $Timeout
                RegistryKey      = $RegistryKey
                RegistryProperty = $RegistryProperty

            }
            $vDiskLookup = Get-VDiskInfo @lookupParams

            # Now we can loop through the sessions and handle them accordingly
            foreach ($availableMachine in $availableMachines)
            {
                try   { $vDisk = $vDiskLookup[$availableMachine.HostedMachineName] }
                catch { $vDisk = $null }

                $statusParams = @{
                    TargetVersionPattern = $TargetVersionPattern
                    AllVersionsPattern   = $AllVersionsPattern
                    DiskName             = $vDisk
                }

                $updateStatus = Get-UpdateStatus @statusParams

                # Propose an action based on update status
                switch ($updateStatus)
                {
                    'RestartRequired'
                    {
                        # Machine isn't in use, we should restart it.
                        $proposedAction = [ProposedAction]::Restart
                    }

                    default
                    {
                        # No action needed (or not enough info to propose an action)
                        $proposedAction = [ProposedAction]::None
                    }
                }

                # Summarize this machine
                [pscustomobject]@{
                    HostedMachineName = $availableMachine.HostedMachineName
                    DiskName          = $vDisk
                    UpdateStatus      = $updateStatus
                    ProposedAction    = $proposedAction
                    SummaryState      = $availableMachine.SummaryState
                    Uid               = $availableMachine.Uid
                    AdminAddress      = $controller.ToUpper()
                }
            }
        }

        else
        {
            Write-Verbose "No available machines found on $($controller.ToUpper())."
        }

        $elapsed = [int]((Get-Date) - $analysisStart).TotalSeconds
        Write-Verbose "Completed $($controller.ToUpper()) machine analysis in ${elapsed} seconds."
    }
    if ($availableMachineReport)
    {
        'Available Machine Summary' | Out-Header -Double
        $availableMachineReport | Format-Table -AutoSize
    }
}

if ($SearchScope -eq 'AvailableMachines')
{
    # Sessions are out of scope for this pass
    $sessionReport = @()
}
else
{
    # Loop through the eligible controllers (one per site), analyze the MACHINES WITH SESSIONS to see what
    # automated action should be taken, and store that report in a collection.
    [array]$sessionReport = foreach ($controller in $controllers)
    {
        $analysisStart = Get-Date

        $oldAvailableMachines = @(
            $availableMachineReport |
                Where-Object { ($_.AdminAddress -eq $controller) -and ($_.ProposedAction -eq 'Restart') }
        )

        if ($oldAvailableMachines)
        {
            Write-Warning "There are still at least $($oldAvailableMachines.Count) outdated and available machines reported by $($controller.ToUpper())."
            Write-Warning 'Skipping session analysis until available machines are all up-to-date.'
            $sessions = @()
        }

        else
        {
            Write-Verbose "Analyzing sessions and vDisks on $($controller.ToUpper()) (this may take a minute)..."
            Write-Progress -Activity 'Pulling session list' -Status $controller

            $sessionParams = @{
                AdminAddress     = $controller
                DesktopGroupName = $DeliveryGroup
                DesktopKind      = 'Shared'
                MaxRecordCount   = $MaxRecordCount
            }

            $sessions = Get-BrokerSession @sessionParams

            Write-Progress -Activity 'Pulling session list' -Completed
        }

        if ($sessions)
        {
            Write-Progress -Activity "Querying $($sessions.Length) desktops for vDisk information (${TimeOut} sec timeout)." -Status $controller

            $lookupParams = @{
                ComputerName     = $sessions.HostedMachineName
                Timeout          = $Timeout
                RegistryKey      = $RegistryKey
                RegistryProperty = $RegistryProperty

            }
            $vDiskLookup = Get-VDiskInfo @lookupParams

            Write-Progress -Activity "Querying $($sessions.Length) desktops for vDisk information (${TimeOut} sec timeout)." -Completed

            # Now we can loop through the sessions and handle them accordingly
            foreach ($session in $sessions)
            {
                try   { $vDisk = $vDiskLookup[$session.HostedMachineName] }
                catch { $vDisk = $null }

                $statusParams = @{
                    TargetVersionPattern = $TargetVersionPattern
                    AllVersionsPattern   = $AllVersionsPattern
                    DiskName             = $vDisk
                }

                $updateStatus = Get-UpdateStatus @statusParams

                # Propose an action based on update status
                switch ($updateStatus)
                {
                    'RestartRequired'
                    {
                        $isInactive = $session.SessionState -ne 'Active'
                        $hasntChangedInAWhile = $session.SessionStateChangeTime -lt (Get-Date).AddHours( - $MaxHoursIdle)

                        if ($isInactive -and $hasntChangedInAWhile)
                        {
                            # Needs a restart, and they aren't using it
                            $proposedAction = [ProposedAction]::Restart
                        }
                        else
                        {
                            # Needs a restart, but they could be using it (it's either active, or was recently active)
                            $proposedAction = [ProposedAction]::Nag
                        }
                    }

                    default
                    {
                        # No action needed (or not enough info to propose an action)
                        $proposedAction = [ProposedAction]::None
                    }
                }

                # Summarize this session
                [pscustomobject]@{
                    HostedMachineName      = $session.HostedMachineName
                    DiskName               = $vDisk
                    UpdateStatus           = $updateStatus
                    ProposedAction         = $proposedAction
                    SessionState           = $session.SessionState
                    SessionStateChangeTime = $session.SessionStateChangeTime
                    Uid                    = $session.Uid
                    AdminAddress           = $controller.ToUpper()
                }
            }
        }
        else
        {
            Write-Verbose "No interesting sessions found on $($controller.ToUpper())."
        }
        $elapsed = [int]((Get-Date) - $analysisStart).TotalSeconds
        Write-Verbose "Completed $($controller.ToUpper()) session analysis in ${elapsed} seconds."
    }

    if ($sessionReport)
    {
        'Session Summary' | Out-Header -Double
        $sessionReport | Format-Table -AutoSize
    }
}
#endregion Analysis

#region Actions

# Randomize the report order so we get some distribution across sites.
# TODO: Write a helper function to sort (round-robin across sites by action).
$sessionReport          = $sessionReport          | Sort-Object {Get-Random}
$availableMachineReport = $availableMachineReport | Sort-Object {Get-Random}

# Restart available outdated machines
foreach ($availableMachineInfo in $availableMachineReport)
{
    switch ($availableMachineInfo.ProposedAction)
    {
        'Restart'
        {
            # Make sure the machine is still available before we reboot it.
            $refreshParams = @{
                AdminAddress      = $availableMachineInfo.AdminAddress
                HostedMachineName = $availableMachineInfo.HostedMachineName
            }

            $currentMachine = Get-BrokerMachine @refreshParams

            if ($currentMachine.SummaryState -ne 'Available')
            {
                Write-Warning "$($currentMachine.HostedMachineName) is no longer available ($($currentMachine.SummaryState)). Skipping."
            }

            else
            {
                if (($restartCount -lt $MaxRestartActions) -and ($whatIfRestartCount -lt $MaxRestartActions))
                {
                    if ($PSCmdlet.ShouldProcess("$($availableMachineInfo.HostedMachineName) (Available: No Session)", 'RESTART MACHINE'))
                    {
                        $restartParams = @{
                            AdminAddress = $availableMachineInfo.AdminAddress
                            MachineName  = $currentMachine.MachineName
                            Action       = 'Restart'
                            ErrorAction  = 'Stop'
                        }

                        try
                        {
                            $asyncTask = New-BrokerHostingPowerAction @restartParams
                            $taskName  = "$($asyncTask.Uid)@$($restartParams.AdminAddress)"

                            $asyncTasks.Add($taskName) > $null
                            Write-Verbose "Task: ${taskName}"
                            $restartCount++
                        }
                        catch
                        {
                            Write-Warning $_.Exception.Message
                            $restartFailCount++
                        }
                    }
                    else
                    {
                        $whatIfRestartCount++
                        $whatIfTracker.Add($availableMachineInfo) > $null
                    }
                }
            }
        }
    }
}

# Restart and/or nag sessions on outdated machines
foreach ($sessionInfo in $sessionReport)
{
    switch ($sessionInfo.ProposedAction)
    {
        'Restart'
        {
            # Verify it's still inactive before restarting
            $refreshParams = @{
                AdminAddress      = $sessionInfo.AdminAddress
                HostedMachineName = $sessionInfo.HostedMachineName
            }

            $currentSession = Get-BrokerSession @refreshParams

            if ($currentSession.SessionState -ne 'Active')
            {
                if (($restartCount -lt $MaxRestartActions) -and ($whatIfRestartCount -lt $MaxRestartActions))
                {
                    if ($PSCmdlet.ShouldProcess("$($sessionInfo.HostedMachineName) (Inactive Session)", 'RESTART MACHINE'))
                    {
                        $restartParams = @{
                            AdminAddress = $sessionInfo.AdminAddress
                            MachineName  = $currentSession.MachineName
                            Action       = 'Restart'
                            ErrorAction  = 'Stop'
                        }

                        try
                        {
                            $asyncTask = New-BrokerHostingPowerAction @restartParams
                            $taskName  = "$($asyncTask.Uid)@$($restartParams.AdminAddress)"

                            $asyncTasks.Add($taskName) > $null
                            Write-Verbose "Task: ${taskName}"
                            $restartCount++
                        }
                        catch
                        {
                            Write-Warning $_.Exception.Message
                            $restartFailCount++
                        }
                    }
                    else
                    {
                        $whatIfRestartCount++
                        $whatIfTracker.Add($sessionInfo) > $null
                    }
                }
            }

            # It's active now, we'll nag instead.
            else
            {
                $nagParams = @{
                    AdminAddress      = $sessionInfo.AdminAddress
                    HostedMachineName = $sessionInfo.HostedMachineName
                    SessionUID        = $sessionInfo.Uid
                    Title             = $NagTitle
                    Text              = $NagText
                }

                Send-Nag @nagParams
            }
        } # 'Restart'

        'Nag'
        {
            $nagParams = @{
                AdminAddress      = $sessionInfo.AdminAddress
                HostedMachineName = $sessionInfo.HostedMachineName
                SessionUID        = $sessionInfo.Uid
                Title             = $NagTitle
                Text              = $NagText
            }

            Send-Nag @nagParams
        }
    }
}
#endregion Actions

#region Monitor

# Unless otherwise specified, wait for power actions to complete before exiting script.
if (-not $RunAsync)
{
    $startingTaskCount = $asyncTasks.Count
    $stopWatch = [Diagnostics.StopWatch]::StartNew()

    $activity   = 'Waiting for power actions to complete'
    $activityId = 10
    $progressParams = @{
        Activity = $activity
        Status   = "Querying ${startingTaskCount} tasks"
        Id       = $activityId
    }
    Write-Progress @progressParams

    while ($asyncTasks -and ($stopWatch.Elapsed.TotalSeconds -lt $PowerActionTimeout))
    {
        $asyncTasks = @($asyncTasks | Get-PendingPowerAction)

        if ($asyncTasks)
        {
            $completedTaskCount = $startingTaskCount - $asyncTasks.Count
            $pctComplete = 100 * ($completedTaskCount / $startingTaskCount)

            # Update the "elapsed" time on the progress bar each second, but
            # don't re-query anything for another 5 seconds.
            for ($i = 1; $i -le 5; $i++)
            {
                $elapsed = $stopWatch.Elapsed.ToString("mm\:ss")

                $progressParams = @{
                    PercentComplete = $pctComplete
                    Id              = $activityId
                    Activity        = $activity
                    Status          = "${completedTaskCount}/${startingTaskCount} (${elapsed} elapsed)"
                }
                Write-Progress @progressParams

                Start-Sleep -Seconds 1
            }
        }
    }

    if ($asyncTasks)
    {
        Write-Warning "$($asyncTasks.Count) tasks still pending after ${PowerActionTimeout} seconds!"
        Write-Warning "The following power actions are still queued, but their"
        Write-Warning "progress will not be monitored:"
        $asyncTasks | Write-Warning
    }

    Write-Progress -Activity $activity -Id $activityId -Completed
    $stopWatch.Stop()
}
#endregion Monitor

#region Summary
$combinedReport = $sessionReport + $availableMachineReport

'Final Summary' | Out-Header -Double

foreach ($property in 'UpdateStatus', 'ProposedAction', 'DiskName')
{
    $property | Out-Header

    $combinedReport |
        Group-Object -Property $property -NoElement |
        Select-Object -Property Count, @{ n = $property; e = { $_.Name } } |
        Sort-Object -Property 'Count' -Descending |
        Format-Table -HideTableHeaders
}

$elapsedSeconds = [int]((Get-Date) - $scriptStart).TotalSeconds
"Total Nags Sent: ${nagCount} (${nagFailCount} failed)"
"Total Restarts Requested: ${restartCount} (${restartFailCount} failed, $($asyncTasks.Count) pending)."
"Script completed in ${elapsedSeconds} seconds."
#endregion Summary


text:
package OptimizationTests.ShortLeafMethodsInlining.InvokeVirtual_mul_double_001;
class Test {

    public double simple_method(double jj, double ii) {
        jj = ii * jj;
        return jj;
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Agaricus daucipes Pers.

### Remarks
null


text:
int string_set(fdb_context_t* context, fdb_slot_t* slot, fdb_slice_t* key, fdb_slice_t* value);

int string_setnx(fdb_context_t* context, fdb_slot_t* slot, fdb_slice_t* key, fdb_slice_t* value);

int string_setxx(fdb_context_t* context, fdb_slot_t* slot, fdb_slice_t* key, fdb_slice_t* value);

int string_mset(fdb_context_t* context, fdb_slot_t* slot,  fdb_array_t* kvs, fdb_array_t** rets);

int string_msetnx(fdb_context_t* context, fdb_slot_t* slot, fdb_array_t* kvs, fdb_array_t** rets);

int string_get(fdb_context_t* context, fdb_slot_t* slot, fdb_slice_t* key, fdb_slice_t** pvalue);

int string_mget(fdb_context_t* context, fdb_slot_t* slot, fdb_array_t* keys, fdb_array_t** rets);

int string_incr(fdb_context_t* context, fdb_slot_t* slot, fdb_slice_t* key, int64_t init, int64_t by, int64_t* val);

#endif //FDB_T_STRING_H


text:
package com.taobao.tddl.rule.enumerator;

import com.taobao.tddl.rule.model.sqljep.Comparative;

public class EnumerationInterruptException extends RuntimeException {

    private static final long     serialVersionUID = 1L;
    private transient Comparative comparative;

    public EnumerationInterruptException(Comparative comparative){
        super(comparative.toString());
        this.comparative = comparative;
    }

    public Comparative getComparative() {
        return comparative;
    }

    public void setComparative(Comparative comparative) {
        this.comparative = comparative;
    }

    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }

}