text:
package cz.quinix.condroid.ui.adapters;

import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.google.inject.Inject;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import cz.quinix.condroid.R;
import cz.quinix.condroid.database.DataProvider;
import cz.quinix.condroid.model.Annotation;
import cz.quinix.condroid.ui.listeners.MakeFavoritedListener;
import cz.quinix.condroid.util.DateHelper;

class ViewHelper {

	@Inject
	DataProvider provider;

	public final static DateFormat todayFormat = new SimpleDateFormat("HH:mm");

	public final static DateFormat dayFormat = new SimpleDateFormat(
			"EE dd.MM. HH:mm", new Locale("cs", "CZ"));

	public View inflateAnnotation(View v, Annotation annotation) {
		return this.inflateAnnotation(v, annotation, this.getViewHolder(v));
	}

	public View inflateAnnotation(View v, final Annotation annotation, final ViewHolder vh) {

		setFavoriteState(v, annotation, vh);

		vh.favorited.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				new MakeFavoritedListener(v.getContext()).invoke(annotation.getPid());
				setFavoriteState(v, annotation, vh);
			}
		});

		if (vh.title != null) {
			vh.title.setText(annotation.getTitle());
		}
		if (vh.author != null) {
			if (annotation.getAuthor() != null && !annotation.getAuthor().trim().equals("")) {
				vh.author.setText(annotation.getAuthor());
				vh.author.setVisibility(View.VISIBLE);
			} else {
				vh.author.setVisibility(View.GONE);
			}
		}

		if (vh.line != null) {
			if (annotation.getLid() > 0) {
				vh.line.setText(provider.getProgramLine(annotation.getLid()).getName());
				vh.line.setVisibility(View.VISIBLE);
			} else {
				vh.line.setVisibility(View.GONE);
			}
		}
		if (annotation.getStart() != null && annotation.getEnd() != null) {
			vh.time.setText(formatDate(annotation.getStart()) + " - "
					+ todayFormat.format(annotation.getEnd()));
			vh.time.setVisibility(View.VISIBLE);
		} else {
			vh.time.setVisibility(View.GONE);
		}
		if (annotation.getLocation() != null && !annotation.getLocation().trim().equals("")) {
			vh.place.setText(annotation.getLocation());
			vh.place.setVisibility(View.VISIBLE);
		} else {
			vh.place.setVisibility(View.GONE);
		}

		vh.itemLayout.setBackgroundResource(annotation.getType().getTypeColor());

		return v;
	}

	private void setFavoriteState(View v, Annotation annotation, ViewHolder vh) {
		if (provider.getFavorited().contains(Integer.valueOf(annotation.getPid()))) {
			vh.favorited.setTextColor(v.getResources().getColor(R.color.lightyellow));
		} else {
			vh.favorited.setTextColor(v.getResources().getColor(R.color.lightgray));
		}
	}

	public ViewHolder getViewHolder(View v) {
		if (v.getTag(R.id.listItem) == null) {
			ViewHolder vh = new ViewHolder();

			this.initializeItemLayout(v, vh);
			v.setTag(R.id.listItem, vh);
		}

		return (ViewHolder) v.getTag(R.id.listItem);
	}

	public ViewHolder initializeItemLayout(View convertView, ViewHolder viewHolder) {
		viewHolder.firstRow = (RelativeLayout) convertView.findViewById(R.id.lFirstRow);
		viewHolder.author = (TextView) convertView.findViewById(R.id.alAuthor);
		viewHolder.title = (TextView) convertView.findViewById(R.id.alTitle);
		viewHolder.line = (TextView) convertView.findViewById(R.id.alLine);
		viewHolder.place = (TextView) convertView.findViewById(R.id.alPlace);
		viewHolder.time = (TextView) convertView.findViewById(R.id.alTime);

		viewHolder.favorited = (TextView) convertView.findViewById(R.id.lFavorited);

		viewHolder.itemLayout = (FrameLayout) convertView.findViewById(R.id.lItemLayout);
		return viewHolder;
	}

	public void setFavoritedIcon(AssetManager assets, View view) {
		Typeface type = Typeface.createFromAsset(assets, "fonts/fontawesome-webfont.ttf");

		TextView lFavorited = (TextView) view.findViewById(R.id.lFavorited);
		lFavorited.setText(R.string.fa_star);
		lFavorited.setTypeface(type);

	}

	boolean isDateToday(Date date) {
		return DateHelper.isToday(date);
	}

	private String formatDate(Date date) {

		if (isDateToday(date)) {
			//its today
			return todayFormat.format(date);
		} else {
			return dayFormat.format(date);
		}

	}

	static class ViewHolder {

		TextView favorited;

		TextView title;

		TextView author;

		TextView line;

		TextView time;

		TextView place;

		RelativeLayout firstRow;

		FrameLayout itemLayout;
	}
}


