text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="theme" content="hugo-academic">
  <meta name="generator" content="Hugo 0.56.3" />
  <meta name="author" content="Sam Abbott">

  <meta name="description" content="">

  <link rel="alternate" hreflang="en-uk" href="http://www.samabbott.co.uk/talk/">

  <meta name="theme-color" content="#0095eb">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha512-6MXa8B6uaO18Hid6blRMetEIoPqHf7Ux1tnyIQdpt9qI5OACx7C+O3IVTr98vwGnlcg0LOLa02i9Y1HpVhlfiw==" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.8.1/css/academicons.min.css" integrity="sha512-NThgw3XKQ1absAahW6to7Ey42uycrVvfNfyjqcFNgCmOCQ5AR4AO0SiXrN+8ZtYeappp56lk1WtvjVmEa+VR6A==" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw==" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.css" integrity="sha256-ygkqlh3CYSUri3LhQxzdcm0n1EQvH2Y+U5S2idbLtxs=" crossorigin="anonymous">

  <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Montserrat:400,700%7cRoboto:400,400italic,700%7cRoboto+Mono">

  <link rel="stylesheet" href="../styles.css">

  <link rel="alternate" href="http://www.samabbott.co.uk/talk/index.xml" type="application/rss+xml" title="Sam Abbott">
  <link rel="feed" href="http://www.samabbott.co.uk/talk/index.xml" type="application/rss+xml" title="Sam Abbott">

  <link rel="manifest" href="../site.webmanifest">
  <link rel="icon" type="image/png" href="../img/icon.png">
  <link rel="apple-touch-icon" type="image/png" href="../img/icon-192.png">

  <link rel="canonical" href="http://www.samabbott.co.uk/talk/">

  <meta property="twitter:card" content="summary_large_image">

  <meta property="twitter:site" content="@seabbs">
  <meta property="twitter:creator" content="@seabbs">

  <meta property="og:site_name" content="Sam Abbott">
  <meta property="og:url" content="http://www.samabbott.co.uk/talk/">
  <meta property="og:title" content="Recent & Upcoming Talks | Sam Abbott">
  <meta property="og:description" content="">
  <meta property="og:locale" content="en-uk">

  <meta property="og:updated_time" content="2017-01-01T00:00:00+00:00">

  <!DOCTYPE html>

<title>Recent & Upcoming Talks - Sam Abbott</title>
<meta property="og:title" content="Recent & Upcoming Talks - Sam Abbott">
<meta property="og:type" content="article">

  <meta name="twitter:card" content="summary">
  <meta name="twitter:image" content="https://raw.githubusercontent.com/seabbs/seabbs.github.io/sources/static/img/logo.png" >

<meta property="description" content="Article posted by %!s(<nil>), on Sunday, January 1nd, 2017">
<meta property="og:description" content="Article posted by %!s(<nil>), on Sunday, January 1nd, 2017">

<meta name="twitter:creator" content="">
<meta name="twitter:site" content="">

  <title>Recent & Upcoming Talks | Sam Abbott</title>

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
              data-target=".navbar-collapse" aria-expanded="false">
        Toggle navigation

      </button>

            Home

            Tags

            Publications

            Talks

            Teaching

            Posts

            Projects

            CV

Recent & Upcoming Talks

2019

  idmodelr: An R package containing a library of infectious disease models and utilities

    Sat, Nov 16, 2019

            Cardiff SatRday

  Slides

  Project

  CV generation in R: a useful use of time?

    Tue, Nov 12, 2019

            BristolR

  Slides

  getTBinR: an R package for accessing and summarising World Health Organization Tuberculosis data

    Sat, Sep 14, 2019

            R/Medicine

  Slides

  Project

  What do we really know about BCG

    Fri, Jun 14, 2019

            UK Clinical Vaccine Network Conference 2019

  Slides

  Project

  (My) essential R resources

    Tue, Apr 23, 2019

            BristolR

  Slides

2018

  Estimating the effect of the 2005 UK BCG vaccination policy change: A retrospective cohort study using the Enhanced Tuberculosis Surveillance system, 2000-2015

    Tue, Mar 20, 2018

            Research and Applied Epidemiology Scientific Conference 2018

  PDF

  Introduction to getTBinR

    Tue, Mar 6, 2018

            Bristol infectious disease dynamics modelling workshop

  Slides

  Project

2017

  Beneficial effects of BCG vaccination in outcomes for patients diagnosed with TB: observational study using the Enhanced Tuberculosis surveillance system 2009-2015

    Wed, Oct 11, 2017

            48th Union World Conference on Lung Health

  PDF

  Modelling BCG vaccination in the UK: What is the impact of changing vaccination policy?

    Thu, Aug 3, 2017

            Bristol infectious disease dynamics modelling workshop

  PDF

  Beneficial effects of BCG vaccination in outcomes for patients with active TB: observational study using the Enhanced Tuberculosis surveillance system 2000-2014

    Fri, Mar 24, 2017

            Research and Applied Epidemiology Scientific Conference 2017

  Slides

2016

  Assessing the Evidence for Universal Bacillus Calmette-Guèrin (BCG) Vaccination in England

    Wed, Mar 23, 2016

            Research and Applied Epidemiology Scientific Conference 2016

  Slides

      © 2017-2019 Sam Abbott ·

      Powered by the Academic
      theme for Hugo ·

     Edit this page.


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

package org.chromium.chrome.browser.omnibox;

import android.content.res.Resources;
import android.text.Editable;
import android.text.Selection;
import android.text.TextUtils;

import androidx.annotation.ColorRes;

import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.Callback;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.omnibox.UrlBarProperties.AutocompleteText;
import org.chromium.chrome.browser.omnibox.UrlBarProperties.UrlBarTextState;
import org.chromium.ui.modelutil.PropertyKey;
import org.chromium.ui.modelutil.PropertyModel;

/**
 * Handles translating the UrlBar model data to the view state.
 */
class UrlBarViewBinder {
    /**
     * @see
     * PropertyModelChangeProcessor.ViewBinder#bind(Object,
     * Object, Object)
     */
    public static void bind(PropertyModel model, UrlBar view, PropertyKey propertyKey) {
        if (UrlBarProperties.ACTION_MODE_CALLBACK.equals(propertyKey)) {
            view.setCustomSelectionActionModeCallback(
                    model.get(UrlBarProperties.ACTION_MODE_CALLBACK));
        } else if (UrlBarProperties.ALLOW_FOCUS.equals(propertyKey)) {
            view.setAllowFocus(model.get(UrlBarProperties.ALLOW_FOCUS));
        } else if (UrlBarProperties.AUTOCOMPLETE_TEXT.equals(propertyKey)) {
            AutocompleteText autocomplete = model.get(UrlBarProperties.AUTOCOMPLETE_TEXT);
            if (view.shouldAutocomplete()) {
                view.setAutocompleteText(autocomplete.userText, autocomplete.autocompleteText);
            }
        } else if (UrlBarProperties.DELEGATE.equals(propertyKey)) {
            view.setDelegate(model.get(UrlBarProperties.DELEGATE));
        } else if (UrlBarProperties.FOCUS_CHANGE_CALLBACK.equals(propertyKey)) {
            final Callback<Boolean> focusChangeCallback =
                    model.get(UrlBarProperties.FOCUS_CHANGE_CALLBACK);
            view.setOnFocusChangeListener((v, focused) -> {
                if (focused) view.setIgnoreTextChangesForAutocomplete(false);
                focusChangeCallback.onResult(focused);
            });
        } else if (UrlBarProperties.SHOW_CURSOR.equals(propertyKey)) {
            view.setCursorVisible(model.get(UrlBarProperties.SHOW_CURSOR));
        } else if (UrlBarProperties.TEXT_CONTEXT_MENU_DELEGATE.equals(propertyKey)) {
            view.setTextContextMenuDelegate(model.get(UrlBarProperties.TEXT_CONTEXT_MENU_DELEGATE));
        } else if (UrlBarProperties.TEXT_STATE.equals(propertyKey)) {
            UrlBarTextState state = model.get(UrlBarProperties.TEXT_STATE);
            view.setIgnoreTextChangesForAutocomplete(true);
            view.setText(state.text);
            view.setTextForAutofillServices(state.textForAutofillServices);
            view.setScrollState(state.scrollType, state.scrollToIndex);
            view.setIgnoreTextChangesForAutocomplete(false);

            if (view.hasFocus()) {
                if (state.selectionState == UrlBarCoordinator.SelectionState.SELECT_ALL) {
                    view.selectAll();
                } else if (state.selectionState == UrlBarCoordinator.SelectionState.SELECT_END) {
                    view.setSelection(view.getText().length());
                }
            }
        } else if (UrlBarProperties.USE_DARK_TEXT_COLORS.equals(propertyKey)) {
            updateTextColors(view, model.get(UrlBarProperties.USE_DARK_TEXT_COLORS));
        } else if (UrlBarProperties.URL_DIRECTION_LISTENER.equals(propertyKey)) {
            view.setUrlDirectionListener(model.get(UrlBarProperties.URL_DIRECTION_LISTENER));
        } else if (UrlBarProperties.URL_TEXT_CHANGE_LISTENER.equals(propertyKey)) {
            view.setUrlTextChangeListener(model.get(UrlBarProperties.URL_TEXT_CHANGE_LISTENER));
        } else if (UrlBarProperties.TEXT_CHANGED_LISTENER.equals(propertyKey)) {
            view.setTextChangedListener(model.get(UrlBarProperties.TEXT_CHANGED_LISTENER));
        } else if (UrlBarProperties.WINDOW_DELEGATE.equals(propertyKey)) {
            view.setWindowDelegate(model.get(UrlBarProperties.WINDOW_DELEGATE));
        }
    }

