text:
import React from "react"

// This should intentionally fail
const foo = null
foo.bar()

export default () =>
Hi


text:
package com.github.szberes.spring.examples.aop.advised.classes.subpackage;

import org.springframework.stereotype.Component;

@Component
public class MyClassInSubpackage {

	public void doNothing() {}
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Maxtoan\ToolsBundle\Traits;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use App\Entity\M\User;

/**
 * Add Owner behavior to an entity.
 * @author Máximo Sojo <maxsojo13@gmail.com>
 */
trait OwnerTrait
{
    /**
     * @var User
     *
     * @Gedmo\Blameable(on="create")
     * @ORM\ManyToOne(targetEntity="App\Entity\M\User")
     */
    protected $owner;

    /**
     * Set owner
     *
     * @param User $owner
     * @return Object
     */
    public function setOwner(User $owner)
    {
        $this->owner = $owner;

        return $this;
    }

    /**
     * Get owner
     *
     * @return User
     */
    public function getOwner()
    {
        return $this->owner;
    }
}


text:
/*
 * Copyright 2011-2014, by Vladimir Kostyukov and Contributors.
 *
 * This file is part of la4j project (http://la4j.org)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Contributor(s): -
 */
package net.fec.openrq.util.linearalgebra.io;

class CursorToMatrixIterator extends ByteMatrixIterator {

    private CursorIterator underlying;

    public CursorToMatrixIterator(CursorIterator underlying, int rows, int columns) {

        super(rows, columns);
        this.underlying = underlying;
    }

    @Override
    public int rowIndex() {

        return underlying.cursor() / columns;
    }

    @Override
    public int columnIndex() {

        return underlying.cursor() - rowIndex() * columns;
    }

    @Override
    public byte get() {

        return underlying.get();
    }

    @Override
    public void set(byte value) {

        underlying.set(value);
    }

    @Override
    public boolean hasNext() {

        return underlying.hasNext();
    }

    @Override
    public Byte next() {

        return underlying.next();
    }
}


text:
using CQRS.Messaging;
using System;

namespace CQRS.Event
{
    public interface IEvent : IMessagePayload
    {
        Guid SourceId { get; set; }
    }
}


text:
package org.springframework.beans.factory.support;

import java.lang.reflect.Method;

import org.springframework.beans.BeanMetadataElement;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;

/**
 * Object representing the override of a method on a managed
 * object by the IoC container.
 *
 *
Note that the override mechanism is not intended as a
 * generic means of inserting crosscutting code: use AOP for that.
 *
 * @author Rod Johnson
 * @author Juergen Hoeller
 * @since 1.1
 */
public abstract class MethodOverride implements BeanMetadataElement {

	private final String methodName;

	private boolean overloaded = true;

	private Object source;

	/**
	 * Construct a new override for the given method.
	 * @param methodName the name of the method to override
	 */
	protected MethodOverride(String methodName) {
		Assert.notNull(methodName, "Method name must not be null");
		this.methodName = methodName;
	}

	/**
	 * Return the name of the method to be overridden.
	 */
	public String getMethodName() {
		return this.methodName;
	}

	/**
	 * Set whether the overridden method has to be considered as overloaded
	 * (that is, whether arg type matching has to happen).
	 *
Default is "true"; can be switched to "false" to optimize runtime performance.
	 */
	protected void setOverloaded(boolean overloaded) {
		this.overloaded = overloaded;
	}

	/**
	 * Return whether the overridden method has to be considered as overloaded
	 * (that is, whether arg type matching has to happen).
	 */
	protected boolean isOverloaded() {
		return this.overloaded;
	}

	/**
	 * Set the configuration source Object for this metadata element.
	 *
The exact type of the object will depend on the configuration mechanism used.
	 */
	public void setSource(Object source) {
		this.source = source;
	}

	public Object getSource() {
		return this.source;
	}

	/**
	 * Subclasses must override this to indicate whether they match
	 * the given method. This allows for argument list checking
	 * as well as method name checking.
	 * @param method the method to check
	 * @return whether this override matches the given method
	 */
	public abstract boolean matches(Method method);

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof MethodOverride)) {
			return false;
		}
		MethodOverride that = (MethodOverride) other;
		return (ObjectUtils.nullSafeEquals(this.methodName, that.methodName) &&
				this.overloaded == that.overloaded &&
				ObjectUtils.nullSafeEquals(this.source, that.source));
	}

	public int hashCode() {
		int hashCode = ObjectUtils.nullSafeHashCode(this.methodName);
		hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.source);
		hashCode = 29 * hashCode + (this.overloaded ? 1 : 0);
		return hashCode;
	}

}


text:
__version__ = '1.3.0'
__author__ = 'Serge S. Koval'
__email__ = 'serge.koval+github@gmail.com'

from .base import expose, expose_plugview, Admin, BaseView, AdminIndexView


text:
package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"
	"encoding/json"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/validate"
)

// KlusterPhase kluster phase
//
// swagger:model KlusterPhase
type KlusterPhase string

func NewKlusterPhase(value KlusterPhase) *KlusterPhase {
	return &value
}

// Pointer returns a pointer to a freshly-allocated KlusterPhase.
func (m KlusterPhase) Pointer() *KlusterPhase {
	return &m
}

const (

	// KlusterPhasePending captures enum value "Pending"
	KlusterPhasePending KlusterPhase = "Pending"

	// KlusterPhaseCreating captures enum value "Creating"
	KlusterPhaseCreating KlusterPhase = "Creating"

	// KlusterPhaseRunning captures enum value "Running"
	KlusterPhaseRunning KlusterPhase = "Running"

	// KlusterPhaseUpgrading captures enum value "Upgrading"
	KlusterPhaseUpgrading KlusterPhase = "Upgrading"

	// KlusterPhaseTerminating captures enum value "Terminating"
	KlusterPhaseTerminating KlusterPhase = "Terminating"
)

// for schema
var klusterPhaseEnum []interface{}

