text:
package bolianeducation.bolianchild.view;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;

import com.google.gson.reflect.TypeToken;
import com.zhy.view.flowlayout.FlowLayout;
import com.zhy.view.flowlayout.TagFlowLayout;

import java.util.ArrayList;
import java.util.List;

import bolianeducation.bolianchild.KeyList;
import bolianeducation.bolianchild.R;
import bolianeducation.bolianchild.adapter.MissionFilterAdapter;
import bolianeducation.bolianchild.adapter.NormalTagAdapter;
import bolianeducation.bolianchild.api.BLService;
import bolianeducation.bolianchild.manager.InfoManager;
import bolianeducation.bolianchild.modle.MissionFilter;
import bolianeducation.bolianchild.modle.MissionFilterKind;
import bolianeducation.bolianchild.modle.ResponseEntity;
import bolianeducation.bolianchild.modle.SearchEntity;
import bolianeducation.bolianchild.modle.TagEntity;
import bolianeducation.bolianchild.utils.GsonUtils;
import bolianeducation.bolianchild.utils.LogManager;
import bolianeducation.bolianchild.widget.ClearEditText;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

import static bolianeducation.bolianchild.KeyList.IKEY_KEYWORD;
import static bolianeducation.bolianchild.KeyList.IKEY_TASKTYPE;

/**
 * Created by admin on 2017/7/5.
 * <p>
 * 首页搜索
 */

public class SearchActivity extends BaseActivity {

    @BindView(R.id.et_search)
    ClearEditText etSearch;
    @BindView(R.id.recycler_view)
    RecyclerView recyclerView;
    @BindView(R.id.fl_recommend)
    TagFlowLayout flRecommend;
    @BindView(R.id.fl_custom)
    TagFlowLayout flCustom;
    @BindView(R.id.btn_search)
    Button btnSearch;

    NormalTagAdapter taskAdapter, recommendAdapter;
    private List<TagEntity> taskTags = new ArrayList<>();
    private List<TagEntity> recommendTags = new ArrayList<>();
    MissionFilterAdapter missionFilterAdapter;
    SearchEntity searchEntity = new SearchEntity();
    String taskType;

    /**
     * 区分我发布的任务页
     */
    int actTag;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home_search);
        ButterKnife.bind(this);

        if (getIntent() != null) {
            taskType = getIntent().getStringExtra(IKEY_TASKTYPE);
            actTag = getIntent().getIntExtra(KeyList.IKEY_ACT_TAG, 0);
        }

        init();

        //所有自定义标签(number不起作用,随便填)
        requestAllTags(0, taskType, InfoManager.getGroupId());
        //推荐标签(number表示你想要多少个)
        requestAllTags(20, taskType, "no");
    }

    List<MissionFilterKind> filters;

    private void init() {
        if (actTag != 0) {
            recyclerView.setVisibility(View.GONE);
        }
        setTitle(getString(R.string.search_task));
        setTvBackVisible(true);
        etSearch.setDrawableLeft(context.getResources().getDrawable(R.mipmap.icon_find));

        recyclerView.setLayoutManager(new LinearLayoutManager(this));

        taskAdapter = new NormalTagAdapter(taskTags);
        recommendAdapter = new NormalTagAdapter(recommendTags);

        flCustom.setAdapter(taskAdapter);
        flRecommend.setAdapter(recommendAdapter);

        //自定义标签点击监听
        flCustom.setOnTagClickListener(new TagFlowLayout.OnTagClickListener() {
            @Override
            public boolean onTagClick(View view, final int position, FlowLayout parent) {
                tagClick(position, flRecommend, taskTags);
                return true;
            }
        });

        //推荐标签点击监听
        flRecommend.setOnTagClickListener(new TagFlowLayout.OnTagClickListener() {
            @Override
            public boolean onTagClick(View view, final int position, FlowLayout parent) {
                tagClick(position, flCustom, recommendTags);
                return true;
            }
        });
    }

    @Override
    protected void onResume() {
        super.onResume();
        isRelease = "no";
        isParticipate = "no";
        initFilter();
    }

    //继承自原作者的筛选
    private void initFilter() {
        ArrayList<MissionFilter> filterData = new ArrayList<>();

        filters = new ArrayList<>();
        filters.add(new MissionFilterKind("我发布的任务", false));
        filters.add(new MissionFilterKind("我参与的任务", false));
        MissionFilter missionFilter = new MissionFilter("全部", filters, false);

        filterData.add(missionFilter);

        missionFilterAdapter = new MissionFilterAdapter(this, filterData);
        recyclerView.setAdapter(missionFilterAdapter);
    }

    String isRelease = "no";//我发布的
    String isParticipate = "no";//我参与的

    @OnClick(R.id.btn_search)
    void searchResult() {
        MissionFilterKind publishFilter = filters.get(0);
        MissionFilterKind joinFilter = filters.get(1);
        if (publishFilter.isFilter() && joinFilter.isFilter()) {
            isRelease = "all";
            isParticipate = "all";
        } else if (publishFilter.isFilter() && !joinFilter.isFilter()) {
            isRelease = "yes";
            isParticipate = "no";
        } else if (!publishFilter.isFilter() && joinFilter.isFilter()) {
            isRelease = "no";
            isParticipate = "yes";
        }

        searchEntity.setTaskTitle(etSearch.getText().toString());
        searchEntity.setTaskType(taskType);

        if (actTag != 0) {
            searchEntity.setIsParticipate("no");
            searchEntity.setIsRelease("yes");
        } else {
            searchEntity.setIsParticipate(isParticipate);
            searchEntity.setIsRelease(isRelease);
        }
        Intent intent = new Intent(this, SearchResultActivity.class);
        intent.putExtra(IKEY_KEYWORD, searchEntity);
        startActivity(intent);
    }

    //请求所有标签
    private void requestAllTags(final int number, final String type, String owerId) {
        final Call<ResponseEntity> tags = BLService.getService().getAllTags(number, type, owerId);
        final String finalOwerId = owerId;
        tags.enqueue(new Callback<ResponseEntity>() {
            @Override
            public void onResponse(Call<ResponseEntity> call, final Response<ResponseEntity> response) {
                ResponseEntity body = response.body();
                String s = GsonUtils.toJson(body);
                LogManager.e("customtask", s);
                final ResponseEntity responseEntity = GsonUtils.fromJson(s, new TypeToken<ResponseEntity<TagEntity>>() {
                }.getType());
                if (responseEntity == null || responseEntity.getReturnData() == null) return;
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        if ("no".equals(finalOwerId)) {//推荐标签
                            recommendTags.clear();
                            recommendTags.addAll(responseEntity.getReturnData());
                            flRecommend.getAdapter().notifyDataChanged();
                        } else {//对应任务类型下的标签
                            taskTags.clear();
                            taskTags.addAll(responseEntity.getReturnData());
                            flCustom.getAdapter().notifyDataChanged();
                        }
                    }
                });

            }

            @Override
            public void onFailure(Call<ResponseEntity> call, Throwable t) {

            }
        });
    }

    /**
     * @param position      点击的postion
     * @param tagFlowLayout 清除另外的FlowLayout点击状态
     * @param datas
     */
    private void tagClick(int position, TagFlowLayout tagFlowLayout, List<TagEntity> datas) {
        tagFlowLayout.getAdapter().setSelectedList();
        etSearch.setText(datas.get(position).getContent());
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Log in</title>

    <link href="dist/css/bootstrap.min.css" rel="stylesheet">

    <link href="login.css" rel="stylesheet">

Login to UPS Event Management System

    <form class="well span8 form-signin" role="form">

    <input type="username" class="form-control" placeholder="Username" required autofocus>

    <input type="password" class="form-control" placeholder="Password" required autofocus>

      <input type="checkbox">Remember Me

      <input type="checkbox">System User

Login
    </form>

redpajama_set_name: RedPajamaGithub


text:
Date: Thu, 21 Nov 1996 19:57:23 GMT
Server: NCSA/1.4
Content-type: text/html
Last-modified: Fri, 09 Aug 1996 21:00:40 GMT
Content-length: 3417

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

<TITLE>C. V. Ramamoorthy</TITLE>

<!WA0> C. V. Ramamoorthy

Ph.D., Harvard University

Professor Emeritus

(510) 642-4751

<!WA1>ram@cs.berkeley.edu

Awards/Lectureships

Distinquished Scholar Award, Society for Design & Process Science, 1995

IEEE Richard E. Merwin Award, 1993

IEEE Computer Society Meritorious Service Award, 1991

Keynote Speaker, IEEE International Conference on Distributed
Computing Systems, 1991

IEEE Computer Society Taylor Booth Award, 1990

Keynote Speaker, IEEE International Conference on Data Engineering, 1991

Keynote Speaker, Silver Jubilee Anniversary Conference of the Computer
Society of India, 1990

IEEE Computer Society, Outstanding Paper Award, 1987

Keynote Speaker, International Computer Symposium, Taiwan, 1988 and 1990

IEEE Centennial Medal, 1984

Fellow, IEEE, 1978

IEEE Computer Society, Special Education Award, 1978

IEEE Computer Society, Honor Roll Award, 1974

Admiral Grace Hopper Chair, Naval Postgraduate School

Editorships/Program Committees

Editor-in-Chief

Int. J. Software Engineering and Artificial

Intelligence Editor-in-Chief

IEEE Trans. Software Engineering, 1983-1987

Editor-in-Chief

IEEE Trans. Knowledge and Data Engineering

Member

Editorial Board, Int. J. Information and Computer Systems

Member

Editorial Board, J. Programming Languages

Member

Editorial Board, Computer J. IEEE Computer Society

Selected Publications

Evolution Support Environment System

(with Y. Usuda et al.),
IEEE Trans. Software Engineering, 1990.

Issues in the Development of Reliable Large, Distributed Software
Systems

(with A. Prakash et al.), Advances in Computers, Vol. 26,
Academic Press, 1987, pp. 393-443.

Pipeline Architectures

(with H. F. Li), Computing Surveys, March 1977, pp. 61-102.

Testing Large Software with Automated Software Evaluation Systems

(with F. Ho), IEEE Trans. Software Engineering, April 1975, pp. 46-58.

Optimal Scheduling Strategies in a Multi-Processor Environment

(with K. M. Chandy and M. J. Gonzalez), IEEE Trans. on Computers, 1972,
pp. 137-146.

Optimization of Memory Hierarchies in Multiprogrammed Systems

 J. ACM, July 1970, pp. 426-445.

<!WA2> <!WA3>
(Left to right) Joo Seok Song, currently Professor and Chair of
the Computer Science and Engineering Department, Yongsei
University, Seoul, Korea; Y. F. Chen, currently at AT &amp T Bell
Labs, Murray Hill; and Professor C. V. Ramamoorthy


text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
	<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
		<Pattern>%d{yyyy-MM-dd_HH:mm:ss.SSS} user:%X{user} %X{applicationId}  [%thread] %-5level %logger{36} - %msg%n
                </Pattern>
	</encoder>
 </appender>

 <appender name="FILE"
	class="ch.qos.logback.core.rolling.RollingFileAppender">
	<file>expdata.log</file>
	<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
	   <Pattern>%d{yyyy-MM-dd_HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
           </Pattern>
	</encoder>

	<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
		<FileNamePattern>expdata.%i.log.zip</FileNamePattern>
		<MinIndex>1</MinIndex>
		<MaxIndex>10</MaxIndex>
	</rollingPolicy>

	<triggeringPolicy
		class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
		<MaxFileSize>2MB</MaxFileSize>
	</triggeringPolicy>

  </appender>

  <logger name="org.hibernate.type" level="INFO" />
  <logger name="org.hibernate" level="INFO" />
  <!-- <logger name="org.springframework.context.annotation" level="DEBUG" /> -->

  <root level="INFO">
	<appender-ref ref="FILE" />
	<appender-ref ref="STDOUT" />
  </root>

</configuration>


text:
"""Tests for the Linky config flow."""
import pytest
from unittest.mock import patch
from pylinky.exceptions import (
    PyLinkyAccessException,
    PyLinkyEnedisException,
    PyLinkyException,
    PyLinkyWrongLoginException,
)

from homeassistant import data_entry_flow
from homeassistant.components.linky import config_flow
from homeassistant.components.linky.const import DOMAIN, DEFAULT_TIMEOUT
from homeassistant.const import CONF_PASSWORD, CONF_TIMEOUT, CONF_USERNAME

from tests.common import MockConfigEntry

USERNAME = "username"
PASSWORD = "password"
TIMEOUT = 20

@pytest.fixture(name="login")
def mock_controller_login():
    """Mock a successful login."""
    with patch("pylinky.client.LinkyClient.login", return_value=True):
        yield

@pytest.fixture(name="fetch_data")
def mock_controller_fetch_data():
    """Mock a successful get data."""
    with patch("pylinky.client.LinkyClient.fetch_data", return_value={}):
        yield

@pytest.fixture(name="close_session")
def mock_controller_close_session():
    """Mock a successful closing session."""
    with patch("pylinky.client.LinkyClient.close_session", return_value=None):
        yield

def init_config_flow(hass):
    """Init a configuration flow."""
    flow = config_flow.LinkyFlowHandler()
    flow.hass = hass
    return flow

async def test_user(hass, login, fetch_data, close_session):
    """Test user config."""
    flow = init_config_flow(hass)

    result = await flow.async_step_user()
    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["step_id"] == "user"

    # test with all provided
    result = await flow.async_step_user(
        {CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD}
    )
    assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
    assert result["title"] == USERNAME
    assert result["data"][CONF_USERNAME] == USERNAME
    assert result["data"][CONF_PASSWORD] == PASSWORD
    assert result["data"][CONF_TIMEOUT] == DEFAULT_TIMEOUT

async def test_import(hass, login, fetch_data, close_session):
    """Test import step."""
    flow = init_config_flow(hass)

    # import with username and password
    result = await flow.async_step_import(
        {CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD}
    )
    assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
    assert result["title"] == USERNAME
    assert result["data"][CONF_USERNAME] == USERNAME
    assert result["data"][CONF_PASSWORD] == PASSWORD
    assert result["data"][CONF_TIMEOUT] == DEFAULT_TIMEOUT

    # import with all
    result = await flow.async_step_import(
        {CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD, CONF_TIMEOUT: TIMEOUT}
    )
    assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
    assert result["title"] == USERNAME
    assert result["data"][CONF_USERNAME] == USERNAME
    assert result["data"][CONF_PASSWORD] == PASSWORD
    assert result["data"][CONF_TIMEOUT] == TIMEOUT

async def test_abort_if_already_setup(hass, login, fetch_data, close_session):
    """Test we abort if Linky is already setup."""
    flow = init_config_flow(hass)
    MockConfigEntry(
        domain=DOMAIN, data={CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD}
    ).add_to_hass(hass)

    # Should fail, same USERNAME (import)
    result = await flow.async_step_import(
        {CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD}
    )
    assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
    assert result["reason"] == "username_exists"

    # Should fail, same USERNAME (flow)
    result = await flow.async_step_user(
        {CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD}
    )
    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["errors"] == {CONF_USERNAME: "username_exists"}

async def test_abort_on_login_failed(hass, close_session):
    """Test when we have errors during login."""
    flow = init_config_flow(hass)

    with patch(
        "pylinky.client.LinkyClient.login", side_effect=PyLinkyAccessException()
    ):
        result = await flow.async_step_user(
            {CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD}
        )
        assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
        assert result["errors"] == {"base": "access"}

    with patch(
        "pylinky.client.LinkyClient.login", side_effect=PyLinkyWrongLoginException()
    ):
        result = await flow.async_step_user(
            {CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD}
        )
        assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
        assert result["errors"] == {"base": "wrong_login"}

async def test_abort_on_fetch_failed(hass, login, close_session):
    """Test when we have errors during fetch."""
    flow = init_config_flow(hass)

    with patch(
        "pylinky.client.LinkyClient.fetch_data", side_effect=PyLinkyAccessException()
    ):
        result = await flow.async_step_user(
            {CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD}
        )
        assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
        assert result["errors"] == {"base": "access"}

    with patch(
        "pylinky.client.LinkyClient.fetch_data", side_effect=PyLinkyEnedisException()
    ):
        result = await flow.async_step_user(
            {CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD}
        )
        assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
        assert result["errors"] == {"base": "enedis"}

    with patch("pylinky.client.LinkyClient.fetch_data", side_effect=PyLinkyException()):
        result = await flow.async_step_user(
            {CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD}
        )
        assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
        assert result["errors"] == {"base": "unknown"}


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Synapse.Models;

namespace Azure.ResourceManager.Synapse
{
    public partial class SqlPoolVulnerabilityAssessmentRuleBaselineData : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            writer.WritePropertyName("properties");
            writer.WriteStartObject();
            if (Optional.IsCollectionDefined(BaselineResults))
            {
                writer.WritePropertyName("baselineResults");
                writer.WriteStartArray();
                foreach (var item in BaselineResults)
                {
                    writer.WriteObjectValue(item);
                }
                writer.WriteEndArray();
            }
            writer.WriteEndObject();
            writer.WriteEndObject();
        }

        internal static SqlPoolVulnerabilityAssessmentRuleBaselineData DeserializeSqlPoolVulnerabilityAssessmentRuleBaselineData(JsonElement element)
        {
            ResourceIdentifier id = default;
            string name = default;
            ResourceType type = default;
            Optional<SystemData> systemData = default;
            Optional<IList<SqlPoolVulnerabilityAssessmentRuleBaselineItem>> baselineResults = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    systemData = JsonSerializer.Deserialize<SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("baselineResults"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List<SqlPoolVulnerabilityAssessmentRuleBaselineItem> array = new List<SqlPoolVulnerabilityAssessmentRuleBaselineItem>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(SqlPoolVulnerabilityAssessmentRuleBaselineItem.DeserializeSqlPoolVulnerabilityAssessmentRuleBaselineItem(item));
                            }
                            baselineResults = array;
                            continue;
                        }
                    }
                    continue;
                }
            }
            return new SqlPoolVulnerabilityAssessmentRuleBaselineData(id, name, type, systemData.Value, Optional.ToList(baselineResults));
        }
    }
}


