text:
/* Authors:  Keith Whitwell <keith@tungstengraphics.com>
 */
#include "lp_context.h"
#include "lp_state.h"
#include "draw/draw_context.h"

static void
llvmpipe_set_clip_state(struct pipe_context *pipe,
                        const struct pipe_clip_state *clip)
{
   struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);

   /* pass the clip state to the draw module */
   draw_set_clip_state(llvmpipe->draw, clip);
}

static void
llvmpipe_set_viewport_state(struct pipe_context *pipe,
                            const struct pipe_viewport_state *viewport)
{
   struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);

   /* pass the viewport info to the draw module */
   draw_set_viewport_state(llvmpipe->draw, viewport);

   llvmpipe->viewport = *viewport; /* struct copy */
   llvmpipe->dirty |= LP_NEW_VIEWPORT;
}

static void
llvmpipe_set_scissor_state(struct pipe_context *pipe,
                           const struct pipe_scissor_state *scissor)
{
   struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);

   draw_flush(llvmpipe->draw);

   llvmpipe->scissor = *scissor; /* struct copy */
   llvmpipe->dirty |= LP_NEW_SCISSOR;
}

static void
llvmpipe_set_polygon_stipple(struct pipe_context *pipe,
                             const struct pipe_poly_stipple *stipple)
{
   struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);

   draw_flush(llvmpipe->draw);

   llvmpipe->poly_stipple = *stipple; /* struct copy */
   llvmpipe->dirty |= LP_NEW_STIPPLE;
}

void
llvmpipe_init_clip_funcs(struct llvmpipe_context *llvmpipe)
{
   llvmpipe->pipe.set_clip_state = llvmpipe_set_clip_state;
   llvmpipe->pipe.set_polygon_stipple = llvmpipe_set_polygon_stipple;
   llvmpipe->pipe.set_scissor_state = llvmpipe_set_scissor_state;
   llvmpipe->pipe.set_viewport_state = llvmpipe_set_viewport_state;
}

redpajama_set_name: RedPajamaGithub


text:
title: Функция импликации
sidebar: flexberry-orm_sidebar
keywords: Flexberry ORM, ограничения, импликация? funcImplication
summary: Использование импликации в ограничениях
toc: true
permalink: ru/fo_function-implication.html
lang: ru
---

`funcImplication` - функция [ExternalLangDef](fo_external-lang-def.html) для задания логической импликации.

Импликация - функция двух логических операндов: предпосылки и следствия, может принимать следующие значения:

Предпосылка  | Следствие | Результат
:----------|:----------|:----------
 0 | 0 | 1
 0 | 1 | 1
 1 | 0 | 0
 1 | 1 | 1

Логически, импликация "Если а, то b " равна "(не a) или b".
Например, ограничение вида: "Если кличка = барсик, то пол = мужской" приведет к выводу всех барсиков с мужским полом и всех (не барсиков).

## Пример

**Все Ивановы Иваны и все не Ивановы**

``` csharp
var langDef = new ExternalLangDef();
Function function = langDef.GetFunction(langDef.funcImplication,
                    langDef.GetFunction(langDef.funcEQ, new VariableDef(langDef.StringType, "Фамилия"),"Иванов"),
                    langDef.GetFunction(langDef.funcEQ, new VariableDef(langDef.StringType, "Имя"), "Иван"));
```


text:
package plugin

import (
	"fmt"

	"github.com/golang/glog"

	osapi "github.com/openshift/origin/pkg/sdn/api"

	kapi "k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/client/cache"
	utilwait "k8s.io/kubernetes/pkg/util/wait"
)

func (plugin *OsdnNode) SetupEgressNetworkPolicy() error {
	policies, err := plugin.osClient.EgressNetworkPolicies(kapi.NamespaceAll).List(kapi.ListOptions{})
	if err != nil {
		return fmt.Errorf("could not get EgressNetworkPolicies: %s", err)
	}

	for _, policy := range policies.Items {
		vnid, err := plugin.vnids.GetVNID(policy.Namespace)
		if err != nil {
			glog.Warningf("Could not find netid for namespace %q: %v", policy.Namespace, err)
			continue
		}
		plugin.egressPolicies[vnid] = append(plugin.egressPolicies[vnid], &policy)
	}

	for vnid := range plugin.egressPolicies {
		err := plugin.updateEgressNetworkPolicyRules(vnid)
		if err != nil {
			return err
		}
	}

	go utilwait.Forever(plugin.watchEgressNetworkPolicies, 0)
	return nil
}

func (plugin *OsdnNode) watchEgressNetworkPolicies() {
	RunEventQueue(plugin.osClient, EgressNetworkPolicies, func(delta cache.Delta) error {
		policy := delta.Object.(*osapi.EgressNetworkPolicy)

		vnid, err := plugin.vnids.GetVNID(policy.Namespace)
		if err != nil {
			return fmt.Errorf("Could not find netid for namespace %q: %v", policy.Namespace, err)
		}

		policies := plugin.egressPolicies[vnid]
		for i, oldPolicy := range policies {
			if oldPolicy.UID == policy.UID {
				policies = append(policies[:i], policies[i+1:]...)
				break
			}
		}
		if delta.Type != cache.Deleted && len(policy.Spec.Egress) > 0 {
			policies = append(policies, policy)
		}
		plugin.egressPolicies[vnid] = policies

		err = plugin.updateEgressNetworkPolicyRules(vnid)
		if err != nil {
			return err
		}
		return nil
	})
}

func (plugin *OsdnNode) UpdateEgressNetworkPolicyVNID(namespace string, oldVnid, newVnid uint32) error {
	var policy *osapi.EgressNetworkPolicy

	policies := plugin.egressPolicies[oldVnid]
	for i, oldPolicy := range policies {
		if oldPolicy.Namespace == namespace {
			policy = oldPolicy
			plugin.egressPolicies[oldVnid] = append(policies[:i], policies[i+1:]...)
			err := plugin.updateEgressNetworkPolicyRules(oldVnid)
			if err != nil {
				return err
			}
			break
		}
	}

	if policy != nil {
		plugin.egressPolicies[newVnid] = append(plugin.egressPolicies[newVnid], policy)
		err := plugin.updateEgressNetworkPolicyRules(newVnid)
		if err != nil {
			return err
		}
	}

	return nil
}


text:
Если пользоваться терминами фиксиков из одноименного мультфильма, то эта программа - "помогатор" в решении игр "мозговой штурм" для проекта encounter (en.cx)

Когда-то меня стало утомлять выполнение однообразных действий, на которые приходится тратить время, и, проигрывать..
Что делать? выходов не так много:

1. быстрее нажимать кнопки на клавиатуре
2. переехать ближе к серверам en.cx и google.com
3. автоматизировать отнимающие время процессы.

Да! Правильно! Именно так я и решил! ) Нет, не переехать, но создать рабочий инструмент.

## Цель и назначение
- избавление себя от мозолей на пальцах при активном поиске по картинке в гугле и яндексе;
- не получение бана за чрезмерно активное использвоание ресурсов с ассоциациями слов;
- перекладывание утомительных расчетов с головы в эксель, а ещё лучше их автоматизация;
- упрощение работы с картинками в части убирания уже решенных с экрана;
- не допущения повторов вбивания одних и тех же ответов, в том числе других игроков команды;
- падла, кубрая... ) хотя я их люблю;
- выполнение прочих действий, явно не связанных с умственным трудом при решении задач

## Кому это нужно?
- мне :) я без скромности;
- прочим игрокам, которым уже сняться image.google.com, sniptool.exe и прочие твидлы;
- разработчикам, которым интересно попробовать закодить нетривиальную логику

## А мне можно?
- скачать и пользоваться - мне все равно. я не доктор чтобы сказать наверняка;
- принять участие в создании инструментов - [вам сюда](https://github.com/lnl122/ENS/blob/master/docs/index.md);
- предложить свои идеи - о! именно этого я и жду! ) хотя и своих хватает..
- продавать - =) только если вам позволит совесть. я за свободное ПО.

## Чем помочь?
- дизайн. у меня с этим слабо. даже иконку придумать сложно;
- кодинг. две голову лучше, да и багов меньше будет. идеальный вариант, чтоб кодер и ЕНщиком был дополнительно;
- тест. головная боль в создании тестовых сценариев и прогона помогатора. нужно время;
- документация. так-то оно можно и самому, но нужно время. картинки вырезать, рамочки красные обводить, текст писать доходчивый;
- идеи. тут уже только ЕНщик поможет, с дополнительным скилом развития технической логики решения задач МШ;

## Гарантии и права
Никаких. точка.

MIT License предполагает отсутствие каких либо гарантий. Ни на обновление, ни на поддержку. Прав тоже. )

К моей радости я мало чем обязан пользователям, толкьо по-джентельменски, и, только пока мне интересен проект.


text:
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('phone-number-hidden', 'Integration | Component | phone number hidden', {
  integration: true
});

test('it renders', function(assert) {
  assert.expect(2);

  // Set any properties with this.set('myProperty', 'value');
  // Handle any actions with this.on('myAction', function(val) { ... });

  this.render(hbs`{{phone-number-hidden}}`);

  assert.equal(this.$().text().trim(), '');

  // Template block usage:
  this.render(hbs`
    {{#phone-number-hidden}}
      template block text
    {{/phone-number-hidden}}
  `);

  assert.equal(this.$().text().trim(), 'template block text');
});


text:
from django.db.backends import BaseDatabaseIntrospection

class DatabaseIntrospection(BaseDatabaseIntrospection):

    def get_table_list(self, cursor):
        "Returns a list of table names in the current database."
        cursor.execute("SHOW TABLES")
        return [row[0] for row in cursor.fetchall()]


text:
#include "tensorflow/core/framework/model.h"

#include <memory>