func init() {
	var res []KlusterPhase
	if err := json.Unmarshal([]byte(`["Pending","Creating","Running","Upgrading","Terminating"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		klusterPhaseEnum = append(klusterPhaseEnum, v)
	}
}

func (m KlusterPhase) validateKlusterPhaseEnum(path, location string, value KlusterPhase) error {
	if err := validate.EnumCase(path, location, value, klusterPhaseEnum, true); err != nil {
		return err
	}
	return nil
}

// Validate validates this kluster phase
func (m KlusterPhase) Validate(formats strfmt.Registry) error {
	var res []error

	// value enum
	if err := m.validateKlusterPhaseEnum("", "body", m); err != nil {
		return err
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

// ContextValidate validates this kluster phase based on context it is used
func (m KlusterPhase) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}


text:
require "spec_helper"

describe Elrio::PatternDetector do
  describe "#detect_cap_insets" do
    it "returns the non-repeating prefix and suffix lengths of a collection" do
      data = %w(A - - - B C)
      subject.detect_pattern(data).should == Elrio::Pattern.new(1, 2, 1)
    end

    it "returns zero when all items are the same" do
      data = %w(- - -)
      subject.detect_pattern(data).should == Elrio::Pattern.new(0, 0, 1)
    end

    it "returns the length of the collection when all items are unique" do
      data = %w(A B C D E)
      subject.detect_pattern(data).should == Elrio::Pattern.new(5, 0, 1)
    end

    it "does not fail with a single-item collection" do
      data = %w(A)
      subject.detect_pattern(data).should == Elrio::Pattern.new(1, 0, 1)
    end

    it "can handle multiple runs" do
      data = %w(A A A B C - - - - - D E F F F)
      subject.detect_pattern(data).should == Elrio::Pattern.new(5, 5, 1)
    end

    it "can handle longest runs at the beginning" do
      data = %w(- - - A)
      subject.detect_pattern(data).should == Elrio::Pattern.new(0, 1, 1)
    end

    it "can handle longest runs at the end" do
      data = %w(A - - -)
      subject.detect_pattern(data).should == Elrio::Pattern.new(1, 0, 1)
    end

    it "can handle patterns" do
      data = %w(- A B A B A B -)
      subject.detect_pattern(data).should == Elrio::Pattern.new(1, 1, 2)
    end
  end
end


text:
import React from 'react';
import PropTypes from 'prop-types';

const ArtistList = props => {
  return (
    <div>
      {props.data}
    </div>
  );
};

ArtistList.propTypes = {
  data: PropTypes.array.isRequired
};

export default ArtistList;


text:
TeX Beamer Template
---

This repo contains my Beamer presentation template. For more information, see [this blog post](http://www.drbunsen.org/custom-beamer-theme.html).

#### Dependencies:

+ [XeTeX](http://en.wikipedia.org/wiki/XeTeX)
+ [The Fontin Font](http://www.exljbris.com/fontin.html)


text:
DAMS 5 "damspas-rd" Ansible Playbook
================================

Installs dependencies for Hyrax as listed on [Hyrax repository][hyrax].

Vagrant Steps
-------------

1.  `cd playbooks; make all`

    Creates the VM(s), downloads the required Ansible roles, create the Ansible
    inventory, and Ansible/ssh configurations.

2.  `ansible-playbook playbook.yml`

    Runs the playbook against the Vagrant VM.

If you need the /vagrant sync'd folder, be certain to remove the
*box.vm.synced_folder* option from the *Vagrantfile*.

### Makefile supported Commands

* **up**: Creates the VM(s)
* **roles**: Install Ansible roles, if not already present
* **force-roles**: (Re)Installs Ansible roles, regardless of presence
* **ip**: Displays IP addresses of all present and running VMs
* **ping**: Verifies VMs are running and accessible

### Additional Makefile commands

* **hosts**: Creates Ansible inventory
* **.ssh-config**: Creates ssh configuration
* **ansible.cfg**: Creates Ansible configuration

vSphere / Physical System Steps
-------------------------------

1.  `cd playbooks; make roles`

    Downloads required Ansible roles

2.  `ansible-playbook playbook.yml`

    Runs the playbook. This assumes a global Ansible inventory, proper ssh
    configuration, passwordless keys, and passwordless sudo. Use additional
    Ansible command line arguments (`-i <inventory> -l <host/group> -K -k`) as appropriate

[hyrax]: https://github.com/projecthydra-labs/hyrax#prerequisites


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.interceptores.ejemplos</groupId>
  <artifactId>Interceptores</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>

  <properties>
    <spring.version>4.3.5.RELEASE</spring.version>
  </properties>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <warSourceDirectory>target</warSourceDirectory>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>

    <!-- Spring dependencies -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>${spring.version}</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>${spring.version}</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>${spring.version}</version>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-tx</artifactId>
      <version>4.3.8.RELEASE</version>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.17</version>
    </dependency>

    <dependency>
      <groupId>jstl</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>

  </dependencies>

</project>


text:
/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass
   then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */
let generateSpringRK4 = (function(){
  function springAccelerationForState( state ){
    return (-state.tension * state.x) - (state.friction * state.v);
  }

  function springEvaluateStateWithDerivative( initialState, dt, derivative ){
    let state = {
      x: initialState.x + derivative.dx * dt,
      v: initialState.v + derivative.dv * dt,
      tension: initialState.tension,
      friction: initialState.friction
    };

    return { dx: state.v, dv: springAccelerationForState( state ) };
  }

  function springIntegrateState( state, dt ){
    let a = {
      dx: state.v,
      dv: springAccelerationForState( state )
    },
    b = springEvaluateStateWithDerivative( state, dt * 0.5, a ),
    c = springEvaluateStateWithDerivative( state, dt * 0.5, b ),
    d = springEvaluateStateWithDerivative( state, dt, c ),
    dxdt = 1.0 / 6.0 * (a.dx + 2.0 * (b.dx + c.dx) + d.dx),
    dvdt = 1.0 / 6.0 * (a.dv + 2.0 * (b.dv + c.dv) + d.dv);

    state.x = state.x + dxdt * dt;
    state.v = state.v + dvdt * dt;

    return state;
  }

  return function springRK4Factory( tension, friction, duration ){

    let initState = {
      x: -1,
      v: 0,
      tension: null,
      friction: null
    },
    path = [0],
    time_lapsed = 0,
    tolerance = 1 / 10000,
    DT = 16 / 1000,
    have_duration, dt, last_state;

    tension = parseFloat( tension ) || 500;
    friction = parseFloat( friction ) || 20;
    duration = duration || null;

    initState.tension = tension;
    initState.friction = friction;

    have_duration = duration !== null;

    /* Calculate the actual time it takes for this animation to complete with the provided conditions. */
    if( have_duration ){
      /* Run the simulation without a duration. */
      time_lapsed = springRK4Factory( tension, friction );
      /* Compute the adjusted time delta. */
      dt = time_lapsed / duration * DT;
    } else {
      dt = DT;
    }

    for(;;){
      /* Next/step function .*/
      last_state = springIntegrateState( last_state || initState, dt );
      /* Store the position. */
      path.push( 1 + last_state.x );
      time_lapsed += 16;
      /* If the change threshold is reached, break. */
      if( !(Math.abs( last_state.x ) > tolerance && Math.abs( last_state.v ) > tolerance) ){
        break;
      }
    }

    /* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the
       computed path and returns a snapshot of the position according to a given percentComplete. */
    return !have_duration ? time_lapsed : function( percentComplete ){ return path[ (percentComplete * (path.length - 1)) | 0 ]; };
  };
}());

export default generateSpringRK4;


text:
Star::~Star()
{

}

void Star::Update()
{
  throw NotImplementedException();
}


text:
package com.sgu.infowksporga.jfx.workspace;

import com.sgu.infowksporga.business.dto.WorkspaceDto;

public class WorkspaceDynamic extends AbstractWorkspace {

  public WorkspaceDynamic(final WorkspaceDto configuration) {
    super(configuration);// TODO Auto-generated constructor stub
  }

  @Override
  protected void initDockingViewMap() {
    // TODO Auto-generated method stub

  }

  @Override
  protected void defineWorkspaceLayout() {
    // TODO Auto-generated method stub

  }

}


text:
Select Color

							<button color-button="{{details.text}}" class="btn btn-product-colors" ng-click="vm.applyInnerFilters('color', details.text)"  ng-repeat="details in vm.filterProductsColors" style="background: {{details.text}}"> </button>

Select Size

						<select ng-change="vm.applyInnerFilters('size', vm.selectedProductsSize)" ng-model="vm.selectedProductsSize">
							<option ng-if="!details.text" selected>Select Size</option>
							<option ng-if="details.text" size-dropdown="{{details.text}}" value="{{details.text}}" ng-repeat="details in vm.filterProductsSize">
								{{details.text}}
							</option>
						</select>

Items...

${{product.price}}

{{product.name}}

									Add to cart

Add to wishlist

Add to compare


text:
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | API request logging
    |--------------------------------------------------------------------------
    |
    | This switch will enable or disable logging of the requests made. This
    | feature needs to be enabled for API request limiting to work
    |
    */

    'logging'              => true,

    'models'               => [

        'apiKey' => \Chrisbjr\ApiGuard\Models\ApiKey::class,

        'apiLog' => \Chrisbjr\ApiGuard\Models\ApiLog::class,

    ],

    /*
    |--------------------------------------------------------------------------
    | Key name
    |--------------------------------------------------------------------------
    |
    | This is the name of the variable that will provide us the API key in the
    | header
    |
    */

    'keyName'              => 'X-Authorization',

    /*
    |--------------------------------------------------------------------------
    | Variable name for Fractal's include / embed objects
    |--------------------------------------------------------------------------
    |
    | Set the variable name for Fractal's include / embed keyword here. This is
    | automatically parsed if it exists in the GET parameters. Values are
    | comma-separated.
    |
    */

    'includeKeyword'       => 'include',

    /*
    |--------------------------------------------------------------------------
    | Api key access limit increment
    |--------------------------------------------------------------------------
    |
    | This is the default value for the increment of limits when defining
    | limits in the methods. The default value is "1 hour" which means that
    | if you specified a limit of 100 to a method, it will limit requests to
    | 100 for every 1 hour. This value can be any value acceptable by the
    | strtotime() method of PHP.
    |
    | Examples:
    | 1 hour
    | 1 day
    | 15 minutes
    |
    */

    'keyLimitIncrement'    => '1 hour',

    /*
    |--------------------------------------------------------------------------
    | Method key access limit increment
    |--------------------------------------------------------------------------
    |
    | This is the default value for the increment of limits when defining
    | limits in the methods. The default value is "1 hour" which means that
    | if you specified a limit of 100 to a method, it will limit requests to
    | 100 for every 1 hour. This value can be any value acceptable by the
    | strtotime() method of PHP.
    |
    | Examples:
    | 1 hour
    | 1 day
    | 15 minutes
    |
    */

    'methodLimitIncrement' => '1 hour',

    'providers'            => [

        /*
        |--------------------------------------------------------------------------
        | Authentication Provider
        |--------------------------------------------------------------------------
        |
        | Specify the provider that is used to authenticate users.
        |
        */
        'auth' => Chrisbjr\ApiGuard\Providers\Auth\Illuminate::class

    ],

    /*
    |--------------------------------------------------------------------------
    | Duration the API key should be cached for
    |--------------------------------------------------------------------------
    |
    | This is the number of minutes API keys will be cached for. A value of 0
    | or less (or not setting the option at all) disables API key caching.
    |
    */

    'rememberApiKeyDuration' => 0,
];


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

<title>CodePageUtil (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

org.apache.poi.util

Class CodePageUtil

java.lang.Object

org.apache.poi.util.CodePageUtil

public class CodePageUtil
extends java.lang.Object

Utilities for working with Microsoft CodePages.

Provides constants for understanding numeric codepages,
  along with utilities to translate these into Java Character Sets.

Field Summary

Fields

Modifier and Type
Field and Description

static int
CP_037

Codepage 037, a special case

static int
CP_EUC_JP

Codepage for EUC-JP

static int
CP_EUC_KR

Codepage for EUC-KR

static int
CP_GB18030

Codepage for GB18030

static int
CP_GB2312

Codepage for GB2312

static int
CP_GBK

Codepage for GBK, aka MS936

static int
CP_ISO_2022_JP1

Codepage for ISO-2022-JP

static int
CP_ISO_2022_JP2

Another codepage for ISO-2022-JP

static int
CP_ISO_2022_JP3

Yet another codepage for ISO-2022-JP

static int
CP_ISO_2022_KR

Codepage for ISO-2022-KR

static int
CP_ISO_8859_1

Codepage for ISO-8859-1

static int
CP_ISO_8859_2

Codepage for ISO-8859-2

static int
CP_ISO_8859_3

Codepage for ISO-8859-3

static int
CP_ISO_8859_4

Codepage for ISO-8859-4

static int
CP_ISO_8859_5

Codepage for ISO-8859-5

static int
CP_ISO_8859_6

Codepage for ISO-8859-6

static int
CP_ISO_8859_7

Codepage for ISO-8859-7

static int
CP_ISO_8859_8

Codepage for ISO-8859-8

static int
CP_ISO_8859_9

Codepage for ISO-8859-9

static int
CP_JOHAB

Codepage for Johab

static int
CP_KOI8_R

Codepage for KOI8-R

static int
CP_MAC_ARABIC

Codepage for Macintosh Arabic (Java: MacArabic)

static int
CP_MAC_CENTRAL_EUROPE

Codepage for Macintosh Central Europe (Latin-2)
 (Java: MacCentralEurope)

static int
CP_MAC_CHINESE_SIMPLE

Codepage for Macintosh Chinese Simplified (Java: unknown - use
 EUC_CN, ISO2022_CN_GB, MS936 or cp935)

static int
CP_MAC_CHINESE_TRADITIONAL

Codepage for Macintosh Chinese Traditional (Java: unknown - use Big5,
 MS950, or cp937)

static int
CP_MAC_CROATIAN

Codepage for Macintosh Croatian (Java: MacCroatian)

static int
CP_MAC_CYRILLIC

Codepage for Macintosh Cyrillic (Java: MacCyrillic)

static int
CP_MAC_GREEK

Codepage for Macintosh Greek (Java: MacGreek)

static int
CP_MAC_HEBREW

Codepage for Macintosh Hebrew (Java: MacHebrew)

static int
CP_MAC_ICELAND

Codepage for Macintosh Iceland (Java: MacIceland)

static int
CP_MAC_JAPAN

Codepage for Macintosh Japan (Java: unknown - use SJIS, cp942 or
 cp943)

static int
CP_MAC_KOREAN

Codepage for Macintosh Korean (Java: unknown - use EUC_KR or
 cp949)

static int
CP_MAC_ROMAN

Codepage for Macintosh Roman (Java: MacRoman)

static int
CP_MAC_ROMANIA

Codepage for Macintosh Romanian (Java: MacRomania)

static int
CP_MAC_THAI

Codepage for Macintosh Thai (Java: MacThai)

static int
CP_MAC_TURKISH

Codepage for Macintosh Turkish (Java: MacTurkish)

static int
CP_MAC_UKRAINE

Codepage for Macintosh Ukrainian (Java: MacUkraine)

static int
CP_MS949

Codepage for MS949

static int
CP_SJIS

Codepage for SJIS

static int
CP_UNICODE

Codepage for Unicode

static int
CP_US_ACSII

Codepage for US-ASCII

static int
CP_US_ASCII2

Another codepage for US-ASCII

static int
CP_UTF16

Codepage for UTF-16

static int
CP_UTF16_BE

Codepage for UTF-16 big-endian

static int
CP_UTF8

Codepage for UTF-8

static int
CP_WINDOWS_1250

Codepage for Windows 1250

static int
CP_WINDOWS_1251

Codepage for Windows 1251

static int
CP_WINDOWS_1252

Codepage for Windows 1252

static int
CP_WINDOWS_1253

Codepage for Windows 1253

static int
CP_WINDOWS_1254

Codepage for Windows 1254

static int
CP_WINDOWS_1255

Codepage for Windows 1255

static int
CP_WINDOWS_1256

Codepage for Windows 1256

static int
CP_WINDOWS_1257

Codepage for Windows 1257

static int
CP_WINDOWS_1258

Codepage for Windows 1258

Constructor Summary

Constructors

Constructor and Description

CodePageUtil()

Method Summary

Methods

Modifier and Type
Method and Description

static java.lang.String
codepageToEncoding(int codepage)

Turns a codepage number into the equivalent character encoding's
 name (in Java NIO canonical naming format).

static java.lang.String
codepageToEncoding(int codepage,
                  boolean javaLangFormat)

Turns a codepage number into the equivalent character encoding's
 name, in either Java NIO or Java Lang canonical naming.

static byte[]
getBytesInCodePage(java.lang.String string,
                  int codepage)

Converts a string into bytes, in the equivalent character encoding
  to the supplied codepage number.

static java.lang.String
getStringFromCodePage(byte[] string,
                     int codepage)

Converts the bytes into a String, based on the equivalent character encoding
  to the supplied codepage number.

static java.lang.String
getStringFromCodePage(byte[] string,
                     int offset,
                     int length,
                     int codepage)

Converts the bytes into a String, based on the equivalent character encoding
  to the supplied codepage number.

Methods inherited from class java.lang.Object

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

Field Detail

CP_037

public static final int CP_037

Codepage 037, a special case

See Also:

Constant Field Values

CP_SJIS

public static final int CP_SJIS

Codepage for SJIS

See Also:

Constant Field Values

CP_GBK

public static final int CP_GBK

Codepage for GBK, aka MS936

See Also:

Constant Field Values

CP_MS949

public static final int CP_MS949

Codepage for MS949

See Also:

Constant Field Values

CP_UTF16

public static final int CP_UTF16

Codepage for UTF-16

See Also:

Constant Field Values

CP_UTF16_BE

public static final int CP_UTF16_BE

Codepage for UTF-16 big-endian

See Also:

Constant Field Values

CP_WINDOWS_1250

public static final int CP_WINDOWS_1250

Codepage for Windows 1250

See Also:

Constant Field Values

CP_WINDOWS_1251

public static final int CP_WINDOWS_1251

Codepage for Windows 1251

See Also:

Constant Field Values

CP_WINDOWS_1252

public static final int CP_WINDOWS_1252

Codepage for Windows 1252

See Also:

Constant Field Values

CP_WINDOWS_1253

public static final int CP_WINDOWS_1253

Codepage for Windows 1253

See Also:

Constant Field Values

CP_WINDOWS_1254

public static final int CP_WINDOWS_1254

Codepage for Windows 1254

See Also:

Constant Field Values

CP_WINDOWS_1255

public static final int CP_WINDOWS_1255

Codepage for Windows 1255

See Also:

Constant Field Values

CP_WINDOWS_1256

public static final int CP_WINDOWS_1256

Codepage for Windows 1256

See Also:

Constant Field Values

CP_WINDOWS_1257

public static final int CP_WINDOWS_1257

Codepage for Windows 1257

See Also:

Constant Field Values

CP_WINDOWS_1258

public static final int CP_WINDOWS_1258

Codepage for Windows 1258

See Also:

Constant Field Values

CP_JOHAB

public static final int CP_JOHAB

Codepage for Johab

See Also:

Constant Field Values

CP_MAC_ROMAN

public static final int CP_MAC_ROMAN

Codepage for Macintosh Roman (Java: MacRoman)

See Also:

Constant Field Values

CP_MAC_JAPAN

public static final int CP_MAC_JAPAN

Codepage for Macintosh Japan (Java: unknown - use SJIS, cp942 or
 cp943)

See Also:

Constant Field Values

CP_MAC_CHINESE_TRADITIONAL

public static final int CP_MAC_CHINESE_TRADITIONAL

Codepage for Macintosh Chinese Traditional (Java: unknown - use Big5,
 MS950, or cp937)

See Also:

Constant Field Values

CP_MAC_KOREAN

public static final int CP_MAC_KOREAN

Codepage for Macintosh Korean (Java: unknown - use EUC_KR or
 cp949)

See Also:

Constant Field Values

CP_MAC_ARABIC

public static final int CP_MAC_ARABIC

Codepage for Macintosh Arabic (Java: MacArabic)

See Also:

Constant Field Values

CP_MAC_HEBREW

public static final int CP_MAC_HEBREW

Codepage for Macintosh Hebrew (Java: MacHebrew)

See Also:

Constant Field Values

CP_MAC_GREEK

public static final int CP_MAC_GREEK

Codepage for Macintosh Greek (Java: MacGreek)

See Also:

Constant Field Values

CP_MAC_CYRILLIC

public static final int CP_MAC_CYRILLIC

Codepage for Macintosh Cyrillic (Java: MacCyrillic)

See Also:

Constant Field Values

CP_MAC_CHINESE_SIMPLE

public static final int CP_MAC_CHINESE_SIMPLE

Codepage for Macintosh Chinese Simplified (Java: unknown - use
 EUC_CN, ISO2022_CN_GB, MS936 or cp935)

See Also:

Constant Field Values

CP_MAC_ROMANIA

public static final int CP_MAC_ROMANIA

Codepage for Macintosh Romanian (Java: MacRomania)

See Also:

Constant Field Values

CP_MAC_UKRAINE

public static final int CP_MAC_UKRAINE

Codepage for Macintosh Ukrainian (Java: MacUkraine)

See Also:

Constant Field Values

CP_MAC_THAI

public static final int CP_MAC_THAI

Codepage for Macintosh Thai (Java: MacThai)

See Also:

Constant Field Values

CP_MAC_CENTRAL_EUROPE

public static final int CP_MAC_CENTRAL_EUROPE

Codepage for Macintosh Central Europe (Latin-2)
 (Java: MacCentralEurope)

See Also:

Constant Field Values

CP_MAC_ICELAND

public static final int CP_MAC_ICELAND

Codepage for Macintosh Iceland (Java: MacIceland)

See Also:

Constant Field Values

CP_MAC_TURKISH

public static final int CP_MAC_TURKISH

Codepage for Macintosh Turkish (Java: MacTurkish)

See Also:

Constant Field Values

CP_MAC_CROATIAN

public static final int CP_MAC_CROATIAN

Codepage for Macintosh Croatian (Java: MacCroatian)

See Also:

Constant Field Values

CP_US_ACSII

public static final int CP_US_ACSII

Codepage for US-ASCII

See Also:

Constant Field Values

CP_KOI8_R

public static final int CP_KOI8_R

Codepage for KOI8-R

See Also:

Constant Field Values

CP_ISO_8859_1

public static final int CP_ISO_8859_1

Codepage for ISO-8859-1

See Also:

Constant Field Values

CP_ISO_8859_2

public static final int CP_ISO_8859_2

Codepage for ISO-8859-2

See Also:

Constant Field Values

CP_ISO_8859_3

public static final int CP_ISO_8859_3

Codepage for ISO-8859-3

See Also:

Constant Field Values

CP_ISO_8859_4

public static final int CP_ISO_8859_4

Codepage for ISO-8859-4

See Also:

Constant Field Values

CP_ISO_8859_5

public static final int CP_ISO_8859_5

Codepage for ISO-8859-5

See Also:

Constant Field Values

CP_ISO_8859_6

public static final int CP_ISO_8859_6

Codepage for ISO-8859-6

See Also:

Constant Field Values

CP_ISO_8859_7

public static final int CP_ISO_8859_7

Codepage for ISO-8859-7

See Also:

Constant Field Values

CP_ISO_8859_8

public static final int CP_ISO_8859_8

Codepage for ISO-8859-8

See Also:

Constant Field Values

CP_ISO_8859_9

public static final int CP_ISO_8859_9

Codepage for ISO-8859-9

See Also:

Constant Field Values

CP_ISO_2022_JP1

public static final int CP_ISO_2022_JP1

Codepage for ISO-2022-JP

See Also:

Constant Field Values

CP_ISO_2022_JP2

public static final int CP_ISO_2022_JP2

Another codepage for ISO-2022-JP

See Also:

Constant Field Values

CP_ISO_2022_JP3

public static final int CP_ISO_2022_JP3

Yet another codepage for ISO-2022-JP

See Also:

Constant Field Values

CP_ISO_2022_KR

public static final int CP_ISO_2022_KR

Codepage for ISO-2022-KR

See Also:

Constant Field Values

CP_EUC_JP

public static final int CP_EUC_JP

Codepage for EUC-JP

See Also:

Constant Field Values

CP_EUC_KR

public static final int CP_EUC_KR

Codepage for EUC-KR

See Also:

Constant Field Values

CP_GB2312

public static final int CP_GB2312

Codepage for GB2312

See Also:

Constant Field Values

CP_GB18030

public static final int CP_GB18030

Codepage for GB18030

See Also:

Constant Field Values

CP_US_ASCII2

public static final int CP_US_ASCII2

Another codepage for US-ASCII

See Also:

Constant Field Values

CP_UTF8

public static final int CP_UTF8

Codepage for UTF-8

See Also:

Constant Field Values

CP_UNICODE

public static final int CP_UNICODE

Codepage for Unicode

See Also:

Constant Field Values

Constructor Detail

CodePageUtil

public CodePageUtil()

Method Detail

getBytesInCodePage

public static byte[] getBytesInCodePage(java.lang.String string,
                        int codepage)
                                 throws java.io.UnsupportedEncodingException

Converts a string into bytes, in the equivalent character encoding
  to the supplied codepage number.

Parameters:

string - The string to convert

codepage - The codepage number

Throws:

java.io.UnsupportedEncodingException

getStringFromCodePage

public static java.lang.String getStringFromCodePage(byte[] string,
                                     int codepage)
                                              throws java.io.UnsupportedEncodingException

Converts the bytes into a String, based on the equivalent character encoding
  to the supplied codepage number.

Parameters:

string - The byte of the string to convert

codepage - The codepage number

Throws:

java.io.UnsupportedEncodingException

getStringFromCodePage

public static java.lang.String getStringFromCodePage(byte[] string,
                                     int offset,
                                     int length,
                                     int codepage)
                                              throws java.io.UnsupportedEncodingException

Converts the bytes into a String, based on the equivalent character encoding
  to the supplied codepage number.

Parameters:

string - The byte of the string to convert

codepage - The codepage number

Throws:

java.io.UnsupportedEncodingException

codepageToEncoding

public static java.lang.String codepageToEncoding(int codepage)
                                           throws java.io.UnsupportedEncodingException

Turns a codepage number into the equivalent character encoding's
 name (in Java NIO canonical naming format).

Parameters:

codepage - The codepage number

Returns:

The character encoding's name. If the codepage number is 65001,
 the encoding name is "UTF-8". All other positive numbers are mapped to
 their Java NIO names, normally either "windows-" followed by the number,
 eg "windows-1251", or "cp" followed by the number, e.g. if the codepage
 number is 1252 the returned character encoding name will be "cp1252".

Throws:

java.io.UnsupportedEncodingException - if the specified codepage is
 less than zero.

codepageToEncoding

public static java.lang.String codepageToEncoding(int codepage,
                                  boolean javaLangFormat)
                                           throws java.io.UnsupportedEncodingException

Turns a codepage number into the equivalent character encoding's
 name, in either Java NIO or Java Lang canonical naming.

Parameters:

codepage - The codepage number

javaLangFormat - Should Java Lang or Java NIO naming be used?

Returns:

The character encoding's name, in either Java Lang format
  (eg Cp1251, ISO8859_5) or Java NIO format (eg windows-1252, ISO-8859-9)

Throws:

java.io.UnsupportedEncodingException - if the specified codepage is
 less than zero.

See Also:

Supported Encodings

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

                Copyright 2014 The Apache Software Foundation or
        its licensors, as applicable.


text:
KEYWORDS_ATLANTA="Atlanta"
KEYWORDS_ATLANTA_EXCLUDE="Atlanta(| )Braves"
KEYWORDS_ATHENSGEORGIA="Athens(,|)(| )Georgia"
KEYWORDS_GEORGIA="Georgia|, GA\b"
KEYWORDS_GEORGIA_EXCLUDE="(Country|Republic)(| )of(| )Georgia|$KEYWORDS_ATLANTA|$KEYWORDS_ATHENSGEORGIA"
KEYWORDS_GEORGIA_ALL="$KEYWORDS_GEORGIA|$KEYWORDS_ATLANTA|$KEYWORDS_ATHENSGEORGIA"

if [ "$1" == "" ];
then

  debug_start "Georgia"

  GEORGIA=$(egrep -i "$KEYWORDS_GEORGIA" "$NEWPAGES" | egrep -iv "$KEYWORDS_GEORGIA_EXCLUDE")
  ATLANTA=$(egrep -i "$KEYWORDS_ATLANTA" "$NEWPAGES" | egrep -iv "$KEYWORDS_ATLANTA_EXCLUDE")
  ATHENSGEORGIA=$(egrep -i "$KEYWORDS_ATHENSGEORGIA" "$NEWPAGES")

  categorize "GEORGIA" "Georgia"
  categorize "ATLANTA" "Atlanta"
  categorize "ATHENSGEORGIA" "Athens, Georgia"

  debug_end "Georgia"

fi


text:
module Azure end
module Azure::CognitiveServices end
module Azure::CognitiveServices::AnomalyDetector end
module Azure::CognitiveServices::AnomalyDetector::V1_0 end


text:
package com.crawljax.core;

import com.codahale.metrics.MetricRegistry;
import com.crawljax.browser.EmbeddedBrowser;
import com.crawljax.condition.browserwaiter.WaitConditionChecker;
import com.crawljax.core.configuration.CrawljaxConfiguration;
import com.crawljax.core.plugin.Plugins;
import com.crawljax.core.state.*;
import com.crawljax.core.state.Identification.How;
import com.crawljax.di.CoreModule.CandidateElementExtractorFactory;
import com.crawljax.di.CoreModule.FormHandlerFactory;
import com.crawljax.di.CoreModule.TrainingFormHandlerFactory;
import com.crawljax.forms.FormHandler;
import com.crawljax.forms.FormInput;
import com.crawljax.forms.TrainingFormHandler;
import com.crawljax.oraclecomparator.StateComparator;
import com.google.common.collect.ImmutableList;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.*;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import javax.inject.Provider;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

import static org.junit.Assert.fail;
import static org.mockito.Mockito.*;

/**
 * Test class for the Crawler testing.
 */
// @RunWith(MockitoJUnitRunner.Silent.class)
@RunWith(PowerMockRunner.class)
@PrepareForTest({ StateMachine.class, Crawler.class })
public class CrawlerTest {

	private URI url;

	private String strippedDom;

	private Crawler crawler;

	private StateMachine sm;

	@Mock
	private EmbeddedBrowser browser;

	@Spy
	private Plugins plugins = new Plugins(
			CrawljaxConfiguration.builderFor("http://localhost").build(), new MetricRegistry());

	@Mock
	private Provider<CrawlSession> sessionProvider;

	@Mock
	private CrawlSession session;

	private StateComparator stateComparator;

	@Mock
	private FormHandler formHandler;

	@Mock
	private TrainingFormHandler trainingFormHandler;

	@Mock
	private WaitConditionChecker waitConditionChecker;

	@Mock
	private CandidateElementExtractor extractor;

	@Mock
	private UnfiredCandidateActions candidateActionCache;

	@Mock
	private StateVertex index;

	@Mock
	private StateVertex target;

	@Mock
	private InMemoryStateFlowGraph graph;

	@Mock
	private Provider<InMemoryStateFlowGraph> graphProvider;

	@Mock
	private Eventable eventToTransferToTarget;

	@Captor
	private ArgumentCaptor<List<FormInput>> formInputsCaptor;

	@Mock
	private CandidateElement action;

	@Mock
	private ExitNotifier exitNotifier;

	private CrawlerContext context;

	@Before
	public void setup() {
		CandidateElementExtractorFactory elementExtractor =
				mock(CandidateElementExtractorFactory.class);
		when(elementExtractor.newExtractor(browser)).thenReturn(extractor);
		FormHandlerFactory formHandlerFactory = mock(FormHandlerFactory.class);
		when(formHandlerFactory.newFormHandler(browser)).thenReturn(formHandler);
		TrainingFormHandlerFactory trainingFormHandlerFactory =
				mock(TrainingFormHandlerFactory.class);
		when(trainingFormHandlerFactory.newTrainingFormHandler(browser))
				.thenReturn(trainingFormHandler);
		url = URI.create("http://example.com");

		strippedDom = "
Hello
";

		when(browser.getCurrentUrl()).thenReturn(url.toString());
		when(browser.getStrippedDom()).thenReturn(strippedDom);
		when(sessionProvider.get()).thenReturn(session);

		CrawljaxConfiguration config = Mockito.spy(CrawljaxConfiguration.builderFor(url).build());
		stateComparator = new StateComparator(config.getCrawlRules());

		when(extractor.extract(target)).thenReturn(ImmutableList.of(action));
		when(graphProvider.get()).thenReturn(graph);

		context = new CrawlerContext(browser, config, sessionProvider, exitNotifier,
				new MetricRegistry());
		crawler = new Crawler(context, config, stateComparator, candidateActionCache,
				formHandlerFactory, null, waitConditionChecker, elementExtractor, graphProvider,
				plugins, new DefaultStateVertexFactory());

		when(candidateActionCache.pollActionOrNull(index)).thenReturn(null);
		setupStateFlowGraph();
		setStateMachineForConfig(config);

	}

	private void setupStateFlowGraph() {
		when(index.getId()).thenReturn(1);
		when(index.getName()).thenReturn("Index");
		when(index.toString()).thenReturn("index");
		when(target.getId()).thenReturn(2);
		when(target.getName()).thenReturn("State 2");
		when(target.toString()).thenReturn("target");
		when(target.equals(target)).thenReturn(true);
		when(target.equals(index)).thenReturn(false);
		when(index.equals(index)).thenReturn(true);
		when(index.equals(target)).thenReturn(false);

		when(eventToTransferToTarget.getIdentification())
				.thenReturn(new Identification(How.name, "//DIV[@id='click]"));
		when(eventToTransferToTarget.getRelatedFrame()).thenReturn("");
		when(eventToTransferToTarget.getSourceStateVertex()).thenReturn(index);
		when(eventToTransferToTarget.getTargetStateVertex()).thenReturn(target);
		when(eventToTransferToTarget.getRelatedFormInputs())
				.thenReturn(new CopyOnWriteArrayList<>());
		when(graph.getShortestPath(index, target))
				.thenReturn(ImmutableList.of(eventToTransferToTarget));
		when(graph.getInitialState()).thenReturn(index);
		when(session.getStateFlowGraph()).thenReturn(graph);
		when(session.getInitialState()).thenReturn(index);

		when(graph.canGoTo(index, target)).thenReturn(true);
		when(graph.putIfAbsent(index)).thenReturn(index);
	}

	private void setStateMachineForConfig(CrawljaxConfiguration config) {
		sm = PowerMockito.mock(StateMachine.class);
		List<StateVertex> onURLSet = new ArrayList<>();
		onURLSet.add(index);
		try {
			PowerMockito.whenNew(StateMachine.class)
					.withAnyArguments()
					.thenReturn(sm);

			when(sm.getStateFlowGraph()).thenReturn(graph);
			when(sm.getCurrentState()).thenReturn(index, index, target);
			when(sm.changeState(Mockito.any())).thenReturn(true);
			when(sm.newStateFor(Mockito.any())).thenReturn(index);
		} catch (Exception e) {
			fail(e.getMessage());
		}
	}

	@Test
	public void whenResetTheStateIsBackToIndex() {
		crawler.reset();
		verifyCrawlerReset(inOrder(plugins, browser));
	}

	private void verifyCrawlerReset(InOrder order) {
		order.verify(browser).goToUrl(url);
		order.verify(plugins).runOnUrlLoadPlugins(context);
	}

	@Test
	public void whenExecuteTaskTheCrawlIsCompletedCorrectly() throws Exception {
		when(extractor.checkCrawlCondition()).thenReturn(true);
		when(browser.fireEventAndWait(eventToTransferToTarget)).thenReturn(true);

		crawler.execute(target);
		InOrder order = inOrder(extractor, browser, formHandler, plugins, waitConditionChecker,
				candidateActionCache);
		verifyPathIsFollowed(order);
	}

	private void verifyPathIsFollowed(InOrder order) {
		verifyCrawlerReset(order);
		order.verify(extractor).checkCrawlCondition();
		verifyFormElementsChecked(order);
		order.verify(waitConditionChecker).wait(browser);
		order.verify(browser).closeOtherWindows();
		order.verify(plugins).runOnRevisitStatePlugins(context, target);
		order.verify(extractor).checkCrawlCondition();
		order.verify(candidateActionCache).pollActionOrNull(target);
	}

	private void verifyFormElementsChecked(InOrder order) {
		order.verify(formHandler).getFormInputs();
		order.verify(formHandler).handleFormElements(formInputsCaptor.capture());
		formInputsCaptor.getValue().isEmpty();
	}
}


text:
package io.fabric8.zookeeper.utils;

import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.cache.ChildData;
import org.apache.curator.framework.recipes.cache.TreeCache;
import org.apache.curator.utils.ZKPaths;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.data.Stat;

import io.fabric8.zookeeper.ZkPath;

import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;

public final class ZooKeeperUtils {

    private static final Charset UTF_8 = Charset.forName("UTF-8");
    private static final String CONTAINERS_NODE = "/fabric/authentication/containers";

    private ZooKeeperUtils() {
        //Utility Class
    }

    public static void copy(CuratorFramework source, CuratorFramework dest, String path) throws Exception {
        for (String child : source.getChildren().forPath(path)) {
            child = ZKPaths.makePath(path, child);
            Stat stat = source.checkExists().forPath(child);
            if (stat != null && stat.getEphemeralOwner() == 0 && dest.checkExists().forPath(child) == null) {
                byte[] data = source.getData().forPath(child);
                setData(dest, child, data);
                copy(source, dest, child);
            }
        }
    }

    public static void copy(CuratorFramework curator, String from, String to) throws Exception {
        for (String child : curator.getChildren().forPath(from)) {
            String fromChild = from + "/" + child;
            String toChild = to + "/" + child;
            if (curator.checkExists().forPath(toChild) == null) {
                byte[] data = curator.getData().forPath(fromChild);
                setData(curator, toChild, data);
                copy(curator, fromChild, toChild);
            }
        }
    }

    public static void add(CuratorFramework curator, String path, String value) throws Exception {
        if (curator.checkExists().forPath(path) == null) {
            curator.setData().forPath(path, value != null ? value.getBytes(UTF_8) : null);
        } else {
            String data = getStringData(curator, path);
            if (data == null) {
                data = "";
            }
            if (data.length() > 0) {
                data += " ";
            }
            data += value;
            curator.setData().forPath(path, data.getBytes(UTF_8));
        }
    }

    public static void remove(CuratorFramework curator, String path, String value) throws Exception {
        if (curator.checkExists().forPath(path) != null) {
            List<String> parts = new LinkedList<String>();
            String data = getStringData(curator, path);
            if (data != null) {
                parts = new ArrayList<String>(Arrays.asList(data.trim().split(" +")));
            }
            boolean changed = false;
            StringBuilder sb = new StringBuilder();
            for (Iterator<String> it = parts.iterator(); it.hasNext(); ) {
                String v = it.next();
                if (v.matches(value)) {
                    it.remove();
                    changed = true;
                }
            }
            if (changed) {
                sb.delete(0, sb.length());
                for (String part : parts) {
                    if (sb.length() > 0) {
                        sb.append(" ");
                    }
                    sb.append(part);
                }
                setData(curator, path, sb.toString());
            }
        }
    }

    public static List<String> getChildren(CuratorFramework curator, String path) throws Exception {
        return curator.getChildren().forPath(path);
    }

    /**
     * Returns an empty list if the given path doesn't exist in curator
     */
    public static List<String> getChildrenSafe(CuratorFramework curator, String path) throws Exception {
        boolean pathExists = curator.checkExists().forPath(path) != null;
        return pathExists ? curator.getChildren().forPath(path) : Collections.<String>emptyList();
    }

    public static List<String> getChildren(TreeCache cache, String path) throws Exception {
        return cache.getChildrenNames(path);
    }

    public static List<String> getAllChildren(CuratorFramework curator, String path) throws Exception {
        List<String> children = getChildren(curator, path);
        List<String> allChildren = new ArrayList<String>();
        for (String child : children) {
            String fullPath = ZKPaths.makePath(path, child);
            allChildren.add(fullPath);
            allChildren.addAll(getAllChildren(curator, fullPath));
        }
        return allChildren;
    }

    public static List<String> getAllChildren(TreeCache cache, String path) throws Exception {
        List<String> children = getChildren(cache, path);
        List<String> allChildren = new ArrayList<String>();
        for (String child : children) {
            String fullPath = ZKPaths.makePath(path, child);
            allChildren.add(fullPath);
            allChildren.addAll(getAllChildren(cache, fullPath));
        }
        return allChildren;
    }

    public static byte[] getByteData(TreeCache cache, String path) throws Exception {
        ChildData cacheData = cache.getCurrentData(path);
        if (cacheData != null) {
            return cacheData.getData();
        } else {
            return null;
        }
    }

    public static String getStringData(TreeCache cache, String path) throws Exception {
        byte[] data = getByteData(cache, path);
        if (data == null) {
            return null;
        } else {
            return new String(data, UTF_8);
        }
    }

    public static String getStringData(CuratorFramework curator, String path) throws Exception {
        return getStringData(curator, path, null);
    }

    public static String getStringData(CuratorFramework curator, String path, Watcher watcher) throws Exception {
        byte[] bytes = watcher != null ? curator.getData().usingWatcher(watcher).forPath(path) : curator.getData().forPath(path);
        if (bytes == null) {
            return null;
        } else {
            return new String(bytes, UTF_8);
        }
    }

    public static String getStringDataSafe(CuratorFramework curator, String path) throws Exception {
        byte[] bytes = getData(curator, path);
        if (bytes == null) {
            return null;
        } else {
            return new String(bytes, UTF_8);
        }
    }

    /**
     * Returns the data for the given path or null if it doesn not exist
     */
    public static byte[] getData(CuratorFramework curator, String path) throws Exception {
        if (curator.checkExists().forPath(path) != null) {
            return curator.getData().forPath(path);
        }
        return null;
    }

    public static void setData(CuratorFramework curator, String path, String value) throws Exception {
        setData(curator, path, value != null ? value.getBytes(UTF_8) : null);
    }

    public static void setData(CuratorFramework curator, String path, byte[] value) throws Exception {
        if (curator.checkExists().forPath(path) == null) {
            curator.create().creatingParentsIfNeeded().forPath(path, value != null ? value : null);
        }
        curator.setData().forPath(path, value != null ? value : null);
    }

    public static void setData(CuratorFramework curator, String path, String value, CreateMode createMode) throws Exception {
        setData(curator, path, value != null ? value.getBytes(UTF_8) : null, createMode);
    }

    public static void setData(CuratorFramework curator, String path, byte[] value, CreateMode createMode) throws Exception {
        if (curator.checkExists().forPath(path) == null) {
            curator.create().creatingParentsIfNeeded().withMode(createMode).forPath(path, value != null ? value : null);
        }
        curator.setData().forPath(path, value != null ? value : null);
    }

    public static void create(CuratorFramework curator, String path) throws Exception {
        create(curator, path, CreateMode.PERSISTENT);
    }

    public static String create(CuratorFramework curator, String path, CreateMode createMode) throws Exception {
        return create(curator, path, (byte[]) null, createMode);
    }

    public static String create(CuratorFramework curator, String path, String data, CreateMode createMode) throws Exception {
        return create(curator, path, data != null ? data.getBytes(UTF_8) : null, createMode);
    }

    public static String create(CuratorFramework curator, String path, byte[] data, CreateMode createMode) throws Exception {
        return curator.create().creatingParentsIfNeeded().withMode(createMode).forPath(path, data);
    }

    public static void createDefault(CuratorFramework curator, String path, String value) throws Exception {
        if (curator.checkExists().forPath(path) == null) {
            curator.create().creatingParentsIfNeeded().forPath(path, value != null ? value.getBytes(UTF_8) : null);
        }
    }

    public static void deleteSafe(CuratorFramework curator, String path) throws Exception {
        if (curator.checkExists().forPath(path) != null) {
            for (String child : curator.getChildren().forPath(path)) {
                deleteSafe(curator, path + "/" + child);
            }
            try {
                curator.delete().forPath(path);
            } catch (KeeperException.NotEmptyException ex) {
                deleteSafe(curator, path);
            }
        }
    }

    public static void delete(CuratorFramework curator, String path) throws Exception {
        curator.delete().forPath(path);
    }

    public static Stat exists(CuratorFramework curator, String path) throws Exception {
        return curator.checkExists().forPath(path);
    }

    public static Properties getProperties(CuratorFramework curator, String path, Watcher watcher) throws Exception {
        String value = getStringData(curator, path, watcher);
        Properties properties = new Properties();
        if (value != null) {
            try {
                properties.load(new StringReader(value));
            } catch (IOException ignore) {
            }
        }
        return properties;
    }

    public static Map<String, String> getPropertiesAsMap(CuratorFramework curator, String path) throws Exception {
        Properties properties = getProperties(curator, path);
        Map<String, String> map = new HashMap<String, String>();
        for (String key : properties.stringPropertyNames()) {
            map.put(key, properties.getProperty(key));
        }
        return map;
    }

    public static Map<String, String> getPropertiesAsMap(TreeCache cache, String path) throws Exception {
        Properties properties = getProperties(cache, path);
        Map<String, String> map = new HashMap<String, String>();
        for (String key : properties.stringPropertyNames()) {
            map.put(key, properties.getProperty(key));
        }
        return map;
    }

    public static Properties getProperties(CuratorFramework curator, String path) throws Exception {
        String value = getStringDataSafe(curator, path);
        Properties properties = new Properties();
        if (value != null) {
            try {
                properties.load(new StringReader(value));
            } catch (IOException ignore) {
            }
        }
        return properties;
    }

    public static Properties getProperties(TreeCache cace, String path) throws Exception {
        String value = getStringData(cace, path);
        Properties properties = new Properties();
        if (value != null) {
            try {
                properties.load(new StringReader(value));
            } catch (IOException ignore) {
            }
        }
        return properties;
    }
       /*

    public static void setPropertiesAsMap(CuratorFramework curator, String path, Map<String, String> map) throws Exception {
        Properties properties = new Properties();
        for (String key : map.keySet()) {
            properties.put(key, map.get(key));
        }
        setProperties(curator, path, properties);
    }

    public static void setProperties(CuratorFramework curator, String path, Properties properties) throws Exception {
        try {
            org.apache.felix.utils.properties.Properties p = new org.apache.felix.utils.properties.Properties();
            if(curator.checkExists().forPath(path) == null){
                create(curator, path);
            }
            String org = getStringData(curator, path);
            if (org != null) {
                p.load(new StringReader(org));
            }
            List<String> keys = new ArrayList<String>();
            for (String key : properties.stringPropertyNames()) {
                p.put(key, properties.getProperty(key));
                keys.add(key);
            }
            List<String> deleted = new ArrayList<String>(p.keySet());
            deleted.removeAll(keys);
            for (String key : deleted) {
                p.remove(key);
            }
            StringWriter writer = new StringWriter();
            p.save(writer);
            setData(curator, path, writer.toString());
        } catch (IOException e) {
            // ignore
        }
    }
*/

    public static String getSubstitutedPath(final CuratorFramework curator, String path) throws Exception {
        String normalized = path != null && path.contains("#") ? path.substring(0, path.lastIndexOf('#')) : path;
        if (normalized != null && exists(curator, normalized) != null) {
            byte[] data = ZkPath.loadURL(curator, path);
            if (data != null && data.length > 0) {
                String str = new String(ZkPath.loadURL(curator, path), "UTF-8");
                return getSubstitutedData(curator, str);
            }
        }
        return null;
    }

    public static String getSubstitutedData(final CuratorFramework curator, String data) throws URISyntaxException {
        if (data == null) {
            return null;
        }
        Map<String, String> props = new HashMap<String, String>();
        props.put("data", data);

        InterpolationHelper.performSubstitution(props, new InterpolationHelper.SubstitutionCallback() {
            @Override
            public String getValue(String key) {
                if (key.startsWith("zk:")) {
                    try {
                        return new String(ZkPath.loadURL(curator, key), "UTF-8");
                    } catch (Exception e) {
                        //ignore and just return null.
                    }
                }
                return null;
            }
        });
        return props.get("data");
    }

    /**
     * Generate a random String that can be used as a Zookeeper password.
     */
    public static String generatePassword() {
        StringBuilder password = new StringBuilder();
        for (int i = 0; i < 16; i++) {
            long l = Math.round(Math.floor(Math.random() * (26 * 2 + 10)));
            if (l < 10) {
                password.append((char) ('0' + l));
            } else if (l < 36) {
                password.append((char) ('A' + l - 10));
            } else {
                password.append((char) ('a' + l - 36));
            }
        }
        return password.toString();
    }

    /**
     * Returns the last modified time of the znode taking children into consideration.
     */
    public static long lastModified(CuratorFramework curator, String path) throws Exception {
        long lastModified = 0;
        List<String> children = getChildren(curator, path);
        if (children.isEmpty()) {
            return exists(curator, path).getMtime();
        } else {
            for (String child : children) {
                lastModified = Math.max(lastModified(curator, path + "/" + child), lastModified);
            }
        }
        return lastModified;
    }

    public static boolean isContainerLogin(String login) {
        return login.startsWith("container#");
    }

    public static Properties getContainerTokens(CuratorFramework curator) throws Exception {
        Properties props = new Properties();
        if (exists(curator, CONTAINERS_NODE) != null) {
            for (String key : getChildren(curator, CONTAINERS_NODE)) {
                props.setProperty("container#" + key, getStringData(curator, CONTAINERS_NODE + "/" + key));
            }
        }
        return props;
    }

    private static volatile long lastTokenGenerationTime = 0;

    /*public static String generateContainerToken(RuntimeProperties sysprops, CuratorFramework curator) {
        String container = sysprops.getRuntimeIdentity();
        long time = System.currentTimeMillis();
        String password = null;
        try {
            if (time - lastTokenGenerationTime < 60 * 1000) {
                try {
                    password = getStringData(curator, CONTAINERS_NODE + "/" + container);
                } catch (KeeperException.NoNodeException ex) {
                    //Node hasn't been created yet. It's safe to ignore.
                }
            }
            if (password == null) {
                password = generatePassword();
                setData(curator, CONTAINERS_NODE + "/" + container, password);
                lastTokenGenerationTime = time;
            }
        } catch (KeeperException.NotReadOnlyException e) {
            throw new FabricException("ZooKeeper server is partitioned. Currently working in read-only mode!");
        } catch (RuntimeException rte) {
            throw rte;
        } catch (Exception ex) {
            throw new IllegalStateException("Cannot generate container token", ex);
        }
        return password;
    }*/

}


text:
<Record>
<Term>Vision Disorders</Term>
<SemanticType>Disease or Syndrome</SemanticType>
<SemanticType>Sign or Symptom</SemanticType>
<ParentTerm>Sensation Disorders</ParentTerm>
<ParentTerm>Eye Diseases</ParentTerm>
<ClassificationPath>Pathological Conditions, Signs and Symptoms/Signs and Symptoms/Neurologic Manifestations/Sensation Disorders/Vision Disorders</ClassificationPath>
<ClassificationPath>Nervous System Diseases/Neurologic Manifestations/Sensation Disorders/Vision Disorders</ClassificationPath>
<ClassificationPath>Eye Diseases/Vision Disorders</ClassificationPath>
<BroaderTerm>Neurologic Manifestations</BroaderTerm>
<BroaderTerm>Signs and Symptoms</BroaderTerm>
<BroaderTerm>Pathological Conditions, Signs and Symptoms</BroaderTerm>
<BroaderTerm>Vision Disorders</BroaderTerm>
<BroaderTerm>Nervous System Diseases</BroaderTerm>
<BroaderTerm>Sensation Disorders</BroaderTerm>
<BroaderTerm>Eye Diseases</BroaderTerm>
<ChildTerm>Amblyopia</ChildTerm>
<ChildTerm>Color Vision Defects</ChildTerm>
<ChildTerm>Night Blindness</ChildTerm>
<ChildTerm>Hemianopsia</ChildTerm>
<ChildTerm>Susac Syndrome</ChildTerm>
<ChildTerm>Vision, Low</ChildTerm>
<ChildTerm>Scotoma</ChildTerm>
<ChildTerm>Photophobia</ChildTerm>
<ChildTerm>Blindness</ChildTerm>
<ChildTerm>Diplopia</ChildTerm>
<Synonym>Metamorphopsia</Synonym>
<Synonym>Vision Disorder</Synonym>
<Synonym>Macropsia</Synonym>
<Synonym>Vision Disorders</Synonym>
<Synonym>Day Blindness</Synonym>
<Synonym>Hemeralopia</Synonym>
<Synonym>Macropsias</Synonym>
<Synonym>Micropsias</Synonym>
<Synonym>Metamorphopsias</Synonym>
<Synonym>Hemeralopias</Synonym>
<Synonym>Micropsia</Synonym>
<Description>Visual impairments limiting one or more of the basic functions of the eye: visual acuity, dark adaptation, color vision, or peripheral vision. These may result from EYE DISEASES; OPTIC NERVE DISEASES; VISUAL PATHWAY diseases; OCCIPITAL LOBE diseases; OCULAR MOTILITY DISORDERS; and other conditions. Visual disability refers to inability of the individual to perform specific visual tasks, such as reading, writing, orientation, or traveling unaided. (From Newell, Ophthalmology: Principles and Concepts, 7th ed, p132)</Description>
<Source>MeSH</Source>
</Record>


text:
<?php

RequestHandler::respond('resources');


text:
'use strict';

angular.module('mean.system')
    .controller('HeaderController', ['$scope', 'Upload', '$rootScope', 'Global', 'Menus',
        function ($scope, Upload, $rootScope, Global, Menus) {
            $scope.global = Global;
            $scope.menus = {};
            $rootScope.constants = {
                max: {
                    teams: 3,
                    backgrounds_colours: 6,
                    fonts_colours: 6,
                    borders_colours: 6,
                    overlays_colours: 6,
                    fonts: 12,
                    borders: 12,
                    overlays: 6
                }
            };

            // Default hard coded menu items for main menu
            var defaultMainMenu = [];

            // Query menus added by modules. Only returns menus that user is allowed to see.
            function queryMenu(name, defaultMenu) {
                Menus.query({
                    name: name,
                    defaultMenu: defaultMenu
                }, function (menu) {
                    $scope.menus[name] = menu;
                });
            }

            // Query server for menus and check permissions
            queryMenu('main', defaultMainMenu);
            queryMenu('account', []);

            $scope.isCollapsed = false;

            $rootScope.$on('loggedin', function () {

                queryMenu('main', defaultMainMenu);

                $scope.global = {
                    authenticated: !!$rootScope.user,
                    user: $rootScope.user
                };
            });

            $scope.upload = function (files) {
                if (files && files.length) {
                    var sucess = function(data, status, headers, config){
                            $scope.global.teamActive.logo = data.file.filename;
                            $scope.global.teamActive.$update();
                        };
                    for (var i = 0; i < files.length; i = i + 1) {
                        var file = files[i];
                        Upload
                            .upload({
                                url: '/upload',
                                fields: {'dest': '/upload/' + $scope.global.teamActive._id + '/', delete: $scope.global.teamActive.logo},
                                file: file
                            })
                            .success(sucess);
                    }
                }
            };
        }
    ])
    .controller('TeamsController', ['$scope', '$rootScope', '$location', 'Global', 'Teams', 'Settings',
        function ($scope, $rootScope, $location, Global, Teams, Settings) {
            $scope.global = Global;
            $rootScope.teams = [];
            $scope.team = {};

            $scope.init = function () {
                Teams.query(function (teams) {
                    $rootScope.teams = teams;
                    if($scope.teams.length){
                        $scope.changeTeamActive($scope.teams[0]);
                    }
                    else{
                        for (var i in $scope.teams) {
                            if($scope.teams[i] === $scope.global.user.lastTeamAccessed){
                                $scope.changeTeamActive($scope.teams[i]);
                            }
                        }
                    }
                });
            };

            $scope.remove = function (team) {
                if (team) {
                    team.$remove(function (response) {
                        for (var i in $scope.teams) {
                            if ($scope.teams[i] === team) {
                                $scope.teams.splice(i, 1);
                                if($scope.teams.length){
                                    if(team === $scope.global.teamActive){
                                        $scope.changeTeamActive($scope.teams[0]);
                                    }
                                }
                                else{
                                    delete $scope.global.teamActive;
                                    $location.url('/');
                                    $scope.$apply();
                                }
                            }
                        }
                    });
                }
            };

            $scope.create = function (isValid) {
                if (isValid && $scope.teams.length < $scope.constants.max.teams) {
                    new Settings().$save(function(response){
                        var team = new Teams({
                            name: $scope.team.name,
                            settings: response._id
                        });
                        team.$save(function (response) {
                            $scope.teams.push(response);
                            $scope.changeTeamActive(response);
                            $scope.team.name = '';
                        });
                    });
                } else {
                    $scope.submitted = true;
                }
            };

            $rootScope.changeTeamActive = function (team){
                $scope.global.teamActive = team;
                Settings.get({
                    settingId: typeof team.settings === 'object' ? team.settings._id : team.settings
                }, function (settings) {
                    $scope.global.teamActive.settings = settings;
                });
            };
        }
    ]);


text:
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (c) 2015, Abhishek Dabholkar
  ~ All rights reserved.
  ~
  ~ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  ~
  ~ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  ~
  ~ 2. 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.
  ~
  ~ 3. Neither the name of the copyright holder 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.
  -->

<resources>

    <attr name="colorDrawerIcon" format="reference|color" />
    <attr name="colorDrawerText" format="reference|color" />
    <attr name="colorCardBackground" format="reference|color" />
    <attr name="colorDivider" format="reference|color" />

    <attr name="drawableDrawerActivatedBackground" format="reference" />

    <attr name="drawableLatestIssue" format="reference" />
    <attr name="drawableArchive" format="reference" />
    <attr name="drawableFavoriteOutline" format="reference" />
    <attr name="drawableFavorite" format="reference" />
    <attr name="drawableStatistics" format="reference" />
    <attr name="drawableSettings" format="reference" />
    <attr name="drawableHelp" format="reference" />
    <attr name="drawableAbout" format="reference" />
    <attr name="drawableLogo" format="reference" />

    <declare-styleable name="animatedPathView">
        <attr name="strokeWidth" format="dimension" />
        <attr name="strokeColor" format="color|reference" />
        <attr name="fillColor" format="color|reference" />
        <attr name="phase" format="float" />
        <attr name="duration" format="integer" />
        <attr name="fillDuration" format="integer" />
        <attr name="fillOffset" format="integer" />
        <attr name="fadeFactor" format="float" />
        <attr name="svgPath" format="reference" />
    </declare-styleable>

</resources>


text:
package org.wso2.siddhi.core.query.selector.attribute.processor;

import org.wso2.siddhi.core.event.StreamEvent;

public interface NonGroupingAttributeProcessor extends AttributeProcessor {

    public Object process(StreamEvent event);

}


text:
module xlib.ui.element.adapters.browser.a {

  import IEvent = elements.IEvent;

  export class Element extends browser.Element implements element.elements.a.IElement<HTMLElement> {

    constructor(options?: element.elements.a.IOptions<HTMLElement>) {
      super(options);
      if (options && xlib.typeOf(options.title) !== "undefined") {
        this.setTitle(options.title);
      }
      if (options && xlib.typeOf(options.lang) !== "undefined") {
        this.setLang(options.lang);
      }
      if (options && xlib.typeOf(options.xmlLang) !== "undefined") {
        this.setXmlLang(options.xmlLang);
      }
      if (options && xlib.typeOf(options.dir) !== "undefined") {
        this.setDir(options.dir);
      }
      if (options && xlib.typeOf(options.accessKey) !== "undefined") {
        this.setAccessKey(options.accessKey);
      }
      if (options && xlib.typeOf(options.tabIndex) !== "undefined") {
        this.setTabIndex(options.tabIndex);
      }
      if (options && xlib.typeOf(options.charset) !== "undefined") {
        this.setCharset(options.charset);
      }
      if (options && xlib.typeOf(options.type) !== "undefined") {
        this.setType(options.type);
      }
      if (options && xlib.typeOf(options.name) !== "undefined") {
        this.setName(options.name);
      }
      if (options && xlib.typeOf(options.href) !== "undefined") {
        this.setHref(options.href);
      }
      if (options && xlib.typeOf(options.hrefLang) !== "undefined") {
        this.setHrefLang(options.hrefLang);
      }
      if (options && xlib.typeOf(options.rel) !== "undefined") {
        this.setRel(options.rel);
      }
      if (options && xlib.typeOf(options.rev) !== "undefined") {
        this.setRev(options.rev);
      }
      if (options && xlib.typeOf(options.shape) !== "undefined") {
        this.setShape(options.shape);
      }
      if (options && xlib.typeOf(options.coords) !== "undefined") {
        this.setCoords(options.coords);
      }
      if (options && xlib.typeOf(options.target) !== "undefined") {
        this.setTarget(options.target);
      }
      if (options && xlib.typeOf(options.download) !== "undefined") {
        this.setDownload(options.download);
      }
    }

    public attributesDeny(): string[] {
      // todo: adjust xml:lang
      return super.attributesDeny().concat(["title", "lang", "xml:lang", "dir", "accesskey", "tabindex", "charset", "type", "name", "href", "hreflang", "rel", "rev", "shape", "coords"]);
    }

    public attributesAllow(): string[] {
      return super.attributesAllow().concat(["title", "lang", "xml:lang", "dir", "accesskey", "tabindex", "charset", "type", "name", "href", "hreflang", "rel", "rev", "shape", "coords"]);
    }

    public allowChildren(): boolean {
      return true;
    }

    public allowText(): boolean {
      return true;
    }

    public allowHtml(): boolean {
      return true;
    }

    public allowTags(): string[] {
      return ["abbr", "acronym", "b", "bdo", "big", "br", "button", "cite", "code", "del", "dfn", "em", "i", "img", "input", "ins", "kbd", "label", "map", "object", "q", "samp", "script", "select", "small", "span", "strong", "sub", "sup", "textarea", "tt", "var"];
    }

    public getTag(): string {
      return "a";
    }

    public getDownload(): boolean {
      var element: HTMLElement = this.element(),
        value: string = String(element.getAttribute("title") || "") || null;
      return element.hasAttribute("download") || value === "download";
    }

    public setDownload(value: boolean): void {
      var temp: boolean = xlib.isTrue(value),
        element: HTMLElement = this.element();
      if (!temp) {
        element.removeAttribute("download");
      } else {
        element.setAttribute("download", "download");
      }
    }

    public getTarget(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("title") || "").replace(/^_/, "") || null;
    }

    public setTarget(value: string): void {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("target");
      } else {
        if (["blank", "self", "parent", "top"].indexOf(temp) === -1) {
          throw new Error("bla bla bla");
        }
        element.setAttribute("target", "_" + temp);
      }
    }

    public getTitle(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("title") || "") || null;
    }

    public setTitle(value: string): void {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("title");
      } else {
        element.setAttribute("title", temp);
      }
    }

    public getLang(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("lang") || "") || null;
    }

    public setLang(value: string): void {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("lang");
      } else {
        element.setAttribute("lang", temp);
      }
    }

    public getXmlLang(): string {
      var element: HTMLElement = this.element();
      // todo: use element.getAttributeNs() !!!
      return String(element.getAttribute("xml:lang") || "") || null;
    }

    public setXmlLang(value: string) {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        // todo: use element.removeAttributeNS() !!!
        element.removeAttribute("xml:lang");
      } else {
        // todo: use element.setAttributeNS() !!!
        element.setAttribute("xml:lang", temp);
      }
    }

    public getDir(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("dir") || "") || null;
    }

    public setDir(value: string) {
      var temp: string = String(value || "").toLowerCase(),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("dir");
      } else {
        if (["ltr", "rtl"].indexOf(temp) === -1) {
          throw new Error("bla bla bla");
        }
        element.setAttribute("dir", temp);
      }
    }

    public getAccessKey(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("accesskey") || "") || null;
    }

    public setAccessKey(value: string): void {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("accesskey");
      } else {
        if (!/^[a-z0-9]$/.test(temp)) {
          throw new Error("bla bla bla");
        }
        element.setAttribute("accesskey", temp);
      }
    }

    public getTabIndex(): number {
      var element: HTMLElement = this.element();
      return parseInt(element.getAttribute("tabindex") || "0", 10) || 0;
    }

    public setTabIndex(value: number): void {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("tabindex");
      } else {
        if (!/^\d+$/.test(temp)) {
          throw new Error("bla bla bla");
        }
        element.setAttribute("tabindex", temp);
      }
    }

    public getCharset(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("charset") || "") || null;
    }

    public setCharset(value: string): void {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("tabindex");
      } else {
        element.setAttribute("tabindex", temp);
      }
    }

    public getType(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("type") || "") || null;
    }

    public setType(value) {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("type");
      } else {
        element.setAttribute("type", temp);
      }
    }

    public getName(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("name") || "") || null;
    }

    public setName(value: string): void {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("name");
      } else {
        element.setAttribute("name", temp);
      }
    }

    public getHref(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("href") || "") || null;
    }

    public setHref(value: string): void {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("href");
      } else {
        element.setAttribute("href", temp);
      }
    }

    public getHrefLang(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("hreflang") || "") || null;
    }

    public setHrefLang(value: string): void {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("hreflang");
      } else {
        element.setAttribute("hreflang", temp);
      }
    }

    public getRel(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("rel") || "") || null;
    }

    public setRel(value: string): void {
      var temp: string = String(value || "").toLowerCase(),
        element: HTMLElement = this.element(),
        values: string[] = ["pronunciation", "accessibility", "acquaintance",
          "admin", "ajax", "alternate", "answer", "application-manifest",
          "archives", "author", "bookmark", "canonical", "canonical-domain",
          "canonical-first", "canonical-human", "canonical-organization",
          "canonical-wwwnone", "chapter", "child", "co-resident", "co-worker",
          "colleague", "contact", "contributor", "crush", "date",
          "dns-prefetch", "edit", "edituri", "enclosure", "enlarged",
          "external", "extension", "first", "friend", "gallery", "glossary",
          "help", "hub", "i18nrules", "icon", "index", "jump", "kin", "last",
          "latest-version", "license", "login", "logout", "longdesc", "map",
          "me", "met", "meta", "muse", "neighbor", "next", "next-archive",
          "nofollow", "noreferrer", "noprefetch", "note", "openid.delegate",
          "openid.server", "openid2.local_id", "openid2.provider", "parent",
          "payment", "pgpkey", "pingback", "prefetch", "prerender", "presentation",
          "prev", "prev-archive", "print", "profile", "question", "related",
          "reply", "resource-package", "resources", "reviewer", "script",
          "search", "self", "service", "shortlink", "sibling", "sidebar",
          "spouse", "statechart", "stylesheet", "subresource", "sweetheart",
          "tag", "technicalauthor", "thread", "timesheet", "topic", "translatedfrom",
          "translator", "up", "us", "webmaster", "widget", "wlwmanifest"];
      if (temp === "") {
        element.removeAttribute("hreflang");
      } else {
        if (values.indexOf(temp) === -1) {
          throw new Error("bla bla bla");
        }
        element.setAttribute("rel", temp);
      }
    }

    public getRev(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("rev") || "") || null;
    }

    public setRev(value: string): void {
      var temp: string = String(value || ""),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("rev");
      } else {
        element.setAttribute("rev", temp);
      }
    }

    public getShape(): string {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("shape") || "") || null;
    }

    public setShape(value: string): void {
      var temp: string = String(value || "").toLowerCase(),
        element: HTMLElement = this.element();
      if (temp === "") {
        element.removeAttribute("hreflang");
      } else {
        if (["circle", "default", "poly", "rect"].indexOf(temp) === -1) {
          throw new Error("bla bla bla");
        }
        element.setAttribute("rel", temp);
      }
    }

    public getCoords(): number[] {
      var element: HTMLElement = this.element();
      return String(element.getAttribute("coords") || "").split(/\s*,\s*/).
        map((element: string) => {
          var value: number = parseFloat(element);
          if (isNaN(value)) {
            throw new Error("bla bla bla");
          }
          return parseFloat(element);
        });
    }

    public setCoords(value: number[]): void {
      var result: string[] = [],
        shape: string = this.getShape(),
        element: HTMLElement = this.element();
      // todo: adjust empty/null value
      if (xlib.typeOf(value) !== "array") {
        throw new Error("bla bla bla");
      }
      if (!element.hasAttribute("shape")) {
        throw new Error("bla bla bla");
      }
      if (["default", "rect"].indexOf(shape) !== -1 && value.length !== 4) {
        throw new Error("bla bla bla");
      }
      if (shape === "circle" && value.length !== 3) {
        throw new Error("bla bla bla");
      }
      if (shape === "poly" && !(value.length > 5 && value.length % 2 === 0)) {
        throw new Error("bla bla bla");
      }
      if (["circle", "default", "poly", "rect"].indexOf(shape) === -1) {
        throw new Error("bla bla bla");
      }
      value.forEach((element: number) => {
        var value: number = parseFloat(String(element));
        if (isNaN(value)) {
          throw new Error("bla bla bla");
        }
        result.push(String(value));
      });
      element.setAttribute("coords", result.join(", "));
    }

    public onClick(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("click", listener);
    }

    public onDblClick(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("dblclick", listener);
    }

    public onMouseDown(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("mousedown", listener);
    }

    public onMouseUp(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("mouseup", listener);
    }

    public onMouseOver(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("mouseover", listener);
    }

    public onMouseMove(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("mousemove", listener);
    }

    public onMouseOut(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("mouseout", listener);
    }

    public onKeyPress(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("mousepress", listener);
    }

    public onKeyDown(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("keydown", listener);
    }

    public onKeyUp(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("keyup", listener);
    }

    public onFocus(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("focus", listener);
    }

    public onFocusIn(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("focusin", listener);
    }

    public onFocusOut(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("focusout", listener);
    }

    public onBlur(listener: (event?: IEvent<HTMLElement>) => void): void {
      this.on("blur", listener);
    }

  }

}


text:
using RussellGroup.Pims.DataAccess.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace RussellGroup.Pims.Website.Models
{
    public class BatchStatus
    {
        [Display(Name = "scans")]
        [DataType(DataType.MultilineText)]
        public string Scans { get; set; }

        [ForeignKey("Status")]
        public int StatusId { get; set; }

        [Display(Name = "status")]
        public virtual Status Status { get; set; }

        public IEnumerable<Plant> Plants { get; set; }
    }
}