text:
package com.example.android.sunshine.app;

import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.CardView;
import android.support.v7.widget.ShareActionProvider;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.android.sunshine.app.data.WeatherContract;

/**
 * DetailActivityFragment
 */
public class DetailActivityFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor> {

    private TextView mDateWeek, mMaxView, mMinView, mHumidityView, mWindView, mPressureView, mDescView, mDateCalendar, mCityName, mDateTextView;
    private ImageView mIconView;
    private String mDetailData;
    private ShareActionProvider mShareActionProvider;
    private Uri mUri;
    public static final String DTL_ACT_FRAG_URI = "detail_fragment_uri";
    private static final String SHARE_DATA_HASHTAG = " #Sunshine App";
    static final String DETAIL_TRANSITION_ANIMATION = "DTA";
    private boolean mTransitionAnimation;
    private static String LOG_TAG = DetailActivityFragment.class.getSimpleName();
    private static final int DETAIL_LOADER_ID = 0;
    private static final String[] DETAIL_COLUMNS = {
            WeatherContract.WeatherEntry.TABLE_NAME + "." + WeatherContract.WeatherEntry._ID,
            WeatherContract.WeatherEntry.COLUMN_DATE,
            WeatherContract.WeatherEntry.COLUMN_SHORT_DESC,
            WeatherContract.WeatherEntry.COLUMN_MAX_TEMP,
            WeatherContract.WeatherEntry.COLUMN_MIN_TEMP,
            WeatherContract.WeatherEntry.COLUMN_HUMIDITY,
            WeatherContract.WeatherEntry.COLUMN_WIND_SPEED,
            WeatherContract.WeatherEntry.COLUMN_PRESSURE,
            WeatherContract.WeatherEntry.COLUMN_DEGREES,
            WeatherContract.WeatherEntry.COLUMN_WEATHER_ID
    };
    // These indices are tied to DETAIL_COLUMNS.  If DETAIL_COLUMNS changes, these
    // must change.
    private static final int COL_WEATHER_ID = 0;
    private static final int COL_WEATHER_DATE = 1;
    private static final int COL_WEATHER_DESC = 2;
    private static final int COL_WEATHER_MAX_TEMP = 3;
    private static final int COL_WEATHER_MIN_TEMP = 4;
    private static final int COL_WEATHER_HUMIDITY = 5;
    private static final int COL_WEATHER_WIND_SPEED = 6;
    private static final int COL_WEATHER_PRESSURE = 7;
    private static final int COL_WEATHER_WIND_DEGREE = 8;
    private static final int COL_WEATHER_COND_ID = 9;

    public DetailActivityFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        //Get the bundle from the Fragment
        Bundle args = getArguments();
        if (args != null) {
            mUri = args.getParcelable(DTL_ACT_FRAG_URI);
            mTransitionAnimation = args.getBoolean(DetailActivityFragment.DETAIL_TRANSITION_ANIMATION, false);
        }

        View rootView = inflater.inflate(R.layout.fragment_detail_start, container, false);
//        mDateWeek = (TextView) rootView.findViewById(R.id.detail_date_week);
//        mDateCalendar = (TextView) rootView.findViewById(R.id.detail_date_calendar);
        mDateTextView = (TextView) rootView.findViewById(R.id.detail_date_textview);
        mMaxView = (TextView) rootView.findViewById(R.id.detail_maxTempView);
        mMinView = (TextView) rootView.findViewById(R.id.detail_minTempView);
        mHumidityView = (TextView) rootView.findViewById(R.id.detail_humidityView);
        mWindView = (TextView) rootView.findViewById(R.id.detail_windView);
        mPressureView = (TextView) rootView.findViewById(R.id.detail_pressureView);
        mIconView = (ImageView) rootView.findViewById(R.id.detail_weather_icon);
        mDescView = (TextView) rootView.findViewById(R.id.detail_weather_desc);
        mCityName = (TextView) rootView.findViewById(R.id.detail_city_name);
        return rootView;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //Following line needed to let android know that Fragment has options menu
        //If this line is not added then associated method (e.g. OnCreateOptionsMenu) does not get supported
        //even in auto code completion
        setHasOptionsMenu(true);
    }

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        //Following if condition ensures that the fragment mneu (share menu) only appear for activity (i.e. for phone)
        //on the appbar. For Tablet the fragment menu (share menu) will not be added to activity's appbar
        if ( getActivity() instanceof DetailActivity ) {
            // Inflate the menu, this adds items to the action bar if it is present
            inflater.inflate(R.menu.detailfragment, menu);
            finishCreatingMenu(menu);
        }
    }

    private void finishCreatingMenu(Menu menu) {
        // Locate MenuItem with ShareActionProvider
        MenuItem item = menu.findItem(R.id.menu_item_share);
        // Fetch and store ShareActionProvider
        mShareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(item);
        //Show share option if onLoadFinished is complete and we have data
        if(mDetailData != null) {
            shareWeatherData(mShareActionProvider);
        }
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        //Create a loader when we have valid data
        if (mUri != null) {
            getLoaderManager().initLoader(DETAIL_LOADER_ID, null, this);
        } else {
            //Hide the cards when there is no data to display
            ViewParent vp = getView().getParent();
            if ( vp instanceof CardView) {
                ((View)vp).setVisibility(View.INVISIBLE);
            }
        }
    }

    //This method ensure the loader is restarted whenever the location is changed
    void onLocationChanged( String newLocation ) {
        // replace the uri, since the location has changed
        Uri uri = mUri;
        if (null != uri) {
            long date = WeatherContract.WeatherEntry.getDateFromUri(uri);
            Uri updatedUri = WeatherContract.WeatherEntry.buildWeatherLocationWithDate(newLocation, date);
            mUri = updatedUri;
            getLoaderManager().restartLoader(DETAIL_LOADER_ID, null, this);
        }
    }

    /**
     * Share weather data with other applications
     */
    public void shareWeatherData(ShareActionProvider shareAction) {

        Intent sendIntent = new Intent();
        sendIntent.setAction(Intent.ACTION_SEND);
        sendIntent.putExtra(Intent.EXTRA_TEXT, mDetailData + SHARE_DATA_HASHTAG);
        sendIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
        sendIntent.setType("text/plain");
        shareAction.setShareIntent(sendIntent);
    }

    @Override
    public Loader<Cursor> onCreateLoader(int id, Bundle args) {

        //Sort Order: Ascending by Date
        String sortOrder = WeatherContract.WeatherEntry.COLUMN_DATE + " ASC";

        switch (id) {
            case DETAIL_LOADER_ID:
                return new CursorLoader(
                        getActivity(),          //Parent Activity Context
                        mUri, //Table to query
                        DETAIL_COLUMNS,         //Projection to return
                        null,                   //Selection Clause, null->will return all data
                        null,                   //Selection Arg, null-> will return all data
                        sortOrder);             //Sort order, will be sorted by date in ascending order
            default:
                return null;
        }
    }

    @Override
    public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
        //Show the cards when we have data to display
        if(data != null) {
            ViewParent vp = getView().getParent();
            if ( vp instanceof CardView ) {
                ((View)vp).setVisibility(View.VISIBLE);
            }
        }
        if(data.moveToFirst()) {
            String dayWeek = Utility.getDayName(getActivity(), data.getLong(COL_WEATHER_DATE));
            String dateCal = Utility.getFormattedMonthDay(getActivity(), data.getLong(COL_WEATHER_DATE));
            String desc = data.getString(COL_WEATHER_DESC);
            boolean isMetric = Utility.isMetric(getActivity());
            String highTemp = Utility.formatTemperature(getActivity(), data.getFloat(COL_WEATHER_MAX_TEMP), isMetric);
            String lowTemp = Utility.formatTemperature(getActivity(), data.getFloat(COL_WEATHER_MIN_TEMP), isMetric);
            String humidity = String.format(getActivity().getString(R.string.format_humidity), data.getFloat(COL_WEATHER_HUMIDITY));
            String windSpeed = Utility.getFormattedWind(getActivity(), data.getLong(COL_WEATHER_WIND_SPEED),
                    data.getLong(COL_WEATHER_WIND_DEGREE));
            String pressure = String.format(getActivity().getString(R.string.format_pressure), data.getFloat(COL_WEATHER_PRESSURE));

            mDetailData = String.format("%s - %s - %s/%s",dayWeek,desc,highTemp,lowTemp);

            //Use Gradle to load the image
            //mIconView.setImageResource(Utility.getArtResourceForWeatherCondition(data.getInt(COL_WEATHER_COND_ID)));
            Glide.with(this)
                    .load(Utility.getArtUrlForWeatherCondition(getActivity(),data.getInt(COL_WEATHER_COND_ID)))
                    .error(Utility.getArtResourceForWeatherCondition(data.getInt(COL_WEATHER_COND_ID)))
                    .crossFade()
                    .into(mIconView);

            // For accessibility, add a content description to the icon field. Because the ImageView
            // is independently focusable, it's better to have a description of the image. Usin
            // null is appropriate when the image is purely decorative or when the image already
            // has text describing it in the same UI component.
            mIconView.setContentDescription(getString(R.string.a11y_forecast_icon, desc));
            //mDateWeek.setText(dayWeek);
            //mDateCalendar.setText(dateCal);
            mDateTextView.setText(dayWeek+", "+dateCal);
            mMaxView.setText(highTemp);
            // For accessibility, add a content description to the high temp field.
            mMaxView.setContentDescription(getString(R.string.a11y_high_temp, highTemp));
            mMinView.setText(lowTemp);
            // For accessibility, add a content description to the low temp field.
            mMaxView.setContentDescription(getString(R.string.a11y_low_temp,lowTemp));
            mHumidityView.setText(humidity);
            // For accessibility, add a content description to the humidity field.
            mHumidityView.setContentDescription(getString(R.string.format_humidity, data.getFloat(COL_WEATHER_HUMIDITY)));
            mWindView.setText(windSpeed);
            // For accessibility, add a content description to the wind speed field.
            mWindView.setContentDescription(mWindView.getText());
            mPressureView.setText(pressure);
            // For accessibility, add a content description to the pressure field.
            mPressureView.setContentDescription(mPressureView.getText());
            mDescView.setText(desc);
            // For accessibility, add a content description to the description field.
            mDescView.setContentDescription(getString(R.string.a11y_forecast, desc));
            mCityName.setText(MainActivity.getmCityNameData());
        }

        AppCompatActivity activity = (AppCompatActivity)getActivity();
        Toolbar toolbarView = (Toolbar) getView().findViewById(R.id.my_toolbar);

        // We need to start the enter transition after the data has loaded
        //if (activity instanceof DetailActivity) {
        if (mTransitionAnimation) {
            activity.supportStartPostponedEnterTransition();

            if ( null != toolbarView ) {
                activity.setSupportActionBar(toolbarView);
                activity.getSupportActionBar().setDisplayShowTitleEnabled(false);
                activity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
            }
        } else {
            if ( null != toolbarView ) {
                Menu menu = toolbarView.getMenu();
                if ( null != menu ) menu.clear();
                toolbarView.inflateMenu(R.menu.detailfragment);
                finishCreatingMenu(toolbarView.getMenu());
            }
        }

        if (mShareActionProvider != null)
        {
            //If onCreateOptionMenus has happened already then update the share intent
            shareWeatherData(mShareActionProvider);
        }
        else {
            Log.d(LOG_TAG, "Share Action Provider is null");
        }

    }

    @Override
    public void onLoaderReset(Loader<Cursor> loader) {
        //Do nothing
    }
}


