text:
using System;
using System.Web.Http;
using BohFoundation.Domain.Dtos;
using BohFoundation.Domain.Dtos.UserManagement;
using BohFoundation.Domain.Enums;
using BohFoundation.MembershipProvider.UserManagement.Manage.Interfaces;
using BohFoundation.TestHelpers;
using BohFoundation.WebApi.Controllers.UserAccount;
using FakeItEasy;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace BohFoundation.WebApi.Tests.Controllers.UserAccount
{
    [TestClass]
    public class RegisterApplicantControllerTests
    {
        private RegisterApplicantController _registerApplicantController;
        private IRegisterUserService _registerApplicant;
        private RegisterInputModel Model { get; set; }
        private IHttpActionResult Result { get; set; }

        [TestInitialize]
        public void Initialize()
        {
            _registerApplicant = A.Fake<IRegisterUserService>();
            _registerApplicantController = new RegisterApplicantController(_registerApplicant);

            Model = new RegisterInputModel();
        }

        [TestMethod]
        public void RegisterApplicantController_Post_Should_Call_RegisterApplicant_CreateAccount()
        {
            PostRegisteration();
            A.CallTo(() => _registerApplicant.CreateAccount(Model, MemberTypesEnum.Applicant)).MustHaveHappened();
        }

        [TestMethod]
        public void RegisterApplicantController_Post_Should_Return_HttpActionResult()
        {
            PostRegisteration();
            WebApiCommonAsserts.IsHttpActionResult(Result);
        }

        [TestMethod]
        public void RegisterApplicantController_Post_Should_ReturnInternalServerError_OnException()
        {
            A.CallTo(() => _registerApplicant.CreateAccount(Model, MemberTypesEnum.Applicant)).Throws(new Exception());
            PostRegisteration();
            WebApiCommonAsserts.IsInternalServerError(Result);
        }

        [TestMethod]
        public void RegisterApplicantController_Post_Should_Have_A_BadRequest_When_FailureSuccessModelReturn()
        {
            A.CallTo(() => _registerApplicant.CreateAccount(Model, MemberTypesEnum.Applicant)).Returns(new SuccessOrFailureDto { Success = false, ExceptionMessage = TestHelpersCommonFields.ExceptionMessage });
            PostRegisteration();
            WebApiCommonAsserts.IsBadResultWithMessage(Result);
        }

        [TestMethod]
        public void RegisterApplicantController_Post_Should_Have_A_BadRequest_WithExceptionMessage_When_FailureSuccessModelReturn()
        {
            A.CallTo(() => _registerApplicant.CreateAccount(Model, MemberTypesEnum.Applicant)).Returns(new SuccessOrFailureDto { Success = false, ExceptionMessage = TestHelpersCommonFields.ExceptionMessage });
            PostRegisteration();
            WebApiCommonAsserts.BadResultHasTheCorrectErrorMessage(Result, TestHelpersCommonFields.ExceptionMessage);
        }

        [TestMethod]
        public void RegisterApplicantController_Post_HappyPath_Should_ReturnOKResult()
        {
            A.CallTo(() => _registerApplicant.CreateAccount(Model, MemberTypesEnum.Applicant)).Returns(new SuccessOrFailureDto { Success = true });
            PostRegisteration();
            WebApiCommonAsserts.IsOkResult(Result);
        }

        private void PostRegisteration()
        {
            Result = _registerApplicantController.Post(Model);
        }
    }
}


text:
require "spec_helper"

describe Mongoid::QueryCache::Middleware do

  let :middleware do
    Mongoid::QueryCache::Middleware.new(app)
  end

  context "when not touching mongoid on the app" do

    let(:app) do
      ->(env) { @enabled = Mongoid::QueryCache.enabled?; [200, env, "app"] }
    end

    it "returns success" do
      code, _ = middleware.call({})
      expect(code).to eq(200)
    end

    it "enableds the query cache" do
      middleware.call({})
      expect(@enabled).to be true
    end
  end

  context "when querying on the app" do

    let(:app) do
      ->(env) {
        Band.all.to_a
        [200, env, "app"]
      }
    end

    it "returns success" do
      code, _ = middleware.call({})
      expect(code).to eq(200)
    end

    it "cleans the query cache after reponds" do
      middleware.call({})
      expect(Mongoid::QueryCache.cache_table).to be_empty
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package org.hollowcraft.server.task;

/*
 * OpenCraft License
 *
 * Copyright (c) 2009 Graham Edgecombe, Søren Enevoldsen and Brett Russell.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *     * Redistributions of source code must retain the above copyright notice,
 *       this list of conditions and the following disclaimer.
 *
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *
 *     * Neither the name of the OpenCraft nor the names of its
 *       contributors may be used to endorse or promote products derived from
 *       this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/**
 * Represents a task that is executed on the TaskQueue.
 * @author Graham Edgecombe
 * @author Caleb Champlin
 */
public interface Task {

	/**
	 * Performs whatever action this task is for.
	 */
	public void execute();

}


text:
namespace TestApp
{
    internal enum DbProviders
    {
        None,
        MsSql,
        Oracle,
        PostgreSql
    }
}


text:
struct Material : public ISerializable
{
    Color<double>::type diffuse, ambient, specular, sss;
    bool doSSS;
    double specularHardness;
    //double emission;

    Material(Color<double>::type diff, Color<double>::type amb, Color<double>::type spec, double h)
        : diffuse(diff), ambient(amb), specular(spec), specularHardness(h), doSSS(false)
    {}

    Material()
    {
        ambient  = diffuse = NewPoint4D(1.,0.89,0.9, 1.0);
        specular = NewPoint4D(1.,1.,1.);
        specularHardness = 230.;
        sss = NewPoint4D(1.0,0.4,0.4,1.0);
        doSSS = false;
    }

    std::ostream& serialize(std::ostream &str) const
    {
        str << '[' << diffuse << ' ' << specular << ' ' << specularHardness << ' ';
        str << ambient;
        if (doSSS) str << " with-sss" << sss;
        str << ']';

        return str;
    }

    std::istream& deserialize(std::istream &str)
    {
        char z(0);

        str >> z;
        if (z != '[')
            throw MakeParserException("Expected '[' for material definition.");

        int i = 0;
        try
        {
            str >> diffuse; ++i;
            str >> specular; ++i;
            str >> specularHardness; ++i;
            str >> ambient; ++i;
        } catch (ParserException &ex)
        {
            throw MakeParserException(ex.GetError() + whichFailed(i));
        }

        std::string opt;
        str >> opt;
        if (opt == "with-sss")
        {
            try
            {
                str >> sss;
                doSSS = true;
            }
            catch (ParserException& ex)
            {
                throw MakeParserException(ex.GetError() + "no SSS color.");
            }

            str >> z;
            if (z != ']') throw MakeParserException("Expected ']' for material.");
        }
        else if (opt != "]")
            throw MakeParserException("Expected ']' or 'with-sss <color>]' for material. ");

        return str;
    }

    static std::string whichFailed( int i )
    {
        switch(i)
        {
        case 0:
            return " Diffuse color is invalid.";
        case 1:
            return " Specular color is invalid.";
        case 2:
            return " Specular hardness is invalid.";
        case 3:
            return " Ambient color is invalid.";
        default:
            return " Unknown";
        }
    }

};

#endif //__MATERIAL_HPP__


text:
require 'test_suite'
require 'test_suite/runner'

module TestSuite
  class CLI

    def self.start(args)
      args.each do |file|
        load File.expand_path(file)
      end
      TestSuite.run!
    end

  end
end


text:
using Free.FileFormats.VRML.Fields;
using Free.FileFormats.VRML.Interfaces;

namespace Free.FileFormats.VRML.Nodes
{
	/// <summary>
	/// This node defines material properties that can effect both the front and
	/// back side of a polygon individually.
	/// </summary>
	public class x3dTwoSidedMaterial : X3DNode, X3DMaterialNode
	{
		public double AmbientIntensity { get; set; }
		public double BackAmbientIntensity { get; set; }
		public SFColor BackDiffuseColor { get; set; }
		public SFColor BackEmissiveColor { get; set; }
		public double BackShininess { get; set; }
		public SFColor BackSpecularColor { get; set; }
		public double BackTransparency { get; set; }
		public SFColor DiffuseColor { get; set; }
		public SFColor EmissiveColor { get; set; }
		public double Shininess { get; set; }
		public bool SeparateBackColor { get; set; }
		public SFColor SpecularColor { get; set; }
		public double Transparency { get; set; }

		public x3dTwoSidedMaterial()
		{
			AmbientIntensity=0.2;
			BackAmbientIntensity=0.2;
			BackDiffuseColor=new SFColor(0.8, 0.8, 0.8);
			BackEmissiveColor=new SFColor(0, 0, 0);
			BackShininess=0.2;
			BackSpecularColor=new SFColor(0, 0, 0);
			BackTransparency=0;
			DiffuseColor=new SFColor(0.8, 0.8, 0.8);
			EmissiveColor=new SFColor(0, 0, 0);
			Shininess=0.2;
			SeparateBackColor=false;
			SpecularColor=new SFColor(0, 0, 0);
			Transparency=0;
		}

		internal override X3DPrototypeInstance GetProto() { return new x3dTwoSidedMaterialPROTO(); }

		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="ambientIntensity") AmbientIntensity=parser.ParseDoubleValue();
			else if(id=="backAmbientIntensity") BackAmbientIntensity=parser.ParseDoubleValue();
			else if(id=="backDiffuseColor") BackDiffuseColor=parser.ParseSFColorValue();
			else if(id=="backEmissiveColor") BackEmissiveColor=parser.ParseSFColorValue();
			else if(id=="backShininess") BackShininess=parser.ParseDoubleValue();
			else if(id=="backSpecularColor") BackSpecularColor=parser.ParseSFColorValue();
			else if(id=="backTransparency") BackTransparency=parser.ParseDoubleValue();
			else if(id=="diffuseColor") DiffuseColor=parser.ParseSFColorValue();
			else if(id=="emissiveColor") EmissiveColor=parser.ParseSFColorValue();
			else if(id=="shininess") Shininess=parser.ParseDoubleValue();
			else if(id=="separateBackColor") SeparateBackColor=parser.ParseBoolValue();
			else if(id=="specularColor") SpecularColor=parser.ParseSFColorValue();
			else if(id=="transparency") Transparency=parser.ParseDoubleValue();
			else return false;
			return true;
		}
	}
}


text:
import os
import re

from pandas import DataFrame