text:
{-# LANGUAGE OverloadedStrings #-}
module Tyckiting.Event (Event(..)) where

import Prelude        ()
import Prelude.Compat

import Control.Applicative ((<|>))
import Control.Monad       (mzero)
import Data.Aeson          (FromJSON (..), Value (..), Object, (.:))
import Data.Aeson.Types    (Parser)
import Data.Text           (Text)

import Tyckiting.Position
import Tyckiting.Types

data Event
    = UnknownEvent Text
    | HitEvent BotId BotId     -- ^ we them
    | DamagedEvent BotId Word  -- ^ target damage
    | DieEvent BotId           -- ^ some?
    | RadarEchoEvent Position  -- ^ we them position
    | DetectedEvent BotId      -- ^ we
    | NoActionEvent BotId      -- ^ we
    | MoveEvent BotId Position -- ^ we position
    | SeeEvent BotId Position  -- ^ them position
    | SeeAsteroid Position     -- ^ asteroid position
    | EndEvent
  deriving (Show, Read)

eventParseJSON :: Object -> Text -> Parser Event
eventParseJSON _ "end"         = pure EndEvent
eventParseJSON v "see"         = SeeEvent
    <$> v .: "botId"
    <*> v .: "pos"
eventParseJSON v "seeAsteroid" = SeeAsteroid <$> v .: "pos"
eventParseJSON v "radarEcho"   = RadarEchoEvent <$> v .: "pos"
eventParseJSON v "move"        = MoveEvent
    <$> v .: "botId"
    <*> v .: "pos"
eventParseJSON v "noaction"    = NoActionEvent <$> v .: "botId"
eventParseJSON v "detected"    = DetectedEvent <$> v .: "botId"
eventParseJSON v "die"         = DieEvent <$> v .: "botId"
eventParseJSON v "damaged"     = DamagedEvent
    <$> v .: "botId"
    <*> v .: "damage"
eventParseJSON v "hit"         = HitEvent
    <$> v .: "source"
    <*> v .: "botId"
eventParseJSON _ t             = pure $ UnknownEvent t

instance FromJSON Event where
    parseJSON (Object v)  = (v .: "event" >>= eventParseJSON v) <|> pure (UnknownEvent "-")
    parseJSON _     = mzero


text:
// Get JSON data
treeJSON = d3.json("scripts/d3/carteiras.json", function (error, treeData) {

    treeData = treeData[1];
    console.log(treeData);
    // Calculate total nodes, max label length
    var totalNodes = 0;
    var maxLabelLength = 0;
    // variables for drag/drop
    var selectedNode = null;
    var draggingNode = null;
    // panning variables
    var panSpeed = 200;
    var panBoundary = 20; // Within 20px from edges will pan when dragging.
    // Misc. variables
    var i = 0;
    var duration = 750;
    var root;

    // size of the diagram
    var viewerWidth = $(document).width();
    var viewerHeight = $(document).height();

    var tree = d3.layout.tree()
            .size([viewerHeight, viewerWidth]);

    // define a d3 diagonal projection for use by the node paths later on.
    var diagonal = d3.svg.diagonal()
            .projection(function (d) {
                return [d.y, d.x];
            });

    // A recursive helper function for performing some setup by walking through all nodes

    function visit(parent, visitFn, childrenFn) {
        if (!parent)
            return;

        visitFn(parent);

        var children = childrenFn(parent);
        if (children) {
            var count = children.length;
            for (var i = 0; i < count; i++) {
                visit(children[i], visitFn, childrenFn);
            }
        }
    }

    // Call visit function to establish maxLabelLength
    visit(treeData, function (d) {
        totalNodes++;
        maxLabelLength = Math.max(d.name.length, maxLabelLength);

    }, function (d) {
        return d.children && d.children.length > 0 ? d.children : null;
    });

    // sort the tree according to the node names

    function sortTree() {
        tree.sort(function (a, b) {
            return b.name.toLowerCase() < a.name.toLowerCase() ? 1 : -1;
        });
    }
    // Sort the tree initially incase the JSON isn't in a sorted order.
    sortTree();

    // TODO: Pan function, can be better implemented.

    function pan(domNode, direction) {
        var speed = panSpeed;
        if (panTimer) {
            clearTimeout(panTimer);
            translateCoords = d3.transform(svgGroup.attr("transform"));
            if (direction == 'left' || direction == 'right') {
                translateX = direction == 'left' ? translateCoords.translate[0] + speed : translateCoords.translate[0] - speed;
                translateY = translateCoords.translate[1];
            } else if (direction == 'up' || direction == 'down') {
                translateX = translateCoords.translate[0];
                translateY = direction == 'up' ? translateCoords.translate[1] + speed : translateCoords.translate[1] - speed;
            }
            scaleX = translateCoords.scale[0];
            scaleY = translateCoords.scale[1];
            scale = zoomListener.scale();
            svgGroup.transition().attr("transform", "translate(" + translateX + "," + translateY + ")scale(" + scale + ")");
            d3.select(domNode).select('g.node').attr("transform", "translate(" + translateX + "," + translateY + ")");
            zoomListener.scale(zoomListener.scale());
            zoomListener.translate([translateX, translateY]);
            panTimer = setTimeout(function () {
                pan(domNode, speed, direction);
            }, 50);
        }
    }

    // Define the zoom function for the zoomable tree

    function zoom() {
        svgGroup.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")");
    }

    // define the zoomListener which calls the zoom function on the "zoom" event constrained within the scaleExtents
    var zoomListener = d3.behavior.zoom().scaleExtent([0.1, 3]).on("zoom", zoom);

    function initiateDrag(d, domNode) {
        draggingNode = d;
        d3.select(domNode).select('.ghostCircle').attr('pointer-events', 'none');
        d3.selectAll('.ghostCircle').attr('class', 'ghostCircle show');
        d3.select(domNode).attr('class', 'node activeDrag');

        svgGroup.selectAll("g.node").sort(function (a, b) { // select the parent and sort the path's
            if (a.id != draggingNode.id)
                return 1; // a is not the hovered element, send "a" to the back
            else
                return -1; // a is the hovered element, bring "a" to the front
        });
        // if nodes has children, remove the links and nodes
        if (nodes.length > 1) {
            // remove link paths
            links = tree.links(nodes);
            nodePaths = svgGroup.selectAll("path.link")
                    .data(links, function (d) {
                        return d.target.id;
                    }).remove();
            // remove child nodes
            nodesExit = svgGroup.selectAll("g.node")
                    .data(nodes, function (d) {
                        return d.id;
                    }).filter(function (d, i) {
                if (d.id == draggingNode.id) {
                    return false;
                }
                return true;
            }).remove();
        }

        // remove parent link
        parentLink = tree.links(tree.nodes(draggingNode.parent));
        svgGroup.selectAll('path.link').filter(function (d, i) {
            if (d.target.id == draggingNode.id) {
                return true;
            }
            return false;
        }).remove();

        dragStarted = null;
    }

    // define the baseSvg, attaching a class for styling and the zoomListener
    var baseSvg = d3.select("#tree-container").append("svg")
            .attr("width", viewerWidth)
            .attr("height", viewerHeight)
            .attr("class", "overlay")
            .call(zoomListener);

    // Define the drag listeners for drag/drop behaviour of nodes.
    dragListener = d3.behavior.drag()
            .on("dragstart", function (d) {
                if (d == root) {
                    return;
                }
                dragStarted = true;
                nodes = tree.nodes(d);
                d3.event.sourceEvent.stopPropagation();
                // it's important that we suppress the mouseover event on the node being dragged. Otherwise it will absorb the mouseover event and the underlying node will not detect it d3.select(this).attr('pointer-events', 'none');
            });

    // Helper functions for collapsing and expanding nodes.

    function collapse(d) {
        if (d.children) {
            d._children = d.children;
            d._children.forEach(collapse);
            d.children = null;
        }
    }

    function expand(d) {
        if (d._children) {
            d.children = d._children;
            d.children.forEach(expand);
            d._children = null;
        }
    }

    var overCircle = function (d) {
        selectedNode = d;
        updateTempConnector();

    };
    var outCircle = function (d) {
        selectedNode = null;
        updateTempConnector();
    };

    var overNodeCircle = function (d) {
        console.log('over ' + d.value);

    };
    var outNodeCircle = function (d) {
        console.log('out ' + d);
    };

    // Function to update the temporary connector indicating dragging affiliation
    var updateTempConnector = function () {
        var data = [];
        if (draggingNode !== null && selectedNode !== null) {
            // have to flip the source coordinates since we did this for the existing connectors on the original tree
            data = [{
                    source: {
                        x: selectedNode.y0,
                        y: selectedNode.x0
                    },
                    target: {
                        x: draggingNode.y0,
                        y: draggingNode.x0
                    }
                }];
        }
        var link = svgGroup.selectAll(".templink").data(data);

        link.enter().append("path")
                .attr("class", "templink")
                .attr("d", d3.svg.diagonal())
                .attr('pointer-events', 'none');

        link.attr("d", d3.svg.diagonal());

        link.exit().remove();
    };

    // Function to center node when clicked/dropped so node doesn't get lost when collapsing/moving with large amount of children.

    function centerNode(source) {
        scale = zoomListener.scale();
        x = -source.y0;
        y = -source.x0;
        x = x * scale + viewerWidth / 2;
        y = y * scale + viewerHeight / 2;
        d3.select('g').transition()
                .duration(duration)
                .attr("transform", "translate(" + x + "," + y + ")scale(" + scale + ")");
        zoomListener.scale(scale);
        zoomListener.translate([x, y]);
    }

    // Toggle children function

    function toggleChildren(d) {
        if (d.children) {
            d._children = d.children;
            d.children = null;
        } else if (d._children) {
            d.children = d._children;
            d._children = null;
        }
        return d;
    }

    // Toggle children on click.

    function click(d) {
        if (d3.event.defaultPrevented)
            return; // click suppressed
        d = toggleChildren(d);
        update(d);
        centerNode(d);
    }

    function update(source) {
        // Compute the new height, function counts total children of root node and sets tree height accordingly.
        // This prevents the layout looking squashed when new nodes are made visible or looking sparse when nodes are removed
        // This makes the layout more consistent.
        var levelWidth = [1];
        var childCount = function (level, n) {

            if (n.children && n.children.length > 0) {
                if (levelWidth.length <= level + 1)
                    levelWidth.push(0);

                levelWidth[level + 1] += n.children.length;
                n.children.forEach(function (d) {
                    childCount(level + 1, d);
                });
            }
        };
        childCount(0, root);
        var newHeight = d3.max(levelWidth) * 25; // 25 pixels per line
        tree = tree.size([newHeight, viewerWidth]);

        // Compute the new tree layout.
        var nodes = tree.nodes(root).reverse(),
                links = tree.links(nodes);

        // Set widths between levels based on maxLabelLength.
        nodes.forEach(function (d) {
            d.y = (d.depth * (maxLabelLength * 10)); //maxLabelLength * 10px
            // alternatively to keep a fixed scale one can set a fixed depth per level
            // Normalize for fixed-depth by commenting out below line
            // d.y = (d.depth * 500); //500px per level.
        });

        // Update the nodes…
        node = svgGroup.selectAll("g.node")
                .data(nodes, function (d) {
                    return d.id || (d.id = ++i);
                });

        // Enter any new nodes at the parent's previous position.
        var nodeEnter = node.enter().append("g")
                .call(dragListener)
                .attr("class", "node")
                .attr("transform", function (d) {
                    return "translate(" + source.y0 + "," + source.x0 + ")";
                })
                .on('click', click);

        nodeEnter.append("circle")
                .attr('class', 'nodeCircle')
                .on("mouseover", function (node) {

                    overNodeCircle(node);
                })
                .on("mouseout", function (node) {
                    outNodeCircle(node);
                })
                .attr("r", 0)
                .style("fill", function (d) {
                    return d._children ? "lightsteelblue" : "#fff";
                });

        nodeEnter.append("text")
                .attr("x", function (d) {
                    return d.children || d._children ? -10 : 10;
                })
                .attr("dy", ".35em")
                .attr('class', 'nodeText')
                .attr("text-anchor", function (d) {
                    return d.children || d._children ? "end" : "start";
                })
                .text(function (d) {
                    return d.name;
                })
                .style("fill-opacity", 0);

        // phantom node to give us mouseover in a radius around it
        nodeEnter.append("circle")
                .attr('class', 'ghostCircle')
                .attr("r", 30)
                .attr("opacity", 0.2) // change this to zero to hide the target area
                .style("fill", "red")
                .attr('pointer-events', 'mouseover')
                .on("mouseover", function (node) {
                    overCircle(node);
                })
                .on("mouseout", function (node) {
                    outCircle(node);
                })
                ;

        var num =0;

        // Update the text to reflect whether node has children or not.
        node.select('text')
                .attr("x", function (d) {
                    return d.children || d._children ? -10 : 10;
                })
                .attr("text-anchor", function (d) {
                    return d.children || d._children ? "end" : "start";
                })
                .text(function (d) {
                    num += d.size;
                    return d.name;
                });

        // Change the circle fill depending on whether it has children and is collapsed
        node.select("circle.nodeCircle")
                .attr("r", 4.5)
                .style("fill", function (d) {
                    return d._children ? "lightsteelblue" : "#fff";
                })
                .text(function (d) {
                    return num;
                });

        // Transition nodes to their new position.
        var nodeUpdate = node.transition()
                .duration(duration)
                .attr("transform", function (d) {
                    return "translate(" + d.y + "," + d.x + ")";
                });

        // Fade the text in
        nodeUpdate.select("text")
                .style("fill-opacity", 1);

        // Transition exiting nodes to the parent's new position.
        var nodeExit = node.exit().transition()
                .duration(duration)
                .attr("transform", function (d) {
                    return "translate(" + source.y + "," + source.x + ")";
                })
                .remove();

        nodeExit.select("circle")
                .attr("r", 0);

        nodeExit.select("text")
                .style("fill-opacity", 0);

        // Update the links…
        var link = svgGroup.selectAll("path.link")
                .data(links, function (d) {
                    return d.target.id;
                });

        // Enter any new links at the parent's previous position.
        link.enter().insert("path", "g")
                .attr("class", "link")
                .attr("d", function (d) {
                    var o = {
                        x: source.x0,
                        y: source.y0
                    };
                    return diagonal({
                        source: o,
                        target: o
                    });
                });

        // Transition links to their new position.
        link.transition()
                .duration(duration)
                .attr("d", diagonal);

        // Transition exiting nodes to the parent's new position.
        link.exit().transition()
                .duration(duration)
                .attr("d", function (d) {
                    var o = {
                        x: source.x,
                        y: source.y
                    };
                    return diagonal({
                        source: o,
                        target: o
                    });
                })
                .remove();

        // Stash the old positions for transition.
        nodes.forEach(function (d) {
            d.x0 = d.x;
            d.y0 = d.y;
        });
    }

    // Append a group which holds all nodes and which the zoom Listener can act upon.
    var svgGroup = baseSvg.append("g");

    // Define the root
    root = treeData;
    console.log(root);
    root.x0 = viewerHeight / 2;
    root.y0 = 0;

    // Layout the tree initially and center on the root node.
    update(root);
    centerNode(root);
});