text:
import enum
import onnx
import os
import sys
from pathlib import Path

# add tools dir where pre_post_processing folder is to sys path
script_dir = os.path.dirname(os.path.realpath(__file__))
ort_ext_root = os.path.abspath(os.path.join(script_dir, "..", "..", ".."))
tools_dir = os.path.join(ort_ext_root, "tools")
sys.path.append(tools_dir)

from pre_post_processing import PrePostProcessor
from pre_post_processing.Steps import *
from pre_post_processing.utils import create_named_value, PRE_POST_PROCESSING_ONNX_OPSET

def create_model(output_file: Path):
    """
    Create unit test model. If input is bytes from a jpg we do the following
      - DecodeImage: jpg to BGR
      - EncodeImage: BGR to png (output format is set in the node)
      - DecodeImage: png to BGR

    This is slightly easier to test as we can set the expected output by decoding the original image in the unit test.
    """
    inputs = [create_named_value("image", onnx.TensorProto.UINT8, ["num_bytes"])]

    pipeline = PrePostProcessor(inputs)
    pipeline.add_pre_processing(
        [
            ConvertImageToBGR(),  # jpg/png image to BGR in HWC layout
        ]
    )

    pipeline.add_post_processing(
        [
            ConvertBGRToImage(image_format="png"),  # jpg or png are supported
            ConvertImageToBGR(),  # png to BGR in HWC layout
        ]
    )

    g = onnx.helper.make_graph(
        [
            onnx.helper.make_node("Identity", ["bgr_data_in"], ["bgr_data_out"])
        ],
        "empty",
        [
            onnx.helper.make_tensor_value_info("bgr_data_in", onnx.TensorProto.UINT8, ['h', 'w', 3])
        ],
        [
            onnx.helper.make_tensor_value_info("bgr_data_out", onnx.TensorProto.UINT8, ['h', 'w', 3])
        ]
    )

    onnx_import = onnx.helper.make_operatorsetid('', PRE_POST_PROCESSING_ONNX_OPSET)
    model = onnx.helper.make_model(g, opset_imports=[onnx_import])
    new_model = pipeline.run(model)
    new_model.doc_string = "Model for testing DecodeImage and EncodeImage."
    new_model.graph.doc_string = ""  # clear out all the messages from graph merges
    onnx.save_model(new_model, str(output_file.resolve()))

if __name__ == "__main__":
    create_model(Path('decode_encode_decode_test.onnx'))

redpajama_set_name: RedPajamaGithub


text:
namespace VariationOfSet
{
    using System;

    class VariationOfSet
    {
        static int N = int.Parse(Console.ReadLine());
        static int K = int.Parse(Console.ReadLine());

        //generates variations
        static void Variations(int[] array, int index)
        {
            if (index == array.Length)
            {
                PrintArray(array);
            }
            else
            {
                for (int i = 1; i <= N; i++)
                {
                    array[index] = i;
                    Variations(array, index + 1);
                }
            }
        }

        //prints array
        static void PrintArray(int[] array)
        {
            for (int i = 0; i < array.Length; i++)
            {
                Console.Write(array[i] + " ");
            }
            Console.WriteLine();
        }

        static void Main()
        {
            int[] variations = new int[K];
            Variations(variations, 0);
        }
    }
}


text:
package io.daplug.dongle;

import java.util.Vector;
import com.codeminders.hidapi.HIDDeviceInfo;
import io.daplug.dongle.hid.HIDExec;
import io.daplug.dongle.winusb.DaplugDongleWinusb;

public class DaplugEnumerator{

	/**
	 * List all HID device
	 * String format in Vector :
	 * HID, vid, pid, path, interface_number, manufactured
	 * @return Vector<String> list of all HID Device
	 * @author yassir
	 */
	private static Vector<String> listDaplugHIDDevice()
	{
		Vector<String> hid = new Vector<String>();
		Vector <HIDDeviceInfo> listHID = new HIDExec().listAllDaplug();
		int i = 0;
		 for(HIDDeviceInfo dev : listHID) {
			 if(dev.getInterface_number() != 0) {
			 StringBuilder sb = new StringBuilder();
			 sb.append("Dongle "+i + ",").append("HID").append(",").
			 	append(dev.getPath()).append(",").
			 	append(dev.getManufacturer_string());
			 hid.add(sb.toString());
			}
		 }
		 return hid;
	}

	/**
	 * List all WINUSB device
	 * format String :  WINSUB, vid, pid, path, interface_number, manufactured
	 * @return Vector<String> path of all DaplugDevice in Winusb mode
	 * @author yassir
	 */
	private static Vector<String> listDaplugWinusbDevice() {
		return new DaplugDongleWinusb().getPath();
	}

	/**
	 * list all daplug device in HID and WINUSB
	 * format of String : type (HID/WINUSB), vid, pid, path, interface_number, manufactured
	 * all information are separated by a coma (,)
	 * @return Vector<String> list all DaplugDevice
	 * @author yassir
	 */
	public static Vector<String> listDaplugDongles() {
		System.out.println("List all Daplug Dongle (HID/WINUSB)");
		Vector <String> hid = listDaplugHIDDevice();
		Vector <String> winusb = listDaplugWinusbDevice();
		for(String value : hid)
			System.out.println(value);
		for(String value : winusb)
			System.out.println(value);
		//add ath the end of HID vector list, all data contained by winusb vector
		hid.addAll(winusb);
		return hid;
	}

}


text:
<?php

require_once(dirname(__FILE__) . '/../interface/startOfLine.interface.php');

class horizontalrule implements startOfLine
{
    const regular_expression = '/^----(\s*)$/';

    public function __construct()
    {

    }

    public function startOfLine($line)
    {
        return preg_replace_callback(horizontalrule::regular_expression,array($this,'replace_callback'),$line);
    }

    private function replace_callback($matches)
    {
        return '<hr/>';
    }

}

?>


text:
<?php

namespace oxide\base;

trait InjectorTrait {

   /**
    * Invoke given $callable and attempt to resolve the params argument.
    *
    * All param names will be attempted to match with resolver container.  If
    * matches then
    * @param callable $callable
    * @return type
    * @throws \Exception
    * @throws \InvalidArgumentException
    */
   public function invokeByInjecting(callable $callable, Dictionary $container) {
      if(is_string($callable) || $callable instanceof \Closure) {
         $reflection = new \ReflectionFunction($callable);
      } else if(is_array($callable)) {
         list($class, $method) = $callable;
         $reflection = new \ReflectionMethod($class, $method);
      } else {
         throw new \Exception("Unable to resolve this callable.");
      }

      if($reflection->getNumberOfParameters() > 0) {
         $args = [];
         foreach($reflection->getParameters() as $param) {
            $name = $param->getName();

            $instance = $container->get($name, null);
            if($instance === null) {
               throw new \InvalidArgumentException("Unable to resolve parameter: " . $name);
            }

            $args[$name] = $instance;
         }
      }

      return call_user_func_array([$this, $method], $args);
   }

   /**
    *
    * @param type $class
    */
	protected function instanciateByInjecting($class) {
	   $reflector = new \ReflectionClass($class);
	   $constructor = $reflector->getConstructor();
	   if($constructor->getNumberOfParameters() > 0) {
		   $params = $constructor->getParameters();
		   foreach($params as $param) {
			   $paramClass = $param->getClass();
			   $paramName = $param->getName();
		   }
	   }
   }
}


text:
/*!
 * \file
* \brief Tessellation Geometry Interaction - Point Size
*//*--------------------------------------------------------------------*/

#include "vktTessellationGeometryPassthroughTests.hpp"
#include "vktTestCaseUtil.hpp"
#include "vktTessellationUtil.hpp"

#include "tcuTestLog.hpp"

#include "vkDefs.hpp"
#include "vkBarrierUtil.hpp"
#include "vkQueryUtil.hpp"
#include "vkBuilderUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkImageUtil.hpp"
#include "vkCmdUtil.hpp"
#include "vkObjUtil.hpp"

#include "deUniquePtr.hpp"

#include <string>
#include <vector>

namespace vkt
{
namespace tessellation
{

using namespace vk;

namespace
{

enum Constants
{
	RENDER_SIZE = 32,
};

enum FlagBits
{
	FLAG_VERTEX_SET						= 1u << 0,		// !< set gl_PointSize in vertex shader
	FLAG_TESSELLATION_EVALUATION_SET	= 1u << 1,		// !< set gl_PointSize in tessellation evaluation shader
	FLAG_TESSELLATION_ADD				= 1u << 2,		// !< read and add to gl_PointSize in tessellation shader pair
	FLAG_GEOMETRY_SET					= 1u << 3,		// !< set gl_PointSize in geometry shader
	FLAG_GEOMETRY_ADD					= 1u << 4,		// !< read and add to gl_PointSize in geometry shader
};
typedef deUint32 Flags;

void checkPointSizeRequirements (const InstanceInterface& vki, const VkPhysicalDevice physDevice, const int maxPointSize)
{
	const VkPhysicalDeviceProperties properties = getPhysicalDeviceProperties(vki, physDevice);
	if (maxPointSize > static_cast<int>(properties.limits.pointSizeRange[1]))
		throw tcu::NotSupportedError("Test requires point size " + de::toString(maxPointSize));
	// Point size granularity must be 1.0 at most, so no need to check it for this test.
}

int getExpectedPointSize (const Flags flags)
{
	int addition = 0;

	// geometry
	if (flags & FLAG_GEOMETRY_SET)
		return 6;
	else if (flags & FLAG_GEOMETRY_ADD)
		addition += 2;

	// tessellation
	if (flags & FLAG_TESSELLATION_EVALUATION_SET)
		return 4 + addition;
	else if (flags & FLAG_TESSELLATION_ADD)
		addition += 2;

	// vertex
	if (flags & FLAG_VERTEX_SET)
		return 2 + addition;

	// undefined
	DE_ASSERT(false);
	return -1;
}

inline bool isTessellationStage (const Flags flags)
{
	return (flags & (FLAG_TESSELLATION_EVALUATION_SET | FLAG_TESSELLATION_ADD)) != 0;
}

inline bool isGeometryStage (const Flags flags)
{
	return (flags & (FLAG_GEOMETRY_SET | FLAG_GEOMETRY_ADD)) != 0;
}

bool verifyImage (tcu::TestLog& log, const tcu::ConstPixelBufferAccess image, const int expectedSize)
{
	log << tcu::TestLog::Message << "Verifying rendered point size. Expecting " << expectedSize << " pixels." << tcu::TestLog::EndMessage;

	bool			resultAreaFound	= false;
	tcu::IVec4		resultArea;
	const tcu::Vec4	black(0.0, 0.0, 0.0, 1.0);

	// Find rasterization output area

	for (int y = 0; y < image.getHeight(); ++y)
	for (int x = 0; x < image.getWidth();  ++x)
		if (image.getPixel(x, y) != black)
		{
			if (!resultAreaFound)
			{
				// first fragment
				resultArea = tcu::IVec4(x, y, x + 1, y + 1);
				resultAreaFound = true;
			}
			else
			{
				// union area
				resultArea.x() = de::min(resultArea.x(), x);
				resultArea.y() = de::min(resultArea.y(), y);
				resultArea.z() = de::max(resultArea.z(), x+1);
				resultArea.w() = de::max(resultArea.w(), y+1);
			}
		}

	if (!resultAreaFound)
	{
		log << tcu::TestLog::Message << "Verification failed, could not find any point fragments." << tcu::TestLog::EndMessage;
		return false;
	}

	const tcu::IVec2 pointSize = resultArea.swizzle(2,3) - resultArea.swizzle(0, 1);

	if (pointSize.x() != pointSize.y())
	{
		log << tcu::TestLog::Message << "ERROR! Rasterized point is not a square. Point size was " << pointSize << tcu::TestLog::EndMessage;
		return false;
	}

	if (pointSize.x() != expectedSize)
	{
		log << tcu::TestLog::Message << "ERROR! Point size invalid, expected " << expectedSize << ", got " << pointSize.x() << tcu::TestLog::EndMessage;
		return false;
	}

	return true;
}

void initPrograms (vk::SourceCollections& programCollection, const Flags flags)
{
	// Vertex shader
	{
		std::ostringstream src;
		src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES) << "\n"
			<< "\n"
			<< "void main (void)\n"
			<< "{\n"
			<< "    gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n";

		if (flags & FLAG_VERTEX_SET)
			src << "    gl_PointSize = 2.0;\n";

		src << "}\n";

		programCollection.glslSources.add("vert") << glu::VertexSource(src.str());
	}