text:
(function() {
  var autoBind, subsetMethods;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  }, __indexOf = Array.prototype.indexOf || function(item) {
    for (var i = 0, l = this.length; i < l; i++) {
      if (this[i] === item) return i;
    }
    return -1;
  };
  autoBind = {
    autoBind: function() {
      var fns, prototype_fns;
      fns = _.functions(this.constructor.prototype);
      prototype_fns = _.without(['autoBind', 'constructor'].concat(_.functions(Backbone.Collection.prototype), _.functions(Backbone.Model.prototype), _.functions(Backbone.View.prototype)), 'render');
      return _.each(fns, __bind(function(f) {
        if (_.indexOf(prototype_fns, f) === -1) {
          return this[f] = _.bind(this[f], this);
        }
      }, this));
    }
  };
  _.extend(Backbone.Collection.prototype, autoBind);
  _.extend(Backbone.Model.prototype, autoBind);
  _.extend(Backbone.View.prototype, autoBind);
  window._.supplement = function(destination) {
    _.each(Array.prototype.slice.call(arguments, 1), function(source) {
      var prop, val, _results;
      _results = [];
      for (prop in source) {
        val = source[prop];
        _results.push(val !== 0 && !(destination[prop] != null) ? destination[prop] = val : void 0);
      }
      return _results;
    });
    return destination;
  };
  window.Backbrace = {};
  window.Backbrace.Subset = (function() {
    Subset.prototype.models = [];
    function Subset(options) {
      this.parent = options != null ? options.parent : void 0;
      this.filterfn = options != null ? options.filterfn : void 0;
      if (!(this.parent instanceof Backbone.Collection || this.parent instanceof Backbrace.Subset)) {
        throw 'Required option: parent must be a Collection or Subset.';
      }
      if (typeof this.filterfn !== 'function') {
        throw 'Required option: filterfn must be function mapping Model to boolean.';
      }
      this.options = options;
      delete this.options.parent;
      delete this.options.filterfn;
      this._bindings = {};
      this.models = [];
      this._bind();
      this._reset();
      this.initialize(this.options);
    }
    Subset.prototype._bind = function() {
      this.parent.bind('all', __bind(function(ev, model) {
        switch (ev) {
          case 'add':
          case 'remove':
          case 'destroy':
            if (this.filterfn(model)) {
              this._reset();
              return this.trigger.apply(this, arguments);
            }
            break;
          case 'error':
            if (this.filterfn(model)) {
              return this.trigger.apply(this, arguments);
            }
            break;
          case 'reset':
            return this.update();
          default:
            if (ev.indexOf('change') === 0) {
              if (this.getByCid(model)) {
                if (!this.filterfn(model)) {
                  this._reset();
                  this.trigger('remove', model, this);
                } else {
                  this.trigger.apply(this, arguments);
                }
              }
              if (!this.getByCid(model) && this.filterfn(model)) {
                this._reset();
                return this.trigger('add', model, this);
              }
            }
        }
      }, this));
      return this._boundOnModelEvent = _.bind(this._onModelEvent, this);
    };
    Subset.prototype.initialize = function(options) {};
    Subset.prototype._reset = function() {
      this.model = this.parent.model;
      _.each(this.models, __bind(function(model) {
        return model.unbind('all', this._bindings[model.id]);
      }, this));
      this.models = this._models();
      _.each(this.models, __bind(function(model) {
        return this._bindings[model.id] = model.bind('all', __bind(function(ev) {
          return this._onModelEvent(model, ev, arguments);
        }, this));
      }, this));
      return this.length = this.models.length;
    };
    Subset.prototype._models = function() {
      return _.filter(this.parent.models, this.filterfn);
    };
    Subset.prototype._onModelEvent = function(model, ev, params) {
      switch (ev) {
        case 'add':
        case 'remove':
        case 'destroy':
        case 'reset':
        case 'error':
          return;
        default:
          if (ev.indexOf('change') === 0) {
            return;
          }
      }
      if (this.filterfn(model)) {
        return this.trigger.apply(this, params);
      }
    };
    Subset.prototype.update = function() {
      this._reset();
      this.trigger('reset', this);
      return this;
    };
    Subset.prototype.add = function(model, options) {
      this.parent.add(model, options);
      return this;
    };
    Subset.prototype.remove = function(model, options) {
      this.parent.remove(model, options);
      return this;
    };
    Subset.prototype.get = function(id) {
      return _.select(this.models, function(x) {
        return x.id === id;
      })[0];
    };
    Subset.prototype.getByCid = function(cid) {
      return _.select(this.models, function(x) {
        return x.cid === (cid.cid || cid);
      })[0];
    };
    Subset.prototype.at = function(idx) {
      return this.models[idx];
    };
    Subset.prototype.sort = function(options) {
      this.parent.sort(options);
      return this;
    };
    Subset.prototype.pluck = function(attr) {
      return _.map(this.models, function(model) {
        return model.get(attr);
      });
    };
    Subset.prototype.reset = function(models, options) {
      this.parent.reset(models, options);
      return this;
    };
    Subset.prototype.fetch = function(options) {
      this.parent.fetch(options);
      return this;
    };
    Subset.prototype.create = function(model, options) {
      return this.parent.create(model, options);
    };
    Subset.prototype.parse = function(resp) {
      return resp;
    };
    Subset.prototype.chain = function() {
      return this.parent.chain();
    };
    return Subset;
  })();
  _.supplement(Backbrace.Subset.prototype, Backbone.Collection.prototype);
  subsetMethods = ['forEach', 'each', 'map', 'reduce', 'reduceRight', 'find', 'detect', 'filter', 'select', 'reject', 'every', 'all', 'some', 'any', 'include', 'invoke', 'max', 'min', 'sortBy', 'sortedIndex', 'toArray', 'size', 'first', 'rest', 'last', 'without', 'indexOf', 'lastIndexOf', 'isEmpty'];
  _.each(subsetMethods, function(method_name) {
    return Backbrace.Subset.prototype[method_name] = function() {
      return _[method_name].apply(_, [this.models].concat(_.toArray(arguments)));
    };
  });
  window.Backbrace.IndexedSubset = (function() {
    __extends(IndexedSubset, Backbrace.Subset);
    function IndexedSubset(options) {
      this.autoBind();
      this.parent = options != null ? options.parent : void 0;
      if (!(this.parent != null)) {
        throw 'Required option: parent';
      }
      this.object = options != null ? options.object : void 0;
      this.property = options != null ? options.property : void 0;
      if ((this.object != null) && (this.property != null)) {
        this.indices = this.object.get(this.property);
        if (!(this.indices != null)) {
          throw 'Object property is not present.';
        }
        this.object.bind('change:' + this.property, __bind(function() {
          this.indices = this.object.get(this.property);
          return this.update();
        }, this));
      } else {
        this.indices = options != null ? options.indices : void 0;
        if (!(this.indices != null)) {
          throw 'Required option: indices (if object, property not provided).';
        }
      }
      this._bindings = {};
      this.models = [];
      this._bind();
      this._reset();
      this.initialize(this.options);
    }
    IndexedSubset.prototype.filterfn = function(model) {
      var _ref;
      return _ref = model.id, __indexOf.call(this.indices, _ref) >= 0;
    };
    IndexedSubset.prototype._models = function() {
      return this.parent.filter(__bind(function(obj) {
        var _ref;
        return _ref = obj.id, __indexOf.call(this.indices, _ref) >= 0;
      }, this));
    };
    return IndexedSubset;
  })();
  window.Backbrace.TableView = (function() {
    __extends(TableView, Backbone.View);
    function TableView() {
      TableView.__super__.constructor.apply(this, arguments);
    }
    TableView.prototype.collection = null;
    TableView.prototype.table_options = null;
    TableView.prototype.datatable = null;
    TableView.prototype.initialize = function(options) {
      this.autoBind();
      this.el = $(this.el);
      this.table_options = options.table_options;
      this._table_rows = {};
      this.collection.bind('add', this._addItem);
      this.collection.bind('remove', this._removeItem);
      this.collection.bind('reset', this.repopulate);
      return this.collection.bind('change', this._updateItem);
    };
    TableView.prototype.render = function() {
      this.datatable = this.el.dataTable(this.table_options);
      this.repopulate();
      return this;
    };
    TableView.prototype.repopulate = function() {
      this.datatable.fnClearTable();
      return this.collection.each(this._addItem);
    };
    TableView.prototype._addItem = function(model) {
      var row;
      row = this.datatable.fnAddData(model.toJSON())[0];
      return this._table_rows[model.id] = row;
    };
    TableView.prototype._removeItem = function(model) {
      var row;
      row = this._table_rows[model.id];
      if (!(row != null)) {
        return;
      }
      return this.datatable.fnDeleteRow(row);
    };
    TableView.prototype._updateItem = function(model) {
      var row;
      row = this._table_rows[model.id];
      if (!(row != null)) {
        return;
      }
      this.datatable.fnUpdate(model.toJSON(), row);
      return this.trigger('rowchange', row, model.id, this.datatable.fnGetNodes(row));
    };
    return TableView;
  })();
  window.Backbrace.ListView = (function() {
    __extends(ListView, Backbone.View);
    function ListView() {
      ListView.__super__.constructor.apply(this, arguments);
    }
    ListView.prototype.collection = null;
    ListView.prototype.itemView = null;
    ListView.prototype.filter = null;
    ListView.prototype.initialize = function(options) {
      var _ref;
      this.autoBind();
      this.el = $(this.el);
      this.itemView = options.itemView;
      this.filter = (_ref = options.filter) != null ? _ref : function(model) {
        return true;
      };
      if (!(typeof this.filter === 'function')) {
        throw 'filter: Must be function';
      }
      if (!this.collection) {
        throw 'collection: Must be Backbone.Collection';
      }
      this.collection = options.collection;
      this.collection.bind('add', this.onCollectionAdd);
      this.collection.bind('reset', this.onCollectionReset);
      return this.collection.bind('change', this.onCollectionChange);
    };
    ListView.prototype.onCollectionAdd = function(model) {
      return this.render();
    };
    ListView.prototype.onCollectionReset = function() {
      return this.render();
    };
    ListView.prototype.onCollectionChange = function() {
      return this.render();
    };
    ListView.prototype.render = function() {
      this.el.children(".bb-list-item").remove();
      _.each(this.collection.filter(this.filter), this._addItem);
      return this;
    };
    ListView.prototype._addItem = function(model) {
      model.view = new this.itemView({
        model: model
      });
      return this.el.append($(model.view.render().el).addClass("bb-list-item"));
    };
    return ListView;
  })();
  window.Backbrace.TabPaneView = (function() {
    __extends(TabPaneView, Backbone.View);
    function TabPaneView() {
      TabPaneView.__super__.constructor.apply(this, arguments);
    }
    TabPaneView.prototype.initialize = function(options) {
      this.autoBind();
      this.el = $(this.el);
      this.views = options.views;
      this.activeView = null;
      if (options.defaultView != null) {
        return this.onTabChange(options.defaultView);
      }
    };
    TabPaneView.prototype.onTabChange = function(tabid) {
      var _ref;
      if ((_ref = this.activeView) != null) {
        _ref.remove();
      }
      this.activeView = new this.views[tabid]();
      return this.render();
    };
    TabPaneView.prototype.render = function() {
      var _ref;
      this.el.append((_ref = this.activeView) != null ? _ref.render().el : void 0);
      return this;
    };
    return TabPaneView;
  })();
  window.Backbrace.TabBarView = (function() {
    __extends(TabBarView, Backbone.View);
    function TabBarView() {
      TabBarView.__super__.constructor.apply(this, arguments);
    }
    TabBarView.prototype.initialize = function() {
      var el, _i, _len, _ref;
      this.autoBind();
      this._wrapElement();
      this.tabs = {};
      _ref = this.el.children('li');
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        el = _ref[_i];
        this.tabs[el.id] = $(el);
      }
      this.activeTab = this.el.children('li').first().attr('id');
      return this.update();
    };
    TabBarView.prototype._wrapElement = function() {
      var that;
      that = this;
      this.el.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');
      this.el.children('li').addClass('ui-state-default ui-corner-top');
      this.el.wrap('
');
      return this.el.children('li').each(function(i, el) {
        $(el).html('' + $(el).text() + '');
        return $(el).children('a').click(function() {
          return that.setTab(el.id);
        });
      });
    };
    TabBarView.prototype.update = function() {
      this.el.children('li').removeClass('ui-tabs-selected ui-state-active');
      return this.tabs[this.activeTab].addClass('ui-tabs-selected ui-state-active');
    };
    TabBarView.prototype.setTab = function(tabid) {
      if (this.tabs[tabid] != null) {
        this.activeTab = tabid;
        this.update();
        return this.trigger('tabchange', tabid);
      }
    };
    TabBarView.prototype.getTab = function() {
      return this.activeTab;
    };
    return TabBarView;
  })();
  window.Backbrace.buildTabRouter = function(tabBarView, tabPaneView) {
    var ext, router, tabid, tabview, _fn, _ref;
    ext = {
      routes: {}
    };
    _ref = tabPaneView.views;
    _fn = function(tabid) {
      return ext['_tab_' + tabid] = function() {
        return tabBarView.setTab(tabid);
      };
    };
    for (tabid in _ref) {
      tabview = _ref[tabid];
      ext.routes[tabid] = '_tab_' + tabid;
      _fn(tabid);
    }
    router = new (Backbone.Router.extend(ext));
    return router;
  };
}).call(this);

redpajama_set_name: RedPajamaGithub


text:
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ash/login/oobe_quick_start/target_device_bootstrap_controller.h"
#include <memory>

#include "base/test/bind.h"
#include "chrome/browser/ash/login/oobe_quick_start/connectivity/fake_target_device_connection_broker.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/abseil-cpp/absl/types/variant.h"

namespace {

using TargetDeviceBootstrapController =
    ash::quick_start::TargetDeviceBootstrapController;
using TargetDeviceConnectionBroker =
    ash::quick_start::TargetDeviceConnectionBroker;
using FakeTargetDeviceConnectionBroker =
    ash::quick_start::FakeTargetDeviceConnectionBroker;
using TargetDeviceConnectionBrokerFactory =
    ash::quick_start::TargetDeviceConnectionBrokerFactory;
using Observer = TargetDeviceBootstrapController::Observer;
using Status = TargetDeviceBootstrapController::Status;
using Step = TargetDeviceBootstrapController::Step;
using ErrorCode = TargetDeviceBootstrapController::ErrorCode;

class FakeObserver : public Observer {
 public:
  FakeObserver() = default;
  ~FakeObserver() override = default;

  void OnStatusChanged(const Status& status) override {
    // Step must change.
    ASSERT_NE(status.step, last_status.step);

    last_status = status;
  }

  Status last_status;
};

}  // namespace

class TargetDeviceBootstrapControllerTest : public testing::Test {
 public:
  static constexpr char kSourceDeviceId[] = "fake-source-device-id";

  TargetDeviceBootstrapControllerTest() = default;
  TargetDeviceBootstrapControllerTest(TargetDeviceBootstrapControllerTest&) =
      delete;
  TargetDeviceBootstrapControllerTest& operator=(
      TargetDeviceBootstrapControllerTest&) = delete;
  ~TargetDeviceBootstrapControllerTest() override = default;

  void SetUp() override { CreateBootstrapController(); }
  void TearDown() override {
    bootstrap_controller_->RemoveObserver(fake_observer_.get());
  }

  void CreateBootstrapController() {
    TargetDeviceConnectionBrokerFactory::SetFactoryForTesting(
        &connection_broker_factory_);

    bootstrap_controller_ = std::make_unique<TargetDeviceBootstrapController>();
    fake_observer_ = std::make_unique<FakeObserver>();
    bootstrap_controller_->AddObserver(fake_observer_.get());
  }

  FakeTargetDeviceConnectionBroker* connection_broker() {
    EXPECT_EQ(1u, connection_broker_factory_.instances().size());
    return connection_broker_factory_.instances().back();
  }

 protected:
  FakeTargetDeviceConnectionBroker::Factory connection_broker_factory_;
  std::unique_ptr<FakeObserver> fake_observer_;
  std::unique_ptr<TargetDeviceBootstrapController> bootstrap_controller_;
};

TEST_F(TargetDeviceBootstrapControllerTest, StartAdvertising) {
  bootstrap_controller_->StartAdvertising();
  EXPECT_EQ(1u, connection_broker()->num_start_advertising_calls());
  EXPECT_EQ(bootstrap_controller_.get(),
            connection_broker()->connection_lifecycle_listener());

  connection_broker()->on_start_advertising_callback().Run(/*success=*/true);
  EXPECT_EQ(fake_observer_->last_status.step, Step::ADVERTISING);
}