    private static void updateTextColors(UrlBar view, boolean useDarkTextColors) {
        int originalHighlightColor;
        Object highlightColorObj = view.getTag(R.id.highlight_color);
        if (highlightColorObj == null || !(highlightColorObj instanceof Integer)) {
            originalHighlightColor = view.getHighlightColor();
            view.setTag(R.id.highlight_color, originalHighlightColor);
        } else {
            originalHighlightColor = (Integer) highlightColorObj;
        }

        Resources resources = view.getResources();
        int textColor;
        int hintColor;
        int highlightColor;
        if (useDarkTextColors) {
            textColor = ApiCompatibilityUtils.getColor(resources, R.color.default_text_color_dark);
            hintColor =
                    ApiCompatibilityUtils.getColor(resources, R.color.locationbar_dark_hint_text);
            highlightColor = originalHighlightColor;
        } else {
            textColor = ApiCompatibilityUtils.getColor(resources, R.color.default_text_color_light);
            hintColor =
                    ApiCompatibilityUtils.getColor(resources, R.color.locationbar_light_hint_text);
            highlightColor = ApiCompatibilityUtils.getColor(
                    resources, R.color.highlight_color_on_light_text);
        }

        view.setTextColor(textColor);
        setHintTextColor(view, hintColor);
        view.setHighlightColor(highlightColor);
    }

    private static void setHintTextColor(UrlBar view, @ColorRes int textColor) {
        // Note: Setting the hint text color only takes effect if there is not text in the URL bar.
        //       To get around this, set the URL to empty before setting the hint color and revert
        //       back to the previous text after.
        boolean hasNonEmptyText = false;
        int selectionStart = 0;
        int selectionEnd = 0;
        Editable text = view.getText();
        if (!TextUtils.isEmpty(text)) {
            selectionStart = view.getSelectionStart();
            selectionEnd = view.getSelectionEnd();
            // Make sure the setText in this block does not affect the suggestions.
            view.setIgnoreTextChangesForAutocomplete(true);
            view.setText("");
            hasNonEmptyText = true;
        }
        view.setHintTextColor(textColor);
        if (hasNonEmptyText) {
            view.setText(text);
            if (view.hasFocus()) {
                Selection.setSelection(view.getText(), selectionStart, selectionEnd);
            }
            view.setIgnoreTextChangesForAutocomplete(false);
        }
    }

    private UrlBarViewBinder() {}
}

redpajama_set_name: RedPajamaGithub


text:
class ProductsController < Spree::BaseController
  private

# Uncomment this method to make the simple search work for products.
  def collection
    # Define what is allowed.
    sort_params = {
      "price_asc" => ["master_price", "ASC"],
      "price_desc" => ["master_price", "DESC"],
      "date_asc" => ["available_on", "ASC"],
      "date_desc" => ["available_on", "DESC"],
      "name_asc" => ["name", "ASC"],
      "name_desc" => ["name", "DESC"]
    }
    # Set it to what is allowed or default.
    @sort_by_and_as = sort_params[params[:sort]] || ["available_on", "DESC"]
    # If setted to default, clean the param it doesn't need to clutter the url.
    params[:sort] = nil if @sort_by_and_as == ["available_on", "DESC"]

#    @search_param = "- #{t('ext.search.searching_by', :search_term => params[:keywords])}" if params[:keywords]

    @search = Product.active.new_search(params[:search])
    @search.order_by = @sort_by_and_as[0]
    @search.order_as = @sort_by_and_as[1]
    @search.conditions.name_contains = params[:keywords]

    @search.per_page = Spree::Config[:products_per_page]
    @search.include = :images

    @product_cols = 3
    @products ||= @search.all
  end
end


text:
package zerror

import (
	"fmt"
	"os"
	"syscall"

	slog "github.com/burke/zeus/go/shinylog"
)

var finalOutput []func()

func Init() {
	finalOutput = make([]func(), 0)
}

func PrintFinalOutput() {
	for _, cb := range finalOutput {
		cb()
	}
}

// TODO: this is gross because code is ignored.
func ExitNow(code int, finalOuputCallback func()) {
	finalOutput = append(finalOutput, finalOuputCallback)
	proc, _ := os.FindProcess(os.Getpid())
	proc.Signal(syscall.SIGTERM)
}

func Error(msg string) {
	ExitNow(1, func() {
		slog.Red(msg)
	})
}

func ErrorCantConnectToMaster() {
	slog.StdErrorString("Can't connect to master. Run {yellow}zeus start{red} first.\r")
}

func ErrorConfigCommandCouldntStart(msg, output string) {
	ExitNow(1, func() {
		slog.Red("Failed to initialize application from {yellow}zeus.json{red}.")
		slog.Red("The json file is valid, but the {yellow}command{red} could not be started:\n\x1b[0m" + output)
	})
}

func ErrorConfigCommandCrashed(output string) {
	ExitNow(1, func() {
		slog.Red("Couldn't boot application. {yellow}command{red} terminated with this output:")
		fmt.Println(output)
	})
}

// The config file is loaded before any goroutines are launched that require cleanup,
// and our exitNow goroutine has not been spawned yet, so we will just explicitly exit
// in the json-related errors..
func ErrorConfigFileInvalidJson() {
	if slog.Red("The config file {yellow}zeus.json{red} contains invalid JSON and could not be parsed.") {
		os.Exit(1)
	}
}

func ErrorConfigFileInvalidFormat() {
	if slog.Red("The config file {yellow}zeus.json{red} is not in the correct format.") {
		os.Exit(1)
	}
}

func ErrorCantCreateListener() {
	ExitNow(1, func() {
		slog.Red("It looks like Zeus is already running. If not, remove {yellow}.zeus.sock{red} and try again.")
	})
}

func ErrorUnableToAcceptSocketConnection() {
	slog.Red("Unable to accept socket connection.")
}


text:
<?php
/**
 * Отображение для create:
 *
 *   @category YupeView
 *   @package  yupe
 *   @author   Yupe Team <team@yupe.ru>
 *   @license  https://github.com/yupe/yupe/blob/master/LICENSE BSD
 *   @link     http://yupe.ru
 **/
$this->breadcrumbs = [
    $this->getModule()->getCategory() => [],
    Yii::t('AdvertisingModule.advertising', 'Скидки') => ['/advertising/advertisingSaleBackend/index'],
    Yii::t('AdvertisingModule.advertising', 'Добавление'),
];

$this->pageTitle = Yii::t('AdvertisingModule.advertising', 'Скидки - добавление');