text:
<?php

/*
 * This file is part of the PHP CS utility.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Symfony\CS\Tokenizer\Transformer;

use Symfony\CS\Tokenizer\AbstractTransformer;
use Symfony\CS\Tokenizer\Token;
use Symfony\CS\Tokenizer\Tokens;

/**
 * Transform `class` class' constant from T_CLASS into CT_CLASS_CONSTANT.
 *
 * @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
 *
 * @internal
 */
final class ClassConstantTransformer extends AbstractTransformer
{
    /**
     * {@inheritdoc}
     */
    public function getCustomTokenNames()
    {
        return array('CT_CLASS_CONSTANT');
    }

    /**
     * {@inheritdoc}
     */
    public function process(Tokens $tokens, Token $token, $index)
    {
        if (!$token->isGivenKind(T_CLASS)) {
            return;
        }

        $prevIndex = $tokens->getPrevMeaningfulToken($index);
        $prevToken = $tokens[$prevIndex];

        if ($prevToken->isGivenKind(T_DOUBLE_COLON)) {
            $token->override(array(CT_CLASS_CONSTANT, $token->getContent()));
        }
    }
}


text:
package p;

public interface JavaSAM {
    public void foo(int number, String ss);
}


text:
package edu.emory.cci.aiw.i2b2etl.dest.metadata;