	// Fragment shader
	{
		std::ostringstream src;
		src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES) << "\n"
			<< "layout(location = 0) out mediump vec4 fragColor;\n"
			<< "\n"
			<< "void main (void)\n"
			<< "{\n"
			<< "    fragColor = vec4(1.0);\n"
			<< "}\n";

		programCollection.glslSources.add("frag") << glu::FragmentSource(src.str());
	}

	if (isTessellationStage(flags))
	{
		// Tessellation control shader
		{
			std::ostringstream src;
			src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES) << "\n"
				<< "#extension GL_EXT_tessellation_shader : require\n"
				<< "#extension GL_EXT_tessellation_point_size : require\n"
				<< "layout(vertices = 1) out;\n"
				<< "\n"
				<< "void main (void)\n"
				<< "{\n"
				<< "    gl_TessLevelOuter[0] = 3.0;\n"
				<< "    gl_TessLevelOuter[1] = 3.0;\n"
				<< "    gl_TessLevelOuter[2] = 3.0;\n"
				<< "    gl_TessLevelInner[0] = 3.0;\n"
				<< "\n"
				<< "    gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n";

			if (flags & FLAG_TESSELLATION_ADD)
				src << "    // pass as is to eval\n"
					<< "    gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n";

			src << "}\n";

			programCollection.glslSources.add("tesc") << glu::TessellationControlSource(src.str());
		}

		// Tessellation evaluation shader
		{
			std::ostringstream src;
			src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES) << "\n"
				<< "#extension GL_EXT_tessellation_shader : require\n"
				<< "#extension GL_EXT_tessellation_point_size : require\n"
				<< "layout(triangles, point_mode) in;\n"
				<< "\n"
				<< "void main (void)\n"
				<< "{\n"
				<< "    // hide all but one vertex\n"
				<< "    if (gl_TessCoord.x < 0.99)\n"
				<< "        gl_Position = vec4(-2.0, 0.0, 0.0, 1.0);\n"
				<< "    else\n"
				<< "        gl_Position = gl_in[0].gl_Position;\n";

			if (flags & FLAG_TESSELLATION_ADD)
				src << "\n"
					<< "    // add to point size\n"
					<< "    gl_PointSize = gl_in[0].gl_PointSize + 2.0;\n";
			else if (flags & FLAG_TESSELLATION_EVALUATION_SET)
				src << "\n"
					<< "    // set point size\n"
					<< "    gl_PointSize = 4.0;\n";

			src << "}\n";

			programCollection.glslSources.add("tese") << glu::TessellationEvaluationSource(src.str());
		}
	}

	if (isGeometryStage(flags))
	{
		// Geometry shader
		std::ostringstream src;
		src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES) << "\n"
			<< "#extension GL_EXT_geometry_shader : require\n"
			<< "#extension GL_EXT_geometry_point_size : require\n"
			<< "layout(points) in;\n"
			<< "layout(points, max_vertices = 1) out;\n"
			<< "\n"
			<< "void main (void)\n"
			<< "{\n"
			<< "    gl_Position  = gl_in[0].gl_Position;\n";

		if (flags & FLAG_GEOMETRY_SET)
			src << "    gl_PointSize = 6.0;\n";
		else if (flags & FLAG_GEOMETRY_ADD)
			src << "    gl_PointSize = gl_in[0].gl_PointSize + 2.0;\n";

		src << "\n"
			<< "    EmitVertex();\n"
			<< "}\n";

		programCollection.glslSources.add("geom") << glu::GeometrySource(src.str());
	}
}

tcu::TestStatus test (Context& context, const Flags flags)
{
	const int expectedPointSize = getExpectedPointSize(flags);
	{
		const InstanceInterface& vki        = context.getInstanceInterface();
		const VkPhysicalDevice   physDevice = context.getPhysicalDevice();

		requireFeatures           (vki, physDevice, FEATURE_TESSELLATION_SHADER | FEATURE_GEOMETRY_SHADER | FEATURE_SHADER_TESSELLATION_AND_GEOMETRY_POINT_SIZE);
		checkPointSizeRequirements(vki, physDevice, expectedPointSize);
	}
	{
		tcu::TestLog& log = context.getTestContext().getLog();

		if (flags & FLAG_VERTEX_SET)
			log << tcu::TestLog::Message << "Setting point size in vertex shader to 2.0." << tcu::TestLog::EndMessage;
		if (flags & FLAG_TESSELLATION_EVALUATION_SET)
			log << tcu::TestLog::Message << "Setting point size in tessellation evaluation shader to 4.0." << tcu::TestLog::EndMessage;
		if (flags & FLAG_TESSELLATION_ADD)
			log << tcu::TestLog::Message << "Reading point size in tessellation control shader and adding 2.0 to it in evaluation." << tcu::TestLog::EndMessage;
		if (flags & FLAG_GEOMETRY_SET)
			log << tcu::TestLog::Message << "Setting point size in geometry shader to 6.0." << tcu::TestLog::EndMessage;
		if (flags & FLAG_GEOMETRY_ADD)
			log << tcu::TestLog::Message << "Reading point size in geometry shader and adding 2.0." << tcu::TestLog::EndMessage;
	}

	const DeviceInterface&	vk					= context.getDeviceInterface();
	const VkDevice			device				= context.getDevice();
	const VkQueue			queue				= context.getUniversalQueue();
	const deUint32			queueFamilyIndex	= context.getUniversalQueueFamilyIndex();
	Allocator&				allocator			= context.getDefaultAllocator();

	// Color attachment

	const tcu::IVec2			  renderSize				 = tcu::IVec2(RENDER_SIZE, RENDER_SIZE);
	const VkFormat				  colorFormat				 = VK_FORMAT_R8G8B8A8_UNORM;
	const VkImageSubresourceRange colorImageSubresourceRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u);
	const Image					  colorAttachmentImage		 (vk, device, allocator,
															 makeImageCreateInfo(renderSize, colorFormat, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT, 1u),
															 MemoryRequirement::Any);

	// Color output buffer

	const VkDeviceSize	colorBufferSizeBytes = renderSize.x()*renderSize.y() * tcu::getPixelSize(mapVkFormat(colorFormat));
	const Buffer		colorBuffer          (vk, device, allocator, makeBufferCreateInfo(colorBufferSizeBytes, VK_BUFFER_USAGE_TRANSFER_DST_BIT), MemoryRequirement::HostVisible);

	// Pipeline

	const Unique<VkImageView>		colorAttachmentView	(makeImageView			(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
	const Unique<VkRenderPass>		renderPass			(makeRenderPass			(vk, device, colorFormat));
	const Unique<VkFramebuffer>		framebuffer			(makeFramebuffer		(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y()));
	const Unique<VkPipelineLayout>	pipelineLayout		(makePipelineLayout		(vk, device));
	const Unique<VkCommandPool>		cmdPool				(makeCommandPool		(vk, device, queueFamilyIndex));
	const Unique<VkCommandBuffer>	cmdBuffer			(allocateCommandBuffer	(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));

	GraphicsPipelineBuilder			pipelineBuilder;

	pipelineBuilder
		.setPrimitiveTopology		  (VK_PRIMITIVE_TOPOLOGY_POINT_LIST)
		.setRenderSize				  (renderSize)
		.setPatchControlPoints		  (1)
		.setShader					  (vk, device, VK_SHADER_STAGE_VERTEX_BIT,					context.getBinaryCollection().get("vert"), DE_NULL)
		.setShader					  (vk, device, VK_SHADER_STAGE_FRAGMENT_BIT,				context.getBinaryCollection().get("frag"), DE_NULL);

	if (isTessellationStage(flags))
		pipelineBuilder
			.setShader				  (vk, device, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,	context.getBinaryCollection().get("tesc"), DE_NULL)
			.setShader				  (vk, device, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, context.getBinaryCollection().get("tese"), DE_NULL);

	if (isGeometryStage(flags))
		pipelineBuilder
			.setShader				  (vk, device, VK_SHADER_STAGE_GEOMETRY_BIT,				context.getBinaryCollection().get("geom"), DE_NULL);

	const Unique<VkPipeline> pipeline(pipelineBuilder.build(vk, device, *pipelineLayout, *renderPass));

	// Draw commands

	beginCommandBuffer(vk, *cmdBuffer);

	{
		const VkImageMemoryBarrier colorAttachmentLayoutBarrier = makeImageMemoryBarrier(
			(VkAccessFlags)0, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
			VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
			*colorAttachmentImage, colorImageSubresourceRange);

		vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, 0u,
			0u, DE_NULL, 0u, DE_NULL, 1u, &colorAttachmentLayoutBarrier);
	}

	// Begin render pass
	{
		const VkRect2D	renderArea	= makeRect2D(renderSize);
		const tcu::Vec4	clearColor	(0.0f, 0.0f, 0.0f, 1.0f);

		beginRenderPass(vk, *cmdBuffer, *renderPass, *framebuffer, renderArea, clearColor);
	}

	vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline);

	vk.cmdDraw(*cmdBuffer, 1u, 1u, 0u, 0u);
	endRenderPass(vk, *cmdBuffer);

	// Copy render result to a host-visible buffer
	copyImageToBuffer(vk, *cmdBuffer, *colorAttachmentImage, *colorBuffer, renderSize);

	endCommandBuffer(vk, *cmdBuffer);
	submitCommandsAndWait(vk, device, queue, *cmdBuffer);

	// Verify results
	{
		const Allocation&			alloc	= colorBuffer.getAllocation();
		tcu::TestLog&				log		= context.getTestContext().getLog();

		invalidateAlloc(vk, device, alloc);

		tcu::ConstPixelBufferAccess	image	(mapVkFormat(colorFormat), renderSize.x(), renderSize.y(), 1, alloc.getHostPtr());

		log << tcu::LogImage("color0", "", image);

		if (verifyImage(log, image, expectedPointSize))
			return tcu::TestStatus::pass("OK");
		else
			return tcu::TestStatus::fail("Didn't render expected point");
	}
}