namespace tensorflow {
namespace data {
namespace model {

// TODO(jsimsa): Use `Node` subclassing instead of types and node statements.
void Model::Node::CollectTunables(
    std::vector<std::shared_ptr<Node::Tunable>>* tunables) {
  tf_shared_lock l(mu_);
  for (auto input : inputs_) {
    input->CollectTunables(tunables);
  }
  switch (type_) {
    case Type::MAP_AND_BATCH:
    case Type::PARALLEL_INTERLEAVE_V2:
    case Type::PARALLEL_MAP: {
      if (auto* tunable_param =
              gtl::FindOrNull(tunable_params_, "parallelism")) {
        tunables->push_back(*tunable_param);
      }
      return;
    }
    default:
      return;
  }
}

int64 Model::Node::GetParameterValue(const string& name) {
  if (auto* tunable_param = gtl::FindOrNull(tunable_params_, name)) {
    return (*tunable_param)->value;
  }
  return constant_params_[name];
}

int64 Model::Node::ProcessingTimeLocked() {
  switch (type_) {
    case Type::BATCH:
    case Type::MAP_AND_BATCH:
    case Type::PADDED_BATCH: {
      int64 batch_size = GetParameterValue("batch_size");
      return NanosPerElementLocked() + batch_size * ProcessingTimeForInputs();
    }
    case Type::FILTER: {
      if (inputs_.size() <= 1) {
        return NanosPerElementLocked();
      }
      std::shared_ptr<Node> input = inputs_.front();
      double ratio = 0.0L;
      if (num_elements_ > 0) {
        ratio = static_cast<double>(input->num_elements()) /
                static_cast<double>(num_elements_);
      }
      return NanosPerElementLocked() +
             static_cast<int64>(ratio *
                                static_cast<double>(ProcessingTimeForInputs()));
    }
    case Type::FLAT_MAP:
    case Type::INTERLEAVE:
    case Type::PARALLEL_INTERLEAVE:
    case Type::PARALLEL_INTERLEAVE_V2: {
      // TODO(jsimsa): model the first input
      // TODO(jsimsa): use processing time history as a prior for future inputs
      if (inputs_.size() <= 1) {
        return NanosPerElementLocked();
      }
      int64 processing_time =
          ProcessingTimeForInputs() - inputs_.front()->ProcessingTime();
      return NanosPerElementLocked() +
             static_cast<double>(processing_time) /
                 static_cast<double>(inputs_.size() - 1);
    }
    case Type::CACHE:
    case Type::CONCATENATE:
    case Type::MAP:
    case Type::PARALLEL_MAP:
    case Type::PREFETCH:
      // TODO(jsimsa): use processing time history as a prior for future inputs
    case Type::REPEAT:
    case Type::SHUFFLE:
    case Type::SKIP:
    case Type::TAKE:
    case Type::ZIP: {
      return NanosPerElementLocked() + ProcessingTimeForInputs();
    }
    default:
      return NanosPerElementLocked();
  }
}

int64 Model::Node::OutputTimeLocked(std::vector<int64>* input_times) {
  switch (type_) {
    case Type::BATCH:
    case Type::PADDED_BATCH: {
      double batch_size = GetParameterValue("batch_size");
      int64 old_value = (*input_times)[input_times->size() - 1];
      (*input_times)[input_times->size() - 1] = static_cast<int64>(
          static_cast<double>(old_value + NanosPerElementLocked()) /
          batch_size);
      auto cleanup = gtl::MakeCleanup([input_times, old_value]() {
        (*input_times)[input_times->size() - 1] = old_value;
      });
      return NanosPerElementLocked() +
             batch_size * OutputTimeForInputs(input_times);
    }
    case Type::FILTER: {
      if (inputs_.size() <= 1) {
        return NanosPerElementLocked();
      }
      std::shared_ptr<Node> input = inputs_.front();
      double ratio = 0.0L;
      if (num_elements_ > 0) {
        ratio = static_cast<double>(input->num_elements()) /
                static_cast<double>(num_elements_);
        int64 old_value = (*input_times)[input_times->size() - 1];
        (*input_times)[input_times->size() - 1] = static_cast<int64>(
            static_cast<double>(old_value + NanosPerElementLocked()) / ratio);
        auto cleanup = gtl::MakeCleanup([input_times, old_value]() {
          (*input_times)[input_times->size() - 1] = old_value;
        });
      }
      return NanosPerElementLocked() +
             static_cast<int64>(
                 static_cast<double>(OutputTimeForInputs(input_times)) * ratio);
    }
    case Type::FLAT_MAP:
    case Type::INTERLEAVE: {
      // TODO(jsimsa): model the first input
      // TODO(jsimsa): use cycle length metadata instead of `inputs_.size() - 1`
      if (inputs_.size() <= 1) {
        return NanosPerElementLocked();
      }
      int64 delta =
          static_cast<int64>(static_cast<double>(NanosPerElementLocked()) *
                             static_cast<double>(inputs_.size() - 1));
      (*input_times)[input_times->size() - 1] += delta;
      auto cleanup = gtl::MakeCleanup([input_times, delta]() {
        (*input_times)[input_times->size() - 1] -= delta;
      });
      int64 output_time = OutputTimeForInputs(input_times) -
                          inputs_.front()->OutputTime(input_times);
      return NanosPerElementLocked() +
             static_cast<double>(output_time) /
                 static_cast<double>(inputs_.size() - 1);
    }
    case Type::MAP_AND_BATCH: {
      double batch_size = GetParameterValue("batch_size");
      double parallelism = GetParameterValue("parallelism");
      int64 delta =
          static_cast<int64>(static_cast<double>(NanosPerElementLocked()) /
                             (batch_size * parallelism));
      input_times->push_back(delta);
      auto cleanup =
          gtl::MakeCleanup([input_times]() { input_times->pop_back(); });
      int64 output_time = static_cast<int64>(
          static_cast<double>(NanosPerElementLocked()) / parallelism +
          batch_size * OutputTimeForInputs(input_times));
      return std::max(0LL,
                      output_time - input_times->at(input_times->size() - 2));
    }
    case Type::PARALLEL_INTERLEAVE: {
      // TODO(jsimsa): model the first input
      if (inputs_.size() <= 1) {
        return NanosPerElementLocked();
      }
      int64 delta = static_cast<double>(NanosPerElementLocked()) *
                    static_cast<double>(inputs_.size() - 1);
      input_times->push_back(delta);
      auto cleanup =
          gtl::MakeCleanup([input_times]() { input_times->pop_back(); });
      int64 inputs_output_time = OutputTimeForInputs(input_times) -
                                 inputs_.front()->OutputTime(input_times);
      double parallelism = GetParameterValue("parallelism");
      int64 output_time =
          NanosPerElementLocked() + ((static_cast<double>(inputs_output_time) /
                                      static_cast<double>(inputs_.size() - 1)) /
                                     parallelism);
      return std::max(0LL,
                      output_time - input_times->at(input_times->size() - 2));
    }
    case Type::PARALLEL_INTERLEAVE_V2: {
      // TODO(jsimsa): model the first input
      if (inputs_.size() <= 1) {
        return NanosPerElementLocked();
      }
      int64 delta = static_cast<double>(NanosPerElementLocked()) *
                    static_cast<double>(inputs_.size() - 1);
      input_times->push_back(delta);
      auto cleanup =
          gtl::MakeCleanup([input_times]() { input_times->pop_back(); });
      int64 inputs_output_time = OutputTimeForInputs(input_times) -
                                 inputs_.front()->OutputTime(input_times);
      double parallelism =
          std::min(static_cast<int>(GetParameterValue("cycle_length")),
                   static_cast<int>(GetParameterValue("parallelism")));
      int64 output_time =
          NanosPerElementLocked() + ((static_cast<double>(inputs_output_time) /
                                      static_cast<double>(inputs_.size() - 1)) /
                                     parallelism);
      return std::max(0LL,
                      output_time - input_times->at(input_times->size() - 2));
    }
    case Type::PARALLEL_MAP: {
      double parallelism =
          std::min(port::NumSchedulableCPUs(),
                   static_cast<int>(GetParameterValue("parallelism")));
      int64 delta = static_cast<int64>(
          static_cast<double>(NanosPerElementLocked()) / parallelism);
      input_times->push_back(delta);
      auto cleanup =
          gtl::MakeCleanup([input_times]() { input_times->pop_back(); });
      int64 output_time =
          static_cast<double>(NanosPerElementLocked()) / parallelism +
          OutputTimeForInputs(input_times);
      return std::max(0LL,
                      output_time - input_times->at(input_times->size() - 2));
    }
    case Type::PREFETCH: {
      int64 delta = NanosPerElementLocked();
      input_times->push_back(delta);
      auto cleanup =
          gtl::MakeCleanup([input_times]() { input_times->pop_back(); });
      return std::max(0LL, NanosPerElementLocked() +
                               OutputTimeForInputs(input_times) -
                               input_times->at(input_times->size() - 2));
    }
    case Type::CACHE:
    case Type::CONCATENATE:
    case Type::MAP:
    case Type::REPEAT:
    case Type::SHUFFLE:
    case Type::SKIP:
    case Type::TAKE:
    case Type::ZIP: {
      int64 delta = NanosPerElementLocked();
      (*input_times)[input_times->size() - 1] += delta;
      auto cleanup = gtl::MakeCleanup([input_times, delta]() {
        (*input_times)[input_times->size() - 1] -= delta;
      });
      return NanosPerElementLocked() + OutputTimeForInputs(input_times);
    }
    default:
      return NanosPerElementLocked();
  }
}

std::shared_ptr<Model::Node> Model::Node::Snapshot(
    std::shared_ptr<Model::Node> output) {
  tf_shared_lock l(mu_);
  std::shared_ptr<Node> result =
      std::make_shared<Node>(id_, name_, std::move(output));
  result->processing_time_ = processing_time_;
  result->num_elements_ = num_elements_;
  result->constant_params_ = constant_params_;
  result->tunable_params_ = tunable_params_;
  for (auto& input : inputs_) {
    result->add_input(input->Snapshot(result));
  }
  return result;
}

void Model::AddConstantParameter(const string& node_name,
                                 const string& parameter_name, int64 value) {
  tf_shared_lock l(mu_);
  auto node = gtl::FindOrNull(lookup_table_, node_name);
  if (node) {
    (*node)->add_constant_param(parameter_name, value);
  }
}

void Model::AddNode(const string& name, const string& output_name) {
  // The name captures the sequence of iterators joined by `::`. We use the full
  // sequence as the key in the lookup table, but only the last element of the
  // sequence as the name node.
  std::vector<string> tokens =
      str_util::Split(name, ':', str_util::SkipEmpty());
  // The output name might contain an index. We need to strip it to make it
  // possible for the model to successfully identify the output node.
  string sanitized_output_name = output_name;
  if (str_util::EndsWith(output_name, "]")) {
    sanitized_output_name = output_name.substr(0, output_name.rfind('['));
  }
  std::shared_ptr<Node> output;
  mutex_lock l(mu_);
  auto it = lookup_table_.find(sanitized_output_name);
  if (it != lookup_table_.end()) {
    output = it->second;
  }
  std::shared_ptr<Node> node(new Node(id_counter_++, tokens.back(), output));
  if (!output_) {
    output_ = node;
  }
  if (output) {
    output->add_input(node);
  }
  lookup_table_.insert(std::make_pair(name, node));
}

void Model::AddProcessingTime(const string& name, int64 delta) {
  tf_shared_lock l(mu_);
  auto node = gtl::FindOrNull(lookup_table_, name);
  if (node) {
    (*node)->add_processing_time(delta);
  }
}

void Model::AddTunableParameter(const string& node_name,
                                const string& parameter_name,
                                std::shared_ptr<SharedState> state, int64 min,
                                int64 max) {
  tf_shared_lock l(mu_);
  auto node = *gtl::FindOrNull(lookup_table_, node_name);
  DCHECK(node);
  node->add_tunable_param(parameter_name, std::move(state), min, max);
}

// The optimization algorithm starts by setting all tunable parallelism
// parameters to 1. It then repeatedly identifies the parameter whose increase
// in parallelism decreases the output time the most. This process is repeated
// until all parameters reach their maximum values or the projected output time
// is less than or equal to the processing time needed to produce an element
// divided by CPU budget.
void Model::Optimize(int64 cpu_budget) {
  std::shared_ptr<Model::Node> snapshot;
  {
    tf_shared_lock lock(mu_);
    snapshot = output_->Snapshot(nullptr);
  }
  const int64 processing_time = ProcessingTime(snapshot);
  auto tunables = CollectTunables(snapshot);
  for (auto tunable : tunables) {
    tunable->value = 1;
  }
  while (true) {
    const int64 output_time = OutputTime(snapshot);
    bool all_tunables = true;
    for (auto& tunable : tunables) {
      if (tunable->value < tunable->max) {
        all_tunables = false;
        break;
      }
    }
    if (output_time < processing_time / cpu_budget || all_tunables) {
      break;
    }
    int64 best_delta = -1;
    Model::Node::Tunable* best_tunable = nullptr;
    for (auto& tunable : tunables) {
      if (tunable->value == tunable->max) {
        continue;
      }
      tunable->value++;
      int64 delta = output_time - OutputTime(snapshot);
      if (delta > best_delta) {
        best_delta = delta;
        best_tunable = tunable.get();
      }
      tunable->value--;
    }
    if (!best_tunable) {
      // This should never happen because we are using a model snapshot and
      // the output time is monotonically decreasing w.r.t. parallelism.
      LOG(WARNING) << "Failed to find a tunable parameter that would "
                      "decrease the output time, aborting the current "
                      "optimization attempt.";
      return;
    }
    best_tunable->value++;
  }
  VLOG(2) << "Number of knobs: " << tunables.size();
  for (auto& tunable : tunables) {
    VLOG(2) << "Setting tunable parameter: " << tunable->value;
    mutex_lock l(*tunable->state->mu);
    tunable->state->value = tunable->value;
    tunable->state->cond_var->notify_all();
  }
}

void Model::RecordElement(const string& name) {
  tf_shared_lock l(mu_);
  auto node = gtl::FindOrNull(lookup_table_, name);
  if (node) {
    (*node)->record_element();
  }
}

void Model::RecordStart(const string& name, bool stop_output) {
  tf_shared_lock l(mu_);
  auto node = gtl::FindOrNull(lookup_table_, name);
  if (node) {
    if (stop_output && (*node)->output()) {
      (*node)->output()->record_stop();
    }
    (*node)->record_start();
  }
}

void Model::RecordStop(const string& name, bool start_output) {
  tf_shared_lock l(mu_);
  auto node = gtl::FindOrNull(lookup_table_, name);
  if (node) {
    (*node)->record_stop();
    if (start_output && (*node)->output()) {
      (*node)->output()->record_start();
    }
  }
}

void Model::RemoveNode(const string& name) {
  mutex_lock l(mu_);
  auto node = gtl::FindOrNull(lookup_table_, name);
  if (node && (*node)->output()) {
    (*node)->output()->remove_input(*node);
  }
  lookup_table_.erase(name);
}

std::vector<std::shared_ptr<Model::Node::Tunable>> Model::CollectTunables(
    std::shared_ptr<Model::Node> node) {
  std::vector<std::shared_ptr<Model::Node::Tunable>> tunables;
  node->CollectTunables(&tunables);
  return tunables;
}

int64 Model::OutputTime(std::shared_ptr<Model::Node> node) {
  std::vector<int64> input_times(1, 0);
  return node->OutputTime(&input_times);
}

int64 Model::ProcessingTime(std::shared_ptr<Model::Node> node) {
  return node->ProcessingTime();
}

}  // namespace model
}  // namespace data
}  // namespace tensorflow


