text:
package com.allsaintsrobotics.scouting.adapters;

import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.allsaintsrobotics.scouting.R;
import com.allsaintsrobotics.scouting.MatchDetail;
import com.allsaintsrobotics.scouting.models.Match;
import com.allsaintsrobotics.scouting.models.Team;

import java.util.List;

/**
 * Created by jack on 11/27/13.
 * This file is a part of the ASTECHZ Scouting app.
 */
public class MatchAdapter extends ArrayAdapter<Match> {
    private final Team team;
    private final Context context;
    private final List<Match> matches;

    public MatchAdapter(Context context, Team team, List<Match> matches) {
        super(context, R.layout.listitem_match, matches);

        this.team = team;
        this.context = context;
        this.matches = matches;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        MatchFieldHelper mfh;
        View row = convertView;

        if (row == null) {
            LayoutInflater li = LayoutInflater.from(context);

            row = li.inflate(R.layout.listitem_match, parent, false);

            mfh = new MatchFieldHelper();

            mfh.blue1 = (TextView) row.findViewById(R.id.blue_1);
            mfh.blue2 = (TextView) row.findViewById(R.id.blue_2);
            mfh.blue3 = (TextView) row.findViewById(R.id.blue_3);
            mfh.red1 = (TextView) row.findViewById(R.id.red_1);
            mfh.red2 = (TextView) row.findViewById(R.id.red_2);
            mfh.red3 = (TextView) row.findViewById(R.id.red_3);

            mfh.matchId = (TextView) row.findViewById(R.id.match_id_lv);

            row.setTag(mfh);
        }
        else {
            mfh = (MatchFieldHelper) row.getTag();
        }

        final Match m = matches.get(position);

        mfh.matchId.setText(String.format(context.getString(R.string.match_id_format),
                m.getNumber()));
        mfh.blue1.setText(Integer.toString(m.getTeam(Match.Alliance.BLUE, 0)));
        mfh.blue2.setText(Integer.toString(m.getTeam(Match.Alliance.BLUE, 1)));
        mfh.blue3.setText(Integer.toString(m.getTeam(Match.Alliance.BLUE, 2)));

        mfh.red1.setText(Integer.toString(m.getTeam(Match.Alliance.RED, 0)));
        mfh.red2.setText(Integer.toString(m.getTeam(Match.Alliance.RED, 1)));
        mfh.red3.setText(Integer.toString(m.getTeam(Match.Alliance.RED, 2)));

        if (mfh.blue1.getText().toString().equals(Integer.toString(m.getScout()))) {
            mfh.blue1.setTypeface(null, Typeface.BOLD);
        }
        else {
            mfh.blue1.setTypeface(null, Typeface.NORMAL);
        }

        if (mfh.blue2.getText().toString().equals(Integer.toString(m.getScout()))) {
            mfh.blue2.setTypeface(null, Typeface.BOLD);
        }
        else {
            mfh.blue2.setTypeface(null, Typeface.NORMAL);
        }

        if (mfh.blue3.getText().toString().equals(Integer.toString(m.getScout()))) {
            mfh.blue3.setTypeface(null, Typeface.BOLD);
        }
        else {
            mfh.blue3.setTypeface(null, Typeface.NORMAL);
        }

        if (mfh.red1.getText().toString().equals(Integer.toString(m.getScout()))) {
            mfh.red1.setTypeface(null, Typeface.BOLD);
        }
        else {
            mfh.red1.setTypeface(null, Typeface.NORMAL);
        }

        if (mfh.red2.getText().toString().equals(Integer.toString(m.getScout()))) {
            mfh.red2.setTypeface(null, Typeface.BOLD);
        }
        else {
            mfh.red2.setTypeface(null, Typeface.NORMAL);
        }

        if (mfh.red3.getText().toString().equals(Integer.toString(m.getScout()))) {
            mfh.red3.setTypeface(null, Typeface.BOLD);
        }
        else {
            mfh.red3.setTypeface(null, Typeface.NORMAL);
        }

        if (isEnabled(position)) {
            row.setClickable(true);
            row.setOnClickListener(new View.OnClickListener() {
                public void onClick(View v) {
                    Intent i = new Intent();

                    i.setClass(context, MatchDetail.class);

                    i.putExtra("match", m);

                    context.startActivity(i);
                }
            });
        }
        else {
            row.setClickable(false);
        }

        return row;
    }

    @Override
    public boolean isEnabled(int position) {
        // If this isn't the team we're scouting for this match, disable it.
        return !(team != null && matches.get(position).getScout() != team.getNumber()) && super.isEnabled(position);
    }

    private class MatchFieldHelper {
        TextView red1, red2, red3;
        TextView blue1, blue2, blue3;

        TextView matchId;
    }
}


text:
Formtastic::FormBuilder.all_fields_required_by_default = false

# Should select fields have a blank option/prompt by default?
# Defaults to true.
# Formtastic::FormBuilder.include_blank_for_select_by_default = true

# Set the string that will be appended to the labels/fieldsets which are required
# It accepts string or procs and the default is a localized version of
# '<abbr title="required">*</abbr>'. In other words, if you configure formtastic.required
# in your locale, it will replace the abbr title properly. But if you don't want to use
# abbr tag, you can simply give a string as below
# Formtastic::FormBuilder.required_string = "(required)"

# Set the string that will be appended to the labels/fieldsets which are optional
# Defaults to an empty string ("") and also accepts procs (see required_string above)
# Formtastic::FormBuilder.optional_string = "(optional)"

# Set the way inline errors will be displayed.
# Defaults to :sentence, valid options are :sentence, :list, :first and :none
# Formtastic::FormBuilder.inline_errors = :sentence
# Formtastic uses the following classes as default for hints, inline_errors and error list

# If you override the class here, please ensure to override it in your stylesheets as well
# Formtastic::FormBuilder.default_hint_class = "inline-hints"
# Formtastic::FormBuilder.default_inline_error_class = "inline-errors"
# Formtastic::FormBuilder.default_error_list_class = "errors"

# Set the method to call on label text to transform or format it for human-friendly
# reading when formtastic is used without object. Defaults to :humanize.
# Formtastic::FormBuilder.label_str_method = :humanize

# Set the array of methods to try calling on parent objects in :select and :radio inputs
# for the text inside each @<option>@ tag or alongside each radio @<input>@. The first method
# that is found on the object will be used.
# Defaults to ["to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
# Formtastic::FormBuilder.collection_label_methods = [
#   "to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]

# Additionally, you can customize the order for specific types of inputs.
# This is configured on a type basis and if a type is not found it will
# fall back to the default order as defined by #inline_order
# Formtastic::FormBuilder.custom_inline_order[:checkbox] = [:errors, :hints, :input]
# Formtastic::FormBuilder.custom_inline_order[:select] = [:hints, :input, :errors]

# Specifies if labels/hints for input fields automatically be looked up using I18n.
# Default value: true. Overridden for specific fields by setting value to true,
# i.e. :label => true, or :hint => true (or opposite depending on initialized value)
# Formtastic::FormBuilder_lookups_by_default = false

# You can add custom inputs or override parts of Formtastic by subclassing Formtastic::FormBuilder and
# specifying that class here.  Defaults to Formtastic::FormBuilder.
# Formtastic::Helpers::FormHelper.builder = MyCustomBuilder

redpajama_set_name: RedPajamaGithub


text:
package api.usage.happypath;

import api.usage.Happy;
import api.usage.Sad;
import io.github.theangrydev.businessflows.HappyPath;
import org.assertj.core.api.WithAssertions;
import org.junit.Test;

public class SadPathTest implements WithAssertions {

    /**
     * This produces a happy path biased view of an underlying sad case.
     */
    @Test
    public void sadCaseHappyPath() {
        Sad sad = new Sad();

        HappyPath<Happy, Sad> happyPath = HappyPath.sadPath(sad);

        assertThat(happyPath.getSad()).isEqualTo(sad);
    }
}


text: function _js_debug(){}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/monitoring/v3/service_service.proto

namespace Google\Cloud\Monitoring\V3;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * The `ListServiceLevelObjectives` response.
 *
 * Generated from protobuf message google.monitoring.v3.ListServiceLevelObjectivesResponse
 */
class ListServiceLevelObjectivesResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * The `ServiceLevelObjective`s matching the specified filter.
     *
     * Generated from protobuf field repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1;
     */
    private $service_level_objectives;
    /**
     * If there are more results than have been returned, then this field is set
     * to a non-empty value.  To see the additional results,
     * use that value as `page_token` in the next call to this method.
     *
     * Generated from protobuf field string next_page_token = 2;
     */
    private $next_page_token = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Monitoring\V3\ServiceLevelObjective[]|\Google\Protobuf\Internal\RepeatedField $service_level_objectives
     *           The `ServiceLevelObjective`s matching the specified filter.
     *     @type string $next_page_token
     *           If there are more results than have been returned, then this field is set
     *           to a non-empty value.  To see the additional results,
     *           use that value as `page_token` in the next call to this method.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce();
        parent::__construct($data);
    }

    /**
     * The `ServiceLevelObjective`s matching the specified filter.
     *
     * Generated from protobuf field repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1;
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getServiceLevelObjectives()
    {
        return $this->service_level_objectives;
    }

    /**
     * The `ServiceLevelObjective`s matching the specified filter.
     *
     * Generated from protobuf field repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1;
     * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setServiceLevelObjectives($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\ServiceLevelObjective::class);
        $this->service_level_objectives = $arr;

        return $this;
    }

    /**
     * If there are more results than have been returned, then this field is set
     * to a non-empty value.  To see the additional results,
     * use that value as `page_token` in the next call to this method.
     *
     * Generated from protobuf field string next_page_token = 2;
     * @return string
     */
    public function getNextPageToken()
    {
        return $this->next_page_token;
    }

    /**
     * If there are more results than have been returned, then this field is set
     * to a non-empty value.  To see the additional results,
     * use that value as `page_token` in the next call to this method.
     *
     * Generated from protobuf field string next_page_token = 2;
     * @param string $var
     * @return $this
     */
    public function setNextPageToken($var)
    {
        GPBUtil::checkString($var, True);
        $this->next_page_token = $var;

        return $this;
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Annapolis.Abstract.UnitOfWork
{
    public interface IUnitOfWork : IAnnapolisBase, IDisposable
    {
        void Commit();
        void Rollback();
        void SaveChanges();
    }
}


text:
'use strict';

/**
 * @ngdoc directive
 * @name voyager.directive:encodingVariations
 * @description
 * # encodingVariations
 */
angular.module('voyager')
  .directive('encodingVariations', function (Visrec, consts, $document, _, Logger) {

    return {
      templateUrl: 'components/encodingvariations/encodingvariations.html',
      restrict: 'E',
      replace: true,
      scope: {},
      link: function postLink(scope/*, element, attrs*/) {
        scope.Visrec = Visrec;
        scope.consts = consts;
        scope._ = _;

        function escape(e) {

          if (e.keyCode === 27) {
            console.log('escape');
            scope.close();
            angular.element($document).off('keydown', escape);
          }
        }

        angular.element($document).on('keydown', escape);

        scope.isInList = function(fieldSetKey) {
          return Visrec.selectedCluster &&
            fieldSetKey === Visrec.selectedCluster.key;
        };

        scope.select = function(subcluster) {
          scope.selectedSubcluster = subcluster;
          Logger.logInteraction(Logger.actions.CLUSTER_SELECT, subcluster);
        };

        scope.close = function() {
          Logger.logInteraction(Logger.actions.DRILL_DOWN_CLOSE, Visrec.selectedCluster.key);
          scope.Visrec.selectedCluster = null;

        };

        scope.$watch('Visrec.selectedCluster', function(selectedCluster) {
          scope.selectedSubcluster = selectedCluster ? selectedCluster[0] : null;
        });
      }
    };
  });


text:
<?php

namespace Rds\Request\V20140815;

class CheckRecoveryConditionsRequest extends \RpcAcsRequest
{
	function  __construct()
	{
		parent::__construct("Rds", "2014-08-15", "CheckRecoveryConditions", "rds", "openAPI");
		$this->setMethod("POST");
	}

	private  $resourceOwnerId;

	private  $restoreTime;

	private  $resourceOwnerAccount;

	private  $backupFile;

	private  $backupId;

	private  $ownerAccount;

	private  $dBInstanceId;

	private  $ownerId;

	public function getResourceOwnerId() {
		return $this->resourceOwnerId;
	}

	public function setResourceOwnerId($resourceOwnerId) {
		$this->resourceOwnerId = $resourceOwnerId;
		$this->queryParameters["ResourceOwnerId"]=$resourceOwnerId;
	}

	public function getRestoreTime() {
		return $this->restoreTime;
	}

	public function setRestoreTime($restoreTime) {
		$this->restoreTime = $restoreTime;
		$this->queryParameters["RestoreTime"]=$restoreTime;
	}

	public function getResourceOwnerAccount() {
		return $this->resourceOwnerAccount;
	}

	public function setResourceOwnerAccount($resourceOwnerAccount) {
		$this->resourceOwnerAccount = $resourceOwnerAccount;
		$this->queryParameters["ResourceOwnerAccount"]=$resourceOwnerAccount;
	}

	public function getBackupFile() {
		return $this->backupFile;
	}

	public function setBackupFile($backupFile) {
		$this->backupFile = $backupFile;
		$this->queryParameters["BackupFile"]=$backupFile;
	}

	public function getBackupId() {
		return $this->backupId;
	}

	public function setBackupId($backupId) {
		$this->backupId = $backupId;
		$this->queryParameters["BackupId"]=$backupId;
	}

	public function getOwnerAccount() {
		return $this->ownerAccount;
	}

	public function setOwnerAccount($ownerAccount) {
		$this->ownerAccount = $ownerAccount;
		$this->queryParameters["OwnerAccount"]=$ownerAccount;
	}

	public function getDBInstanceId() {
		return $this->dBInstanceId;
	}

	public function setDBInstanceId($dBInstanceId) {
		$this->dBInstanceId = $dBInstanceId;
		$this->queryParameters["DBInstanceId"]=$dBInstanceId;
	}

	public function getOwnerId() {
		return $this->ownerId;
	}

	public function setOwnerId($ownerId) {
		$this->ownerId = $ownerId;
		$this->queryParameters["OwnerId"]=$ownerId;
	}

}


text:
import React, { Component } from 'react';
import { View, Text, Image, Dimensions } from 'react-native';
import { Container, Content, Icon } from 'native-base';
import Carousel from 'react-native-looped-carousel';

const { width, height } = Dimensions.get('window');
const Styles = {
  viewStyle:{
    justifyContent:'center',
    alignItems: 'center',
    flex: 1
  },
  iconStyle: {
    fontSize: 130,
    color: 'whitesmoke'
  },
  textStyle: {
    fontSize: 16,
    color: 'whitesmoke',
    margin: 20,
    textAlign: 'center'
  }
}
const { viewStyle, iconStyle, textStyle } = Styles;

class InfoCarousel extends Component {

    constructor(props) {
        super(props);

        this.state = {
            size: { width, height },
        };
    }

    _onLayoutDidChange = (e) => {
        const layout = e.nativeEvent.layout;
        this.setState({ size: { width: layout.width, height: layout.height } });
    }

    render() {
        return (
            <View style={{ flex: 1 }} onLayout={this._onLayoutDidChange}>
                <Carousel
                    delay={3000}
                    style={this.state.size}
                    autoplay = {true}
                    pageInfo = {false}
                    bullets  = {true}
                >
                    <View style={viewStyle}>
                        <Icon name='ios-mail' style={iconStyle}/>
                        <Text style={textStyle}> Envie emails marketings em massa,
                            {"\n"}
                            facil e rapido.
                          </Text>
                    </View>
                    <View style={viewStyle}>
                        <Icon name='ios-list-box' style={iconStyle}/>
                        <Text style={textStyle}>
                          Mais de 80 opções de Templates ja prontas para uso.
                        </Text>
                    </View>
                    <View style={viewStyle}>
                        <Icon name='ios-person-add' style={iconStyle}/>
                        <Text style={textStyle}>
                          Sem limites de Base de contatos, adicione quantos emails quiser.
                        </Text>
                    </View>
                    <View style={viewStyle}>
                        <Icon name='ios-trending-up' style={iconStyle}/>
                        <Text style={textStyle}>
                          Acompanhe suas Campanhas com relatorios tem tempo real
                        </Text>
                    </View>
                </Carousel>
            </View>
        );
    }
}

export { InfoCarousel }


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical">

    <ImageView
        android:id="@+id/img_tip_logo"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:visibility="gone"
        android:src="@drawable/no_content_tip" />
    <ProgressBar
        android:id="@+id/progress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:indeterminateDrawable="@drawable/loading_dialog_progressbar" />
    <TextView
        android:id="@+id/tv_tips"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="15dp"
        android:textColor="?attr/dayNightOneTextColor"
        android:textSize="@dimen/font_normal"
        android:text="加载中..." />
    <Button
        android:id="@+id/bt_operate"
        android:layout_width="wrap_content"
        android:layout_height="35dp"
        android:layout_marginTop="10dp"
        android:background="@drawable/selector_gray"
        android:paddingBottom="5dp"
        android:paddingLeft="20dp"
        android:paddingRight="20dp"
        android:paddingTop="5dp"
        android:textColor="?attr/dayNightOneTextColor"
        android:visibility="gone"
        tools:text="@string/reload" />
</LinearLayout>


text:
```
I know is unecessarly upload playbooks and ansible stuffs to server, but, in this specific case
my original idea was let it 100% automaticly by only one command, so, I've installed everything
in the server side wihtout install anything in local machine.
```


text:
<title>Mock Page</title>

Home
<wicket:link>
  Home
</wicket:link>
<wicket:link autolink="false">
  Home
</wicket:link>
<wicket:link autolink="true">
  Home
</wicket:link>
<wicket:link autolink="false">
  Home
  <wicket:link autolink="true">
    Home
  </wicket:link>
</wicket:link>

<wicket:link autolink="false"/>
Home
<wicket:link autolink="true">
Home
<link href="resources/org.apache.wicket.markup.html.link.AutolinkPage_1/test_myStyle.css"/>
<link href="resources/org.apache.wicket.markup.html.link.AutolinkPage_1/test2_myStyle.css"/>
<link href="resources/org.apache.wicket.markup.html.link.AutolinkPage_1/test3_myStyle_de_DE.css"/>
<link href="resources/org.apache.wicket.markup.html.link.AutolinkPage_1/$up$/$up$/html/link/test2_myStyle.css"/>
Home
Home
  Google
</wicket:link>


text:
/*
 * Changes for SnappyData data platform.
 *
 * Portions Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
 *
 * 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. See accompanying
 * LICENSE file.
 */

//--------Headers----------
#include <chrono>
#include <boost/assign/list_of.hpp>
#include <boost/assign.hpp>
#include <boost/thread.hpp>
#include <thrift/Thrift.h>
#include <thrift/transport/TSSLSocket.h>
#include <thrift/transport/TSocket.h>
#include <thrift/transport/TBufferTransports.h>
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/protocol/TCompactProtocol.h>

#include <SQLState.h>
#include <Utils.h>
#include <boost/range/algorithm.hpp>
#include <boost/make_shared.hpp>
#include "ControlConnection.h"
#include "NetConnection.h"
#include <map>
using namespace io::snappydata;
using namespace io::snappydata::client;
using namespace io::snappydata::client::impl;
using namespace io::snappydata::thrift;

//----private static data member initialiazation----
std::vector<std::unique_ptr<ControlConnection> > ControlConnection::s_allConnections;
boost::mutex ControlConnection::s_allConnsLock;

ControlConnection::ControlConnection(ClientService* service) :
    m_serverGroups(service->getServerGrps()) {
  m_locators = service->getLocators();
  m_framedTransport = service->isFrameTransport();
  m_snappyServerType = service->getServerType();
  m_controlHost = service->getCurrentHostAddress();
  boost::assign::insert(m_snappyServerTypeSet)(
      service->getServerType());
  std::copy(m_locators.begin(), m_locators.end(),
      std::inserter(m_controlHostSet, m_controlHostSet.end()));
  m_controlLocator = nullptr;
}

const boost::optional<ControlConnection&> ControlConnection::getOrCreateControlConnection(
    const std::vector<thrift::HostAddress>& hostAddrs,
    ClientService* service, const std::exception& failure) {

  // loop through all ControlConnections since size of this global list is
  // expected to be in single digit (total number of distributed systems)

  boost::lock_guard<boost::mutex> globalGuard(s_allConnsLock);

  signed short index = static_cast<signed short>(s_allConnections.size());
  signed short allConnSize = index;
  while (--index >= 0) {
    const std::unique_ptr<ControlConnection>& controlConn =
        s_allConnections.at(index);

    boost::lock_guard<boost::mutex> serviceGuard(controlConn->m_lock);
    std::vector<thrift::HostAddress> _locators = controlConn->m_locators;
    for (thrift::HostAddress hostAddr : hostAddrs) {
      auto result = std::find(_locators.begin(), _locators.end(), hostAddr);

      if (result == _locators.end()) {
        continue;
      } else {
        auto serviceServerType = service->getServerType();
        auto contrConnServerType = controlConn->m_snappyServerType;
        if (contrConnServerType == serviceServerType) {
          return *controlConn;
        } else {
          thrift::SnappyException ex;
          std::string portStr;
          Utils::convertIntToString(hostAddr.port, portStr);
          std::string msg = hostAddr.hostName + ":" + portStr
              + " as registered but having different type "
              + Utils::getServerTypeString(contrConnServerType)
              + " than connection "
              + Utils::getServerTypeString(serviceServerType);
          SnappyExceptionData snappyExData;
          snappyExData.__set_sqlState("08006");
          snappyExData.__set_reason(msg);
          // errorCode matches product ExceptionSeverity.SESSION_SEVERITY
          snappyExData.__set_errorCode(40000);
          ex.__set_exceptionData(snappyExData);
          ex.__set_serverInfo(hostAddr.hostName + ":" + portStr);
          throw ex;
        }
      }
    }
  }

  {  // first attempt of creating connection
    // if we reached here, then need to create a new ControlConnection
    std::unique_ptr<ControlConnection> controlConn(
        new ControlConnection(service));
    thrift::HostAddress preferredServer;
    controlConn->getPreferredServer(preferredServer, failure, service ,true);
    // check again if new control host already exist
    index = static_cast<signed short>(s_allConnections.size());
    while (--index >= 0) {
      const std::unique_ptr<ControlConnection>& controlConn =
          s_allConnections.at(index);
      boost::lock_guard<boost::mutex> serviceGuard(controlConn->m_lock);
      std::vector<thrift::HostAddress> _locators = controlConn->m_locators;
      auto result = std::find(_locators.begin(), _locators.end(),
          preferredServer);
      if (result == _locators.end()) {
        return *controlConn;
      }
    }
    s_allConnections.push_back(std::move(controlConn));
  }
  return *s_allConnections.back();
}

void ControlConnection::getLocatorPreferredServer(
    thrift::HostAddress& prefHostAddr,
    std::set<thrift::HostAddress>& failedServers,
    std::set<std::string> serverGroups) {
  m_controlLocator->getPreferredServer(prefHostAddr, m_snappyServerTypeSet,
      serverGroups, failedServers);
}

void ControlConnection::getPreferredServer(
    thrift::HostAddress& preferredServer, const std::exception& failure,
    ClientService* service, bool forFailover) {
  std::set<thrift::HostAddress> failedServers;
  std::set<std::string> serverGroups;
  return getPreferredServer(preferredServer, failure, failedServers,
      serverGroups, service, forFailover);
}

void ControlConnection::getPreferredServer(
    thrift::HostAddress& preferredServer, const std::exception& failure,
    std::set<thrift::HostAddress>& failedServers,
    std::set<std::string>& serverGroups, ClientService* service,
    bool forFailover) {
  if (m_controlLocator == nullptr) {
    failoverToAvailableHost(failedServers, false, failure, service);
    forFailover = true;
  }
  boost::lock_guard<boost::mutex> localGuard(m_lock);
  bool firstCall = true;
  while (true) {
    try {
      if (forFailover) {
        //refresh the full host list
        std::vector<HostAddress> prefServerAndAllHosts;
        m_controlLocator->getAllServersWithPreferredServer(
            prefServerAndAllHosts, m_snappyServerTypeSet, serverGroups,
            failedServers);
        if (!prefServerAndAllHosts.empty()) {
          std::vector<HostAddress> allHosts(prefServerAndAllHosts.begin() + 1,
              prefServerAndAllHosts.end());
          refreshAllHosts(allHosts);
          preferredServer = prefServerAndAllHosts.at(0);
        }
      } else {
        getLocatorPreferredServer(preferredServer, failedServers,
            serverGroups);
      }
      if (preferredServer.port <= 0) {
        /*For this case we don't have a locator or locator unable to
         * determine a preferred server, so choose some server randomly
         * as the "preferredServer". In case all servers have failed then
         * the search below will also fail.
         * Remove controlHost from failedServers since it is known to be
         * working at this point (e.g after a reconnect)
         * */
        std::set<thrift::HostAddress> skipServers = failedServers;
        if (!failedServers.empty()
            && std::find(failedServers.begin(), failedServers.end(),
                m_controlHost) != failedServers.end()) {
          //don't change the original failure list since that is proper
          // for the current operation but change for random server search
          skipServers.erase(m_controlHost);
        }
        searchRandomServer(skipServers, failure, preferredServer);
      }
      return;
    } catch (thrift::SnappyException &snEx) {
      FailoverStatus status = NetConnection::getFailoverStatus(
          snEx.exceptionData.sqlState, snEx.exceptionData.errorCode, snEx);
      if (status == FailoverStatus::NONE) {
        throw unexpectedError(snEx, m_controlHost);
      } else if (status == FailoverStatus::RETRY) {
        forFailover = true;
        continue;
      }
    } catch (const TException &tex) {
      //Search for a new host for locator query
      // for the first call do not mark controlhost as failed but retry(e.g. for a reconnect case)
      if (firstCall) {
        firstCall = false;
      } else {
        failedServers.insert(m_controlHost);
      }
      m_controlLocator->getOutputProtocol()->getTransport()->close();
      failoverToAvailableHost(failedServers, true, tex, service);
    } catch (std::exception &ex) {
      throw unexpectedError(ex, m_controlHost);
    }
    forFailover = true;
  }
}

void ControlConnection::searchRandomServer(
    const std::set<thrift::HostAddress>& skipServers,
    const std::exception& failure, thrift::HostAddress& hostAddress) {

  std::vector<thrift::HostAddress> searchServers;
  // Note: Do not use unordered_set -- reason is http://www.cplusplus.com/forum/general/198319/
  std::copy(m_controlHostSet.begin(), m_controlHostSet.end(),
      std::inserter(searchServers, searchServers.end()));
  if (searchServers.size() > 2) {
    std::random_shuffle(searchServers.begin(), searchServers.end());
  }
  bool findIt = false;
  for (thrift::HostAddress host : searchServers) {
    if (host.serverType == m_snappyServerType
        && !(!skipServers.empty()
            && std::find(skipServers.begin(), skipServers.end(), host)
                != skipServers.end())) {
      hostAddress = host;
      findIt = true;
      break;
    }
  }
  if (findIt) return;
  failoverExhausted(skipServers, failure);
}

void ControlConnection::failoverToAvailableHost(
    std::set<thrift::HostAddress>& failedServers,
    bool checkFailedControlHosts, const std::exception& failure,
    ClientService* service) {
  boost::lock_guard<boost::mutex> localGuard(m_lock);
  for (auto iterator = m_controlHostSet.begin();
      iterator != m_controlHostSet.end(); ++iterator) {
    thrift::HostAddress controlAddr = *iterator;
    if (checkFailedControlHosts && !failedServers.empty()
        && (failedServers.find(controlAddr) != failedServers.end())) {
      continue;
    }
    m_controlLocator.reset(nullptr);

    boost::shared_ptr<TTransport> inTransport = nullptr;
    boost::shared_ptr<TTransport> outTransport = nullptr;
    boost::shared_ptr<TProtocol> inProtocol = nullptr;
    boost::shared_ptr<TProtocol> outProtocol = nullptr;

    try {
      while (true) {
        if (outTransport != nullptr) {
          outTransport->close();
        }
        boost::shared_ptr<TTransport> tTransport = nullptr;
        if (m_snappyServerType == thrift::ServerType::THRIFT_LOCATOR_BP_SSL
            || m_snappyServerType == thrift::ServerType::THRIFT_LOCATOR_CP_SSL
            || m_snappyServerType == thrift::ServerType::THRIFT_SNAPPY_BP_SSL
            || m_snappyServerType
                == thrift::ServerType::THRIFT_SNAPPY_CP_SSL) {
          tTransport = service->createSSLSocket(controlAddr.hostName, controlAddr.port);
        } else if (m_snappyServerType == thrift::ServerType::THRIFT_LOCATOR_BP
            || m_snappyServerType == thrift::ServerType::THRIFT_LOCATOR_CP
            || m_snappyServerType == thrift::ServerType::THRIFT_SNAPPY_BP
            || m_snappyServerType == thrift::ServerType::THRIFT_SNAPPY_CP) {
          tTransport = boost::make_shared<TSocket>(controlAddr.hostName,
              controlAddr.port);
        }
        tTransport->open();
        TTransportFactory* transportFactory = nullptr;
        if (m_framedTransport) {
          transportFactory = new TFramedTransportFactory();
        } else {
          transportFactory = new TTransportFactory();
        }
        inTransport = transportFactory->getTransport(tTransport);
        outTransport = transportFactory->getTransport(tTransport);
        delete transportFactory;
        transportFactory = 0;

        TProtocolFactory* protocolFactory = nullptr;
        if (m_snappyServerType == thrift::ServerType::THRIFT_LOCATOR_BP
            || m_snappyServerType == thrift::ServerType::THRIFT_LOCATOR_BP_SSL
            || m_snappyServerType == thrift::ServerType::THRIFT_SNAPPY_BP
            || m_snappyServerType
                == thrift::ServerType::THRIFT_SNAPPY_BP_SSL) {
          protocolFactory = new TBinaryProtocolFactory();

        } else {
          protocolFactory = new TCompactProtocolFactory();
        }
        inProtocol = protocolFactory->getProtocol(inTransport);
        outProtocol = protocolFactory->getProtocol(outTransport);

        delete protocolFactory;
        protocolFactory = 0;
        break;
      }
    } catch (const TException&) {
      failedServers.insert(controlAddr);
      if (outTransport != nullptr) {
        outTransport->close();
      }
      continue;
    } catch (std::exception &ex) {
      throw unexpectedError(ex, controlAddr);
    }
    m_controlHost = controlAddr;
    m_controlLocator.reset(
        new thrift::LocatorServiceClient(inProtocol, outProtocol));
    return;
  }
  failoverExhausted(failedServers, failure);
}

const thrift::SnappyException ControlConnection::unexpectedError(
    const std::exception& ex, const thrift::HostAddress& host) {

  close(false);
  thrift::SnappyException snappyEx;
  SnappyExceptionData snappyExData;
  snappyExData.__set_sqlState(
      std::string(SQLState::UNKNOWN_EXCEPTION.getSQLState()));
  snappyExData.__set_reason(ex.what());

  snappyEx.__set_exceptionData(snappyExData);

  std::string portNum;
  Utils::convertIntToString(host.port, portNum);
  snappyEx.__set_serverInfo(
      host.hostName + host.ipAddress + portNum
          + Utils::getServerTypeString(host.serverType));

  return snappyEx;
}

void ControlConnection::refreshAllHosts(
    const std::vector<thrift::HostAddress>& allHosts) {
  //refresh the locator list first(keep old but push current to front)
  std::vector<thrift::HostAddress> locators = m_locators;
  std::vector<thrift::HostAddress> newLocators(locators.size());

  for (HostAddress host : allHosts) {
    thrift::ServerType::type sType = host.serverType;
    if (sType == ServerType::THRIFT_LOCATOR_BP
        || sType == ServerType::THRIFT_LOCATOR_BP_SSL
        || sType == ServerType::THRIFT_LOCATOR_CP
        || sType == ServerType::THRIFT_LOCATOR_CP_SSL
        || (std::find(locators.begin(), locators.end(), host)
            != locators.end())) {
      newLocators.push_back(host);
    }
  }
  for (HostAddress host : locators) {
    if (!(std::find(newLocators.begin(), newLocators.end(), host)
        != newLocators.end())) {
      newLocators.push_back(host);
    }
  }

  m_locators = newLocators;
  // refresh the new server list

  // we remove all from the set and re-populate since we would like
  // to prefer the ones coming as "allServers" with "isServer" flag
  // correctly set rather than the ones in "secondary-locators"
  m_controlHostSet.clear();
  m_controlHostSet.insert(newLocators.begin(), newLocators.end());
  m_controlHostSet.insert(allHosts.begin(), allHosts.end());
}

void ControlConnection::failoverExhausted(
    const std::set<thrift::HostAddress>& failedServers,
    const std::exception& failure) {

  std::string failedServerString;
  for (thrift::HostAddress host : failedServers) {
    std::string portStr;
    Utils::convertIntToString(host.port, portStr);
    if (!failedServerString.empty()) failedServerString.append(",");
    failedServerString.append(host.hostName).append(":").append(portStr);
  }
  thrift::SnappyException snappyEx;
  SnappyExceptionData snappyExData;
  snappyExData.__set_sqlState(
      std::string(SQLState::DATA_CONTAINER_CLOSED.getSQLState()));
  std::string reason = "Failed after trying all available servers: {";
  reason.append(failedServerString).append("}");
  // failure is not empty exception
  if (std::string(failure.what()).compare("std::exception") != 0) {
    reason.append(" and ").append(failure.what());
  }
  snappyExData.__set_reason(reason);
  snappyEx.__set_exceptionData(snappyExData);
  snappyEx.__set_serverInfo(failedServerString);
  throw snappyEx;
}

void ControlConnection::getConnectedHost(thrift::HostAddress& hostAddr,
    thrift::HostAddress& connectedHost) {
  boost::lock_guard<boost::mutex> controlConnLock(this->m_lock);

  auto it = std::find(m_controlHostSet.begin(),m_controlHostSet.end(),hostAddr);//;m_controlHostSet.find(hostAddr);
  if (it != m_controlHostSet.end()) {
    connectedHost = *it;
    return;
  }

  for (auto iterator = m_controlHostSet.begin();
      iterator != m_controlHostSet.end(); ++iterator) {
    auto host = *iterator;
    if (host.__isset.isCurrent && host.isCurrent) {
      connectedHost = host;
    }
  }
}

void ControlConnection::close(bool clearGlobal) {
  m_controlHost = thrift::HostAddress();
  if (m_controlLocator != nullptr) {
    m_controlLocator->getOutputProtocol()->getTransport()->close();
    m_controlLocator.reset(nullptr);
  }
  if (clearGlobal) {
    boost::lock_guard<boost::mutex> globalGuard(s_allConnsLock);
    auto thisPtr = std::unique_ptr<ControlConnection>(this);
    auto pos = std::find(s_allConnections.begin(), s_allConnections.end(),
        thisPtr);
    // don't delete "this" here
    thisPtr.release();
    if (pos != s_allConnections.end()) {
      s_allConnections.erase(pos);
    }
  }
}


text:
<?php

include_once('_init.php');

$authenticated_user = $_SESSION['user'];
$authenticated_user_object = User::withUserObjectData($_SESSION['user']);

if (isset($_POST['action'])) {

    switch ($_POST['action']) {

        case "COURSE_ADD_STAFF":
            if (!$_POST['course_id'] || !$_POST['user_id']) {
                echo "ERROR: Parameter fehlen.";
                break;
            }

            if($authenticated_user['id'] != $_POST['user_id'] &&
                !$authenticated_user_object->hasPermission(array('Administrator'))) {

                echo "ERROR: Nicht authorisiert.";
                break;
            }

            if(!userIsAuthorizedForCourse($_POST['user_id'], $_POST['course_id'])) {

                echo "ERROR: Du bist für diesen Veranstaltungstypen nicht freigeschalten.";
                break;
            }

            $success = addStaff($_POST['course_id'], $_POST['user_id']);

            if ($success) echo "SUCCESS";
            else echo "ERROR: Datenbank Fehler.";
            break;

        case "COURSE_REMOVE_STAFF":
            if (!$_POST['course_id'] || !$_POST['user_id']) {
                echo "ERROR: Parameters missing";
                break;
            }

            if($authenticated_user['id'] != $_POST['user_id'] &&
                !$authenticated_user_object->hasPermission(array('Administrator'))) {

                echo "ERROR: Nicht authorisiert.";
                break;
            }

            // check deadline
            if($authenticated_user['id'] == $_POST['user_id'] &&
                !$authenticated_user_object->hasPermission(array('Administrator'))) {

                if(!isset($_POST['deadline'])) {
                    echo "ERROR: Deadline nicht gesetzt.";
                    break;
                }
                else {
                    $deadline = intval($_POST['deadline']) - 1;
                    $course = getCourse($_POST['course_id']);

                    $durationString = 'P' . $deadline . 'D';
                    $temp_date = new DateTime();
                    $deadline_date = $temp_date->add(new DateInterval($durationString));

                    if($course['day_interval'] == 0 && $course['month_interval'] == 0) {

                        if($deadline_date > $course['dates'][0]['date']) {
                            echo "ERROR: Du kannst dich nicht mehr austragen. Deadline {$deadline} Tage vor Kursbeginn.";
                            break;
                        }

                        if(!$course['staff_cancel']) {
                            echo "ERROR: Du kannst dich nicht austragen. Bitte kontaktiere den Kursverantwortlichen.";
                            break;
                        }
                    }
                }
            }

            $success = removeStaff($_POST['course_id'], $_POST['user_id']);

            if ($success) echo "SUCCESS";
            else echo "ERROR: Datenbank Fehler.";
            break;

        case "COURSE_ADD_EXCEPTION":
            if (!$_POST['course_id'] || !$_POST['date'] || !$_POST['user_id']) {
                echo "ERROR: Parameter fehlen.";
                break;
            }

            if($authenticated_user['id'] != $_POST['user_id'] &&
                !$authenticated_user_object->hasPermission(array('Administrator'))) {

                echo "ERROR: Nicht authorisiert.";
                break;
            }

            $cancellation = isset($_POST['cancellation']) && $_POST['cancellation'] == 1;
            $success = addCourseException($_POST['course_id'], $_POST['date'], $cancellation);

            if ($success) echo "SUCCESS";
            else echo "ERROR: Datenbank Fehler.";
            break;

        case "USER_ADD_ROLE":
            if(!$authenticated_user_object->hasPermission(array('Administrator'))) {
                echo "ERROR: Nicht authorisiert.";
                break;
            }
            if (!$_POST['user_id'] || !$_POST['role_id']) {
                echo "ERROR: Parameter fehlen.";
                break;
            }

            $success = addRole($_POST['user_id'], $_POST['role_id']);

            if ($success) echo "SUCCESS";
            else echo "ERROR: Datenbank Fehler.";
            break;

        case "USER_REMOVE_ROLE":
            if(!$authenticated_user_object->hasPermission(array('Administrator'))) {
                echo "ERROR: Nicht authorisiert.";
                break;
            }
            if (!$_POST['user_id'] || !$_POST['role_id']) {
                echo "ERROR: Parameter fehlen.";
                break;
            }

            $success = removeRole($_POST['user_id'], $_POST['role_id']);

            if ($success) echo "SUCCESS";
            else echo "ERROR: Datenbank Fehler.";
            break;

        case "USER_ADD_EVENT":
            if(!$authenticated_user_object->hasPermission(array('Administrator'))) {
                echo "ERROR: Nicht authorisiert.";
                break;
            }
            if (!$_POST['user_id'] || !$_POST['event_id']) {
                echo "ERROR: Parameter fehlen.";
                break;
            }

            $success = addEventToWhitelist($_POST['user_id'], $_POST['event_id']);

            if ($success) echo "SUCCESS";
            else echo "ERROR: Datenbank Fehler.";
            break;

        case "USER_REMOVE_EVENT":
            if(!$authenticated_user_object->hasPermission(array('Administrator'))) {
                echo "ERROR: Nicht authorisiert.";
                break;
            }
            if (!$_POST['user_id'] || !$_POST['event_id']) {
                echo "ERROR: Parameter fehlen.";
                break;
            }

            $success = removeEventFromWhitelist($_POST['user_id'], $_POST['event_id']);

            if ($success) echo "SUCCESS";
            else echo "ERROR: Datenbank Fehler.";
            break;

        case "USER_DELETE":
            if(!$authenticated_user_object->hasPermission(array('Administrator'))) {
                echo "ERROR: Nicht authorisiert.";
                break;
            }
            if (!$_POST['user_id']) {
                echo "ERROR: Parameter fehlt.";
                break;
            }

            $success = deleteItem($_POST['user_id'], "user");

            if ($success) echo "SUCCESS";
            else echo "ERROR: Datenbank Fehler.";
            break;

        default:
            echo "Unknown.";
            break;
    }
}

?>


text:
Scotty is a high performance, scalable collector for the
[tricorder](https://github.com/Symantec/tricorder) metrics publishing library.
Scotty provides a RESTful API to grab the latest polled metrics, and it can
push metrics to various persistent stores.

Please see the
[design document](https://docs.google.com/document/d/142Llj30LplgxWhOLOprqH59hS01EJ9iC1THV3no5oy0/pub)
and the
[online code documentation](https://godoc.org/github.com/Symantec/scotty)
for more information.

## Contributions

Prior to receiving information from any contributor, Symantec requires
that all contributors complete, sign, and submit Symantec Personal
Contributor Agreement (SPCA).  The purpose of the SPCA is to clearly
define the terms under which intellectual property has been
contributed to the project and thereby allow Symantec to defend the
project should there be a legal dispute regarding the software at some
future time. A signed SPCA is required to be on file before an
individual is given commit privileges to the Symantec open source
project.  Please note that the privilege to commit to the project is
conditional and may be revoked by Symantec.

If you are employed by a corporation, a Symantec Corporate Contributor
Agreement (SCCA) is also required before you may contribute to the
project.  If you are employed by a company, you may have signed an
employment agreement that assigns intellectual property ownership in
certain of your ideas or code to your company.  We require a SCCA to
make sure that the intellectual property in your contribution is
clearly contributed to the Symantec open source project, even if that
intellectual property had previously been assigned by you.

Please complete the SPCA and, if required, the SCCA and return to
Symantec at:

Symantec Corporation
Legal Department
Attention:  Product Legal Support Team
350 Ellis Street
Mountain View, CA 94043

Please be sure to keep a signed copy for your records.

## LICENSE

Copyright 2015 Symantec Corporation.

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.

## Building and Running Tests

When building scotty for the very first time, perform the following steps to
install the correct dependencies.

```
go get github.com/Symantec/scotty
cd $GOPATH/src/github.com/Symantec/scotty
make getdeps
```

From the top level directory of the scotty project:

To run all the tests

```
go test -v ./...
```

To rebuild after doing code changes

```
go install ./...
```


text:
title: Math Hypot
localeTitle: Hipoteca da Matemática
---
## Hipoteca da Matemática

Este é um esboço. [Ajude nossa comunidade a expandi-lo](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/math/math-hypot/index.md) .

[Este guia de estilo rápido ajudará a garantir que sua solicitação de recebimento seja aceita](https://github.com/freecodecamp/guides/blob/master/README.md) .

#### Mais Informações:


text:
package oracle

import (
	"fmt"
	"go/token"

	"code.google.com/p/go.tools/go/callgraph"
	"code.google.com/p/go.tools/go/ssa"
	"code.google.com/p/go.tools/oracle/serial"
)

// Callers reports the possible callers of the function
// immediately enclosing the specified source location.
//
func callers(o *Oracle, qpos *QueryPos) (queryResult, error) {
	pkg := o.prog.Package(qpos.info.Pkg)
	if pkg == nil {
		return nil, fmt.Errorf("no SSA package")
	}
	if !ssa.HasEnclosingFunction(pkg, qpos.path) {
		return nil, fmt.Errorf("this position is not inside a function")
	}

	buildSSA(o)

	target := ssa.EnclosingFunction(pkg, qpos.path)
	if target == nil {
		return nil, fmt.Errorf("no SSA function built for this location (dead code?)")
	}

	// Run the pointer analysis, recording each
	// call found to originate from target.
	o.ptaConfig.BuildCallGraph = true
	cg := ptrAnalysis(o).CallGraph
	cg.DeleteSyntheticNodes()
	edges := cg.CreateNode(target).In
	// TODO(adonovan): sort + dedup calls to ensure test determinism.

	return &callersResult{
		target:    target,
		callgraph: cg,
		edges:     edges,
	}, nil
}

type callersResult struct {
	target    *ssa.Function
	callgraph *callgraph.Graph
	edges     []*callgraph.Edge
}

func (r *callersResult) display(printf printfFunc) {
	root := r.callgraph.Root
	if r.edges == nil {
		printf(r.target, "%s is not reachable in this program.", r.target)
	} else {
		printf(r.target, "%s is called from these %d sites:", r.target, len(r.edges))
		for _, edge := range r.edges {
			if edge.Caller == root {
				printf(r.target, "the root of the call graph")
			} else {
				printf(edge, "\t%s from %s", edge.Description(), edge.Caller.Func)
			}
		}
	}
}

func (r *callersResult) toSerial(res *serial.Result, fset *token.FileSet) {
	var callers []serial.Caller
	for _, edge := range r.edges {
		callers = append(callers, serial.Caller{
			Caller: edge.Caller.Func.String(),
			Pos:    fset.Position(edge.Pos()).String(),
			Desc:   edge.Description(),
		})
	}
	res.Callers = callers
}


text:
package com.github.cuzfrog.psmm;

import com.github.cuzfrog.psmm.Data;

final class UniqueMessage<K,T> extends AbstractMessage<K,T> {

	public UniqueMessage(Messages.Style type,Message<K,T> parent, Data data) {
		super(type, parent, data);
	}

}


text:
package com.qxcmp.web.view.elements.html;

import lombok.Getter;
import lombok.Setter;

/**
 * 标题3
 *
 * @author aaric
 */
@Getter
@Setter
public class H3 extends HeaderElement {

    public H3() {
    }

    public H3(String text) {
        super(text);
    }

    @Override
    public String getFragmentName() {
        return "h3";
    }
}


text:
layout: example.html
title: Image Filters
shortdesc: Apply a filter to imagery
docs: >

Layer rendering can be manipulated in precompose and postcompose event listeners.
  These listeners get an event with a reference to the Canvas rendering context.
  In this example, the postcompose listener applies a filter to the image data.

tags: "filter, image manipulation"
cloak:
  AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
---

<select id="kernel" name="kernel">
  <option>none</option>
  <option selected>sharpen</option>
  <option value="sharpenless">sharpen less</option>
  <option>blur</option>
  <option>shadow</option>
  <option>emboss</option>
  <option value="edge">edge detect</option>
</select>


text:
package com.amazonaws.services.kendra.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum WebCrawlerMode {

    HOST_ONLY("HOST_ONLY"),
    SUBDOMAINS("SUBDOMAINS"),
    EVERYTHING("EVERYTHING");

    private String value;

    private WebCrawlerMode(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return WebCrawlerMode corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static WebCrawlerMode fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (WebCrawlerMode enumEntry : WebCrawlerMode.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
unsigned int IRKE_COMMON::MONITOR = 0;
size_t KMER_SIZE = 25;
int MAX_THREADS = 6;

// various devel params
bool IRKE_COMMON::__DEVEL_no_kmer_sort = false;

void populate_kmer_counter (KmerCounter& kcounter, string& kmers_fasta_file);
vector<unsigned int> compute_kmer_coverage (string& sequence, KmerCounter& kcounter);
unsigned int median_coverage (vector<unsigned int>);
string usage(ArgProcessor args);
long sum(vector<unsigned int>& vals);
float mean(vector<unsigned int>& vals);
float stDev(vector<unsigned int>& vals);
int runMe(int argc, char* argv[]);

int main(int argc, char* argv[]) {

    try {
        return(runMe(argc, argv));
    }
    catch (string errmsg) {

        cerr << "ERROR encountered: " << errmsg;
        exit(1);

    }

    return(0);
}

int runMe(int argc, char* argv[]) {

    ArgProcessor args(argc, argv);
    if(args.isArgSet("--help") ||
       (!(args.isArgSet("--reads") && args.isArgSet("--kmers")))) {
        cerr << usage(args) << endl << endl;
        exit(1);
    }
    string reads_fasta_file = args.getStringVal("--reads");
    string kmers_fasta_file = args.getStringVal("--kmers");
    bool is_DS = (! args.isArgSet("--SS"));
    if(args.isArgSet("--kmer_size")) {
        KMER_SIZE = args.getIntVal("--kmer_size");
        if(KMER_SIZE < 20) {
            cerr << "Error, min kmer size is 20";
            exit(2);
        }
    }
    if(args.isArgSet("--monitor")) {
        IRKE_COMMON::MONITOR = args.getIntVal("--monitor");
    }
    if (args.isArgSet("--num_threads")) {
        int num_threads = args.getIntVal("--num_threads");
        if (num_threads < MAX_THREADS) {
            omp_set_num_threads(num_threads);
        }
        else {
            // set to max
            omp_set_num_threads(MAX_THREADS);
        }
    }

    if(omp_get_max_threads() > MAX_THREADS) {
        omp_set_num_threads(MAX_THREADS);
    }
    KmerCounter kcounter (KMER_SIZE, is_DS);
    populate_kmer_counter(kcounter, kmers_fasta_file);
    Fasta_reader fasta_reader(reads_fasta_file);
    bool write_coverage_info = args.isArgSet("--capture_coverage_info");

    int start_time = time(NULL);

    #pragma omp parallel
    while (true) {

        if (! fasta_reader.hasNext())
            break;

        int myTid = omp_get_thread_num();

        Fasta_entry fe = fasta_reader.getNext();
        string sequence = fe.get_sequence();
        if(sequence == "")
            continue;

        string header = fe.get_header();
        vector<unsigned int> kmer_coverage = compute_kmer_coverage(sequence, kcounter);
        unsigned int median_cov = median_coverage(kmer_coverage);
        float mean_cov = mean(kmer_coverage);
        float stdev = stDev(kmer_coverage);
        float pct_stdev_of_avg = stdev/mean_cov*100;
        stringstream stats_text;

        stats_text << median_cov << "\t"
                   << mean_cov << "\t"
                   << stdev << "\t"
                   << pct_stdev_of_avg << "\t"
                   << fe.get_accession();

        stats_text << "\tthread:" << myTid;

        if(write_coverage_info) {
            // add the coverage info
            stats_text << "\t";
            for (size_t i = 0; i < kmer_coverage.size(); i++) {
                stats_text<< kmer_coverage[i];
                if(i != kmer_coverage.size() - 1) {
                    stats_text<< ",";
                }
            }
        }
        stats_text << endl;

        #pragma omp critical
        {
            cout << stats_text.str();
        }

        if (mean_cov < 0) {
            cerr << "ERROR, cannot have negative coverage!!" << endl;
            exit(1);
        }

    }

    int end_time = time(NULL);

    cerr << "STATS_GENERATION_TIME: " << (end_time - start_time) << " seconds." << endl;

    return(0);
}

void populate_kmer_counter(KmerCounter& kcounter, string& kmers_fasta_file) {
    // code largely copied from IRKE.cpp
    int i, myTid;
    unsigned long sum,
        *record_counter = new unsigned long[omp_get_max_threads()];
    unsigned long start, end;
    // init record counter
    for (int i = 0; i < omp_get_max_threads(); i++) {
        record_counter[i] = 0;
    }
    cerr << "-reading Kmer occurrences..." << endl;
    start = time(NULL);
    Fasta_reader fasta_reader(kmers_fasta_file);
    #pragma omp parallel private (myTid)
    {
        myTid = omp_get_thread_num();
        record_counter[myTid] = 0;
        while (true) {
            Fasta_entry fe = fasta_reader.getNext();
            if(fe.get_sequence() == "") break;
            record_counter[myTid]++;
            if(IRKE_COMMON::MONITOR) {
                if(myTid == 0 && record_counter[myTid] % 100000 == 0)
                    {
                        sum = record_counter[0];
                        for (i=1; i<omp_get_num_threads(); i++)
                            sum+= record_counter[i];
                        cerr << "\r [" << sum/1000000 << "M] Kmers parsed.     ";
                    }
            }
            string seq = fe.get_sequence();
            if(seq.length() != KMER_SIZE) {
                cerr << "ERROR: kmer " << seq << " is not of length: " << KMER_SIZE << endl;
                continue;
            }
            kmer_int_type_t kmer = kcounter.get_kmer_intval(seq);
            unsigned int count = atoi(fe.get_header().c_str());
            kcounter.add_kmer(kmer, count);
        }
    }
    end = time(NULL);
    sum = record_counter[0];
    for (i=1; i<omp_get_max_threads(); i++)
        sum+= record_counter[i];
    delete [] record_counter;
    cerr << endl << " done parsing " << sum << " Kmers, " << kcounter.size() << " added, taking " << (end-start) << " seconds." << endl;
    return;
}

vector<unsigned int> compute_kmer_coverage(string& sequence, KmerCounter& kcounter) {
    vector<unsigned int> coverage;
    if(IRKE_COMMON::MONITOR) {
        cerr << "processing sequence: " << sequence << endl;
    }
    for (size_t i = 0; i <= sequence.length() - KMER_SIZE; i++) {
        // cerr << "i: " << i << ", <= " << sequence.length() - KMER_SIZE << endl;
        string kmer = sequence.substr(i, KMER_SIZE);
        if(IRKE_COMMON::MONITOR >= 2) {
            for (size_t j = 0; j <= i; j++) {
                cerr << " ";
            }
            cerr << kmer << endl;
        }
        unsigned int kmer_count = 0;
        if(!contains_non_gatc(kmer)) {
            kmer_count = kcounter.get_kmer_count(kmer);
        }

        // Note, in the jellyfish run, we restrain it to min kmer coverage of 2.
        // If we don't find a kmer catalogued, it must have a kmer count of 1.
        if (kmer_count < 1) {
            kmer_count = 1;
        }

        coverage.push_back(kmer_count);
    }
    return(coverage);
}

unsigned int median_coverage(vector<unsigned int> coverage) {
    int num_pts = coverage.size();
    if(num_pts == 0) {
        return(0);
    }
    sort(coverage.begin(), coverage.end());
    if(num_pts % 2 == 1){
      return(coverage[(num_pts)/2]);
    }
    return((coverage[(num_pts - 1)/2] + coverage[(num_pts)/2]) / 2);
}

string usage(ArgProcessor) {
    stringstream usage_info;
    usage_info << endl << endl;
    usage_info << "Usage: " << endl
               << "  --reads  <str>             " << ":fasta file containing reads" << endl
               << "  --kmers  <str>             " << ":fasta file containing kmers" << endl
               << "* optional:" << endl
               << "  --kmer_size <int>          " << ":default = 25" << endl
               << "  --DS                             " << ":double-stranded RNA-Seq mode (not strand-specific)" << endl
               << "  --capture_coverage_info    " << ":writes coverage info file." << endl
               << "  --monitor <int>            " << ":verbose level for debugging" << endl
               << "  --num_threads <int>        " << ":number of threads" << endl
               << endl;
    return(usage_info.str());
}

long sum(vector<unsigned int>& vals) {
    long sum_vals = 0;
    for (int i = 0; i < (int) vals.size(); i++) {
        sum_vals += vals[i];
    }

    return(sum_vals);
}

float mean(vector<unsigned int>& vals) {
  if(vals.size() == 0){
    return(0);
  }
  long sum_vals = sum(vals);
  float avg = (float) sum_vals / vals.size();
  return(avg);
}

float stDev( vector<unsigned int>& vals) {
    float avg = mean(vals);
    int num_vals = vals.size();

    float sum_avg_diffs_sqr = 0;
    for (int i = 0; i < num_vals; i++) {
        float delta = vals[i] - avg;
        sum_avg_diffs_sqr += (delta * delta);
    }

    float stdev = sqrt( sum_avg_diffs_sqr/(num_vals-1) );

    return(stdev);
}


text:
package tpe.Gruppe1_1.uebung03.aufgabe01.teilB;

public class PlaneTooHighException extends GeneralFlightSimulatorException {

    public PlaneTooHighException(String message) {
        super(message);
    }

}


text:
$(function() {

	$('.tooltip').not('#welcome .tooltip').tooltipster({
		offsetY: 2,
	});
	$('#welcome .tooltip').tooltipster({
		offsetY: 2,
		theme: 'tooltipster-white'
	});
	$('#demo-default').tooltipster({
		offsetY: 2
	});
	$('#demo-html').tooltipster({
		content: $('
Soufflé chocolate cake powder. Applicake lollipop oat cake gingerbread.
'),
		fixedWidth: 300,
		position: 'right'
	});
	$('#demo-theme').tooltipster({
		animation: 'grow',
		theme: 'tooltipster-pink'
	});
	$('#demo-callback').tooltipster({
		content: 'Loading...',
		updateAnimation: false,
		functionBefore: function(origin, continueTooltip) {
			continueTooltip();

			if (origin.data('ajax') !== 'cached') {

				$.jGFeed('http://ws.audioscrobbler.com/2.0/user/ce3ge/recenttracks.rss?',
					function(feeds){
						var content = '';
						if(!feeds){
							content = 'Woops - there was an error retrieving my last.fm RSS feed';
							origin.tooltipster('content', content);
						}
						else {
							content = $('I last listened to: ' + feeds.entries[0].title + '');
							origin
								.tooltipster('content', content)
								.data('ajax', 'cached');
						}
				}, 10);

				origin.data('ajax', 'cached');
			}
		},
		functionAfter: function(origin) {
			alert('The tooltip has closed!');
		}
	});
	$('#demo-events').tooltipster({
		trigger: 'click'
	});
	$(window).keypress(function() {
		$('#demo-events').tooltipster('hide');
	});
	$('#demo-interact').tooltipster({
		contentAsHTML: true,
		interactive: true
	});
	$('#demo-touch').tooltipster({
		touchDevices: false
	});
	$('#demo-icon').tooltipster({
		iconDesktop: true,
		iconTouch: true
	});
	$('.tooltipster-light-preview').tooltipster({
		theme: 'tooltipster-light'
	});
	$('.tooltipster-punk-preview').tooltipster({
		theme: 'tooltipster-punk'
	});
	$('.tooltipster-noir-preview').tooltipster({
		theme: 'tooltipster-noir'
	});
	$('.tooltipster-shadow-preview').tooltipster({
		theme: 'tooltipster-shadow'
	});

	$('header select').change(function() {
		var goTo = $(this).val();
		var section = $('#'+goTo);
		var offset = section.offset().top;
		$('html, body').scrollTop(offset);
	});

	prettyPrint();

});


text:
<?php

class Google_Service_Slides_PageProperties extends Google_Model
{
  protected $colorSchemeType = 'Google_Service_Slides_ColorScheme';
  protected $colorSchemeDataType = '';
  protected $pageBackgroundFillType = 'Google_Service_Slides_PageBackgroundFill';
  protected $pageBackgroundFillDataType = '';

  public function setColorScheme(Google_Service_Slides_ColorScheme $colorScheme)
  {
    $this->colorScheme = $colorScheme;
  }
  public function getColorScheme()
  {
    return $this->colorScheme;
  }
  public function setPageBackgroundFill(Google_Service_Slides_PageBackgroundFill $pageBackgroundFill)
  {
    $this->pageBackgroundFill = $pageBackgroundFill;
  }
  public function getPageBackgroundFill()
  {
    return $this->pageBackgroundFill;
  }
}


text:
package com.amazonaws.services.clouddirectory.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AttachObjectRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * Amazon Resource Name (ARN) that is associated with the Directory where both objects reside. For more
     * information, see arns.
     *

     */
    private String directoryArn;
    /**
     *

     * The parent object reference.
     *

     */
    private ObjectReference parentReference;
    /**
     *

     * The child object reference to be attached to the object.
     *

     */
    private ObjectReference childReference;
    /**
     *

     * The link name with which the child object is attached to the parent.
     *

     */
    private String linkName;

    /**
     *

     * Amazon Resource Name (ARN) that is associated with the Directory where both objects reside. For more
     * information, see arns.
     *

     *
     * @param directoryArn
     *        Amazon Resource Name (ARN) that is associated with the Directory where both objects reside. For
     *        more information, see arns.
     */

    public void setDirectoryArn(String directoryArn) {
        this.directoryArn = directoryArn;
    }

    /**
     *

     * Amazon Resource Name (ARN) that is associated with the Directory where both objects reside. For more
     * information, see arns.
     *

     *
     * @return Amazon Resource Name (ARN) that is associated with the Directory where both objects reside. For
     *         more information, see arns.
     */

    public String getDirectoryArn() {
        return this.directoryArn;
    }

    /**
     *

     * Amazon Resource Name (ARN) that is associated with the Directory where both objects reside. For more
     * information, see arns.
     *

     *
     * @param directoryArn
     *        Amazon Resource Name (ARN) that is associated with the Directory where both objects reside. For
     *        more information, see arns.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public AttachObjectRequest withDirectoryArn(String directoryArn) {
        setDirectoryArn(directoryArn);
        return this;
    }

    /**
     *

     * The parent object reference.
     *

     *
     * @param parentReference
     *        The parent object reference.
     */

    public void setParentReference(ObjectReference parentReference) {
        this.parentReference = parentReference;
    }

    /**
     *

     * The parent object reference.
     *

     *
     * @return The parent object reference.
     */

    public ObjectReference getParentReference() {
        return this.parentReference;
    }

    /**
     *

     * The parent object reference.
     *

     *
     * @param parentReference
     *        The parent object reference.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public AttachObjectRequest withParentReference(ObjectReference parentReference) {
        setParentReference(parentReference);
        return this;
    }

    /**
     *

     * The child object reference to be attached to the object.
     *

     *
     * @param childReference
     *        The child object reference to be attached to the object.
     */

    public void setChildReference(ObjectReference childReference) {
        this.childReference = childReference;
    }

    /**
     *

     * The child object reference to be attached to the object.
     *

     *
     * @return The child object reference to be attached to the object.
     */

    public ObjectReference getChildReference() {
        return this.childReference;
    }

    /**
     *

     * The child object reference to be attached to the object.
     *

     *
     * @param childReference
     *        The child object reference to be attached to the object.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public AttachObjectRequest withChildReference(ObjectReference childReference) {
        setChildReference(childReference);
        return this;
    }

    /**
     *

     * The link name with which the child object is attached to the parent.
     *

     *
     * @param linkName
     *        The link name with which the child object is attached to the parent.
     */

    public void setLinkName(String linkName) {
        this.linkName = linkName;
    }

    /**
     *

     * The link name with which the child object is attached to the parent.
     *

     *
     * @return The link name with which the child object is attached to the parent.
     */

    public String getLinkName() {
        return this.linkName;
    }

    /**
     *

     * The link name with which the child object is attached to the parent.
     *

     *
     * @param linkName
     *        The link name with which the child object is attached to the parent.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public AttachObjectRequest withLinkName(String linkName) {
        setLinkName(linkName);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getDirectoryArn() != null)
            sb.append("DirectoryArn: ").append(getDirectoryArn()).append(",");
        if (getParentReference() != null)
            sb.append("ParentReference: ").append(getParentReference()).append(",");
        if (getChildReference() != null)
            sb.append("ChildReference: ").append(getChildReference()).append(",");
        if (getLinkName() != null)
            sb.append("LinkName: ").append(getLinkName());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof AttachObjectRequest == false)
            return false;
        AttachObjectRequest other = (AttachObjectRequest) obj;
        if (other.getDirectoryArn() == null ^ this.getDirectoryArn() == null)
            return false;
        if (other.getDirectoryArn() != null && other.getDirectoryArn().equals(this.getDirectoryArn()) == false)
            return false;
        if (other.getParentReference() == null ^ this.getParentReference() == null)
            return false;
        if (other.getParentReference() != null && other.getParentReference().equals(this.getParentReference()) == false)
            return false;
        if (other.getChildReference() == null ^ this.getChildReference() == null)
            return false;
        if (other.getChildReference() != null && other.getChildReference().equals(this.getChildReference()) == false)
            return false;
        if (other.getLinkName() == null ^ this.getLinkName() == null)
            return false;
        if (other.getLinkName() != null && other.getLinkName().equals(this.getLinkName()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getDirectoryArn() == null) ? 0 : getDirectoryArn().hashCode());
        hashCode = prime * hashCode + ((getParentReference() == null) ? 0 : getParentReference().hashCode());
        hashCode = prime * hashCode + ((getChildReference() == null) ? 0 : getChildReference().hashCode());
        hashCode = prime * hashCode + ((getLinkName() == null) ? 0 : getLinkName().hashCode());
        return hashCode;
    }

    @Override
    public AttachObjectRequest clone() {
        return (AttachObjectRequest) super.clone();
    }

}


text:
package com.alibaba.excel.analysis.v03.handlers;

import org.apache.poi.hssf.record.Record;
import org.apache.poi.hssf.record.TextObjectRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.excel.analysis.v03.IgnorableXlsRecordHandler;
import com.alibaba.excel.context.xls.XlsReadContext;
import com.alibaba.excel.enums.CellExtraTypeEnum;
import com.alibaba.excel.read.metadata.holder.xls.XlsReadSheetHolder;

/**
 * Record handler
 *
 * @author Jiaju Zhuang
 */
public class TextObjectRecordHandler extends AbstractXlsRecordHandler implements IgnorableXlsRecordHandler {
    private static final Logger LOGGER = LoggerFactory.getLogger(TextObjectRecordHandler.class);

    @Override
    public boolean support(XlsReadContext xlsReadContext, Record record) {
        return xlsReadContext.readWorkbookHolder().getExtraReadSet().contains(CellExtraTypeEnum.COMMENT);
    }

    @Override
    public void processRecord(XlsReadContext xlsReadContext, Record record) {
        TextObjectRecord tor = (TextObjectRecord)record;
        XlsReadSheetHolder xlsReadSheetHolder = xlsReadContext.xlsReadSheetHolder();
        Integer tempObjectIndex = xlsReadSheetHolder.getTempObjectIndex();
        if (tempObjectIndex == null) {
            LOGGER.debug("tempObjectIndex is null.");
            return;
        }
        xlsReadSheetHolder.getObjectCacheMap().put(tempObjectIndex, tor.getStr().getString());
        xlsReadSheetHolder.setTempObjectIndex(null);
    }
}


text:
namespace blink {

class ComputedStyle;
class NGBlockNode;
class NGFragment;
class NGConstraintSpace;

// Helper class for positioning of out-of-flow blocks.
// It should be used together with NGFragmentBuilder.
// See NGFragmentBuilder::AddOutOfFlowChildCandidate documentation
// for example of using these classes together.
class CORE_EXPORT NGOutOfFlowLayoutPart
    : public GarbageCollectedFinalized<NGOutOfFlowLayoutPart> {
 public:
  NGOutOfFlowLayoutPart(PassRefPtr<const ComputedStyle>, NGLogicalSize);

  void Layout(NGBlockNode&, NGStaticPosition, NGFragment**, NGLogicalOffset*);

  DECLARE_TRACE();

 private:
  NGFragment* GenerateFragment(NGBlockNode& node,
                               const Optional<LayoutUnit>& block_estimate,
                               const NGAbsolutePhysicalPosition node_position);

  NGLogicalOffset parent_border_offset_;
  NGPhysicalOffset parent_border_physical_offset_;
  Member<NGConstraintSpace> parent_space_;
};

}  // namespace blink

#endif


text:
<!--
   This file is part of the X12Parser library that provides tools to
   manipulate X12 messages using Ruby native syntax.

   http://x12parser.rubyforge.org

   Copyright (C) 2009 APP Design, Inc.

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

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

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

   $Id: AM1.xml 78 2009-05-12 22:27:26Z ikk $
-->

<Segment name="AM1" comment="To specify a code and the amount or quantity or percentage associated with it">
  <Field name="CodeCategory" min="2" max="2" validation="T1136" comment="Specifies the situation or category to which the code applies"/>
  <Field name="ProductServiceIdQualifier" min="2" max="2" validation="T235" comment="Code identifying the type/source of the descriptive number used in Product/Service ID (234)"/>
  <Field name="ProductServiceId" min="1" max="48" comment="Identifying number for a product or service"/>
  <Field name="MonetaryAmount" type="double" required="y" min="1" max="18" comment="Monetary amount"/>
  <Field name="Quantity" type="double" required="y" min="1" max="15" comment="Numeric value of quantity"/>
  <Field name="Percent" type="double" required="y" min="1" max="10" comment="Percentage expressed as a decimal"/>
</Segment>


text:
package main

var errorMessage = "%v function fails. Expects %v, returns %v."


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zenith.Core.Models
{
    public class Details: ObservationDataCategory
    {
    }
}


text:
package com.themodernway.server.core.json.validation;

public class StringValidator extends AbstractAttributeTypeValidator
{
    public StringValidator()
    {
        super(String.class);
    }

    @Override
    public boolean validate(final IJSONValue json, final IMutableValidationContext ctx)
    {
        if ((null == json) || (null == json.getAsString()))
        {
            ctx.addTypeValidationError(getClassSimpleName());

            return false;
        }
        return true;
    }
}


text:
namespace Microsoft.Azure.Management.BatchAI.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Caffe job settings.
    /// </summary>
    public partial class CaffeSettings
    {
        /// <summary>
        /// Initializes a new instance of the CaffeSettings class.
        /// </summary>
        public CaffeSettings()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the CaffeSettings class.
        /// </summary>
        /// <param name="configFilePath">Config file path.</param>
        /// <param name="pythonScriptFilePath">Python script file path.</param>
        /// <param name="pythonInterpreterPath">Python interpreter
        /// path.</param>
        /// <param name="commandLineArgs">Command line arguments.</param>
        /// <param name="processCount">Process count.</param>
        public CaffeSettings(string configFilePath = default(string), string pythonScriptFilePath = default(string), string pythonInterpreterPath = default(string), string commandLineArgs = default(string), int? processCount = default(int?))
        {
            ConfigFilePath = configFilePath;
            PythonScriptFilePath = pythonScriptFilePath;
            PythonInterpreterPath = pythonInterpreterPath;
            CommandLineArgs = commandLineArgs;
            ProcessCount = processCount;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets config file path.
        /// </summary>
        /// <remarks>
        /// Path of the config file for the job. This property cannot be
        /// specified if pythonScriptFilePath is specified.
        /// </remarks>
        [JsonProperty(PropertyName = "configFilePath")]
        public string ConfigFilePath { get; set; }

        /// <summary>
        /// Gets or sets python script file path.
        /// </summary>
        /// <remarks>
        /// Python script to execute. This property cannot be specified if
        /// configFilePath is specified.
        /// </remarks>
        [JsonProperty(PropertyName = "pythonScriptFilePath")]
        public string PythonScriptFilePath { get; set; }

        /// <summary>
        /// Gets or sets python interpreter path.
        /// </summary>
        /// <remarks>
        /// The path to the Python interpreter. The property can be specified
        /// only if the pythonScriptFilePath is specified.
        /// </remarks>
        [JsonProperty(PropertyName = "pythonInterpreterPath")]
        public string PythonInterpreterPath { get; set; }

        /// <summary>
        /// Gets or sets command line arguments.
        /// </summary>
        /// <remarks>
        /// Command line arguments that need to be passed to the Caffe job.
        /// </remarks>
        [JsonProperty(PropertyName = "commandLineArgs")]
        public string CommandLineArgs { get; set; }

        /// <summary>
        /// Gets or sets process count.
        /// </summary>
        /// <remarks>
        /// Number of processes to launch for the job execution. The default
        /// value for this property is equal to nodeCount property
        /// </remarks>
        [JsonProperty(PropertyName = "processCount")]
        public int? ProcessCount { get; set; }

    }
}