std::string getTestCaseName (const Flags flags)
{
	std::ostringstream buf;

	// join per-bit descriptions into a single string with '_' separator
	if (flags & FLAG_VERTEX_SET)					buf																		<< "vertex_set";
	if (flags & FLAG_TESSELLATION_EVALUATION_SET)	buf << ((flags & (FLAG_TESSELLATION_EVALUATION_SET-1))	? ("_") : (""))	<< "evaluation_set";
	if (flags & FLAG_TESSELLATION_ADD)				buf << ((flags & (FLAG_TESSELLATION_ADD-1))				? ("_") : (""))	<< "control_pass_eval_add";
	if (flags & FLAG_GEOMETRY_SET)					buf << ((flags & (FLAG_GEOMETRY_SET-1))					? ("_") : (""))	<< "geometry_set";
	if (flags & FLAG_GEOMETRY_ADD)					buf << ((flags & (FLAG_GEOMETRY_ADD-1))					? ("_") : (""))	<< "geometry_add";

	return buf.str();
}

std::string getTestCaseDescription (const Flags flags)
{
	std::ostringstream buf;

	// join per-bit descriptions into a single string with ", " separator
	if (flags & FLAG_VERTEX_SET)					buf																			<< "set point size in vertex shader";
	if (flags & FLAG_TESSELLATION_EVALUATION_SET)	buf << ((flags & (FLAG_TESSELLATION_EVALUATION_SET-1))	? (", ") : (""))	<< "set point size in tessellation evaluation shader";
	if (flags & FLAG_TESSELLATION_ADD)				buf << ((flags & (FLAG_TESSELLATION_ADD-1))				? (", ") : (""))	<< "add to point size in tessellation shader";
	if (flags & FLAG_GEOMETRY_SET)					buf << ((flags & (FLAG_GEOMETRY_SET-1))					? (", ") : (""))	<< "set point size in geometry shader";
	if (flags & FLAG_GEOMETRY_ADD)					buf << ((flags & (FLAG_GEOMETRY_ADD-1))					? (", ") : (""))	<< "add to point size in geometry shader";

	return buf.str();
}

} // anonymous

//! Ported from dEQP-GLES31.functional.tessellation_geometry_interaction.point_size.*
//! with the exception of the default 1.0 point size cases (not valid in Vulkan).
tcu::TestCaseGroup* createGeometryPointSizeTests (tcu::TestContext& testCtx)
{
	de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(testCtx, "point_size", "Test point size"));

	static const Flags caseFlags[] =
	{
		FLAG_VERTEX_SET,
							FLAG_TESSELLATION_EVALUATION_SET,
																	FLAG_GEOMETRY_SET,
		FLAG_VERTEX_SET	|	FLAG_TESSELLATION_EVALUATION_SET,
		FLAG_VERTEX_SET |											FLAG_GEOMETRY_SET,
		FLAG_VERTEX_SET	|	FLAG_TESSELLATION_EVALUATION_SET	|	FLAG_GEOMETRY_SET,
		FLAG_VERTEX_SET	|	FLAG_TESSELLATION_ADD				|	FLAG_GEOMETRY_ADD,
	};

	for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(caseFlags); ++ndx)
	{
		const std::string name = getTestCaseName       (caseFlags[ndx]);
		const std::string desc = getTestCaseDescription(caseFlags[ndx]);

		addFunctionCaseWithPrograms(group.get(), name, desc, initPrograms, test, caseFlags[ndx]);
	}

	return group.release();
}

} // tessellation
} // vkt


text:
package parser

import (
	"fmt"
	"io/ioutil"
	"monkey/ast"
	"monkey/lexer"
	"monkey/token"
	"os"
)

func (p *Parser) parseReturnStatement() *ast.ReturnStatement {
	stmt := &ast.ReturnStatement{Token: p.curToken}
	if p.peekTokenIs(token.SEMICOLON) {
		p.nextToken()
		return stmt
	}
	p.nextToken()
	stmt.ReturnValue = p.parseExpressionStatement().Expression

	return stmt
}

func (p *Parser) parseBreakWithoutLoopContext() ast.Expression {
	p.errors = append(p.errors, "'break' outside of loop context")
	return p.parseBreakExpression()
}

func (p *Parser) parseBreakExpression() ast.Expression {
	return &ast.BreakExpression{Token: p.curToken}
}

func (p *Parser) parseLetStatement() *ast.LetStatement {
	stmt := &ast.LetStatement{Token: p.curToken}

	if p.expectPeek(token.IDENT) {
		stmt.Name = &ast.Identifier{Token: p.curToken, Value: p.curToken.Literal}
	}

	if p.expectPeek(token.ASSIGN) {
		p.nextToken()
		stmt.Value = p.parseExpressionStatement().Expression
	}

	return stmt
}

func (p *Parser) parseAssignExpression(name ast.Expression) ast.Expression {
	e := &ast.AssignExpression{Token: p.curToken}

	if n, ok := name.(*ast.Identifier); ok {
		e.Name = n
	} else {
		msg := fmt.Sprintf("expected assign token to be IDENT, got %s instead", name.TokenLiteral())
		p.errors = append(p.errors, msg)
	}
	p.nextToken()
	e.Value = p.parseExpression(LOWEST)

	return e
}

func (p *Parser) parseIncludeStatement() *ast.IncludeStatement {
	stmt := &ast.IncludeStatement{Token: p.curToken}

	if p.expectPeek(token.IDENT) {
		stmt.IncludePath = p.parseExpressionStatement().Expression
	}
	program, module, err := p.getIncludedStatements(stmt.IncludePath.String())
	if err != nil {
		p.errors = append(p.errors, err.Error())
	}
	stmt.Program = program
	stmt.IsModule = module
	return stmt
}

func (p *Parser) getIncludedStatements(importpath string) (*ast.Program, bool, error) {
	module := false
	path := p.path
	f, err := ioutil.ReadFile(path + "/" + importpath + ".my")
	if err != nil {
		path = path + "/" + importpath
		_, err := os.Stat(path)
		if err != nil {
			return nil, module, fmt.Errorf("no file or directory: %s.my, %s", importpath, path)
		}
		m, err := ioutil.ReadFile(path + "/module.my")
		if err != nil {
			return nil, module, err
		}
		module = true
		f = m
	}
	l := lexer.New(string(f))
	ps := New(l, path)
	parsed := ps.ParseProgram()
	if len(ps.errors) != 0 {
		p.errors = append(p.errors, ps.errors...)
	}
	return parsed, module, nil
}


text:
require 'ads_common/savon_service'
require 'dfp_api/v201511/content_service_registry'

module DfpApi; module V201511; module ContentService
  class ContentService < AdsCommon::SavonService
    def initialize(config, endpoint)
      namespace = 'https://www.google.com/apis/ads/publisher/v201511'
      super(config, endpoint, namespace, :v201511)
    end

    def get_content_by_statement(*args, &block)
      return execute_action('get_content_by_statement', args, &block)
    end

    def get_content_by_statement_to_xml(*args)
      return get_soap_xml('get_content_by_statement', args)
    end

    def get_content_by_statement_and_custom_targeting_value(*args, &block)
      return execute_action('get_content_by_statement_and_custom_targeting_value', args, &block)
    end

    def get_content_by_statement_and_custom_targeting_value_to_xml(*args)
      return get_soap_xml('get_content_by_statement_and_custom_targeting_value', args)
    end

    private

    def get_service_registry()
      return ContentServiceRegistry
    end

    def get_module()
      return DfpApi::V201511::ContentService
    end
  end
end; end; end


text:
ACCEPTED

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

#### Published in
Fung. 2: 463 (1884)

#### Original name
Fusisporium atrovirens Berk., 1836

### Remarks
null


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

function validarLetras(e) { // 1
    tecla = (document.all) ? e.keyCode : e.which;
    if (tecla==8) return true; // backspace
    if (tecla==32) return true; // espacio
    if (e.ctrlKey && tecla==86) { return true;} //Ctrl v
    if (e.ctrlKey && tecla==67) { return true;} //Ctrl c
    if (e.ctrlKey && tecla==88) { return true;} //Ctrl x

    patron = /[a-zA-Z.0-9]/; //patron

    te = String.fromCharCode(tecla);
    return patron.test(te); // prueba de patron
  }

function validarNumeros(e)
{

    teclaNumero = (document.all) ? e.keyCode : e.which;
    if (teclaNumero==8) return true;

    patronNumeros= /[0-9]/;
    te2 = String.fromCharCode(teclaNumero);
    return patronNumeros.test(te2);
}