text:
/**
 * Created by user on 12.03.2017.
 */
//Require the dev-dependencies
var chai = require('chai');
var chaiHttp = require('chai-http');
var expect = chai.expect;
var calculator = require('./coverage/instrumented/services/calculator');

chai.use(chaiHttp);

describe('Calculators', function () {
    /*
     * Test the /GET route
     */
    describe('calculate should', function () {
        it('return correct results', function () {
            var amount = 1000;
            var rate = 1.5;
            var months = 12;

            var result = calculator.calculateMorgage(amount,months,rate);

            expect(result.credit).to.exist;
            expect(result.credit).to.equal(84.01196734115257);

        });
    });

});


text:
'use strict';

module.exports = function(project) {
  let model = project.model;

  Object.assign(model.platform, {
    hmr: false,
    open: false
  });

  const configurePlatform = require(`./${model.platform.id}`);
  configurePlatform(project);
};


text:
from anim import AnimManager

class AnimDriver(object):

    def __init__(self, obj, values, attr, t, ease_func):
        self.start, self.end = values
        self.delta = self.end - self.start
        self.total_time = t * 1000.0
        self.t = 0.0
        self.obj = obj
        self.attr = attr
        self.ease_func = ease_func
        self.done = False
        self._kill = False
        self._skip = False

    def kill(self):
        self._kill = True

    def skip(self):
        self._skip = True

    def update(self, dT):
        if self._kill:
            return True
        if self._skip:
            self.obj[self.attr] = self.end
            return True

        value = self.ease_func(self.t, self.start, self.delta, self.total_time)
        self.obj[self.attr] = value

        if self.t >= self.total_time:
            return True

        self.t = min(self.t + dT, self.total_time)

        return False

    def onRemove(self):
        self.obj = None
        self.attr = None

from maths.Vect2 import Vect2
class Vect2AnimDriver(AnimDriver):
    def __init__(self, src_vec, dest_vec, t, ease_func):
        super(Vect2AnimDriver, self).__init__(src_vec, dest_vec, None, t, ease_func)
        self.start, self.end = Vect2(src_vec), Vect2(dest_vec)
        self.delta = self.end - self.start

    def update(self, dT):
        if self._kill:
            return True
        if self._skip:
            self.obj = self.end
            return True

        new_x = self.ease_func(self.t, self.start.x, self.delta.x, self.total_time)
        new_y = self.ease_func(self.t, self.start.y, self.delta.y, self.total_time)

        #if self.start.y < 0:
        #    print str(new_x) + ', ' + str(new_y)

        self.obj.x = new_x
        self.obj.y = new_y

        if self.t >= self.total_time:
            return True

        self.t = min(self.t + float(dT), self.total_time)

        return False

class IterableAnimDriver(AnimDriver):
    def __init__(self, iterable, obj, attr, loop, ease_func):
        # 30 fps
        t = 1
        if len(iterable) > 1:
            t = float(len(iterable)) * (1.0 / 30.0)

        super(IterableAnimDriver, self).__init__(obj, (0, len(iterable)-1), attr, t, ease_func)
        self.iterable = iterable
        self.delta = float(len(iterable)-1)
        self.loop = loop

    def update(self, dT):
        if self._kill:
            return True
        if self._skip:
            self.obj[self.attr] = self.iterable[self.end]
            return True

        new_idx = int(self.ease_func(self.t, self.start, self.delta, self.total_time))
        # clamp index to valid values
        new_idx = max(0, min(len(self.iterable), new_idx))

        self.obj.__dict__[self.attr] = self.iterable[new_idx]

        if self.t >= self.total_time:
            if self.loop:
                self.t = 0
                return False
            else:
                return True

        self.t = min(self.t + float(dT), self.total_time)
        return False

    def onRemove(self):
        super(IterableAnimDriver, self).onRemove()
        self.iterable = None


text:
package com.intellij.ide.plugins;

import com.intellij.icons.AllIcons;
import com.intellij.ide.IdeBundle;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.extensions.PluginId;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.ui.Messages;
import com.intellij.util.net.IOExceptionDialog;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.io.IOException;
import java.util.*;

/**
 * @author lloix
 */
public class InstallPluginAction extends AnAction implements DumbAware {
  private static final InstalledPluginsState ourState = InstalledPluginsState.getInstance();
  private static final Set<IdeaPluginDescriptor> ourInstallingNodes = new HashSet<>();

  private final PluginManagerMain myHost;
  private final PluginManagerMain myInstalled;

  public InstallPluginAction(PluginManagerMain mgr, PluginManagerMain installed) {
    super(IdeBundle.message("action.download.and.install.plugin"), IdeBundle.message("action.download.and.install.plugin"), AllIcons.Actions.Install);
    myHost = mgr;
    myInstalled = installed;
  }

  @Override
  public void update(AnActionEvent e) {
    Presentation presentation = e.getPresentation();
    IdeaPluginDescriptor[] selection = getPluginTable().getSelectedObjects();
    boolean enabled = (selection != null);

    if (enabled) {
      for (IdeaPluginDescriptor descr : selection) {
        presentation.setText(IdeBundle.message("action.download.and.install.plugin"));
        presentation.setDescription(IdeBundle.message("action.download.and.install.plugin"));
        enabled &= !ourInstallingNodes.contains(descr);
        if (descr instanceof PluginNode) {
          enabled &= !PluginManagerColumnInfo.isDownloaded((PluginNode)descr);
          if (((PluginNode)descr).getStatus() == PluginNode.STATUS_INSTALLED) {
            presentation.setText(IdeBundle.message("action.update.plugin"));
            presentation.setDescription(IdeBundle.message("action.update.plugin"));
            enabled &= ourState.hasNewerVersion(descr.getPluginId());
          }
        }
        else if (descr instanceof IdeaPluginDescriptorImpl) {
          presentation.setText(IdeBundle.message("action.update.plugin"));
          presentation.setDescription(IdeBundle.message("action.update.plugin"));
          PluginId id = descr.getPluginId();
          enabled = enabled && ourState.hasNewerVersion(id);
        }
      }
    }

    presentation.setEnabled(enabled);
  }

  @Override
  public void actionPerformed(AnActionEvent e) {
    install(null);
  }

  public static boolean isInstalling(IdeaPluginDescriptor node) {
    return ourInstallingNodes.contains(node);
  }

  public void install(@Nullable final Runnable onSuccess) {
    install(onSuccess, null, false);
  }

  public void install(@Nullable final Runnable onSuccess, @Nullable final Runnable cleanup, boolean confirmed) {
    IdeaPluginDescriptor[] selection = getPluginTable().getSelectedObjects();

    if (confirmed || userConfirm(selection)) {
      final List<PluginNode> list = new ArrayList<>();
      for (IdeaPluginDescriptor descr : selection) {
        PluginNode pluginNode = null;
        if (descr instanceof PluginNode) {
          pluginNode = (PluginNode)descr;
        }
        else if (descr instanceof IdeaPluginDescriptorImpl) {
          PluginId pluginId = descr.getPluginId();
          pluginNode = new PluginNode(pluginId);
          pluginNode.setName(descr.getName());
          pluginNode.setDepends(Arrays.asList(descr.getDependentPluginIds()), descr.getOptionalDependentPluginIds());
          pluginNode.setSize("-1");
          pluginNode.setRepositoryName(PluginInstaller.UNKNOWN_HOST_MARKER);
        }

        if (pluginNode != null) {
          list.add(pluginNode);
          ourInstallingNodes.add(pluginNode);
        }
      }

      final InstalledPluginsTableModel installedModel = (InstalledPluginsTableModel)myInstalled.getPluginsModel();
      PluginManagerMain.PluginEnabler.UI pluginEnabler = new PluginManagerMain.PluginEnabler.UI(installedModel);

      if (PluginManagerMain.suggestToEnableInstalledDependantPlugins(pluginEnabler, list)) {
        myInstalled.setRequireShutdown(true);
      }

      try {
        Runnable onInstallRunnable = () -> {
          for (PluginNode node : list) {
            installedModel.appendOrUpdateDescriptor(node);
          }
          if (!myInstalled.isDisposed()) {
            getPluginTable().updateUI();
            myInstalled.setRequireShutdown(true);
          }
          else {
            boolean needToRestart = false;
            for (PluginNode node : list) {
              final IdeaPluginDescriptor pluginDescriptor = PluginManager.getPlugin(node.getPluginId());
              if (pluginDescriptor == null || pluginDescriptor.isEnabled()) {
                needToRestart = true;
                break;
              }
            }

            if (needToRestart) {
              PluginManagerMain.notifyPluginsUpdated(null);
            }
          }
          if (onSuccess != null) {
            onSuccess.run();
          }
        };
        Runnable cleanupRunnable = () -> {
          ourInstallingNodes.removeAll(list);
          if (cleanup != null) {
            cleanup.run();
          }
        };
        final List<IdeaPluginDescriptor> plugins = myHost.getPluginsModel().getAllPlugins();
        PluginManagerMain.downloadPlugins(list, PluginManagerMain.mapToPluginIds(plugins), onInstallRunnable, pluginEnabler, cleanupRunnable);
      }
      catch (final IOException e1) {
        ourInstallingNodes.removeAll(list);
        PluginManagerMain.LOG.error(e1);
        //noinspection SSBasedInspection
        SwingUtilities.invokeLater(() -> IOExceptionDialog.showErrorDialog(IdeBundle.message("action.download.and.install.plugin"), IdeBundle.message("error.plugin.download.failed")));
      }
    }
  }

