text:
package org.motechproject.mtraining.domain;

/**
 * Enum state for activity. This can be use to mark the user as having started a course, in progress or completed
 * a course curriculum
 */
public enum ActivityState {
    NONE,
    STARTED,
    INPROGRESS,
    COMPLETED;
}


text:
var AutocompleteTransaction = {

    init: function (elementId, transactionId) {
        var element = $('#' + elementId);
        $('#' + elementId).autocomplete({
            source:'/application/search/autocompleteInvoice',
            autoFocus: true,
            select: function (event, ui) {
                $('#invoiceId-' + transactionId).val(ui.item.id);
                $('#associate-' + transactionId).prop('disabled', false);
                return ui.item.label;
            }
        });
    }
};

var AutocompleteRowArticle = {

    init: function (elementId) {
        var element = $('#article-' + elementId);

        $('#article-' + elementId).autocomplete({
            source: function(request, response) {
                $.ajax({
                    url: '/application/article/autocompleteRowArticle',
                    datatype: "json",
                    data: {
                        query: request.term
                    },
                    success: function(data) {
                        console.log(data);
                        response($.map(data, function(item) {
                            return {
                                id: item.id,
                                value: item.value
                            }
                        }))
                    },
                    error: function(data) {
                        console.log('error')
                    }
                })
            },
            select: function(event, ui) {
                console.log('teretere');
                $('#articleId-' + elementId).val(ui.item.id).trigger("change");
                return ui.item.label;
            }
        });
    }
};

redpajama_set_name: RedPajamaGithub


text:
Underwear.defineMethod(String.prototype, 'strip', function() {
  return this.replace(/^\s+(.+)\s+$/, "$1");
});


text:
watirworks
==========

#Install: TODO

https://leanpub.com/watirbook/read#leanpub-auto-installation

#Features: TODO


text:
import React, { Component } from 'react';
import style from './FormContainer.module.css';

export default class Form extends Component {
    componentDidMount() {
        componentHandler.upgradeDom();
    }

    render() {
        const { children } = this.props;

        return (
            <div className={style.formContainer}>
                {children}
            </div>
        );
    };
}


text:
layout: default
title: Support the movement to end corruption
permalink: /dsdonate/
---
{% capture content %}

This is our moment

A historic protest called Democracy Spring just wrapped up a 10-day march from Philadelphia to DC, followed by thousands from across the country converging on Capitol Hill for a massive series of sit-ins & demonstrations, including celebrities like Mark Ruffalo and Gaby Hoffman.

I co-founded MAYDAY.US with hopes of 2016 being a tipping point moment for reform. We're beginning to see the promise of that launch, and it's because so many of you from across the country have committed to a principled fight for political equality.

Please give whatever you can to keep this fight alive.

Donate In Two Minutes or Less

      {% include form_donate.html facebook_tracking_id='6033848617290' %}

Prefer to donate by check?

Mayday PAC

       P.O. Box 75357

       Washington, DC 20013

    {% include donate_rules.html %}

{% endcapture %}

{% include sub_layouts/default_layout.html %}


text:
'use strict';

/**
 * @ngdoc function
 * @name app.controller:TagsCtrl
 * @description
 * # TagsCtrl
 * Controller of the app
 */
angular.module('app')
  .controller('TagsCtrl', function () {
    this.awesomeThings = [
      'HTML5 Boilerplate',
      'AngularJS',
      'Karma'
    ];
  });


text:
var app = require('./../../main/js/main')

var chai = require('chai')
var chaii = require('chai-immutable')
var chaip = require('chai-as-promised');

var expect = chai.expect
chai.use(chaip);

describe('chk function', () => {
  it ('should add 2', () => {
    expect(app.chk(2)).to.equal(4)
  })
})

describe('fct function', () => {
  it ('should add 1', () => {
    expect(app.fct(2)).to.equal(3)
  })
})

describe('pid function', () => {
  it ('should return number', () => {
    expect(app.pid()).to.be.a('number')
  })
})

describe('flatten feature', () => {
  it ('should work with an empty object', () => {
    expect(app.flatten({})).to.deep.equal({})
  })
  it ('should work with simple object', () => {
    expect(app.flatten({a:1})).to.deep.equal({a:1})
    expect(app.flatten({'a':1})).to.deep.equal({a:1})
  })
  it ('should work with simple object and a specified prefix', () => {
    expect(app.flatten({a:1}, {prefix:'root'})).to.deep.equal({'root.a':1})
  })
  it ('should work with simple object and a specified longer prefix', () => {
    expect(app.flatten({'a':1}, {prefix:'root.subroot'})).to.deep.equal({'root.subroot.a':1})
  })
  it ('should walk into object tree', () => {
    expect(app.flatten({'a':{'b':2}})).to.deep.equal({'a.b':2})
  })
  it ('should walk into object tree with a custom separator', () => {
    expect(app.flatten({'a':{'b':2}}, {sep:'~~'})).to.deep.equal({'a~~b':2})
    expect(app.flatten({a:{b:{c:3}}}, {sep:'~#~'})).to.deep.equal({'a~#~b~#~c':3})
  })
  it ('should walk through several object subtrees', () => {
    expect(app.flatten({'a':{'b':2}, 'A':{'B':{'C':3}, 'D':4}})).to.deep.equal({'a.b':2, 'A.B.C':3, 'A.D':4})
  })
  it ('should work with process.versions', () => {
    expect(app.flatten(process.versions)).to.contains.any.keys('http_parser')
  })
  it ('should work with process.config', () => {
    const flat = app.flatten(process.config)
    expect(flat).to.contains.any.keys('variables.target_arch')
  })
  it ('should work with process.argv with an array content', () => {
    const flat = app.flatten(process.argv, {prefix:'argv'})
    expect(flat).to.contains.any.keys('argv')
  })
})

describe('should work with promises', () => {
  it ('should say us hello', () => {
    const promise = new Promise( (resolve, reject) => {
      app.testcb( (ob) => {resolve(ob)} )
    } )
    return expect(promise).to.eventually.equal('hello')
  } )
} )

describe('modules', () => {
  it ('should report some installed module', () => {
    const promise = new Promise( (resolve, reject) => {
      function job() { app.npmls( (ob) => { resolve(ob) } ) }
      setTimeout(()=>job, 5000)
      //job()
    } )
    return expect(promise).to.eventually.have.deep.property('dependencies.babel-cli.version')
  } )
} )


text:
using System.Reflection;
using System.Runtime.InteropServices;
using Android;
using Android.App;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using Xamarin.Forms.GoogleMaps;
using Xamarin.Forms.GoogleMaps.Android;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("Xamarin.Forms.GoogleMaps.Android")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

// Add some common permissions, these can be removed if not needed

[assembly: UsesPermission(Manifest.Permission.Internet)]
[assembly: UsesPermission(Manifest.Permission.WriteExternalStorage)]
[assembly: ExportRenderer(typeof(Map), typeof(MapRenderer))]
[assembly: Preserve]


text:
// Copyright 2021 DeepMind Technologies Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include <array>
#include <cstdio>
#include <map>
#include <memory>
#include <random>
#include <string>
#include <vector>

#include "open_spiel/abseil-cpp/absl/flags/flag.h"
#include "open_spiel/abseil-cpp/absl/flags/parse.h"
#include "open_spiel/abseil-cpp/absl/strings/str_join.h"
#include "open_spiel/abseil-cpp/absl/time/clock.h"
#include "open_spiel/abseil-cpp/absl/time/time.h"
#include "open_spiel/algorithms/alpha_zero_torch/device_manager.h"
#include "open_spiel/algorithms/alpha_zero_torch/vpevaluator.h"
#include "open_spiel/algorithms/alpha_zero_torch/vpnet.h"
#include "open_spiel/algorithms/mcts.h"
#include "open_spiel/bots/human/human_bot.h"
#include "open_spiel/spiel.h"
#include "open_spiel/spiel_utils.h"

ABSL_FLAG(std::string, game, "tic_tac_toe", "The name of the game to play.");
ABSL_FLAG(std::string, player1, "az", "Who controls player1.");
ABSL_FLAG(std::string, player2, "random", "Who controls player2.");
ABSL_FLAG(std::string, az_path, "", "Path to AZ experiment.");
ABSL_FLAG(std::string, az_graph_def, "vpnet.pb",
          "AZ graph definition file name.");
ABSL_FLAG(double, uct_c, 2, "UCT exploration constant.");
ABSL_FLAG(int, rollout_count, 10, "How many rollouts per evaluation.");
ABSL_FLAG(int, max_simulations, 10000, "How many simulations to run.");
ABSL_FLAG(int, num_games, 1, "How many games to play.");
ABSL_FLAG(int, max_memory_mb, 1000,
          "The maximum memory used before cutting the search short.");
ABSL_FLAG(int, az_checkpoint, -1, "Checkpoint of AZ model.");
ABSL_FLAG(int, az_batch_size, 1, "Batch size of AZ inference.");
ABSL_FLAG(int, az_threads, 1, "Number of threads to run for AZ inference.");
ABSL_FLAG(int, az_cache_size, 16384, "Cache size of AZ algorithm.");
ABSL_FLAG(int, az_cache_shards, 1, "Cache shards of AZ algorithm.");
ABSL_FLAG(bool, solve, true, "Whether to use MCTS-Solver.");
ABSL_FLAG(uint_fast32_t, seed, 0, "Seed for MCTS.");
ABSL_FLAG(bool, verbose, false, "Show the MCTS stats of possible moves.");
ABSL_FLAG(bool, quiet, false, "Show the MCTS stats of possible moves.");

uint_fast32_t Seed() {
  uint_fast32_t seed = absl::GetFlag(FLAGS_seed);
  return seed != 0 ? seed : absl::ToUnixMicros(absl::Now());
}