import edu.emory.cci.aiw.i2b2etl.dest.metadata.conceptid.InvalidConceptCodeException;
import edu.emory.cci.aiw.i2b2etl.dest.metadata.conceptid.ModifierParentConceptId;
import edu.emory.cci.aiw.i2b2etl.dest.metadata.conceptid.ConceptId;
import edu.emory.cci.aiw.i2b2etl.dest.metadata.conceptid.ModifierConceptId;
import edu.emory.cci.aiw.i2b2etl.dest.metadata.conceptid.PropDefConceptId;
import edu.emory.cci.aiw.i2b2etl.dest.config.ModifierSpec;
import edu.emory.cci.aiw.i2b2etl.util.Util;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringEscapeUtils;
import org.protempa.Attribute;
import org.protempa.KnowledgeSourceCache;
import org.protempa.KnowledgeSourceReadException;
import org.protempa.ParameterDefinition;
import org.protempa.PropertyDefinition;
import org.protempa.PropositionDefinition;
import org.protempa.proposition.value.Value;
import org.protempa.valueset.ValueSet;
import org.protempa.valueset.ValueSetElement;
import org.protempa.proposition.value.ValueType;

class PropositionConceptTreeBuilder implements OntologyBuilder, SubtreeBuilder {

    private static final ModifierSpec[] EMPTY_MODIFIER_SPEC_ARRAY = new ModifierSpec[0];

    private final SimpleDateFormat valueMetadataCreateDateTimeFormat;
    private final String conceptCode;
    private final Metadata metadata;
    private final ValueTypeCode valueTypeCode;
    private final String createDate;
    private final ModifierSpec[] modifiers;
    private final String[] propIds;
    private final KnowledgeSourceCache knowledgeSourceCache;
    private final boolean alreadyLoaded;
    private List<Concept> roots;

    PropositionConceptTreeBuilder(KnowledgeSourceCache knowledgeSourceCache,
            String[] propIds, String conceptCode, ValueTypeCode valueTypeCode,
            ModifierSpec[] modifiers, boolean alreadyLoaded, Metadata metadata)
            throws KnowledgeSourceReadException,
            UnknownPropositionDefinitionException {
        assert knowledgeSourceCache != null : "knowledgeSourceCache cannot be null";
        assert metadata != null : "metadata cannot be null";
        this.propIds = propIds;
        this.conceptCode = conceptCode;
        this.metadata = metadata;
        this.valueTypeCode = valueTypeCode;
        this.valueMetadataCreateDateTimeFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
        this.createDate = this.valueMetadataCreateDateTimeFormat.format(new Date());
        if (modifiers != null) {
            this.modifiers = modifiers.clone();
        } else {
            this.modifiers = EMPTY_MODIFIER_SPEC_ARRAY;
        }
        this.knowledgeSourceCache = knowledgeSourceCache;
        this.alreadyLoaded = alreadyLoaded;
        this.roots = new ArrayList<>();
    }

    Metadata getMetadata() {
        return metadata;
    }

    @Override
    public void build(Concept concept) throws OntologyBuildException {
        try {
            for (String childPropId : this.propIds) {
                PropositionDefinition childPropDef
                        = this.knowledgeSourceCache.get(childPropId);
                if (childPropDef != null) {
                    Concept child = addNode(childPropDef);
                    if (concept != null) {
                        concept.add(child);
                    }
                    this.roots.add(child);
                    addModifierConcepts(childPropDef, child);
                    buildHelper(childPropDef.getInverseIsA(), child);
                }
            }
        } catch (InvalidConceptCodeException | KnowledgeSourceReadException ex) {
            throw new OntologyBuildException(
                    "Could not build proposition concept tree", ex);
        }
    }

    @Override
    public Concept[] getRoots() {
        return this.roots.toArray(new Concept[this.roots.size()]);
    }

    private void buildHelper(String[] childPropIds, Concept parent)
            throws KnowledgeSourceReadException, InvalidConceptCodeException, OntologyBuildException {
        for (String childPropId : childPropIds) {
            PropositionDefinition childPropDef
                    = this.knowledgeSourceCache.get(childPropId);
            if (childPropDef != null) {
                Concept child = addNode(childPropDef);
                parent.add(child);
                addModifierConcepts(childPropDef, child);
                buildHelper(childPropDef.getInverseIsA(), child);
            }
        }
    }

    private Concept addNode(PropositionDefinition propDef)
            throws InvalidConceptCodeException, KnowledgeSourceReadException, OntologyBuildException {
        ConceptId conceptId
                = PropDefConceptId.getInstance(propDef.getId(), null, null, this.metadata);
        Concept newChild = new Concept(conceptId, this.conceptCode, this.metadata);
        newChild.setDownloaded(propDef.getDownloaded());
        Date updated = propDef.getUpdated();
        newChild.setUpdated(updated != null ? propDef.getUpdated() : propDef.getCreated());
        String[] children = propDef.getChildren();
        String[] inverseIsAs = propDef.getInverseIsA();
        newChild.setInDataSource(children.length == 0 //is a leaf
                || inverseIsAs.length == 0 /* is abstracted */);
        newChild.setDerived(children.length > inverseIsAs.length);
        newChild.setDisplayName(propDef.getDisplayName());
        newChild.setSourceSystemCode(
                MetadataUtil.toSourceSystemCode(
                        propDef.getSourceId().getStringRepresentation()));
        newChild.setValueTypeCode(this.valueTypeCode);
        newChild.setComment(propDef.getDescription());
        newChild.setAlreadyLoaded(this.alreadyLoaded);
        Attribute attribute = propDef.attribute(Util.C_FULLNAME_ATTRIBUTE_NAME);
        if (attribute != null) {
            Value value = attribute.getValue();
            if (value != null) {
                newChild.setFullName(value.getFormatted());
            }
        }
        if (this.valueTypeCode == ValueTypeCode.LABORATORY_TESTS) {
            ValueType valueType
                    = ((ParameterDefinition) propDef).getValueType();
            newChild.setDataType(DataType.dataTypeFor(valueType));
            if (children.length < 1) {
                newChild.setMetadataXml("<?xml version=\"1.0\"?><ValueMetadata><Version>3.02</Version><CreationDateTime>" + this.createDate
                        + "</CreationDateTime><TestID>" + StringEscapeUtils.escapeXml10(newChild.getConceptCode())
                        + "</TestID><TestName>" + StringEscapeUtils.escapeXml10(newChild.getDisplayName())
                        + "</TestName><DataType>" + (newChild.getDataType() == DataType.NUMERIC ? "Float" : "String") + "</DataType><Flagstouse></Flagstouse><Oktousevalues>Y</Oktousevalues><UnitValues><NormalUnits> </NormalUnits></UnitValues></ValueMetadata>");
            }
        } else {
            newChild.setDataType(DataType.TEXT);
        }
        if (this.metadata.getFromIdCache(conceptId) == null) {
            this.metadata.addToIdCache(newChild);
        } else {
            newChild.setSynonymCode(SynonymCode.SYNONYM);
        }
        return newChild;
    }