  public PluginTable getPluginTable() {
    return myHost.getPluginTable();
  }

  //---------------------------------------------------------------------------
  //  Show confirmation message depending on the amount and type of the
  //  selected plugin descriptors: already downloaded plugins need "update"
  //  while non-installed yet need "install".
  //---------------------------------------------------------------------------
  private boolean userConfirm(IdeaPluginDescriptor[] selection) {
    String message;
    if (selection.length == 1) {
      if (selection[0] instanceof IdeaPluginDescriptorImpl) {
        message = IdeBundle.message("prompt.update.plugin", selection[0].getName());
      }
      else {
        message = IdeBundle.message("prompt.download.and.install.plugin", selection[0].getName());
      }
    }
    else {
      message = IdeBundle.message("prompt.install.several.plugins", selection.length);
    }

    return Messages.showYesNoDialog(myHost.getMainPanel(), message, IdeBundle.message("action.download.and.install.plugin"), Messages.getQuestionIcon()) == Messages.YES;
  }
}


text:
'use strict';

describe('test search controller', function() {

  beforeEach(module('mapTweetInfoApp'));
  beforeEach(module('twitterSearchServices'));
  beforeEach(module('latLngServices'));

  describe('searchCtrl', function(){
    var scope, ctrl, $httpBackend, $browser, $location;

    beforeEach(inject(function(_$httpBackend_, $rootScope, $controller) {
    //   $httpBackend = _$httpBackend_;
    //   $httpBackend.expectGET('phones/phones.json').
    //       respond([{name: 'Nexus S'}, {name: 'Motorola DROID'}]);

      scope = $rootScope.$new();
      $location = scope.$service('$location');
      $browser = scope.$service('$browser');
      ctrl = $controller('searchCtrl', {$scope: scope});
    }));

    it('should have default variables set', function() {
      // expect(scope.phones).toEqualData([]);
      // $httpBackend.flush();

      expect(scope.counts).toEqualData(
        [{label: '25 Tweets', value: '25'},{label: '50 Tweets', value: '50'},{label: '75 Tweets', value: '75'},{label: '150 Tweets', value: '150'}]
      );
    });

    // it('should set the default value of orderProp model', function() {
    //   expect(scope.orderProp).toBe('age');
    // });
  });

});


text:
                    Nuris Akbar
                    08.00 - 21 agustus 2015

                    <button class="btn btn-box-tool" data-toggle="tooltip" title="Mark as read"></button>
                    <button class="btn btn-box-tool" data-widget="collapse"></button>
                    <button class="btn btn-box-tool" data-widget="remove"></button>

Far far away, behind the word mountains, far from the
                    countries Vokalia and Consonantia, there live the blind
                    texts. Separated they live in Bookmarksgrove right at

the coast of the Semantics, a large language ocean.
                    A small river named Duden flows by their place and supplies
                    it with the necessary regelialia. It is a paradisematic
                    country, in which roasted parts of sentences fly into
                    your mouth.


text:
"""Config flow to configure zone component."""
from __future__ import annotations

from typing import Any

from iaqualink.client import AqualinkClient
from iaqualink.exception import (
    AqualinkServiceException,
    AqualinkServiceUnauthorizedException,
)
import voluptuous as vol

from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.data_entry_flow import FlowResult

from .const import DOMAIN

class AqualinkFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
    """Aqualink config flow."""

    VERSION = 1

    async def async_step_user(
        self, user_input: dict[str, Any] | None = None
    ) -> FlowResult:
        """Handle a flow start."""
        # Supporting a single account.
        entries = self._async_current_entries()
        if entries:
            return self.async_abort(reason="single_instance_allowed")

        errors = {}

        if user_input is not None:
            username = user_input[CONF_USERNAME]
            password = user_input[CONF_PASSWORD]

            try:
                async with AqualinkClient(username, password):
                    pass
            except AqualinkServiceUnauthorizedException:
                errors["base"] = "invalid_auth"
            except AqualinkServiceException:
                errors["base"] = "cannot_connect"
            else:
                return self.async_create_entry(title=username, data=user_input)

        return self.async_show_form(
            step_id="user",
            data_schema=vol.Schema(
                {
                    vol.Required(CONF_USERNAME): str,
                    vol.Required(CONF_PASSWORD): str,
                }
            ),
            errors=errors,
        )


text:
> {%= description %}

## Quickstart
{%= docs("quickstart") %}

## Options
{%= docs("options") %}

## Usage Examples
{%= docs("examples") %}

***

## Contributing
{%= include("contributing") %}

## Authors
{%= include("authors") %}

## Other grunt-assemble plugins
{%= related(verb.related.list, {remove: name}) %}

## License
{%= copyright() %}
{%= license() %}

***

{%= include("footer") %}


text:
<?php require_once __DIR__ . "/../include/header.php"; ?>

Editar Categoria

            <form name="form" method="post" action="<?php echo "/categories/{$category->getId()}/update"; ?>">

                    Nome:
                    <input class="form-control" type="text" id="name" name="name" value="<?php echo $category->getName(); ?>"/>

                <button class="btn btn-default" type="submit">Salvar!</button>
            </form>

<?php require_once __DIR__ . "/../include/footer.php"; ?>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.Storage.Blobs;
using Azure.Storage.Files.DataLake.Models;

namespace Azure.Storage.Files.DataLake
{
    /// <summary>
    /// Provides the client configuration options for connecting to Azure Data Lake service.
    /// </summary>
    public class DataLakeClientOptions : ClientOptions
    {
        /// <summary>
        /// The Latest service version supported by this client library.
        /// </summary>
        internal const ServiceVersion LatestVersion = StorageVersionExtensions.LatestVersion;

        /// <summary>
        /// The versions of Azure Data Lake Sevice supported by this client
        /// library.  For more, see
        /// <see href="https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-services" />.
        /// </summary>
        public enum ServiceVersion
        {
#pragma warning disable CA1707 // Identifiers should not contain underscores
            /// <summary>
            /// The 2019-02-02 service version described at
            /// <see href="https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-services#version-2019-02-02" />
            /// </summary>
            V2019_02_02 = 1,

            /// <summary>
            /// The 2019-07-07 service version.
            /// </summary>
            V2019_07_07 = 2,

            /// <summary>
            /// The 2019-12-12 service version.
            /// </summary>
            V2019_12_12 = 3
#pragma warning restore CA1707 // Identifiers should not contain underscores
        }

        /// <summary>
        /// Gets the <see cref="ServiceVersion"/> of the service API used when
        /// making requests.  For more, see
        /// <see href="https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-services" />.
        /// </summary>
        public ServiceVersion Version { get; }

        /// <summary>
        /// Initializes a new instance of the <see cref="DataLakeClientOptions"/>
        /// class.
        /// </summary>
        /// <param name="version">
        /// The <see cref="ServiceVersion"/> of the service API used when
        /// making requests.
        /// </param>
        public DataLakeClientOptions(ServiceVersion version = LatestVersion)
        {
            if (ServiceVersion.V2019_02_02 <= version
                && version <= LatestVersion)
            {
                Version = version;
            }
            else
            {
                throw Errors.VersionNotSupported(nameof(version));
            }

            this.Initialize();
            AddHeadersAndQueryParameters();
        }

        /// <summary>
        /// Gets or sets the secondary storage <see cref="Uri"/> that can be read from for the storage account if the
        /// account is enabled for RA-GRS.
        ///
        /// If this property is set, the secondary Uri will be used for GET or HEAD requests during retries.
        /// If the status of the response from the secondary Uri is a 404, then subsequent retries for
        /// the request will not use the secondary Uri again, as this indicates that the resource
        /// may not have propagated there yet. Otherwise, subsequent retries will alternate back and forth
        /// between primary and secondary Uri.
        /// </summary>
        public Uri GeoRedundantSecondaryUri { get; set; }