std::unique_ptr<open_spiel::Bot>
InitBot(std::string type, const open_spiel::Game &game,
        open_spiel::Player player,
        std::shared_ptr<open_spiel::algorithms::Evaluator> evaluator,
        std::shared_ptr<open_spiel::algorithms::torch_az::VPNetEvaluator>
            az_evaluator) {
  if (type == "az") {
    return std::make_unique<open_spiel::algorithms::MCTSBot>(
        game, std::move(az_evaluator), absl::GetFlag(FLAGS_uct_c),
        absl::GetFlag(FLAGS_max_simulations),
        absl::GetFlag(FLAGS_max_memory_mb), absl::GetFlag(FLAGS_solve), Seed(),
        absl::GetFlag(FLAGS_verbose),
        open_spiel::algorithms::ChildSelectionPolicy::PUCT, 0, 0,
        /*dont_return_chance_node=*/true);
  }
  if (type == "human") {
    return std::make_unique<open_spiel::HumanBot>();
  }
  if (type == "mcts") {
    return std::make_unique<open_spiel::algorithms::MCTSBot>(
        game, std::move(evaluator), absl::GetFlag(FLAGS_uct_c),
        absl::GetFlag(FLAGS_max_simulations),
        absl::GetFlag(FLAGS_max_memory_mb), absl::GetFlag(FLAGS_solve), Seed(),
        absl::GetFlag(FLAGS_verbose));
  }
  if (type == "random") {
    return open_spiel::MakeUniformRandomBot(player, Seed());
  }

  open_spiel::SpielFatalError(
      "Bad player type. Known types: az, human, mcts, random");
}

open_spiel::Action GetAction(const open_spiel::State &state,
                             std::string action_str) {
  for (open_spiel::Action action : state.LegalActions()) {
    if (action_str == state.ActionToString(state.CurrentPlayer(), action))
      return action;
  }
  return open_spiel::kInvalidAction;
}

std::pair<std::vector<double>, std::vector<std::string>>
PlayGame(const open_spiel::Game &game,
         std::vector<std::unique_ptr<open_spiel::Bot>> &bots, std::mt19937 &rng,
         const std::vector<std::string> &initial_actions) {
  bool quiet = absl::GetFlag(FLAGS_quiet);
  std::unique_ptr<open_spiel::State> state = game.NewInitialState();
  std::vector<std::string> history;

  if (!quiet)
    std::cerr << "Initial state:\n" << state << std::endl;

  // Play the initial actions (if there are any).
  for (const auto &action_str : initial_actions) {
    open_spiel::Player current_player = state->CurrentPlayer();
    open_spiel::Action action = GetAction(*state, action_str);

    if (action == open_spiel::kInvalidAction)
      open_spiel::SpielFatalError(absl::StrCat("Invalid action: ", action_str));

    history.push_back(action_str);
    state->ApplyAction(action);

    if (!quiet) {
      std::cerr << "Player " << current_player
                << " forced action: " << action_str << std::endl;
      std::cerr << "Next state:\n" << state->ToString() << std::endl;
    }
  }

  while (!state->IsTerminal()) {
    open_spiel::Player player = state->CurrentPlayer();

    open_spiel::Action action;
    if (state->IsChanceNode()) {
      // Chance node; sample one according to underlying distribution.
      open_spiel::ActionsAndProbs outcomes = state->ChanceOutcomes();
      action = open_spiel::SampleAction(outcomes, rng).first;
    } else {
      // The state must be a decision node, ask the right bot to make its
      // action.
      action = bots[player]->Step(*state);
    }
    if (!quiet)
      std::cerr << "Player " << player
                << " chose action: " << state->ActionToString(player, action)
                << std::endl;

    // Inform the other bot of the action performed.
    for (open_spiel::Player p = 0; p < bots.size(); ++p) {
      if (p != player) {
        bots[p]->InformAction(*state, player, action);
      }
    }

    // Update history and get the next state.
    history.push_back(state->ActionToString(player, action));
    state->ApplyAction(action);

    if (!quiet)
      std::cerr << "Next state:\n" << state->ToString() << std::endl;
  }

  std::cerr << "Returns: " << absl::StrJoin(state->Returns(), ", ")
            << std::endl;
  std::cerr << "Game actions: " << absl::StrJoin(history, ", ") << std::endl;

  return {state->Returns(), history};
}

int main(int argc, char **argv) {
  std::vector<char *> positional_args = absl::ParseCommandLine(argc, argv);
  std::mt19937 rng(Seed());  // Random number generator.

  // Create the game.
  std::string game_name = absl::GetFlag(FLAGS_game);
  std::cerr << "Game: " << game_name << std::endl;
  std::shared_ptr<const open_spiel::Game> game =
      open_spiel::LoadGame(game_name);

  // Ensure the game is AlphaZero-compatible and arguments are compatible.
  open_spiel::GameType game_type = game->GetType();
  if (game->NumPlayers() != 2)
    open_spiel::SpielFatalError("AlphaZero can only handle 2-player games.");
  if (game_type.reward_model != open_spiel::GameType::RewardModel::kTerminal)
    open_spiel::SpielFatalError("Game must have terminal rewards.");
  if (game_type.dynamics != open_spiel::GameType::Dynamics::kSequential)
    open_spiel::SpielFatalError("Game must have sequential turns.");
  if (absl::GetFlag(FLAGS_az_path).empty())
    open_spiel::SpielFatalError("AlphaZero path must be specified.");
  if (absl::GetFlag(FLAGS_player1) != "az" &&
      absl::GetFlag(FLAGS_player2) != "az")
    open_spiel::SpielFatalError("One of the players must be AlphaZero.");

  open_spiel::algorithms::torch_az::DeviceManager device_manager;
  device_manager.AddDevice(open_spiel::algorithms::torch_az::VPNetModel(
      *game, absl::GetFlag(FLAGS_az_path), absl::GetFlag(FLAGS_az_graph_def),
      "/cpu:0"));
  device_manager.Get(0, 0)->LoadCheckpoint(absl::GetFlag(FLAGS_az_checkpoint));
  auto az_evaluator =
      std::make_shared<open_spiel::algorithms::torch_az::VPNetEvaluator>(
          /*device_manager=*/&device_manager,
          /*batch_size=*/absl::GetFlag(FLAGS_az_batch_size),
          /*threads=*/absl::GetFlag(FLAGS_az_threads),
          /*cache_size=*/absl::GetFlag(FLAGS_az_cache_size),
          /*cache_shards=*/absl::GetFlag(FLAGS_az_cache_shards));
  auto evaluator =
      std::make_shared<open_spiel::algorithms::RandomRolloutEvaluator>(
          absl::GetFlag(FLAGS_rollout_count), Seed());

  std::vector<std::unique_ptr<open_spiel::Bot>> bots;
  bots.push_back(
      InitBot(absl::GetFlag(FLAGS_player1), *game, 0, evaluator, az_evaluator));
  bots.push_back(
      InitBot(absl::GetFlag(FLAGS_player2), *game, 1, evaluator, az_evaluator));

  std::vector<std::string> initial_actions;
  for (int i = 1; i < positional_args.size(); ++i) {
    initial_actions.push_back(positional_args[i]);
  }

  std::map<std::string, int> histories;
  std::vector<double> overall_returns(2, 0);
  std::vector<int> overall_wins(2, 0);
  int num_games = absl::GetFlag(FLAGS_num_games);
  for (int game_num = 0; game_num < num_games; ++game_num) {
    auto [returns, history] = PlayGame(*game, bots, rng, initial_actions);
    histories[absl::StrJoin(history, " ")] += 1;
    for (int i = 0; i < returns.size(); ++i) {
      double v = returns[i];
      overall_returns[i] += v;
      if (v > 0) {
        overall_wins[i] += 1;
      }
    }
  }

  std::cerr << "Number of games played: " << num_games << std::endl;
  std::cerr << "Number of distinct games played: " << histories.size()
            << std::endl;
  std::cerr << "Players: " << absl::GetFlag(FLAGS_player1) << ", "
            << absl::GetFlag(FLAGS_player2) << std::endl;
  std::cerr << "Overall wins: " << absl::StrJoin(overall_wins, ", ")
            << std::endl;
  std::cerr << "Overall returns: " << absl::StrJoin(overall_returns, ", ")
            << std::endl;

  return 0;
}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Serialized Form (ORC MapReduce 1.6.9 API)</title>
<meta name="date" content="2021-07-02">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Serialized Form

Package org.apache.orc.mapred

Class org.apache.orc.mapred.OrcList extends ArrayList<E extends WritableComparable> implements Serializable

Serialized Fields

childSchema

TypeDescription childSchema

Class org.apache.orc.mapred.OrcMap extends TreeMap<K extends WritableComparable,V extends WritableComparable> implements Serializable

Serialized Fields

keySchema

TypeDescription keySchema

valueSchema

TypeDescription valueSchema

Class org.apache.orc.mapred.OrcTimestamp extends Timestamp implements Serializable

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2013–2021 The Apache Software Foundation. All rights reserved.


text:
 **android中设置activity切换动画有 两种实现方式**

 1 . 在 AndroidManifest.xml 文件activity标签中,通过设置 android:theme 主题属性来自定义我们 Activity的切换动画( 主题可以定义很多属性,动画只是其中之一)。

```
<activity
    android:name="whateverNameActivity"
    android:theme="@style/myActivityTheme" >
</activity>
```

首先要定义自己的主题,打开res/values/styles.xml文件,加入

```
<style name="myActivityTheme">
  <itemname="android:windowAnimationStyle">@style/myAnimTheme />
</style>
```
然后继续定义具体切换动画样式,分为4种需要动画的情况。