    private void addModifierConcepts(PropositionDefinition propDef, Concept appliedConcept) throws KnowledgeSourceReadException, InvalidConceptCodeException {
        if (this.modifiers.length > 0) {
            ConceptId modParentId = ModifierParentConceptId.getInstance(propDef.getId(), this.metadata);
            Concept modParent = new Concept(modParentId, null, this.metadata);
            modParent.setAlreadyLoaded(this.alreadyLoaded);
            this.metadata.addModifierRoot(modParent);
            if (this.metadata.getFromIdCache(modParentId) == null) {
                this.metadata.addToIdCache(modParent);
            } else {
                modParent.setSynonymCode(SynonymCode.SYNONYM);
            }
            for (ModifierSpec modifier : this.modifiers) {
                PropertyDefinition propertyDef = propDef.propertyDefinition(modifier.getProperty());
                if (propertyDef != null && !propertyDef.isInherited()) {
                    String valStr = modifier.getValue();
                    Value val = valStr != null ? propertyDef.getValueType().parse(valStr) : null;
                    ConceptId modId = ModifierConceptId.getInstance(
                            propDef.getId(),
                            propertyDef.getId(),
                            val,
                            this.metadata);
                    Concept mod = new Concept(modId, modifier.getCodePrefix(), this.metadata);
                    mod.setDisplayName(modifier.getDisplayName());
                    Date updated = propDef.getUpdated();
                    mod.setUpdated(updated != null ? propDef.getUpdated() : propDef.getCreated());
                    mod.setDownloaded(propDef.getDownloaded());
                    mod.setSourceSystemCode(
                            MetadataUtil.toSourceSystemCode(
                                    propDef.getSourceId().getStringRepresentation()));
                    mod.setValueTypeCode(this.valueTypeCode);
                    mod.setAppliedPath(appliedConcept.getFullName() + "%");
                    mod.setDataType(DataType.dataTypeFor(propertyDef.getValueType()));
                    mod.setFactTableColumn("MODIFIER_CD");
                    mod.setTableName("MODIFIER_DIMENSION");
                    mod.setColumnName("MODIFIER_PATH");
                    mod.setAlreadyLoaded(this.alreadyLoaded);
                    Attribute attribute = propertyDef.getAttribute(Util.C_FULLNAME_ATTRIBUTE_NAME);
                    if (attribute != null) {
                        Value value = attribute.getValue();
                        if (value != null) {
                            mod.setFullName(value.getFormatted());
                        }
                    }
                    if (propertyDef.getValueType() != ValueType.BOOLEANVALUE) {
                        StringBuilder mXml = new StringBuilder();
                        mXml.append("<?xml version=\"1.0\"?><ValueMetadata><Version>3.02</Version><CreationDateTime>");
                        mXml.append(this.createDate);
                        mXml.append("</CreationDateTime><TestID>");
                        mXml.append(StringEscapeUtils.escapeXml10(mod.getConceptCode()));
                        mXml.append("</TestID><TestName>");
                        mXml.append(StringEscapeUtils.escapeXml10(mod.getDisplayName()));
                        mXml.append("</TestName>");
                        String valueSetId = propertyDef.getValueSetId();
                        if (valueSetId != null) {
                            mXml.append("<DataType>Enum</DataType><EnumValues>");
                            ValueSet valueSet = this.knowledgeSourceCache.getValueSet(valueSetId);
                            if (valueSet != null) {
                                for (ValueSetElement vse : valueSet.getValueSetElements()) {
                                    mXml.append("<Val description=\"");
                                    mXml.append(StringEscapeUtils.escapeXml10(vse.getDisplayName()));
                                    mXml.append("\">");
                                    mXml.append(StringEscapeUtils.escapeXml10(vse.getValue().getFormatted()));
                                    mXml.append("</Val>");
                                }
                            }
                            mXml.append("</EnumValues>");
                        } else {
                            mXml.append("<DataType>");
                            mXml.append(mod.getDataType() == DataType.NUMERIC ? "Float" : "String");
                            mXml.append("</DataType>");
                        }
                        mXml.append("<Flagstouse></Flagstouse><Oktousevalues>Y</Oktousevalues><UnitValues><NormalUnits> </NormalUnits></UnitValues></ValueMetadata>");
                        mod.setMetadataXml(mXml.toString());
                    }
                    if (this.metadata.getFromIdCache(modId) == null) {
                        this.metadata.addToIdCache(mod);
                    } else {
                        mod.setSynonymCode(SynonymCode.SYNONYM);
                    }
                    if (this.metadata.getFromIdCache(modId) == null) {
                        this.metadata.addToIdCache(mod);
                    } else {
                        mod.setSynonymCode(SynonymCode.SYNONYM);
                    }
                    modParent.add(mod);
                }
            }
        }
    }

}


text:
title: Need help?
layout: single
id: support
---

**Nodal** is worked on full-time by [Keith Horwood](https://twitter.com/keithwhor). Keith is often around and available for questions.

## Gitter

Many Nodal developers and users ask and answer questions on **[Nodal's gitter channel](https://gitter.im/keithwhor/nodal).**

## Twitter

For the latest news about Nodal, [follow Nodal creator **@keithwhor** on Twitter](https://twitter.com/keithwhor). In addition, you can use the #nodaljs hashtag to see what others are saying or add to the conversation.


text:
#pragma once

#include <array>
#include <ostream>
#include <string>
#include <utility>

namespace org {
namespace apache {
namespace nifi {
namespace minifi {
namespace utils {

template<size_t N>
class SmallString : public std::array<char, N + 1> {
 public:
  operator std::string() const {  // NOLINT
    return {c_str()};
  }

  [[nodiscard]] std::string_view view() const noexcept {
    return std::string_view{this->data(), N};
  }

  constexpr size_t length() const noexcept {
    return N;
  }

  const char* c_str() const {
    return this->data();
  }

  friend std::ostream &operator<<(std::ostream &out, const SmallString &str) {
    return out << str.c_str();
  }

  friend std::string operator+(const std::string &lhs, const SmallString &rhs) {
    return lhs + rhs.c_str();
  }

  friend std::string operator+(std::string &&lhs, const SmallString &rhs) {
    return std::move(lhs) + rhs.c_str();
  }

  friend std::string operator+(const SmallString &lhs, const std::string &rhs) {
    return lhs.c_str() + rhs;
  }

  friend std::string operator+(const SmallString &lhs, std::string &&rhs) {
    return lhs.c_str() + std::move(rhs);
  }

  friend bool operator==(const std::string& lhs, const SmallString& rhs) {
    return lhs == rhs.c_str();
  }

  friend bool operator==(const SmallString& lhs, const std::string& rhs) {
    return lhs.c_str() == rhs;
  }

  friend bool operator==(const SmallString& lhs, const SmallString& rhs) {
    return static_cast<std::array<char, N + 1>>(lhs) == static_cast<std::array<char, N + 1>>(rhs);
  }

  friend bool operator!=(const std::string& lhs, const SmallString& rhs) {
    return !(lhs == rhs);
  }

  friend bool operator!=(const SmallString& lhs, const std::string& rhs) {
    return !(lhs == rhs);
  }

  friend bool operator!=(const SmallString& lhs, const SmallString& rhs) {
    return !(lhs == rhs);
  }
};

}  // namespace utils
}  // namespace minifi
}  // namespace nifi
}  // namespace apache
}  // namespace org


text:
package org.mrgeo.hdfs.vector.shp.exception;

/**
 * An MissingExpectedDataException is thrown when expected data is not returned
 * during database activity.
 */
public class MissingArgumentException extends Exception
{

  /**
     *
     */
  private static final long serialVersionUID = 1L;

  /**
   * Creates a new instance of MissingExpectedDataException without
   * detail message.
   */
  public MissingArgumentException()
  {
    super();
  }

  /**
   * Constructs an instance of MissingExpectedDataException with
   * the specified detail message.
   *
   * @param s
   *          The message.
   */
  public MissingArgumentException(String msg)
  {
    super(msg);
  }

  /**
   * Constructs an instance of MissingExpectedDataException with
   * the specified detail message and throwable cause.
   *
   * @param msg
   *          the detail message.
   * @param throwable
   *          the throwable cause.
   */
  public MissingArgumentException(String msg, Throwable throwable)
  {
    super(msg, throwable);
  }

  /**
   * Constructs an instance of MissingExpectedDataException with
   * the specified throwable cause.
   *
   * @param throwable
   *          the throwable cause.
   */
  public MissingArgumentException(Throwable throwable)
  {
    super(throwable);
  }
}


text:
'use strict';

var _ = require('lodash');
var path = require('path');

/**
 * hierarchyReporter.js
 *
 * Support for hierarchy report template
 * These functions will always be called,
 * but they will be harmlessly ignored by other report types
 */

/**
 * Review each feature in the suite, and find the common baseDir that is shared by all of them.
 * We will later use this as the basis from which to construct the feature hierarchy--
 * the basedir prefix needs to be removed since it is not important.
 */
var getBaseDir = function (suite) {
    var baseDir = [];
    suite.features.forEach(function (feature) {
        var uriParts = feature.uri.split(path.sep);
        if (!baseDir.length) {
            baseDir = uriParts;
        } else {
            for (var i = uriParts.length; i > 0; i--) {
                if ((baseDir.length > i) && (baseDir[i] !== uriParts[i])) {
                    baseDir.length = i;
                }
            }
        }
    });
    return baseDir.join(path.sep);
};

/**
 * Given a feature, remove the basedir prefix and the feature name suffix from its URI
 * and return the remaining folders (if any) in an array.  If the feature is at the top-level,
 * it will return []
 * For example:
 * @param featureUri:  '/home/cstrong/myproj/test/features/authentication/login/guestLogin.feature'
 * @param baseDir:  '/home/cstrong/myproj/test/features'
 * @returns [ 'authentication', 'login' ]
 */
var getFeatureHierarchy = function (featureUri, baseDir) {
    var noBaseDir = featureUri.slice(baseDir.length + 1);
    var noBadChars = noBaseDir.split('=').join('_');
    var featureDirs = noBadChars.split(path.sep);

    // remove the feature name itself
    featureDirs.length = featureDirs.length - 1;

    return featureDirs;
};

/**
 * Given the top-level suite and the hierarchy to build, recursively create the hierarchy
 * of sub-suites (if needed) and return the lowest level sub-suite.
 *
 * @param suite
 * @param hierarchy  e.g. [ 'authentication', 'login' ]
 * @returns suite object or null if there is no hierarchy
 */
var findOrCreateSubSuite = function (suite, hierarchy) {

    /*
     Create a new sub-suite correspond to a folder name.  The suite will contain the features that are defined
     within that folder, and/or sub-suites corresponding to any sub-folders that themselves may contain features.
     A sub-suite has a reference to its parent suite, so that we can easily aggregate statistics of passed and failed
     tests up the hierarchy.
     */
    function newSubSuite(name, parent) {
        return {
            name: {
                plain: name,
                sanitized: name
            },
            passed: 0,
            failed: 0,
            ambiguous: 0,
            skipped: 0,
            parent: parent,
            features: [],
            suites: []
        };
    }

    if (hierarchy.length < 1) {
        return null;
    }
    var subSuiteName = hierarchy[0];
    if (!suite.suites) {
        suite.suites = [];
    }
    var subSuite = suite.suites.find(function (s) {
        return s.name.plain === subSuiteName;
    });
    if (!subSuite) {
        subSuite = newSubSuite(subSuiteName, suite);
        suite.suites.push(subSuite);
    }
    if (hierarchy.length === 1) {
        return subSuite;
    } else {
        return findOrCreateSubSuite(subSuite, hierarchy.slice(1));
    }
};

/**
 * Increment stat such as failed, ambiguous or passed for the current suite
 * and follow the parent attribute (if any) recursively up the tree, incrementing all.
 * That way the top level suite accumulates all results from child and grandchild suites
 *
 * @param subSuite
 * @param attrName ('passed', 'failed', 'ambiguous', or 'skipped')
 */
var recursivelyIncrementStat = function (subSuite, attrName) {
    subSuite[attrName] = subSuite[attrName] + 1;
    if (subSuite.parent) {
        recursivelyIncrementStat(subSuite.parent, attrName);
    }
};

module.exports = {
    getBaseDir: getBaseDir,
    getFeatureHierarchy: getFeatureHierarchy,
    findOrCreateSubSuite: findOrCreateSubSuite,
    recursivelyIncrementStat: recursivelyIncrementStat
};


text:
package org.jasig.cas.web.flow;

import java.util.Arrays;

import org.jasig.cas.web.support.ArgumentExtractor;
import org.jasig.cas.web.support.CasArgumentExtractor;
import org.jasig.cas.web.support.CookieRetrievingCookieGenerator;
import org.jasig.cas.web.support.WebUtils;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;
import org.springframework.webflow.context.servlet.ServletExternalContext;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.test.MockRequestContext;

import junit.framework.TestCase;

/**
 *
 * @author Scott Battaglia
 * @version $Revision: 24158 $ $Date: 2011-06-26 23:41:49 -0400 (Sun, 26 Jun 2011) $
 * @since 3.0.5
 *
 */
public class InitialFlowSetupActionTests extends TestCase {
    private final InitialFlowSetupAction action = new InitialFlowSetupAction();

    private CookieRetrievingCookieGenerator warnCookieGenerator;

    private CookieRetrievingCookieGenerator tgtCookieGenerator;

    protected void setUp() throws Exception {
        this.warnCookieGenerator = new CookieRetrievingCookieGenerator();
        this.tgtCookieGenerator = new CookieRetrievingCookieGenerator();
        this.action.setTicketGrantingTicketCookieGenerator(this.tgtCookieGenerator);
        this.action.setWarnCookieGenerator(this.warnCookieGenerator);
        final ArgumentExtractor[] argExtractors = new ArgumentExtractor[] {new CasArgumentExtractor()};
        this.action.setArgumentExtractors(Arrays.asList(argExtractors));
        this.action.afterPropertiesSet();
        this.action.afterPropertiesSet();
    }

    public void testSettingContextPath() throws Exception {
        final MockHttpServletRequest request = new MockHttpServletRequest();
        final String CONST_CONTEXT_PATH = "/test";
        request.setContextPath(CONST_CONTEXT_PATH);
        final MockRequestContext context = new MockRequestContext();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, new MockHttpServletResponse()));

        this.action.doExecute(context);

        assertEquals(CONST_CONTEXT_PATH + "/", this.warnCookieGenerator.getCookiePath());
        assertEquals(CONST_CONTEXT_PATH + "/", this.tgtCookieGenerator.getCookiePath());
    }

    public void testResettingContexPath() throws Exception {
        final MockHttpServletRequest request = new MockHttpServletRequest();
        final String CONST_CONTEXT_PATH = "/test";
        final String CONST_CONTEXT_PATH_2 = "/test1";
        request.setContextPath(CONST_CONTEXT_PATH);
        final MockRequestContext context = new MockRequestContext();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, new MockHttpServletResponse()));

        this.action.doExecute(context);

        assertEquals(CONST_CONTEXT_PATH + "/", this.warnCookieGenerator.getCookiePath());
        assertEquals(CONST_CONTEXT_PATH + "/", this.tgtCookieGenerator.getCookiePath());

        request.setContextPath(CONST_CONTEXT_PATH_2);
        this.action.doExecute(context);

        assertNotSame(CONST_CONTEXT_PATH_2 + "/", this.warnCookieGenerator.getCookiePath());
        assertNotSame(CONST_CONTEXT_PATH_2 + "/", this.tgtCookieGenerator.getCookiePath());
        assertEquals(CONST_CONTEXT_PATH + "/", this.warnCookieGenerator.getCookiePath());
        assertEquals(CONST_CONTEXT_PATH + "/", this.tgtCookieGenerator.getCookiePath());
    }

    public void testNoServiceFound() throws Exception {
        final MockRequestContext context = new MockRequestContext();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), new MockHttpServletRequest(), new MockHttpServletResponse()));

        final Event event = this.action.execute(context);

        assertNull(WebUtils.getService(context));

        assertEquals("success", event.getId());
    }

    public void testServiceFound() throws Exception {
        final MockRequestContext context = new MockRequestContext();
        final MockHttpServletRequest request = new MockHttpServletRequest();
        request.setParameter("service", "test");
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, new MockHttpServletResponse()));

        final Event event = this.action.execute(context);

        assertEquals("test", WebUtils.getService(context).getId());
        assertEquals("success", event.getId());
    }
}