class WaferRun:

    def __init__(self, run_id, wafer_id, label, measurements):
        self.run_id = int(run_id)
        self.wafer_id = int(wafer_id)
        self.label = int(label)
        self.measurements = DataFrame(measurements)
        self.measurements.sort(axis=1, inplace=True)
        self.measurements.sort_index(inplace=True)

    @staticmethod
    def from_files(path, run_id, wafer_id):
        fn_base = os.path.join(path, '{0}_{1:02}'.format(run_id, wafer_id))

        try:
            df = DataFrame({11: DataFrame.from_csv(fn_base + '.11', header=None, sep='\t', index_col=None, parse_dates=False)[1],
                            12: DataFrame.from_csv(fn_base + '.12', header=None, sep='\t', index_col=None, parse_dates=False)[1],
                            15: DataFrame.from_csv(fn_base + '.15', header=None, sep='\t', index_col=None, parse_dates=False)[1],
                            6: DataFrame.from_csv(fn_base + '.6', header=None, sep='\t', index_col=None, parse_dates=False)[1],
                            7: DataFrame.from_csv(fn_base + '.7', header=None, sep='\t', index_col=None, parse_dates=False)[1],
                            8: DataFrame.from_csv(fn_base + '.8', header=None, sep='\t', index_col=None, parse_dates=False)[1]})
        except:
            return None

        m = re.search('/(normal|abnormal)', path)
        if m is None:
            return None

        label = 1 if m.group(1) == 'abnormal' else -1

        return WaferRun(run_id, wafer_id, label, df)

    def as_nparray(self):
        """Spits out data as a T x D numpy.array (T=# samples, D=# variables)

        Notes:
        Notice what we do here: we start with a pandas.DataFrame where each channel
        is a column (so you can think of it as a T x D matrix). We first rename the
        columns to channel numbers,then sort the columns, then sort the index, then
        transform to numpy.array.
        """
        return self.measurements.sort(axis=1).sort_index().reset_index().as_matrix().astype(float)


text:
package topoos.Images;

import java.io.IOException;
import java.net.URLEncoder;
import java.util.List;

import topoos.AccessTokenOAuth;
import topoos.APIAccess.APICaller;
import topoos.APIAccess.Operations.ImageDelete;
import topoos.APIAccess.Operations.ImageSearch;
import topoos.APIAccess.Operations.ImageUpdate;
import topoos.APIAccess.Operations.ImageUpload;
import topoos.APIAccess.Results.GenericResult;
import topoos.APIAccess.Results.ImageCollectionResult;
import topoos.APIAccess.Results.ImageResult;
import topoos.APIAccess.Results.ImageURIThumb;
import topoos.Exception.TopoosException;
import topoos.Objects.Image;

/**
 * The Class Translator.
 */
class Translator {

	/** The Constant SIZE_XXXSMALL. */
	public static final int SIZE_XXXSMALL = 0;

	/** The Constant SIZE_XXSMALL. */
	public static final int SIZE_XXSMALL = 1;

	/** The Constant SIZE_XSMALL. */
	public static final int SIZE_XSMALL = 2;

	/** The Constant SIZE_SMALL. */
	public static final int SIZE_SMALL = 3;

	/** The Constant SIZE_LARGE. */
	public static final int SIZE_LARGE = 4;

	/** The Constant SIZE_XLARGE. */
	public static final int SIZE_XLARGE = 5;

	/** The Constant SIZE_XXLARGE. */
	public static final int SIZE_XXLARGE = 6;

	/** The Constant SIZE_XXXLARGE. */
	public static final int SIZE_XXXLARGE = 7;

	/** The Constant MODE_MAINTAIN*/
	public static final int MODE_MAINTAIN =0;

	/** The Constant MODE_FIT*/
	public static final int MODE_FIT =1;

	/** The Constant PRIVACY_PUBLIC. */
	public static final int PRIVACY_PUBLIC = 0;
	/** The Constant PRIVACY_CLIENT. */
	public static final int PRIVACY_CLIENT = 1;
	/** The Constant PRIVACY_USER. */
	public static final int PRIVACY_USER = 2;

	/** The method_post. */
	private static String method_post = "POST";

	/** The method_get. */
	private static String method_get = "GET";

	/** The format. */
	private static String format = "json";

	/** The version. */
	private static Integer version = topoos.Constants.APIVERSION;

	/**
	 * Image upload.
	 *
	 * @param accessTokenPregenerated
	 *            the access token pregenerated
	 * @param file
	 *            the file
	 * @param filename
	 *            the filename
	 * @param fileformat
	 * @param keywords
	 * @param privacy the privacy
	 * @return the image
	 * @throws IOException
	 *             Signals that an I/O exception has occurred.
	 * @throws TopoosException
	 *             the topoos exception
	 */
	public static Image ImageUpload(AccessTokenOAuth accessTokenPregenerated, byte[] file,
			String filename, String fileformat, String [] keywords, Integer privacy) throws IOException, TopoosException {
		Image image = null;
		if (accessTokenPregenerated.isValid()) {
			String privacystr = "public";
			if (privacy!=null)
			switch (privacy) {

			case PRIVACY_PUBLIC:
				privacystr = "public";
				break;
			case PRIVACY_CLIENT:
				privacystr = "client";
				break;
			case PRIVACY_USER:
				privacystr = "user";
				break;
			default:
				break;
			}

			ImageUpload imageUpload = new ImageUpload("ImageUpload",
					method_post, format, version,
					accessTokenPregenerated.getAccessToken(), file, filename,fileformat,
					keywords,privacystr);
			ImageResult imageResult = new ImageResult();
			APICaller.ExecuteOperation(imageUpload, imageResult,
					APICaller.SERVICE_PIC);
			image = imageResult.getImage();
		} else {
			throw new TopoosException(TopoosException.NOT_VALID_TOKEN);
		}
		return image;
	}

	/**
	 * Image upload position.
	 *
	 * @param accessTokenPregenerated
	 *            the access token pregenerated
	 * @param file
	 *            the file
	 * @param filename
	 *            the filename
	 *
	 * @param file_format
	 *
	 * @param keywords
	 *
	 * @param privacy
	 *
	 * @param pos_id
	 *            the pos_id
	 *
	 * @return the image
	 * @throws IOException
	 *             Signals that an I/O exception has occurred.
	 * @throws TopoosException
	 *             the topoos exception
	 */
	public static Image ImageUploadPosition(AccessTokenOAuth accessTokenPregenerated,byte[] file, String filename,
			String file_format, String [] keywords, Integer privacy, Integer pos_id )
			throws IOException, TopoosException {
		Image image = null;
		if (accessTokenPregenerated.isValid()) {
			String privacystr = "public";
			if (privacy!=null)
			switch (privacy) {

			case PRIVACY_PUBLIC:
				privacystr = "public";
				break;
			case PRIVACY_CLIENT:
				privacystr = "client";
				break;
			case PRIVACY_USER:
				privacystr = "user";
				break;
			default:
				break;
			}
			ImageUpload imageUpload = new ImageUpload("ImageUploadPosition",
					method_post, format, version,
					accessTokenPregenerated.getAccessToken(), file, filename,
					file_format, keywords,privacystr,
					pos_id, ImageUpload.TYPE_POS);

			ImageResult imageResult = new ImageResult();
			APICaller.ExecuteOperation(imageUpload, imageResult,
					APICaller.SERVICE_PIC);
			image = imageResult.getImage();
		} else {
			throw new TopoosException(TopoosException.NOT_VALID_TOKEN);
		}
		return image;
	}

	/**
	 * Image upload poi.
	 *
	 * @param accessTokenPregenerated
	 *            the access token pregenerated
	 * @param file
	 *            the file
	 * @param filename
	 *            the filename
	 *
	 * @param file_format
	 *
	 * @param keywords
	 *
	 * @param privacy
	 *
	 * @param poi_id
	 *            the poi_id
	 *
	 * @return the image
	 * @throws IOException
	 *             Signals that an I/O exception has occurred.
	 * @throws TopoosException
	 *             the topoos exception
	 */
	public static Image ImageUploadPOI(AccessTokenOAuth accessTokenPregenerated,byte[] file, String filename,
			String file_format, String [] keywords, Integer privacy,Integer poi_id )
			throws IOException, TopoosException {
		Image image = null;
		if (accessTokenPregenerated.isValid()) {
			String privacystr = "public";
			if (privacy!=null)
			switch (privacy) {

			case PRIVACY_PUBLIC:
				privacystr = "public";
				break;
			case PRIVACY_CLIENT:
				privacystr = "client";
				break;
			case PRIVACY_USER:
				privacystr = "user";
				break;
			default:
				break;
			}
			ImageUpload imageUpload = new ImageUpload("ImageUploadPOI",
					method_post, format, version,
					accessTokenPregenerated.getAccessToken(), file, filename,
					file_format, keywords, privacystr, poi_id, ImageUpload.TYPE_POI);

			ImageResult imageResult = new ImageResult();
			APICaller.ExecuteOperation(imageUpload, imageResult,
					APICaller.SERVICE_PIC);
			image = imageResult.getImage();
		} else {
			throw new TopoosException(TopoosException.NOT_VALID_TOKEN);
		}
		return image;
	}

	/**
	 * Image upload new poi.
	 *
	 *@param accessTokenPregenerated
	 *            the access token pregenerated
	 * @param file
	 *            the file
	 * @param filename
	 *            the filename
	 * @param file_format
	 *
	 * @param keywords
	 *
	 * @param privacy
	 *
	 * @param lat
	 *            the lat
	 * @param lng
	 *            the lng
	 * @param name
	 *            the name
	 * @param description
	 *            the description
	 * @param elevation
	 *            the elevation
	 * @param accuracy
	 *            the accuracy
	 * @param vaccuracy
	 *            the vaccuracy
	 * @param address
	 *            the address
	 * @param cross_street
	 *            the cross_street
	 * @param city
	 *            the city
	 * @param country
	 *            the country
	 * @param postal_code
	 *            the postal_code
	 * @param phone
	 *            the phone
	 * @param twitter
	 *            the twitter
	 * @param categories
	 *            the categories

	 * @return the image
	 * @throws IOException
	 *             Signals that an I/O exception has occurred.
	 * @throws TopoosException
	 *             the topoos exception
	 */
	public static Image ImageUploadNewPOI(AccessTokenOAuth accessTokenPregenerated, byte[] file, String filename,
			String file_format, String [] keywords, Integer privacy,
			Double lat, Double lng, String name, String description,
			Integer elevation, Integer accuracy, Integer vaccuracy,
			String address, String cross_street, String city, String country,
			String postal_code, String phone, String twitter,
			Integer[] categories)
			throws IOException, TopoosException {
		Image image = null;
		if (accessTokenPregenerated.isValid()) {
			String privacystr = "public";
			if (privacy!=null)
			switch (privacy) {

			case PRIVACY_PUBLIC:
				privacystr = "public";
				break;
			case PRIVACY_CLIENT:
				privacystr = "client";
				break;
			case PRIVACY_USER:
				privacystr = "user";
				break;
			default:
				break;
			}

			ImageUpload imageUpload = new ImageUpload("ImageUploadNewPOI",
			method_post, format, version,
			accessTokenPregenerated.getAccessToken(), file, filename,
			file_format, keywords, privacystr,
			lat, lng, name, description, elevation, accuracy,
			vaccuracy, address, cross_street, city, country,
			postal_code, phone, twitter, categories);

			ImageResult imageResult = new ImageResult();
			APICaller.ExecuteOperation(imageUpload, imageResult,
					APICaller.SERVICE_PIC);
			image = imageResult.getImage();
		} else {
			throw new TopoosException(TopoosException.NOT_VALID_TOKEN);
		}
		return image;
	}