        /// <summary>
        /// Add headers and query parameters in <see cref="DiagnosticsOptions.LoggedHeaderNames"/> and <see cref="DiagnosticsOptions.LoggedQueryParameters"/>
        /// </summary>
        private void AddHeadersAndQueryParameters()
        {
            // Data Lake headers
            Diagnostics.LoggedHeaderNames.Add("x-ms-properties");
            Diagnostics.LoggedHeaderNames.Add("x-ms-client-request-id");
            Diagnostics.LoggedHeaderNames.Add("If-Modified-Since");
            Diagnostics.LoggedHeaderNames.Add("If-Unmodified-Since");
            Diagnostics.LoggedHeaderNames.Add("If-Match");
            Diagnostics.LoggedHeaderNames.Add("If-None-Match");
            Diagnostics.LoggedHeaderNames.Add("x-ms-rename-source");
            Diagnostics.LoggedHeaderNames.Add("x-ms-source-lease-id");
            Diagnostics.LoggedHeaderNames.Add("x-ms-permissions");
            Diagnostics.LoggedHeaderNames.Add("x-ms-umask");
            Diagnostics.LoggedHeaderNames.Add("x-ms-owner");
            Diagnostics.LoggedHeaderNames.Add("x-ms-group");
            Diagnostics.LoggedHeaderNames.Add("x-ms-acl");

            // Data Lake query parameters
            Diagnostics.LoggedQueryParameters.Add("recursive");
            Diagnostics.LoggedQueryParameters.Add("resource");
            Diagnostics.LoggedQueryParameters.Add("action");
            Diagnostics.LoggedQueryParameters.Add("position");
            Diagnostics.LoggedQueryParameters.Add("retainUncommittedData");
            Diagnostics.LoggedQueryParameters.Add("close");
            Diagnostics.LoggedQueryParameters.Add("timeout");
            Diagnostics.LoggedQueryParameters.Add("directory");
            Diagnostics.LoggedQueryParameters.Add("continuation");
            Diagnostics.LoggedQueryParameters.Add("upn");
            Diagnostics.LoggedQueryParameters.Add("maxResults");
            Diagnostics.LoggedQueryParameters.Add("mode");

            // Blob headers
            Diagnostics.LoggedHeaderNames.Add("Access-Control-Allow-Origin");
            Diagnostics.LoggedHeaderNames.Add("x-ms-date");
            Diagnostics.LoggedHeaderNames.Add("x-ms-error-code");
            Diagnostics.LoggedHeaderNames.Add("x-ms-request-id");
            Diagnostics.LoggedHeaderNames.Add("x-ms-version");
            Diagnostics.LoggedHeaderNames.Add("Accept-Ranges");
            Diagnostics.LoggedHeaderNames.Add("Content-Disposition");
            Diagnostics.LoggedHeaderNames.Add("Content-Encoding");
            Diagnostics.LoggedHeaderNames.Add("Content-Language");
            Diagnostics.LoggedHeaderNames.Add("Content-MD5");
            Diagnostics.LoggedHeaderNames.Add("Content-Range");
            Diagnostics.LoggedHeaderNames.Add("Vary");
            Diagnostics.LoggedHeaderNames.Add("x-ms-content-crc64");
            Diagnostics.LoggedHeaderNames.Add("x-ms-copy-action");
            Diagnostics.LoggedHeaderNames.Add("x-ms-copy-completion-time");
            Diagnostics.LoggedHeaderNames.Add("x-ms-copy-id");
            Diagnostics.LoggedHeaderNames.Add("x-ms-copy-progress");
            Diagnostics.LoggedHeaderNames.Add("x-ms-copy-status");
            Diagnostics.LoggedHeaderNames.Add("x-ms-has-immutability-policy");
            Diagnostics.LoggedHeaderNames.Add("x-ms-has-legal-hold");
            Diagnostics.LoggedHeaderNames.Add("x-ms-lease-state");
            Diagnostics.LoggedHeaderNames.Add("x-ms-lease-status");
            Diagnostics.LoggedHeaderNames.Add("x-ms-range");
            Diagnostics.LoggedHeaderNames.Add("x-ms-request-server-encrypted");
            Diagnostics.LoggedHeaderNames.Add("x-ms-server-encrypted");
            Diagnostics.LoggedHeaderNames.Add("x-ms-snapshot");
            Diagnostics.LoggedHeaderNames.Add("x-ms-source-range");
            Diagnostics.LoggedHeaderNames.Add("x-ms-access-tier");
            Diagnostics.LoggedHeaderNames.Add("x-ms-access-tier-change-time");
            Diagnostics.LoggedHeaderNames.Add("x-ms-access-tier-inferred");
            Diagnostics.LoggedHeaderNames.Add("x-ms-account-kind");
            Diagnostics.LoggedHeaderNames.Add("x-ms-archive-status");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-append-offset");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-cache-control");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-committed-block-count");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-condition-appendpos");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-condition-maxsize");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-content-disposition");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-content-encoding");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-content-language");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-content-length");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-content-md5");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-content-type");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-public-access");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-sequence-number");
            Diagnostics.LoggedHeaderNames.Add("x-ms-blob-type");
            Diagnostics.LoggedHeaderNames.Add("x-ms-copy-destination-snapshot");
            Diagnostics.LoggedHeaderNames.Add("x-ms-creation-time");
            Diagnostics.LoggedHeaderNames.Add("x-ms-default-encryption-scope");
            Diagnostics.LoggedHeaderNames.Add("x-ms-delete-snapshots");
            Diagnostics.LoggedHeaderNames.Add("x-ms-delete-type-permanent");
            Diagnostics.LoggedHeaderNames.Add("x-ms-deny-encryption-scope-override");
            Diagnostics.LoggedHeaderNames.Add("x-ms-encryption-algorithm");
            Diagnostics.LoggedHeaderNames.Add("x-ms-if-sequence-number-eq");
            Diagnostics.LoggedHeaderNames.Add("x-ms-if-sequence-number-le");
            Diagnostics.LoggedHeaderNames.Add("x-ms-if-sequence-number-lt");
            Diagnostics.LoggedHeaderNames.Add("x-ms-incremental-copy");
            Diagnostics.LoggedHeaderNames.Add("x-ms-lease-action");
            Diagnostics.LoggedHeaderNames.Add("x-ms-lease-break-period");
            Diagnostics.LoggedHeaderNames.Add("x-ms-lease-duration");
            Diagnostics.LoggedHeaderNames.Add("x-ms-lease-id");
            Diagnostics.LoggedHeaderNames.Add("x-ms-lease-time");
            Diagnostics.LoggedHeaderNames.Add("x-ms-page-write");
            Diagnostics.LoggedHeaderNames.Add("x-ms-proposed-lease-id");
            Diagnostics.LoggedHeaderNames.Add("x-ms-range-get-content-md5");
            Diagnostics.LoggedHeaderNames.Add("x-ms-rehydrate-priority");
            Diagnostics.LoggedHeaderNames.Add("x-ms-sequence-number-action");
            Diagnostics.LoggedHeaderNames.Add("x-ms-sku-name");
            Diagnostics.LoggedHeaderNames.Add("x-ms-source-content-md5");
            Diagnostics.LoggedHeaderNames.Add("x-ms-source-if-match");
            Diagnostics.LoggedHeaderNames.Add("x-ms-source-if-modified-since");
            Diagnostics.LoggedHeaderNames.Add("x-ms-source-if-none-match");
            Diagnostics.LoggedHeaderNames.Add("x-ms-source-if-unmodified-since");
            Diagnostics.LoggedHeaderNames.Add("x-ms-tag-count");
            Diagnostics.LoggedHeaderNames.Add("x-ms-encryption-key-sha256");

            // Blob query parameters
            Diagnostics.LoggedQueryParameters.Add("comp");
            Diagnostics.LoggedQueryParameters.Add("maxresults");
            Diagnostics.LoggedQueryParameters.Add("rscc");
            Diagnostics.LoggedQueryParameters.Add("rscd");
            Diagnostics.LoggedQueryParameters.Add("rsce");
            Diagnostics.LoggedQueryParameters.Add("rscl");
            Diagnostics.LoggedQueryParameters.Add("rsct");
            Diagnostics.LoggedQueryParameters.Add("se");
            Diagnostics.LoggedQueryParameters.Add("si");
            Diagnostics.LoggedQueryParameters.Add("sip");
            Diagnostics.LoggedQueryParameters.Add("sp");
            Diagnostics.LoggedQueryParameters.Add("spr");
            Diagnostics.LoggedQueryParameters.Add("sr");
            Diagnostics.LoggedQueryParameters.Add("srt");
            Diagnostics.LoggedQueryParameters.Add("ss");
            Diagnostics.LoggedQueryParameters.Add("st");
            Diagnostics.LoggedQueryParameters.Add("sv");
            Diagnostics.LoggedQueryParameters.Add("include");
            Diagnostics.LoggedQueryParameters.Add("marker");
            Diagnostics.LoggedQueryParameters.Add("prefix");
            Diagnostics.LoggedQueryParameters.Add("copyid");
            Diagnostics.LoggedQueryParameters.Add("restype");
            Diagnostics.LoggedQueryParameters.Add("blockid");
            Diagnostics.LoggedQueryParameters.Add("blocklisttype");
            Diagnostics.LoggedQueryParameters.Add("delimiter");
            Diagnostics.LoggedQueryParameters.Add("prevsnapshot");
            Diagnostics.LoggedQueryParameters.Add("ske");
            Diagnostics.LoggedQueryParameters.Add("skoid");
            Diagnostics.LoggedQueryParameters.Add("sks");
            Diagnostics.LoggedQueryParameters.Add("skt");
            Diagnostics.LoggedQueryParameters.Add("sktid");
            Diagnostics.LoggedQueryParameters.Add("skv");
            Diagnostics.LoggedQueryParameters.Add("snapshot");
        }

        /// <summary>
        /// Create an HttpPipeline from DataLakeClientOptions.
        /// </summary>
        /// <param name="authentication">Optional authentication policy.</param>
        /// <returns>An HttpPipeline to use for Storage requests.</returns>
        internal HttpPipeline Build(HttpPipelinePolicy authentication = null)
        {
            return this.Build(authentication, GeoRedundantSecondaryUri);
        }

        /// <summary>
        /// Create an HttpPipeline from DataLakeClientOptions.
        /// </summary>
        /// <param name="credentials">Optional authentication credentials.</param>
        /// <returns>An HttpPipeline to use for Storage requests.</returns>
        internal HttpPipeline Build(object credentials)
        {
            return this.Build(credentials, GeoRedundantSecondaryUri);
        }
    }
}


text:
.. _menpofit-lk-ForwardAdditive:

.. currentmodule:: menpofit.lk

ForwardAdditive
===============
.. autoclass:: ForwardAdditive
  :members:
  :inherited-members:
  :show-inheritance:


text:
@interface CXConstraint()

@property (nonatomic, strong) UIView *view;         //要添加约束的视图
@property (nonatomic, assign) UILayoutPriority layoutPriority;

@property (nonatomic, assign, readonly) NSLayoutRelation layoutRelation;
@property (nonatomic, assign) CGFloat layoutMultiplier;
@property (nonatomic, assign) NSLayoutRelation constant;

@property (nonatomic, weak) UIView *installedView;  //布局约束所添加的视图

@end

@implementation CXConstraint

- (CXConstraint *)initWithView:(UIView *)view relation:(NSLayoutRelation)relation{
    self = [super init];
    if (!self) return nil;

    self.view = view;
    self.layoutPriority = UILayoutPriorityRequired;        //约束等级默认为"必须的"
    self.layoutMultiplier = 1;                              //倍数默认为"1"
    self.constant = 0;

    return self;
}

- (CXConstraint *)constraintWithSelfLayoutAttribute:(NSLayoutAttribute)layoutAttr otherAttribute:(CXViewAttribute *)attrSec multiplier:(CGFloat)multiplier constant:(CGFloat)constant{

    UIView *secondView = nil;
    NSLayoutAttribute secondViewAttr = NSLayoutAttributeNotAnAttribute;

    if (attrSec) {
        secondView = attrSec.view;
        secondViewAttr = attrSec.layoutAttribute;
    }

    if (multiplier) {
        self.layoutMultiplier = multiplier;
    }

    if (constant) {
        self.constant = constant;
    }

    self.firstViewAttribute = [[CXViewAttribute alloc] initWithView:self.view layoutAttribute:layoutAttr];
    self.secondViewAttribute = [[CXViewAttribute alloc] initWithView:secondView layoutAttribute:secondViewAttr];

    return self;
}