text:
name='Microsoft.Windows.Common-Controls' \
version='6.0.0.0' \
processorArchitecture='*' \
publicKeyToken='6595b64144ccf1df' \
language='*'\"")

#	if defined(INSANITY_MSWINDOWS_SUPPRESS_CONSOLE)
//tell the program loader not to spawn a console window for this process.
#		pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#	endif
#endif

#endif


text:
package org.apache.beam.sdk.io.parquet;

import static org.apache.beam.sdk.io.common.FileBasedIOITHelper.appendTimestampSuffix;
import static org.apache.beam.sdk.io.common.FileBasedIOITHelper.getExpectedHashForLineCount;
import static org.apache.beam.sdk.io.common.FileBasedIOITHelper.readFileBasedIOITPipelineOptions;
import static org.apache.beam.sdk.values.TypeDescriptors.strings;

import org.apache.avro.Schema;
import org.apache.avro.generic.GenericRecord;
import org.apache.avro.generic.GenericRecordBuilder;
import org.apache.beam.sdk.coders.AvroCoder;
import org.apache.beam.sdk.io.FileIO;
import org.apache.beam.sdk.io.GenerateSequence;
import org.apache.beam.sdk.io.common.FileBasedIOITHelper;
import org.apache.beam.sdk.io.common.FileBasedIOTestPipelineOptions;
import org.apache.beam.sdk.io.common.HashingFn;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.transforms.Combine;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.transforms.MapElements;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.transforms.SerializableFunction;
import org.apache.beam.sdk.transforms.Values;
import org.apache.beam.sdk.transforms.View;
import org.apache.beam.sdk.values.PCollection;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
 * Integration tests for {@link org.apache.beam.sdk.io.parquet.ParquetIO}.
 *
 *
Run this test using the command below. Pass in connection information via PipelineOptions:
 *
 *

 *  ./gradlew integrationTest -p sdks/java/io/file-based-io-tests
 *  -DintegrationTestPipelineOptions='[
 *  "--numberOfRecords=100000",
 *  "--filenamePrefix=output_file_path",
 *  ]'
 *  --tests org.apache.beam.sdk.io.parquet.ParquetIOIT
 *  -DintegrationTestRunner=direct
 *

 *
 *
Please see 'build_rules.gradle' file for instructions regarding running this test using Beam
 * performance testing framework.
 */
@RunWith(JUnit4.class)
public class ParquetIOIT {

  private static final Schema SCHEMA =
      new Schema.Parser()
          .parse(
              "{\n"
                  + " \"namespace\": \"ioitavro\",\n"
                  + " \"type\": \"record\",\n"
                  + " \"name\": \"TestAvroLine\",\n"
                  + " \"fields\": [\n"
                  + "     {\"name\": \"row\", \"type\": \"string\"}\n"
                  + " ]\n"
                  + "}");

  private static String filenamePrefix;
  private static Integer numberOfRecords;

  @Rule public TestPipeline pipeline = TestPipeline.create();

  @BeforeClass
  public static void setup() {
    FileBasedIOTestPipelineOptions options = readFileBasedIOITPipelineOptions();

    numberOfRecords = options.getNumberOfRecords();
    filenamePrefix = appendTimestampSuffix(options.getFilenamePrefix());
  }

  @Test
  public void writeThenReadAll() {
    PCollection<String> testFiles =
        pipeline
            .apply("Generate sequence", GenerateSequence.from(0).to(numberOfRecords))
            .apply(
                "Produce text lines",
                ParDo.of(new FileBasedIOITHelper.DeterministicallyConstructTestTextLineFn()))
            .apply("Produce Avro records", ParDo.of(new DeterministicallyConstructAvroRecordsFn()))
            .setCoder(AvroCoder.of(SCHEMA))
            .apply(
                "Write Parquet files",
                FileIO.<GenericRecord>write().via(ParquetIO.sink(SCHEMA)).to(filenamePrefix))
            .getPerDestinationOutputFilenames()
            .apply("Get file names", Values.create());

    PCollection<String> consolidatedHashcode =
        testFiles
            .apply("Find files", FileIO.matchAll())
            .apply("Read matched files", FileIO.readMatches())
            .apply("Read parquet files", ParquetIO.readFiles(SCHEMA))
            .apply(
                "Map records to strings",
                MapElements.into(strings())
                    .via(
                        (SerializableFunction<GenericRecord, String>)
                            record -> String.valueOf(record.get("row"))))
            .apply("Calculate hashcode", Combine.globally(new HashingFn()));

    String expectedHash = getExpectedHashForLineCount(numberOfRecords);
    PAssert.thatSingleton(consolidatedHashcode).isEqualTo(expectedHash);

    testFiles.apply(
        "Delete test files",
        ParDo.of(new FileBasedIOITHelper.DeleteFileFn())
            .withSideInputs(consolidatedHashcode.apply(View.asSingleton())));

    pipeline.run().waitUntilFinish();
  }

  private static class DeterministicallyConstructAvroRecordsFn extends DoFn<String, GenericRecord> {
    @ProcessElement
    public void processElement(ProcessContext c) {
      c.output(new GenericRecordBuilder(SCHEMA).set("row", c.element()).build());
    }
  }
}


text:
package io.crate.license.exception;

abstract class LicenseException extends RuntimeException {

    LicenseException(String message) {
        super(message);
    }

    LicenseException(String message, Throwable cause) {
        super(message, cause);
    }

}


text:
var GetMemberships = function(Req, Res) {
    var ToReturn = Req.session && Req.session.User && Req.session.User.Memberships ? Req.session.User.Memberships : [];
    return(ToReturn);
};

var LoggedIn = function(Req, Res) {
    return(Req.session&&Req.session.User);
};

function SetGetMemberships(NewGetter)
{
    GetMemberships = NewGetter;
}

function SetLoggedIn(NewChecker)
{
    LoggedIn = NewChecker;
}

function Authenticate(Req, Res, Groups, And)
{
    if(LoggedIn(Req, Res))
    {
        if(Groups)
        {
            var Operator = And ? 'every' : 'some';
            var Memberships = GetMemberships(Req, Res);
            return(Groups[Operator](function(Group, GroupIndex, GroupList) {
                return(Memberships.some(function(Membership, MembershipIndex, MembershipList) {
                    return(Membership==Group);
                }));
            }));
        }
        else
        {
            return(true);
        }
    }

    return(false);
}

function AuthenticateRoute(Options)
{
    var Groups = [];
    var And = false
    var Not = false
    if(Array.isArray(Options))
    {
        Groups = Options;
    }
    else
    {
        Groups = Options && Options.Groups ? Options.Groups : null;
        And = Options && Options.And ? Options.And : false;
        Not = Options && Options.Not ? Options.Not : false;
    }
    return(function(Req, Res, Next) {
        var Authenticated = Authenticate(Req, Res, Groups, And);
        Authenticated = Not ? (!Authenticated) : Authenticated;
        if(Authenticated)
        {
            Next();
        }
        else
        {
            var Err = new Error();
            Err.Source = "ExpressAccessControl";
            Err.Type = "NoAccess";
            Next(Err);
        }
    });
}

module.exports = {'Authenticate': Authenticate, 'AuthenticateRoute': AuthenticateRoute, 'SetGetMemberships': SetGetMemberships, 'SetLoggedIn': SetLoggedIn};


text:
iOS Change Log
==============

Version 5.1.5 *(2015-03-13)*
----------------------------