$this->menu = [
    ['icon' => 'fa fa-fw fa-list-alt', 'label' => Yii::t('AdvertisingModule.advertising', 'Управление скидками'), 'url' => ['/advertising/advertisingSaleBackend/index']],
    ['icon' => 'fa fa-fw fa-plus-square', 'label' => Yii::t('AdvertisingModule.advertising', 'Добавить скидку'), 'url' => ['/advertising/advertisingSaleBackend/create']],
];
?>

        <?php echo Yii::t('AdvertisingModule.advertising', 'Скидки'); ?>
        <?php echo Yii::t('AdvertisingModule.advertising', 'добавление'); ?>

<?php echo $this->renderPartial('_form', ['model' => $model]); ?>


text:
using namespace std;
using namespace Meshing;
using namespace Geometry;

MultiVolumeGrid::MultiVolumeGrid()
{
  channelNames.push_back("value");
  channels.resize(1);
}

void MultiVolumeGrid::AddChannel(const std::string& name)
{
  channelNames.push_back(name);
  channels.resize(channels.size()+1);
  if(channels.size() > 1)
    channels.back().MakeSimilar(channels[0]);
}

void MultiVolumeGrid::SetChannelName(int channel,const std::string& name)
{
  channelNames[channel] = name;
}

int MultiVolumeGrid::GetChannel(const std::string& name) const
{
  auto i=find(channelNames.begin(),channelNames.end(),name);
  if(i==channelNames.end()) return -1;
  return i-channelNames.begin();
}

void MultiVolumeGrid::Resize(int m,int n,int p)
{
  for(size_t i=0;i<channels.size();i++)
    channels[i].Resize(m,n,p);
}

void MultiVolumeGrid::ResizeByResolution(const Vector3& res)
{
  for(size_t i=0;i<channels.size();i++)
    channels[i].ResizeByResolution(res);
}

void MultiVolumeGrid::MakeSimilar(const MultiVolumeGrid& grid)
{
  channelNames = grid.channelNames;
  channels.resize(grid.channels.size());
  for(size_t i=0;i<channels.size();i++)
    channels[i].MakeSimilar(grid.channels[i]);
}
bool MultiVolumeGrid::IsSimilar(const MultiVolumeGrid& grid) const
{
  if(channels.size() != grid.channels.size()) return false;
  for(size_t i=0;i<channels.size();i++)
    if(!channels[i].IsSimilar(grid.channels[i])) return false;
  return true;
}

void MultiVolumeGrid::GetValue(const IntTriple& index,Vector& values) const
{
  ///TODO: make this a little faster by precomputing array offset?
  values.resize(channels.size());
  for(size_t i=0;i<channels.size();i++)
    values[i] = channels[i].value(index);
}

void MultiVolumeGrid::GetValue(const Vector3& pt,Vector& values) const
{
  IntTriple index;
  channels[0].GetIndex(pt,index);
  GetValue(index,values);
}

void MultiVolumeGrid::SetValue(const IntTriple& index,const Vector& values)
{
  Assert(values.size()==(int)channels.size());
  for(size_t i=0;i<channels.size();i++)
    channels[i].value(index) = values[i];
}

void MultiVolumeGrid::SetValue(const Vector3& pt,const Vector& values)
{
  IntTriple index;
  channels[0].GetIndex(pt,index);
  SetValue(index,values);
}

void MultiVolumeGrid::TrilinearInterpolate(const Vector3& pt,Vector& values) const
{
  ///TODO: make this a little faster by precomputing interpolation parameters?
  values.resize(channels.size());
  for(size_t i=0;i<channels.size();i++)
    values[i] = channels[i].TrilinearInterpolate(pt);
}

void MultiVolumeGrid::ResampleTrilinear(const MultiVolumeGrid& grid)
{
  channelNames = grid.channelNames;
  channels.resize(grid.channels.size());
  for(size_t i=1;i<channels.size();i++)
    channels[i].MakeSimilar(channels[0]);
  for(size_t i=0;i<channels.size();i++)
    channels[i].ResampleTrilinear(grid.channels[i]);
}
void MultiVolumeGrid::ResampleAverage(const MultiVolumeGrid& grid)
{
  channelNames = grid.channelNames;
  channels.resize(grid.channels.size());
  for(size_t i=1;i<channels.size();i++)
    channels[i].MakeSimilar(channels[0]);
  for(size_t i=0;i<channels.size();i++)
    channels[i].ResampleAverage(grid.channels[i]);
}


text:
layout: post
title: "5by5 Radio App"
date: 2012-05-16 10:59
comments: true
external-url: http://itunes.apple.com/us/app/5by5-radio/id520847556?mt=8
categories: blog
---

It's quite obvious from my [Recommended page][1] that I'm a big fan of [Dan Benjamin's][2] [5by5 Network][3] of podcasts. On any given work day, I typically have the [5by5 Live Stream][4] running in the background while I bang away in Xcode.

The recently released [5by5 Radio App][5] enhances the live listening experience by providing easy access to the live broadcast schedule and in-app notifications for when shows are going live.  During off-air moments, the app streams prior episodes via the "Best of 5by5" feed.

Highly recommended!

[1]: /recommended
[2]: http://danbenjamin.com
[3]: http://5by5.tv
[4]: http://5by5.fm
[5]: http://itunes.apple.com/us/app/5by5-radio/id520847556?mt=8


text:
    (XB).setRandom(); ref = (XB); \
    (TRI).solveInPlace(XB); \
    VERIFY_IS_APPROX((TRI).toDenseMatrix() * (XB), ref); \
    (XB).setRandom(); ref = (XB); \
    (XB) = (TRI).solve(XB); \
    VERIFY_IS_APPROX((TRI).toDenseMatrix() * (XB), ref); \
  }

#define VERIFY_TRSM_ONTHERIGHT(TRI,XB) { \
    (XB).setRandom(); ref = (XB); \
    (TRI).transpose().template solveInPlace<OnTheRight>(XB.transpose()); \
    VERIFY_IS_APPROX((XB).transpose() * (TRI).transpose().toDenseMatrix(), ref.transpose()); \
    (XB).setRandom(); ref = (XB); \
    (XB).transpose() = (TRI).transpose().template solve<OnTheRight>(XB.transpose()); \
    VERIFY_IS_APPROX((XB).transpose() * (TRI).transpose().toDenseMatrix(), ref.transpose()); \
  }

template<typename Scalar,int Size, int Cols> void trsolve(int size=Size,int cols=Cols)
{
  typedef typename NumTraits<Scalar>::Real RealScalar;

  Matrix<Scalar,Size,Size,ColMajor> cmLhs(size,size);
  Matrix<Scalar,Size,Size,RowMajor> rmLhs(size,size);

  enum {  colmajor = Size==1 ? RowMajor : ColMajor,
          rowmajor = Cols==1 ? ColMajor : RowMajor };
  Matrix<Scalar,Size,Cols,colmajor> cmRhs(size,cols);
  Matrix<Scalar,Size,Cols,rowmajor> rmRhs(size,cols);
  Matrix<Scalar,Dynamic,Dynamic,colmajor> ref(size,cols);

  cmLhs.setRandom(); cmLhs *= static_cast<RealScalar>(0.1); cmLhs.diagonal().array() += static_cast<RealScalar>(1);
  rmLhs.setRandom(); rmLhs *= static_cast<RealScalar>(0.1); rmLhs.diagonal().array() += static_cast<RealScalar>(1);

  VERIFY_TRSM(cmLhs.conjugate().template triangularView<Lower>(), cmRhs);
  VERIFY_TRSM(cmLhs.adjoint()  .template triangularView<Lower>(), cmRhs);
  VERIFY_TRSM(cmLhs            .template triangularView<Upper>(), cmRhs);
  VERIFY_TRSM(cmLhs            .template triangularView<Lower>(), rmRhs);
  VERIFY_TRSM(cmLhs.conjugate().template triangularView<Upper>(), rmRhs);
  VERIFY_TRSM(cmLhs.adjoint()  .template triangularView<Upper>(), rmRhs);

  VERIFY_TRSM(cmLhs.conjugate().template triangularView<UnitLower>(), cmRhs);
  VERIFY_TRSM(cmLhs            .template triangularView<UnitUpper>(), rmRhs);

  VERIFY_TRSM(rmLhs            .template triangularView<Lower>(), cmRhs);
  VERIFY_TRSM(rmLhs.conjugate().template triangularView<UnitUpper>(), rmRhs);

  VERIFY_TRSM_ONTHERIGHT(cmLhs.conjugate().template triangularView<Lower>(), cmRhs);
  VERIFY_TRSM_ONTHERIGHT(cmLhs            .template triangularView<Upper>(), cmRhs);
  VERIFY_TRSM_ONTHERIGHT(cmLhs            .template triangularView<Lower>(), rmRhs);
  VERIFY_TRSM_ONTHERIGHT(cmLhs.conjugate().template triangularView<Upper>(), rmRhs);

  VERIFY_TRSM_ONTHERIGHT(cmLhs.conjugate().template triangularView<UnitLower>(), cmRhs);
  VERIFY_TRSM_ONTHERIGHT(cmLhs            .template triangularView<UnitUpper>(), rmRhs);

  VERIFY_TRSM_ONTHERIGHT(rmLhs            .template triangularView<Lower>(), cmRhs);
  VERIFY_TRSM_ONTHERIGHT(rmLhs.conjugate().template triangularView<UnitUpper>(), rmRhs);

  int c = internal::random<int>(0,cols-1);
  VERIFY_TRSM(rmLhs.template triangularView<Lower>(), rmRhs.col(c));
  VERIFY_TRSM(cmLhs.template triangularView<Lower>(), rmRhs.col(c));
}