- (void)install {

    UIView *firstLayoutItem = self.firstViewAttribute.item;
    NSLayoutAttribute firstLayoutAttribute = self.firstViewAttribute.layoutAttribute;

    UIView *secondLayoutItem = self.secondViewAttribute.item;
    NSLayoutAttribute secondLayoutAttribute = self.secondViewAttribute.layoutAttribute;

    if (self.secondViewAttribute.view){
        //寻找两个视图的公共父视图
        UIView *closestCommonSuperview = [self.firstViewAttribute.view
                                          closestCommonSuperview:self.secondViewAttribute.view];
        self.installedView = closestCommonSuperview;
    }else if (self.firstViewAttribute.layoutAttribute == NSLayoutAttributeWidth || self.firstViewAttribute.layoutAttribute == NSLayoutAttributeHeight){
        self.installedView = self.firstViewAttribute.view;
    }else{
        self.installedView = self.firstViewAttribute.view.superview;

        secondLayoutItem = self.installedView;
        secondLayoutAttribute = firstLayoutAttribute;
    }

#pragma -- Mark 使用NSLayoutConstraint添加约束

    // create constraints
    NSLayoutConstraint *layoutConstraint
    = [NSLayoutConstraint constraintWithItem:firstLayoutItem
                                    attribute:firstLayoutAttribute
                                    relatedBy:self.layoutRelation
                                       toItem:secondLayoutItem
                                    attribute:secondLayoutAttribute
                                   multiplier:self.layoutMultiplier
                                     constant:self.constant];

    layoutConstraint.priority = self.layoutPriority;
//    layoutConstraint.mas_key = self.mas_key;

    NSLayoutConstraint *existingConstraint = nil;
    if (self.layoutType == CXLayoutTypeUpdate) {
        existingConstraint = [self layoutConstraintSimilarTo:layoutConstraint];
    }

    if (existingConstraint) {
        // update constraints
        existingConstraint.constant = layoutConstraint.constant;
    } else {
        // add constraints
        [self.installedView addConstraint:layoutConstraint];
    }
}

- (NSLayoutConstraint *)layoutConstraintSimilarTo:(NSLayoutConstraint *)layoutConstraint {
    for (NSLayoutConstraint *existingConstraint in self.installedView.constraints.reverseObjectEnumerator) {
        if (![existingConstraint isKindOfClass:NSLayoutConstraint.class]) continue;
        if (existingConstraint.firstItem != layoutConstraint.firstItem) continue;
        if (existingConstraint.secondItem != layoutConstraint.secondItem) continue;
        if (existingConstraint.firstAttribute != layoutConstraint.firstAttribute) continue;
        if (existingConstraint.secondAttribute != layoutConstraint.secondAttribute) continue;
        if (existingConstraint.relation != layoutConstraint.relation) continue;
        if (existingConstraint.multiplier != layoutConstraint.multiplier) continue;
        if (existingConstraint.priority != layoutConstraint.priority) continue;

        return (id)existingConstraint;
    }
    return nil;
}

@end


text:
package fr.cvlaminck.owm.model;

public class WeatherCondition
{
	private int m_id;
	private String m_main;
	private String m_description;
	private String m_icon;

	public WeatherCondition()
	{
	}

	public int getId() {
		return m_id;
	}

	public void setId(int m_id) {
		this.m_id = m_id;
	}

	public String getMain() {
		return m_main;
	}

	public void setMain(String main) {
		this.m_main = main;
	}

	public String getDescription() {
		return m_description;
	}

	public void setDescription(String description) {
		this.m_description = description;
	}

	public String getIcon() {
		return m_icon;
	}

	public void setIcon(String icon) {
		this.m_icon = icon;
	}

}


text:
/**
 * This package contains core utility classes that can be used to extend the framework and used in the application
 * logic.
 */
package com.github.leanframeworks.propertiesframework.base.utils;


text:
echo "*****FIRST BOOT*****"

mv /etc/sudoers /etc/sudoers-orig
chmod 440 /root/sudoers
cp /root/sudoers /etc/sudoers
#chmod 440 /etc/sudoers
cp /root/testwriteaccess.sh /usr/local/sbin
chmod 755 /usr/local/sbin/testwriteaccess.sh
cp /root/testuseraccess.sh /usr/local/sbin
chmod 755 /usr/local/sbin/testuseraccess.sh
cp /root/listAdmiralUsers.sh /usr/local/sbin
chmod 755 /usr/local/sbin/listAdmiralUsers.sh
cp /root/admiraluserinfo.sh /usr/local/sbin
chmod 755 /usr/local/sbin/admiraluserinfo.sh
cp /root/admiralupdateuserinfo.sh /usr/local/sbin
chmod 755 /usr/local/sbin/admiralupdateuserinfo.sh
cp /root/admiraladdnewuser.sh /usr/local/sbin
chmod 755 /usr/local/sbin/admiraladdnewuser.sh
smbpasswd -s -a admiral <<END
%{PASSWORD}
%{PASSWORD}
END

a2enmod authnz_ldap
a2enmod ssl
a2ensite default-ssl

#a2enmod webauth
#a2enmod auth_kerb
#ln -s /var/lib/webauth /etc/apache2/webauth
#cp /root/webauth.keytab /etc/apache2/webauth/keytab
#chgrp www-data /etc/apache2/webauth/keytab
#chmod u=rw,g=r,o= /etc/apache2/webauth/keytab
#cp /root/krb5.keytab /etc/krb5.keytab
#chmod u=rw,go= /etc/krb5.keytab
#cp /root/webdav.keytab /etc/apache2/webdav.keytab
#chown root:www-data /etc/apache2/webdav.keytab
#chmod 640 /etc/apache2/webdav.keytab

mkdir /home/data
chown www-data: /home/data
chmod g+ws /home/data
cp /root/ADMIRAL.README /home/data

chmod +x /root/make-apache2-cert.sh
/root/make-apache2-cert.sh %{HOSTFULLNAME}
cp /root/apache-default-ssl /etc/apache2/sites-available/default-ssl

a2enmod dav
a2enmod dav_fs
mkdir /usr/share/apache2/var
touch /usr/share/apache2/var/DAVlock
chown -R www-data:www-data /usr/share/apache2/var
mv /etc/apache2/sites-available/default /etc/apache2/sites-available/default_orig
cp /root/apache-default /etc/apache2/sites-available/default

a2enmod proxy
a2enmod proxy_http
cp /root/apache-databank-proxy /etc/apache2/conf.d/databank-proxy.conf

/etc/init.d/apache2 restart

gunzip /usr/share/doc/smbldap-tools/configure.pl.gz
adduser openldap ssl-cert


text:
namespace exo {

ExtendedDragOffer::ExtendedDragOffer(DataOffer* offer, Delegate* delegate)
    : offer_(offer), delegate_(delegate) {
  DCHECK(offer_);
  DCHECK(delegate_);
}

ExtendedDragOffer::~ExtendedDragOffer() {
  delegate_->OnDataOfferDestroying();
}

// TODO(crbug.com/1099418): Implement extended-drag Wayland extension.
void ExtendedDragOffer::Swallow(uint32_t serial, const std::string& mime_type) {
  NOTIMPLEMENTED();
}

// TODO(crbug.com/1099418): Implement extended-drag Wayland extension.
void ExtendedDragOffer::Unswallow(uint32_t serial,
                                  const std::string& mime_type,
                                  const gfx::Vector2d& offset) {
  NOTIMPLEMENTED();
}

void ExtendedDragOffer::OnDataOfferDestroying(DataOffer* offer) {
  DCHECK_EQ(offer, offer_);
  offer_ = nullptr;
}

}  // namespace exo


text:
package org.conqat.engine.core.driver.util;

import java.io.Serializable;

/**
 * This class represents multiplicities, i.e., ranges with upper and lower
 * bounds, where the lower bound is always non-negative and the upper bound
 * potentially infinite.
 *

 * The class is immutable, so all modification will result in new objects being
 * created.
 *
 * @author $Author: kinnen $
 * @version $Rev: 41751 $
 * @ConQAT.Rating GREEN Hash: 832175AC812C7E3C8ABE5C5459D8F2BC
 */
public final class Multiplicity implements Serializable {

	/** Version used for serialization. */
	private static final long serialVersionUID = 1;

	/** An "infinite" value. */
	public static final int INFINITY = Integer.MAX_VALUE;

	/** Empty multiplicity zero, i.e. [0,0]. */
	public static final Multiplicity ZERO = new Multiplicity(0, 0);

	/** The lower bound */
	private final int lower;

	/** The upper bound */
	private final int upper;

	/** Create interval ranging form 0 to infinity. */
	public Multiplicity() {
		lower = 0;
		upper = INFINITY;
	}

	/** Create interval with given bounds. */
	public Multiplicity(int lower, int upper) {
		this.lower = lower;
		this.upper = upper;
	}

	/** Intersects this multiplicity with another one. The result is returned. */
	public Multiplicity intersect(Multiplicity m) {
		return new Multiplicity(Math.max(lower, m.lower), Math.min(upper,
				m.upper));
	}

	/**
	 * Adds this multiplicity with another one by adding individual bounds. The
	 * result is returned.
	 */
	public Multiplicity add(Multiplicity m) {
		int newUpper = upper + m.upper;
		if (isUnbounded() || m.isUnbounded()) {
			newUpper = INFINITY;
		}

		return new Multiplicity(lower + m.lower, newUpper);
	}

	/** Returns the lower bound. */
	public int getLower() {
		return lower;
	}

	/** Returns the upper bound. */
	public int getUpper() {
		return upper;
	}

	/** Returns whether the upper bound is missing. */
	public boolean isUnbounded() {
		return upper == INFINITY;
	}

	/** Returns whether this interval is empty. */
	public boolean isEmpty() {
		return upper < lower;
	}

	/**
	 * Returns a new multiplicity whose bounds are both increased by the given
	 * amount (which also may be negative). For this the lower bound always
	 * saturates at zero and an infinite upper bound behaves correctly.
	 *
	 * @param amount
	 *            the amount by which the boundaries are increased.
	 * @return the adjusted multiplicity.
	 */
	public Multiplicity shiftBounds(int amount) {
		int newLower = Math.max(0, lower + amount);
		int newUpper = isUnbounded() ? INFINITY : upper + amount;
		return new Multiplicity(newLower, newUpper);
	}

	/**
	 * Returns a new multiplicity m divided by a
	 * factor, i.e. any value in the returned range will fit into
	 * this range after multiplication with the factor. Unbounded multiplicities
	 * are handled correctly.
	 *

	 * In formulas:
	 *
	 *

	 *         this.lower <= factor * m.lower
	 *         this.upper >= factor * m.upper
	 *

	 *
	 * @param factor
	 *            the factor by which to divide (must be positive).
	 * @return the adjusted multiplicity.
	 */
	public Multiplicity divideBy(int factor) {
		if (factor < 1) {
			throw new IllegalArgumentException("Factor must be positive!");
		}
		// round up
		int newLower = (lower + factor - 1) / factor;

		// round down
		int newUpper = isUnbounded() ? INFINITY : upper / factor;

		return new Multiplicity(newLower, newUpper);
	}

	/** {@inheritDoc} */
	@Override
	public String toString() {
		String result = "[" + lower + ", ";
		if (isUnbounded()) {
			result += "INF[";
		} else {
			result += upper + "]";
		}
		return result;
	}

	/** {@inheritDoc} */
	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Multiplicity)) {
			return false;
		}
		Multiplicity m = (Multiplicity) obj;

		return (lower == m.lower) && (upper == m.upper);
	}

	/** Returns a hash code based on the lower and upper bound. */
	@Override
	public int hashCode() {
		return lower + 93 * upper;
	}

	/**
	 * Returns whether this is a singleton, i.e. the lower and upper bounds are
	 * finite and the same.
	 */
	public boolean isSingleton() {
		return !isUnbounded() && lower == upper;
	}
}


text:
#ifndef DAPINCLUDES_H
#define DAPINCLUDES_H 1

#include "config.h"
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include <stdio.h>

#include "netcdf.h"