	/**
	 * Gets the image uri.
	 *
	 * @param filename_unique
	 *            the filename_unique
	 * @return the string
	 */
	public static String GetImageURI(String filename_unique) {
		String uri = APICaller.GetURLPICAPItopoos() + "/"
				+ URLEncoder.encode(filename_unique);
		return uri;
	}

	/**
	 * Delete image from PIC service permanently.
	 *
	 * @param accessTokenPregenerated
	 *            (required) access_token to user resources
	 * @param filename_unique Unique image ID
	 * @return Boolean
	 * @throws TopoosException
	 * @throws IOException
	 *  */
	public static Boolean Delete(AccessTokenOAuth accessTokenPregenerated,
			String fileName) throws IOException, TopoosException {
		boolean delete = false;
		if (accessTokenPregenerated.isValid()) {
			ImageDelete imDel = new ImageDelete ("Delete",method_get, format, version,
					accessTokenPregenerated.getAccessToken(), fileName);
			GenericResult genericResult = new GenericResult();
			APICaller.ExecuteOperation(imDel, genericResult, APICaller.SERVICE_PIC);
			delete = genericResult.getCode() == 200;
		} else {
			throw new TopoosException(TopoosException.NOT_VALID_TOKEN);
		}
		return delete;
	}

	/**
	 * Update privacy, and keywords.
	 *
	 * @param accessTokenPregenerated
	 *            (required) access_token to user resources
	 * @param filename_unique Unique image ID
	 * @param keywords for the image
	 * @param privacy for the image
	 * @return Boolean
	 * @throws TopoosException
	 * @throws IOException
	 *  */
	public static Boolean ImageUpdate(String filename_unique,
				AccessTokenOAuth accessTokenPregenerated, String[] keywords,
				Integer privacy) throws TopoosException, IOException {
		Boolean update = false;
		if (accessTokenPregenerated.isValid()) {
			String privacystr = "";
			if (privacy!=null)
				switch (privacy) {
				case PRIVACY_PUBLIC:
					privacystr = "public";
					break;
				case PRIVACY_CLIENT:
					privacystr = "client";
					break;
				case PRIVACY_USER:
					privacystr = "user";
					break;
				default:
					privacystr = "";
					break;
				}
			GenericResult genericResult = new GenericResult();
			ImageUpdate imUpd = new ImageUpdate ("ImageUpdate",method_get, format, version,
					accessTokenPregenerated.getAccessToken(),filename_unique,keywords,privacystr);
			APICaller.ExecuteOperation(imUpd, genericResult, APICaller.SERVICE_PIC);
			update = genericResult.getCode() == 200;
		} else {
			throw new TopoosException(TopoosException.NOT_VALID_TOKEN);
		}

		return update;
	}

	/**
	 * Build a string of keywords (String) list
	 * */

	/**
	 * Search images
	 *
	 * @param accessTokenPregenerated
	 * 			(required) access_token to user resources
	 * @param filename_unique unique identifier image
	 * @param keywords keywords id of image
	 * @param count max number of items that will be returned
	 * @param page result page number. First page is 0. Default 0
	 * @return List <Image> */
	public static List <Image> SearchImage (AccessTokenOAuth accessTokenPregenerated,String filename_unique, String [] keywords, Integer count, Integer page) throws TopoosException, IOException{
		List <Image> imagesFound= null;
		if (accessTokenPregenerated.isValid()) {
			ImageSearch imSearch = new ImageSearch ("ImageSearch", method_get, format, version, accessTokenPregenerated.getAccessToken(),filename_unique, keywords, count, page );
			ImageCollectionResult imColRes= new ImageCollectionResult ();
			APICaller.ExecuteOperation(imSearch, imColRes, APICaller.SERVICE_PIC);
			imagesFound = imColRes.getImageCollection().getImageList();
		}else {
			throw new TopoosException(TopoosException.NOT_VALID_TOKEN);
		}
		return imagesFound;
	}

	/**
	 * Gets the image uri with privacy
	 *
	 * @param filename_unique
	 *            the filename_unique
	 * @param privacy
	 *            the privacy
	 * @return the string
	 */
	public static String GetImageURI(String filename_unique,
			AccessTokenOAuth accessTokenPregenerated) throws IOException,
			TopoosException {
		String uri = null;
		if (accessTokenPregenerated.isValid()) {
			uri = APICaller.GetURLPICAPItopoos()
					+ "/"
					+ URLEncoder.encode(filename_unique)
					+ "?access_token="
					+ URLEncoder.encode(accessTokenPregenerated
							.getAccessToken());
		} else {
			throw new TopoosException(TopoosException.NOT_VALID_TOKEN);
		}
		return uri;
	}

	/**
	 * Gets the image uri thumb by size.
	 *
	 * @param accessTokenPregenerated for the privacy
	 * @param filename_unique
	 *            the filename_unique
	 * @param size
	 *            the size
	 *
	 * @return the URI
	 *
	 */
	public static String GetImageURIThumb(AccessTokenOAuth accessTokenPregenerated,String filename_unique, Integer size, Integer dpi, Integer mode) throws TopoosException {
		String strsize = "small";
		String strmode = "maintain";
		String token = null;
		if (accessTokenPregenerated != null){
			if (!accessTokenPregenerated.isValid()){
				throw new TopoosException(TopoosException.NOT_VALID_TOKEN);
			}else {
				token = accessTokenPregenerated.getAccessToken();
			}
		}
		if (size != null)
		switch (size) {
		case SIZE_LARGE:
			strsize = "large";
			break;
		case SIZE_SMALL:
			strsize = "small";
			break;
		case SIZE_XLARGE:
			strsize = "x-large";
			break;
		case SIZE_XSMALL:
			strsize = "x-small";
			break;
		case SIZE_XXLARGE:
			strsize = "xx-large";
			break;
		case SIZE_XXSMALL:
			strsize = "xx-small";
			break;
		case SIZE_XXXLARGE:
			strsize = "xxx-large";
			break;
		case SIZE_XXXSMALL:
			strsize = "xxx-small";
			break;
		default:
			break;
		}
		if (mode != null)
			switch (mode){
				case MODE_MAINTAIN:
					strmode = "maintain";
					break;
				case MODE_FIT:
					strmode = "fit";
					break;
				default:
					break;
			}

		ImageURIThumb imURIThumb = new ImageURIThumb (token,filename_unique, strsize, dpi, strmode);
		imURIThumb.setParameters();
		return imURIThumb.getUriThumb();
	}

	/**
	 * Gets the image uri thumb by width and high.
	 *
	 * @param accessTokenPregenerated for the privacy
	 * @param filename_unique
	 *            the filename_unique
	 * @param width the width
	 * @param high the high
	 * @return the URI
	 *
	 */
	public static String GetImageURIThumb(AccessTokenOAuth accessTokenPregenerated,String filename_unique, Integer width, Integer high, Integer dpi, Integer mode) throws TopoosException {
		String strmode = "maintain";
		String token = null;
		if (accessTokenPregenerated != null){
			if (!accessTokenPregenerated.isValid()){
				throw new TopoosException(TopoosException.NOT_VALID_TOKEN);
			}else {
				token = accessTokenPregenerated.getAccessToken();
			}
		}
		if (mode != null)
		switch (mode){
			case MODE_MAINTAIN:
				strmode = "maintain";
				break;
			case MODE_FIT:
				strmode = "fit";
				break;
			default:
				break;
		}
		ImageURIThumb imURIThumb = new ImageURIThumb (token,filename_unique, width,high, dpi, strmode);
		imURIThumb.setParameters();
		return imURIThumb.getUriThumb();
	}

}


text:
//
//  HeadView.h
//  testObject
//
//  Created by Windy on 16/10/13.
//  Copyright © 2016年 Windy. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface HeadView : UIView

/** bar悬停的位置 */
@property (nonatomic, assign) CGFloat barStop_H;

@end


text:
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Action } from '@ngrx/store';

import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/startWith';
import 'rxjs/add/operator/toPromise';

import * as fromLayout from '../actions/layout';
import { Actions, Effect } from '@ngrx/effects';
import { of } from 'rxjs/observable/of';

@Injectable()
export class LayoutEffects {

  @Effect()
  loadStateFromDb$: Observable<Action> = this.actions$
    .ofType(fromLayout.LOAD_FROM_DB)
    .startWith(new fromLayout.LoadFromDatabaseAction())
    .switchMap(() =>
      of(new fromLayout.LoadFromDatabaseSuccessAction({
        sideNavOpened: localStorage.getItem('sideNavOpened') === 'true' || false
      }))
    );

  constructor(
    private actions$: Actions
  ) { }
}