TEST_F(TargetDeviceBootstrapControllerTest, StartAdvertisingFail) {
  bootstrap_controller_->StartAdvertising();
  connection_broker()->on_start_advertising_callback().Run(/*success=*/false);
  EXPECT_EQ(fake_observer_->last_status.step, Step::ERROR);
  ASSERT_TRUE(
      absl::holds_alternative<ErrorCode>(fake_observer_->last_status.payload));
  EXPECT_EQ(absl::get<ErrorCode>(fake_observer_->last_status.payload),
            ErrorCode::START_ADVERTISING_FAILED);
}

TEST_F(TargetDeviceBootstrapControllerTest, StopAdvertising) {
  bootstrap_controller_->StartAdvertising();
  connection_broker()->on_start_advertising_callback().Run(/*success=*/true);
  ASSERT_EQ(fake_observer_->last_status.step, Step::ADVERTISING);

  bootstrap_controller_->StopAdvertising();
  EXPECT_EQ(1u, connection_broker()->num_stop_advertising_calls());

  // Status changes only after the `on_stop_advertising_callback` run.
  EXPECT_EQ(fake_observer_->last_status.step, Step::ADVERTISING);

  connection_broker()->on_stop_advertising_callback().Run();
  EXPECT_EQ(fake_observer_->last_status.step, Step::NONE);
}

TEST_F(TargetDeviceBootstrapControllerTest, InitiateConnection) {
  bootstrap_controller_->StartAdvertising();
  connection_broker()->on_start_advertising_callback().Run(/*success=*/true);
  ASSERT_EQ(fake_observer_->last_status.step, Step::ADVERTISING);

  connection_broker()->InitiateConnection(kSourceDeviceId);

  EXPECT_EQ(fake_observer_->last_status.step, Step::QR_CODE_VERIFICATION);
  using QRCodePixelData =
      ash::quick_start::TargetDeviceBootstrapController::QRCodePixelData;
  EXPECT_TRUE(absl::holds_alternative<QRCodePixelData>(
      fake_observer_->last_status.payload));
}

TEST_F(TargetDeviceBootstrapControllerTest, AuthenticateConnection) {
  bootstrap_controller_->StartAdvertising();
  connection_broker()->on_start_advertising_callback().Run(/*success=*/true);
  connection_broker()->InitiateConnection(kSourceDeviceId);
  connection_broker()->AuthenticateConnection(kSourceDeviceId);

  EXPECT_EQ(fake_observer_->last_status.step, Step::CONNECTED);
  EXPECT_TRUE(absl::holds_alternative<absl::monostate>(
      fake_observer_->last_status.payload));
}

TEST_F(TargetDeviceBootstrapControllerTest, FeatureSupportStatus) {
  absl::optional<TargetDeviceConnectionBroker::FeatureSupportStatus>
      feature_status;

  connection_broker()->set_feature_support_status(
      ash::quick_start::FakeTargetDeviceConnectionBroker::FeatureSupportStatus::
          kUndetermined);

  bootstrap_controller_->GetFeatureSupportStatusAsync(
      base::BindLambdaForTesting(
          [&](TargetDeviceConnectionBroker::FeatureSupportStatus status) {
            feature_status = status;
          }));
  EXPECT_FALSE(feature_status.has_value());

  connection_broker()->set_feature_support_status(
      ash::quick_start::FakeTargetDeviceConnectionBroker::FeatureSupportStatus::
          kNotSupported);
  ASSERT_TRUE(feature_status.has_value());
  EXPECT_EQ(feature_status.value(),
            ash::quick_start::FakeTargetDeviceConnectionBroker::
                FeatureSupportStatus::kNotSupported);
}

TEST_F(TargetDeviceBootstrapControllerTest, RejectConnection) {
  bootstrap_controller_->StartAdvertising();
  connection_broker()->on_start_advertising_callback().Run(/*success=*/true);
  connection_broker()->InitiateConnection(kSourceDeviceId);

  connection_broker()->RejectConnection(kSourceDeviceId);

  EXPECT_EQ(fake_observer_->last_status.step, Step::ERROR);
  ASSERT_TRUE(
      absl::holds_alternative<ErrorCode>(fake_observer_->last_status.payload));
  EXPECT_EQ(absl::get<ErrorCode>(fake_observer_->last_status.payload),
            ErrorCode::CONNECTION_REJECTED);
}

TEST_F(TargetDeviceBootstrapControllerTest, CloseConnection) {
  bootstrap_controller_->StartAdvertising();
  connection_broker()->on_start_advertising_callback().Run(/*success=*/true);
  connection_broker()->InitiateConnection(kSourceDeviceId);

  connection_broker()->CloseConnection(kSourceDeviceId);

  EXPECT_EQ(fake_observer_->last_status.step, Step::ERROR);
  ASSERT_TRUE(
      absl::holds_alternative<ErrorCode>(fake_observer_->last_status.payload));
  EXPECT_EQ(absl::get<ErrorCode>(fake_observer_->last_status.payload),
            ErrorCode::CONNECTION_CLOSED);
}


text:
package org.zstack.header.storage.backup;

import org.zstack.header.message.APIReply;

import java.util.List;

public class APIListBackupStorageReply extends APIReply {
    private List<BackupStorageInventory> inventories;

    public List<BackupStorageInventory> getInventories() {
        return inventories;
    }

    public void setInventories(List<BackupStorageInventory> inventories) {
        this.inventories = inventories;
    }
}


text:
package daemon

import (
	"github.com/Sirupsen/logrus"
	"github.com/docker/docker/daemon/graphdriver"
	"github.com/docker/docker/daemon/graphdriver/aufs"
)