function validarCampos(formulario) {

        //Controlar campos vacios y caracteres invalidos del nombre largo de la empresa
        if(formulario.textfield1.value.length==0) {
            formulario.textfield1.focus();
            alert('Por favor, ingrese la puntuación del Cumplimiento de especificaciones del proponente (sobre 15 puntos)');
        return false;
        }

        if(formulario.textfield2.value.length==0) {
            formulario.textfield2.focus();
            alert('Por favor, ingrese la puntuación de la Claridad en la organización de la empresa proponente (sobre 10 puntos)');
        return false;
        }

        if(formulario.textfield3.value.length==0) {
            formulario.textfield3.focus();
            alert('Por favor, ingrese la puntuación del Cumplimiento de especificaciones técnicas (sobre 30 puntos)');
        return false;
        }

        if(formulario.textfield4.value.length==0) {
            formulario.textfield4.focus();
            alert('Por favor, ingrese la puntuación de la Claridad en el proceso de desarrollo (sobre 10 puntos)');
        return false;
        }

        if(formulario.textfield5.value.length==0) {
            formulario.textfield5.focus();
            alert('Por favor, ingrese la puntuación del Plazo de ejecución (sobre 10 puntos)');
        return false;
        }

        if(formulario.textfield6.value.length==0) {
            formulario.textfield6.focus();
            alert('Por favor, ingrese la puntuación del Precio total (sobre 15 puntos)');
        return false;
        }

        if(formulario.textfield7.value.length==0) {
            formulario.textfield7.focus();
            alert('Por favor, ingrese la puntuación del Uso de herramientas en el proceso de desarrollo (sobre 10 puntos)');
        return false;
        }
        if(formulario.fecha.value.length===0) {
            formulario.textfield7.focus();
            alert('Por favor, ingrese la fecha para la reuni\u00f3n');
        return false;
        }
        if(formulario.hora.value.length===0) {
            formulario.textfield7.focus();
            alert('Por favor, ingrese la hora para la reuni\u00f3n');
        return false;
        }

        //controlamos que la calificacion no sea mayor de lo que se estipula

        if(formulario.textfield1.value > 15) {
            formulario.textfield1.focus();
            alert('La puntuación del Cumplimiento de especificaciones del proponente es sobre 15 puntos');
        return false;
        }

        if(formulario.textfield2.value > 10) {
            formulario.textfield2.focus();
            alert('La puntuación de la Claridad en la organización de la empresa proponente es sobre 10 puntos');
        return false;
        }

        if(formulario.textfield3.value > 30) {
            formulario.textfield3.focus();
            alert('La puntuación del Cumplimiento de especificaciones técnicas es sobre 30 puntos');
        return false;
        }

        if(formulario.textfield4.value > 10) {
            formulario.textfield4.focus();
            alert('La puntuación de la Claridad en el proceso de desarrollo es sobre 10 puntos');
        return false;
        }

        if(formulario.textfield5.value > 10) {
            formulario.textfield5.focus();
            alert('La puntuación del Plazo de ejecución es sobre 10 puntos');
        return false;
        }

        if(formulario.textfield6.value > 15) {
            formulario.textfield6.focus();
            alert('La puntuación del Precio total es sobre 15 puntos');
        return false;
        }

        if(formulario.textfield7.value > 10) {
            formulario.textfield7.focus();
            alert('La puntuación del Uso de herramientas en el proceso de desarrollo es sobre 10 puntos');
        return false;
        }

        //controlar espacio en blanco calificacion 1
        var calificacionUno=formulario.textfield1.value;
        var contadorUno=0;
        for (var i=0;i<calificacionUno.length;i++)
        {
            var caracterUno=calificacionUno.substring(i,i+1);
            if(caracterUno == ' ')
            {
                contadorUno++;
            }
        }

        if(contadorUno == calificacionUno.length)
        {
            alert('Campo de calificación requerido');
            return false;
        }

        //controlar espacio en blanco calificacion 2
        var calificacionDos=formulario.textfield2.value;
        var contadorDos=0;
        for (var i=0;i<calificacionDos.length;i++)
        {
            var caracterDos=calificacionDos.substring(i,i+1);
            if(caracterDos == ' ')
            {
                contadorDos++;
            }
        }

        if(contadorDos == calificacionDos.length)
        {
            alert('Campo de calificación requerido');
            return false;
        }

        //controlar espacio en blanco calificacion 3
        var calificacionTres=formulario.textfield3.value;
        var contadorTres=0;
        for (var i=0;i<calificacionTres.length;i++)
        {
            var caracterTres=calificacionTres.substring(i,i+1);
            if(caracterTres == ' ')
            {
                contadorTres++;
            }
        }

        if(contadorTres == calificacionTres.length)
        {
            alert('Campo de calificación requerido');
            return false;
        }

        //controlar espacio en blanco calificacion 4
        var calificacionCuatro=formulario.textfield4.value;
        var contadorCuatro=0;
        for (var i=0;i<calificacionCuatro.length;i++)
        {
            var caracterCuatro=calificacionCuatro.substring(i,i+1);
            if(caracterCuatro == ' ')
            {
                contadorCuatro++;
            }
        }

        if(contadorCuatro == calificacionCuatro.length)
        {
            alert('Campo de calificación requerido');
            return false;
        }

        //controlar espacio en blanco calificacion 5
        var calificacionCinco=formulario.textfield5.value;
        var contadorCinco=0;
        for (var i=0;i<calificacionCinco.length;i++)
        {
            var caracterCinco=calificacionCinco.substring(i,i+1);
            if(caracterCinco == ' ')
            {
                contadorCinco++;
            }
        }

        if(contadorCinco == calificacionCinco.length)
        {
            alert('Campo de calificación requerido');
            return false;
        }

        //controlar espacio en blanco calificacion 6
        var calificacionSeis=formulario.textfield6.value;
        var contadorSeis=0;
        for (var i=0;i<calificacionSeis.length;i++)
        {
            var caracterSeis=calificacionSeis.substring(i,i+1);
            if(caracterSeis == ' ')
            {
                contadorSeis++;
            }
        }

        if(contadorSeis == calificacionSeis.length)
        {
            alert('Campo de calificación requerido');
            return false;
        }

        //controlar espacio en blanco calificacion 7
        var calificacionSiete=formulario.textfield7.value;
        var contadorSiete=0;
        for (var i=0;i<calificacionSiete.length;i++)
        {
            var caracterSiete=calificacionSiete.substring(i,i+1);
            if(caracterSiete == ' ')
            {
                contadorSiete++;
            }
        }

        if(contadorSiete == calificacionSiete.length)
        {
            alert('Campo de calificación requerido');
            return false;
        }

        //controlamos el espacio del lugar
        var lugar=formulario.lugar.value;
        var contadorOcho=0;
        for (var i=0;i<lugar.length;i++)
        {
            var caracterOcho=lugar.substring(i,i+1);
            if(caracterOcho == ' ')
            {
                contadorOcho++;
            }
        }

        if(contadorOcho == lugar.length)
        {
            alert('Por favor, ingrese el lugar de la reunion');
            return false;
        }

        //controlamos que se introduzca el lugar
        if(oc.lugar.value.length==0) {
            oc.lugar.focus();
            alert('Por favor, ingrese el lugar de la reunión');
        return false;
        }

        return true;

}


text:
import { ClearMemPool } from '../../src/Commands'
import { TestCommand } from '../test-helpers'

describe('/ClearMemPool', function() {
  it(
    'ClearMemPool() should return a properly configured JSON-RPC request',
    function() {
      // Signature 1: undefined
      TestCommand(
        ClearMemPool(),
        ClearMemPool,
      )
    },
  )
})


text:
import { makeStyles } from '@material-ui/core/styles';

export default makeStyles(theme => ({
  root: {
    padding: theme.spacing(2),
  },
  label: {
    fontWeight: 'bold',
    marginRight: theme.spacing(1),
  },
  avatar: {
    margin: 0,
    marginBottom: theme.spacing(1),
  },
  detailsButton: {
    marginTop: theme.spacing(1),
  },
}));


text:
@interface PodsDummy_Pods_Payment : NSObject
@end
@implementation PodsDummy_Pods_Payment
@end


text:
import React, { Component } from 'react';
import DynamicList from './DynamicList';

export default class MobilePanel extends Component {
  constructor(props){
    super(props);
    this._getCategory = this._getCategory.bind(this);
    this._getSubs = this._getSubs.bind(this);
    this._interceptItem = this._interceptItem.bind(this);
    this.state = { figure: ()=>{}, options: [], title: "CATEGORIES", listClass: "shop-items", item: "" }
  }

  componentWillMount() {
    this._getCategory();
    this.setState({figure: this._getSubs});
  }

  _getSubs(category, item){
    let options = [];
    item = item ? item : "";
    const { actions } = this.props;
    if(category === "Show All" || category === "CATEGORIES") return this._interceptItem(category);
    actions.rawData.forEach(item => {
      if(item.category === category && options.indexOf(item.sub) < 0) options.push(item.sub);
      else if(category === "Go Back" && options.indexOf(item.sub) < 0) return this._getCategory();
    });
    options.push("Go Back");
    this.setState({ options, figure: this._interceptItem, title: category, item, listClass: "shop-items reload" });
  }

  _getCategory(ctgy){
    const { actions } = this.props;
    if (ctgy) return this._getSubs(ctgy[0], ctgy[1]);
    if (actions.rawData.length === 0) return;
    let options = [];
    actions.rawData.forEach(({ category })=>{
      options.indexOf(category) < 0 && options.push(category);
    });
    options.push("Show All");
    this.setState({ options, figure: this._getSubs, listClass: "shop-items" });
  }

  _interceptItem(item){
    item = item === "CATEGORIES" ? "Show All" : item;
    item === "Show All" ? this.setState({title: "CATEGORY", item: ""}) : this.setState({ item: "/ "+item });
    this.props.actions.setFigure(item);
  }

  render() {
    const { actions } = this.props;
  	let options = [];
    actions.rawData.forEach(({ category })=>{
      if(options.indexOf(category) < 0) options.push(category)
    });
    options.push("Show All");
    const filters = [50000, 200000, 500000, 1000000];
    const className = `mobile-panel`;
    const inline = { minHeight: actions.height }
    const shop = actions.knob ? "shop-items" : "shop-items no-display";
    const filter = actions.knob ? "filter-items no-display" : "filter-items";
    return (
      <section className={className} style={inline}>
        <DynamicList list={this.state.options} back={this._getCategory} figure={this.state.figure} listClass={shop} />
        <DynamicList list={filters} selectClass="select-button" filter={actions.filter} setFilter={actions.setFilter} reArrange={true} price={actions.setPrice} listClass={filter} />
        <button className="mobile-panel" onClick={actions.custom}>MAKE A CUSTOM ORDER</button>
        <button className="mobile-panel" onClick={()=>actions.shop("", "no-display", true)}>BACK TO SHOP</button>
      </section>
    );
  }
}


text:
using Microsoft.Xna.Framework;
using System;
using System.Text;
using tdsm.api;
using tdsm.api.Plugin;
using tdsm.core.Logging;
using tdsm.core.Messages.Out;
using tdsm.core.ServerCore;
using Terraria;

namespace tdsm.core.Messages.In
{
    class PlayerDataMessage : MessageHandler
    {
        public PlayerDataMessage()
        {
            //IgnoredStates |= SlotState.ASSIGNING_SLOT;
            ValidStates = SlotState.ACCEPTED | SlotState.ASSIGNING_SLOT |
                /* this so that we can have a custom error message */
                SlotState.SENDING_WORLD | SlotState.SENDING_TILES | SlotState.PLAYING;
        }

        private const int MAX_HAIR_ID = 36;

        public override Packet GetPacket()
        {
            return Packet.PLAYER_DATA;
        }

        static string GetName(ClientConnection conn, byte[] readBuffer, int num, int len)
        {
            string name;

            try
            {
                name = Encoding.ASCII.GetString(readBuffer, num, len).Trim();
            }
            catch (ArgumentException)
            {
                conn.Kick("Invalid name: contains non-ASCII characters.");
                return null;
            }

            if (name.Length > 20)
            {
                conn.Kick("Invalid name: longer than 20 characters.");
                return null;
            }

            if (name == String.Empty)
            {
                conn.Kick("Invalid name: whitespace or empty.");
                return null;
            }

            foreach (char c in name)
            {
                if (c < 32 || c > 126)
                {
                    conn.Kick("Invalid name: contains non-printable characters.");
                    return null;
                }
            }

            if (name.Contains(" " + " "))
            {
                conn.Kick("Invalid name: contains double spaces.");
                return null;
            }

            return name;
        }