void test_product_trsolve()
{
  for(int i = 0; i < g_repeat ; i++)
  {
    // matrices
    CALL_SUBTEST_1((trsolve<float,Dynamic,Dynamic>(internal::random<int>(1,320),internal::random<int>(1,320))));
    CALL_SUBTEST_2((trsolve<double,Dynamic,Dynamic>(internal::random<int>(1,320),internal::random<int>(1,320))));
    CALL_SUBTEST_3((trsolve<std::complex<float>,Dynamic,Dynamic>(internal::random<int>(1,200),internal::random<int>(1,200))));
    CALL_SUBTEST_4((trsolve<std::complex<double>,Dynamic,Dynamic>(internal::random<int>(1,200),internal::random<int>(1,200))));

    // vectors
    CALL_SUBTEST_1((trsolve<float,Dynamic,1>(internal::random<int>(1,320))));
    CALL_SUBTEST_5((trsolve<std::complex<double>,Dynamic,1>(internal::random<int>(1,320))));
    CALL_SUBTEST_6((trsolve<float,1,1>()));
    CALL_SUBTEST_7((trsolve<float,1,2>()));
    CALL_SUBTEST_8((trsolve<std::complex<float>,4,1>()));
  }
}


text:
var path = require('path');
var fs = require('fs');

//try to detect if user is using a custom scripts version
var custom_scripts = process.env.REACT_SCRIPTS_VERSION || false;
const cs_index = process.argv.indexOf('--scripts-version');

if (cs_index > -1 && cs_index + 1 <= process.argv.length) {
  custom_scripts = process.argv[cs_index + 1];
}

//Allow custom overrides package location
const projectDir = path.resolve(fs.realpathSync(process.cwd()));
const customPath = require(path.resolve(projectDir, 'package.json'))['config-overrides-path'];
var config_overrides = customPath
  ? `${ projectDir }/${ customPath }`
  : `${ projectDir }/config-overrides`;
const co_index = process.argv.indexOf('--config-overrides');

var has_co_argument = false;
if (co_index > -1 && co_index + 1 <= process.argv.length) {
  has_co_argument = true;
  config_overrides = path.resolve(process.argv[co_index + 1]);
}

const scriptVersion = custom_scripts || 'react-scripts';
const modulePath = path.join(
  require.resolve(`${scriptVersion}/package.json`),
  '..'
);

const paths = require(modulePath + '/config/paths');

module.exports = Object.assign({
  scriptVersion: modulePath,
  configOverrides: config_overrides,
  customScriptsIndex: (custom_scripts ? cs_index : -1),
  configOverridesIndex: (has_co_argument ? co_index : -1),
}, paths);


text:
using System;
using System.Drawing;
using System.Windows.Forms;
using Zutatensuppe.DiabloInterface.Lib.Plugin;

namespace Zutatensuppe.DiabloInterface.Plugin.Updater
{
    class ConfigEditRenderer : IPluginConfigEditRenderer
    {
        private GroupBox control;
        private CheckBox chkEnabled;

        Plugin plugin;

        public ConfigEditRenderer(Plugin plugin)
        {
            this.plugin = plugin;
        }

        public void ApplyChanges()
        {
        }

        public void ApplyConfig()
        {
            if (control.InvokeRequired)
            {
                control.Invoke((Action)(() => ApplyConfig()));
                return;
            }

            chkEnabled.Checked = plugin.Config.Enabled;
        }

        public Control CreateControl()
        {
            var btnCheck = new Button();
            btnCheck.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            btnCheck.Location = new Point(6, 42);
            btnCheck.Size = new Size(265, 23);
            btnCheck.Text = "Check for updates now";
            btnCheck.Click += new EventHandler(CheckUpdatesButton_Click);

            chkEnabled = new CheckBox();
            chkEnabled.AutoSize = true;
            chkEnabled.Location = new Point(10, 19);
            chkEnabled.Size = new Size(148, 17);
            chkEnabled.Text = "Check for updates at start";

            control = new GroupBox();
            control.SuspendLayout();
            control.Controls.Add(btnCheck);
            control.Controls.Add(chkEnabled);
            control.Location = new Point(0, 0);
            control.Margin = new Padding(0);
            control.Size = new Size(277, 70);
            control.Text = "Updates";
            control.ResumeLayout(false);
            control.PerformLayout();
            return control;
        }

        public IPluginConfig GetEditedConfig()
        {
            var conf = new Config();
            conf.Enabled = chkEnabled.Checked;
            return conf;
        }

        public bool IsDirty()
        {
            return plugin.Config.Enabled != chkEnabled.Checked;
        }

        private void CheckUpdatesButton_Click(object sender, EventArgs e)
        {
            plugin.ManuallyCheckVersion();
        }
    }
}


text:
<?php
/**
 * @file
 * Template for a single column layout.
 *
 * Variables:
 * - $title: The page title, for use in the actual HTML content.
 * - $messages: Status and error messages. Should be displayed prominently.
 * - $tabs: Tabs linking to any sub-pages beneath the current page
 *   (e.g., the view and edit tabs when displaying a node).
 * - $action_links: Array of actions local to the page, such as 'Add menu' on
 *   the menu administration interface.
 * - $classes: Array of classes to be added to the layout wrapper.
 * - $attributes: Additional attributes to be added to the layout wrapper.
 * - $content: An array of content, each item in the array is keyed to one
 *   region of the layout. This layout supports the following sections:
 *   - $content['header']
 *   - $content['top']
 *   - $content['content']
 *   - $content['footer']
 */
?>
<div class="layout--one-column <?php print implode(' ', $classes); ?>"<?php print backdrop_attributes($attributes); ?>>

    <?php print t('Skip to main content'); ?>

  <?php if ($content['header']): ?>
    <header class="l-header" role="banner" aria-label="<?php print t('Site header'); ?>">
      <?php print $content['header']; ?>

  <?php endif; ?>

  <?php if ($content['top']): ?>

      <?php print $content['top']; ?>

  <?php endif; ?>

  <?php if ($messages): ?>

      <?php print $messages; ?>

  <?php endif; ?>

      <?php print render($title_prefix); ?>
      <?php if ($is_front): ?>

          The Wedding of
          Wes Ruvalcaba
          &
          Katie Barron

      <?php elseif ($title): ?>

          <?php print $title; ?>

      <?php endif; ?>
      <?php print render($title_suffix); ?>

      <?php if ($tabs): ?>

          <?php print $tabs; ?>

      <?php endif; ?>

      <?php print $action_links; ?>
      <?php print $content['content']; ?>

  <?php if ($content['footer']): ?>

      <?php print $content['footer']; ?>

  <?php endif; ?>