// Given the graphdriver ad, if it is aufs, then migrate it.
// If aufs driver is not built, this func is a noop.
func migrateIfAufs(driver graphdriver.Driver, root string) error {
	if ad, ok := driver.(*aufs.Driver); ok {
		logrus.Debugf("Migrating existing containers")
<<<<<<< HEAD
		if err := ad.Migrate(root, setupInitLayer); err != nil {
=======
		if err := ad.Migrate(root, graph.SetupInitLayer); err != nil {
>>>>>>> shakamunyi
			return err
		}
	}
	return nil
}


text:
<?php

return [
    'Names' => [
        'Africa/Abidjan' => 'Greenwich Ortalama Saati (Abidjan)',
        'Africa/Accra' => 'Greenwich Ortalama Saati (Akra)',
        'Africa/Addis_Ababa' => 'Doğu Afrika Saati (Addis Ababa)',
        'Africa/Algiers' => 'Orta Avrupa Saati (Cezayir)',
        'Africa/Asmera' => 'Doğu Afrika Saati (Asmara)',
        'Africa/Bamako' => 'Greenwich Ortalama Saati (Bamako)',
        'Africa/Bangui' => 'Batı Afrika Saati (Bangui)',
        'Africa/Banjul' => 'Greenwich Ortalama Saati (Banjul)',
        'Africa/Bissau' => 'Greenwich Ortalama Saati (Bissau)',
        'Africa/Blantyre' => 'Orta Afrika Saati (Blantyre)',
        'Africa/Brazzaville' => 'Batı Afrika Saati (Brazzavil)',
        'Africa/Bujumbura' => 'Orta Afrika Saati (Bujumbura)',
        'Africa/Cairo' => 'Doğu Avrupa Saati (Kahire)',
        'Africa/Casablanca' => 'Batı Avrupa Saati (Kazablanka)',
        'Africa/Ceuta' => 'Orta Avrupa Saati (Septe)',
        'Africa/Conakry' => 'Greenwich Ortalama Saati (Konakri)',
        'Africa/Dakar' => 'Greenwich Ortalama Saati (Dakar)',
        'Africa/Dar_es_Salaam' => 'Doğu Afrika Saati (Darüsselam)',
        'Africa/Djibouti' => 'Doğu Afrika Saati (Cibuti)',
        'Africa/Douala' => 'Batı Afrika Saati (Douala)',
        'Africa/El_Aaiun' => 'Batı Avrupa Saati (Layun)',
        'Africa/Freetown' => 'Greenwich Ortalama Saati (Freetown)',
        'Africa/Gaborone' => 'Orta Afrika Saati (Gaborone)',
        'Africa/Harare' => 'Orta Afrika Saati (Harare)',
        'Africa/Johannesburg' => 'Güney Afrika Standart Saati (Johannesburg)',
        'Africa/Juba' => 'Orta Afrika Saati (Cuba)',
        'Africa/Kampala' => 'Doğu Afrika Saati (Kampala)',
        'Africa/Khartoum' => 'Orta Afrika Saati (Hartum)',
        'Africa/Kigali' => 'Orta Afrika Saati (Kigali)',
        'Africa/Kinshasa' => 'Batı Afrika Saati (Kinşasa)',
        'Africa/Lagos' => 'Batı Afrika Saati (Lagos)',
        'Africa/Libreville' => 'Batı Afrika Saati (Librevil)',
        'Africa/Lome' => 'Greenwich Ortalama Saati (Lome)',
        'Africa/Luanda' => 'Batı Afrika Saati (Luanda)',
        'Africa/Lubumbashi' => 'Orta Afrika Saati (Lubumbashi)',
        'Africa/Lusaka' => 'Orta Afrika Saati (Lusaka)',
        'Africa/Malabo' => 'Batı Afrika Saati (Malabo)',
        'Africa/Maputo' => 'Orta Afrika Saati (Maputo)',
        'Africa/Maseru' => 'Güney Afrika Standart Saati (Maseru)',
        'Africa/Mbabane' => 'Güney Afrika Standart Saati (Mbabane)',
        'Africa/Mogadishu' => 'Doğu Afrika Saati (Mogadişu)',
        'Africa/Monrovia' => 'Greenwich Ortalama Saati (Monrovia)',
        'Africa/Nairobi' => 'Doğu Afrika Saati (Nairobi)',
        'Africa/Ndjamena' => 'Batı Afrika Saati (Ndjamena)',
        'Africa/Niamey' => 'Batı Afrika Saati (Niamey)',
        'Africa/Nouakchott' => 'Greenwich Ortalama Saati (Nouakchott)',
        'Africa/Ouagadougou' => 'Greenwich Ortalama Saati (Ouagadougou)',
        'Africa/Porto-Novo' => 'Batı Afrika Saati (Porto-Novo)',
        'Africa/Sao_Tome' => 'Greenwich Ortalama Saati (Sao Tome)',
        'Africa/Tripoli' => 'Doğu Avrupa Saati (Trablus)',
        'Africa/Tunis' => 'Orta Avrupa Saati (Tunus)',
        'Africa/Windhoek' => 'Orta Afrika Saati (Windhoek)',
        'America/Adak' => 'Hawaii-Aleut Saati (Adak)',
        'America/Anchorage' => 'Alaska Saati (Anchorage)',
        'America/Anguilla' => 'Atlantik Saati (Anguilla)',
        'America/Antigua' => 'Atlantik Saati (Antigua)',
        'America/Araguaina' => 'Brasilia Saati (Araguaina)',
        'America/Argentina/La_Rioja' => 'Arjantin Saati (La Rioja)',
        'America/Argentina/Rio_Gallegos' => 'Arjantin Saati (Rio Gallegos)',
        'America/Argentina/Salta' => 'Arjantin Saati (Salta)',
        'America/Argentina/San_Juan' => 'Arjantin Saati (San Juan)',
        'America/Argentina/San_Luis' => 'Arjantin Saati (San Luis)',
        'America/Argentina/Tucuman' => 'Arjantin Saati (Tucuman)',
        'America/Argentina/Ushuaia' => 'Arjantin Saati (Ushuaia)',
        'America/Aruba' => 'Atlantik Saati (Aruba)',
        'America/Asuncion' => 'Paraguay Saati (Asunción)',
        'America/Bahia' => 'Brasilia Saati (Bahia)',
        'America/Bahia_Banderas' => 'Kuzey Amerika Merkezi Saati (Bahia Banderas)',
        'America/Barbados' => 'Atlantik Saati (Barbados)',
        'America/Belem' => 'Brasilia Saati (Belem)',
        'America/Belize' => 'Kuzey Amerika Merkezi Saati (Belize)',
        'America/Blanc-Sablon' => 'Atlantik Saati (Blanc-Sablon)',
        'America/Boa_Vista' => 'Amazon Saati (Boa Vista)',
        'America/Bogota' => 'Kolombiya Saati (Bogota)',
        'America/Boise' => 'Kuzey Amerika Dağ Saati (Boise)',
        'America/Buenos_Aires' => 'Arjantin Saati (Buenos Aires)',
        'America/Cambridge_Bay' => 'Kuzey Amerika Dağ Saati (Cambridge Bay)',
        'America/Campo_Grande' => 'Amazon Saati (Campo Grande)',
        'America/Cancun' => 'Kuzey Amerika Doğu Saati (Cancun)',
        'America/Caracas' => 'Venezuela Saati (Caracas)',
        'America/Catamarca' => 'Arjantin Saati (Catamarca)',
        'America/Cayenne' => 'Fransız Guyanası Saati (Cayenne)',
        'America/Cayman' => 'Kuzey Amerika Doğu Saati (Cayman)',
        'America/Chicago' => 'Kuzey Amerika Merkezi Saati (Chicago)',
        'America/Chihuahua' => 'Meksika Pasifik Kıyısı Saati (Chihuahua)',
        'America/Coral_Harbour' => 'Kuzey Amerika Doğu Saati (Atikokan)',
        'America/Cordoba' => 'Arjantin Saati (Cordoba)',
        'America/Costa_Rica' => 'Kuzey Amerika Merkezi Saati (Kosta Rika)',
        'America/Creston' => 'Kuzey Amerika Dağ Saati (Creston)',
        'America/Cuiaba' => 'Amazon Saati (Cuiaba)',
        'America/Curacao' => 'Atlantik Saati (Curaçao)',
        'America/Danmarkshavn' => 'Greenwich Ortalama Saati (Danmarkshavn)',
        'America/Dawson' => 'Kuzey Amerika Dağ Saati (Dawson)',
        'America/Dawson_Creek' => 'Kuzey Amerika Dağ Saati (Dawson Creek)',
        'America/Denver' => 'Kuzey Amerika Dağ Saati (Denver)',
        'America/Detroit' => 'Kuzey Amerika Doğu Saati (Detroit)',
        'America/Dominica' => 'Atlantik Saati (Dominika)',
        'America/Edmonton' => 'Kuzey Amerika Dağ Saati (Edmonton)',
        'America/Eirunepe' => 'Acre Saati (Eirunepe)',
        'America/El_Salvador' => 'Kuzey Amerika Merkezi Saati (El Salvador)',
        'America/Fort_Nelson' => 'Kuzey Amerika Dağ Saati (Fort Nelson)',
        'America/Fortaleza' => 'Brasilia Saati (Fortaleza)',
        'America/Glace_Bay' => 'Atlantik Saati (Glace Bay)',
        'America/Godthab' => 'Batı Grönland Saati (Nuuk)',
        'America/Goose_Bay' => 'Atlantik Saati (Goose Bay)',
        'America/Grand_Turk' => 'Kuzey Amerika Doğu Saati (Grand Turk)',
        'America/Grenada' => 'Atlantik Saati (Grenada)',
        'America/Guadeloupe' => 'Atlantik Saati (Guadeloupe)',
        'America/Guatemala' => 'Kuzey Amerika Merkezi Saati (Guatemala)',
        'America/Guayaquil' => 'Ekvador Saati (Guayaquil)',
        'America/Guyana' => 'Guyana Saati',
        'America/Halifax' => 'Atlantik Saati (Halifax)',
        'America/Havana' => 'Küba Saati (Havana)',
        'America/Hermosillo' => 'Meksika Pasifik Kıyısı Saati (Hermosillo)',
        'America/Indiana/Knox' => 'Kuzey Amerika Merkezi Saati (Knox, Indiana)',
        'America/Indiana/Marengo' => 'Kuzey Amerika Doğu Saati (Marengo, Indiana)',
        'America/Indiana/Petersburg' => 'Kuzey Amerika Doğu Saati (Petersburg, Indiana)',
        'America/Indiana/Tell_City' => 'Kuzey Amerika Merkezi Saati (Tell City, Indiana)',
        'America/Indiana/Vevay' => 'Kuzey Amerika Doğu Saati (Vevay, Indiana)',
        'America/Indiana/Vincennes' => 'Kuzey Amerika Doğu Saati (Vincennes, Indiana)',
        'America/Indiana/Winamac' => 'Kuzey Amerika Doğu Saati (Winamac, Indiana)',
        'America/Indianapolis' => 'Kuzey Amerika Doğu Saati (Indianapolis)',
        'America/Inuvik' => 'Kuzey Amerika Dağ Saati (Inuvik)',
        'America/Iqaluit' => 'Kuzey Amerika Doğu Saati (Iqaluit)',
        'America/Jamaica' => 'Kuzey Amerika Doğu Saati (Jamaika)',
        'America/Jujuy' => 'Arjantin Saati (Jujuy)',
        'America/Juneau' => 'Alaska Saati (Juneau)',
        'America/Kentucky/Monticello' => 'Kuzey Amerika Doğu Saati (Monticello, Kentucky)',
        'America/Kralendijk' => 'Atlantik Saati (Kralendijk)',
        'America/La_Paz' => 'Bolivya Saati (La Paz)',
        'America/Lima' => 'Peru Saati (Lima)',
        'America/Los_Angeles' => 'Kuzey Amerika Pasifik Saati (Los Angeles)',
        'America/Louisville' => 'Kuzey Amerika Doğu Saati (Louisville)',
        'America/Lower_Princes' => 'Atlantik Saati (Lower Prince's Quarter)',
        'America/Maceio' => 'Brasilia Saati (Maceio)',
        'America/Managua' => 'Kuzey Amerika Merkezi Saati (Managua)',
        'America/Manaus' => 'Amazon Saati (Manaus)',
        'America/Marigot' => 'Atlantik Saati (Marigot)',
        'America/Martinique' => 'Atlantik Saati (Martinique)',
        'America/Matamoros' => 'Kuzey Amerika Merkezi Saati (Matamoros)',
        'America/Mazatlan' => 'Meksika Pasifik Kıyısı Saati (Mazatlan)',
        'America/Mendoza' => 'Arjantin Saati (Mendoza)',
        'America/Menominee' => 'Kuzey Amerika Merkezi Saati (Menominee)',
        'America/Merida' => 'Kuzey Amerika Merkezi Saati (Merida)',
        'America/Metlakatla' => 'Alaska Saati (Metlakatla)',
        'America/Mexico_City' => 'Kuzey Amerika Merkezi Saati (Mexico City)',
        'America/Miquelon' => 'Saint Pierre ve Miquelon Saati',
        'America/Moncton' => 'Atlantik Saati (Moncton)',
        'America/Monterrey' => 'Kuzey Amerika Merkezi Saati (Monterrey)',
        'America/Montevideo' => 'Uruguay Saati (Montevideo)',
        'America/Montreal' => 'Kanada Saati (Montreal)',
        'America/Montserrat' => 'Atlantik Saati (Montserrat)',
        'America/Nassau' => 'Kuzey Amerika Doğu Saati (Nassau)',
        'America/New_York' => 'Kuzey Amerika Doğu Saati (New York)',
        'America/Nipigon' => 'Kuzey Amerika Doğu Saati (Nipigon)',
        'America/Nome' => 'Alaska Saati (Nome)',
        'America/Noronha' => 'Fernando de Noronha Saati',
        'America/North_Dakota/Beulah' => 'Kuzey Amerika Merkezi Saati (Beulah, Kuzey Dakota)',
        'America/North_Dakota/Center' => 'Kuzey Amerika Merkezi Saati (Merkez, Kuzey Dakota)',
        'America/North_Dakota/New_Salem' => 'Kuzey Amerika Merkezi Saati (New Salem, Kuzey Dakota)',
        'America/Ojinaga' => 'Kuzey Amerika Dağ Saati (Ojinaga)',
        'America/Panama' => 'Kuzey Amerika Doğu Saati (Panama)',
        'America/Pangnirtung' => 'Kuzey Amerika Doğu Saati (Pangnirtung)',
        'America/Paramaribo' => 'Surinam Saati (Paramaribo)',
        'America/Phoenix' => 'Kuzey Amerika Dağ Saati (Phoenix)',
        'America/Port-au-Prince' => 'Kuzey Amerika Doğu Saati (Port-au-Prince)',
        'America/Port_of_Spain' => 'Atlantik Saati (Port of Spain)',
        'America/Porto_Velho' => 'Amazon Saati (Porto Velho)',
        'America/Puerto_Rico' => 'Atlantik Saati (Porto Riko)',
        'America/Punta_Arenas' => 'Şili Saati (Punta Arenas)',
        'America/Rainy_River' => 'Kuzey Amerika Merkezi Saati (Rainy River)',
        'America/Rankin_Inlet' => 'Kuzey Amerika Merkezi Saati (Rankin Inlet)',
        'America/Recife' => 'Brasilia Saati (Recife)',
        'America/Regina' => 'Kuzey Amerika Merkezi Saati (Regina)',
        'America/Resolute' => 'Kuzey Amerika Merkezi Saati (Resolute)',
        'America/Rio_Branco' => 'Acre Saati (Rio Branco)',
        'America/Santa_Isabel' => 'Kuzeybatı Meksika Saati (Santa Isabel)',
        'America/Santarem' => 'Brasilia Saati (Santarem)',
        'America/Santiago' => 'Şili Saati (Santiago)',
        'America/Santo_Domingo' => 'Atlantik Saati (Santo Domingo)',
        'America/Sao_Paulo' => 'Brasilia Saati (Sao Paulo)',
        'America/Scoresbysund' => 'Doğu Grönland Saati (Ittoqqortoormiit)',
        'America/Sitka' => 'Alaska Saati (Sitka)',
        'America/St_Barthelemy' => 'Atlantik Saati (Saint Barthelemy)',
        'America/St_Johns' => 'Newfoundland Saati (St. John's)',
        'America/St_Kitts' => 'Atlantik Saati (St. Kitts)',
        'America/St_Lucia' => 'Atlantik Saati (St. Lucia)',
        'America/St_Thomas' => 'Atlantik Saati (St. Thomas)',
        'America/St_Vincent' => 'Atlantik Saati (St. Vincent)',
        'America/Swift_Current' => 'Kuzey Amerika Merkezi Saati (Swift Current)',
        'America/Tegucigalpa' => 'Kuzey Amerika Merkezi Saati (Tegucigalpa)',
        'America/Thule' => 'Atlantik Saati (Thule)',
        'America/Thunder_Bay' => 'Kuzey Amerika Doğu Saati (Thunder Bay)',
        'America/Tijuana' => 'Kuzey Amerika Pasifik Saati (Tijuana)',
        'America/Toronto' => 'Kuzey Amerika Doğu Saati (Toronto)',
        'America/Tortola' => 'Atlantik Saati (Tortola)',
        'America/Vancouver' => 'Kuzey Amerika Pasifik Saati (Vancouver)',
        'America/Whitehorse' => 'Kuzey Amerika Dağ Saati (Whitehorse)',
        'America/Winnipeg' => 'Kuzey Amerika Merkezi Saati (Winnipeg)',
        'America/Yakutat' => 'Alaska Saati (Yakutat)',
        'America/Yellowknife' => 'Kuzey Amerika Dağ Saati (Yellowknife)',
        'Antarctica/Casey' => 'Casey Saati',
        'Antarctica/Davis' => 'Davis Saati',
        'Antarctica/DumontDUrville' => 'Dumont-d'Urville Saati',
        'Antarctica/Macquarie' => 'Doğu Avustralya Saati (Macquarie)',
        'Antarctica/Mawson' => 'Mawson Saati',
        'Antarctica/McMurdo' => 'Yeni Zelanda Saati (McMurdo)',
        'Antarctica/Palmer' => 'Şili Saati (Palmer)',
        'Antarctica/Rothera' => 'Rothera Saati',
        'Antarctica/Syowa' => 'Showa Saati',
        'Antarctica/Troll' => 'Greenwich Ortalama Saati (Troll)',
        'Antarctica/Vostok' => 'Vostok Saati',
        'Arctic/Longyearbyen' => 'Orta Avrupa Saati (Longyearbyen)',
        'Asia/Aden' => 'Arabistan Saati (Aden)',
        'Asia/Almaty' => 'Doğu Kazakistan Saati (Almatı)',
        'Asia/Amman' => 'Doğu Avrupa Saati (Amman)',
        'Asia/Anadyr' => 'Anadyr Saati (Anadır)',
        'Asia/Aqtau' => 'Batı Kazakistan Saati (Aktav)',
        'Asia/Aqtobe' => 'Batı Kazakistan Saati (Aktöbe)',
        'Asia/Ashgabat' => 'Türkmenistan Saati (Aşkabat)',
        'Asia/Atyrau' => 'Batı Kazakistan Saati (Atırav)',
        'Asia/Baghdad' => 'Arabistan Saati (Bağdat)',
        'Asia/Bahrain' => 'Arabistan Saati (Bahreyn)',
        'Asia/Baku' => 'Azerbaycan Saati (Bakü)',
        'Asia/Bangkok' => 'Hindiçin Saati (Bangkok)',
        'Asia/Barnaul' => 'Rusya Saati (Barnaul)',
        'Asia/Beirut' => 'Doğu Avrupa Saati (Beyrut)',
        'Asia/Bishkek' => 'Kırgızistan Saati (Bişkek)',
        'Asia/Brunei' => 'Brunei Darü's-Selam Saati',
        'Asia/Calcutta' => 'Hindistan Standart Saati (Kalküta)',
        'Asia/Chita' => 'Yakutsk Saati (Çita)',
        'Asia/Choibalsan' => 'Ulan Batur Saati (Çoybalsan)',
        'Asia/Colombo' => 'Hindistan Standart Saati (Kolombo)',
        'Asia/Damascus' => 'Doğu Avrupa Saati (Şam)',
        'Asia/Dhaka' => 'Bangladeş Saati (Dakka)',
        'Asia/Dili' => 'Doğu Timor Saati (Dili)',
        'Asia/Dubai' => 'Körfez Saati (Dubai)',
        'Asia/Dushanbe' => 'Tacikistan Saati (Duşanbe)',
        'Asia/Famagusta' => 'Doğu Avrupa Saati (Gazimağusa)',
        'Asia/Gaza' => 'Doğu Avrupa Saati (Gazze)',
        'Asia/Hebron' => 'Doğu Avrupa Saati (El Halil)',
        'Asia/Hong_Kong' => 'Hong Kong Saati',
        'Asia/Hovd' => 'Hovd Saati',
        'Asia/Irkutsk' => 'İrkutsk Saati',
        'Asia/Jakarta' => 'Batı Endonezya Saati (Cakarta)',
        'Asia/Jayapura' => 'Doğu Endonezya Saati (Jayapura)',
        'Asia/Jerusalem' => 'İsrail Saati (Kudüs)',
        'Asia/Kabul' => 'Afganistan Saati (Kabil)',
        'Asia/Kamchatka' => 'Petropavlovsk-Kamçatski Saati (Kamçatka)',
        'Asia/Karachi' => 'Pakistan Saati (Karaçi)',
        'Asia/Katmandu' => 'Nepal Saati (Katmandu)',
        'Asia/Khandyga' => 'Yakutsk Saati (Handiga)',
        'Asia/Krasnoyarsk' => 'Krasnoyarsk Saati',
        'Asia/Kuala_Lumpur' => 'Malezya Saati (Kuala Lumpur)',
        'Asia/Kuching' => 'Malezya Saati (Kuçing)',
        'Asia/Kuwait' => 'Arabistan Saati (Kuveyt)',
        'Asia/Macau' => 'Çin Saati (Makao)',
        'Asia/Magadan' => 'Magadan Saati',
        'Asia/Makassar' => 'Orta Endonezya Saati (Makassar)',
        'Asia/Manila' => 'Filipinler Saati (Manila)',
        'Asia/Muscat' => 'Körfez Saati (Maskat)',
        'Asia/Nicosia' => 'Doğu Avrupa Saati (Lefkoşa)',
        'Asia/Novokuznetsk' => 'Krasnoyarsk Saati (Novokuznetsk)',
        'Asia/Novosibirsk' => 'Novosibirsk Saati',
        'Asia/Omsk' => 'Omsk Saati',
        'Asia/Oral' => 'Batı Kazakistan Saati (Oral)',
        'Asia/Phnom_Penh' => 'Hindiçin Saati (Phnom Penh)',
        'Asia/Pontianak' => 'Batı Endonezya Saati (Pontianak)',
        'Asia/Pyongyang' => 'Kore Saati (Pyongyang)',
        'Asia/Qatar' => 'Arabistan Saati (Katar)',
        'Asia/Qostanay' => 'Doğu Kazakistan Saati (Kostanay)',
        'Asia/Qyzylorda' => 'Batı Kazakistan Saati (Kızılorda)',
        'Asia/Rangoon' => 'Myanmar Saati (Yangon)',
        'Asia/Riyadh' => 'Arabistan Saati (Riyad)',
        'Asia/Saigon' => 'Hindiçin Saati (Ho Chi Minh Kenti)',
        'Asia/Sakhalin' => 'Sahalin Saati',
        'Asia/Samarkand' => 'Özbekistan Saati (Semerkand)',
        'Asia/Seoul' => 'Kore Saati (Seul)',
        'Asia/Shanghai' => 'Çin Saati (Şanghay)',
        'Asia/Singapore' => 'Singapur Standart Saati',
        'Asia/Srednekolymsk' => 'Magadan Saati (Srednekolymsk)',
        'Asia/Taipei' => 'Taipei Saati',
        'Asia/Tashkent' => 'Özbekistan Saati (Taşkent)',
        'Asia/Tbilisi' => 'Gürcistan Saati (Tiflis)',
        'Asia/Tehran' => 'İran Saati (Tahran)',
        'Asia/Thimphu' => 'Butan Saati (Thimphu)',
        'Asia/Tokyo' => 'Japonya Saati (Tokyo)',
        'Asia/Tomsk' => 'Rusya Saati (Tomsk)',
        'Asia/Ulaanbaatar' => 'Ulan Batur Saati',
        'Asia/Urumqi' => 'Çin Saati (Urumçi)',
        'Asia/Ust-Nera' => 'Vladivostok Saati (Ust-Nera)',
        'Asia/Vientiane' => 'Hindiçin Saati (Vientiane)',
        'Asia/Vladivostok' => 'Vladivostok Saati',
        'Asia/Yakutsk' => 'Yakutsk Saati',
        'Asia/Yekaterinburg' => 'Yekaterinburg Saati',
        'Asia/Yerevan' => 'Ermenistan Saati (Erivan)',
        'Atlantic/Azores' => 'Azorlar Saati (Azor Adaları)',
        'Atlantic/Bermuda' => 'Atlantik Saati (Bermuda)',
        'Atlantic/Canary' => 'Batı Avrupa Saati (Kanarya Adaları)',
        'Atlantic/Cape_Verde' => 'Cape Verde Saati',
        'Atlantic/Faeroe' => 'Batı Avrupa Saati (Faroe)',
        'Atlantic/Madeira' => 'Batı Avrupa Saati (Madeira Adaları)',
        'Atlantic/Reykjavik' => 'Greenwich Ortalama Saati (Reykjavik)',
        'Atlantic/South_Georgia' => 'Güney Georgia Saati',
        'Atlantic/St_Helena' => 'Greenwich Ortalama Saati (St. Helena)',
        'Atlantic/Stanley' => 'Falkland Adaları Saati (Stanley)',
        'Australia/Adelaide' => 'Orta Avustralya Saati (Adelaide)',
        'Australia/Brisbane' => 'Doğu Avustralya Saati (Brisbane)',
        'Australia/Broken_Hill' => 'Orta Avustralya Saati (Broken Hill)',
        'Australia/Currie' => 'Doğu Avustralya Saati (Currie)',
        'Australia/Darwin' => 'Orta Avustralya Saati (Darwin)',
        'Australia/Eucla' => 'İç Batı Avustralya Saati (Eucla)',
        'Australia/Hobart' => 'Doğu Avustralya Saati (Hobart)',
        'Australia/Lindeman' => 'Doğu Avustralya Saati (Lindeman)',
        'Australia/Lord_Howe' => 'Lord Howe Saati',
        'Australia/Melbourne' => 'Doğu Avustralya Saati (Melbourne)',
        'Australia/Perth' => 'Batı Avustralya Saati (Perth)',
        'Australia/Sydney' => 'Doğu Avustralya Saati (Sidney)',
        'CST6CDT' => 'Kuzey Amerika Merkezi Saati',
        'EST5EDT' => 'Kuzey Amerika Doğu Saati',
        'Etc/GMT' => 'Greenwich Ortalama Saati',
        'Etc/UTC' => 'Eş Güdümlü Evrensel Zaman',
        'Europe/Amsterdam' => 'Orta Avrupa Saati (Amsterdam)',
        'Europe/Andorra' => 'Orta Avrupa Saati (Andorra)',
        'Europe/Astrakhan' => 'Moskova Saati (Astrahan)',
        'Europe/Athens' => 'Doğu Avrupa Saati (Atina)',
        'Europe/Belgrade' => 'Orta Avrupa Saati (Belgrad)',
        'Europe/Berlin' => 'Orta Avrupa Saati (Berlin)',
        'Europe/Bratislava' => 'Orta Avrupa Saati (Bratislava)',
        'Europe/Brussels' => 'Orta Avrupa Saati (Brüksel)',
        'Europe/Bucharest' => 'Doğu Avrupa Saati (Bükreş)',
        'Europe/Budapest' => 'Orta Avrupa Saati (Budapeşte)',
        'Europe/Busingen' => 'Orta Avrupa Saati (Büsingen)',
        'Europe/Chisinau' => 'Doğu Avrupa Saati (Kişinev)',
        'Europe/Copenhagen' => 'Orta Avrupa Saati (Kopenhag)',
        'Europe/Dublin' => 'Greenwich Ortalama Saati (Dublin)',
        'Europe/Gibraltar' => 'Orta Avrupa Saati (Cebelitarık)',
        'Europe/Guernsey' => 'Greenwich Ortalama Saati (Guernsey)',
        'Europe/Helsinki' => 'Doğu Avrupa Saati (Helsinki)',
        'Europe/Isle_of_Man' => 'Greenwich Ortalama Saati (Man Adası)',
        'Europe/Istanbul' => 'Türkiye Saati (İstanbul)',
        'Europe/Jersey' => 'Greenwich Ortalama Saati (Jersey)',
        'Europe/Kaliningrad' => 'Doğu Avrupa Saati (Kaliningrad)',
        'Europe/Kiev' => 'Doğu Avrupa Saati (Kiev)',
        'Europe/Kirov' => 'Rusya Saati (Kirov)',
        'Europe/Lisbon' => 'Batı Avrupa Saati (Lizbon)',
        'Europe/Ljubljana' => 'Orta Avrupa Saati (Ljubljana)',
        'Europe/London' => 'Greenwich Ortalama Saati (Londra)',
        'Europe/Luxembourg' => 'Orta Avrupa Saati (Lüksemburg)',
        'Europe/Madrid' => 'Orta Avrupa Saati (Madrid)',
        'Europe/Malta' => 'Orta Avrupa Saati (Malta)',
        'Europe/Mariehamn' => 'Doğu Avrupa Saati (Mariehamn)',
        'Europe/Minsk' => 'Moskova Saati (Minsk)',
        'Europe/Monaco' => 'Orta Avrupa Saati (Monako)',
        'Europe/Moscow' => 'Moskova Saati',
        'Europe/Oslo' => 'Orta Avrupa Saati (Oslo)',
        'Europe/Paris' => 'Orta Avrupa Saati (Paris)',
        'Europe/Podgorica' => 'Orta Avrupa Saati (Podgorica)',
        'Europe/Prague' => 'Orta Avrupa Saati (Prag)',
        'Europe/Riga' => 'Doğu Avrupa Saati (Riga)',
        'Europe/Rome' => 'Orta Avrupa Saati (Roma)',
        'Europe/Samara' => 'Samara Saati',
        'Europe/San_Marino' => 'Orta Avrupa Saati (San Marino)',
        'Europe/Sarajevo' => 'Orta Avrupa Saati (Saraybosna)',
        'Europe/Saratov' => 'Moskova Saati (Saratov)',
        'Europe/Simferopol' => 'Moskova Saati (Simferopol)',
        'Europe/Skopje' => 'Orta Avrupa Saati (Üsküp)',
        'Europe/Sofia' => 'Doğu Avrupa Saati (Sofya)',
        'Europe/Stockholm' => 'Orta Avrupa Saati (Stokholm)',
        'Europe/Tallinn' => 'Doğu Avrupa Saati (Tallinn)',
        'Europe/Tirane' => 'Orta Avrupa Saati (Tiran)',
        'Europe/Ulyanovsk' => 'Moskova Saati (Ulyanovsk)',
        'Europe/Uzhgorod' => 'Doğu Avrupa Saati (Ujgorod)',
        'Europe/Vaduz' => 'Orta Avrupa Saati (Vaduz)',
        'Europe/Vatican' => 'Orta Avrupa Saati (Vatikan)',
        'Europe/Vienna' => 'Orta Avrupa Saati (Viyana)',
        'Europe/Vilnius' => 'Doğu Avrupa Saati (Vilnius)',
        'Europe/Volgograd' => 'Volgograd Saati',
        'Europe/Warsaw' => 'Orta Avrupa Saati (Varşova)',
        'Europe/Zagreb' => 'Orta Avrupa Saati (Zagreb)',
        'Europe/Zaporozhye' => 'Doğu Avrupa Saati (Zaporojye)',
        'Europe/Zurich' => 'Orta Avrupa Saati (Zürih)',
        'Indian/Antananarivo' => 'Doğu Afrika Saati (Antananarivo)',
        'Indian/Chagos' => 'Hint Okyanusu Saati (Chagos)',
        'Indian/Christmas' => 'Christmas Adası Saati',
        'Indian/Cocos' => 'Cocos Adaları Saati',
        'Indian/Comoro' => 'Doğu Afrika Saati (Komor)',
        'Indian/Kerguelen' => 'Fransız Güney ve Antarktika Saati (Kerguelen)',
        'Indian/Mahe' => 'Seyşeller Saati (Mahe)',
        'Indian/Maldives' => 'Maldivler Saati',
        'Indian/Mauritius' => 'Mauritius Saati',
        'Indian/Mayotte' => 'Doğu Afrika Saati (Mayotte)',
        'Indian/Reunion' => 'Reunion Saati',
        'MST7MDT' => 'Kuzey Amerika Dağ Saati',
        'PST8PDT' => 'Kuzey Amerika Pasifik Saati',
        'Pacific/Apia' => 'Apia Saati',
        'Pacific/Auckland' => 'Yeni Zelanda Saati (Auckland)',
        'Pacific/Bougainville' => 'Papua Yeni Gine Saati (Bougainville)',
        'Pacific/Chatham' => 'Chatham Saati',
        'Pacific/Easter' => 'Paskalya Adası Saati',
        'Pacific/Efate' => 'Vanuatu Saati (Efate)',
        'Pacific/Enderbury' => 'Phoenix Adaları Saati (Enderbury)',
        'Pacific/Fakaofo' => 'Tokelau Saati (Fakaofo)',
        'Pacific/Fiji' => 'Fiji Saati',
        'Pacific/Funafuti' => 'Tuvalu Saati (Funafuti)',
        'Pacific/Galapagos' => 'Galapagos Saati',
        'Pacific/Gambier' => 'Gambier Saati',
        'Pacific/Guadalcanal' => 'Solomon Adaları Saati (Guadalcanal)',
        'Pacific/Guam' => 'Chamorro Saati (Guam)',
        'Pacific/Honolulu' => 'Hawaii-Aleut Saati (Honolulu)',
        'Pacific/Johnston' => 'Hawaii-Aleut Saati (Johnston)',
        'Pacific/Kiritimati' => 'Line Adaları Saati (Kiritimati)',
        'Pacific/Kosrae' => 'Kosrae Saati',
        'Pacific/Kwajalein' => 'Marshall Adaları Saati (Kwajalein)',
        'Pacific/Majuro' => 'Marshall Adaları Saati (Majuro)',
        'Pacific/Marquesas' => 'Markiz Adaları Saati',
        'Pacific/Midway' => 'Samoa Saati (Midway)',
        'Pacific/Nauru' => 'Nauru Saati',
        'Pacific/Niue' => 'Niue Saati',
        'Pacific/Norfolk' => 'Norfolk Adası Saati',
        'Pacific/Noumea' => 'Yeni Kaledonya Saati (Noumea)',
        'Pacific/Pago_Pago' => 'Samoa Saati (Pago Pago)',
        'Pacific/Palau' => 'Palau Saati',
        'Pacific/Pitcairn' => 'Pitcairn Saati',
        'Pacific/Ponape' => 'Ponape Saati (Pohnpei)',
        'Pacific/Port_Moresby' => 'Papua Yeni Gine Saati (Port Moresby)',
        'Pacific/Rarotonga' => 'Cook Adaları Saati (Rarotonga)',
        'Pacific/Saipan' => 'Chamorro Saati (Saipan)',
        'Pacific/Tahiti' => 'Tahiti Saati',
        'Pacific/Tarawa' => 'Gilbert Adaları Saati (Tarawa)',
        'Pacific/Tongatapu' => 'Tonga Saati (Tongatapu)',
        'Pacific/Truk' => 'Chuuk Saati',
        'Pacific/Wake' => 'Wake Adası Saati',
        'Pacific/Wallis' => 'Wallis ve Futuna Saati',
    ],
    'Meta' => [
    ],
];