        public override void Process(ClientConnection conn, byte[] readBuffer, int length, int num)
        {
            int start = num - 1;

            if (conn.State == SlotState.ASSIGNING_SLOT)
            {
                // TODO: verify that data didn't change.
                int who = conn.SlotIndex;
                NewNetMessage.SendData(4, -1, who, conn.Player.Name, who);
                return;
            }

            //if (conn.Player != null)
            //{
            //    conn.Kick("Player data sent twice.");
            //    return;
            //}

            //var player = new Player();
            var player = conn.Player;
            var connecting = conn.Player == null;
            if (connecting)
            {
                player = new Player();
                conn.Player = player;
                player.Connection = conn;
                player.IPAddress = conn.RemoteAddress;
                player.whoAmi = conn.SlotIndex;
            }

            var data = new HookArgs.PlayerDataReceived()
            {
                IsConnecting = connecting
            };

            var read = data.Parse(readBuffer, num + 1 /* PlayerId */, length);
            Skip(read);

            if (data.Hair >= MAX_HAIR_ID)
            {
                data.Hair = 0;
            }

            var ctx = new HookContext
            {
                Connection = conn,
                Player = player,
                Sender = player,
            };

            HookPoints.PlayerDataReceived.Invoke(ref ctx, ref data);

            if (ctx.CheckForKick())
                return;

            if (!data.NameChecked)
            {
                string error;
                if (!data.CheckName(out error))
                {
                    conn.Kick(error);
                    return;
                }
            }

            string address = conn.RemoteAddress.Split(':')[0];
            if (!data.BansChecked)
            {
                if (Server.Bans.Contains(address) || Server.Bans.Contains(data.Name))
                {
                    ProgramLog.Admin.Log("Prevented banned user {0} from accessing the server.", data.Name);
                    conn.Kick("You are banned from this server.");
                    return;
                }
            }

            if (!data.WhitelistChecked && Server.WhitelistEnabled)
            {
                if (!Server.Whitelist.Contains(address) && !Server.Whitelist.Contains(data.Name))
                {
                    ProgramLog.Admin.Log("Prevented non whitelisted user {0} from accessing the server.", data.Name);
                    conn.Kick("You do not have access to this server.");
                    return;
                }
            }

            data.Apply(player);

            if (connecting)
                if (ctx.Result == HookResult.ASK_PASS)
                {
                    conn.State = SlotState.PLAYER_AUTH;

                    var msg = NewNetMessage.PrepareThreadInstance();
                    msg.PasswordRequest();
                    conn.Send(msg.Output);

                    return;
                }
                else // HookResult.DEFAULT
                {
                    // don't allow replacing connections for guests, but do for registered users
                    if (conn.State < SlotState.PLAYING)
                    {
                        var lname = player.Name.ToLower();

                        foreach (var otherPlayer in Main.player)
                        {
                            var otherSlot = Terraria.Netplay.Clients[otherPlayer.whoAmi];
                            if (otherPlayer.Name != null && lname == otherPlayer.Name.ToLower() && otherSlot.State() >= SlotState.CONNECTED)
                            {
                                conn.Kick("A \"" + otherPlayer.Name + "\" is already on this server.");
                                return;
                            }
                        }
                    }

                    //conn.Queue = (int)loginEvent.Priority; // actual queueing done on world request message

                    // and now decide whether to queue the connection
                    //SlotManager.Schedule (conn, (int)loginEvent.Priority);

                    //NewNetMessage.SendData (4, -1, -1, player.Name, whoAmI);
                }

            //int num3 = (int)ReadByte(readBuffer);
            //if (Main.netMode == 2)
            //{
            //    num3 = this.whoAmI;
            //}
            //if (num3 == Main.myPlayer && !Main.ServerSideCharacter)
            //{
            //    return;
            //}
            //Player player2 = Main.player[num3];
            //player2.whoAmi = num3;
            //if (ReadByte() == 0)
            //{
            //    player2.male = true;
            //}
            //else
            //{
            //    player2.male = false;
            //}
            //player2.hair = (int)ReadByte(readBuffer);
            //if (player2.hair >= 123)
            //{
            //    player2.hair = 0;
            //}
            //player2.name = ReadString().Trim();
            //player2.hairDye = ReadByte(readBuffer);
            //player2.hideVisual = ReadByte(readBuffer);
            //player2.hairColor = ReadRGB();
            //player2.skinColor = ReadRGB();
            //player2.eyeColor = ReadRGB();
            //player2.shirtColor = ReadRGB();
            //player2.underShirtColor = ReadRGB();
            //player2.pantsColor = ReadRGB();
            //player2.shoeColor = ReadRGB();
            //player2.difficulty = ReadByte(readBuffer);
            //if (Main.netMode != 2)
            //{
            //    return;
            //}
            //bool flag = false;
            //if (tdsm.api.Callbacks.Netplay.slots[this.whoAmI].state < 10)
            //{
            //    for (int n = 0; n < 255; n++)
            //    {
            //        if (n != num3 && player2.name == Main.player[n].name && tdsm.api.Callbacks.Netplay.slots[n].active)
            //        {
            //            flag = true;
            //        }
            //    }
            //}
            //if (flag)
            //{
            //    NewNetMessage.SendData(2, this.whoAmI, -1, player2.name + " " + Lang.mp[5], 0, 0f, 0f, 0f, 0);
            //    return;
            //}
            //if (player2.name.Length > Player.nameLen)
            //{
            //    NewNetMessage.SendData(2, this.whoAmI, -1, "Name is too long.", 0, 0f, 0f, 0f, 0);
            //    return;
            //}
            //if (player2.name == String.Empty)
            //{
            //    NewNetMessage.SendData(2, this.whoAmI, -1, "Empty name.", 0, 0f, 0f, 0f, 0);
            //    return;
            //}
            //tdsm.api.Callbacks.Netplay.slots[this.whoAmI].oldName = player2.name;
            //tdsm.api.Callbacks.Netplay.slots[this.whoAmI].name = player2.name;
            //NewNetMessage.SendData(4, -1, this.whoAmI, player2.name, num3, 0f, 0f, 0f, 0);
            //return;
        }

        private int setColor(Color color, int bufferPos, byte[] readBuffer)
        {
            color.R = readBuffer[bufferPos++];
            color.G = readBuffer[bufferPos++];
            color.B = readBuffer[bufferPos++];
            return bufferPos;
        }

    }
}


text:
#ifndef ABCC_ABCC_DEVICE_H
#define ABCC_ABCC_DEVICE_H

#include <android/log.h>
#if VERBOSE
#include <sys/time.h>
#endif
#include "Abcc.h"

#define LOG_TAG "AbccNative"
#define LOGE(format, ...)  do {\
  __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, format, ##__VA_ARGS__);\
  } while(0)

#if VERBOSE
#define LOGV(format, ...)  do {\
  __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, format, ##__VA_ARGS__);\
  } while(0)
#else
#define LOGV(format, ...)
#endif  // VERBOSE

namespace abcc {

#if VERBOSE
class Timer {
private:
  struct timeval _t0;
public:
  Timer() {};
  void start() { gettimeofday(&_t0, NULL); }
  long long stop() {
  struct timeval t;
    gettimeofday(&t, NULL);
    long long l0 = _t0.tv_sec * 1000000LL + _t0.tv_usec;
    long long l = t.tv_sec * 1000000LL + t.tv_usec;
    return l - l0;
  }
};

extern long long llc_usec;

#endif // VERBOSE

class DeviceBitcodeCompiler : public BitcodeCompiler {
public:
  DeviceBitcodeCompiler(const std::string &working_dir, const std::string &sysroot);
  virtual void cleanupPost();

public:
  virtual int parseLDFlags(BitcodeInfo &info, const std::string &str);

private:
  virtual void getBitcodeFiles();
  virtual void prepareToolchain();
  virtual void copyRuntime(const BitcodeInfo &info);
  virtual void removeIntermediateFile(const std::string &path);
};

} // namespace abcc

#endif


text:
TEMA

		Tumor Evolution Manager and Analyzer

User activation

			We are verifying the provided confirmation token...

Your user has been activated!

An error occurred during the activation of your user.

User already activated.

An error occurred during the activation of your user.

...


text:
// =============================
// Email: info@ebenmonney.com
// www.ebenmonney.com/templates
// =============================

using System;
using System.Collections.Generic;
using DAL.Core;
using IdentityModel;
using IdentityServer4;
using IdentityServer4.Models;

namespace QuickApp
{
    public class IdentityServerConfig
    {
        public const string ApiName = "quickapp_api";
        public const string ApiFriendlyName = "QuickApp API";
        public const string QuickAppClientID = "quickapp_spa";
        public const string SwaggerClientID = "swaggerui";

        // Identity resources (used by UserInfo endpoint).
        public static IEnumerable<IdentityResource> GetIdentityResources()
        {
            return new List<IdentityResource>
            {
                new IdentityResources.OpenId(),
                new IdentityResources.Profile(),
                new IdentityResources.Phone(),
                new IdentityResources.Email(),
                new IdentityResource(ScopeConstants.Roles, new List<string> { JwtClaimTypes.Role })
            };
        }

        // Api scopes.
        public static IEnumerable<ApiScope> GetApiScopes()
        {
            return new List<ApiScope>
            {
                new ApiScope(ApiName, ApiFriendlyName) {
                    UserClaims = {
                        JwtClaimTypes.Name,
                        JwtClaimTypes.Email,
                        JwtClaimTypes.PhoneNumber,
                        JwtClaimTypes.Role,
                        ClaimConstants.Permission
                    }
                }
            };
        }

        // Api resources (Needed for audience to be set on token).
        public static IEnumerable<ApiResource> GetApiResources()
        {
            return new List<ApiResource>
            {
                new ApiResource(ApiName) {
                    Scopes = { ApiName }
                }
            };
        }

        // Clients want to access resources.
        public static IEnumerable<Client> GetClients()
        {
            // Clients credentials.
            return new List<Client>
            {
                // http://docs.identityserver.io/en/release/reference/client.html.
                new Client
                {
                    ClientId = QuickAppClientID,
                    AllowedGrantTypes = GrantTypes.ResourceOwnerPassword, // Resource Owner Password Credential grant.
                    AllowAccessTokensViaBrowser = true,
                    RequireClientSecret = false, // This client does not need a secret to request tokens from the token endpoint.

                    AllowedScopes = {
                        IdentityServerConstants.StandardScopes.OpenId, // For UserInfo endpoint.
                        IdentityServerConstants.StandardScopes.Profile,
                        IdentityServerConstants.StandardScopes.Phone,
                        IdentityServerConstants.StandardScopes.Email,
                        ScopeConstants.Roles,
                        ApiName
                    },
                    AllowOfflineAccess = true, // For refresh token.
                    RefreshTokenExpiration = TokenExpiration.Sliding,
                    RefreshTokenUsage = TokenUsage.OneTimeOnly,
                    //AccessTokenLifetime = 900, // Lifetime of access token in seconds.
                    //AbsoluteRefreshTokenLifetime = 7200,
                    //SlidingRefreshTokenLifetime = 900,
                },

                new Client
                {
                    ClientId = SwaggerClientID,
                    ClientName = "Swagger UI",
                    AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
                    AllowAccessTokensViaBrowser = true,
                    RequireClientSecret = false,

                    AllowedScopes = {
                        ApiName
                    }
                }
            };
        }
    }
}