text:
// This file is automatically generated.

package adila.db;

/*
 * HTC Desire 530
 *
 * DEVICE: htc_a16ul
 * MODEL: HTC Desire 530
 */
final class htc5fa16ul_htc20desire20530 {
    public static final String DATA = "HTC|Desire 530|";
}


text:
var cm = Packages.net.canarymod;
var cmRecipe = cm.api.inventory.recipes.CraftingRecipe;
var cmRecipeRow = cm.api.inventory.recipes.RecipeRow;

function addRecipe(recipe) {
  return server.addRecipe(createRecipe(recipe));
}
function createRecipe(recipe) {
  if (!recipe) {
    return null;
  }
  var result, rows, i, j, cells, rr;
  if (recipe.shape) {
    rows = [];
    for (i = 0; i < recipe.shape.length; i++) {
      cells = recipe.shape[i].split('');
      rr = [];
      for (j = 0; j < cells.length; j++) {
        if (cells[j] != ' ') {
          rr.push(recipe.ingredients[cells[j]]);
        }
      }
      rows.push(new cmRecipeRow(recipe.shape[i], rr));
    }
    /*
      wph 20150607 short-term workaround for nashorn defect
      https://bugs.openjdk.java.net/browse/JDK-8072596
    */
    if (typeof Java !== 'undefined' && typeof Java.type === 'function') {
      var RecipeRowArrayType = Java.type(
        'net.canarymod.api.inventory.recipes.RecipeRow[]'
      );
      rows = Java.to(rows, RecipeRowArrayType);
    }
    result = cmRecipe.createShapedRecipe(recipe.result, rows);
  } else {
    result = cmRecipe.createShapelessRecipe(recipe.result, recipe.ingredients);
  }
  return result;
}
function removeRecipe(recipe) {
  server.removeRecipe(recipe);
}
exports.create = createRecipe;
exports.add = addRecipe;
exports.remove = removeRecipe;


text:
<!DOCTYPE html>

    <link href="css/awsdocs.css" rel="stylesheet" type="text/css">

    <meta charset="utf-8">

AWS::Glue::DevEndpoint

The
                        AWS::Glue::DevEndpoint resource specifies a development endpoint where a developer can remotely debug ETL
                        scripts for AWS Glue. For more information, see
                        DevEndpoint Structure in the
                        AWS Glue Developer Guide.

Topics

Syntax

Properties

See Also

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{
  "Type" : "AWS::Glue::DevEndpoint",
  "Properties" : {
    "EndpointName" : String,
    "ExtraJarsS3Path" : String,
    "ExtraPythonLibsS3Path" : String,
    "NumberOfNodes" : Integer,
    "PublicKey" : String,
    "RoleArn" : String,
    "SecurityGroupIds" : [ String, ... ],
    "SubnetId" : String
  }
}

YAML

Type: AWS::Glue::DevEndpoint
Properties:
  EndpointName: String
  ExtraJarsS3Path: String
  ExtraPythonLibsS3Path: String
  NumberOfNodes: Integer
  PublicKey: String
  RoleArn: String
  SecurityGroupIds:
    - String
  SubnetId: String

Properties

EndpointName

The name of the endpoint.

                                 Required: No

                                 Type: String

                                 Update requires:
                                 Replacement

ExtraJarsS3Path

The path to one or more Java Jars in an Amazon S3 bucket to load in your endpoint.

Note

You can
                                    currently use
                                    only
                                    pure Java/Scala libraries
                                    on
                                    a DevEndpoint.

                                 Required: No

                                 Type: String

                                 Update requires:
                                 No interruption

ExtraPythonLibsS3Path

The path to one or more Python libraries in an Amazon S3 bucket to load in your endpoint.

Note

You can
                                    currently use
                                    only
                                    pure Python libraries
                                    on
                                    a DevEndpoint. Libraries that rely on C extensions, such as the pandas Python data analysis library, aren't
                                    supported
                                    yet.

                                 Required: No

                                 Type: String

                                 Update requires:
                                 No interruption

NumberOfNodes

The number of nodes that the endpoint uses.

                                 Required: No

                                 Type: Integer

                                 Update requires:
                                 No interruption

PublicKey

The public key for the endpoint to use for authentication.

                                 Required: Yes

                                 Type: String

                                 Update requires:
                                 No interruption

RoleArn

The Amazon Resource Name (ARN) of the IAM role for the endpoint.
                                 It
                                 must
                                 match the AWS ARN string pattern: arn:aws:iam::\d{12}:role/.*

                                 Required: Yes

                                 Type: String

                                 Update requires:
                                 No interruption

SecurityGroupIds

A list of UTF-8 strings that specify the security group IDs for the endpoint.

                                 Required: No

                                 Type: List of
                                 String
                                 values

                                 Update requires:
                                 No interruption

SubnetId

The subnet ID for the endpoint.

                                 Required: No

                                 Type: String

                                 Update requires:
                                 No interruption

See Also

DevEndpoint Structure in the
                                 AWS Glue Developer Guide


text:
package java.awt;

import java.util.Vector;
import java.awt.peer.SystemTrayPeer;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import sun.awt.AppContext;
import sun.awt.SunToolkit;
import sun.awt.HeadlessToolkit;
import sun.security.util.SecurityConstants;
import sun.awt.AWTAccessor;

/**
 * The SystemTray class represents the system tray for a
 * desktop.  On Microsoft Windows it is referred to as the "Taskbar
 * Status Area", on Gnome it is referred to as the "Notification
 * Area", on KDE it is referred to as the "System Tray".  The system
 * tray is shared by all applications running on the desktop.
 *
 *
 On some platforms the system tray may not be present or may not
 * be supported, in this case {@link SystemTray#getSystemTray()}
 * throws {@link UnsupportedOperationException}.  To detect whether the
 * system tray is supported, use {@link SystemTray#isSupported}.
 *
 *
The SystemTray may contain one or more {@link
 * TrayIcon TrayIcons}, which are added to the tray using the {@link
 * #add} method, and removed when no longer needed, using the
 * {@link #remove}.  TrayIcon consists of an
 * image, a popup menu and a set of associated listeners.  Please see
 * the {@link TrayIcon} class for details.
 *
 *
Every Java application has a single SystemTray
 * instance that allows the app to interface with the system tray of
 * the desktop while the app is running.  The SystemTray
 * instance can be obtained from the {@link #getSystemTray} method.
 * An application may not create its own instance of
 * SystemTray.
 *
 *
The following code snippet demonstrates how to access
 * and customize the system tray:
 *

 *
 *     {@link TrayIcon} trayIcon = null;
 *     if (SystemTray.isSupported()) {
 *         // get the SystemTray instance
 *         SystemTray tray = SystemTray.{@link #getSystemTray};
 *         // load an image
 *         {@link java.awt.Image} image = {@link java.awt.Toolkit#getImage(String) Toolkit.getDefaultToolkit().getImage}(...);
 *         // create a action listener to listen for default action executed on the tray icon
 *         {@link java.awt.event.ActionListener} listener = new {@link java.awt.event.ActionListener ActionListener}() {
 *             public void {@link java.awt.event.ActionListener#actionPerformed actionPerformed}({@link java.awt.event.ActionEvent} e) {
 *                 // execute default action of the application
 *                 // ...
 *             }
 *         };
 *         // create a popup menu
 *         {@link java.awt.PopupMenu} popup = new {@link java.awt.PopupMenu#PopupMenu PopupMenu}();
 *         // create menu item for the default action
 *         MenuItem defaultItem = new MenuItem(...);
 *         defaultItem.addActionListener(listener);
 *         popup.add(defaultItem);
 *         /// ... add other items
 *         // construct a TrayIcon
 *         trayIcon = new {@link TrayIcon#TrayIcon(java.awt.Image, String, java.awt.PopupMenu) TrayIcon}(image, "Tray Demo", popup);
 *         // set the TrayIcon properties
 *         trayIcon.{@link TrayIcon#addActionListener(java.awt.event.ActionListener) addActionListener}(listener);
 *         // ...
 *         // add the tray image
 *         try {
 *             tray.{@link SystemTray#add(TrayIcon) add}(trayIcon);
 *         } catch (AWTException e) {
 *             System.err.println(e);
 *         }
 *         // ...
 *     } else {
 *         // disable tray option in your application or
 *         // perform other actions
 *         ...
 *     }
 *     // ...
 *     // some time later
 *     // the application state has changed - update the image
 *     if (trayIcon != null) {
 *         trayIcon.{@link TrayIcon#setImage(java.awt.Image) setImage}(updatedImage);
 *     }
 *     // ...
 *
 *

 *
 * @since 1.6
 * @see TrayIcon
 *
 * @author Bino George
 * @author Denis Mikhalkin
 * @author Sharon Zakhour
 * @author Anton Tarasov
 */