text:
#include "tensorflow/core/data/service/journal.h"

#include "absl/memory/memory.h"
#include "tensorflow/core/data/service/journal.pb.h"
#include "tensorflow/core/lib/io/record_reader.h"
#include "tensorflow/core/lib/io/record_writer.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/errors.h"
#include "tensorflow/core/platform/path.h"
#include "tensorflow/core/platform/regexp.h"

namespace tensorflow {
namespace data {

namespace {
constexpr StringPiece kJournal = "journal";

Status ParseSequenceNumber(const std::string& journal_file,
                           int64_t* sequence_number) {
  if (!RE2::FullMatch(journal_file, ".*_(\\d+)", sequence_number)) {
    return errors::InvalidArgument("Failed to parse journal file name: ",
                                   journal_file);
  }
  return Status::OK();
}
}  // namespace

std::string DataServiceJournalFile(const std::string& journal_dir,
                                   int64_t sequence_number) {
  return io::JoinPath(journal_dir,
                      absl::StrCat(kJournal, "_", sequence_number));
}

FileJournalWriter::FileJournalWriter(Env* env, const std::string& journal_dir)
    : env_(env), journal_dir_(journal_dir) {}

Status FileJournalWriter::EnsureInitialized() {
  if (writer_) {
    return Status::OK();
  }
  std::vector<std::string> journal_files;
  TF_RETURN_IF_ERROR(env_->RecursivelyCreateDir(journal_dir_));
  TF_RETURN_IF_ERROR(env_->GetChildren(journal_dir_, &journal_files));
  int64_t latest_sequence_number = -1;
  for (const auto& file : journal_files) {
    int64_t sequence_number;
    TF_RETURN_IF_ERROR(ParseSequenceNumber(file, &sequence_number));
    latest_sequence_number = std::max(latest_sequence_number, sequence_number);
  }
  std::string journal_file =
      DataServiceJournalFile(journal_dir_, latest_sequence_number + 1);
  TF_RETURN_IF_ERROR(env_->NewAppendableFile(journal_file, &file_));
  writer_ = absl::make_unique<io::RecordWriter>(file_.get());
  VLOG(1) << "Created journal writer to write to " << journal_file;
  return Status::OK();
}

Status FileJournalWriter::Write(const Update& update) {
  TF_RETURN_IF_ERROR(EnsureInitialized());
  std::string s = update.SerializeAsString();
  if (s.empty()) {
    return errors::Internal("Failed to serialize update ", update.DebugString(),
                            " to string");
  }
  TF_RETURN_IF_ERROR(writer_->WriteRecord(s));
  TF_RETURN_IF_ERROR(writer_->Flush());
  TF_RETURN_IF_ERROR(file_->Sync());
  if (VLOG_IS_ON(4)) {
    VLOG(4) << "Wrote journal entry: " << update.DebugString();
  }
  return Status::OK();
}

FileJournalReader::FileJournalReader(Env* env, StringPiece journal_dir)
    : env_(env), journal_dir_(journal_dir) {}

Status FileJournalReader::EnsureInitialized() {
  if (reader_) {
    return Status::OK();
  }
  return UpdateFile(DataServiceJournalFile(journal_dir_, 0));
}

Status FileJournalReader::Read(Update& update, bool& end_of_journal) {
  TF_RETURN_IF_ERROR(EnsureInitialized());
  while (true) {
    tstring record;
    Status s = reader_->ReadRecord(&record);
    if (errors::IsOutOfRange(s)) {
      sequence_number_++;
      std::string next_journal_file =
          DataServiceJournalFile(journal_dir_, sequence_number_);
      if (errors::IsNotFound(env_->FileExists(next_journal_file))) {
        VLOG(3) << "Next journal file " << next_journal_file
                << " does not exist. End of journal reached.";
        end_of_journal = true;
        return Status::OK();
      }
      TF_RETURN_IF_ERROR(UpdateFile(next_journal_file));
      continue;
    }
    TF_RETURN_IF_ERROR(s);
    if (!update.ParseFromString(record)) {
      return errors::DataLoss("Failed to parse journal record.");
    }
    if (VLOG_IS_ON(4)) {
      VLOG(4) << "Read journal entry: " << update.DebugString();
    }
    end_of_journal = false;
    return Status::OK();
  }
}

Status FileJournalReader::UpdateFile(const std::string& filename) {
  VLOG(1) << "Reading from journal file " << filename;
  TF_RETURN_IF_ERROR(env_->NewRandomAccessFile(filename, &file_));
  io::RecordReaderOptions opts;
  opts.buffer_size = 2 << 20;  // 2MB
  reader_ = absl::make_unique<io::SequentialRecordReader>(file_.get(), opts);
  return Status::OK();
}

}  // namespace data
}  // namespace tensorflow