text:
package gocb

import (
	"fmt"
	"strconv"
	"sync"
	"sync/atomic"
	"time"

	gocbcore "github.com/couchbase/gocbcore/v8"
	"github.com/couchbaselabs/gocbconnstr"
	"github.com/pkg/errors"
)

// Cluster represents a connection to a specific Couchbase cluster.
type Cluster struct {
	cSpec gocbconnstr.ConnSpec
	auth  Authenticator

	connectionsLock sync.RWMutex
	connections     map[string]client
	clusterClient   client

	clusterLock sync.RWMutex
	queryCache  map[string]*queryCacheEntry

	sb stateBlock

	supportsEnhancedStatements int32

	supportsGCCCP bool
}

// IoConfig specifies IO related configuration options.
type IoConfig struct {
	DisableMutationTokens  bool
	DisableServerDurations bool
}

// TimeoutsConfig specifies options for various operation timeouts.
type TimeoutsConfig struct {
	ConnectTimeout    time.Duration
	KVTimeout         time.Duration
	ViewTimeout       time.Duration
	QueryTimeout      time.Duration
	AnalyticsTimeout  time.Duration
	SearchTimeout     time.Duration
	ManagementTimeout time.Duration
}

// OrphanReporterConfig specifies options for controlling the orphan
// reporter which records when the SDK receives responses for requests
// that are no longer in the system (usually due to being timed out).
type OrphanReporterConfig struct {
	Disabled       bool
	ReportInterval time.Duration
	SampleSize     uint32
}

// ClusterOptions is the set of options available for creating a Cluster.
type ClusterOptions struct {
	// Authenticator specifies the authenticator to use with the cluster.
	Authenticator Authenticator

	// Timeouts specifies various operation timeouts.
	TimeoutsConfig TimeoutsConfig

	// Transcoder is used for trancoding data used in KV operations.
	Transcoder Transcoder

	// RetryStrategy is used to automatically retry operations if they fail.
	RetryStrategy RetryStrategy

	// Tracer specifies the tracer to use for requests.
	// VOLATILE: This API is subject to change at any time.
	Tracer requestTracer

	// OrphanReporterConfig specifies options for the orphan reporter.
	OrphanReporterConfig OrphanReporterConfig

	// CircuitBreakerConfig specifies options for the circuit breakers.
	CircuitBreakerConfig CircuitBreakerConfig

	// IoConfig specifies IO related configuration options.
	IoConfig IoConfig
}

// ClusterCloseOptions is the set of options available when
// disconnecting from a Cluster.
type ClusterCloseOptions struct {
}

// Connect creates and returns a Cluster instance created using the
// provided options and a connection string.
func Connect(connStr string, opts ClusterOptions) (*Cluster, error) {
	connSpec, err := gocbconnstr.Parse(connStr)
	if err != nil {
		return nil, err
	}

	if connSpec.Scheme == "http" {
		return nil, errors.New("http scheme is not supported, use couchbase or couchbases instead")
	}

	connectTimeout := 10000 * time.Millisecond
	kvTimeout := 2500 * time.Millisecond
	viewTimeout := 75000 * time.Millisecond
	queryTimeout := 75000 * time.Millisecond
	analyticsTimeout := 75000 * time.Millisecond
	searchTimeout := 75000 * time.Millisecond
	managementTimeout := 75000 * time.Millisecond
	if opts.TimeoutsConfig.ConnectTimeout > 0 {
		connectTimeout = opts.TimeoutsConfig.ConnectTimeout
	}
	if opts.TimeoutsConfig.KVTimeout > 0 {
		kvTimeout = opts.TimeoutsConfig.KVTimeout
	}
	if opts.TimeoutsConfig.ViewTimeout > 0 {
		viewTimeout = opts.TimeoutsConfig.ViewTimeout
	}
	if opts.TimeoutsConfig.QueryTimeout > 0 {
		queryTimeout = opts.TimeoutsConfig.QueryTimeout
	}
	if opts.TimeoutsConfig.AnalyticsTimeout > 0 {
		analyticsTimeout = opts.TimeoutsConfig.AnalyticsTimeout
	}
	if opts.TimeoutsConfig.SearchTimeout > 0 {
		searchTimeout = opts.TimeoutsConfig.SearchTimeout
	}
	if opts.TimeoutsConfig.ManagementTimeout > 0 {
		managementTimeout = opts.TimeoutsConfig.SearchTimeout
	}
	if opts.Transcoder == nil {
		opts.Transcoder = NewJSONTranscoder()
	}
	if opts.RetryStrategy == nil {
		opts.RetryStrategy = NewBestEffortRetryStrategy(nil)
	}

	useMutationTokens := true
	useServerDurations := true
	if opts.IoConfig.DisableMutationTokens {
		useMutationTokens = false
	}
	if opts.IoConfig.DisableServerDurations {
		useServerDurations = false
	}

	var initialTracer requestTracer
	if opts.Tracer != nil {
		initialTracer = opts.Tracer
	} else {
		initialTracer = newThresholdLoggingTracer(nil)
	}
	tracerAddRef(initialTracer)

	cluster := &Cluster{
		cSpec:       connSpec,
		auth:        opts.Authenticator,
		connections: make(map[string]client),
		sb: stateBlock{
			ConnectTimeout:         connectTimeout,
			QueryTimeout:           queryTimeout,
			AnalyticsTimeout:       analyticsTimeout,
			SearchTimeout:          searchTimeout,
			ViewTimeout:            viewTimeout,
			KvTimeout:              kvTimeout,
			DuraTimeout:            40000 * time.Millisecond,
			DuraPollTimeout:        100 * time.Millisecond,
			Transcoder:             opts.Transcoder,
			UseMutationTokens:      useMutationTokens,
			ManagementTimeout:      managementTimeout,
			RetryStrategyWrapper:   newRetryStrategyWrapper(opts.RetryStrategy),
			OrphanLoggerEnabled:    !opts.OrphanReporterConfig.Disabled,
			OrphanLoggerInterval:   opts.OrphanReporterConfig.ReportInterval,
			OrphanLoggerSampleSize: opts.OrphanReporterConfig.SampleSize,
			UseServerDurations:     useServerDurations,
			Tracer:                 initialTracer,
			CircuitBreakerConfig:   opts.CircuitBreakerConfig,
		},

		queryCache: make(map[string]*queryCacheEntry),
	}

	err = cluster.parseExtraConnStrOptions(connSpec)
	if err != nil {
		return nil, err
	}

	csb := &clientStateBlock{
		BucketName: "",
	}
	cli := newClient(cluster, csb)
	err = cli.buildConfig()
	if err != nil {
		return nil, err
	}

	err = cli.connect()
	if err != nil {
		return nil, err
	}
	cluster.clusterClient = cli
	cluster.supportsGCCCP = cli.supportsGCCCP()

	return cluster, nil
}

func (c *Cluster) parseExtraConnStrOptions(spec gocbconnstr.ConnSpec) error {
	fetchOption := func(name string) (string, bool) {
		optValue := spec.Options[name]
		if len(optValue) == 0 {
			return "", false
		}
		return optValue[len(optValue)-1], true
	}

	if valStr, ok := fetchOption("query_timeout"); ok {
		val, err := strconv.ParseInt(valStr, 10, 64)
		if err != nil {
			return fmt.Errorf("query_timeout option must be a number")
		}
		c.sb.QueryTimeout = time.Duration(val) * time.Millisecond
	}

	if valStr, ok := fetchOption("analytics_timeout"); ok {
		val, err := strconv.ParseInt(valStr, 10, 64)
		if err != nil {
			return fmt.Errorf("analytics_timeout option must be a number")
		}
		c.sb.AnalyticsTimeout = time.Duration(val) * time.Millisecond
	}

	if valStr, ok := fetchOption("search_timeout"); ok {
		val, err := strconv.ParseInt(valStr, 10, 64)
		if err != nil {
			return fmt.Errorf("search_timeout option must be a number")
		}
		c.sb.SearchTimeout = time.Duration(val) * time.Millisecond
	}

	if valStr, ok := fetchOption("view_timeout"); ok {
		val, err := strconv.ParseInt(valStr, 10, 64)
		if err != nil {
			return fmt.Errorf("view_timeout option must be a number")
		}
		c.sb.ViewTimeout = time.Duration(val) * time.Millisecond
	}

	return nil
}

// Bucket connects the cluster to server(s) and returns a new Bucket instance.
func (c *Cluster) Bucket(bucketName string) *Bucket {
	b := newBucket(&c.sb, bucketName)
	cli := c.takeClusterClient()
	if cli == nil {
		// We've already taken the cluster client for a different bucket or something like that so
		// we need to connect a new client.
		cli = c.getClient(&b.sb.clientStateBlock)
		err := cli.buildConfig()
		if err == nil {
			err = cli.connect()
			if err != nil {
				cli.setBootstrapError(err)
			}
		} else {
			cli.setBootstrapError(err)
		}
	} else {
		err := cli.selectBucket(bucketName)
		if err != nil {
			cli.setBootstrapError(err)
		}
	}
	c.connectionsLock.Lock()
	c.connections[b.hash()] = cli
	c.connectionsLock.Unlock()
	b.cacheClient(cli)

	return b
}

func (c *Cluster) takeClusterClient() client {
	c.connectionsLock.Lock()
	defer c.connectionsLock.Unlock()

	if c.clusterClient != nil {
		cli := c.clusterClient
		c.clusterClient = nil
		return cli
	}

	return nil
}

func (c *Cluster) getClient(sb *clientStateBlock) client {
	c.connectionsLock.Lock()

	hash := sb.Hash()
	if cli, ok := c.connections[hash]; ok {
		c.connectionsLock.Unlock()
		return cli
	}
	c.connectionsLock.Unlock()

	cli := newClient(c, sb)

	return cli
}

func (c *Cluster) randomClient() (client, error) {
	c.connectionsLock.RLock()
	if len(c.connections) == 0 {
		c.connectionsLock.RUnlock()
		return nil, errors.New("not connected to cluster")
	}
	var randomClient client
	var firstError error
	for _, c := range c.connections { // This is ugly
		if c.connected() {
			randomClient = c
			break
		} else if firstError == nil {
			firstError = c.getBootstrapError()
		}
	}
	c.connectionsLock.RUnlock()
	if randomClient == nil {
		if firstError == nil {
			return nil, errors.New("not connected to cluster")
		}

		return nil, firstError
	}

	return randomClient, nil
}