#include "ncbytes.h"
#include "nclist.h"
#include "nclog.h"
#include "ncuri.h"

#include "fbits.h"
#include "dceconstraints.h"

#include "ncdispatch.h"
#include "nc.h"
#include "nc3internal.h"
 /* netcdf overrides*/
#include "dapnc.h"

#include "oc.h"

#include "ncdap.h"
#include "nccommon.h"
#include "dapdebug.h"
#include "daputil.h"

/**************************************************/
/* sigh, do the forwards */
struct NCprojection;
struct NCselection;
struct Getvara;
struct NCcachenode;
struct NCcache;
struct NCslice;
struct NCsegment;

/**************************************************/

#include "getvara.h"
#include "constraints.h"

/**************************************************/

extern struct NCTMODEL nctmodels[];

/**************************************************/
/* Import some internal procedures from libsrc*/

/* Internal, but non-static procedures */
extern NCerror computecdfvarnames(NCDAPCOMMON*,CDFnode*,NClist*);
extern NCerror computecdfnodesets(NCDAPCOMMON* nccomm, CDFtree* tree);
extern NCerror computevarnodes(NCDAPCOMMON*, NClist*, NClist*);
extern NCerror collectvardefdims(NCDAPCOMMON* drno, CDFnode* var, NClist* dimset);
extern NCerror fixgrids(NCDAPCOMMON* drno);
extern NCerror dapmerge(NCDAPCOMMON* drno, CDFnode* node, OCobject dasroot);
extern NCerror sequencecheck(NCDAPCOMMON* drno);
extern NCerror computecdfdimnames(NCDAPCOMMON*);
extern NCerror attachdatadds(struct NCDAPCOMMON*);
extern NCerror detachdatadds(struct NCDAPCOMMON*);
extern void dapdispatch3init(void);

/*
extern void dereference(NCconstraint* constraint);
extern NCerror rereference(NCconstraint*, NClist*);
*/

extern NCerror dapbuildvaraprojection(CDFnode*,
		     const size_t* startp, const size_t* countp, const ptrdiff_t* stridep,
		     struct DCEprojection** projectionlist);

extern NCerror nc3d_getvarx(int ncid, int varid,
	    const size_t *startp,
	    const size_t *countp,
	    const ptrdiff_t *stridep,
	    void *data,
	    nc_type dsttype0);

/**************************************************/

extern NCerror nc3d_open(const char* path, int mode, int* ncidp);
extern int nc3d_close(int ncid);
extern NCerror restruct(NCDAPCOMMON*, CDFnode* ddsroot, CDFnode* pattern, NClist*);
extern void setvisible(CDFnode* root, int visible);
extern NCerror mapnodes(CDFnode* dstroot, CDFnode* srcroot);
extern void unmap(CDFnode* root);

#if 0
extern NCerror fetchpatternmetadata(NCDAPCOMMON* nccomm);
extern NCerror fetchconstrainedmetadata(NCDAPCOMMON* nccomm);
extern void applyclientparamcontrols(NCDAPCOMMON*);
extern NCerror suppressunusablevars(NCDAPCOMMON*);
extern void estimatevarsizes(NCDAPCOMMON*);
extern NCerror showprojection(NCDAPCOMMON*, CDFnode* var);
#endif

/* From: dapcvt.c*/
extern NCerror dapconvert(nc_type, nc_type, char*, char*, size_t);
extern int dapcvtattrval(nc_type, void*, NClist*, NCattribute*);

#endif /*DAPINCLUDES_H*/


text:
<?php

/*
 * This file is part of Gush package.
 *
 * (c) Luis Cordova <cordoval@gmail.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Gush\Command\Core;

use Gush\Command\BaseCommand;
use Gush\Config;
use Gush\ConfigFactory;
use Gush\Feature\GitFolderFeature;
use Gush\Helper\GitHelper;
use Gush\Helper\StyleHelper;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class InitCommand extends BaseCommand implements GitFolderFeature
{
    /**
     * Configures the current command.
     *
     * Actual options are configured by the CoreInitSubscriber.
     */
    protected function configure()
    {
        $this
            ->setName('core:init')
            ->setDescription('Configures a local .gush.yml config file')
            ->setHelp(
                <<<EOF
The <info>%command.name%</info> creates .gush.yml file that Gush will use for project in current directory:

    <info>$ gush %command.name%</info>

EOF
            )
        ;
    }

    protected function interact(InputInterface $input, OutputInterface $output)
    {
        /** @var StyleHelper $styleHelper */
        $styleHelper = $this->getHelper('gush_style');
        $adapters = $this->getAdapters();

        $input->setOption(
            'repo-adapter',
            $styleHelper->numberedChoice(
                'Choose repository-manager',
                $adapters[0],
                GitHelper::undefinedToDefault($input->getOption('repo-adapter'))
            )
        );

        $input->setOption(
            'issue-adapter',
            $styleHelper->numberedChoice(
                'Choose issue-tracker',
                $adapters[1],
                GitHelper::undefinedToDefault($input->getOption('issue-adapter'))
            )
        );

        $input->setOption(
            'org',
            $styleHelper->ask(
                'Specify the repository organization name',
                GitHelper::undefinedToDefault($input->getOption('org'))
            )
        );

        $input->setOption(
            'repo',
            $styleHelper->ask('Specify the repository name', GitHelper::undefinedToDefault($input->getOption('repo')))
        );

        $input->setOption(
            'issue-org',
            $styleHelper->ask(
                'Specify the issue-tracker organization name',
                GitHelper::undefinedToDefault($input->getOption('issue-org'), $input->getOption('org'))
            )
        );

        $input->setOption(
            'issue-project',
            $styleHelper->ask(
                'Specify the issue-tracker repository/project name',
                GitHelper::undefinedToDefault($input->getOption('issue-project'), $input->getOption('repo'))
            )
        );
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var \Gush\Application $application */
        $application = $this->getApplication();

        $config = $application->getConfig();
        $valid = true;

        /** @var StyleHelper $styleHelper */
        $styleHelper = $this->getHelper('gush_style');

        $adapters = $this->getAdapters();
        $repositoryManagers = $adapters[0];
        $issueTrackers = $adapters[1];

        $repositoryManager = GitHelper::undefinedToDefault($input->getOption('repo-adapter'));
        $issueTracker = GitHelper::undefinedToDefault($input->getOption('issue-adapter'));

        $org = GitHelper::undefinedToDefault($input->getOption('org'));
        $repo = GitHelper::undefinedToDefault($input->getOption('repo'));

        $issueOrg = GitHelper::undefinedToDefault($input->getOption('issue-org'), $org);
        $issueRepo = GitHelper::undefinedToDefault($input->getOption('issue-project'), $repo);

        $this->validateAdapter($repositoryManager, $repositoryManagers, 'Repository-manager', $valid);
        $this->validateAdapter($issueTracker, $issueTrackers, 'Issue-tracker', $valid);

        if (!$valid) {
            return self::COMMAND_FAILURE;
        }

        $this->checkAdapterConfigured(
            $repositoryManager,
            $repositoryManagers[$repositoryManager],
            'Repository-manager',
            $valid
        );

        $this->checkAdapterConfigured(
            $issueTracker,
            $issueTrackers[$issueTracker],
            'Issue-tracker',
            $valid
        );

        if (!$valid) {
            if ($input->isInteractive() &&
                $styleHelper->confirm('Would you like to configure the missing adapters now?')
            ) {
                $application->doRun(new ArrayInput(['command' => 'core:configure']), $output);
            } else {
                $styleHelper->note(
                    [
                        'You cannot use the selected repository-manager and/or issue-tracker until its configured.',
                        'Run the "core:configure" command to configure the adapters.',
                    ]
                );
            }
        }

        $params = [
            'repo_adapter' => $repositoryManager,
            'issue_tracker' => $issueTracker,
            'repo_org' => $org,
            'repo_name' => $repo,
            'issue_project_org' => $issueOrg,
            'issue_project_name' => $issueRepo,
        ];

        $config->merge($params, Config::CONFIG_LOCAL);

        ConfigFactory::dumpToFile($config, Config::CONFIG_LOCAL);

        $styleHelper->success('Configuration file saved successfully.');

        return self::COMMAND_SUCCESS;
    }

    private function validateAdapter($selected, array $available, $type, &$valid)
    {
        if (!array_key_exists($selected, $available)) {
            $this->getHelper('gush_style')->error(
                sprintf(
                    '%s "%s" is invalid. Available adapters are "%s".',
                    $type,
                    $selected,
                    implode('", "', array_keys($available))
                )
            );

            $valid = false;
        }
    }

    private function checkAdapterConfigured($selected, $label, $typeLabel, &$valid)
    {
        /** @var \Gush\Application $application */
        $application = $this->getApplication();
        $config = $application->getConfig();

        if (!$config->has(['adapters', $selected])) {
            $this->getHelper('gush_style')->note(
                sprintf('%s "%s" is not configured yet.', $typeLabel, $label)
            );

            $valid = false;
        }
    }

    private function getAdapters()
    {
        /** @var \Gush\Application $application */
        $application = $this->getApplication();
        $adapters = $application->getAdapterFactory()->all();

        static $repositoryManagers, $issueTrackers;

        if (null === $repositoryManagers) {
            $repositoryManagers = [];
            $issueTrackers = [];

            foreach ($adapters as $adapterName => $adapter) {
                if ($adapter['supports_repository_manager']) {
                    $repositoryManagers[$adapterName] = $adapter['label'];
                }

                if ($adapter['supports_issue_tracker']) {
                    $issueTrackers[$adapterName] = $adapter['label'];
                }
            }
        }

        return [$repositoryManagers, $issueTrackers];
    }
}


text:
using NUnit.Framework;
using System;
using System.IO;

namespace lab5_v8
{
	[TestFixture ()]
	public class TestBinaryFileDoubleEnumerator
	{
		// https://msdn.microsoft.com/en-us/library/system.io.binaryreader.readdouble(v=vs.110).aspx
		[Test ()]
		public void TestIterations ()
		{
			int i;
			const int arrayLength = 1000;

			// Create random data to write to the stream.
			Random randomGenerator = new Random();
			double[] dataArray = new double[arrayLength];
			for(i = 0; i < arrayLength; i++)
			{
				dataArray[i] = 100.1 * randomGenerator.NextDouble();
			}

			using (BinaryWriter binWriter =
				      new BinaryWriter (new MemoryStream ()))
			{
				// Write the data to the stream.
				Console.WriteLine ("Writing data to the stream.");
				for (i = 0; i < arrayLength; i++) {
					binWriter.Write (dataArray [i]);
				}

				// Create a reader using the stream from the writer.
				BinaryFileDoubleEnumerator enumer =
					new BinaryFileDoubleEnumerator (binWriter.BaseStream);

				// Return to the beginning of the stream.
				enumer.Reset ();

				for (i = 0; i < arrayLength; i++) {
					enumer.MoveNext ();

					Assert.AreEqual (dataArray [i], enumer.Current);
				}
			}
		}
	}
}


text:
<?php

namespace Viteloge\FrontendBundle\Form\Type {