text:
'use strict';

const RuntimeVersion = require('./lib/RuntimeVersion.js');
const {oneBehindFetch} = require('@ampproject/toolbox-core');
module.exports = new RuntimeVersion(oneBehindFetch);


text:
/**
 * This class is generated by jOOQ
 */
package de.piratenpartei.berlin.ldadmin.dbaccess.generated.tables.interfaces;

/**
 * This class is generated by jOOQ.
 */
@javax.annotation.Generated(value    = { "http://www.jooq.org", "3.4.4" },
                            comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public interface IIssueOrderInAdmissionState extends java.io.Serializable {

	/**
	 * Getter for issue_order_in_admission_state.id.
	 */
	public java.lang.Long getId();

	/**
	 * Getter for issue_order_in_admission_state.order_in_area.
	 */
	public java.lang.Integer getOrderInArea();

	/**
	 * Getter for issue_order_in_admission_state.order_in_unit.
	 */
	public java.lang.Integer getOrderInUnit();
}


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

    <title>org.gradle.plugins.javascript.base</title>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="keywords" CONTENT="org/gradle/plugins/javascript/base package">

    <link href="groovy.ico" type="image/x-icon" rel="shortcut icon">
    <link href="groovy.ico" type="image/x-icon" rel="icon">
    <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

    org.gradle.plugins.javascript.base

Classes

JavaScriptBasePlugin

JavaScriptExtension

JavaScriptRepositoriesExtension

Exceptions

SourceTransformationException


text:
import { JsonSchema } from "./JsonSchema";

/**
 * Base class for thing schemas, properties, methods, and parameters, which
 * all have a name and optional description.
 */
export abstract class ThingCharacteristic {
    /**
     * Name of the characteristic.
     *
     * The name property of a schema may be different from the schema's module name.
     * A schema name should be globally unique, to avoid potential conflicts with other
     * similar schemas. Uniqueness is typically achieved using a reverse-domain-name style
     * hierarchical naming pattern.
     *
     * Property and method names are allowed to conflict across different schemas, even
     * ones that implemented by the same translator. When invoking a translator, a schema
     * context is always specified.
     */
    public readonly name: string;

    /**
     * Optional English description of the schema, to be used as developer documentation.
     */
    public readonly description?: string;
}

/**
 * Describes a schema that can be implemented by a thing translator.
 *
 * Schemas are composable, meaning they can reference other schemas, which reference
 * other schemas, etc. So getting a complete view of all of a schema's properties
 * and methods requires resolving and following all references. (Duplicate schema
 * references are ignored; cycles are not allowed.) Schema resolution is provided
 * by the ThingAccessor.getSchemaAsync() method.
 */
export class ThingSchema extends ThingCharacteristic {
    /**
     * Merges multiple schemas into a single combined schema containing
     * members from all specified schemas and all schemas they reference
     * recursively. Members having the same name are NOT combined, unless they
     * are also from the same schema.
     *
     * This may be used to generate a single schema that describes everything
     * a thing is capable of. (The generated schema will always have an
     * empty list of references.)
     *
     * @param {ThingSchema[]} schemas  Array of schemas to be merged
     * @param {string} name  Name of the new merged schema
     * @param {string} [description]  Optional description of the merged schema
     * @returns {ThingSchema}  Merged schema
     */
    public static merge(
            schemas: ThingSchema[],
            name: string,
            description?: string): ThingSchema {
        throw new Error("Not implemented");
    }

    /**
     * List of properties declared by this schema.
     */
    public readonly properties: ThingProperty[];

    /**
     * List of methods declared by this schema.
     */
    public readonly methods: ThingMethod[];

    /**
     * List of referenced schemas declared by this schema. All properties and
     * methods from directly and indirectly referenced schemas are effectively
     * included in this schema. (It's conceptually similar to schema inheritance.)
     */
    public readonly references: ThingSchema[];
}

/**
 * A property declared by a ThingSchema. Properties can be readable,
 * writeable, and/or notifiable. (A property that is notify-only is equivalent
 * to an AllJoyn signal.)
 */
export class ThingProperty extends ThingCharacteristic {
    /**
     * Name of the schema that declared this property.
     *
     * This may be useful when the property is included in a group along with properties from
     * referenced schemas. The name of the schema that actually declared the property
     * (not just one that referenced it) must be used when accessing the property.
     */
    public readonly schemaName: string;

    /**
     * Whether the property is readable.
     */
    public readonly canRead: boolean;

    /**
     * Whether the property is writeable.
     */
    public readonly canWrite: boolean;

    /**
     * Whether the property supports notifications.
     *
     * Notifications can be subscribed to using the standard node events API.
     *
     * For a property that is also readable, a notification typically represents
     * a property-changed event. For a notify-only property, the meaning of the
     * notification may be different. Either way, the type of the notification
     * event object conforms to the property type schema.
     */
    public readonly canNotify: boolean;

    /**
     * JSON schema that specifies the type of the property.
     */
    public readonly propertyType: JsonSchema;
}

/**
 * A method declared by a thing schema.
 */
export class ThingMethod extends ThingCharacteristic {
    /**
     * Name of the schema that declared this method.
     *
     * This may be useful when the method is included in a group along with methods from
     * referenced schemas. The name of the schema that actually declared the method
     * (not just one that referenced it) must be used when invoking the method.
     */
    public readonly schemaName: string;

    /**
     * List of method in and out parameters.
     *
     * Currently no more than one out parameter is allowed; the single
     * out parameter, if present, is the return value of a JavaScript method.
     */
    public readonly parameters: ThingParameter[];
}

/**
 * A parameter of a method in a thing schema.
 */
export class ThingParameter extends ThingCharacteristic {
    /**
     * JSON schema that specifies the type of the parameter.
     */
    public readonly parameterType: JsonSchema;

    /**
     * True if this is an out parameter (return value), false if in.
     */
    public readonly isOut: boolean;
}


text:
package com.github.leosilvadev.proxy.middlewares;

import com.github.leosilvadev.proxy.utils.Response;

import io.vertx.core.Handler;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import io.vertx.ext.web.RoutingContext;

public abstract class AbstractMiddleware implements Handler<RoutingContext> {

  protected static final Logger logger = LoggerFactory.getLogger(AbstractMiddleware.class);

  public abstract void handleRequest(RoutingContext context);

  @Override
  public final void handle(final RoutingContext context) {
    try {
      handleRequest(context);
    } catch (Exception ex) {
      logger.error(ex.getMessage(), ex);
      Response.internalServerError(context);
    }
  }

  public String path() {
    return null;
  }

}


text:
from __future__ import print_function
import time, sys, signal, atexit
from upm import pyupm_nunchuck as upmNunchuck

def main():
    # Instantiate a nunchuck controller bus 3 on I2C
    myNunchuck = upmNunchuck.NUNCHUCK(3)

    ## Exit handlers ##
    # This function stops python from printing a stacktrace when you hit control-C
    def SIGINTHandler(signum, frame):
        raise SystemExit

    # This function lets you run code on exit, including functions from myNunchuck
    def exitHandler():
        print("Exiting")
        sys.exit(0)

    # Register exit handlers
    atexit.register(exitHandler)
    signal.signal(signal.SIGINT, SIGINTHandler)

    def buttonStateStr(buttonState):
        return "pressed" if buttonState else "not pressed"

    # Print the X and Y input values every second
    while(1):
        myNunchuck.update()

        outputStr = "stickX: {0}, stickY: {1}".format(
        myNunchuck.stickX, myNunchuck.stickY)
        print(outputStr)
        outputStr = "accelX: {0}, accelY: {1}, accelZ: {2}".format(
        myNunchuck.accelX, myNunchuck.accelY, myNunchuck.accelZ)
        print(outputStr)

        outputStr = "button C: {0}".format(
        buttonStateStr(myNunchuck.buttonC))
        print(outputStr)
        outputStr = "button Z: {0}".format(
        buttonStateStr(myNunchuck.buttonZ))
        print(outputStr)

        time.sleep(.1)

if __name__ == '__main__':
    main()


text:
/* jslint node: true */
/* jshint node:true */
/* global describe, it, before, beforeEach, after, afterEach */
/* jshint expr: true, ok */

"use strict";

var sinon = require('sinon');
var should = require('should');
var request = require('request');
var _ = require('underscore');
var ThingSpeakClient = require('../thingspeakclient');

describe('ThinkSpeakClient Get Field Feed Tests', function() {
    var client = new ThingSpeakClient();
    var stub;

    before(function(done) {
        stub = sinon.stub(request, "get", function(reqData, cB) {
            //console.log(reqData);
            var res = -1;
            if (reqData.uri === 'https://api.thingspeak.com/channels/654321/field/1.json') {
                res = {
                    channel: {
                        id: 654321,
                        name: 'node.js-Test-Channel',
                        field1: 'Field Label 1',
                        created_at: '2014-02-23T16:33:07Z',
                        updated_at: '2014-02-23T16:37:22Z',
                        last_entry_id: 2
                    },
                    feeds: [{
                        created_at: '2014-02-23T16:35:35Z',
                        entry_id: 1,
                        field1: '7'
                    }, {
                        created_at: '2014-02-23T16:37:22Z',
                        entry_id: 2,
                        field1: '7'
                    }]
                }
            };
            if (reqData.uri === 'https://api.thingspeak.com/channels/222222/field/1.json') {
                res = {
                    channel: {
                        id: 222222,
                        name: 'node.js-Test-Channel',
                        field1: 'Field Label 1',
                        created_at: '2014-02-23T16:33:07Z',
                        updated_at: '2014-02-23T16:37:22Z',
                        last_entry_id: 2
                    },
                    feeds: [{
                        created_at: '2014-02-23T16:35:35Z',
                        entry_id: 1,
                        field1: '7'
                    }, {
                        created_at: '2014-02-23T16:37:22Z',
                        entry_id: 2,
                        field1: '7'
                    }]
                };
            }
            if (_.isFunction(cB)) {
                cB(null, 'fakeResponse', res);
            };
        });
        client.attachChannel(222222, {
            'readKey': 'you'
        });
        client.attachChannel(123456, {
            'writeKey': 'you'
        }, done);
    });

    after(function(done) {
        stub.restore();
        done();
    });

    it('should give an error if the channel id is not a number', function(done) {
        client.getFieldFeed('abcd', 1, function(err, response) {
            err.should.be.an.Error;
            err.message.should.be.eql('no channel id given for getFieldFeed');
            stub.callCount.should.eql(0);
            done();
        });
    });

    it('should give an error if the field id is not a number', function(done) {
        client.getFieldFeed(654321, 'a', function(err, response) {
            err.should.be.an.Error;
            err.message.should.be.eql('field id is out of range');
            stub.callCount.should.eql(0);
            done();
        });
    });

    it('should give an error if the field id is lesser than 1', function(done) {
        client.getFieldFeed(654321, 0, function(err, response) {
            err.should.be.an.Error;
            err.message.should.be.eql('field id is out of range');
            stub.callCount.should.eql(0);
            done();
        });
    });

    it('should give an error if the field id is greater than 8', function(done) {
        client.getFieldFeed(654321, 9, function(err, response) {
            err.should.be.an.Error;
            err.message.should.be.eql('field id is out of range');
            stub.callCount.should.eql(0);
            done();
        });
    });

    it('should make a call without a query on an unattached channel', function(done) {
        client.getFieldFeed(654321, 1, function(err, response) {
            should(err).not.Error;
            stub.callCount.should.eql(1);
            var callArgs = stub.getCall(0).args[0];
            callArgs.should.have.property('uri', 'https://api.thingspeak.com/channels/654321/field/1.json');
            callArgs.should.have.property('qs', null);
            callArgs.should.have.property('json', true);
            response.should.be.an.Object;
            done();
        });
    });

    it('should make a call without a query on an attached channel without existing readKey and get back -1 (unauthorized)', function(done) {
        client.getFieldFeed(123456, 1, function(err, response) {
            should(err).not.Error;
            stub.callCount.should.eql(2);
            var callArgs = stub.getCall(1).args[0];
            callArgs.should.have.property('uri', 'https://api.thingspeak.com/channels/123456/field/1.json');
            callArgs.should.have.property('qs', null);
            callArgs.should.have.property('json', true);
            response.should.be.not.an.Object;
            response.should.be.a.Number.and.eql(-1);
            done();
        });
    });

    it('should make a call without a query on an attached channel with readKey and get back an object', function(done) {
        client.getFieldFeed(222222, 1, function(err, response) {
            should(err).not.Error;
            stub.callCount.should.eql(3);
            var callArgs = stub.getCall(2).args[0];
            callArgs.should.have.property('uri', 'https://api.thingspeak.com/channels/222222/field/1.json');
            callArgs.should.have.property('qs', {
                key: 'you'
            });
            callArgs.should.have.property('json', true);
            response.should.be.an.Object;
            done();
        });
    });

    it('should make a call with a query on an unattached channel', function(done) {
        client.getFieldFeed(654321, 1, {
            results: 7
        }, function(err, response) {
            should(err).not.Error;
            stub.callCount.should.eql(4);
            var callArgs = stub.getCall(3).args[0];
            callArgs.should.have.property('uri', 'https://api.thingspeak.com/channels/654321/field/1.json');
            callArgs.should.have.property('qs', {
                results: 7
            });
            callArgs.should.have.property('json', true);
            response.should.be.an.Object;
            done();
        });
    });

    it('should make a call with a query on an attached channel without existing readKey and get back -1 (unauthorized)', function(done) {
        client.getFieldFeed(123456, 1, {
            results: 7
        }, function(err, response) {
            should(err).not.Error;
            stub.callCount.should.eql(5);
            var callArgs = stub.getCall(4).args[0];
            callArgs.should.have.property('uri', 'https://api.thingspeak.com/channels/123456/field/1.json');
            callArgs.should.have.property('qs', {
                results: 7
            });
            callArgs.should.have.property('json', true);
            response.should.be.not.an.Object;
            response.should.be.a.Number.and.eql(-1);
            done();
        });
    });

    it('should make a call with a query on an attached channel with readKey and get back an object', function(done) {
        client.getFieldFeed(222222, 1, {
            status: true
        }, function(err, response) {
            should(err).not.Error;
            stub.callCount.should.eql(6);
            var callArgs = stub.getCall(5).args[0];
            callArgs.should.have.property('uri', 'https://api.thingspeak.com/channels/222222/field/1.json');
            callArgs.should.have.property('qs', {
                key: 'you',
                status: true
            });
            callArgs.should.have.property('json', true);
            response.should.be.an.Object;
            done();
        });
    });
});


text:
package com.breadwallet.tools.qrcode.xzing.open;

import android.hardware.Camera;
import android.util.Log;

/**
 * Abstraction over the {@link Camera} API that helps open them and return their metadata.
 */
public final class OpenCameraInterface {

  private static final String TAG = OpenCameraInterface.class.getName();

  private OpenCameraInterface() {
  }

  /** For {@link #open(int)}, means no preference for which camera to open. */
  public static final int NO_REQUESTED_CAMERA = -1;

  /**
   * Opens the requested camera with {@link Camera#open(int)}, if one exists.
   *
   * @param cameraId camera ID of the camera to use. A negative value
   *  or {@link #NO_REQUESTED_CAMERA} means "no preference", in which case a rear-facing
   *  camera is returned if possible or else any camera
   * @return handle to {@link OpenCamera} that was opened
   */
  public static OpenCamera open(int cameraId) {

    int numCameras = Camera.getNumberOfCameras();
    if (numCameras == 0) {
      Log.w(TAG, "No cameras!");
      return null;
    }

    boolean explicitRequest = cameraId >= 0;

    Camera.CameraInfo selectedCameraInfo = null;
    int index;
    if (explicitRequest) {
      index = cameraId;
      selectedCameraInfo = new Camera.CameraInfo();
      Camera.getCameraInfo(index, selectedCameraInfo);
    } else {
      index = 0;
      while (index < numCameras) {
        Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
        Camera.getCameraInfo(index, cameraInfo);
        CameraFacing reportedFacing = CameraFacing.values()[cameraInfo.facing];
        if (reportedFacing == CameraFacing.BACK) {
          selectedCameraInfo = cameraInfo;
          break;
        }
        index++;
      }
    }

    Camera camera;
    if (index < numCameras) {
      Log.i(TAG, "Opening camera #" + index);
      camera = Camera.open(index);
    } else {
      if (explicitRequest) {
        Log.w(TAG, "Requested camera does not exist: " + cameraId);
        camera = null;
      } else {
        Log.i(TAG, "No camera facing " + CameraFacing.BACK + "; returning camera #0");
        camera = Camera.open(0);
        selectedCameraInfo = new Camera.CameraInfo();
        Camera.getCameraInfo(0, selectedCameraInfo);
      }
    }

    if (camera == null) {
      return null;
    }
    return new OpenCamera(index,
        camera,
        CameraFacing.values()[selectedCameraInfo.facing],
        selectedCameraInfo.orientation);
  }

}