public class SystemTray {
    private static SystemTray systemTray;
    private int currentIconID = 0; // each TrayIcon added gets a unique ID

    transient private SystemTrayPeer peer;

    private static final TrayIcon[] EMPTY_TRAY_ARRAY = new TrayIcon[0];

    static {
        AWTAccessor.setSystemTrayAccessor(
            new AWTAccessor.SystemTrayAccessor() {
                public void firePropertyChange(SystemTray tray,
                                               String propertyName,
                                               Object oldValue,
                                               Object newValue) {
                    tray.firePropertyChange(propertyName, oldValue, newValue);
                }
            });
    }

    /**
     * Private SystemTray constructor.
     *
     */
    private SystemTray() {
        addNotify();
    }

    /**
     * Gets the SystemTray instance that represents the
     * desktop's tray area.  This always returns the same instance per
     * application.  On some platforms the system tray may not be
     * supported.  You may use the {@link #isSupported} method to
     * check if the system tray is supported.
     *
     *
If a SecurityManager is installed, the AWTPermission
     * {@code accessSystemTray} must be granted in order to get the
     * {@code SystemTray} instance. Otherwise this method will throw a
     * SecurityException.
     *
     * @return the SystemTray instance that represents
     * the desktop's tray area
     * @throws UnsupportedOperationException if the system tray isn't
     * supported by the current platform
     * @throws HeadlessException if
     * GraphicsEnvironment.isHeadless() returns true
     * @throws SecurityException if {@code accessSystemTray} permission
     * is not granted
     * @see #add(TrayIcon)
     * @see TrayIcon
     * @see #isSupported
     * @see SecurityManager#checkPermission
     * @see AWTPermission
     */
    public static SystemTray getSystemTray() {
        checkSystemTrayAllowed();
        if (GraphicsEnvironment.isHeadless()) {
            throw new HeadlessException();
        }

        initializeSystemTrayIfNeeded();

        if (!isSupported()) {
            throw new UnsupportedOperationException(
                "The system tray is not supported on the current platform.");
        }

        return systemTray;
    }

    /**
     * Returns whether the system tray is supported on the current
     * platform.  In addition to displaying the tray icon, minimal
     * system tray support includes either a popup menu (see {@link
     * TrayIcon#setPopupMenu(PopupMenu)}) or an action event (see
     * {@link TrayIcon#addActionListener(ActionListener)}).
     *
     *
Developers should not assume that all of the system tray
     * functionality is supported.  To guarantee that the tray icon's
     * default action is always accessible, add the default action to
     * both the action listener and the popup menu.  See the {@link
     * SystemTray example} for an example of how to do this.
     *
     *
Note: When implementing SystemTray and
     * TrayIcon it is strongly recommended that
     * you assign different gestures to the popup menu and an action
     * event.  Overloading a gesture for both purposes is confusing
     * and may prevent the user from accessing one or the other.
     *
     * @see #getSystemTray
     * @return false if no system tray access is supported; this
     * method returns true if the minimal system tray access is
     * supported but does not guarantee that all system tray
     * functionality is supported for the current platform
     */
    public static boolean isSupported() {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        if (toolkit instanceof SunToolkit) {
            // connecting tray to native resource
            initializeSystemTrayIfNeeded();
            return ((SunToolkit)toolkit).isTraySupported();
        } else if (toolkit instanceof HeadlessToolkit) {
            // skip initialization as the init routine
            // throws HeadlessException
            return ((HeadlessToolkit)toolkit).isTraySupported();
        } else {
            return false;
        }
    }

    /**
     * Adds a TrayIcon to the SystemTray.
     * The tray icon becomes visible in the system tray once it is
     * added.  The order in which icons are displayed in a tray is not
     * specified - it is platform and implementation-dependent.
     *
     *
 All icons added by the application are automatically
     * removed from the SystemTray upon application exit
     * and also when the desktop system tray becomes unavailable.
     *
     * @param trayIcon the TrayIcon to be added
     * @throws NullPointerException if trayIcon is
     * null
     * @throws IllegalArgumentException if the same instance of
     * a TrayIcon is added more than once
     * @throws AWTException if the desktop system tray is missing
     * @see #remove(TrayIcon)
     * @see #getSystemTray
     * @see TrayIcon
     * @see java.awt.Image
     */
    public void add(TrayIcon trayIcon) throws AWTException {
        if (trayIcon == null) {
            throw new NullPointerException("adding null TrayIcon");
        }
        TrayIcon[] oldArray = null, newArray = null;
        Vector<TrayIcon> icons = null;
        synchronized (this) {
            oldArray = systemTray.getTrayIcons();
            icons = (Vector<TrayIcon>)AppContext.getAppContext().get(TrayIcon.class);
            if (icons == null) {
                icons = new Vector<TrayIcon>(3);
                AppContext.getAppContext().put(TrayIcon.class, icons);

            } else if (icons.contains(trayIcon)) {
                throw new IllegalArgumentException("adding TrayIcon that is already added");
            }
            icons.add(trayIcon);
            newArray = systemTray.getTrayIcons();

            trayIcon.setID(++currentIconID);
        }
        try {
            trayIcon.addNotify();
        } catch (AWTException e) {
            icons.remove(trayIcon);
            throw e;
        }
        firePropertyChange("trayIcons", oldArray, newArray);
    }

    /**
     * Removes the specified TrayIcon from the
     * SystemTray.
     *
     *
 All icons added by the application are automatically
     * removed from the SystemTray upon application exit
     * and also when the desktop system tray becomes unavailable.
     *
     *
 If trayIcon is null or was not
     * added to the system tray, no exception is thrown and no action
     * is performed.
     *
     * @param trayIcon the TrayIcon to be removed
     * @see #add(TrayIcon)
     * @see TrayIcon
     */
    public void remove(TrayIcon trayIcon) {
        if (trayIcon == null) {
            return;
        }
        TrayIcon[] oldArray = null, newArray = null;
        synchronized (this) {
            oldArray = systemTray.getTrayIcons();
            Vector<TrayIcon> icons = (Vector<TrayIcon>)AppContext.getAppContext().get(TrayIcon.class);
            // TrayIcon with no peer is not contained in the array.
            if (icons == null || !icons.remove(trayIcon)) {
                return;
            }
            trayIcon.removeNotify();
            newArray = systemTray.getTrayIcons();
        }
        firePropertyChange("trayIcons", oldArray, newArray);
    }

    /**
     * Returns an array of all icons added to the tray by this
     * application.  You can't access the icons added by another
     * application.  Some browsers partition applets in different
     * code bases into separate contexts, and establish walls between
     * these contexts.  In such a scenario, only the tray icons added
     * from this context will be returned.
     *
     *
 The returned array is a copy of the actual array and may be
     * modified in any way without affecting the system tray.  To
     * remove a TrayIcon from the
     * SystemTray, use the {@link
     * #remove(TrayIcon)} method.
     *
     * @return an array of all tray icons added to this tray, or an
     * empty array if none has been added
     * @see #add(TrayIcon)
     * @see TrayIcon
     */
    public TrayIcon[] getTrayIcons() {
        Vector<TrayIcon> icons = (Vector<TrayIcon>)AppContext.getAppContext().get(TrayIcon.class);
        if (icons != null) {
            return (TrayIcon[])icons.toArray(new TrayIcon[icons.size()]);
        }
        return EMPTY_TRAY_ARRAY;
    }