func (c *Cluster) authenticator() Authenticator {
	return c.auth
}

func (c *Cluster) connSpec() gocbconnstr.ConnSpec {
	return c.cSpec
}

// Close shuts down all buckets in this cluster and invalidates any references this cluster has.
func (c *Cluster) Close(opts *ClusterCloseOptions) error {
	var overallErr error

	c.clusterLock.Lock()
	for key, conn := range c.connections {
		err := conn.close()
		if err != nil {
			logWarnf("Failed to close a client in cluster close: %s", err)
			overallErr = err
		}

		delete(c.connections, key)
	}
	if c.clusterClient != nil {
		err := c.clusterClient.close()
		if err != nil {
			logWarnf("Failed to close cluster client in cluster close: %s", err)
			overallErr = err
		}
	}
	c.clusterLock.Unlock()

	if c.sb.Tracer != nil {
		tracerDecRef(c.sb.Tracer)
		c.sb.Tracer = nil
	}

	return overallErr
}

func (c *Cluster) clusterOrRandomClient() (client, error) {
	var cli client
	c.connectionsLock.RLock()
	if c.clusterClient == nil {
		c.connectionsLock.RUnlock()
		var err error
		cli, err = c.randomClient()
		if err != nil {
			return nil, err
		}
	} else {
		cli = c.clusterClient
		c.connectionsLock.RUnlock()
		if !cli.supportsGCCCP() {
			return nil, errors.New("cluster-level operations not supported due to cluster version")
		}
	}

	return cli, nil
}

func (c *Cluster) getDiagnosticsProvider() (diagnosticsProvider, error) {
	cli, err := c.clusterOrRandomClient()
	if err != nil {
		return nil, err
	}

	provider, err := cli.getDiagnosticsProvider()
	if err != nil {
		return nil, err
	}

	return provider, nil
}

func (c *Cluster) getQueryProvider() (queryProvider, error) {
	cli, err := c.clusterOrRandomClient()
	if err != nil {
		return nil, err
	}

	provider, err := cli.getQueryProvider()
	if err != nil {
		return nil, err
	}

	return provider, nil
}

func (c *Cluster) getAnalyticsProvider() (analyticsProvider, error) {
	cli, err := c.clusterOrRandomClient()
	if err != nil {
		return nil, err
	}

	provider, err := cli.getAnalyticsProvider()
	if err != nil {
		return nil, err
	}

	return provider, nil
}

func (c *Cluster) getSearchProvider() (searchProvider, error) {
	cli, err := c.clusterOrRandomClient()
	if err != nil {
		return nil, err
	}

	provider, err := cli.getSearchProvider()
	if err != nil {
		return nil, err
	}

	return provider, nil
}

func (c *Cluster) getHTTPProvider() (httpProvider, error) {
	cli, err := c.clusterOrRandomClient()
	if err != nil {
		return nil, err
	}

	provider, err := cli.getHTTPProvider()
	if err != nil {
		return nil, err
	}

	return provider, nil
}

func (c *Cluster) supportsEnhancedPreparedStatements() bool {
	return atomic.LoadInt32(&c.supportsEnhancedStatements) > 0
}

func (c *Cluster) setSupportsEnhancedPreparedStatements(supports bool) {
	if supports {
		atomic.StoreInt32(&c.supportsEnhancedStatements, 1)
	} else {
		atomic.StoreInt32(&c.supportsEnhancedStatements, 0)
	}
}

type clusterHTTPWrapper struct {
	c *Cluster
}

func (cw clusterHTTPWrapper) DoHTTPRequest(req *gocbcore.HTTPRequest) (*gocbcore.HTTPResponse, error) {
	provider, err := cw.c.getHTTPProvider()
	if err != nil {
		return nil, err
	}

	return provider.DoHTTPRequest(req)
}

// Users returns a UserManager for managing users.
func (c *Cluster) Users() *UserManager {
	provider := clusterHTTPWrapper{c}

	return &UserManager{
		httpClient:           provider,
		globalTimeout:        c.sb.ManagementTimeout,
		defaultRetryStrategy: c.sb.RetryStrategyWrapper,
		tracer:               c.sb.Tracer,
	}
}

// Buckets returns a BucketManager for managing buckets.
func (c *Cluster) Buckets() *BucketManager {
	provider := clusterHTTPWrapper{c}

	return &BucketManager{
		httpClient:           provider,
		globalTimeout:        c.sb.ManagementTimeout,
		defaultRetryStrategy: c.sb.RetryStrategyWrapper,
		tracer:               c.sb.Tracer,
	}
}

// AnalyticsIndexes returns an AnalyticsIndexManager for managing analytics indexes.
func (c *Cluster) AnalyticsIndexes() *AnalyticsIndexManager {
	return &AnalyticsIndexManager{
		cluster: c,
		tracer:  c.sb.Tracer,
	}
}

// QueryIndexes returns a QueryIndexManager for managing query indexes.
func (c *Cluster) QueryIndexes() *QueryIndexManager {
	return &QueryIndexManager{
		cluster: c,
		tracer:  c.sb.Tracer,
	}
}

// SearchIndexes returns a SearchIndexManager for managing search indexes.
func (c *Cluster) SearchIndexes() *SearchIndexManager {
	return &SearchIndexManager{
		cluster: c,
		tracer:  c.sb.Tracer,
	}
}


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

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="syntax_highlight.css" type="text/css" charset="utf-8" />

    <title>All Modules / Classes</title>
    <base target="main" />

All Modules / Classes

Wesabe (class)

Wesabe::Account (class)

Wesabe::BaseModel (class)

Wesabe::Credential (class)

Wesabe::Currency (class)

Wesabe::FinancialInstitution (class)

Wesabe::Job (class)

Wesabe::Request (class)

Wesabe::Request::Exception (class)

Wesabe::Request::Redirect (class)

Wesabe::Request::RequestFailed (class)

Wesabe::Request::ResourceNotFound (class)

Wesabe::Request::ServerBrokeConnection (class)

Wesabe::Request::Unauthorized (class)

Wesabe::Target (class)

Wesabe::Upload (class)

Wesabe::Upload::Exception (class)

Wesabe::Upload::StatementError (class)

Wesabe::Util (module)


text:
package CobaiaEx;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;

public class Gravar2 {

	public static void main(String[] args) throws FileNotFoundException {

		File arquivo = new File("arquivo.txt");

		PrintStream out  = new PrintStream(arquivo);

		out.println("Ola Marilene");

		out.flush();
		out.close();

		System.out.println("OK");

	}

}


text:
Describe "ConvertTo-JiraComment" -Tag 'Unit' {

    BeforeAll {
        Remove-Item -Path Env:\BH*
        $projectRoot = (Resolve-Path "$PSScriptRoot/../..").Path
        if ($projectRoot -like "*Release") {
            $projectRoot = (Resolve-Path "$projectRoot/..").Path
        }

        Import-Module BuildHelpers
        Set-BuildEnvironment -BuildOutput '$ProjectPath/Release' -Path $projectRoot -ErrorAction SilentlyContinue

        $env:BHManifestToTest = $env:BHPSModuleManifest
        $script:isBuild = $PSScriptRoot -like "$env:BHBuildOutput*"
        if ($script:isBuild) {
            $Pattern = [regex]::Escape($env:BHProjectPath)

            $env:BHBuildModuleManifest = $env:BHPSModuleManifest -replace $Pattern, $env:BHBuildOutput
            $env:BHManifestToTest = $env:BHBuildModuleManifest
        }

        Import-Module "$env:BHProjectPath/Tools/BuildTools.psm1"

        Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
        Import-Module $env:BHManifestToTest
    }
    AfterAll {
        Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
        Remove-Module BuildHelpers -ErrorAction SilentlyContinue
        Remove-Item -Path Env:\BH*
    }

    InModuleScope JiraPS {

        . "$PSScriptRoot/../Shared.ps1"

        $jiraServer = 'http://jiraserver.example.com'
        $jiraUsername = 'powershell-test'
        $jiraUserDisplayName = 'PowerShell Test User'
        $jiraUserEmail = 'noreply@example.com'

        $commentId = 90730
        $commentBody = "Test comment"

        $sampleJson = @"
{
    "self": "$jiraServer/rest/api/2/issue/41701/comment/90730",
    "id": "$commentId",
    "author": {
    "self": "$jiraServer/rest/api/2/user?username=powershell-test",
    "name": "$jiraUsername",
    "emailAddress": "$jiraUserEmail",
    "avatarUrls": {
        "48x48": "$jiraServer/secure/useravatar?avatarId=10202",
        "24x24": "$jiraServer/secure/useravatar?size=small&avatarId=10202",
        "16x16": "$jiraServer/secure/useravatar?size=xsmall&avatarId=10202",
        "32x32": "$jiraServer/secure/useravatar?size=medium&avatarId=10202"
    },
    "displayName": "$jiraUserDisplayName",
    "active": true
    },
    "body": "$commentBody",
    "updateAuthor": {
    "self": "$jiraServer/rest/api/2/user?username=powershell-test",
    "name": "powershell-test",
    "emailAddress": "$jiraUserEmail",
    "avatarUrls": {
        "48x48": "$jiraServer/secure/useravatar?avatarId=10202",
        "24x24": "$jiraServer/secure/useravatar?size=small&avatarId=10202",
        "16x16": "$jiraServer/secure/useravatar?size=xsmall&avatarId=10202",
        "32x32": "$jiraServer/secure/useravatar?size=medium&avatarId=10202"
    },
    "displayName": "$jiraUserDisplayName",
    "active": true
    },
    "created": "2015-05-01T16:24:38.000-0500",
    "updated": "2015-05-01T16:24:38.000-0500",
    "visibility": {
    "type": "role",
    "value": "Developers"
    }
}
"@

        $sampleObject = ConvertFrom-Json -InputObject $sampleJson
        $r = ConvertTo-JiraComment -InputObject $sampleObject

        It "Creates a PSObject out of JSON input" {
            $r | Should Not BeNullOrEmpty
        }

        checkPsType $r 'JiraPS.Comment'

        defProp $r 'Id' $commentId
        defProp $r 'Body' $commentBody
        defProp $r 'RestUrl' "$jiraServer/rest/api/2/issue/41701/comment/$commentId"
        defProp $r 'Created' (Get-Date '2015-05-01T16:24:38.000-0500')
        defProp $r 'Updated' (Get-Date '2015-05-01T16:24:38.000-0500')
    }
}


text:
from .Tabular import Tabular
from .IncrementalTabular import IncrementalTabular
from .IndependentDiscretization import IndependentDiscretization
from .IndependentDiscretizationCompactBinary import IndependentDiscretizationCompactBinary
from .RBF import RBF
from .iFDD import iFDD, iFDDK
from .Fourier import Fourier
from .BEBF import BEBF
from .OMPTD import OMPTD
from .TileCoding import TileCoding

from .KernelizediFDD import linf_triangle_kernel, gaussian_kernel, KernelizediFDD
from .LocalBases import RandomLocalBases
from .LocalBases import NonparametricLocalBases