打开新界面时 :

 - 新界面出现(android:activityOpenEnterAnimation)
 - 当前界面消失(android:activityOpenExitAnimation)

返回上一界面时:

 - 当前界面消失(android:activityCloseExitAnimation)
 - 上一界面出现(android:activityCloseEnterAnimation)

> a、b、c、d为自定义在res/anim下的具体动画效果文件(下面贴出)

```
<style name="myAnimTheme " parent="@android:style/Animation.Activity">
    <item name="android:activityOpenEnterAnimation">@anim/a />
    <item name="android:activityOpenExitAnimation">@anim/b />
    <item name="android:activityCloseEnterAnimation">@anim/c />
    <item name="android:activityCloseExitAnimation">@anim/d />
</style>
```

2 . 在Android的2.0版本之后,加入了overridePendingTransition()这个函数来帮我们实现activity切换动画,它**在startActivity()或者finish()函数之后调用**

![这里写图片描述](http://img.blog.csdn.net/20160408111715900)

它有两个参数,
enterAnim是下一界面进入效果的xml文件的id,
exitAnim是当前界面退出效果的xml文件id。

> 我们可以看出它也实现了第一种方式的四种动画情况。

注意:

 - 当我们不想要动画时,设置为 0 即可。
 - 我们可以看出这个方法是定义在android.app.Activity下的,如果我们用自定义的view或fragment等嵌入到Activity中,调用这个函数时很可能不起作用。一般改写为this.getParent().overridePendingTransition 就可以解决。

3 .上 res/anim 下的各种动画文件

zoomin.xml:

```
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator">

<scale android:fromXScale="0.1"
android:toXScale="1.0"
android:fromYScale="0.1"
android:toYScale="1.0"
android:pivotX="50%p"
android:pivotY="50%p"
android:duration="300" />

<alpha
android:fromAlpha="0.1"
android:toAlpha="1.0"
android:duration="300" />
</set>
```
zoomout.xml

```
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator"
android:zAdjustment="top">

<scale android:fromXScale="1.0"
android:toXScale=".5"
android:fromYScale="1.0"
android:toYScale=".5"
android:pivotX="50%p"
android:pivotY="50%p"
android:duration="300" />

<alpha android:fromAlpha="1.0"
android:toAlpha="0"
android:duration="300"/>
</set>
```
out_from_right.xml

```
<?xml version="1.0" encoding="utf-8"?>

<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:fromXDelta="0"
    android:fromYDelta="0"
    android:toXDelta="100%p"
    android:toYDelta="0" >

</translate>
```

in_from_left.xml

```
<?xml version="1.0" encoding="utf-8"?>

<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:fromXDelta="-100%p"
    android:fromYDelta="0"
    android:toXDelta="0"
    android:toYDelta="0" >

</translate>
```
out_from_left.xml

```
<?xml version="1.0" encoding="utf-8"?>

<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:fromXDelta="0"
    android:fromYDelta="0"
    android:toXDelta="-100%p"
    android:toYDelta="0" >

</translate>
```

in_from_right.xml

```
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:fromXDelta="100%p"
    android:fromYDelta="0"
    android:toXDelta="0"
    android:toYDelta="0" >

</translate>
```
fade.xml

```
<?xml version="1.0" encoding="utf-8"?>

<alpha xmlns:android="http://schemas.android.com/apk/res/android"
       android:interpolator="@android:anim/accelerate_interpolator"
       android:fromAlpha="0.0" android:toAlpha="1.0"
       android:duration="2000" />

```

hold.xml

```
<?xml version="1.0" encoding="utf-8"?>

<translate xmlns:android="http://schemas.android.com/apk/res/android"
       android:interpolator="@android:anim/accelerate_interpolator"
       android:fromXDelta="0" android:toXDelta="0"
       android:duration="2000" />

```
hyperspace_in.xml

```
<?xml version="1.0" encoding="utf-8"?>

<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="2000"
android:startOffset="1200" />

```

hyperspace_out.xml

```
<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android"
	android:shareInterpolator="false">
	<scale android:interpolator="@android:anim/accelerate_decelerate_interpolator"
		android:fromXScale="1.0"
		android:fromYScale="1.0"
		android:toYScale="0.6"
		android:pivotX="50%"
		android:pivotY="50%"
        android:duration="2000" />

	<set android:interpolator="@android:anim/accelerate_interpolator"
		android:startOffset="700">
		<scale android:fromXScale="1.4"
		 android:toXScale="0.0"
		android:toYScale="0.0"
		android:pivotX="50%"
		android:pivotY="50%"
		android:duration="2000" />
		<rotate android:fromDegrees="0"
		android:toDegrees="-45"
		android:pivotX="50%"
		android:pivotY="50%"
		android:duration="2000" />
	</set>
</set>

```
alpha_action.xml

```
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<alpha android:fromAlpha="1.0"
android:toAlpha="0"
android:duration="2000"/>
<!-- 透明度控制动画效果 alpha
        0.0表示完全透明
        1.0表示完全不透明
        以上值取0.0-1.0之间的float数据类型的数字

-->
</set>
```
scale_action.xml

```
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
	<scale android:interpolator="@android:anim/accelerate_decelerate_interpolator"
		android:fromXScale="0.0"
		android:toXScale="1.4"
		android:fromYScale="0.0"
		android:toYScale="1.4"
		android:pivotX="50%"
		android:pivotY="50%"
		android:fillAfter="false"
		android:duration="2000" />
</set>
```

scale_rotate.xml

```
<?xml version="1.0" encoding="utf-8"?>
<!-- android:duration="@android:integer/config_mediumAnimTime" -->
<set xmlns:android="http://schemas.android.com/apk/res/android"
	android:shareInterpolator="false">
	<scale android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
		android:fromXScale="0.0"
		android:toXScale="1.0"
		android:fromYScale="0.0"
		android:toYScale="1.0"
		android:pivotX="50%"
		android:pivotY="50%"
		android:duration="2000"
		android:repeatCount="0"
		android:startOffset="20"></scale>

	<rotate android:interpolator="@android:anim/accelerate_decelerate_interpolator"
		android:fromDegrees="0"
		android:toDegrees="+355"
		android:pivotX="50%"
		android:pivotY="50%"
		android:duration="2000" />
</set>

```

scale_translate.xml

```
<?xml version="1.0" encoding="utf-8"?>
<!-- android:duration="@android:integer/config_mediumAnimTime" -->
<set xmlns:android="http://schemas.android.com/apk/res/android"
	android:shareInterpolator="false">
	<scale android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
		android:fromXScale="0.0"
		android:toXScale="1.0"
		android:fromYScale="0.0"
		android:toYScale="1.0"
		android:pivotX="0"
		android:pivotY="0"
		android:duration="2000"
		android:repeatCount="0"
		android:startOffset="0"></scale>

	<translate android:fromXDelta="0"
		android:toXDelta="0"
		android:fromYDelta="0"
		android:toYDelta="0"
		android:duration="2000" />
</set>

```
scale_translate_rotate.xml

```
<?xml version="1.0" encoding="utf-8"?>
<!-- android:duration="@android:integer/config_mediumAnimTime" -->
<set xmlns:android="http://schemas.android.com/apk/res/android"
	android:shareInterpolator="false">
	<scale android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
		android:fromXScale="0.0"
		android:toXScale="1.0"
		android:fromYScale="0.0"
		android:toYScale="1.0"
		android:pivotX="50%"
		android:pivotY="50%"
		android:duration="2000"></scale>

	<translate android:interpolator="@android:anim/accelerate_decelerate_interpolator"
		android:fromXDelta="120"
		android:toXDelta="30"
		android:fromYDelta="30"
		android:toYDelta="250"
		android:duration="2000" />

	<rotate android:interpolator="@android:anim/accelerate_decelerate_interpolator"
		android:fromDegrees="0"
		android:toDegrees="+355"
		android:pivotX="50%"
		android:pivotY="50%"
		android:duration="2000" />
</set>

```

slide_down_out.xml

```
<?xml version="1.0" encoding="UTF-8"?>
<set android:interpolator="@android:anim/accelerate_interpolator"
	xmlns:android="http://schemas.android.com/apk/res/android">
	<translate android:duration="2000"
		android:fromYDelta="0.0"
		android:toYDelta="100.0%p" />
</set>
```

wave_scale.xml

```
<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android"
	android:interpolator="@android:anim/accelerate_interpolator">
	<alpha android:fromAlpha="0.0"
		android:toAlpha="1.0"
		android:duration="2000" />

	<scale android:fromXScale="0.5"
		android:toXScale="1.5"
		android:fromYScale="0.5"
		android:toYScale="1.5"
		android:pivotX="50%"
		android:pivotY="50%"
		android:duration="2000" />

	<scale android:fromXScale="1.5"
		android:toXScale="1.0"
		android:fromYScale="1.5"
		android:toYScale="1.0"
		android:pivotX="50%"
		android:pivotY="50%"
		android:startOffset="200"
		android:duration="2000" />
</set>

```


text:
import {Input, OnDestroy, OnInit} from "@angular/core";
import * as angular from "angular";
import * as _ from "underscore";

import {FeedDataTransformation} from "../../model/feed-data-transformation";
import {TableSchema} from "../../model/table-schema";
import {UserDatasource} from "../../model/user-datasource";
import {QueryEngine} from "../wrangler/query-engine";

declare const flowchart: any;

const moduleName: string = require("feed-mgr/visual-query/module-name");

/**
 * Code for the delete key.
 */
const DELETE_KEY_CODE = 46;

/**
 * Code for control key.
 */
const CTRL_KEY_CODE = 17;

/**
 * Code for A key.
 */
const A_KEY_CODE = 65;

/**
 * Code for esc key.
 */
const ESC_KEY_CODE = 27;

/**
 * Displays the Build Query step of the Visual Query page.
 *
 * There are two modes for how the user may build their query:
 *
 * - Visual Mode - (default) A {@code QueryEngine} is used to retrieve a list of tables and the schema is displayed in a flow chart. The nodes in the flow chart can be connected to create joins
 * between tables.
 *
 * - Advanced Mode - A textarea is provided for the user to input their query.
 */
export class QueryBuilderComponent implements OnDestroy, OnInit {

    /**
     * Indicates if the UI is in advanced mode
     */
    advancedMode: boolean = false;

    /**
     * Text indicating which node to switch to
     */
    advancedModeText: string;

    /**
     * List of data sources to display.
     */
    availableDatasources: UserDatasource[] = [];

    /**
     * Model for the chart.
     */
    chartViewModel: any;

    /**
     * Indicates that there was an error retrieving the list of tables.
     * @type {boolean} true if there was an error or false otherwise
     */
    databaseConnectionError: boolean = false;

    /**
     * Query engine for determining capabilities.
     */
    @Input()
    engine: QueryEngine<any>;

    /**
     * Error message to be displayed.
     */
    error: string;

    /**
     * Height offset from the top of the page.
     */
    heightOffset: string = "0";

    /**
     * Indicates if the model is valid.
     */
    isValid: boolean = false;

    /**
     * Indicates that the page is being loaded.
     */
    loadingPage: boolean = true;

    /**
     * Indicates that a table schema is being loaded.
     */
    loadingSchema: boolean = false;

    /**
     * Data transformation model
     */
    @Input()
    model: FeedDataTransformation;

    /**
     * Next node id.
     */
    nextNodeID = 10;

    /**
     * List of the data sources used in model.
     * @type {Array.<string>}
     */
    selectedDatasourceIds: string[] = [];

    /**
     * holds the metadata about each column and table that is used to build the SQL str in the getSQLModel() method
     */
    selectedColumnsAndTables: any = [];

    /**
     * Step index (0-based) for this component.
     */
    stepIndex: number;

    /**
     * Step number (1-based) for this component.
     */
    stepNumber: number;

    /**
     * Controller for parent stepper component.
     */
    stepperController: object;

    /**
     * Autocomplete for the table selector.
     */
    tablesAutocomplete: any = {
        clear: this.onAutocompleteClear.bind(this),
        searchText: "",
        selectedTable: null,
        noCache: true,
        querySearch: this.onAutocompleteQuerySearch.bind(this),
        refreshCache: this.onAutocompleteRefreshCache.bind(this),
        delay: 900
    };

    /**
     * List of native data sources to exclude from the model.
     */
    private nativeDataSourceIds: string[] = [];

    /**
     * Constructs a {@code BuildQueryComponent}.
     */
    constructor(private $scope: angular.IScope, $element: angular.IAugmentedJQuery, private $mdToast: angular.material.IToastService, private $mdDialog: angular.material.IDialogService,
                private $document: angular.IDocumentService, private Utils: any, private RestUrlService: any, private HiveService: any, private SideNavService: any, private StateService: any,
                private VisualQueryService: any, private FeedService: any, private DatasourcesService: any) {
        // Setup initializers
        this.$scope.$on("$destroy", this.ngOnDestroy.bind(this));
        this.initKeyBindings();

        // Setup environment
        this.heightOffset = $element.attr("height-offset");
        this.SideNavService.hideSideNav();
    }

    /**
     * Get or set the SQL for the advanced mode.
     */
    advancedModeSql(sql: string = null) {
        if (sql !== null) {
            this.model.sql = sql;
            this.validate();
        }
        return this.model.sql;
    }

    /**
     * Indicates if the active datasource can be changed.
     */
    canChangeDatasource(): boolean {
        return (this.error == null && (this.engine.allowMultipleDataSources || this.selectedDatasourceIds.length === 0));
    }

    /**
     * Gets the browser height offset for the element with the specified offset from the top of this component.
     */
    getBrowserHeightOffset(elementOffset: number): number {
        return parseInt(this.heightOffset) + elementOffset;
    }

    /**
     * Adds the table to the flowchart.
     */
    onAddTable() {
        this.SideNavService.hideSideNav();
        this.onTableClick(this.tablesAutocomplete.selectedTable);
        this.tablesAutocomplete.clear();
    }

    /**
     * Initialize state from services.
     */
    private init() {
        const self = this;

        // Get the list of data sources
        Promise.all([self.engine.getNativeDataSources(), this.DatasourcesService.findAll()])
            .then(resultList => {
                self.nativeDataSourceIds = resultList[0].map((dataSource: UserDatasource): string => dataSource.id);

                const supportedDatasources = resultList[0].concat(resultList[1]).filter(self.engine.supportsDataSource);
                if (supportedDatasources.length > 0) {
                    return supportedDatasources;
                } else {
                    const supportedNames = (function (supportedNameList) {
                        if (supportedNameList.length === 0) {
                            return "";
                        } else if (supportedNameList.length === 1) {
                            return `Please create a ${supportedNameList[0]} data source and try again.`;
                        } else {
                            return `Please create one of the following data sources and try again: ${supportedNameList.join(", ")}`;
                        }
                    })(self.engine.getSupportedDataSourceNames());
                    throw new Error("No supported data sources were found. " + supportedNames);
                }
            })
            .then((datasources: UserDatasource[]) => {
                self.availableDatasources = datasources;
                if (self.model.$selectedDatasourceId == null) {
                    self.model.$selectedDatasourceId = datasources[0].id;
                }
                self.validate();
            })
            .catch((err: string) => {
                self.error = err;
            })
            .then(function () {
                self.loadingPage = false;
            });
    }

    /**
     * Initialize the key bindings.
     */
    private initKeyBindings() {
        const self = this;

        //
        // Set to true when the ctrl key is down.
        //
        let ctrlDown = false;

        //
        // Event handler for key-down on the flowchart.
        //
        this.$document.bind('keydown', function (evt: JQueryKeyEventObject) {
            if (evt.keyCode === CTRL_KEY_CODE) {
                ctrlDown = true;
                evt.stopPropagation();
                evt.preventDefault();
            }
        });

        //
        // Event handler for key-up on the flowchart.
        //
        this.$document.bind('keyup', function (evt: JQueryKeyEventObject) {
            if (evt.keyCode === DELETE_KEY_CODE) {
                //
                // Delete key.
                //
                self.chartViewModel.deleteSelected();
                self.validate();
            }

            if (evt.keyCode == A_KEY_CODE && ctrlDown) {
                //
                // Ctrl + A
                //
                self.chartViewModel.selectAll();
            }

            if (evt.keyCode == ESC_KEY_CODE) {
                // Escape.
                self.chartViewModel.deselectAll();
            }

            if (evt.keyCode === CTRL_KEY_CODE) {
                ctrlDown = false;

                evt.stopPropagation();
                evt.preventDefault();
            }
        });
    }

    /**
     * Initialize the model for the flowchart.
     */
    setupFlowChartModel() {
        const self = this;
        // Load data model
        let chartDataModel: any;
        if (this.model.chartViewModel != null) {
            chartDataModel = this.model.chartViewModel;
        } else {
            chartDataModel = {"nodes": [], "connections": []};
        }

        // Prepare nodes
        angular.forEach(chartDataModel.nodes, function (node: any) {
            // Add utility functions
            self.prepareNode(node);

            // Determine next node ID
            self.nextNodeID = Math.max(node.id + 1, self.nextNodeID);
        });

        // Create view model
        this.chartViewModel = new flowchart.ChartViewModel(chartDataModel, this.onCreateConnectionCallback.bind(this), this.onEditConnectionCallback.bind(this),
            this.onDeleteSelectedCallback.bind(this));
    }

    /**
     * Called after a user Adds a table to fetch the Columns and datatypes.
     * @param schema - the schema name
     * @param table - the table name
     */
    private getTableSchema(schema: string, table: string): Promise<TableSchema> {
        const self = this;
        return this.engine.getTableSchema(schema, table, this.model.$selectedDatasourceId)
            .then(function (tableSchema: TableSchema) {
                self.loadingSchema = false;
                return tableSchema;
            });
    }

    /**
     * Validate the canvas.
     * If there is at least one table defined, it is valid
     * TODO enhance to check if there are any tables without connections
     */
    private validate() {
        const self = this;
        if (this.advancedMode) {
            let sql = this.advancedModeSql();
            this.isValid = (typeof(sql) !== "undefined" && sql.length > 0);

            this.model.$selectedColumnsAndTables = null;
            this.model.chartViewModel = null;
            this.model.datasourceIds = this.nativeDataSourceIds.indexOf(this.model.$selectedDatasourceId) < 0 ? [this.model.$selectedDatasourceId] : [];
            this.model.$datasources = this.DatasourcesService.filterArrayByIds(this.model.$selectedDatasourceId, this.availableDatasources);
        } else if (this.chartViewModel.nodes != null) {
            this.isValid = (this.chartViewModel.nodes.length > 0);

            this.model.chartViewModel = this.chartViewModel.data;
            this.model.sql = this.getSQLModel();
            this.model.$selectedColumnsAndTables = this.selectedColumnsAndTables;
            this.model.datasourceIds = this.selectedDatasourceIds.filter(id => self.nativeDataSourceIds.indexOf(id) < 0);
            this.model.$datasources = this.DatasourcesService.filterArrayByIds(this.selectedDatasourceIds, this.availableDatasources);
        } else {
            this.isValid = false;
        }
    }

    private getNewXYCoord() {
        let coord = {x: 20, y: 20};
        //attempt to align it on the top
        if (this.chartViewModel.data.nodes.length > 0) {
            //constants
            let yThreshold = 150;
            let tableWidth = 250;

            //reduce the set to just show those in the top row
            let tables = _.filter(this.chartViewModel.data.nodes, function (table: any) {
                return table.y <= yThreshold;
            });
            //sort by x then y (underscore sort is reverse thinking)
            tables = _.chain(tables).sortBy('y').sortBy('x').value();
            let lastX = coord.x;
            _.some(tables, function (table: any) {
                //if this table is within the top row
                //move over to find the next X position on the top row that is open
                if (table.x < lastX + tableWidth) {
                    lastX = table.x + table.width;
                }
                else {
                    //break out
                    return true;
                }

            });
            if (lastX > 20) {
                //add padding
                lastX += 20;
            }
            coord.x = lastX;

        }
        return coord;
    }

    /**
     * Turn on SQL mode.
     */
    toggleAdvancedMode() {
        let self = this;
        if (this.advancedMode === false) {
            let goAdvanced = function () {
                self.advancedMode = true;
                self.advancedModeText = "Visual Mode";
            };
            if (this.chartViewModel.nodes.length > 0) {
                this.$mdDialog.show(
                    this.$mdDialog.confirm()
                        .parent($("body"))
                        .clickOutsideToClose(true)
                        .title("Switch to advanced mode")
                        .textContent("If you switch to the advanced SQL editor then you will no longer be able to return to this visual editor. Are you sure you want to continue?")
                        .ariaLabel("Switch to advanced mode or stay in visual editor?")
                        .ok("Continue")
                        .cancel("Cancel")
                ).then(goAdvanced);
            } else {
                goAdvanced();
            }
        } else {
            this.advancedMode = false;
            this.model.sql = "";
            this.advancedModeText = "Advanced Mode";
        }

    };

    /**
     * Adds utility functions to a node data model.
     *
     * @param node - the node data model
     */
    prepareNode(node: any) {
        const self = this;
        /**
         * Indicates if all of the attributes are selected.
         *
         * @returns {@code true} if all attributes are selected, or {@code false} otherwise
         */
        node.nodeAttributes.hasAllSelected = function (): boolean {
            return _.every(this.attributes, function (attr: any) {
                return attr.selected
            });
        };

        /**
         * Selects the specified attribute.
         *
         * @param attr - the attribute to be selected
         */
        node.nodeAttributes.select = function (attr: any): void {
            attr.selected = true;
            this.selected.push(attr);
            self.validate();
        };

        /**
         * Selects all attributes.
         */
        node.nodeAttributes.selectAll = function (): void {
            let selected: any = [];
            angular.forEach(this.attributes, function (attr: any) {
                attr.selected = true;
                selected.push(attr);
            });
            this.selected = selected;
            self.validate();
        };

        /**
         * Deselects the specified attribute.
         *
         * @param attr - the attribute to be deselected
         */
        node.nodeAttributes.deselect = function (attr: any): void {
            attr.selected = false;
            let idx = this.selected.indexOf(attr);
            if (idx > -1) {
                this.selected.splice(idx, 1);
            }
            self.validate();
        };

        /**
         * Deselects all attributes.
         */
        node.nodeAttributes.deselectAll = function (): void {
            angular.forEach(this.attributes, function (attr: any) {
                attr.selected = false;
            });
            this.selected = [];
            self.validate();
        };
    };

    //
    // Add a new node to the chart.
    //
    onTableClick(table: any) {
        const self = this;

        //get attributes for table
        const datasourceId = this.model.$selectedDatasourceId;
        const nodeName = table.schema + "." + table.tableName;
        this.getTableSchema(table.schema, table.tableName).then(function (schemaData: any) {
            //
            // Template for a new node.
            //
            const coord = self.getNewXYCoord();

            angular.forEach(schemaData.fields, function (attr: any) {
                attr.selected = true;
                if (self.engine.useNativeDataType) {
                    attr.dataTypeWithPrecisionAndScale = attr.nativeDataType.toLowerCase();
                }
            });
            const newNodeDataModel: any = {
                name: nodeName,
                id: self.nextNodeID++,
                datasourceId: datasourceId,
                x: coord.x,
                y: coord.y,
                nodeAttributes: {
                    attributes: schemaData.fields,
                    reference: [table.schema, table.tableName],
                    selected: []
                },
                connectors: {
                    top: {},
                    bottom: {},
                    left: {},
                    right: {}
                },
                inputConnectors: [
                    {
                        name: ""
                    }
                ],
                outputConnectors: [
                    {
                        name: ""
                    }
                ]
            };
            self.prepareNode(newNodeDataModel);
            self.chartViewModel.addNode(newNodeDataModel);
            self.validate();
        });

    };

    /**
     * Parses the tables on the canvas and returns a SQL string, along with populating the self.selectedColumnsAndTables array of objects.
     *
     * @returns the SQL string or null if multiple data sources are used
     */
    getSQLModel(): string | null {
        let builder = this.VisualQueryService.sqlBuilder(this.chartViewModel.data, this.engine.sqlDialect);
        let sql = builder.build();

        this.selectedColumnsAndTables = builder.getSelectedColumnsAndTables();
        this.selectedDatasourceIds = builder.getDatasourceIds();
        return sql;
    }

    /**
     * When a connection is edited
     */
    onEditConnectionCallback(connectionViewModel: any, connectionDataModel: any, dest: any, source: any) {
        this.showConnectionDialog(false, connectionViewModel, connectionDataModel, source, dest);
    };

    /**
     * When a connection is created
     */
    onCreateConnectionCallback(connectionViewModel: any, connectionDataModel: any, dest: any, source: any, inputConnection: any, outputConnection: any) {
        // Ensure connection is unique
        let newDestID = dest.data.id;
        let newSourceID = source.data.id;

        for (let i = 0; i < this.chartViewModel.data.connections.length - 1; ++i) {
            let oldDestID = this.chartViewModel.data.connections[i].dest.nodeID;
            let oldSourceID = this.chartViewModel.data.connections[i].source.nodeID;
            if ((oldDestID === newDestID && oldSourceID === newSourceID) || (oldDestID === newSourceID && oldSourceID === newDestID)) {
                // Delete connection
                this.chartViewModel.deselectAll();
                connectionViewModel.select();
                this.chartViewModel.deleteSelected();

                // Display error message
                let alert = this.$mdDialog.alert()
                    .parent($('body'))
                    .clickOutsideToClose(true)
                    .title("Duplicate join")
                    .textContent("There is already a join between those two tables. Please edit the existing join or switch to advanced mode.")
                    .ariaLabel("joins must be unique")
                    .ok("Got it!");
                this.$mdDialog.show(alert);
                return;
            }
        }

        // Add connection
        this.showConnectionDialog(true, connectionViewModel, connectionDataModel, source, dest);
        this.validate();
    };

    /**
     * Called when the current selection is deleted.
     */
    onDeleteSelectedCallback() {
        this.validate();
    };

    showConnectionDialog(isNew: any, connectionViewModel: any, connectionDataModel: any, source: any, dest: any) {
        const self = this;
        this.chartViewModel.deselectAll();
        this.$mdDialog.show({
            controller: 'ConnectionDialog',
            templateUrl: 'js/feed-mgr/visual-query/build-query/connection-dialog/connection-dialog.component.html',
            parent: angular.element(document.body),
            clickOutsideToClose: false,
            fullscreen: true,
            locals: {
                isNew: isNew,
                connectionDataModel: connectionDataModel,
                source: source,
                dest: dest
            }
        })
            .then(function (msg: any) {
                if (msg === "delete" || (isNew && msg === "cancel")) {
                    connectionViewModel.select();
                    self.chartViewModel.deleteSelected();
                }
                self.validate();
            });
    };

    // -----------------
    // Angular Callbacks
    // -----------------

    /**
     * Cleanup environment when this directive is destroyed.
     */
    ngOnDestroy(): void {
        this.SideNavService.showSideNav();
        this.$document.unbind("keydown");
        this.$document.unbind("keypress");
        this.$document.unbind("keyup");
    }

    /**
     * Finish initializing after data-bound properties are initialized.
     */
    ngOnInit(): void {
        // Initialize properties dependent on data-bound properties
        this.stepNumber = this.stepIndex + 1;

        if (this.model.$selectedDatasourceId == null && this.model.datasourceIds && this.model.datasourceIds.length > 0) {
            this.model.$selectedDatasourceId = this.model.datasourceIds[0];
        }

        // Allow for SQL editing
        if (this.model.chartViewModel == null && typeof this.model.sql !== "undefined" && this.model.sql !== null) {
            this.advancedMode = true;
            this.advancedModeText = "Visual Mode";
        } else {
            this.advancedMode = false;
            this.advancedModeText = "Advanced Mode";
        }

        // Wait for query engine to load
        const onLoad = () => {
            // Initialize state
            this.init();

            // Setup the flowchart Model
            this.setupFlowChartModel();

            // Validate when the page loads
            this.validate();
        };

        if (this.engine instanceof Promise) {
            this.engine.then(queryEngine => {
                this.engine = queryEngine;
                onLoad();
            });
        } else {
            onLoad();
        }
    }

    /**
     * Finish initializing after data-bound properties are initialized.
     */
    $onInit(): void {
        this.ngOnInit();
    }

    // ----------------------
    // Autocomplete Callbacks
    // ----------------------

    onAutocompleteClear() {
        this.tablesAutocomplete.searchText = '';
        this.tablesAutocomplete.selectedTable = null;
    }

    /**
     * Search the list of table names.
     */
    onAutocompleteQuerySearch(txt: any) {
        const self = this;
        const tables = this.engine.searchTableNames(txt, this.model.$selectedDatasourceId);
        if (tables instanceof Promise) {
            return tables.then(function (tables: any) {
                self.databaseConnectionError = false;
                return tables;
            }, function (): any {
                self.databaseConnectionError = true;
                return [];
            });
        } else {
            return tables;
        }
    }

    onAutocompleteRefreshCache() {
        const successFn = function() {
            let searchText = this.tablesAutocomplete.searchText.trim();
            angular.element('#tables-auto-complete').focus().val(searchText).trigger('change')
        };
        const errorFn = function() {
        };
        this.HiveService.refreshTableCache().then(successFn, errorFn);
    }
}

angular.module(moduleName).component("thinkbigVisualQueryBuilder", {
    bindings: {
        engine: "=",
        heightOffset: "@",
        model: "=",
        stepIndex: "@"
    },
    controller: ["$scope", "$element", "$mdToast", "$mdDialog", "$document", "Utils", "RestUrlService", "HiveService", "SideNavService", "StateService", "VisualQueryService", "FeedService",
        "DatasourcesService", QueryBuilderComponent],
    controllerAs: "$bq",
    require: {
        stepperController: "^thinkbigStepper"
    },
    templateUrl: "js/feed-mgr/visual-query/build-query/build-query.component.html"
});


text:
"""
    Kubernetes

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

    OpenAPI spec version: v1.8.2

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from pprint import pformat
from six import iteritems
import re

class V1beta2StatefulSetSpec(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'pod_management_policy': 'str',
        'replicas': 'int',
        'revision_history_limit': 'int',
        'selector': 'V1LabelSelector',
        'service_name': 'str',
        'template': 'V1PodTemplateSpec',
        'update_strategy': 'V1beta2StatefulSetUpdateStrategy',
        'volume_claim_templates': 'list[V1PersistentVolumeClaim]'
    }

    attribute_map = {
        'pod_management_policy': 'podManagementPolicy',
        'replicas': 'replicas',
        'revision_history_limit': 'revisionHistoryLimit',
        'selector': 'selector',
        'service_name': 'serviceName',
        'template': 'template',
        'update_strategy': 'updateStrategy',
        'volume_claim_templates': 'volumeClaimTemplates'
    }

    def __init__(self, pod_management_policy=None, replicas=None, revision_history_limit=None, selector=None, service_name=None, template=None, update_strategy=None, volume_claim_templates=None):
        """
        V1beta2StatefulSetSpec - a model defined in Swagger
        """

        self._pod_management_policy = None
        self._replicas = None
        self._revision_history_limit = None
        self._selector = None
        self._service_name = None
        self._template = None
        self._update_strategy = None
        self._volume_claim_templates = None
        self.discriminator = None

        if pod_management_policy is not None:
          self.pod_management_policy = pod_management_policy
        if replicas is not None:
          self.replicas = replicas
        if revision_history_limit is not None:
          self.revision_history_limit = revision_history_limit
        if selector is not None:
          self.selector = selector
        self.service_name = service_name
        self.template = template
        if update_strategy is not None:
          self.update_strategy = update_strategy
        if volume_claim_templates is not None:
          self.volume_claim_templates = volume_claim_templates

    @property
    def pod_management_policy(self):
        """
        Gets the pod_management_policy of this V1beta2StatefulSetSpec.
        podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once.

        :return: The pod_management_policy of this V1beta2StatefulSetSpec.
        :rtype: str
        """
        return self._pod_management_policy

    @pod_management_policy.setter
    def pod_management_policy(self, pod_management_policy):
        """
        Sets the pod_management_policy of this V1beta2StatefulSetSpec.
        podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once.

        :param pod_management_policy: The pod_management_policy of this V1beta2StatefulSetSpec.
        :type: str
        """

        self._pod_management_policy = pod_management_policy

    @property
    def replicas(self):
        """
        Gets the replicas of this V1beta2StatefulSetSpec.
        replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1.

        :return: The replicas of this V1beta2StatefulSetSpec.
        :rtype: int
        """
        return self._replicas

    @replicas.setter
    def replicas(self, replicas):
        """
        Sets the replicas of this V1beta2StatefulSetSpec.
        replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1.

        :param replicas: The replicas of this V1beta2StatefulSetSpec.
        :type: int
        """

        self._replicas = replicas

    @property
    def revision_history_limit(self):
        """
        Gets the revision_history_limit of this V1beta2StatefulSetSpec.
        revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.

        :return: The revision_history_limit of this V1beta2StatefulSetSpec.
        :rtype: int
        """
        return self._revision_history_limit

    @revision_history_limit.setter
    def revision_history_limit(self, revision_history_limit):
        """
        Sets the revision_history_limit of this V1beta2StatefulSetSpec.
        revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.

        :param revision_history_limit: The revision_history_limit of this V1beta2StatefulSetSpec.
        :type: int
        """

        self._revision_history_limit = revision_history_limit

    @property
    def selector(self):
        """
        Gets the selector of this V1beta2StatefulSetSpec.
        selector is a label query over pods that should match the replica count. If empty, defaulted to labels on the pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors

        :return: The selector of this V1beta2StatefulSetSpec.
        :rtype: V1LabelSelector
        """
        return self._selector

    @selector.setter
    def selector(self, selector):
        """
        Sets the selector of this V1beta2StatefulSetSpec.
        selector is a label query over pods that should match the replica count. If empty, defaulted to labels on the pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors

        :param selector: The selector of this V1beta2StatefulSetSpec.
        :type: V1LabelSelector
        """

        self._selector = selector

    @property
    def service_name(self):
        """
        Gets the service_name of this V1beta2StatefulSetSpec.
        serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller.

        :return: The service_name of this V1beta2StatefulSetSpec.
        :rtype: str
        """
        return self._service_name

    @service_name.setter
    def service_name(self, service_name):
        """
        Sets the service_name of this V1beta2StatefulSetSpec.
        serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller.

        :param service_name: The service_name of this V1beta2StatefulSetSpec.
        :type: str
        """
        if service_name is None:
            raise ValueError("Invalid value for `service_name`, must not be `None`")

        self._service_name = service_name

    @property
    def template(self):
        """
        Gets the template of this V1beta2StatefulSetSpec.
        template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet.

        :return: The template of this V1beta2StatefulSetSpec.
        :rtype: V1PodTemplateSpec
        """
        return self._template

    @template.setter
    def template(self, template):
        """
        Sets the template of this V1beta2StatefulSetSpec.
        template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet.

        :param template: The template of this V1beta2StatefulSetSpec.
        :type: V1PodTemplateSpec
        """
        if template is None:
            raise ValueError("Invalid value for `template`, must not be `None`")

        self._template = template

    @property
    def update_strategy(self):
        """
        Gets the update_strategy of this V1beta2StatefulSetSpec.
        updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.

        :return: The update_strategy of this V1beta2StatefulSetSpec.
        :rtype: V1beta2StatefulSetUpdateStrategy
        """
        return self._update_strategy

    @update_strategy.setter
    def update_strategy(self, update_strategy):
        """
        Sets the update_strategy of this V1beta2StatefulSetSpec.
        updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.

        :param update_strategy: The update_strategy of this V1beta2StatefulSetSpec.
        :type: V1beta2StatefulSetUpdateStrategy
        """

        self._update_strategy = update_strategy

    @property
    def volume_claim_templates(self):
        """
        Gets the volume_claim_templates of this V1beta2StatefulSetSpec.
        volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name.

        :return: The volume_claim_templates of this V1beta2StatefulSetSpec.
        :rtype: list[V1PersistentVolumeClaim]
        """
        return self._volume_claim_templates

    @volume_claim_templates.setter
    def volume_claim_templates(self, volume_claim_templates):
        """
        Sets the volume_claim_templates of this V1beta2StatefulSetSpec.
        volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name.

        :param volume_claim_templates: The volume_claim_templates of this V1beta2StatefulSetSpec.
        :type: list[V1PersistentVolumeClaim]
        """

        self._volume_claim_templates = volume_claim_templates

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return pformat(self.to_dict())

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        if not isinstance(other, V1beta2StatefulSetSpec):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other


text:
module InternalNameHelper
  VERSION = '0.2.5'.freeze
end


text:
var HOST = "localhost";
var DATABASE_NAME = "ulboracms_ulboracms_org";
var PORT = 3001;

exports.HOST = HOST;
exports.DATABASE_NAME = DATABASE_NAME;
exports.PORT = PORT;


text:
Tuberry
=======

Raspberry-PI-based internet radio


text:
You can use this Node.js module to interact with the [Cumul.io](https://cumul.io) API in order to create, modify or delete datasets, dashboards or push new data into the platform in a programmatic way.

## Installation

`npm install cumulio`

## Usage

Include the `cumulio` npm package in your project. For example, to push data into the platform (triggering real-time dashboard updates):

```
var Cumulio = require('cumulio');

// Connect
var client = new Cumulio({
  api_key: '< your API key >',
  api_token: '< your API token >'
});

client.create(
  'data',
  {
    securable_id: '< dataset identifier >',
    data: [
      ['plaice', 2014, 2.1234, 751],
      ['plaice', 2015, 1.8765, 573]
    ]
  })
  .then(function() {
    console.log('Success!');
  })
  .catch(function(error) {
    console.error('API error:', error);
  })
  .finally(function() {
    client.close();
  });
```

## Documentation

The API documentation (available services and methods) can be found [here](http://docs.cumul.io).


text:
package com.bstek.bdf3.multitenant.ui.policy;

import java.lang.reflect.Field;

import org.malagu.multitenant.MultitenantUtils;

import com.bstek.bdf3.dorado.jpa.policy.impl.AbstractNewGeneratorPolicy;

/**
 * @author Kevin Yang (mailto:kevin.yang@bstek.com)
 * @since 2017年8月10日
 */
public class OrgIdPolicy extends AbstractNewGeneratorPolicy {

	@Override
	protected Object getValue(Object entity, Field field) {
		return MultitenantUtils.getLoginOrgId();
	}

}


text:
namespace ash {

// Mixin browser tests can use for setting up local state environment.
class LocalStateMixin : public InProcessBrowserTestMixin {
 public:
  class Delegate {
   public:
    void SetUpLocalStateBase();

    ~Delegate();

   private:
    // Implement this function to setup g_browser_process->local_state()
    virtual void SetUpLocalState() = 0;

    bool setup_called_ = false;
  };
  LocalStateMixin(InProcessBrowserTestMixinHost* host, Delegate* delegate);

  ~LocalStateMixin() override;
  void CreatedBrowserMainParts(
      content::BrowserMainParts* browser_main_parts) override;

 private:
  Delegate* const delegate_;
};

}  // namespace ash

// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
// source migration is finished.
namespace chromeos {
using ::ash::LocalStateMixin;
}

#endif  // CHROME_BROWSER_ASH_LOGIN_TEST_LOCAL_STATE_MIXIN_H_


text:
@Master['MasterPage'];

@Section['Content']

This is from content

@Partial['subview'];

@EndSection


text:
@gov.au/searchbox
============

>

## Contents

* [Install](#install)
* [Dependency graph](#dependency-graph)
* [Tests](#tests)
* [Release History](#release-history)
* [License](#license)

----------------------------------------------------------------------------------------------------------------------------------------------------------------

## Install

```shell
yarn add @gov.au/searchbox
```

```shell
npm install @gov.au/searchbox
```

**[⬆ back to top](#contents)**

----------------------------------------------------------------------------------------------------------------------------------------------------------------

## Dependency graph

```shell
searchbox
├─ core
├─ text-inputs
│  └─ core
└─ buttons
   └─ core
```

**[⬆ back to top](#contents)**

----------------------------------------------------------------------------------------------------------------------------------------------------------------

## Tests

The visual test: https://auds.service.gov.au/packages/searchbox/tests/site/

**[⬆ back to top](#contents)**

----------------------------------------------------------------------------------------------------------------------------------------------------------------

## Release History

* v0.2.3 - Display search icon for XS breakpoint when responsive (Fix based on the new grid breakpoints)
* v0.2.2 - Increase size for icon
* v0.2.1 - Add styling for secondary buttons
* v0.2.0 - Update padding on button, fix JSdoc
* v0.1.0 - 💥 Initial version

**[⬆ back to top](#contents)**

----------------------------------------------------------------------------------------------------------------------------------------------------------------

## License

Copyright (c) Commonwealth of Australia.
Licensed under [MIT](https://raw.githubusercontent.com/govau/design-system-components/packages/core/master/LICENSE).

**[⬆ back to top](#contents)**

# };

----------------------------------------------------------------------------------------------------------------------------------------------------------------

## Usage

* [React](#react)

**[⬆ back to top](#contents)**

----------------------------------------------------------------------------------------------------------------------------------------------------------------

### React

Usage:

```jsx
import AUsearchbox from '@gov.au/searchbox';

<AUsearchbox
	label="Search"
	btnText="Search"
	responsive={true}
	id="def-search"
	btnProps={{ onClick: () => console.log('hello'), className: 'blah', type: 'button' }}
/>

All props:

<AUsearchbox
	label="Search"                        {/* Text of the label */}
	btnText="Search"                      {/* Text on the button */}
	dark={true}                           {/* Dark variation */}
	responsive={true}                     {/* Responsive variation, text turns to icon on smaller devices*/}
	icon={false}                          {/* Icon only, hides text on button */}
	id="def-search"                       {/* ID of the text input, required */}
	className=""                          {/* Additional class, optional */}
	wrapper="form"                        {/* Wrapper component. Can be a div or form. */}
	btnProps= {{type: 'button'}}          {/* Additonal props to be spread into the button */}
	inputProps= {{type: 'text'}}          {/* Additonal props to be spread into the text input */}
/>
```


text:
<?xml version="1.0" encoding="UTF-8"?>
<refentry version="5.1" xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
          xmlns:xi="http://www.w3.org/2001/XInclude"
          xmlns:trans="http://docbook.org/ns/transclusion"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:m="http://www.w3.org/1998/Math/MathML"
          xmlns:html="http://www.w3.org/1999/xhtml"
          xmlns:db="http://docbook.org/ns/docbook">
  <refnamediv>
    <refname>redirect</refname>

    <refpurpose>Request for client-side redirection</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis label="/bin/redirect" role="iosh">
      <command role="iosh">redirect</command>

      <arg choice="req"><replaceable>url</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Examples</title>

    <para>Here are some examples.</para>

    <example>
      <title>Redirect to another page</title>

      <programlisting language="shell">redirect /foo</programlisting>
    </example>
  </refsection>

  <refsection>
    <title>Source</title>

    <programlisting language="shell" xlink:href="/bin/redirect"
                    xlink:show="replace"/>
  </refsection>
</refentry>


text:
function ecg_save_settings(handles, filename)
% ecg_save_settings(handles, filename)
% Function to save settings

% By Daniel Golden (dgolden1 at stanford dot edu)
% $Id$

if ~exist('filename', 'var')
	filename = 'ecg_settings.mat';
end

settings.edit_input_jpeg = get(handles.edit_input_jpeg, 'String');
settings.edit_output_db = get(handles.edit_output_db, 'String');
settings.checkbox_mark_on_load = get(handles.checkbox_mark_on_load, 'Value');
settings.checkbox_incl_notes = get(handles.checkbox_mark_on_load, 'Value');

full_settings_filename = fullfile(danmatlabroot, 'vlf', 'synoptic_summary_emission_characterizer', filename);
save(full_settings_filename, 'settings');
disp(sprintf('Saved settings to %s', full_settings_filename));


text:
<?xml version="1.0" encoding="utf-8" ?>
<!--
     Copyright (C) 2017 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<resources>

  <style name="Widget.Shrine.Toolbar.Logo" parent="Base.Widget.Shrine.Toolbar.Logo">
    <item name="android:elevation">@dimen/shrine_toolbar_elevation</item>
  </style>

  <style name="TextAppearance.Shrine.Logo" parent="Base.TextAppearance.Shrine.Logo">
    <item name="android:letterSpacing">0.20</item>
  </style>

  <style name="Shrine.BottomNavView" parent="Base.Shrine.BottomNavView">
    <item name="elevation">@dimen/shrine_bottom_nav_view_elevation</item>
  </style>

</resources>


text:
<!DOCTYPE html>

    <link href='app.css' rel='stylesheet' type='text/css'/>

    <input class="dial" id="volume" data-width="60" data-height="60" data-min=0 data-max=100 data-angleOffset="-125" data-angleArc="250" data-flatMouse="1" value="10"/>

  Volume


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    tools:context="com.example.cmput401.classdiscuss.ConnectionList"
    android:background="#ffffff"
    android:paddingTop="10dp"
    android:paddingBottom="10dp"
    android:paddingLeft="10dp"
    android:paddingRight="10dp">

    <ImageView
        android:id="@+id/imageUserProfile"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:src="@drawable/ic_noimage"
        android:layout_alignParentLeft="true"
        android:paddingRight="10dp"
        android:layout_column="35" />

    <TextView
        android:id="@+id/listText"
        android:text="Name"
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#333333"
        android:textSize="20sp"
        android:paddingBottom="8sp"
        android:paddingRight="5dp"
        android:layout_alignParentTop="true"
        android:layout_toRightOf="@+id/imageUserProfile"
        android:layout_toEndOf="@+id/imageUserProfile" />

    <TextView
        android:id="@+id/secondText"
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="18sp"
        android:layout_alignBottom="@+id/imageUserProfile"
        android:layout_toRightOf="@+id/imageUserProfile"
        android:layout_toEndOf="@+id/imageUserProfile"
        android:maxLines="1"
        android:lines="1"
        android:ellipsize="marquee"
        android:text="Message"/>

    <TextView
        android:id="@+id/timeText"
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="15sp"
        android:text="Message"
        android:layout_alignRight="@+id/listText"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

</RelativeLayout>


text:
<!-- #docregion -->
<!DOCTYPE html>
<html>
  <head>
    <title>Angular 2 Todos</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="styles.css">

    <!-- 1. Load libraries -->
    <!-- IE required polyfills (from CDN), in this exact order -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.26/system-polyfills.js"></script>
    <script src="https://npmcdn.com/angular2/es6/dev/src/testing/shims_for_IE.js"></script>

    <script src="https://code.angularjs.org/tools/system.js"></script>
    <script src="https://code.angularjs.org/tools/typescript.js"></script>
    <script src="https://code.angularjs.org/2.0.0-beta.17/angular2-polyfills.js"></script>
    <script src="https://code.angularjs.org/2.0.0-beta.17/Rx.js"></script>
    <script src="https://code.angularjs.org/2.0.0-beta.17/angular2.dev.js"></script>

    <!-- 2. Configure SystemJS -->
    <script>
      System.config({
        transpiler: 'typescript',
        typescriptOptions: { emitDecoratorMetadata: true },
        packages: {'app': {defaultExtension: 'ts'}}
      });
      System.import('app/main')
            .then(null, console.error.bind(console));
    </script>

  </head>

  <!-- 3. Display the application -->
  <body>
    <todo-app class="container" style="display: block">Loading...</todo-app>
  </body>

</html>


text:
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Globalization;

namespace Optimization
{

    public class GeneConverter : JsonConverter
    {
        public override bool CanConvert(Type objectType)
        {
            return objectType == typeof(GeneConfiguration);
        }

        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            if (reader.TokenType == JsonToken.Null)
            {
                return null;
            }

            var json = JObject.Load(reader);

            var precision = json["precision"]?.Value<int?>();

            GeneConfiguration gene = new GeneConfiguration
            {
                Key = json["key"].Value<string>(),
                MinDecimal = precision > 0 ? json["min"].Value<decimal?>() : null,
                MaxDecimal = precision > 0 ? json["max"].Value<decimal?>() : null,
                MinInt = precision > 0 ? null : json["min"].Value<int?>(),
                MaxInt = precision > 0 ? null : json["max"].Value<int?>(),
                Precision = precision,
                Fibonacci = json["fibonacci"] != null ? json["fibonacci"].Value<bool>() : false
            };
            if (json["actual"] != null)
            {

                int parsed;
                string raw = json["actual"].Value<string>();
                if (int.TryParse(raw, out parsed))
                {
                    gene.ActualInt = parsed;
                }

                if (!gene.ActualInt.HasValue)
                {
                    decimal decimalParsed;
                    if (decimal.TryParse(raw, out decimalParsed))
                    {
                        gene.ActualDecimal = decimalParsed;
                    }
                    if (decimal.TryParse(raw, NumberStyles.Float, CultureInfo.InvariantCulture, out decimalParsed))
                    {
                        gene.ActualDecimal = decimalParsed;
                    }
                }
            }

            return gene;
        }

        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            var gene = (GeneConfiguration)value;

            writer.WriteStartObject();

            writer.WritePropertyName("key");
            writer.WriteValue(gene.Key);

            if (gene.MinDecimal.HasValue)
            {
                writer.WritePropertyName("min");
                writer.WriteValue(gene.MinDecimal);
                writer.WritePropertyName("max");
                writer.WriteValue(gene.MaxDecimal);
            }

            if (gene.MinInt.HasValue)
            {
                writer.WritePropertyName("min");
                writer.WriteValue(gene.MinInt);
                writer.WritePropertyName("max");
                writer.WriteValue(gene.MaxInt);
            }

            if (gene.Precision.HasValue)
            {
                writer.WritePropertyName("precision");
                writer.WriteValue(gene.Precision);
            }
            if (gene.ActualInt.HasValue)
            {
                writer.WritePropertyName("actual");
                writer.WriteValue(gene.ActualInt);
            }
            if (gene.ActualDecimal.HasValue)
            {
                writer.WritePropertyName("actual");
                writer.WriteValue(gene.ActualDecimal);
            }

            writer.WriteEndObject();

        }

    }

}


text:
from ..server_utils import SetUpPythonPath
SetUpPythonPath()
from .test_utils import ( Setup, BuildRequest, PathToTestFile,
                          StopOmniSharpServer, WaitUntilOmniSharpServerReady )
from webtest import TestApp
from nose.tools import with_setup, eq_
from hamcrest import ( assert_that, contains, contains_string, has_entries,
                       has_entry, empty, equal_to )
from ..responses import NoDiagnosticSupport
from .. import handlers
import bottle
import httplib

bottle.debug( True )

@with_setup( Setup )
def Diagnostics_ClangCompleter_ZeroBasedLineAndColumn_test():
  app = TestApp( handlers.app )
  contents = """
void foo() {
  double baz = "foo";
}
// Padding to 5 lines
// Padding to 5 lines
"""

  event_data = BuildRequest( compilation_flags = ['-x', 'c++'],
                             event_name = 'FileReadyToParse',
                             contents = contents,
                             filetype = 'cpp' )

  results = app.post_json( '/event_notification', event_data ).json
  assert_that( results,
               contains(
                  has_entries( {
                    'kind': equal_to( 'ERROR'),
                    'text': contains_string( 'cannot initialize' ),
                    'ranges': contains( has_entries( {
                      'start': has_entries( {
                        'line_num': 3,
                        'column_num': 16,
                      } ),
                      'end': has_entries( {
                        'line_num': 3,
                        'column_num': 21,
                      } ),
                    } ) ),
                    'location': has_entries( {
                      'line_num': 3,
                      'column_num': 10
                    } ),
                    'location_extent': has_entries( {
                      'start': has_entries( {
                        'line_num': 3,
                        'column_num': 10,
                      } ),
                      'end': has_entries( {
                        'line_num': 3,
                        'column_num': 13,
                      } ),
                    } )
                  } ) ) )

@with_setup( Setup )
def Diagnostics_ClangCompleter_SimpleLocationExtent_test():
  app = TestApp( handlers.app )
  contents = """
void foo() {
  baz = 5;
}
// Padding to 5 lines
// Padding to 5 lines
"""

  event_data = BuildRequest( compilation_flags = ['-x', 'c++'],
                             event_name = 'FileReadyToParse',
                             contents = contents,
                             filetype = 'cpp' )

  results = app.post_json( '/event_notification', event_data ).json
  assert_that( results,
               contains(
                  has_entries( {
                    'location_extent': has_entries( {
                      'start': has_entries( {
                        'line_num': 3,
                        'column_num': 3,
                      } ),
                      'end': has_entries( {
                        'line_num': 3,
                        'column_num': 6,
                      } ),
                    } )
                  } ) ) )

@with_setup( Setup )
def Diagnostics_ClangCompleter_PragmaOnceWarningIgnored_test():
  app = TestApp( handlers.app )
  contents = """
#pragma once

struct Foo {
  int x;
  int y;
  int c;
  int d;
};
"""

  event_data = BuildRequest( compilation_flags = ['-x', 'c++'],
                             event_name = 'FileReadyToParse',
                             contents = contents,
                             filepath = '/foo.h',
                             filetype = 'cpp' )

  response = app.post_json( '/event_notification', event_data )
  assert_that( response.body, empty() )

@with_setup( Setup )
def Diagnostics_CsCompleter_ZeroBasedLineAndColumn_test():
  app = TestApp( handlers.app )
  app.post_json( '/ignore_extra_conf_file',
                 { 'filepath': PathToTestFile( '.ycm_extra_conf.py' ) } )
  filepath = PathToTestFile( 'testy/Program.cs' )
  contents = open( filepath ).read()
  event_data = BuildRequest( filepath = filepath,
                             filetype = 'cs',
                             contents = contents,
                             event_name = 'FileReadyToParse' )

  results = app.post_json( '/event_notification', event_data )
  WaitUntilOmniSharpServerReady( app )

  event_data = BuildRequest( filepath = filepath,
                             event_name = 'FileReadyToParse',
                             filetype = 'cs',
                             contents = contents )

  results = app.post_json( '/event_notification', event_data ).json

  assert_that( results,
               contains(
                  has_entries( {
                    'kind': equal_to( 'ERROR'),
                    'text': contains_string(
                        "Unexpected symbol `}'', expecting identifier" ),
                    'location': has_entries( {
                      'line_num': 10,
                      'column_num': 2
                    } ),
                    'location_extent': has_entries( {
                      'start': has_entries( {
                        'line_num': 10,
                        'column_num': 2,
                      } ),
                      'end': has_entries( {
                        'line_num': 10,
                        'column_num': 2,
                      } ),
                    } )
                  } ) ) )

  StopOmniSharpServer( app )

@with_setup( Setup )
def GetDetailedDiagnostic_ClangCompleter_Works_test():
  app = TestApp( handlers.app )
  contents = """
struct Foo {
  int x  // semicolon missing here!
  int y;
  int c;
  int d;
};
"""

  diag_data = BuildRequest( compilation_flags = ['-x', 'c++'],
                            line_num = 3,
                            contents = contents,
                            filetype = 'cpp' )

  event_data = diag_data.copy()
  event_data.update( {
    'event_name': 'FileReadyToParse',
  } )

  app.post_json( '/event_notification', event_data )
  results = app.post_json( '/detailed_diagnostic', diag_data ).json
  assert_that( results,
               has_entry( 'message', contains_string( "expected ';'" ) ) )

@with_setup( Setup )
def GetDetailedDiagnostic_CsCompleter_Works_test():
  app = TestApp( handlers.app )
  app.post_json( '/ignore_extra_conf_file',
                 { 'filepath': PathToTestFile( '.ycm_extra_conf.py' ) } )
  filepath = PathToTestFile( 'testy/Program.cs' )
  contents = open( filepath ).read()
  event_data = BuildRequest( filepath = filepath,
                             filetype = 'cs',
                             contents = contents,
                             event_name = 'FileReadyToParse' )

  app.post_json( '/event_notification', event_data )
  WaitUntilOmniSharpServerReady( app )
  app.post_json( '/event_notification', event_data )

  diag_data = BuildRequest( filepath = filepath,
                            filetype = 'cs',
                            contents = contents,
                            line_num = 10,
                            column_num = 2 )

  results = app.post_json( '/detailed_diagnostic', diag_data ).json
  assert_that( results,
               has_entry(
                  'message',
                  contains_string(
                     "Unexpected symbol `}'', expecting identifier" ) ) )

  StopOmniSharpServer( app )

@with_setup( Setup )
def GetDetailedDiagnostic_JediCompleter_DoesntWork_test():
  app = TestApp( handlers.app )
  diag_data = BuildRequest( contents = "foo = 5",
                            line_num = 2,
                            filetype = 'python' )
  response = app.post_json( '/detailed_diagnostic',
                            diag_data,
                            expect_errors = True )

  eq_( response.status_code, httplib.INTERNAL_SERVER_ERROR )
  assert_that( response.json,
               has_entry( 'exception',
                          has_entry( 'TYPE', NoDiagnosticSupport.__name__ ) ) )