    /**
     * Returns the size, in pixels, of the space that a tray icon will
     * occupy in the system tray.  Developers may use this methods to
     * acquire the preferred size for the image property of a tray icon
     * before it is created.  For convenience, there is a similar
     * method {@link TrayIcon#getSize} in the TrayIcon class.
     *
     * @return the default size of a tray icon, in pixels
     * @see TrayIcon#setImageAutoSize(boolean)
     * @see java.awt.Image
     * @see TrayIcon#getSize()
     */
    public Dimension getTrayIconSize() {
        return peer.getTrayIconSize();
    }

    /**
     * Adds a {@code PropertyChangeListener} to the list of listeners for the
     * specific property. The following properties are currently supported:
     *
     *

     *

     *    Property
     *    Description
     *

     *

     *    {@code trayIcons}
     *    The {@code SystemTray}'s array of {@code TrayIcon} objects.
     *        The array is accessed via the {@link #getTrayIcons} method.

     *        This property is changed when a tray icon is added to (or removed
     *        from) the system tray.
 For example, this property is changed
     *        when the system tray becomes unavailable on the desktop

     *        and the tray icons are automatically removed.
     *

     *

     *    {@code systemTray}
     *    This property contains {@code SystemTray} instance when the system tray
     *        is available or null otherwise.
 This property is changed
     *        when the system tray becomes available or unavailable on the desktop.

     *        The property is accessed by the {@link #getSystemTray} method.
     *

     *

     *

     * The {@code listener} listens to property changes only in this context.
     *

     * If {@code listener} is {@code null}, no exception is thrown
     * and no action is performed.
     *
     * @param propertyName the specified property
     * @param listener the property change listener to be added
     *
     * @see #removePropertyChangeListener
     * @see #getPropertyChangeListeners
     */
    public synchronized void addPropertyChangeListener(String propertyName,
                                                       PropertyChangeListener listener)
    {
        if (listener == null) {
            return;
        }
        getCurrentChangeSupport().addPropertyChangeListener(propertyName, listener);
    }

    /**
     * Removes a {@code PropertyChangeListener} from the listener list
     * for a specific property.
     *

     * The {@code PropertyChangeListener} must be from this context.
     *

     * If {@code propertyName} or {@code listener} is {@code null} or invalid,
     * no exception is thrown and no action is taken.
     *
     * @param propertyName the specified property
     * @param listener the PropertyChangeListener to be removed
     *
     * @see #addPropertyChangeListener
     * @see #getPropertyChangeListeners
     */
    public synchronized void removePropertyChangeListener(String propertyName,
                                                          PropertyChangeListener listener)
    {
        if (listener == null) {
            return;
        }
        getCurrentChangeSupport().removePropertyChangeListener(propertyName, listener);
    }

    /**
     * Returns an array of all the listeners that have been associated
     * with the named property.
     *

     * Only the listeners in this context are returned.
     *
     * @param propertyName the specified property
     * @return all of the {@code PropertyChangeListener}s associated with
     *         the named property; if no such listeners have been added or
     *         if {@code propertyName} is {@code null} or invalid, an empty
     *         array is returned
     *
     * @see #addPropertyChangeListener
     * @see #removePropertyChangeListener
     */
    public synchronized PropertyChangeListener[] getPropertyChangeListeners(String propertyName) {
        return getCurrentChangeSupport().getPropertyChangeListeners(propertyName);
    }

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

    /**
     * Support for reporting bound property changes for Object properties.
     * This method can be called when a bound property has changed and it will
     * send the appropriate PropertyChangeEvent to any registered
     * PropertyChangeListeners.
     *
     * @param propertyName the property whose value has changed
     * @param oldValue the property's previous value
     * @param newValue the property's new value
     */
    private void firePropertyChange(String propertyName,
                                    Object oldValue, Object newValue)
    {
        if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
            return;
        }
        getCurrentChangeSupport().firePropertyChange(propertyName, oldValue, newValue);
    }

    /**
     * Returns the current PropertyChangeSupport instance for the
     * calling thread's context.
     *
     * @return this thread's context's PropertyChangeSupport
     */
    private synchronized PropertyChangeSupport getCurrentChangeSupport() {
        PropertyChangeSupport changeSupport =
            (PropertyChangeSupport)AppContext.getAppContext().get(SystemTray.class);

        if (changeSupport == null) {
            changeSupport = new PropertyChangeSupport(this);
            AppContext.getAppContext().put(SystemTray.class, changeSupport);
        }
        return changeSupport;
    }

    synchronized void addNotify() {
        if (peer == null) {
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            if (toolkit instanceof SunToolkit) {
                peer = ((SunToolkit)Toolkit.getDefaultToolkit()).createSystemTray(this);
            } else if (toolkit instanceof HeadlessToolkit) {
                peer = ((HeadlessToolkit)Toolkit.getDefaultToolkit()).createSystemTray(this);
            }
        }
    }

    static void checkSystemTrayAllowed() {
        SecurityManager security = System.getSecurityManager();
        if (security != null) {
            security.checkPermission(SecurityConstants.AWT.ACCESS_SYSTEM_TRAY_PERMISSION);
        }
    }

    private static void initializeSystemTrayIfNeeded() {
        synchronized (SystemTray.class) {
            if (systemTray == null) {
                systemTray = new SystemTray();
            }
        }
    }
}