    use Symfony\Component\OptionsResolver\OptionsResolver;
    use Symfony\Component\Form\AbstractType;
    use Symfony\Component\Form\FormInterface;
    use Symfony\Component\Form\FormBuilderInterface;
    use Symfony\Component\Form\FormEvent;
    use Symfony\Component\Form\FormEvents;
    use Doctrine\ORM\EntityManager;
    use Viteloge\CoreBundle\SearchEntity\Ad;
    use Viteloge\CoreBundle\Component\Enum\TransactionEnum;
    use Viteloge\CoreBundle\Component\Enum\TypeEnum;
    use Viteloge\CoreBundle\Component\Enum\RoomEnum;
    use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
    use Symfony\Component\Form\Extension\Core\Type\MoneyType;
    use Symfony\Component\Form\Extension\Core\Type\SubmitType;
    use Symfony\Bridge\Doctrine\Form\Type\EntityType;

    class AdSearchType extends AbstractType {

        private $em;

        public function __construct(EntityManager $em) {
            $this->em = $em;
        }

        /**
         * on devrait pouvoir virer choices_as_values en 3.0
         */
        public function buildForm(FormBuilderInterface $builder, array $options) {
            $transactionEnum = new TransactionEnum();
            $typeEnum = new TypeEnum();
            $roomEnum = new RoomEnum();
            $builder
                ->add('transaction', ChoiceType::class, array(
                    'label' => 'ad.transaction',
                    'choices' => $transactionEnum->choices(),
                    'expanded' => false,
                    'multiple' => true,
                    'preferred_choices' => array(),
                ))
                ->add('where', ChoiceType::class, array(
                    'label' => 'ad.where',
                    'choices' => array(),
                    'expanded' => false,
                    'multiple' => true,
                    'preferred_choices' => array(),
                ))
                ->add('what', ChoiceType::class, array(
                    'label' => 'ad.what',
                    'choices' => $typeEnum->choices(),
                    'expanded' => false,
                    'multiple' => true,
                    'preferred_choices' => array(),
                ))
                ->add('rooms', ChoiceType::class, array(
                    'label' => 'ad.rooms',
                    'choices' => $roomEnum->choices(),
                    'expanded' => false,
                    'multiple' => true,
                    'preferred_choices' => array(),
                ))
                ->add('minPrice', MoneyType::class, array(
                    'label' => 'ad.price.min',
                    'required' => false,
                    'scale' => 0
                ))
                ->add('maxPrice', MoneyType::class, array(
                    'label' => 'ad.price.max',
                    'required' => false,
                    'scale' => 0
                ))
                ->add('search', SubmitType::class)
            ;

            $em = $this->em;
            $formModifier = function (FormInterface $form, $cities) {
                $choices = (empty($cities)) ? array() : $cities;
                $form->add('where', EntityType::class, array(
                    'label' => 'ad.where',
                    'class' => 'VitelogeInseeBundle:InseeCity',
                    'data_class' => null,
                    'choice_label' => 'getNameAndPostalcode',
                    'group_by' => 'inseeDepartment',
                    'choices' => $choices,
                    'expanded' => false,
                    'multiple' => true,
                    'data' => $cities, // not really necessary
                    'required' => false,
                    //'preferred_choices' => array(),
                    'placeholder' => '',
                    'empty_data' => null,
                    'mapped' => true
                ));
            };

            $builder->addEventListener(
                FormEvents::PRE_SET_DATA,
                function (FormEvent $event) use ($formModifier, $em) {
                    $form = $event->getForm();
                    $data = $event->getData();
                    $where = $data->getWhere();
                    if (!empty($where)) {
                        $cities = $em->getRepository('VitelogeInseeBundle:InseeCity')->findById($where);
                        $formModifier($form, $cities);
                    }
                }
            );

            $builder->addEventListener(
                FormEvents::PRE_SUBMIT,
                function (FormEvent $event) use ($formModifier, $em) {
                    $form = $event->getForm();
                    $data = $event->getData();
                    if (isset($data['where'])) {
                        $cities = $em->getRepository('VitelogeInseeBundle:InseeCity')->findById($data['where']);
                        $formModifier(
                            $form,
                            $cities/*array_flip(array_map(
                                function($city){
                                    return $city->getId();
                                }, $cities
                            ))*/
                        );
                    }
                }
            );
        }

        public function configureOptions(OptionsResolver $resolver){
            $resolver->setDefaults(array(
                'data_class' => Ad::class,
                'csrf_protection' => true,
                'csrf_field_name' => '_token',
                'csrf_token_id'   => 'task_item'
            ));
        }

        public function getBlockPrefix()
       {
           return 'viteloge_core_adsearch';
       }

    }

}


text:
package ru.evgkit.Hangman;

import java.util.Scanner;

public class Prompter {
    private Game game;

    public Prompter(Game game) {
        this.game = game;
    }

    public void play() {
        while (game.getRemainingTries() > 0 && !game.isSolved()) {
            displayProgress();
            promptForGuess();
        }

        if (game.isSolved()) {
            System.out.printf("Congratulations! You won with %d tries remaining", game.getRemainingTries());
        } else {
            System.out.printf("Boomer the word was %s.   :(\n", game.getAnswer());
        }
    }

    private boolean promptForGuess() {
        boolean isHit = false;
        boolean isValidGuess = false;
        Scanner scanner = new Scanner(System.in);

        while (!isValidGuess) {
            try {
                System.out.print("Enter a letter:  ");
                String guessInput = scanner.nextLine();
                isHit = game.applyGuess(guessInput);
                isValidGuess = true;
            } catch (IllegalArgumentException iae) {
                System.out.printf("%s.  Please try again.\n", iae.getMessage());
            }
        }

        return isHit;
    }

    private void displayProgress() {
        System.out.printf(
            "You have %d tries left to solve:  %s\n",
            game.getRemainingTries(),
            game.getCurrentProgress()
        );
    }

    // TODO: As a prompter, I should know the name of the guesser so that things can appear more friendly.
    // TODO: As a prompter, I should know the highest score, so that it can be used to encourage competition
}


text:
using UnityEngine;
using System.Collections;

public class run : MonoBehaviour
{

    public Animator anim;
    private float inputH;
    private float inputV;
    private Vector3 moveDirection;
    private CharacterController controller;
    private float deltaTime;

    void Start()
    {
        anim = GetComponent<Animator>();
        controller = GetComponent<CharacterController>();
    }

    void Update()
    {

        inputH = Input.GetAxis("Horizontal");
        inputV = Input.GetAxis("Vertical");
        deltaTime = Time.deltaTime;

        anim.SetFloat("inputH", inputH);
        anim.SetFloat("inputV", inputV);

        float moveX = inputH * 50f * Time.deltaTime * 10;
        float moveZ = inputV * 50f * Time.deltaTime * 20;

        if (moveZ <= 0f)
        {
            moveX = 0f;
        }

        //Convertis la direction de global à local
        moveDirection = transform.TransformDirection(moveDirection);

        //Rotation personnage
        this.transform.Rotate(new Vector3(0, inputH * deltaTime * 80f, 0));

        this.transform.Translate(new Vector3(0, 0, inputV * deltaTime * 30f));

        //La gravité d'un rigidbody ne fonctionne pas quand il y a un character controller
        //Gravité
        moveDirection.y -= 20f;

        //Application des directions au Character Controller
        controller.Move(moveDirection * deltaTime);

        if(Input.GetKeyDown("space"))
        {
            anim.Play("fire", -1, 0f);
        }
    }
}


text:
/*
Investigating numbers with few repeated digits.
Problem 172

How many 18-digit numbers n (without leading zeros) are there such that no digit occurs more than three times in n?
*/


text:
require 'test_helper'

class MesControllerTest < ActionController::TestCase
  setup do
    @me = mes(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:mes)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create me" do
    assert_difference('Me.count') do
      post :create, me: { birthcity: @me.birthcity, birthday: @me.birthday, livingplace: @me.livingplace, name: @me.name }
    end

    assert_redirected_to me_path(assigns(:me))
  end

  test "should show me" do
    get :show, id: @me
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @me
    assert_response :success
  end

  test "should update me" do
    patch :update, id: @me, me: { birthcity: @me.birthcity, birthday: @me.birthday, livingplace: @me.livingplace, name: @me.name }
    assert_redirected_to me_path(assigns(:me))
  end

  test "should destroy me" do
    assert_difference('Me.count', -1) do
      delete :destroy, id: @me
    end

    assert_redirected_to mes_path
  end
end


text:
START_ATF_NAMESPACE
    typedef _CACHE_DESCRIPTOR *PCACHE_DESCRIPTOR;
END_ATF_NAMESPACE


text:
@interface StartViewController ()

@property (weak) IBOutlet NSButton *slitScanButton;
@property (weak) IBOutlet NSButton *rollingShutterButton;
@property (weak) IBOutlet NSTextField *titleLabel;

@end

@implementation StartViewController

- (void)viewDidLoad
{
	NSString *path = [@"~/Pictures/Slit-Scan Maker/" stringByExpandingTildeInPath];
	if (![[NSFileManager defaultManager] fileExistsAtPath:path])
	{
		[[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
	}

	@weakify(self);
	self.slitScanButton.rac_command = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id __unused input) {
		@strongify(self);
		[self.view.window close];
		[self performSegueWithIdentifier:@"slit-scan-segue" sender:self];
		return [RACSignal empty];
	}];

	self.rollingShutterButton.rac_command = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id __unused input) {
		@strongify(self);
		[self.view.window close];
		[self performSegueWithIdentifier:@"rolling-shutter-segue" sender:self];
		return [RACSignal empty];
	}];

}

@end


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/azul_biocon"
    tools:context=".ActivitMainMenu" >

    <pfg.uem.biocon.customviews.ActionBar
        android:id="@+id/actionbar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true" >
    </pfg.uem.biocon.customviews.ActionBar>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/actionbar"
        android:background="@drawable/shapefondo_unica_pag"
        android:padding="10dp" >

        <ListView
            android:id="@android:id/list"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:visibility="gone" >
        </ListView>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:background="@drawable/shape_titulo_insercion_gris"
            android:orientation="vertical" >

            <LinearLayout
                android:id="@+id/LinearLayoutNFC"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="10dp"
                android:layout_weight="1"
                android:background="@drawable/boton_menu_azul"
                android:clickable="true"
                android:gravity="center"
                android:orientation="vertical" >

                <ImageView
                    android:id="@+id/ImageView02"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:src="@drawable/hardware_phone" />

                <TextView
                    android:id="@+id/TextView09"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:lines="2"
                    android:text="Coloca la etiqueta NFC en la parte trasera del dispositivo"
                    android:textColor="@color/Blanco"
                    android:textStyle="bold|italic" />
            </LinearLayout>
        </LinearLayout>

    </RelativeLayout>

</RelativeLayout>


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

<!-- Jenkins theme -->
<link href="/css/jenkins-design-language.css" rel="stylesheet">

<!-- core-js -->
<link href="/css/blueocean-core-js.css" rel="stylesheet">

<!-- Module CSS -->
<link href="/classes/org/jenkins/ui/jsmodules/blueocean-dashboard/extensions.css" rel="stylesheet">


text:
DO
$body$
BEGIN
   	IF NOT pwaf.build_utils_check_schema_exists('pwaf_app_base') THEN

    	CREATE SCHEMA pwaf_app_base AUTHORIZATION pwaf;

   	END IF;
END
$body$
;
--