text:
namespace Microsoft.Azure.Management.Internal.Network.Version2017_10_01.Models
{
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Contains bgp community information offered in Service Community
    /// resources.
    /// </summary>
    public partial class BGPCommunity
    {
        /// <summary>
        /// Initializes a new instance of the BGPCommunity class.
        /// </summary>
        public BGPCommunity()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the BGPCommunity class.
        /// </summary>
        /// <param name="serviceSupportedRegion">The region which the service
        /// support. e.g. For O365, region is Global.</param>
        /// <param name="communityName">The name of the bgp community. e.g.
        /// Skype.</param>
        /// <param name="communityValue">The value of the bgp community. For
        /// more information:
        /// https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing.</param>
        /// <param name="communityPrefixes">The prefixes that the bgp community
        /// contains.</param>
        /// <param name="isAuthorizedToUse">Customer is authorized to use bgp
        /// community or not.</param>
        /// <param name="serviceGroup">The service group of the bgp community
        /// contains.</param>
        public BGPCommunity(string serviceSupportedRegion = default(string), string communityName = default(string), string communityValue = default(string), IList<string> communityPrefixes = default(IList<string>), bool? isAuthorizedToUse = default(bool?), string serviceGroup = default(string))
        {
            ServiceSupportedRegion = serviceSupportedRegion;
            CommunityName = communityName;
            CommunityValue = communityValue;
            CommunityPrefixes = communityPrefixes;
            IsAuthorizedToUse = isAuthorizedToUse;
            ServiceGroup = serviceGroup;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets the region which the service support. e.g. For O365,
        /// region is Global.
        /// </summary>
        [JsonProperty(PropertyName = "serviceSupportedRegion")]
        public string ServiceSupportedRegion { get; set; }

        /// <summary>
        /// Gets or sets the name of the bgp community. e.g. Skype.
        /// </summary>
        [JsonProperty(PropertyName = "communityName")]
        public string CommunityName { get; set; }

        /// <summary>
        /// Gets or sets the value of the bgp community. For more information:
        /// https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing.
        /// </summary>
        [JsonProperty(PropertyName = "communityValue")]
        public string CommunityValue { get; set; }

        /// <summary>
        /// Gets or sets the prefixes that the bgp community contains.
        /// </summary>
        [JsonProperty(PropertyName = "communityPrefixes")]
        public IList<string> CommunityPrefixes { get; set; }

        /// <summary>
        /// Gets or sets customer is authorized to use bgp community or not.
        /// </summary>
        [JsonProperty(PropertyName = "isAuthorizedToUse")]
        public bool? IsAuthorizedToUse { get; set; }

        /// <summary>
        /// Gets or sets the service group of the bgp community contains.
        /// </summary>
        [JsonProperty(PropertyName = "serviceGroup")]
        public string ServiceGroup { get; set; }

    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="source_link" translatable="false">http://cache-default02f.cdn.yandex.net/download.cdn.yandex.net/mobilization-2016/artists.json</string>
    <string name="app_name">Яндекс мобилизация 2016</string>
    <string name="artists">Исполнители</string>
    <string name="biography">Биография</string>
    <string name="net_error_message">Соединение с сервером неудачно. Попробуйте обновить позже.  </string>
    <string name="parse_error_message">Что-то странное приехало с сервера. Попробуйте обновить еще раз. </string>
    <string name="we_know">Мы уже знаем об этом :)</string>
    <string name="we_never_know">Мы никогда об этом не узнаем :((</string>
    <string name="try_pull_down">Ничего здесь еще нет! Потяните вниз что-бы обновить данные :)</string>

</resources>


text:
#ifndef __OPENSPACE_MODULE_BASE___RENDERABLETRAILORBIT___H__
#define __OPENSPACE_MODULE_BASE___RENDERABLETRAILORBIT___H__

#include <modules/base/rendering/renderabletrail.h>

#include <openspace/properties/scalar/doubleproperty.h>
#include <openspace/properties/scalar/intproperty.h>

namespace openspace {

namespace documentation { struct Documentation; }

/**
 * This concrete implementation of a RenderableTrail renders an updated trail behind an
 * object that is likely to have an orbit-like path. However, this is not required and
 * this class can render any kind of trail as long as it's individual positions can be
 * dynamically queried at runtime. This class always renders a number of points equal to
 * the _resolution number. If the time progresses, old points are discarded and new points
 * are rendered. Each of these fixed points are fixed time steps apart, where as the most
 * current point is floating and updated every frame. The _period determines the length of
 * the trail (the distance between the newest and oldest point being _period days).
 */
class RenderableTrailOrbit : public RenderableTrail {
public:
    explicit RenderableTrailOrbit(const ghoul::Dictionary& dictionary);

    void initializeGL() override;
    void deinitializeGL() override;

    void update(const UpdateData& data) override;

    static documentation::Documentation Documentation();

private:
    /**
     * Performs a full sweep of the orbit and fills the entire vertex buffer object.
     * \param time The current time up to which the full sweep should be performed
     */
    void fullSweep(double time);

    /// This structure is returned from the #updateTrails method and gives information
    /// about which parts of the vertex array to update
    struct UpdateReport {
        static constexpr int All = 0; ///< The entire array was touched in the update

        /// If \c true the floating point needs to be updated
        bool floatingPointNeedsUpdate;

        /// If \c true at least one of their permanent point were touched
        bool permanentPointsNeedUpdate;

        /// Returns the number of fixed points that were touched in the update method
        /// If this value is negative, the newest values were replaced, if positive the
        /// oldest
        int nUpdated;
    };
    /**
     * Updates the trail based on the new incoming UpdateData information. This function
     * might update an arbitrary number of values in the vertex buffer and returns an
     * UpdateReport that will tell the #update method how many values were modified.
     * \param data The UpdateData struct that comes from the #update method
     * \return The UpdateReport containing information which array parts were touched
     */
    UpdateReport updateTrails(const UpdateData& data);

    /// The orbital period of the RenderableTrail in days
    properties::DoubleProperty _period;
    /// The number of points that should be sampled between _period and now
    properties::IntProperty _resolution;

    /// A dirty flag that determines whether a full sweep (recomputing of all values)
    /// is necessary
    bool _needsFullSweep = true;
    /// A dirty flag to determine whether the index buffer needs to be regenerated and
    /// then reuploaded
    bool _indexBufferDirty = true;

    /// The time stamp of the oldest point in the array
    double _firstPointTime = 0.0;
    /// The time stamp of the newest fixed point in the array
    double _lastPointTime = 0.0;
    /// The time stamp of when the last valid trail was generated.
    double _previousTime = 0.0;
};

} // namespace openspace

#endif // __OPENSPACE_MODULE_BASE___RENDERABLETRAILORBIT___H__


text:
<?php

$installer = $this;

$installer->startSetup();

$installer->run("

SET NAMES utf8;

SET SQL_MODE='';

SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO';

/*Table structure for table `cron_schedule` */

-- DROP TABLE IF EXISTS {$this->getTable('cron_schedule')};

CREATE TABLE {$this->getTable('cron_schedule')} (
  `schedule_id` int(10) unsigned NOT NULL auto_increment,
  `task_name` int(10) unsigned NOT NULL default '0',
  `schedule_status` tinyint(4) NOT NULL default '0',
  `schedule_type` tinyint(4) NOT NULL default '0',
  `schedule_cmd` text NOT NULL,
  `schedule_comments` text NOT NULL,
  `created_at` datetime NOT NULL default '0000-00-00 00:00:00',
  `scheduled_at` datetime NOT NULL default '0000-00-00 00:00:00',
  `executed_at` datetime NOT NULL default '0000-00-00 00:00:00',
  `finished_at` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`schedule_id`),
  KEY `task_name` (`task_name`),
  KEY `scheduled_at` (`scheduled_at`,`schedule_status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `cron_schedule` */

SET SQL_MODE=@OLD_SQL_MODE;

    ");

$installer->endSetup();


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=3,width=device-width"/>
  <title>分离轴定理检测碰撞</title>

<canvas id="mineCanvas"></canvas>

  参考文章:2D空间碰撞检测


text:
class MetricFu::RcovHotspot < MetricFu::Hotspot
  COLUMNS = %w{percentage_uncovered}

  def columns
    COLUMNS
  end

  def name
    :rcov
  end

  def map_strategy
    :percentage_uncovered
  end

  def reduce_strategy
    :average
  end

  def score_strategy
    :identity
  end

  def generate_records(data, table)
    return if data == nil
    data.each do |file_name, info|
      next if (file_name == :global_percent_run) || (info[:methods].nil?)
      info[:methods].each do |method_name, percentage_uncovered|
        location = MetricFu::Location.for(method_name)
        table << {
          "metric" => :rcov,
          "file_path" => file_name,
          "class_name" => location.class_name,
          "method_name" => location.method_name,
          "percentage_uncovered" => percentage_uncovered
        }
      end
    end
  end

  def present_group(group)
    occurences = group.size
    average_code_uncoverage = get_mean(group.column("percentage_uncovered"))
    "#{'average ' if occurences > 1}uncovered code is %.1f%" % average_code_uncoverage
  end
end


text:
expressjs-structure
===================

Directory structure used mainly for my personal Express.js projects.

Disclaimer
----------

This structure is under development.

What does this structure offer?
-------------------------------

This directory includes:

* Replicable environments via [Vagrant](http://vagrantup.com) and [Ansible](http://www.ansible.com).

* Task automation via [Grunt](http://gruntjs.com), including:

    - Automatic linting of server files, thanks to [`jshint`](https://github.com/jshint/jshint/) and [`grunt-contrib-jshint`](https://github.com/gruntjs/grunt-contrib-jshint)

    - Live reload of the server, using [`grunt-express-server`](https://github.com/ericclemmons/grunt-express-server).

* Separation of concerns by means of separate configuration files.

Requirements
------------

You have two ways: local development and virtualised development environment. In order to use the former, you need:

* [Node.js](http://nodejs.org)

The requirements for the virtualised development, you will need:

* [Vagrant](http://vagrantup.com).

* [Virtualbox](http://www.virtualbox.org)

* [Ansible](http://www.ansible.com).

How to use it
-------------

1. Download the .zip with the structure:

    ```shell
    $ wget https://github.com/carlosapd/expressjs-structure/archive/master.zip
    ```

2. Unzip it:

    ```shell
    $ unzip master.zip
    ```

3. Rename the directory and the `name` attribute in `package.json`:

    ```shell
    # In the shell
    $ mv master project-name
    ```

    ```json
    // In package.json
    {
        "name": "project-name",
        ...
    }
    ```

How to run the development server
---------------------------------

For local development:

1. `cd` to the directory with the project.

2. Install the packages:

    ```shell
    $ npm install
    ```

3. Run `grunt`:

    ```shell
    $ grunt serve
    ```

For virtualised development:

1. `cd` to the directory with the project.

2. Run `vagrant` (can take some time, as it will build node.js from source):

    ```shell
    $ vagrant up
    ```

3. Go to the virtualised machine:

    ```shell
    $ vagrant ssh
    ```

4. `cd` to the Vagrant shared directory:

    ```shell
    (vagrant)$ cd /vagrant
    ```

5. Install the packages:

    ```shell
    $ npm install
    ```

6. Run `grunt`:

    ```shell
    $ grunt serve
    ```

Things to be added later
------------------------

* Client-side linting.

* Support for testing (probably with Jasmine).

* Production-side client processing (minification, concatenation and other tasks).

* Ease to add any database solution.


text:
// Provides class sap.ui.core.support.plugins.Performance
sap.ui.define(['jquery.sap.global', 'sap/ui/core/support/Plugin',
		'sap/ui/core/support/controls/InteractionSlider',
		'sap/ui/core/support/controls/InteractionTree',
		'sap/ui/core/support/controls/TimelineOverview',
		'sap/ui/Device',
		'sap/m/MessageToast',
		'sap/ui/thirdparty/jszip',
		'sap/ui/core/util/File'
	],
	function(jQuery, Plugin, InteractionSlider, InteractionTree, TimelineOverview, Device, MessageToast, JSZip, File) {
		"use strict";

		/**
		 * Creates an instance of sap.ui.core.support.plugins.Interaction.
		 * @class This class represents the plugin for the support tool functionality of UI5. This class is internal and all its functions must not be used by an application.
		 *
		 * With this plugIn the performance measurements are displayed
		 *
		 * @abstract
		 * @extends sap.ui.core.support.Plugin
		 * @version 1.42.8
		 * @constructor
		 * @private
		 * @alias sap.ui.core.support.plugins.Interaction
		 */
		var Interaction = Plugin.extend("sap.ui.core.support.plugins.Interaction", {
			constructor : function(oSupportStub) {
				Plugin.apply(this, ["sapUiSupportInteraction", "Interaction", oSupportStub]);

				this._oStub = oSupportStub;

				if (this.isToolPlugin()) {

					this._aEventIds = [this.getId() + "SetMeasurements",
						this.getId() + "SetActive",
						this.getId() + "Export",
						this.getId() + "Import",
						this.getId() + "SetQueryString"
					];
					var pad0 = function(i, w) {
						return ("000" + String(i)).slice(-w);
					};
					this._fnFormatTime = function(fNow) {
						var oNow = new Date(fNow),
							iMicroSeconds = Math.floor((fNow - Math.floor(fNow)) * 1000);
						return pad0(oNow.getHours(),2) + ":" + pad0(oNow.getMinutes(),2) + ":" + pad0(oNow.getSeconds(),2) + "." + pad0(oNow.getMilliseconds(),3) + pad0(iMicroSeconds,3);
					};

					this._oInteractionSlider = new InteractionSlider();
					this._oInteractionTree = new InteractionTree({});
					this._oTimelineOverview = new TimelineOverview();

				} else {

					this._aEventIds = [this.getId() + "Refresh",
						this.getId() + "Clear",
						this.getId() + "Start",
						this.getId() + "Stop",
						this.getId() + "Activate",
						this.getId() + "Export",
						this.getId() + "Import",
						this.getId() + "SetQueryString"
					];

				}

			}
		});

		Interaction.prototype.init = function(oSupportStub){
			Plugin.prototype.init.apply(this, arguments);

			if (this.isToolPlugin()) {
				initInTools.call(this, oSupportStub);
			} else {
				initInApps.call(this, oSupportStub);
			}
		};

		Interaction.prototype.exit = function(oSupportStub){
			Plugin.prototype.exit.apply(this, arguments);
		};

		function initInTools(oSupportStub) {

			var rm = sap.ui.getCore().createRenderManager();
			rm.write("
");
			rm.write("<button id=\"" + this.getId() + "-record\" class=\"sapUiSupportIntToggleRecordingBtn\"></button>");
			rm.write("<input type='checkbox' id=\"" + this.getId() + "-odata\" > Enable OData Statistics");
			rm.write("
");
			rm.write("<input id=\"" + this.getId() + "-fileImport\" tabindex='-1' size='1' accept='application/zip' type='file'/>");
			rm.write("
");
			rm.write("<button id=\"" + this.getId() + "-import\" class=\"sapUiSupportBtn sapUiSupportIntImportExportBtn sapUiSupportIntImportBtn \">Import</button>");
			rm.write("<button id=\"" + this.getId() + "-export\" class=\"sapUiSupportBtn sapUiSupportIntImportExportBtn sapUiSupportIntExportBtn sapUiSupportIntHidden\">Export</button>");
			rm.write("");
			rm.write("

");
			rm.write("
");

			rm.write('
');
			rm.write('

');
			rm.write('
');
			rm.write('
');

			rm.write('
');
			rm.write('
');

			rm.write('
');

			rm.flush(this.$().get(0));
			rm.destroy();

			// render timeline
			rm = sap.ui.getCore().createRenderManager();
			this._oTimelineOverview.render(rm);
			rm.flush(this.$().find('.sapUiPerformanceStatsDiv .sapUiPerformanceTimeline').get(0));
			rm.destroy();

			// render interaction slider
			rm = sap.ui.getCore().createRenderManager();
			this._oInteractionSlider.render(rm);
			rm.flush(this.$().find('.sapUiPerformanceStatsDiv .sapUiPerformanceTop').get(0));
			rm.destroy();
			this._oInteractionSlider._registerEventListeners();
			var that = this;
			jQuery(".sapUiPerformanceTop").on("InteractionSliderChange", {
			}, function( event, arg1, arg2 ) {
				that._oInteractionTree.setRange(arg1, arg2);
			});

			this.$("refresh").click(jQuery.proxy(function(oEvent) {
				this._oStub.sendEvent(this.getId() + "Refresh");
			}, this));
			this.$("clear").click(jQuery.proxy(function(oEvent) {
				this._oStub.sendEvent(this.getId() + "Clear");
			}, this));

			this.$("export").click(jQuery.proxy(function(oEvent) {
				//this._oStub.sendEvent(this.getId() + "Export");
				this.onsapUiSupportInteractionExport();
			}, this));
			this.$("fileImport").change(jQuery.proxy(function(oEvent) {
				this.onsapUiSupportInteractionImport();
				//this._oStub.sendEvent(this.getId() + "Import");
			}, this));
			this.$("active").click(jQuery.proxy(function(oEvent) {
				var bActive = false;
				if (this.$("active").prop("checked")) {
					bActive = true;
				}
				this._oStub.sendEvent(this.getId() + "Activate", {"active": bActive});
			}, this));
			this.$("odata").attr('checked',this._bODATA_Stats_On).click(jQuery.proxy(function(oEvent) {
				jQuery.sap.statistics(!jQuery.sap.statistics());
			}, this));

			this.$('record').attr('data-state', (!this._bFesrActive) ? 'Start recording' : 'Stop recording');

			this.$('record').click(jQuery.proxy(function(oEvent) {
				if (this.$('record').attr('data-state') === 'Stop recording') {
					this._oStub.sendEvent(this.getId() + "Refresh");
					this._oStub.sendEvent(this.getId() + "Activate", {"active": false});
					this.$('record').attr('data-state', 'Start recording');
					jQuery(".sapUiPerformanceStatsDiv.sapUiSupportIntHidden").removeClass("sapUiSupportIntHidden");
					jQuery(".sapUiSupportIntExportBtn.sapUiSupportIntHidden").removeClass("sapUiSupportIntHidden");
				} else if (this.$('record').attr('data-state') === 'Start recording') {
					jQuery(".sapUiPerformanceStatsDiv").addClass("sapUiSupportIntHidden");
					jQuery(".sapUiSupportIntExportBtn").addClass("sapUiSupportIntHidden");
					this._oStub.sendEvent(this.getId() + "Clear");
					this._oStub.sendEvent(this.getId() + "Activate", {"active": true});
					this.$('record').attr('data-state', 'Stop recording');
				}
			}, this));

		}

		function initInApps(oSupportStub) {
			var _bFesrActive = /sap-ui-xx-fesr=(true|x|X)/.test(window.location.search);
			var _bODATA_Stats_On = jQuery.sap.statistics() ||
				/sap-statistics=(true|x|X)/.test(window.location.search);

			this._oStub.sendEvent(this.getId() + "SetQueryString", {"queryString": { bFesrActive: _bFesrActive,
				bODATA_Stats_On: _bODATA_Stats_On}});
			getPerformanceData.call(this);
		}

		function getPerformanceData(oSupportStub, jsonData) {
			var bActive = jQuery.sap.interaction.getActive() || this._bFesrActive;
			var aMeasurements = [];

			if (bActive || jsonData) {
				aMeasurements = jsonData || jQuery.sap.measure.getAllInteractionMeasurements(/*bFinalize=*/true);

				var fetchStart = window.performance.timing.fetchStart;

				for (var i = 0; i < aMeasurements.length; i++) {
					var measurement = aMeasurements[i];

					for (var j = 0; j < measurement.requests.length; j++) {

						var request = measurement.requests[j];

						measurement.requests[j] = {
							connectEnd: request.connectEnd,
							connectStart: request.connectStart,
							domainLookupEnd: request.domainLookupEnd,
							domainLookupStart: request.domainLookupStart,
							duration: request.duration,
							entryType: request.entryType,
							fetchStart: request.fetchStart,
							initiatorType: request.initiatorType,
							name: request.name,
							redirectEnd: request.redirectEnd,
							redirectStart: request.redirectStart,
							requestStart: request.requestStart,
							responseEnd: request.responseEnd,
							responseStart: request.responseStart,
							secureConnectionStart: request.secureConnectionStart,
							startTime: request.startTime,
							workerStart: request.workerStart,
							fetchStartOffset: fetchStart
						};

					}
				}

			}

			//this._oStub.$('record').attr('data-state', (bActive) ? 'Stop recording' : 'Start recording');
			this._oStub.sendEvent(this.getId() + "SetMeasurements", { "measurements": aMeasurements });
			this._oStub.sendEvent(this.getId() + "SetActive", {"active": bActive});
		}

		/**
		 * Handler for sapUiSupportInteractionSetQueryString event
		 *
		 * @param {sap.ui.base.Event} oEvent the event
		 * @private
		 */
		Interaction.prototype.onsapUiSupportInteractionSetQueryString = function(oEvent) {

			var oParam = oEvent.getParameter("queryString");
			this._bFesrActive = oParam.bFesrActive;
			this._bODATA_Stats_On = oParam.bODATA_Stats_On;
			this.$("odata").attr('checked',this._bODATA_Stats_On);
			this.$('record').attr('data-state', (!this._bFesrActive) ? 'Start recording' : 'Stop recording');
		};

		/**
		 * Handler for sapUiSupportInteractionSetMeasurements event
		 *
		 * @param {sap.ui.base.Event} oEvent the event
		 * @private
		 */
		Interaction.prototype.onsapUiSupportInteractionSetMeasurements = function(oEvent) {

			this._setMeasurementsData(oEvent.getParameter("measurements"));
		};

		/**
		 * Handler for sapUiSupportInteractionSetActive event
		 *
		 * @param {sap.ui.base.Event} oEvent the event
		 * @private
		 */
		Interaction.prototype.onsapUiSupportInteractionSetActive = function(oEvent) {

			var bActive = oEvent.getParameter("active");
			var oCheckBox = this.$("active");

			if (bActive) {
				oCheckBox.attr("checked", "checked");
			} else {
				oCheckBox.removeAttr("checked");
			}

		};

		/**
		 * Handler for sapUiSupportInteractionRefresh event
		 *
		 * @param {sap.ui.base.Event} oEvent the event
		 * @private
		 */
		Interaction.prototype.onsapUiSupportInteractionRefresh = function(oEvent) {

			getPerformanceData.call(this);

		};

		/**
		 * Handler for sapUiSupportInteractionClear event
		 *
		 * @param {sap.ui.base.Event} oEvent the event
		 * @private
		 */
		Interaction.prototype.onsapUiSupportInteractionClear = function(oEvent) {

			jQuery.sap.measure.clearInteractionMeasurements();
			this._oStub.sendEvent(this.getId() + "SetMeasurements", {"measurements":[]});

		};

		/**
		 * Handler for sapUiSupportInteractionStart event
		 *
		 * @param {sap.ui.base.Event} oEvent the event
		 * @private
		 */
		Interaction.prototype.onsapUiSupportInteractionStart = function(oEvent) {

			jQuery.sap.measure.start(this.getId() + "-perf","Measurement by support tool");

		};

		/**
		 * Handler for sapUiSupportInteractionEnd event
		 *
		 * @param {sap.ui.base.Event} oEvent the event
		 * @private
		 */
		Interaction.prototype.onsapUiSupportInteractionEnd = function(oEvent) {

			//jQuery.sap.measure.end(this.getId() + "-perf");
			jQuery.sap.measure.endInteraction(/* bForce= */true);
		};

		/**
		 * Handler for sapUiSupportInteractionActivate event
		 *
		 * @param {sap.ui.base.Event} oEvent the event
		 * @private
		 */
		Interaction.prototype.onsapUiSupportInteractionActivate = function(oEvent) {

			var bActive = oEvent.getParameter("active");

			if (jQuery.sap.interaction.getActive() != bActive) {
				jQuery.sap.interaction.setActive(bActive);
			}

		};

		/**
		 * Handler for sapUiSupportInteractionExport event
		 *
		 * @param {sap.ui.base.Event} oEvent the event
		 * @private
		 */
		Interaction.prototype.onsapUiSupportInteractionExport = function(oEvent) {

			var aMeasurements = this.measurements || [];
			if (aMeasurements.length > 0) {
				if (Device.browser.msie && Device.browser.version < 10) {
					MessageToast.show('Download action is not supported in Internet Explorer 9', {
						autoClose: true,
						duration: 3000
					});
					return;
				}

				var oZipFile = new JSZip();

				oZipFile.file("InteractionsSteps.json", JSON.stringify(aMeasurements).replace(/,"isExpanded":true/g, ''));
				var oContent = oZipFile.generate({type:"blob"});

				this._openGeneratedFile(oContent);
			}

		};

		/**
		 * Handler for sapUiSupportInteractionImport event
		 *
		 * @param {sap.ui.base.Event} oEvent the event
		 * @private
		 */
		Interaction.prototype.onsapUiSupportInteractionImport = function(oEvent) {
			var aFiles = this.$().find('#' + this.getId() + "-fileImport").get(0).files;

			if (aFiles.length === 0) {
				MessageToast.show('Select a file for import first!', {
					autoClose: true,
					duration: 3000
				});
				return;
			}
			if (!window.FileReader) {
				MessageToast.show('Use a modern browser which supports FileReader!', {
					autoClose: true,
					duration: 3000
				});
				return;
			}

			var reader = new window.FileReader(),
				f = aFiles[0],
				that = this;

			// Closure to capture the file information.
			reader.onload = (function(theFile) {
				return function(e) {
					var oZipFile = new JSZip(e.target.result);
					var jsonData = oZipFile.files["InteractionsSteps.json"] && oZipFile.files["InteractionsSteps.json"].asText();
					if (jsonData) {
						//that._oStub.sendEvent(that.getId() + "SetMeasurements", { "measurements": JSON.parse(jsonData) });
						that._setMeasurementsData(JSON.parse(jsonData.replace(/,"isExpanded":true/g, '')));
					} else {
						MessageToast.show('Imported data does not contain interaction measures', {
							autoClose: true,
							duration: 3000
						});
					}
				};
			})(f);

			reader.readAsArrayBuffer(f);

		};

		Interaction.prototype._openGeneratedFile = function(oContent) {
			File.save(oContent, "InteractionSteps", "zip", "application/zip");
		};

		Interaction.prototype._setMeasurementsData = function(aMeasurements) {
			var requestsCount = 0,
				margin = 100,
				fnFixRequestSequence = function(aData) {
					var fnFindRequestPosition = function(aRequests, requestToInsert) {
						var pos = 0;
						if (aRequests.length === 0) {
							return pos;
						}
						for (var i = aRequests.length - 1; i >= 0; i--) {
							if (aRequests[i].startTime < requestToInsert.startTime) {
								pos = i + 1;
								break;
							}
						}
						return pos;
					},
					fnFindODataTrace = function(aODataTraces, startTime) {
						return aODataTraces.filter(function(ODataTrace) {
							return ODataTrace.timing.startTime === startTime;
						});
					},
					fnFindMeasurePosition = function(aMeasures, requestToMove) {
						var pos = 0;
						if (aMeasures.length === 0) {
							return pos;
						}
						for (var i = aMeasures.length - 1; i >= 0; i--) {
							if (aMeasures[i].start < (requestToMove.fetchStartOffset + requestToMove.startTime)) {
								pos = i ;
								break;
							}
						}
						return pos;
					},
					insertToPos = 0;

					aData.forEach(function(measurement, measurementIndex, measurements) {
						var requests = measurement.requests;

						for (var i = requests.length - 1; i >= 0; i--) {
							var request = requests[i];
							// move requests which are started before the interaction, to the right interaction
							if (measurementIndex > 0 && measurement.start - margin > (request.fetchStartOffset + request.startTime)) {
								var insertInMeasurement = fnFindMeasurePosition(measurements, request);
								var prevMeasureRequests = measurements[insertInMeasurement].requests;
								// copy the request to the right measurement
								insertToPos = fnFindRequestPosition(prevMeasureRequests, request);
								prevMeasureRequests.splice(insertToPos, 0, request);
								// remove the request from the current measurement
								requests.splice(i, 1);
								//move OData statistics if exists
								var aODataTrace = fnFindODataTrace(measurement.sapStatistics, request.startTime);
								if (aODataTrace.length > 0) {
									measurements[insertInMeasurement].sapStatistics = measurements[insertInMeasurement].sapStatistics.concat(aODataTrace);
								}
							}
						}

					});
				};

			fnFixRequestSequence(aMeasurements);

			this.measurements = aMeasurements;
			for (var i = 0; i < aMeasurements.length; i++) {
				requestsCount += aMeasurements[i].requests.length;
			}

			if (aMeasurements.length > 0) {
				jQuery(".sapUiPerformanceStatsDiv.sapUiSupportIntHidden").removeClass("sapUiSupportIntHidden");
				jQuery(".sapUiSupportIntExportBtn.sapUiSupportIntHidden").removeClass("sapUiSupportIntHidden");
				this.$('info').text("Total " + requestsCount + " Requests in " + aMeasurements.length + " Interactions");
			} else {
				jQuery(".sapUiPerformanceStatsDiv").addClass("sapUiSupportIntHidden");
				jQuery(".sapUiSupportIntExportBtn").addClass("sapUiSupportIntHidden");
				this.$('info').text("");
			}

			var oTimelineDiv = this.$().find('.sapUiPerformanceStatsDiv .sapUiPerformanceTimeline').get(0);
			var rm = sap.ui.getCore().createRenderManager();
			this._oTimelineOverview.setInteractions(aMeasurements);
			this._oTimelineOverview.render(rm);
			rm.flush(oTimelineDiv);
			rm.destroy();

			this._oInteractionSlider._initSlider();
			this._oInteractionSlider.setDuration(aMeasurements);
			//
			var oStatsDiv = this.$().find('.sapUiPerformanceStatsDiv .sapUiPerformanceBottom').get(0);
			this._oInteractionTree.setInteractions(aMeasurements);
			this._oInteractionTree.renderAt(oStatsDiv);
		};

		return Interaction;

	});


text:
using System.Text.RegularExpressions;

namespace Scheme.Storage
{
    internal sealed class Symbol : Atom
    {
        private readonly string value;

        public Symbol(string value)
        {
            if (!Symbol.IsValid(value))
                throw new System.ArgumentException($"Invalid symbol: {value}");

            this.value = value;
        }

        public static bool IsValid(string input)
        {
            if (input == ".")
                return false;

            var letters = "A-Z a-z";
            var digits = "0-9";
            var extendedCharacters = @"!$%&*+\-.\/:<=>?@^_~";
            var regex = new Regex($"^[{letters}{digits}{extendedCharacters}]+$");
            return regex.IsMatch(input);
        }

        public override Object Evaluate(Environment environment)
            => environment.LookUp(this).Object;
            // TODO: ensure eqv?-ness

        public override string ToString()
            => value;

        public override bool Equals(object other)
            => other is Symbol && ((Symbol)other).value == this.value;

        public override int GetHashCode()
            => value.GetHashCode();
    }
}


text:
SYNONYM

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

#### Published in
Nouv. Fl. Environs Paris 35 (1821)

#### Original name
Thelephora calcea Pers., 1801

### Remarks
null


text:
<ScrollView 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"
    tools:context="com.google.example.gms.nativeexample.MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <FrameLayout
            android:id="@+id/fl_adplaceholder"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp" />

        <CheckBox
            android:id="@+id/cb_appinstall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:checked="true"
            android:text="Request App Install Ads" />

        <CheckBox
            android:id="@+id/cb_content"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checked="true"
            android:text="Request Content Ads" />

        <Button
            android:id="@+id/btn_refresh"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginBottom="16dp"
            android:layout_marginTop="16dp"
            android:text="Refresh Ad" />

    </LinearLayout>
</ScrollView>


text:
ConsoleBaseType* ConsoleBaseType::smListHead = NULL;
S32 ConsoleBaseType::smConsoleTypeCount = 0;

// And, we also privately store the types lookup table.
static VectorPtr< ConsoleBaseType* > gConsoleTypeTable( __FILE__, __LINE__ );

//-----------------------------------------------------------------------------

ConsoleBaseType::ConsoleBaseType( const S32 size, S32 *idPtr, const char *aTypeName )
   :  mInspectorFieldType( NULL ),
      mTypeSize( size ),
      mTypeInfo( NULL )
{
   mTypeName = StringTable->insert( aTypeName );
   mTypeID = smConsoleTypeCount++;
   *idPtr = mTypeID;

   // Link ourselves into the list.
   mListNext = smListHead;
   smListHead = this;
}

//-----------------------------------------------------------------------------

ConsoleBaseType *ConsoleBaseType::getListHead()
{
   return smListHead;
}

//-----------------------------------------------------------------------------

void ConsoleBaseType::initialize()
{
   // Prep and empty the vector.
   gConsoleTypeTable.setSize(smConsoleTypeCount+1);
   dMemset(gConsoleTypeTable.address(), 0, sizeof(ConsoleBaseType*) * gConsoleTypeTable.size());

   // Walk the list and register each one with the console system.
   ConsoleBaseType *walk = getListHead();
   while(walk)
   {
      const S32 id = walk->getTypeID();
      AssertFatal(gConsoleTypeTable[id]==NULL, "ConsoleBaseType::initialize - encountered a table slot that contained something!");
      gConsoleTypeTable[id] = walk;

      walk = walk->getListNext();
   }
}

//-----------------------------------------------------------------------------

ConsoleBaseType* ConsoleBaseType::getType(const S32 typeID)
{
   if( typeID == -1 || gConsoleTypeTable.size() <= typeID )
      return NULL;

   return gConsoleTypeTable[ typeID ];
}

//-----------------------------------------------------------------------------

ConsoleBaseType* ConsoleBaseType::getTypeByName(const char *typeName)
{
   ConsoleBaseType* walk = getListHead();
   while( walk != NULL )
   {
      if( dStrcmp( walk->getTypeName(), typeName ) == 0 )
         return walk;

      walk = walk->getListNext();
   }

   return NULL;
}

//-----------------------------------------------------------------------------

ConsoleBaseType * ConsoleBaseType::getTypeByClassName(const char *typeName)
{
   ConsoleBaseType *walk = getListHead();
   while( walk != NULL )
   {
      if( dStrcmp( walk->getTypeClassName(), typeName ) == 0 )
         return walk;

      walk = walk->getListNext();
   }

   return NULL;
}


text:
$(document).ready(function(){
  $("#mybutton").click(function(){
    $("body").fadeOut();
  });
});

function hi()
{
  alert("hello");
}


text:
package org.junit;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 *
The Test annotation tells JUnit that the public void method
 * to which it is attached can be run as a test case. To run the method,
 * JUnit first constructs a fresh instance of the class then invokes the
 * annotated method. Any exceptions thrown by the test will be reported
 * by JUnit as a failure. If no exceptions are thrown, the test is assumed
 * to have succeeded.

 *
 *
A simple test looks like this:
 *

 * public class Example {
 *    @Test
 *    public void method() {
 *       org.junit.Assert.assertTrue( new ArrayList().isEmpty() );
 *    }
 * }
 *

 *

 *
 *
The Test annotation supports two optional parameters.
 * The first, expected, declares that a test method should throw
 * an exception. If it doesn't throw an exception or if it throws a different exception
 * than the one declared, the test fails. For example, the following test succeeds:
 *

 *    @Test(expected=IndexOutOfBoundsException.class) public void outOfBounds() {
 *       new ArrayList<Object>().get(1);
 *    }
 *

 *
 *
The second optional parameter, timeout, causes a test to fail if it takes
 * longer than a specified amount of clock time (measured in milliseconds). The following test fails:
 *

 *    @Test(timeout=100) public void infinity() {
 *       while(true);
 *    }
 *

 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface Test {

	/**
	 * Default empty exception
	 */
	static class None extends Throwable {
		private static final long serialVersionUID= 1L;
		private None() {
		}
	}

	/**
	 * Optionally specify expected, a Throwable, to cause a test method to succeed iff
	 * an exception of the specified class is thrown by the method.
	 */
	Class<? extends Throwable> expected() default None.class;

	/**
	 * Optionally specify timeout in milliseconds to cause a test method to fail if it
	 * takes longer than that number of milliseconds.*/
	long timeout() default 0L;
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Nova Hedwigia, Beih. 29: 17 (1969)

#### Original name
Hygrophorus singeri var. albifolius Hesler & A.H. Sm.

### Remarks
null


text:
/// <reference path="library/jquery.js" />
$(document).ready(function () {
    $('#createAccountBtn').click(function () {
        console.log('Create Account Clicked...');
        $.ajax({
            type: "PUT",
            contentType: "application/json",
            url: "/api/CreateAccount",
            dataType: "json",
            data: JSON.stringify({
                firstName: 'Jessica',
                lastName: 'Angres',
                accountNumber: '',
                gender:1
            }),
            success: function (data) {
                console.log(data);
            },
            error: function (data) {
                console.log(data);
            }
        });
    });

    $('#deleteAccountBtn').click(function () {
        console.log('Delete Account Clicked...');
        $.ajax({
            type: "DELETE",
            contentType: "application/json",
            url: "/api/DeleteAccount",
            dataType: "json",
            data: JSON.stringify({
                firstName: 'Jessica',
                lastName: 'Angres',
                accountNumber: '78672376373838828',
                gender: 1
            }),
            success: function (data) {
                console.log(data);
            },
            error: function (data) {
                console.log(data);
            }
        });
    });

    $('#updateAccountBtn').click(function () {
        console.log('Update Account Clicked...');
        $.ajax({
            type: "POST",
            contentType: "application/json",
            url: "/api/UpdateAccount",
            dataType: "json",
            data: JSON.stringify({
                firstName: 'Jessica',
                lastName: 'Angres',
                accountNumber: '78672376373838828',
                gender: 0
            }),
            success: function (data) {
                console.log(data);
            },
            error: function (data) {
                console.log(data);
            }
        });
    });

    $('#getAccountBtn').click(function () {
        console.log('Get Account Clicked...');
        $.ajax({
            type: "GET",
            contentType: "application/json",
            url: "/api/Account/" + '8377738',
            dataType: "json",
            success: function (data) {
                console.log(data);
            },
            error: function (data) {
                console.log(data);
            }
        });
    });
});


text:
package com.intellij.codeInsight;

import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiType;
import org.jetbrains.annotations.NotNull;

/**
 * Created by IntelliJ IDEA.
 * User: ven
 * Date: Jul 14, 2004
 * Time: 4:45:46 PM
 * To change this template use File | Settings | File Templates.
 */
public interface ExpectedTypeInfo {
  int TYPE_STRICTLY = 0;
  int TYPE_OR_SUBTYPE = 1;
  int TYPE_OR_SUPERTYPE = 2;
  ExpectedTypeInfo[] EMPTY_ARRAY = new ExpectedTypeInfo[0];

  PsiMethod getCalledMethod();

  @NotNull
  PsiType getType ();

  PsiType getDefaultType ();

  int getKind();

  boolean equals (ExpectedTypeInfo info);

  String toString();

  ExpectedTypeInfo[] intersect(ExpectedTypeInfo info);

  boolean isArrayTypeInfo ();

  TailType getTailType();

  boolean isInsertExplicitTypeParams();
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>SimpleDateFormatEditor</title>
<meta name="date" content="2014-12-16">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

weka.gui

Class SimpleDateFormatEditor

java.lang.Object

weka.gui.SimpleDateFormatEditor

All Implemented Interfaces:

java.beans.PropertyEditor

public class SimpleDateFormatEditor
extends java.lang.Object
implements java.beans.PropertyEditor

Class for editing SimpleDateFormat strings.

Version:

$Revision: 7059 $

Author:

FracPete (fracpete at waikato dot ac dot nz)

See Also:

SimpleDateFormat

Field Summary

Fields

Modifier and Type
Field and Description

static java.lang.String
DEFAULT_FORMAT

the default format

Constructor Summary

Constructors

Constructor and Description

SimpleDateFormatEditor()

Constructs a new SimpleDateFormatEditor.

Method Summary

Methods

Modifier and Type
Method and Description

void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)

Adds an object to the list of those that wish to be informed when the
 date format changes.

java.lang.String
getAsText()

Returns the date format string.

java.awt.Component
getCustomEditor()

Gets a GUI component with which the user can edit the date format.

java.lang.String
getJavaInitializationString()

Returns the Java code that generates an object the same as the one being edited.

java.lang.String[]
getTags()

Some objects can return tags, but a date format cannot.

java.lang.Object
getValue()

Gets the date format that is being edited.

boolean
isPaintable()

Indicates whether the object can be represented graphically.

void
paintValue(java.awt.Graphics gfx,
          java.awt.Rectangle box)

Paints a graphical representation of the object.

void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)

Removes an object from the list of those that wish to be informed when the
 date format changes.

void
setAsText(java.lang.String text)

Sets the date format string.

void
setValue(java.lang.Object value)

Sets the value of the date format to be edited.

boolean
supportsCustomEditor()

Indicates whether the date format can be edited in a GUI, which it can.

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_FORMAT

public static final java.lang.String DEFAULT_FORMAT

the default format

See Also:

Constant Field Values

Constructor Detail

SimpleDateFormatEditor

public SimpleDateFormatEditor()

Constructs a new SimpleDateFormatEditor.

Method Detail

setValue

public void setValue(java.lang.Object value)

Sets the value of the date format to be edited.

Specified by:

setValue in interface java.beans.PropertyEditor

Parameters:

value - a SimpleDateFormat object to be edited

getValue

public java.lang.Object getValue()

Gets the date format that is being edited.

Specified by:

getValue in interface java.beans.PropertyEditor

Returns:

the edited SimpleDateFormat object

isPaintable

public boolean isPaintable()

Indicates whether the object can be represented graphically. In this case
 it can.

Specified by:

isPaintable in interface java.beans.PropertyEditor

Returns:

true

paintValue

public void paintValue(java.awt.Graphics gfx,
              java.awt.Rectangle box)

Paints a graphical representation of the object. It just prints the
 format.

Specified by:

paintValue in interface java.beans.PropertyEditor

Parameters:

gfx - the graphics context to draw the representation to

box - the bounds within which the representation should fit.

getJavaInitializationString

public java.lang.String getJavaInitializationString()

Returns the Java code that generates an object the same as the one being edited.

Specified by:

getJavaInitializationString in interface java.beans.PropertyEditor

Returns:

the initialization string

getAsText

public java.lang.String getAsText()

Returns the date format string.

Specified by:

getAsText in interface java.beans.PropertyEditor

Returns:

the date format string

setAsText

public void setAsText(java.lang.String text)

Sets the date format string.

Specified by:

setAsText in interface java.beans.PropertyEditor

Parameters:

text - the date format string

getTags

public java.lang.String[] getTags()

Some objects can return tags, but a date format cannot.

Specified by:

getTags in interface java.beans.PropertyEditor

Returns:

null

getCustomEditor

public java.awt.Component getCustomEditor()

Gets a GUI component with which the user can edit the date format.

Specified by:

getCustomEditor in interface java.beans.PropertyEditor

Returns:

an editor GUI component

supportsCustomEditor

public boolean supportsCustomEditor()

Indicates whether the date format can be edited in a GUI, which it can.

Specified by:

supportsCustomEditor in interface java.beans.PropertyEditor

Returns:

true

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

Adds an object to the list of those that wish to be informed when the
 date format changes.

Specified by:

addPropertyChangeListener in interface java.beans.PropertyEditor

Parameters:

listener - a new listener to add to the list

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)

Removes an object from the list of those that wish to be informed when the
 date format changes.

Specified by:

removePropertyChangeListener in interface java.beans.PropertyEditor

Parameters:

listener - the listener to remove from the list

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package io.hawkcd.core.subscriber;

import org.apache.log4j.Logger;

import io.hawkcd.core.Message;

/**
 * Created by rado on 11.11.16.
 */
public class AuthFilter implements IMessageFilter {

    private static final Logger LOGGER = Logger.getLogger(AuthFilter.class.getClass());

    public  AuthFilter(){

    }

    @Override
    public void applyFilter(Message message) {
        LOGGER.info("authFilter message:"+ message);
    }
}


text:
import numpy as np
import sys, ldac, astropy, astropy.io.fits as pyfits
import bootstrap_masses as bm
import process_cosmos_sims as pcs
import os, cPickle

#########################

inputCatFile = sys.argv[1]

nBootstraps = int(sys.argv[2])

bpzcut = float(sys.argv[3])

outputFile = sys.argv[4]

##########################

inputcat = ldac.openObjectFile(inputCatFile)

concentration = inputcat.hdu.header['CONCEN']
zcluster = inputcat.hdu.header['Z']
true_scale_radius = inputcat.hdu.header['R_S']

goodObjs = np.logical_and(inputcat['z_odds'] > bpzcut,
                          np.logical_and(inputcat['z_b'] > zcluster + 0.1,
                                         inputcat['z_b'] < 1.25))

betas = sp.beta_s(inputcat['z_b'], zcluster)

rss, nfails = bm.bootstrap_beta_method(inputcat['r_pix'][goodObjs],
                                    inputcat['r_mpc'][goodObjs],
                                    inputcat['ghats'][goodObjs],
                                    betas[goodObjs],
                                    concentration,
                                    zcluster,
                                    nBootstraps)

r500 = sp.NFWRdelta(500, 4.0, true_scale_radius)

masses = np.array([sp.AdamMass(4.0, x, r500, zcluster) for x in rss])

mu = np.mean(masses)
sig = np.std(masses)

chisq = ((masses - mu)/sig)**2

massdist = pcs.MassDist(zcluster, true_scale_radius, mu, sig, chisq)

cols = [ pyfits.Column(name = 'Rs', format = 'E', array = rss),
         pyfits.Column(name = 'masses', format = 'E', array = masses)]

cat = pyfits.BinTableHDU.from_columns(cols)
cat.header['EXTNAME']= 'OBJECTS'
cat.header['NFAILS']= nfails

cat.writeto(outputFile, overwrite=True)

base, ext = os.path.splitext(outputFile)
output = open('%s.pkl' % base, 'wb')
cPickle.dump(massdist, output)
output.close()


text:
using System;
using System.Collections.Generic;
using System.Web.Http;
using System.Web.Http.Cors;
using System.Web.Http.Description;
using FLS.Data.WebApi.AircraftReservation;
using FLS.Server.Service;

namespace FLS.Server.WebApi.Controllers
{
    /// <summary>
    /// Api controller for aircraft reservation type entities.
    /// </summary>
    [Authorize]
    [RoutePrefix("api/v1/aircraftreservationtypes")]
    public class AircraftReservationTypesController : ApiController
    {
        private readonly AircraftReservationService _aircraftReservationService;

        /// <summary>
        /// Initializes a new instance of the <see cref="AircraftReservationTypesController"/> class.
        /// </summary>
        public AircraftReservationTypesController(AircraftReservationService aircraftReservationService)
        {
            _aircraftReservationService = aircraftReservationService;
        }

        /// <summary>
        /// Gets the aircraft reservation type overviews.
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("")]
        [Route("listitems")]
        [ResponseType(typeof(List<AircraftReservationTypeListItem>))]
        public IHttpActionResult GetAircraftReservationTypeListItems()
        {
            var items = _aircraftReservationService.GetAircraftReservationTypeListItems();
            return Ok(items);
        }
    }
}


text:
package com.offbynull.portmapper.gateways.process;

import com.offbynull.portmapper.gateway.Bus;
import com.offbynull.portmapper.gateways.process.internalmessages.ReadType;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.vash.vate.compatibility.VTArrays;

final class ProcessReaderRunnable implements Runnable {
    private static final Logger LOG = LoggerFactory.getLogger(ProcessReaderRunnable.class);

    private int id;
    private final InputStream inputStream;
    private final Bus processBus;
    private final ReadType readType;

    ProcessReaderRunnable(int id, InputStream inputStream, Bus processBus, ReadType readType) {
        Validate.notNull(inputStream);
        Validate.notNull(processBus);
        Validate.notNull(readType);

        this.id = id;
        this.inputStream = inputStream;
        this.processBus = processBus;
        this.readType = readType;
    }

    public void run() {
        LOG.debug("{} Starting up reader {}", id, readType);

        byte[] buffer = new byte[8192];
        try {
            while (true) {
                int count = inputStream.read(buffer);
                if (count == -1) {
                    LOG.debug("{} {} ended", id, readType);
                    break;
                }

                LOG.debug("{} Read {} bytes from {}", id, count, readType);

                processBus.send(new ReadMessage(id, VTArrays.copyOf(buffer, count), readType));
            }
        } catch (RuntimeException ioe) {
            LOG.debug(id + " " + readType + " encountered exception", ioe);
        } catch (IOException ioe) {
            LOG.debug(id + " " + readType + " encountered exception", ioe);
        } catch (Throwable t) {
            LOG.debug(id + " " + readType + " encountered exception", t);
        }
        finally {
            IOUtils.closeQuietly(inputStream);
            LOG.debug("{} Shutting down reader {}", id, readType);
        }
    }

}


text:
package at.ac.tuwien.big.xmlintelledit.intelledit.oclvisit.fixinggenerators;

import java.util.Collection;

import org.eclipse.ocl.expressions.OperationCallExp;

import at.ac.tuwien.big.xmlintelledit.intelledit.fixer.Decrease;
import at.ac.tuwien.big.xmlintelledit.intelledit.fixer.FixAttempt;
import at.ac.tuwien.big.xmlintelledit.intelledit.fixer.Increase;
import at.ac.tuwien.big.xmlintelledit.intelledit.fixer.MakeDifferent;
import at.ac.tuwien.big.xmlintelledit.intelledit.fixer.MakeEqual;
import at.ac.tuwien.big.xmlintelledit.intelledit.oclvisit.AbstractSelectiveEvaluator;
import at.ac.tuwien.big.xmlintelledit.intelledit.oclvisit.ExpressionResult;
import at.ac.tuwien.big.xmlintelledit.intelledit.oclvisit.FixingGenerator;

public class PropagateSumChanges  extends AbstractSelectiveEvaluator<OperationCallExp, Number> implements FixingGenerator<OperationCallExp, Number> {

	public PropagateSumChanges() {
		super(OperationCallExp.class, Number.class, true, "sum");
	}

	public static PropagateSumChanges INSTANCE = new PropagateSumChanges();

	@Override
	public boolean addFixingPossibilitiesLocal(FixAttempt singleAttemptForThis, ExpressionResult res, OperationCallExp expr,
			Number result, Collection<FixAttempt>[] fixAttemptsPerSub) {
		if (!(singleAttemptForThis instanceof MakeEqual ||
				singleAttemptForThis instanceof MakeDifferent ||
				singleAttemptForThis instanceof Increase ||
				singleAttemptForThis instanceof Decrease)) {
			return false;
		}
		if (singleAttemptForThis instanceof MakeDifferent || singleAttemptForThis instanceof Increase
				|| singleAttemptForThis instanceof Decrease || singleAttemptForThis instanceof MakeEqual) {
			//Do anything
			fixAttemptsPerSub[0].add(singleAttemptForThis);
			//Eigentlich sollte man schauen, woher die Collection kommt
			//Und dann
		}
		// TODO Auto-generated method stub
		return true;
	}

}


text:
module.exports = function(id, falseCase, score, done) {
    var scoreId = "#q" + this.questions[id].id + "_count";
    this.browser.getText(scoreId)
        .then(function (text) {
            if (falseCase) {
                score.should.not.equal(text);
            } else {
                score.should.equal(text);
            }
        })
        .call(done);
};


text:
package org.adbcj.h2;

import org.adbcj.DbCallback;
import org.adbcj.DbException;
import org.adbcj.h2.decoding.DecoderState;
import org.adbcj.h2.packets.ClientToServerPacket;

import java.util.ArrayList;

public class Request<T> {
    private final String description;
    protected final DbCallback<T> toComplete;
    private final DecoderState startState;
    private final ClientToServerPacket request;

    protected Request(
            String description,
            DbCallback<T> toComplete,
            DecoderState startState,
            ClientToServerPacket request) {
        this.description = description;
        this.toComplete = toComplete;
        this.startState = startState;
        this.request = request;
    }

    public DecoderState getStartState() {
        return startState;
    }

    @Override
    public String toString() {
        return String.valueOf(description);
    }

    ClientToServerPacket getRequest() {
        return request;
    }

    public void completeFailure(DbException failed){
        toComplete.onComplete(null, failed);
    }

}

/**
 * Usually we aggressively pipeline request through the TCP connection.
 *
 * However, executeQuery, executeUpdate are internally actually multiple steps.
 * If those are just pipelined through, and a error occur in the first step, the follow up step make no sense.
 * Even works, the follow up step are invalid commands, tripping up the H2 server with more errors.
 *
 * So, to avoid this, we have block requests. If a blocking request is running, all follow up commands are qued behind it.
 * Then, once it completed, the commands are queued up again
 *
 * Assummes that all it's operaiton are done withing the connection's lock
 */
class BlockingRequestInProgress<T> extends Request<T> {

    private final ArrayList<Request> waitingRequests = new ArrayList<>();
    private final H2Connection connection;
    private final Request<T> blockedOn;

    BlockingRequestInProgress(
            H2Connection connection,
            String description,
            DbCallback<T> toComplete,
            DecoderState startState,
            ClientToServerPacket request,
            Request<T> blockedOn
            ) {
        super(description, toComplete, startState, request);
        this.connection = connection;
        this.blockedOn = blockedOn;
    }

    void add(Request request) {
        waitingRequests.add(request);
    }

    boolean unblockBy(Request nextRequest) {
        return blockedOn==nextRequest;
    }

    void continueWithRequests() {
        connection.blockingRequest = null;
        for (Request waitingRequest : waitingRequests) {
            connection.forceQueRequest(waitingRequest);
        }
    }

    public int size() {
        return waitingRequests.size();
    }
}


text:
                {{init.msg}}

           <authy destination="pay.survey" notify="notifyLogin()">
               Login to take survey
           </authy>

     <ui-view></ui-view>


text:
<?php
/*
Template Name: Category Travels
*/
?>
<?php get_template_part('templates/page', 'header'); ?>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php if(is_category('featured')): ?>class="featured-post"<?php endif; ?>>

<a href="<?php the_permalink(); ?>" title="<?php the_title() ;?>"><?php the_title() ;?>

        <?php the_time('F jS, Y'); ?>

    <a href="<?php the_permalink(); ?>" title="<?php the_title() ;?>"><?php the_post_thumbnail('medium', array( 'alt' => get_the_title(), "class" => "alignleft post-thumbnail")); ?>
    <a href="<?php the_permalink(); ?>" title="<?php the_title() ;?>" class="btn btn-bc hidden-xs">More

<?php endwhile; else: ?>

Sorry, no posts to list

<?php endif; ?>