text:
namespace Microsoft.Azure.Management.Sql
{
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Models;
    using System.Collections;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Extension methods for ElasticPoolsOperations.
    /// </summary>
    public static partial class ElasticPoolsOperationsExtensions
    {
            /// <summary>
            /// Returns elastic pool  metrics.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='filter'>
            /// An OData filter expression that describes a subset of metrics to return.
            /// </param>
            public static IEnumerable<Metric> ListMetrics(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, string filter)
            {
                return operations.ListMetricsAsync(resourceGroupName, serverName, elasticPoolName, filter).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Returns elastic pool  metrics.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='filter'>
            /// An OData filter expression that describes a subset of metrics to return.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IEnumerable<Metric>> ListMetricsAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, string filter, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, filter, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Returns elastic pool metric definitions.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            public static IEnumerable<MetricDefinition> ListMetricDefinitions(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName)
            {
                return operations.ListMetricDefinitionsAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Returns elastic pool metric definitions.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IEnumerable<MetricDefinition>> ListMetricDefinitionsAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Gets all elastic pools in a server.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='skip'>
            /// The number of elements in the collection to skip.
            /// </param>
            public static IPage<ElasticPool> ListByServer(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, long? skip = default(long?))
            {
                return operations.ListByServerAsync(resourceGroupName, serverName, skip).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets all elastic pools in a server.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='skip'>
            /// The number of elements in the collection to skip.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<ElasticPool>> ListByServerAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, long? skip = default(long?), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, skip, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Gets an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            public static ElasticPool Get(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName)
            {
                return operations.GetAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ElasticPool> GetAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Creates or updates an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='parameters'>
            /// The elastic pool parameters.
            /// </param>
            public static ElasticPool CreateOrUpdate(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, ElasticPool parameters)
            {
                return operations.CreateOrUpdateAsync(resourceGroupName, serverName, elasticPoolName, parameters).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Creates or updates an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='parameters'>
            /// The elastic pool parameters.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ElasticPool> CreateOrUpdateAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, ElasticPool parameters, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, parameters, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Deletes an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            public static void Delete(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName)
            {
                operations.DeleteAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Deletes an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task DeleteAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Updates an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='parameters'>
            /// The elastic pool update parameters.
            /// </param>
            public static ElasticPool Update(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, ElasticPoolUpdate parameters)
            {
                return operations.UpdateAsync(resourceGroupName, serverName, elasticPoolName, parameters).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Updates an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='parameters'>
            /// The elastic pool update parameters.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ElasticPool> UpdateAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, ElasticPoolUpdate parameters, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, parameters, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Failovers an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool to failover.
            /// </param>
            public static void Failover(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName)
            {
                operations.FailoverAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Failovers an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool to failover.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task FailoverAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.FailoverWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Creates or updates an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='parameters'>
            /// The elastic pool parameters.
            /// </param>
            public static ElasticPool BeginCreateOrUpdate(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, ElasticPool parameters)
            {
                return operations.BeginCreateOrUpdateAsync(resourceGroupName, serverName, elasticPoolName, parameters).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Creates or updates an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='parameters'>
            /// The elastic pool parameters.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ElasticPool> BeginCreateOrUpdateAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, ElasticPool parameters, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, parameters, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Deletes an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            public static void BeginDelete(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName)
            {
                operations.BeginDeleteAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Deletes an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task BeginDeleteAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Updates an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='parameters'>
            /// The elastic pool update parameters.
            /// </param>
            public static ElasticPool BeginUpdate(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, ElasticPoolUpdate parameters)
            {
                return operations.BeginUpdateAsync(resourceGroupName, serverName, elasticPoolName, parameters).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Updates an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool.
            /// </param>
            /// <param name='parameters'>
            /// The elastic pool update parameters.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ElasticPool> BeginUpdateAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, ElasticPoolUpdate parameters, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, parameters, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Failovers an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool to failover.
            /// </param>
            public static void BeginFailover(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName)
            {
                operations.BeginFailoverAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Failovers an elastic pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group that contains the resource. You can obtain
            /// this value from the Azure Resource Manager API or the portal.
            /// </param>
            /// <param name='serverName'>
            /// The name of the server.
            /// </param>
            /// <param name='elasticPoolName'>
            /// The name of the elastic pool to failover.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task BeginFailoverAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Gets all elastic pools in a server.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            public static IPage<ElasticPool> ListByServerNext(this IElasticPoolsOperations operations, string nextPageLink)
            {
                return operations.ListByServerNextAsync(nextPageLink).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets all elastic pools in a server.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<ElasticPool>> ListByServerNextAsync(this IElasticPoolsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListByServerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

    }
}


text:
<?php

namespace QuickUser\Policies;

use QuickUser\User;
use Illuminate\Auth\Access\HandlesAuthorization;

class UserPolicy
{
    use HandlesAuthorization;

    /**
     * Determine whether the user can create models.
     *
     * @param  \QuickUser\User  $user
     * @return mixed
     */
    public function create(User $user)
    {
      return $user->is_admin();
    }

    /**
     * Determine whether the user can update the model.
     *
     * @param  \QuickUser\User  $user
     * @param  \QuickUser\User  $model
     * @return mixed
     */
    public function update(User $user, User $model)
    {
      return $user->is_admin() || $user->id === $model->id;
    }

    /**
     * Determine whether the user can delete the model.
     *
     * @param  \QuickUser\User  $user
     * @param  \QuickUser\User  $model
     * @return mixed
     */
    public function delete(User $user)
    {
      return $user->is_admin();
    }

    /**
     * Determine whether the user can active users
     *
     * @param  \QuickUser\User  $user
     * @return mixed
     */
    public function active_user(User $user)
    {
      return $user->is_admin();
    }

    /**
     * Determine whether the user can disable users
     *
     * @param  \QuickUser\User  $user
     * @return mixed
     */
    public function disable_user(User $user)
    {
      return $user->is_admin();
    }

    /**
     * Determine whether the user can view users list
     *
     * @param  \QuickUser\User  $user
     * @return mixed
     */
    public function access_users_list(User $user)
    {
      return $user->is_admin() || $user->is_agent();
    }
}


text:
<FrameLayout 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"
    tools:context="com.basuritas.www.basuritas.CompartirFragment">

    <!-- TODO: Update blank fragment layout -->
    <TextView android:layout_width="match_parent" android:layout_height="match_parent"
        android:text="@string/denuncias" />

</FrameLayout>


text:
/**
 * tests/api/v1/tokens/associations.js
 */
'use strict';
const supertest = require('supertest');
const api = supertest(require('../../../../express').app);
const constants = require('../../../../api/v1/constants');
const tu = require('../../../testUtils');
const u = require('./utils');
const Token = tu.db.Token;
const User = tu.db.User;
const expect = require('chai').expect;
const Profile = tu.db.Profile;
const path = '/v1/tokens';
const Joi = require('joi');

describe(`tests/api/v1/tokens/associations.js, GET ${path} >`, () => {
  let token;
  const username = `${tu.namePrefix}test@refocus.com`;

  const profile1 = { name: `${tu.namePrefix}testProfile2` };
  const user1 = {
    name: username,
    email: username,
    password: 'user123password',
  };
  const token1 = {
    name: `${tu.namePrefix}token1`,
  };

  before((done) => {
    tu.createUser('testUser')
    .then((user) => {
      token = tu.createTokenFromUserName(user.name);
      done();
    })
    .catch(done);
  });

  before((done) => {
    Profile.create(profile1)
    .then((profile) => {
      user1.profileId = profile.id;
      return User.create(user1);
    })
    .then((user) => {
      token1.createdBy = user.id;
      return Token.create(token1);
    })
    .then(() => done())
    .catch(done);
  });

  after(u.forceDelete);
  after(tu.forceDeleteUser);

  const joiSchema = {
    user: Joi.object().keys({
      id: Joi.string().required(),
      name: Joi.string().required(),
      email: Joi.string().required(),
      profile: Joi.object().keys({
        id: Joi.string().required(),
        name: Joi.string().required(),
      }).required(),
    }),
  };

  it('get by key includes associations', (done) => {
    api.get(`${path}/${token1.name}`)
    .set('Authorization', token)
    .expect(constants.httpStatus.OK)
    .expect((res) => {
      expect(res.body).to.have.property('user');
      expect(Joi.validate(res.body.user, joiSchema.user).error).to.be.null;
    })
    .end(done);
  });

  it('get by key with field param does not include associations', (done) => {
    api.get(`${path}/${token1.name}?fields=name`)
    .set('Authorization', token)
    .expect(constants.httpStatus.OK)
    .expect((res) => {
      expect(res.body).to.not.have.property('user');
    })
    .end(done);
  });

  it(`get by key: an association can be specified as a field param (user)`, (done) => {
    api.get(`${path}/${token1.name}?fields=name,user`)
    .set('Authorization', token)
    .expect(constants.httpStatus.OK)
    .expect((res) => {
      expect(res.body).to.be.an('object');
      expect(res.body).to.have
        .keys('id', 'name', 'user', 'isRevoked', 'apiLinks');
      expect(Joi.validate(res.body.user, joiSchema.user).error).to.be.null;
    })
    .end(done);
  });
});


text:
namespace System.Windows.Forms
{

using System.Runtime.InteropServices;

#if !ECMA_COMPAT && !CONFIG_COMPACT_FORMS
[ComVisible(true)]
#endif
public enum FormWindowState
{
	Normal		= 0,
#if !CONFIG_COMPACT_FORMS
	Minimized	= 1,
#endif
	Maximized	= 2

}; // enum FormWindowState

}; // namespace System.Windows.Forms


text:
<!DOCTYPE html>

  <link href="http://gmpg.org/xfn/11" rel="profile">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta http-equiv="content-type" content="text/html; charset=utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
  <meta name="keywords" content="404: Page not found">
  <meta name="description" content="">
  <meta name="author" content="Reage">
  <title>

      404: Page not found · Reage blog

  </title>

  <link rel="stylesheet" type="text/css" href="/public/css/poole.min.css" />
  <link rel="stylesheet" type="text/css" href="/public/css/lanyon.min.css"/>
  <link rel="stylesheet" type="text/css" href="/public/css/pygment.min.css"/>
  <link rel="stylesheet" type="text/css" href="/public/css/font.min.css"/>
  <link rel="stylesheet" type="text/css" href="/public/css/fontawesome.min.css"/>
  <link rel="stylesheet" type="text/css" href="/public/css/timeline.min.css"/>

  <link rel="shortcut icon" href="/public/favicon.ico"/>

  <link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml"/>

<input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox">

    首页

          关于

          分类

          留言

          文档

          标签

      © Design by Reage

            Reage blog

404: Page not found

404 error

    返回首页