Features:

Fixes:

- Fix issue where close buttons for video were not working on startup.

Improvements:

Version 5.1.4 *(2015-03-04)*
----------------------------

Features:

- Added a new method 'setStatusBarBehavior' to control how fullscreen video ads interact with the status bar.

Fixes:

- Fix for duplicate calls to the creative url from the SDK. This should fix issues with third party click tracking reporting click numbers twice what we report.
- Fix for max ads not being respected when campaign is set to show once per hour and autocache is set to YES. There is now a small delay after successful show call.
- Fix issue for interstitial video and rewarded video calling didDismissInterstitial or didDismissRewardedVideo during a click event.
- Fix issue where didClickInterstitial not firing for interstitial video.
- Fix issue where close buttons for fullscreen video were appearing behing the status bar.

Improvements:

- Added the location parameter, when available, to more relevant network requests. This should provide more information to analytics.

Version 5.1.3 *(2015-01-16)*
----------------------------

Features:

Fixes:

- Disabled request retries by default, fix for multithreaded crashes
- Fix for when the device is in an orientation we do not have assets for. Instead of failing silently a CBLoadError is now called.

Improvements:

- Better inplay caching
- Added orientation information to api-click, and video-complete calls. Allows for better analytics
- Remove hardcoded affiliate token. Now pulled from the server
- Added example usage of isAnyViewVisible: delegate method into the sample project
- Added inplay button to the chartboost example app
- Improved logging for when someone tries to show a rewarded video with prefetching disabled. Instead of failing silently a CBLoadError is called.

Version 5.1.2 *(2014-12-05)*
----------------------------

Features:

Fixes:

- Fix CBAppCall crash if no resource path sent with URL.
- Fix bug with SKStoreProductViewController crashing due to race condition.
- Fix SKStoreProductViewController rotation issue with Unity.
- Fix concurrency issue in CBConfig.

Improvements:

Version 5.1.1 *(2014-12-01)*
----------------------------

Features:

Fixes:

- Fix build for armv7s architectures.

Improvements:

Version 5.1.0 *(2014-11-20)*
----------------------------

Features:

Fixes:

- Fix race condition between actions for video on replay.
- Fix loading screen causing issues with video and app sheet.
- Fix interstitial video close button appearing at incorrect time in portrait orientation.
- Fix rewarded video autoplays when previous display of video is dismissed instead of watched.
- Fix api/config not executing on soft bootups.
- Fix close button clipping the video player in corner.
- Fix api/install not being sent for soft bootups.
- Fix for various crashes due to memory pressure and concurrency.
- Fix for api/track executing on hidden files for older devices.
- Fix for rotating iPhone 6/6+ can cause video to display off screen.
- Fix for incorrect error code enumerations being used.
- Fix loading view not appearing for more apps page on slow connections.
- Fix crash in CBAnalytics if sent an invalid NSDecimalNumber.

Improvements:

- Added new framework tracking values for Cordova and CocoonJS.
- Added new API to check visibility of Chartboost UI.
- Changed delegate callbacks for click and close to be sent after closing or clicking the impression.
- Changed autocache calls to delay execution for better performance.

Version 5.0.3 *(2014-09-30)*
----------------------------

- Bugfixes and stability improvements.

Version 5.0.2 *(2014-09-12)*
----------------------------

- Added functionality to close loading view if taking too long.
- Bugfixes and stability improvements.

Version 5.0.1 *(2014-09-09)*
----------------------------

- Bugfixes and stability improvements.

Version 5.0.0 *(2014-09-03)*
----------------------------

- Public video release.
- Update Chartboost SDK interface to use static methods.
- Remove deprecated Chartboost Store.
- New ChartboostExample project.
- Many delegate methods moved to setter and getter functions.
- Introduce new Chartboost display methods that accept a UIViewController.
- Full SKProductsViewController support added.
- CBPostInstallAnalyticsTracker renamed to CBAnalytics.
- Reduce overall size of SDK.
- Dynamically load symbols and frameworks.
- Remove external dependencies.
- Enable logging in DEBUG builds via environment variable.
- Bugfixes and stability improvements.

Version 4.5.1 *(2014-07-18)*
----------------------------

- Fixes for Store.
- Fixes for session tracking and for invalid data types.

Version 4.5.0 *(2014-06-16)*
----------------------------

- Newsfeed publicly available.
- Post Install Analytics publicly available.

Version 4.4.1 *(2014-05-20)*
----------------------------

- Chartboost now supports x86_64 architectures (64 bit simulator)

Version 4.4.0 *(2014-05-17)*
----------------------------

- New MoreApps: Location support, new look and feel, custom headers
- Updates to video beta, optimizations, portrait support
- New Chartboost initialization method: startWithAppId:appSignature:delegate:
- Automatic caching enabled after show calls.
- Deprecated default location API calls.
- Beta Products support: inPlay and News Feed.
- New delegate method (didFailToRecordClick:withError:). Called when a click is registered, but the user is not fowrwarded to the App Store
- Orientation improvements: an ad will now be displayed at any orientation it
  claims supporting, when the current orientation is not.

Version 4.2.0 *(2014-03-25)*
----------------------------

- New library (CBPostInstallAnalyticsTracker) made available to track IAP.
- Apple non-default frameworks (Quartzcore, System Configuration, Store Kit and
  Ad Support) don't have to be linked manually anymore.
- Carrier information added to default request parameters
- Changed Locations for caching interstitials and more apps to an defined list.
  Locations are now a list of enum values that can be found in the Chartboost.h file.
- App Sheet support for More Apps.

Version 4.1.0 *(2014-02-17)*
----------------------------

- Interstitials and More Apps will change orientation with the device if the
  app supports multiple orientations.
- Server responses are now validated and will fail if any field is not correct.
- More Apps header background is now built from a tilable image.
- An Age Gate can now be added after an interstitial has been clicked. Use the
  delegate method `shouldPauseClickForConfirmation:` to activate it.
- Interstitial background is now blurred if the device & OS support it.
- Fixed break statement missing in the example project.
- Fixed issue with the vendor id.
- Fixed massive memory leak, thorough refactor.

Version 4.0.0 *(2014-01-13)*
----------------------------

- Bundle file scanning is now an option in the header, controlled by a boolean
  property set to false by default
- Files in the cache folder will be now deleted if they have not been  used for
  7 days
- Rate limiting of requests: only 3 interstitial requests per 90s per location
  are allowed
- Error delegate methods now take an `enum` describing the error
- When an interstitial is not loaded because of first session interstitials
  being disabled, it now triggers the failure delegate.
- When an interstitial is shown on the wrong orientation, it now also triggers
  an error.
- User-agent updated to allow wrappers to suffix User-agent.
- Add new session analytics tools to the SDK.
- User-agent updated to allow wrappers to suffix User-agent
- New delegate method, to be called when the App Store sheet is dismissed.
- Completely removing deprecated library, `CBAnalytics`.
- New example project is now part of the sdk download package
- When attempting to load an interstitial without having started a session, an
  error is triggered
- The Chartboost Store

Version 4.0.0-b7 *(2013-10-08)*
-------------------------------

- Auto-upsell
- Logging improvements, log level controllable via env variable
- Misc bug fixes

Version 4.0.0-b6 *(2013-06-28)*
-------------------------------

- Improved `localizedPriceForItem` to support caching
- Fixed crashing bug with `localizedPriceForItem` on iOS 5

Version 4.0.0-b5 *(2013-06-05)*
-------------------------------

- Improved `subscribeToStoreView`.

Version 4.0.0-b4 *(2013-06-05)*
-------------------------------

- Fixed bug when default balance is not retained.

Version 4.0.0-b3 *(2013-06-05)*
-------------------------------

- Fixed bug where new status code would not be allowed by mask.
- Removed `initializeStore` from CBStore.h.
- Completed `triggersImmediately` support for `subscribeToStoreView` to show content right away.

Version 4.0.0-b2 *(2013-06-04)*
-------------------------------

- Fixed memory leak in IAP manager.
- Fixed bug where no callback when the pruchase is unsafe.

Version 4.0.0-b1 *(2013-05-31)*
-------------------------------

- Initial release of the Store.
- New logging framework.

Version 3.3.1 *(2013-10-29)*
----------------------------

- Fixed bug causing More Apps page crashes on iOS 7
- Fix crashes on iOS 5 devices related to the new 64-bit support
- New Feature: Xcode 5 now automatically displays integration tips (defined in **chartboost.h**), contextually presenting them while you code

Version 3.3.0 *(2013-10-17)*
----------------------------

- Fully compatible with iOS 7 64-bit-only projects. Maintains support for 32-bit projects and iOS 5.1+ devices.

Version 3.2.2 *(2013-10-08)*
----------------------------

- Added a new public method (`dismissChartboostView`) to dismiss an interstitial or More Apps view programmatically
- Fixed a bug causing indefinite loading after More Apps page clicks while in Airplane Mode
- Fixed a crash bug that would occur if the SDK received corrupt image data
- Fixed bug affecting display of More Apps button labels on iOS 7 devices
- Fixed bug causing crashes when user clicked interstitial with no iTunes URL set via the dashboard

Version 3.2.1 *(2013-05-23)*
----------------------------

- Improved long term memory management
- Better handles clicks on interstitials with malformed URLs
- Increased stability on repeated calls to hasCachedInterstitial
- Fixed issue where dismiss button could be pressed multiple times on a single interstitial
- Replaced third party JSON lib with Apple internal JSON serializer
- Compatible only with iOS 5.0+. If you need iOS 4.3+ compatibility, use SDK version 3.2 below

Version 3.2.0 *(2013-05-24)*
----------------------------

- Minimum OS version: iOS 5.0
- __UDID method removed__. Use this SDK in any apps submitted to the App Store after May 1st, 2013.
- More Apps page better handles long app names
- Handles showing an interstitial at the same time as the Game Center login prompt
- Better time-outs on intermittent internet
- No longer shows blank interstitials when app orientation is misconfigured server-side
- Added support for targeting interstitials by language
- The window property has been changed to root view
- CBAnalytics beta features removed

**Note:** "Unique" column of App Analytics temporarily shows 0 for apps using SDK v3.2. Please use "Installs" or "Bootups" for reference.

Version 3.1.1 *(2013-02-26)*
----------------------------

- Stability improvements for apps with over 300mb of bundled assets
- Fixed rare visual glitch where interstitial positions itself incorrectly
  relative to status bar after app rotation

Version 3.1.0 *(2012-10-12)*
----------------------------

- Added support for the iOS 6 App Sheet so your users can download apps without
  ever leaving your app! You must include StoreKit.framework for access to the
  App Sheet. We are rolling out this feature in phases, apply for access via
  [bizdev@chartboost.com](mailto:bizdev@chartboost.com).
- More apps status bar fixed, now auto-adjusts position when status bar is
  visible
- Fixed rare crasher in CBCrypto
- Note: This version and all versions in the future are compatible with iOS
  version 4.3 and higher ONLY (armv7 and armv7s).

Version 3.0.7 *(2012-10-22)*
----------------------------

- **REQUIRED: You must include AdSupport.framework for access to the
identifierForAdvertising**
- Added compatibility with Xcode 4.5 and armv7s. This SDK includes armv6, armv7,
  and armv7s
- Fixed shouldRequestInterstitialsInFirstSession delegate method; now requests
  interstitials only after 2nd startSession call
- Internal API upgrades

Version 3.0.6 *(2012-09-13)*
----------------------------

- Automatic interstitial caching now uses a version fallback if your app does
  not include CFBundleShortVersionString in the info.plist. For best
  interstitial caching, add CFBundleShortVersionString key and value to your
  info.plist.

Version 3.0.5 *(2012-08-28)*
----------------------------

- Fixed rare crash in web image caching library

Version 3.0.4 *(2012-08-16)*
----------------------------

- Added SDK support for targeting Wi-fi devices

Version 3.0.3 *(2012-07-31)*
----------------------------

- Removed automatic removal of interstitials and more apps view when
  backgrounding app

Version 3.0.2 *(2012-07-20)*
----------------------------

- Improves click tracking in race conditions
- Fixes issue where cached ads appear during backgrounding
- Fixed JSON crasher in CB Analytics

Version 3.0.1 *(2012-07-06)*
----------------------------

- Improved compatibility with iOS version 4.0 - 4.2

Version 3.0.0 *(2012-07-02)*
----------------------------

- Mandatory updates:
    - Delegate methods now return location strings (no longer pass in a view)
      -- i.e. didFailToLoadInterstitial will pass in the specific location
      identifier that failed
    - Removed methods: loadInterstitial, install -- now use showInterstitial,
      startSession
    - Requirement: rename ChartBoost class to Chartboost (lowercase b, no
      camelCase) Feeling hardcore? Run this bash command in your project
      directory to update camelcase ChartBoost in all your files:

      ```bash
      for ext in '*.m' '*.h' '*.c' '*.mm'; do find . -name "$ext" -exec sed -i '' 's/ChartBoost/Chartboost/g' '{}' \; ; done
      ```

- New native interstitials: faster, less memory
- New native More Apps page: faster, less memory, less network activity
- Asset caching: individual assets are cached and only downloaded if they don't
  exist in cache -- all assets stored in caches folder so the OS handles memory
  appropriately
- Cache expiration: cached interstitials automatically expire after 24 hours
- Multi orientation support: if your app works in both orientations, simply
  select both (landscape and portrait) in the dashboard
- Orientation override: SDK detects orientation using the statusbar location,
  you may override this detection
- UDID replacement: iOS 6 compatible
- New delegate methods:
    - didCacheInterstitial: called when an interstitial is successfully cached
      from the server, interstitial location identifier passed in
    - didCacheMoreApps: called when the more apps page is successfully cached
      from the server
    - shouldRequestInterstitialsInFirstSession: default is YES, you may
      override to NO if you don't want interstitials displayed until after the
      2nd startSession (for compliance with Human Interface Guidelines)
- Version notifications: if a new version of the SDK is released, you'll get
  a version notification in the Xcode console if current device is iPhone
  Simulator
- Bundle assets: you may include frame and cross promotion assets into your
  binary
- Bug fixes:
    - Displaying interstitial no longer fails when there is no appDelegate
      window property
    - Fixed memory leaks
- SDK supported - coming soon to the dashboard:
    - Interstitial animations: four, configurable from the dashboard
    - Retina support for interstitials and more apps
    - New cell types: regular, featured, webview


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width">
		<title>QUnit Example</title>
		<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.0.1.css">


text:
Parallel SSH
------------

The ``parallel-ssh`` module and scripts implement parallelized versions of common SSH tasks including:

* Arbitrary commands over SSH (the ``pssh`` utility)
* File copying to and from remote servers over SSH (the ``pscp`` and ``pslurp`` utilities, respectively)
* Syncing files over SSH (the ``prsync`` utility)
* Forcefully killing processes over SSH (the ``pnuke`` utility)

This project utilizes the SSH binaries and libraries already installed on your system, making it ideal for administrators who do not want to manage external dependencies or for servers which need to be bootstrapped to make use of utilities (e.g. Chef, Puppet, Salt) that follow the master-agent paradigm (i.e. require agents to be installed in order to manage servers).

About This Project
------------------

Original work on ``parallel-ssh`` is by Brent Chun and Andrew McNabb.

This fork of ``parallel-ssh`` implements a number of improvements, including major refactoring of the libraries to make them more modular and easier to extend and the addition of numerous extra options for more easily managing, viewing, and saving the status of command runs.

To see a list of all changes, view the ``ChangeLog``.

Examples
--------

One of the most useful additions to the ``pssh`` utility in particular are the ``--script`` and ``--sudo`` options::

    $ pssh -h hostfile.txt --script restart_iptables.sh --sudo

These options let you run arbitrary scripts (as root, if needed) on remote hosts, without having to properly escape or make special considerations for the contents of those scripts. All that's required is that the script contain a shebang line referencing an interpreter that exists on the remote host.

All of the utilities received some new common options, some of which include the ``--host-regexp`` and ``--sample-size`` options. More information can be found by simply typing ``[utility] --help``. (All of the help output for the commands has been reorganized and made easier to read)


text:
package petablox.program.visitors;

import soot.jimple.internal.JExitMonitorStmt;

/**
 * Visitor over all monitorexit statements in all methods in the program.
 */
public interface IExitMonitorInstVisitor extends IInstVisitor {
    public void visit(JExitMonitorStmt q);
}


text:
        Telegram Bots
        <button class="btn btn-primary float-right jh-create-entity create-telegram-bot" [routerLink]="['/', { outlets: { popup: ['telegram-bot-new'] } }]">

            Create new Telegram Bot

        </button>

    <jhi-alert></jhi-alert>

            <form name="searchForm" class="form-inline">

                    <input type="text" class="form-control" [(ngModel)]="currentSearch" id="currentSearch" name="currentSearch" placeholder="{{ 'gamecraftgatewayApp.telegramBot.home.search' | translate }}">
                    <button class="input-group-addon btn btn-info" (click)="search(currentSearch)">

                    </button>
                    <button class="input-group-addon btn btn-danger" (click)="clear()" *ngIf="currentSearch">

                    </button>

            </form>

            ID
            Telegram Bot Name
            Telegram Bot Description
            Telegram Bot Token
            Telegram Bot Enabled

                {{telegramBot.id}}
                {{telegramBot.telegramBotName}}
                {{telegramBot.telegramBotDescription}}
                {{telegramBot.telegramBotToken}}
                {{telegramBot.telegramBotEnabled}}

                        <button type="submit"
                                [routerLink]="['../telegram-bot', telegramBot.id ]"
                                class="btn btn-info btn-sm">

                            View
                        </button>
                        <button type="submit"
                                [routerLink]="['/', { outlets: { popup: 'telegram-bot/'+ telegramBot.id + '/edit'} }]"
                                replaceUrl="true"
                                class="btn btn-primary btn-sm">

                            Edit
                        </button>
                        <button type="submit"
                                [routerLink]="['/', { outlets: { popup: 'telegram-bot/'+ telegramBot.id + '/delete'} }]"
                                replaceUrl="true"
                                class="btn btn-danger btn-sm">

                            Delete
                        </button>

                <jhi-item-count [page]="page" [total]="queryCount" [itemsPerPage]="itemsPerPage"></jhi-item-count>

                <ngb-pagination [collectionSize]="totalItems" [maxSize]="5" [(page)]="page"  (pageChange)="loadPage(page)"></ngb-pagination>


text:
import {
  REQ_PUT_ADD_WALKTHROUGH,
  REQ_PUT_UPDATE_WALKTHROUGH,
  REQ_PUT_DELETE_WALKTHROUGH,
  PLAYBACK_WALKTHROUGH,
  SET_PLAYBACK_START,
  SET_PLAYBACK_END,
  VIEW_WALKTHROUGH_POINT,
  INSERT_POINT
} from './types';

export default {
  addWalkthrough(modelId, walkthrough, index, isBefore) {
    return {
      type: REQ_PUT_ADD_WALKTHROUGH,
      promise: apiClient => apiClient.put(`/model/${modelId}/addWalkthrough`, {
        body: {
          walkthrough,
          index,
          isBefore
        }
      })
    };
  },

  updateWalkthrough(modelId, index, update) {
    return {
      type: REQ_PUT_UPDATE_WALKTHROUGH,
      promise: apiClient => apiClient.put(`/model/${modelId}/updateWalkthrough`, {
        body: {
          index,
          ...update
        }
      }),
      payload: {
        index
      }
    };
  },

  deleteWalkthrough(modelId, index) {
    return {
      type: REQ_PUT_DELETE_WALKTHROUGH,
      promise: apiClient => apiClient.put(`/model/${modelId}/deleteWalkthrough`, {
        body: {
          index
        }
      }),
      payload: {
        index
      }
    };
  },

  playbackWalkthrough() {
    return {
      type: PLAYBACK_WALKTHROUGH
    };
  },

  setPlaybackStart(startIndex) {
    return {
      type: SET_PLAYBACK_START,
      payload: {
        startIndex
      }
    };
  },

  setPlaybackEnd(endIndex) {
    return {
      type: SET_PLAYBACK_END,
      payload: {
        endIndex
      }
    };
  },

  viewWalkthroughPoint(index) {
    return {
      type: VIEW_WALKTHROUGH_POINT,
      payload: {
        index
      }
    };
  },

  insertWalkthroughPoint(index, controlToggle, pos, lookAt, snapshot) {
    return {
      type: INSERT_POINT,
      payload: {
        index,
        controlToggle,
        pos,
        lookAt,
        snapshot
      }
    };
  }

};


text:
"""
Setup script for calc slope script.
"""

import platform
from numpy.distutils.core import setup, Extension

# Build with ATLAS on linux
if platform.system() == 'Linux':
    liblist = ['lapack','f77blas','cblas','latlas']
# Else try to build with LAPACK (will work on OS X)
else:
    liblist = ['lapack']

slope = Extension('slope',
                    include_dirs = ['/usr/include','/usr/local/include'],
                    libraries = ['lapack'],
                    library_dirs = ['/usr/lib','/usr/local/lib'],
                    sources = ['slope.f90'])

setup(
  name='slopeDegrees',
  version = '1.0',
  description = 'Script to calculate slope from a DEM with a horizontal spacing in degrees',
  author = 'Daniel Clewley',
  author_email = 'daniel.clewley@gmail.com',
  url = 'http://mixil.usc.edu/',
  ext_modules = [slope],
  scripts=['calcSlopeDegrees.py']
)


text:
package org.hibernate.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Property Access type
 *
 * Prefer the standard {@link javax.persistence.Access} annotation
 *
 * @author Emmanuel Bernard
 */
@Target({ TYPE, METHOD, FIELD })
@Retention(RUNTIME)
public @interface AccessType {
	String value();
}